From 1c684aad3c5b368cb1dffa6a7ae8eb701ac243a9 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期四, 27 七月 2023 16:48:55 +0800
Subject: [PATCH] 新增响应措施和修改
---
src/views/Admin/msgReview.vue | 9
src/views/Admin/Report.vue | 9
src/views/Admin/components/userMod.vue | 3
src/views/Admin/reactionManage.vue | 178 +++++++++++++++++
src/views/Admin/components/reactionMod.vue | 150 +++++++++++++++
src/views/Admin/release.vue | 22 -
src/views/Admin/components/msgDetailMod.vue | 20 +
src/router/index.js | 6
src/views/Admin/components/msgEditMod.vue | 30 ++
src/views/Admin/list.vue | 20 +
src/views/Admin/HomeDefault.vue | 2
src/views/Admin/history.vue | 9
src/views/Admin/components/callListMod.vue | 69 ++++++
src/views/Home.vue | 3
src/api/new.js | 46 ++++
src/views/Admin/notice.vue | 9
16 files changed, 529 insertions(+), 56 deletions(-)
diff --git a/src/api/new.js b/src/api/new.js
new file mode 100644
index 0000000..0ca22bd
--- /dev/null
+++ b/src/api/new.js
@@ -0,0 +1,46 @@
+//将拦截器整体导入
+import request from '@/util/request'//导入已经写好的拦截器
+
+// 分页反应措施
+export function getMeasure(data){
+ return request({
+ url: '/response/measure/page',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 新增反应措施
+export function addMeasure(data){
+ return request({
+ url: '/response/measure/add',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 修改反应措施
+export function updateMeasure(data){
+ return request({
+ url: '/response/measure/update',
+ method: 'post',
+ data: data,
+ })
+}
+
+// 删除反应措施
+export function delMeasure(id){
+ return request({
+ url: '/response/measure/deleteById?id=' + id,
+ method: 'get'
+ })
+}
+
+// 根据id获取反应措施
+export function responseMeasure(data){
+ return request({
+ url: '/app/warninfo/responseMeasure/get',
+ method: 'post',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index b764581..2b8b413 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -112,6 +112,12 @@
meta: { title: '短信平台设置' },
component: () => import('@/views/Admin/smsSetting'),
},
+ {
+ path: '/reactionManage',
+ name: 'reactionManage',
+ meta: { title: '响应措施管理' },
+ component: () => import('@/views/Admin/reactionManage'),
+ },
// {
// path: '/menu',
// name: 'menu',
diff --git a/src/views/Admin/HomeDefault.vue b/src/views/Admin/HomeDefault.vue
index 8c3afa9..a17f74e 100644
--- a/src/views/Admin/HomeDefault.vue
+++ b/src/views/Admin/HomeDefault.vue
@@ -33,7 +33,7 @@
<Projecting />
<Dynamic style="margin-top: 20px"/>
</div>
- <div class="left" v-if="userInfo.role.id == 2">
+ <div class="left" v-if="userInfo.role.id == 2 || userInfo.role.id == 4">
<Review />
</div>
<div class="right">
diff --git a/src/views/Admin/Report.vue b/src/views/Admin/Report.vue
index 5588b32..cee7a5b 100644
--- a/src/views/Admin/Report.vue
+++ b/src/views/Admin/Report.vue
@@ -275,10 +275,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachmentName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachmentName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
diff --git a/src/views/Admin/components/callListMod.vue b/src/views/Admin/components/callListMod.vue
index 10b3bec..1a7ab8e 100644
--- a/src/views/Admin/components/callListMod.vue
+++ b/src/views/Admin/components/callListMod.vue
@@ -7,9 +7,13 @@
cancelText="取消"
@cancel="handleCancel"
>
- <a-table :columns="columns" :data-source="data" bordered :pagination="pagination">
+ <a-table :columns="columns" :data-source="data" bordered :pagination="pagination" :rowKey="record=>record.id">
<template #index="text,record,index">
{{ index + 1 }}
+ </template>
+ <template #receiveUnit="name,record">
+ <span v-if="unitType == 3">{{ name }}</span>
+ <span v-else style="cursor: pointer;color: #1890ff" @click="digData(record.forwardWarnInfoId,record.unittype)">{{ name }}</span>
</template>
<template #warningLevel="text">
<a-tag :color="text === 3 ? 'yellow' :text === 2? 'orange':text === 1?'red':'blue'">
@@ -28,17 +32,29 @@
{{text == 1 ? '待叫应' : text == 2 ?'已叫应':text == 3 ?'超时未叫应' : ''}}
</a-tag>
</template>
+ <template #forwardRate="text,record">
+ {{record.forwardStatus == 1?text: '--' }}
+ </template>
+ <template #operation="text, record, index">
+ <a-button type="primary" @click="viewDetail(record.id)">查看详情</a-button>
+ </template>
</a-table>
+ <call-list-mod ref="callList"></call-list-mod>
</a-modal>
</template>
<script>
import {getResponseById} from "@/api/list";
+import callListMod from "@/views/Admin/components/callListMod";
+import msgDetailMod from "@/views/Admin/components/msgDetailMod";
+import {responseMeasure} from "@/api/new";
export default {
- name: 'callListMod',
+ name: 'call-list-mod',
+ components: { callListMod },
data () {
return {
visible: false,
+ unitType: null,
search:{
pageIndex: 1,
pageSize: 10,
@@ -59,7 +75,6 @@
{
title: '序号',
dataIndex: 'index',
- width: '8%',
scopedSlots: {
customRender: 'index'
}
@@ -67,17 +82,15 @@
{
title: '接收人单位',
dataIndex: 'receiveUnit',
- width: '20%'
+ scopedSlots: { customRender: 'receiveUnit' }
},
{
title: '接收人',
dataIndex: 'recipienterName',
- width: '20%'
},
{
title: '级别',
dataIndex: 'unittype',
- width: '12%',
scopedSlots: {
customRender: 'unittype'
},
@@ -85,10 +98,23 @@
{
title: '叫应状态',
dataIndex: 'responseStatus',
- width: '15%',
scopedSlots: {
customRender: 'responseStatus'
- } //设置定制化表格数据
+ }
+ },
+ {
+ title: '转发叫应率',
+ dataIndex: 'forwardRate',
+ scopedSlots: {
+ customRender: 'forwardRate'
+ }
+ },
+ {
+ title: '响应措施',
+ dataIndex: 'operation',
+ scopedSlots: {
+ customRender: 'operation'
+ },
}
]
}
@@ -97,11 +123,17 @@
const t = this
},
methods:{
- openMod(id){
+ openMod(id,type){
const t = this
t.visible = true
+ t.unitType = type
t.search.searchParams.warnInfoId = id
t.getData()
+ if(type == 3){
+ t.columns = t.columns.filter(i=>i.dataIndex !== 'forwardRate')
+ }else{
+ t.columns = t.columns.filter(i=>i.dataIndex !== 'operation')
+ }
},
async getData(){
const t = this
@@ -114,6 +146,25 @@
}
},
+ async viewDetail(id){
+ const t = this
+ const res = await responseMeasure({id:id})
+ if(res.data.code == 100){
+ const data = res.data.data
+ if(!data.baseMeasureIds){
+ t.$message.error('该记录暂无响应措施')
+ }else{
+ console.log('666')
+ }
+ }else{
+ this.$message.error(res.data.msg)
+ }
+ },
+
+ digData(id,type){
+ this.$refs.callList.openMod(id,type)
+ },
+
onPageChange(page, pageSize) {
const t= this
t.pagination.current = page
diff --git a/src/views/Admin/components/msgDetailMod.vue b/src/views/Admin/components/msgDetailMod.vue
index 6b8413d..b2b0453 100644
--- a/src/views/Admin/components/msgDetailMod.vue
+++ b/src/views/Admin/components/msgDetailMod.vue
@@ -30,11 +30,19 @@
</a-row>
<a-row :gutter="24" v-if="details.publishingUnit"><a-col :span="4">发布单位</a-col><a-col :span="14">{{details.publishingUnit}}</a-col></a-row>
<a-row :gutter="24" v-if="details.content"><a-col :span="4">信息内容</a-col><a-col :span="14">{{details.content}}</a-col></a-row>
+ <a-row :gutter="24" v-if="details.directViewUrl"><a-col :span="4">直览附件</a-col><a-col :span="14" style="border: none"><a :href="details.directViewUrl" target="_blank" class="urlClick">{{details.directViewUrl}}</a></a-col></a-row>
<a-row :gutter="24" v-if="details.recipients && details.recipients.length>0">
<a-col :span="4">接收人</a-col>
<a-col :span="20">
<b>本次共发送信息给 {{details.recipients.length}}人:</b><br/><br/>
{{details.recipients.map(i=>i.realName + '(' + i.phone + ')').join(',')}}
+ </a-col>
+ </a-row>
+ <a-row :gutter="24" v-if="details.acceptingUnitIds && details.acceptingUnitIds.length>0">
+ <a-col :span="4">接收人</a-col>
+ <a-col :span="20">
+ <b>本次共发送信息给 {{details.acceptingUnitIds.length}}人:</b><br/><br/>
+ {{details.acceptingUnitIds.map(i=>i.recipienterName + '(' + i.recipienterPhone + ')').join(',')}}
</a-col>
</a-row>
<a-row :gutter="24" v-if="details.attachments && details.attachments.length > 0"><a-col :span="4">附件内容</a-col>
@@ -104,10 +112,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachementName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachementName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
@@ -179,4 +188,7 @@
}
}
}
+.urlClick:hover{
+ text-decoration: underline;
+}
</style>
diff --git a/src/views/Admin/components/msgEditMod.vue b/src/views/Admin/components/msgEditMod.vue
index ac30da2..a5c153e 100644
--- a/src/views/Admin/components/msgEditMod.vue
+++ b/src/views/Admin/components/msgEditMod.vue
@@ -57,6 +57,14 @@
<a-form-model-item prop="content">
<a-textarea v-model="form.content" placeholder="请输入短信通知内容部分" :auto-size="{ minRows: 3, maxRows: 5 }" :readOnly="disable"/>
</a-form-model-item>
+ <a-row v-if="userInfo.unittype == 1 || title == '信息转发' || title == '信息审核'||title == '信息详情'">
+ <a-col :span="24" style="display: flex;align-items: center">
+ <b style="margin-bottom: 24px">直览附件URL:</b>
+ <a-form-model-item style="width: 50%">
+ <a-textarea :readonly="title == '信息转发'||title == '信息审核'||title == '信息详情'?true:false" v-model="form.directViewUrl" placeholder="请输入url信息" :auto-size="{ minRows: 1, maxRows: 3 }"/>
+ </a-form-model-item>
+ </a-col>
+ </a-row>
<a-row>
<a-col :span="12">
<a-upload
@@ -116,9 +124,9 @@
>
</a-tree-select>
</a-form-model-item>
- <a-checkbox :checked="withLeaders" @change="isAddLeaders" style="margin-bottom: 24px" :disabled="disable">
- 同时发信息给本级领导
- </a-checkbox>
+<!-- <a-checkbox :checked="withLeaders" @change="isAddLeaders" style="margin-bottom: 24px" :disabled="disable">-->
+<!-- 同时发信息给本级领导-->
+<!-- </a-checkbox>-->
</a-col>
<a-col :span="12">
<div style="display:flex;justify-content: space-between;align-items: center;">
@@ -206,6 +214,7 @@
disasterType: undefined,
warningLevel: undefined,
content: '',
+ directViewUrl: '',
publishingUnit: '',
districtId: null,
attachments: [],
@@ -277,7 +286,7 @@
},
computed: {},
methods: {
- openMod(type,data){
+ openMod(type,data,id){
const t = this
t.getLeaders()
t.form.acceptingUnitIds = []
@@ -332,6 +341,10 @@
t.form.warningLevel = data.warningLevel
t.form.content = data.content
t.form.timeout = data.timeout
+ t.form.forwardWarnInfoLogId = id
+ t.form.forwardStatus = 1
+ t.form.forwardPath = data.forwardPath
+ t.form.directViewUrl = data.directViewUrl
if(data.attachments && data.attachments.length>0){
t.fileList = data.attachments.map((i)=>{
return {
@@ -602,10 +615,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", file.name);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", file.name);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
diff --git a/src/views/Admin/components/reactionMod.vue b/src/views/Admin/components/reactionMod.vue
new file mode 100644
index 0000000..a8bbd74
--- /dev/null
+++ b/src/views/Admin/components/reactionMod.vue
@@ -0,0 +1,150 @@
+<template>
+ <a-modal
+ :title="title"
+ :visible="visible"
+ centered
+ :confirm-loading="confirmLoading"
+ width="50%"
+ cancelText="取消"
+ okText="确认"
+ @ok="onSubmit"
+ @cancel="handleCancel"
+ :afterClose="clearMod"
+ >
+ <a-form-model ref="ruleForm" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :colon="false">
+ <a-form-model-item label="所属灾种" prop="disasterType">
+ <a-select v-model="form.disasterType" placeholder="选择灾种">
+ <a-select-option v-for="item in riskOptions" :value="item.value" :key="item.value">{{item.name}}</a-select-option>
+ </a-select>
+ </a-form-model-item>
+ <a-form-model-item label="响应措施" prop="measure">
+ <a-textarea v-model="form.measure" :auto-size="{ minRows: 3, maxRows: 6 }"/>
+ </a-form-model-item>
+ </a-form-model>
+ </a-modal>
+</template>
+
+<script>
+import {addMeasure,updateMeasure} from "@/api/new";
+export default {
+ name: 'reactionMod',
+ props: [],
+ data () {
+ return {
+ title: '新增响应措施',
+ visible: false,
+ confirmLoading: false,
+ labelCol: { span: 4 },
+ wrapperCol: { span: 14 },
+ form: {
+ id: null,
+ disasterType: null,
+ measure: ''
+ },
+ rules: {
+ disasterType: [{ required: true, message: '请选择所属灾种', trigger: 'blur'}],
+ measure: [{ required: true, message: '请输入响应措施', trigger: 'blur'}]
+ },
+ riskOptions: [
+ {
+ name: '地震',
+ value: 1
+ },
+ {
+ name: '洪涝',
+ value: 2
+ },
+ {
+ name: '气象',
+ value: 3
+ },
+ {
+ name: '泥石流',
+ value: 4
+ },
+ {
+ name: '水旱',
+ value: 5
+ },
+ {
+ name: '森林草原火灾',
+ value: 6
+ }
+ ],
+ }
+ },
+ created() {
+ const t = this
+ },
+ methods:{
+ openDialog(type,data){
+ const t = this
+ if(type == 'add'){
+ t.title = '新增响应措施'
+ t.form = {
+ id: null,
+ disasterType: null,
+ measure: ''
+ }
+ }else{
+ t.title = '编辑响应措施'
+ for(let i in data){
+ if(t.isValidKey(i,t.form)){
+ t.form[i] = data[i]
+ }
+ }
+ }
+ t.visible = true
+ },
+ isValidKey(key, object){
+ return key in object;
+ },
+
+ clearMod(){
+ this.$refs.ruleForm.clearValidate()
+ this.$refs.ruleForm.resetFields()
+ },
+
+ onSubmit() {
+ this.$refs.ruleForm.validate(valid => {
+ if (valid) {
+ if(this.title == '新增响应措施'){
+ const { id,...data } = this.form
+ addMeasure(data).then((res)=>{
+ if(res.data.code == 100){
+ this.$message.success('新增响应措施成功')
+ this.$emit('refresh')
+ this.visible = false
+ }else{
+ this.$message.error(res.data.msg)
+ }
+ })
+ }else{
+ updateMeasure(this.form).then((res)=>{
+ if(res.data.code == 100){
+ this.$message.success('修改响应措施成功')
+ this.$emit('refresh')
+ this.visible = false
+ }else{
+ this.$message.error(res.data.msg)
+ }
+ })
+ }
+ } else {
+ console.log('error submit!!');
+ return false;
+ }
+ });
+ },
+
+ handleCancel(e) {
+ const t = this
+ t.visible = false;
+ }
+ }
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>
diff --git a/src/views/Admin/components/userMod.vue b/src/views/Admin/components/userMod.vue
index da6f1d4..31c38b3 100644
--- a/src/views/Admin/components/userMod.vue
+++ b/src/views/Admin/components/userMod.vue
@@ -68,6 +68,9 @@
<a-form-model-item label="角色" prop="roleId">
<a-select v-model="form.roleId" placeholder="角色">
<a-select-option :value="2">
+ 审批领导
+ </a-select-option>
+ <a-select-option :value="4">
领导
</a-select-option>
<a-select-option :value="3">
diff --git a/src/views/Admin/history.vue b/src/views/Admin/history.vue
index dd5ace3..15d3fb8 100644
--- a/src/views/Admin/history.vue
+++ b/src/views/Admin/history.vue
@@ -246,10 +246,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachmentName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachmentName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
diff --git a/src/views/Admin/list.vue b/src/views/Admin/list.vue
index bbad73a..47941e9 100644
--- a/src/views/Admin/list.vue
+++ b/src/views/Admin/list.vue
@@ -262,10 +262,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachmentName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachmentName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
@@ -304,6 +305,15 @@
responseMsg(id).then(res=>{
if(res.data.code == 100){
t.$message.success('信息叫应成功');
+ t.search = {
+ pageIndex: 1,
+ pageSize: 10,
+ searchParams:{
+ responseStatus: null,
+ startTime: '',
+ endTime: ''
+ }
+ },
t.getData()
}else{
t.$message.warning(res.data.msg);
@@ -321,7 +331,7 @@
getReviewDetailByWorker(data.warnInfoId).then(res=>{
if(res.data.code == 100){
if(res.data.data){
- t.$refs.msgEdit.openMod(type,res.data.data)
+ t.$refs.msgEdit.openMod(type,res.data.data,data.id)
}else{
t.$message.error('查询信息详情失败')
}
diff --git a/src/views/Admin/msgReview.vue b/src/views/Admin/msgReview.vue
index f12dfe5..29c9096 100644
--- a/src/views/Admin/msgReview.vue
+++ b/src/views/Admin/msgReview.vue
@@ -231,10 +231,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachmentName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachmentName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
diff --git a/src/views/Admin/notice.vue b/src/views/Admin/notice.vue
index 8d1c4ed..1489435 100644
--- a/src/views/Admin/notice.vue
+++ b/src/views/Admin/notice.vue
@@ -55,6 +55,14 @@
<a-textarea v-model="form.content" placeholder="请输入短信通知内容部分"
:auto-size="{ minRows: 3, maxRows: 5 }" />
</a-form-model-item>
+ <a-row v-if="userInfo.unittype == 1">
+ <a-col :span="24" style="display: flex;align-items: center">
+ <b style="margin-bottom: 24px">直览附件URL:</b>
+ <a-form-model-item prop="directViewUrl" style="width: 50%">
+ <a-textarea v-model="form.directViewUrl" placeholder="请输入url信息" :auto-size="{ minRows: 1, maxRows: 3 }"/>
+ </a-form-model-item>
+ </a-col>
+ </a-row>
<a-row>
<a-col :span="12">
<a-upload :action="uploadUrl" :file-list="fileList" @change="fileChange" :headers="header"
@@ -175,6 +183,7 @@
disasterType: undefined,
warningLevel: undefined,
content: '',
+ directViewUrl: '',
publishingUnit: '',
districtId: null,
attachments: [],
diff --git a/src/views/Admin/reactionManage.vue b/src/views/Admin/reactionManage.vue
new file mode 100644
index 0000000..536fa50
--- /dev/null
+++ b/src/views/Admin/reactionManage.vue
@@ -0,0 +1,178 @@
+<template>
+ <div class="inner">
+ <a-row type="flex" justify="space-between" style="margin-bottom: 20px">
+ <a-col :span="4">
+ <a-button type="primary" @click="editData('add',{})">新增</a-button>
+ </a-col>
+ <a-col :span="20">
+ <a-row type="flex" justify="end" :gutter="12">
+<!-- <a-col :span="4">-->
+<!-- <a-input v-model="search.searchParams.realName" placeholder="姓名" style="width: 100%"/>-->
+<!-- </a-col>-->
+<!-- <a-col :span="4">-->
+<!-- <a-button type="primary" @click="getUserList">查询</a-button>-->
+<!-- <a-button style="margin-left: 12px" @click="resetSearch">重置</a-button>-->
+<!-- </a-col>-->
+ </a-row>
+ </a-col>
+ </a-row>
+ <div class="table-cont">
+ <a-table :columns="columns" :data-source="tableData" :pagination="pagination" :rowKey="record=>record.id" bordered>
+ <template #disasterType="type">
+ {{ getRiskName(type) }}
+ </template>
+ <template #action="action,row">
+ <a-button type="link" @click="editData('edit',row)">编辑</a-button>
+ <a-button type="link" class="delBtn" @click="delData(row)">删除</a-button>
+ </template>
+ </a-table>
+ </div>
+ <reaction-mod ref="reactRef" @refresh="getMeasureList()"></reaction-mod>
+ </div>
+</template>
+
+<script>
+import {getMeasure,addMeasure,delMeasure} from '@/api/new'
+import {getUserInfo} from "@/util/storage"
+import ReactionMod from "@/views/Admin/components/reactionMod";
+import Cookies from "js-cookie";
+
+export default {
+ name: 'reactionManage',
+ components: { ReactionMod },
+ data () {
+ return {
+ unittype: null,
+ search:{
+ pageIndex: 1,
+ pageSize: 10
+ },
+ columns:[
+ {
+ title: '所属灾种',
+ dataIndex: 'disasterType',
+ key: 'disasterType',
+ scopedSlots: { customRender: 'disasterType' }
+ },
+ {
+ title: '措施内容',
+ dataIndex: 'measure',
+ key: 'measure'
+ },
+ {
+ title: '操作',
+ key: 'action',
+ scopedSlots: { customRender: 'action' }
+ },
+ ],
+ riskOptions: [
+ {
+ name: '地震',
+ value: 1
+ },
+ {
+ name: '洪涝',
+ value: 2
+ },
+ {
+ name: '气象',
+ value: 3
+ },
+ {
+ name: '泥石流',
+ value: 4
+ },
+ {
+ name: '水旱',
+ value: 5
+ },
+ {
+ name: '森林草原火灾',
+ value: 6
+ }
+ ],
+ tableData: [],
+ pagination: {
+ current: 1,
+ defaultCurrent: 1,
+ defaultPageSize: 10,
+ total: 0,
+ onChange: ( page, pageSize ) => this.onPageChange(page,pageSize),
+ showTotal: total => `共 ${total} 条`
+ }
+ }
+ },
+ created() {
+ const t = this
+ t.unittype = getUserInfo().unittype
+ t.getMeasureList()
+ },
+ methods:{
+ async getMeasureList(){
+ const t = this
+ const res = await getMeasure(t.search)
+ if(res.data.code == 100){
+ t.tableData = res.data.data
+ t.pagination.total = res.data.total
+ }else{
+ t.$message.warning(res.data.msg);
+ }
+ },
+
+ getRiskName(type){
+ return this.riskOptions.find(i=>i.value == type)?.name
+ },
+
+ async delData(row){
+ const t = this
+ this.$confirm({
+ title: '提示',
+ content: h => <div>是否删除该条响应措施?</div>,
+ cancelText: '取消',
+ okText: '确认',
+ centered: true,
+ onOk() {
+ delMeasure(row.id).then(res=>{
+ if(res.data.code == 100){
+ t.$message.success('删除响应措施成功');
+ t.getMeasureList()
+ }else{
+ t.$message.warning(res.data.msg);
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ },
+
+ resetSearch(){
+ const t = this
+ t.search = {
+ pageIndex: 1,
+ pageSize: 10
+ }
+ t.getMeasureList()
+ },
+
+ editData(type,data){
+ const t = this
+ t.$refs.reactRef.openDialog(type,data)
+ },
+
+ onPageChange(page, pageSize) {
+ const t= this
+ t.pagination.current = page
+ t.search.pageIndex = page
+ t.getMeasureList()
+ }
+ }
+}
+</script>
+
+<style lang="less" scoped>
+.delBtn{
+ color: @danger
+}
+</style>
diff --git a/src/views/Admin/release.vue b/src/views/Admin/release.vue
index 00707b5..330525d 100644
--- a/src/views/Admin/release.vue
+++ b/src/views/Admin/release.vue
@@ -73,12 +73,6 @@
<msg-detail-mod ref="msgDetail"></msg-detail-mod>
<call-list-mod ref="callList" @refresh="getData"></call-list-mod>
</div>
- <!-- 对话框 -->
- <a-modal title="查看叫应详情"
- okText="确认"
- cancelText="关闭"
- :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleOk">
- </a-modal>
</div>
</template>
<script>
@@ -153,7 +147,7 @@
scopedSlots: {
customRender: 'operation'
},
- },
+ }
];
export default {
name: 'release',
@@ -255,10 +249,11 @@
let blob = new Blob([res.data],{type: res.data.type})
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
- link.setAttribute("download", item.attachmentName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ window.open(link.href)
+ // link.setAttribute("download", item.attachmentName);
+ // document.body.appendChild(link);
+ // link.click();
+ // document.body.removeChild(link);
} else {
this.$message.error('获取文件失败')
}
@@ -283,11 +278,6 @@
t.timeRange = []
t.getData()
},
-
- //弹出层
- showModal() {
- this.visible = true;
- },
handleOk(e) {
this.visible = false;
diff --git a/src/views/Home.vue b/src/views/Home.vue
index 9a57f99..16dd879 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -2,7 +2,8 @@
<div>
<a-layout id="components-layout-demo-custom-trigger" :style="{ height: '100vh' }">
<a-layout-sider v-model="collapsed" :trigger="null" collapsible>
- <div class="logo">{{ collapsed ? collapsed : '预警响应系统' }}</div>
+ <div class="logo" v-if="!collapsed">{{ '预警响应系统' }}</div>
+ <div class="logo" v-else><a-icon type="alert" /></div>
<menuSider />
</a-layout-sider>
<a-layout>
--
Gitblit v1.9.2