From a4e06ccd3cd976fbe4eef99e188d42ec9f3ad054 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 08 Apr 2021 09:32:05 +0800
Subject: [PATCH] 样式修改

---
 src/views/policeInformationDistribution/index.vue |  926 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 475 insertions(+), 451 deletions(-)

diff --git a/src/views/policeInformationDistribution/index.vue b/src/views/policeInformationDistribution/index.vue
index b748444..56b96d8 100644
--- a/src/views/policeInformationDistribution/index.vue
+++ b/src/views/policeInformationDistribution/index.vue
@@ -24,36 +24,42 @@
       <template slot-scope="{ row }" slot="type">
         <el-tag>{{
           row.type == "0"
-            ? "待处理"
-            : row.type == "1"
-            ? "处理中"
-            : row.type == "2"
-            ? "已处理"
-            : ""
-        }}</el-tag>
+          ? "待处理"
+          : row.type == "1"
+          ? "处理中"
+          : row.type == "2"
+          ? "已处理"
+          : ""
+          }}
+        </el-tag>
       </template>
 
       <template slot-scope="{ type, size, row }" slot="menu">
         <el-button
+          v-if="row.type == 0"
           icon="el-icon-edit"
           :size="size"
           :type="type"
           @click.stop="disposition(row)"
-          >处置</el-button>
+        >处置
+        </el-button>
 
         <el-button
+          v-if="row.type == 1 || row.type == 2"
           icon="el-icon-s-order"
           :size="size"
           :type="type"
           @click.stop="PoliceTracking(row)"
-        >追踪</el-button>
+        >追踪
+        </el-button>
 
         <el-button
           icon="el-icon-location-outline"
           :size="size"
           :type="type"
           @click.stop="handleMap(row)"
-          >定位</el-button>
+        >定位
+        </el-button>
 
       </template>
     </avue-crud>
@@ -65,7 +71,7 @@
       <iframe
         id="mapDiv"
         ref="mapDiv"
-        src="/map/index.html?openid=ClientManagement"
+        src="/map/index.html?openid=ClientManagement&ISinit=1"
         frameborder="0"
         width="100%"
         height="100%"
@@ -75,462 +81,480 @@
 </template>
 
 <script>
-import {
-  getList,
-  remove,
-  update,
-  add,
-  getclient
-} from "@/api/policeInformation/distribution";
-import { mapGetters } from "vuex";
+  import {
+    getList,
+    remove,
+    update,
+    add,
+    getclient
+  } from "@/api/policeInformation/index";
+  import {mapGetters} from "vuex";
 
-export default {
-  data() {
-    return {
-      showMap: false,
-      qwe: false,
-      direction: "rtl",
-      form: {},
-      query: {},
-      dateTime: [],
-      loading: true,
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0
+  export default {
+    data() {
+      return {
+        showMap: false,
+        qwe: false,
+        direction: "rtl",
+        form: {},
+        query: {},
+        dateTime: [],
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: {
+          height: "auto",
+          indexLabel: "序号",
+          calcHeight: 30,
+          labelWidth: "100",
+          size: "mini",
+          dialogWidth: 950,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 3,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: false,
+          dialogClickModal: false,
+          column: [
+            {
+              label: "警情类型",
+              prop: "waringType",
+              search: true,
+              searchSpan: 3,
+              className: "waringTypeClass",
+              searchLabelWidth: 80,
+              searchPlaceholder: "请选择",
+              type: "select",
+              width: 140,
+              props: {
+                label: "dictValue",
+                value: "dictValue"
+              },
+              //cascaderItem: ["city", "district"],
+              dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1356523651644043266",
+            },
+            {
+              label: "报警人",
+              prop: "galarmPeople"
+            },
+            {
+              label: "联系电话",
+              prop: "phoneNumber",
+              width: 96
+            },
+            {
+              label: "报警时间",
+              type: "datetime",
+              format: "yyyy-MM-dd HH:mm:ss",
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
+              prop: "galarmTime",
+              width: 140
+            },
+            {
+              label: "报警时间",
+              prop: "releaseTimeRange",
+              type: "datetime",
+              format: "yyyy-MM-dd",
+              valueFormat: "yyyy-MM-dd",
+              searchRange: true,
+              searchSpan: 5,
+              hide: true,
+              addDisplay: false,
+              editDisplay: false,
+              viewDisplay: false,
+              search: true,
+              rules: [
+                {
+                  required: true,
+                  message: "请输入时间",
+                  trigger: "blur"
+                }
+              ]
+            },
+            {
+              label: "处理人",
+              addDisplay: false,
+              prop: "handName"
+            },
+            {
+              label: "处置时间",
+              type: "datetime",
+              addDisplay: false,
+              format: "yyyy-MM-dd HH:mm:ss",
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
+              prop: "czTime",
+              width: 140
+            },{
+              label: "备注",
+              prop: "bz",
+              width: 150
+            },
+            {
+              label: "设备编号",
+              search: true,
+              searchSpan: 3,
+              width: 120,
+              prop: "deviceNumber"
+            },
+            {
+              label: "省份",
+              prop: "province",
+              search: true,
+              searchSpan: 2,
+              searchLabelWidth: 45,
+              placeholder: "省份",
+              type: "select",
+              props: {
+                label: "name",
+                value: "code"
+              },
+              cascaderItem: ["city", "district"],
+              dicUrl: "/api/blade-system/region/select",
+              span: 6,
+              className: "cityClass1"
+            },
+            {
+              label: "地市",
+              prop: "city",
+              type: "select",
+              searchPlaceholder: "地市",
+              placeholder: "地市",
+              searchLabelWidth: 1,
+              searchSpan: 2,
+              search: true,
+              props: {
+                label: "name",
+                value: "code"
+              },
+              dicUrl: "/api/blade-system/region/select?code={{key}}",
+              span: 3,
+              labelWidth: "0",
+              className: "cityClass2"
+            },
+            {
+              label: "区县",
+              searchSpan: 2,
+              searchLabelWidth: 1,
+              searchPlaceholder: "区县",
+              placeholder: "区县",
+              search: true,
+              prop: "district",
+              type: "select",
+              props: {
+                label: "name",
+                value: "code"
+              },
+              dicUrl: "/api/blade-system/region/select?code={{key}}",
+              span: 3,
+              labelWidth: "0",
+              className: "cityClass3"
+            }, {
+              label: "事发地址",
+              width: 200,
+              prop: "place"
+            },
+            {
+              label: "处理状态",
+              search: true,
+              addDisplay: false,
+              searchSpan: 2,
+              slot: true,
+              searchPlaceholder: "请选择",
+              prop: "type",
+              type: "select",
+              className: "selectClass",
+              dicData: [
+                {
+                  label: "待处理",
+                  value: "0"
+                },
+                {
+                  label: "处理中",
+                  value: "1"
+                },
+                {
+                  label: "已处理",
+                  value: "2"
+                }
+              ]
+            },
+            {
+              label: "报警内容",
+              prop: "content",
+              component: 'AvueUeditor',
+              options: {
+                action: '/api/blade-resource/oss/endpoint/put-file',
+                props: {
+                  res: "data",
+                  url: "link",
+                }
+              },
+              hide: true,
+              minRows: 6,
+              span: 24,
+            },
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission", "flowRoutes"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.distribution_add, false),
+          viewBtn: this.vaildData(null, false),
+          delBtn: this.vaildData(null, false),
+          editBtn: this.vaildData(this.permission.distribution_edit, false)
+        };
       },
-      selectionList: [],
-      option: {
-        height: "auto",
-        indexLabel: "序号",
-        calcHeight: 30,
-        labelWidth: "100",
-        dialogWidth: 950,
-        tip: false,
-        searchShow: true,
-        searchMenuSpan: 3,
-        border: true,
-        index: true,
-        viewBtn: true,
-        selection: false,
-        dialogClickModal: false,
-        column: [
-          {
-            label: "警情类型",
-            prop: "waringType",
-            search: true,
-            searchSpan: 3,
-            searchLabelWidth: 80,
-            searchPlaceholder: "请选择",
-            type: "select",
-            props: {
-              label: "dictValue",
-              value: "dictValue"
-            },
-            //cascaderItem: ["city", "district"],
-            dicUrl: "/api/blade-system/dict-biz/child-list?parentId=1356516807043231746",
-            span: 6
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    created() {
+      this.dateTime = this.getDate();
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(
+          () => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            done();
           },
-          {
-            label: "报警时间",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            prop: "galarmTime",
-            width: 140
-          },
-          {
-            label: "报警时间",
-            prop: "releaseTimeRange",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            searchRange: true,
-            searchSpan: 5,
-            hide: true,
-            addDisplay: false,
-            editDisplay: false,
-            viewDisplay: false,
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: "请输入时间",
-                trigger: "blur"
-              }
-            ]
-          },
-          {
-            label: "报警内容",
-            prop: "rName"
-          },
-          {
-            label: "处理人",
-            prop: "handName"
-          },
-          {
-            label: "报警人",
-            prop: "galarmPeople"
-          },
-          {
-            label: "联系电话",
-            prop: "phoneNumber",
-            width: 96
-          },
-          {
-            label: "处理时间",
-            type: "datetime",
-            format: "yyyy-MM-dd hh:mm:ss",
-            valueFormat: "yyyy-MM-dd hh:mm:ss",
-            prop: "handleTime",
-            width: 140
-          },
-          {
-            label: "事发地址",
-            width: 150,
-            prop: "place"
-          },
-          {
-            label: "设备编号",
-            search: true,
-            searchSpan: 3,
-            width: 120,
-            prop: "deviceNumber"
-          },
-          {
-            label: "行政区",
-            prop: "province",
-            search: true,
-            searchSpan: 3,
-            searchLabelWidth: 60,
-            type: "select",
-            props: {
-              label: "name",
-              value: "code"
-            },
-            cascaderItem: ["city", "district"],
-            dicUrl: "/api/blade-system/region/select",
-            span: 6,
-            className: "cityClass1"
-          },
-          {
-            label: "地市",
-            prop: "city",
-            type: "select",
-            searchLabelWidth: 1,
-            searchSpan: 2,
-            search: true,
-            props: {
-              label: "name",
-              value: "code"
-            },
-            dicUrl: "/api/blade-system/region/select?code={{key}}",
-            span: 3,
-            labelWidth: "0",
-            className: "cityClass2"
-          },
-          {
-            label: "区县",
-            searchSpan: 2,
-            searchLabelWidth: 1,
-            search: true,
-            prop: "district",
-            type: "select",
-            props: {
-              label: "name",
-              value: "code"
-            },
-            dicUrl: "/api/blade-system/region/select?code={{key}}",
-            span: 3,
-            labelWidth: "0",
-            className: "cityClass3"
-          },
-          {
-            label: "处理状态",
-            search: true,
-            searchSpan: 3,
-            slot: true,
-            searchLabelWidth: 80,
-            searchPlaceholder: "请选择",
-            prop: "type",
-            type: "select",
-            dicData: [
-              {
-                label: "待处理",
-                value: "0"
-              },
-              {
-                label: "处理中",
-                value: "1"
-              },
-              {
-                label: "已处理",
-                value: "2"
-              }
-            ]
+          error => {
+            loading();
           }
-        ]
+        );
       },
-      data: []
-    };
-  },
-  computed: {
-    ...mapGetters(["permission", "flowRoutes"]),
-    permissionList() {
-      return {
-        addBtn: this.vaildData(this.permission.distribution_add, false),
-        viewBtn: this.vaildData(null, false),
-        delBtn: this.vaildData(null, false),
-        editBtn: this.vaildData(this.permission.real_edit, false)
-      };
-    },
-    ids() {
-      let ids = [];
-      this.selectionList.forEach(ele => {
-        ids.push(ele.id);
-      });
-      return ids.join(",");
-    }
-  },
-  created() {
-    this.dateTime = this.getDate();
-  },
-  methods: {
-    rowSave(row, done, loading) {
-      add(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          loading();
-        }
-      );
-    },
-    rowUpdate(row, index, done, loading) {
-      row.coordinate = "";
-      update(row).then(
-        () => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-          done();
-        },
-        error => {
-          loading();
-        }
-      );
-    },
-    rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(row.id);
+      rowUpdate(row, index, done, loading) {
+        row.coordinate = "";
+        update(row).then(
+          () => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            done();
+          },
+          error => {
+            loading();
+          }
+        );
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
-        });
-    },
-    searchReset() {
-      this.query = {};
-      this.onLoad(this.page);
-    },
-    searchChange(params, done) {
-      this.query = params;
-      this.page.currentPage = 1;
-      this.onLoad(this.page, params);
-      done();
-    },
-    selectionChange(list) {
-      this.selectionList = list;
-    },
-    selectionClear() {
-      this.selectionList = [];
-      this.$refs.crud.toggleSelection();
-    },
-    beforeOpen(done, type) {
-      if (["edit", "view"].includes(type)) {
-        getclient(this.form.id).then(res => {
-          this.form = res.data.data;
-        });
-      }
-      done();
-    },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage;
-    },
-    sizeChange(pageSize) {
-      this.page.pageSize = pageSize;
-    },
-    refreshChange() {
-      this.onLoad(this.page, this.query);
-    },
-    onLoad(page, params = {}) {
-      const { releaseTimeRange } = this.query;
-      let values = {
-        ...params
-      };
-      if (releaseTimeRange) {
-        values = {
-          ...params,
-          beginTime: releaseTimeRange[0],
-          endTime: releaseTimeRange[1],
-          ...this.query
-        };
-        values.releaseTimeRange = null;
-      }
-      this.loading = true;
-      getList(page.currentPage, page.pageSize, values).then(res => {
-        const data = res.data.data;
-        this.page.total = data.total;
-        this.data = data.records;
-        this.loading = false;
-        this.selectionClear();
-      });
-    },
-    getDate() {
-      // 当前时间
-      var timestamp = Date.parse(new Date());
-      var serverDate = new Date(timestamp);
-
-      // 本周周一的时间
-      var mondayTime =
-        timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
-      var mondayData = new Date(mondayTime);
-      //年
-      var mondayY = mondayData.getFullYear();
-      //月
-      var mondayM =
-        mondayData.getMonth() + 1 < 10
-          ? "0" + (mondayData.getMonth() + 1)
-          : mondayData.getMonth() + 1;
-      //日
-      var mondayD =
-        mondayData.getDate() < 10
-          ? "0" + mondayData.getDate()
-          : mondayData.getDate();
-      // 当前时间
-      var currentData = new Date(timestamp);
-      //年
-      var currentY = currentData.getFullYear();
-      //月
-      var currentM =
-        currentData.getMonth() + 1 < 10
-          ? "0" + (currentData.getMonth() + 1)
-          : currentData.getMonth() + 1;
-      //日
-      var currentD =
-        currentData.getDate() < 10
-          ? "0" + currentData.getDate()
-          : currentData.getDate();
-      //时
-      var currenH =
-        currentData.getHours() < 10
-          ? "0" + currentData.getHours()
-          : currentData.getHours();
-      //分
-      var currenM =
-        currentData.getMinutes() < 10
-          ? "0" + currentData.getMinutes()
-          : currentData.getMinutes();
-
-      return {
-        week: {
-          beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00",
-          endTime:
-            currentY +
-            "-" +
-            currentM +
-            "-" +
-            currentD +
-            " " +
-            currenH +
-            ":" +
-            currenM +
-            ":00"
-        },
-        month: {
-          beginTime: mondayY + "-" + mondayM + "-01 00:00:00",
-          endTime:
-            currentY +
-            "-" +
-            currentM +
-            "-" +
-            currentD +
-            " " +
-            currenH +
-            ":" +
-            currenM +
-            ":00"
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getclient(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
         }
-      };
-    },
-    rowStyle({ row, column, rowIndex }) {
-      if (row.type == "0") {
-        return {
-          color: "#ff7627"
+        done();
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        const {releaseTimeRange} = this.query;
+        let values = {
+          ...params
         };
-      } else if (row.type == "1") {
-        return {
-          color: "#15a2fe"
-        };
-      } else if (row.type == "2") {
-        return {
-          color: "#000"
-        };
-      }
-    },
-    disposition(data) {
-      var arr = [];
-      this.$store.state.tags.tagList.forEach(item => {
-        if (item.label != "警情分发处置") {
-          arr.push(item);
+        if (releaseTimeRange) {
+          values = {
+            ...params,
+            beginTime: releaseTimeRange[0],
+            endTime: releaseTimeRange[1],
+            ...this.query
+          };
+          values.releaseTimeRange = null;
         }
-      });
-      this.$store.state.tags.tagList = arr;
-      this.$router.push({ path: "/distribution/index", query: data });
-    },
-    handleMap(row) {
-      this.showMap = true;
-      this.$nextTick(() => {
-        this.$refs.mapDiv.onload = () => {
-          window.frames[0].locationObj = {x: row.jd, y: row.wd};
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      },
+      getDate() {
+        // 当前时间
+        var timestamp = Date.parse(new Date());
+        var serverDate = new Date(timestamp);
+
+        // 本周周一的时间
+        var mondayTime =
+          timestamp - (serverDate.getDay() - 1) * 24 * 60 * 60 * 1000;
+        var mondayData = new Date(mondayTime);
+        //年
+        var mondayY = mondayData.getFullYear();
+        //月
+        var mondayM =
+          mondayData.getMonth() + 1 < 10
+            ? "0" + (mondayData.getMonth() + 1)
+            : mondayData.getMonth() + 1;
+        //日
+        var mondayD =
+          mondayData.getDate() < 10
+            ? "0" + mondayData.getDate()
+            : mondayData.getDate();
+        // 当前时间
+        var currentData = new Date(timestamp);
+        //年
+        var currentY = currentData.getFullYear();
+        //月
+        var currentM =
+          currentData.getMonth() + 1 < 10
+            ? "0" + (currentData.getMonth() + 1)
+            : currentData.getMonth() + 1;
+        //日
+        var currentD =
+          currentData.getDate() < 10
+            ? "0" + currentData.getDate()
+            : currentData.getDate();
+        //时
+        var currenH =
+          currentData.getHours() < 10
+            ? "0" + currentData.getHours()
+            : currentData.getHours();
+        //分
+        var currenM =
+          currentData.getMinutes() < 10
+            ? "0" + currentData.getMinutes()
+            : currentData.getMinutes();
+
+        return {
+          week: {
+            beginTime: mondayY + "-" + mondayM + "-" + mondayD + " 00:00:00",
+            endTime:
+              currentY +
+              "-" +
+              currentM +
+              "-" +
+              currentD +
+              " " +
+              currenH +
+              ":" +
+              currenM +
+              ":00"
+          },
+          month: {
+            beginTime: mondayY + "-" + mondayM + "-01 00:00:00",
+            endTime:
+              currentY +
+              "-" +
+              currentM +
+              "-" +
+              currentD +
+              " " +
+              currenH +
+              ":" +
+              currenM +
+              ":00"
+          }
         };
-      })
-    },
-    PoliceTracking(row){
-      //警情追踪
+      },
+      rowStyle({row, column, rowIndex}) {
+        if (row.type == "0") {
+          return {
+            color: "#ff0000"
+          };
+        } else if (row.type == "1") {
+          return {
+            color: "#15a2fe"
+          };
+        } else if (row.type == "2") {
+          return {
+            color: "#000"
+          };
+        }
+      },
+      disposition(data) {
 
-
-
+        var arr = [];
+        this.$store.state.tags.tagList.forEach(item => {
+          if (item.label != "警情分发处置") {
+            arr.push(item);
+          }
+        });
+        this.$store.state.tags.tagList = arr;
+        this.$router.push({path: "/distribution/index", query: data});
+      },
+      handleMap(row) {
+        this.showMap = true;
+        this.$nextTick(() => {
+          this.$refs.mapDiv.onload = () => {
+            window.frames[0].init("ClientManagement", {x: row.jd, y: row.wd});
+          };
+        });
+      },
+      PoliceTracking(row) {
+        //警情追踪
+        this.$router.push({path: "/policeTracking/track", query: row});
+      }
     }
-  }
-};
+  };
 </script>
 
 <style>
-.cityClass1 {
-  padding-right: 5px !important;
-}
 
-.cityClass3 div label {
-  display: none;
-}
+  .el-card__body .selectClass {
+    width: 12%;
+  }
 
-.cityClass3 {
-  padding-left: 5px !important;
-}
+
 </style>

--
Gitblit v1.9.3