马宇豪
2023-06-14 d2d8982a787bf7267612c19983798d7aaa0c37fe
新增页面和配置,对接口
已修改5个文件
已添加1个文件
178 ■■■■■ 文件已修改
config/env.development.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env.production.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/list.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/components/callListMod.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/history.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Admin/release.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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',
}
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',
}
src/api/list.js
@@ -53,7 +53,14 @@
    })
}
// 根据id获取叫应信息
export function getResponseById(data){
    return request({
        url: '/published/warninfo/responses/page',
        method: 'post',
        data: data
    })
}
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>
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=>{
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=>{