From d2d8982a787bf7267612c19983798d7aaa0c37fe Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期三, 14 六月 2023 16:22:37 +0800 Subject: [PATCH] 新增页面和配置,对接口 --- config/env.development.js | 1 src/views/Admin/release.vue | 11 +++ src/views/Admin/history.vue | 17 +++-- src/views/Admin/components/callListMod.vue | 138 ++++++++++++++++++++++++++++++++++++++++++++++ config/env.production.js | 2 src/api/list.js | 9 ++ 6 files changed, 166 insertions(+), 12 deletions(-) diff --git a/config/env.development.js b/config/env.development.js index 6751411..5d13ab3 100644 --- a/config/env.development.js +++ b/config/env.development.js @@ -1,4 +1,5 @@ module.exports = { NODE_ENV: "development", baseUrl: 'http://192.168.0.38:8086', + // baseUrl: '121.239.169.30:33306', } \ No newline at end of file diff --git a/config/env.production.js b/config/env.production.js index 5e173d4..07f4c05 100644 --- a/config/env.production.js +++ b/config/env.production.js @@ -1,4 +1,4 @@ module.exports = { NODE_ENV: "production", - baseUrl: 'http://192.168.0.38:8086', + baseUrl: '121.239.169.30:33306', } \ No newline at end of file diff --git a/src/api/list.js b/src/api/list.js index 5de5cff..806dd84 100644 --- a/src/api/list.js +++ b/src/api/list.js @@ -53,7 +53,14 @@ }) } - +// 根据id获取叫应信息 +export function getResponseById(data){ + return request({ + url: '/published/warninfo/responses/page', + method: 'post', + data: data + }) +} diff --git a/src/views/Admin/components/callListMod.vue b/src/views/Admin/components/callListMod.vue new file mode 100644 index 0000000..7b4e630 --- /dev/null +++ b/src/views/Admin/components/callListMod.vue @@ -0,0 +1,138 @@ +<template> + <a-modal + title="叫应列表" + centered + :visible="visible" + width="50%" + cancelText="取消" + @cancel="handleCancel" + > + <a-table :columns="columns" :data-source="data" bordered :pagination="pagination"> + <template #index="text,record,index"> + {{ index + 1 }} + </template> + <template #warningLevel="text"> + <a-tag :color="text === 3 ? 'yellow' :text === 2? 'orange':text === 1?'red':'blue'"> + {{ getLevelName(text) }} + </a-tag> + </template> + <template #unittype="unittype"> + <a-tag + :color="unittype === 1 ? 'purple' : unittype === 2 ? 'blue' : unittype === 3 ? 'cyan' : 'green'" + > + {{ unittype==1?'省级':unittype==2?'地(市、州)级':unittype==3?'区县级':unittype==4?'村(乡、镇)级':'管理员' }} + </a-tag> + </template > + </a-table> + </a-modal> +</template> + +<script> +import {getResponseById} from "@/api/list"; +export default { + name: 'callListMod', + data () { + return { + visible: false, + search:{ + pageIndex: 1, + pageSize: 10, + searchParams:{ + warnInfoId: null + } + }, + data: [], + pagination: { + current: 1, + defaultCurrent: 1, + defaultPageSize: 10, + total: 0, + onChange: ( page, pageSize ) => this.onPageChange(page,pageSize), + showTotal: total => `共 ${total} 条` + }, + columns: [ + { + title: '序号', + dataIndex: 'index', + width: '8%', + scopedSlots: { + customRender: 'index' + } + }, + { + title: '接收人单位', + dataIndex: 'receiveUnit', + width: '20%', + scopedSlots: { + customRender: 'receiveUnit' + } + }, + { + title: '接收人', + dataIndex: 'recipienterName', + width: '20%', + scopedSlots: { + customRender: 'recipienterName' + } + }, + { + title: '级别', + dataIndex: 'unittype', + width: '12%', + scopedSlots: { + customRender: 'unittype' + }, + }, + { + title: '叫应时间', + dataIndex: 'responseTime', + width: '15%', + scopedSlots: { + customRender: 'responseTime' + } //设置定制化表格数据 + } + ] + } + }, + created() { + const t = this + }, + methods:{ + openMod(id){ + const t = this + t.visible = true + t.search.searchParams.warnInfoId = id + t.getData() + }, + async getData(){ + const t = this + const res = await getResponseById(t.search) + if(res.data.code == 100){ + t.data = res.data.data + t.pagination.total = res.data.total + }else{ + this.$message.error(res.data.msg) + } + }, + + onPageChange(page, pageSize) { + const t= this + t.pagination.current = page + t.search.pageIndex = page + t.getData() + }, + + handleCancel(e) { + const t = this + t.visible = false; + }, + onChange(value) { + console.log(value); + } + } +} +</script> + +<style lang="less" scoped> + +</style> diff --git a/src/views/Admin/history.vue b/src/views/Admin/history.vue index 5b64b67..1e91970 100644 --- a/src/views/Admin/history.vue +++ b/src/views/Admin/history.vue @@ -63,23 +63,19 @@ </a-tag> </template> <template #operation="text, record, index"> - <a-button type="primary">叫应列表</a-button> + <a-button type="primary" @click="openList(record.id)">叫应列表</a-button> <a-button type="link" @click="openMod('view',record)">查看详情</a-button> </template> </a-table> <msg-edit-mod ref="msgEdit" @refresh="getData"></msg-edit-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> import {getHistoryRecord, getMsgRecord, getPublishRecord} from "@/api/list"; import msgEditMod from "@/views/Admin/components/msgEditMod"; +import callListMod from "@/views/Admin/components/callListMod"; import {getReviewDetailByWorker} from "@/api/review"; const columns = [{ title: '序号', @@ -149,7 +145,7 @@ ]; export default { name: 'release', - components: { msgEditMod }, + components: { msgEditMod, callListMod }, data() { return { search:{ @@ -207,6 +203,11 @@ } }, + openList(id){ + const t = this + t.$refs.callList.openMod(id) + }, + openMod(type,data){ const t = this getReviewDetailByWorker(data.id).then(res=>{ diff --git a/src/views/Admin/release.vue b/src/views/Admin/release.vue index 2f880b1..162678b 100644 --- a/src/views/Admin/release.vue +++ b/src/views/Admin/release.vue @@ -63,11 +63,12 @@ </a-tag> </template> <template #operation="text, record, index"> - <a-button type="primary">叫应列表</a-button> + <a-button type="primary" @click="openList(record.id)">叫应列表</a-button> <a-button type="link" @click="openMod('view',record)">查看详情</a-button> </template> </a-table> <msg-edit-mod ref="msgEdit" @refresh="getData"></msg-edit-mod> + <call-list-mod ref="callList" @refresh="getData"></call-list-mod> </div> <!-- 对话框 --> <a-modal title="查看叫应详情" @@ -80,6 +81,7 @@ <script> import {getMsgRecord, getPublishRecord} from "@/api/list"; import msgEditMod from "@/views/Admin/components/msgEditMod"; +import callListMod from "@/views/Admin/components/callListMod"; import {getReviewDetailByWorker} from "@/api/review"; const columns = [{ title: '序号', @@ -149,7 +151,7 @@ ]; export default { name: 'release', - components: { msgEditMod }, + components: { msgEditMod, callListMod }, data() { return { search:{ @@ -207,6 +209,11 @@ } }, + openList(id){ + const t = this + t.$refs.callList.openMod(id) + }, + openMod(type,data){ const t = this getReviewDetailByWorker(data.id).then(res=>{ -- Gitblit v1.9.2