From 92cb674638d717af8a397c0eb8d4e3621b088193 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Thu, 01 Feb 2024 16:19:45 +0800
Subject: [PATCH] 九小场所页面添加

---
 src/views/publicSecurity/ninePlaceManage/patrolRecord.vue           |  377 +++++++++++++++++
 src/views/publicSecurity/ninePlaceManage/archivesManage.vue         |  287 +++++++++++++
 src/views/publicSecurity/ninePlaceManage/situationRectification.vue |  279 +++++++++++++
 src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue |  287 +++++++++++++
 4 files changed, 1,230 insertions(+), 0 deletions(-)

diff --git a/src/views/publicSecurity/ninePlaceManage/archivesManage.vue b/src/views/publicSecurity/ninePlaceManage/archivesManage.vue
new file mode 100644
index 0000000..ee37fbd
--- /dev/null
+++ b/src/views/publicSecurity/ninePlaceManage/archivesManage.vue
@@ -0,0 +1,287 @@
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+            @refresh-change="refreshChange" @on-load="onLoad">
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import {
+    mapGetters
+} from "vuex"
+import website from '@/config/website'
+
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menu: false,
+                header: false,
+                border: true,
+                index: true,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                dialogClickModal: false,
+                column: [{
+                    label: "地区",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所名称",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所地址",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所类别",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所负责人",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "身份证信息",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "联系方式",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "辖区派出所",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "责任民警",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "责任民警联系方式",
+                    prop: "regionName",
+                    align: 'center',
+                }],
+            },
+            data: []
+        }
+    },
+
+    computed: {
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.place_add, true),
+                viewBtn: this.vaildData(this.permission.place_view, true),
+                delBtn: this.vaildData(this.permission.place_delete, true),
+                editBtn: this.vaildData(this.permission.place_edit, true),
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach((ele) => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+
+    },
+    methods: {
+        rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            add({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            update({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    row.isDeleted = 1
+                    return removeTask(row)
+                })
+                .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.$nextTick(() => {
+                this.$refs.crud && this.$refs.crud.toggleSelection()
+            })
+        },
+
+        handleDelete () {
+            if (this.selectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据")
+                return
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    return remove(this.ids)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    this.$refs.crud.toggleSelection()
+                })
+        },
+
+        beforeOpen (done, type) {
+            // if (["edit", "view"].includes(type)) {
+
+            // } else {
+            //     done()
+            // }
+        },
+
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+
+        refreshChange () {
+            // this.onLoad(this.page, this.query)
+        },
+
+        onLoad (page, params = {}) {
+            this.loading = true
+            this.loading = false
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.avue-upload__icon {
+    line-height: 6;
+}
+</style>
diff --git a/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue b/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue
new file mode 100644
index 0000000..ee37fbd
--- /dev/null
+++ b/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue
@@ -0,0 +1,287 @@
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+            @refresh-change="refreshChange" @on-load="onLoad">
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import {
+    mapGetters
+} from "vuex"
+import website from '@/config/website'
+
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menu: false,
+                header: false,
+                border: true,
+                index: true,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                dialogClickModal: false,
+                column: [{
+                    label: "地区",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所名称",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所地址",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所类别",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所负责人",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "身份证信息",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "联系方式",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "辖区派出所",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "责任民警",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "责任民警联系方式",
+                    prop: "regionName",
+                    align: 'center',
+                }],
+            },
+            data: []
+        }
+    },
+
+    computed: {
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.place_add, true),
+                viewBtn: this.vaildData(this.permission.place_view, true),
+                delBtn: this.vaildData(this.permission.place_delete, true),
+                editBtn: this.vaildData(this.permission.place_edit, true),
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach((ele) => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+
+    },
+    methods: {
+        rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            add({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            update({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    row.isDeleted = 1
+                    return removeTask(row)
+                })
+                .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.$nextTick(() => {
+                this.$refs.crud && this.$refs.crud.toggleSelection()
+            })
+        },
+
+        handleDelete () {
+            if (this.selectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据")
+                return
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    return remove(this.ids)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    this.$refs.crud.toggleSelection()
+                })
+        },
+
+        beforeOpen (done, type) {
+            // if (["edit", "view"].includes(type)) {
+
+            // } else {
+            //     done()
+            // }
+        },
+
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+
+        refreshChange () {
+            // this.onLoad(this.page, this.query)
+        },
+
+        onLoad (page, params = {}) {
+            this.loading = true
+            this.loading = false
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.avue-upload__icon {
+    line-height: 6;
+}
+</style>
diff --git a/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
new file mode 100644
index 0000000..6cdee2b
--- /dev/null
+++ b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
@@ -0,0 +1,377 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot-scope="{type,size,row }" slot="menu">
+        <el-button icon="el-icon-detail" :size="size" :type="type" @click.stop="getDetail(row)">
+          详情
+        </el-button>
+      </template>
+    </avue-crud>
+
+
+    <el-drawer title="巡查详情" :visible.sync="isDetail" :append-to-body="true" size="60%" direction="rtl">
+
+      <el-card class="trackClass" style="overflow-y: auto">
+        <el-form :model="form" label-position="right" size="mini" class="taskinfoForm" label-width="70px">
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="巡检状态">
+                <el-input :disabled="true" v-model="form.$status" autocomplete="off"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="巡查内容">
+                <el-input :disabled="true" v-model="form.content" autocomplete="off"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="巡查图片">
+                <el-upload action="" :disabled="true" list-type="picture-card" :file-list="form.elUploadImageArr">
+                </el-upload>
+              </el-form-item>
+
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-card>
+
+      <!-- <DcMap v-if="isDetail" :is-detail="isDetail" :range="form.taskRoute" :patrolRoute="form.patrolRoute">
+      </DcMap> -->
+
+    </el-drawer>
+
+  </basic-container>
+</template>
+
+<script>
+  import {
+    getList,
+    remove,
+    update,
+    add,
+    getNotice,
+    upcomment
+  } from "@/api/patrol/placeChek"
+
+  import {
+    addPd,
+  } from "@/api/discuss/publicDiscuss"
+
+  import website from '@/config/website'
+
+
+  import {
+    getDistrictTree
+  } from "@/api/district/index"
+
+  import {
+    mapGetters
+  } from "vuex"
+
+  export default {
+    data() {
+      return {
+        isDetail: false,
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0,
+        },
+        datetime: "",
+        selectionList: [],
+        option: {
+          labelWidth: 120,
+          searchLabelWidth: 96,
+          searchShow: true,
+          searchMenuSpan: 3,
+          // menuWidth: 450,
+          // menu: false,
+          height: "auto",
+          calcHeight: 54,
+          dialogWidth: 950,
+          tip: false,
+          border: true,
+          addBtn: false,
+          delBtn: false,
+          //stripe:true,
+          index: true,
+          editBtn: false,
+          viewBtn: false,
+          // selection: true,
+          excelBtn: true,
+          dialogClickModal: false,
+          column: [{
+              label: "所属街道",
+              prop: "streetName",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              search: true,
+            },
+            {
+              label: "所属社区",
+              prop: "communityName",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              search: true,
+            },
+            {
+              label: "所属网格",
+              prop: "gridName",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              search: true,
+            },
+            {
+              label: "场所名称",
+              prop: "placeName",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              search: true,
+            },
+            {
+              label: "场所隐患",
+              prop: "remark",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+            },
+
+            {
+              label: "场所负责人",
+              prop: "principal",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              search: true,
+            },
+
+            {
+              label: "场所负责人电话",
+              prop: "principalPhone",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+            },
+            {
+              label: "场所地址",
+              prop: "location",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              searchLabelWidth: 46,
+            },
+            {
+              width: 110,
+              label: "签名",
+              prop: "signaturePath",
+              type: "upload",
+              listType: "picture-img",
+              span: 24,
+            },
+            {
+              label: "创建时间",
+              prop: "createTime",
+              span: 24,
+              row: true,
+              searchSpan: 4,
+              searchLabelWidth: 46,
+            },
+          ],
+        },
+        data: [],
+
+        districtTree: [],
+      }
+    },
+    watch: {
+      "form.articleType": {
+        handler(val) {
+          if (val) {
+            var videoUrl = this.findObject(this.option.column, "videoUrl")
+            var content = this.findObject(this.option.column, "content")
+            if (val.indexOf('ksp') != -1) {
+              videoUrl.display = true
+              content.display = false
+              videoUrl.rules = [{
+                required: false,
+                message: "请选择视频",
+                trigger: "blur",
+              }, ]
+            } else {
+              videoUrl.display = false
+              content.display = true
+              videoUrl.rules = ""
+            }
+          }
+        },
+        immediate: true,
+      }
+    },
+    computed: {
+      ...mapGetters(["permission", "userInfo"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.article_add, true),
+          viewBtn: this.vaildData(this.permission.article_view, true),
+          delBtn: this.vaildData(this.permission.article_delete, true),
+          editBtn: this.vaildData(this.permission.article_edit, true),
+        }
+      },
+
+    },
+    methods: {
+
+      getDetail(row) {
+        this.isDetail = true
+      },
+      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()
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据")
+          return
+        }
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            return remove(this.ids)
+          })
+          .then(() => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+            this.$refs.crud.toggleSelection()
+          })
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getNotice(this.form.id).then((res) => {
+            let data = res.data.data
+            // data.forEach(item=>{
+            if (data.url.length > 0) {
+              var urls = []
+              var names = data.url.split(",")
+              names.forEach(name => {
+                urls.push(website.minioUrl + name)
+              })
+              data.url = urls.join(",")
+            }
+            data.articleList = JSON.parse(data.articleRange)
+            this.form = data
+          })
+        }
+        // con
+        done()
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query)
+      },
+      onLoad(page, params = {}) {
+        this.loading = true
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
+          const data = res.data.data
+          this.page.total = data.total
+          this.data = data.records
+          this.data.forEach(item => {
+            if (item.signaturePath.length > 0) {
+              var urls = []
+              var names = item.signaturePath.split(",")
+              names.forEach(name => {
+                urls.push(website.minioUrl + name)
+              })
+              item.signaturePath = urls.join(",")
+            }
+          })
+          this.loading = false
+          this.selectionClear()
+        })
+        getDistrictTree({
+          filterFlag: 1
+        }).then((res) => {
+          const data = res.data.data
+          this.districtTree = data
+          const column = this.findObject(this.option.column, "articleList")
+          column.dicData = res.data.data
+          this.loading = false
+        })
+      },
+      updateFb(row) {
+        if (row.publish == "0") {
+          row.publish = "1"
+        } else {
+          row.publish = "0"
+        }
+        if (row.url.length > 0) {
+          var urls = []
+          var split = row.url.split(",")
+          split.forEach(url => {
+            var names = url.split("jczz/")
+            urls.push(names[1])
+          })
+          row.url = urls.join(",")
+        }
+        update(row).then(
+          () => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+            done()
+          },
+          (error) => {
+            window.console.log(error)
+            loading()
+          }
+        )
+      },
+
+    },
+  }
+</script>
+
+<style>
+  .avue-upload__icon {
+    line-height: 6;
+  }
+</style>
\ No newline at end of file
diff --git a/src/views/publicSecurity/ninePlaceManage/situationRectification.vue b/src/views/publicSecurity/ninePlaceManage/situationRectification.vue
new file mode 100644
index 0000000..62c0357
--- /dev/null
+++ b/src/views/publicSecurity/ninePlaceManage/situationRectification.vue
@@ -0,0 +1,279 @@
+<template>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+            @refresh-change="refreshChange" @on-load="onLoad">
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import {
+    mapGetters
+} from "vuex"
+import website from '@/config/website'
+
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menu: false,
+                header: false,
+                border: true,
+                index: true,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                dialogClickModal: false,
+                column: [{
+                    label: "场所名称",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "地址名称",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "场所类别",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "存在安全隐患或违法行为",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "是否下发《责令改正通知书》或是否处罚",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "是否整改完毕",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "完成整改时限",
+                    prop: "regionName",
+                    align: 'center',
+                }, {
+                    label: "xx派出所",
+                    prop: "regionName",
+                    align: 'center',
+                }],
+            },
+            data: []
+        }
+    },
+
+    computed: {
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.place_add, true),
+                viewBtn: this.vaildData(this.permission.place_view, true),
+                delBtn: this.vaildData(this.permission.place_delete, true),
+                editBtn: this.vaildData(this.permission.place_edit, true),
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach((ele) => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+
+    },
+    methods: {
+        rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            add({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            update({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowDel (row) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    row.isDeleted = 1
+                    return removeTask(row)
+                })
+                .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.$nextTick(() => {
+                this.$refs.crud && this.$refs.crud.toggleSelection()
+            })
+        },
+
+        handleDelete () {
+            if (this.selectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据")
+                return
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    return remove(this.ids)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    this.$refs.crud.toggleSelection()
+                })
+        },
+
+        beforeOpen (done, type) {
+            // if (["edit", "view"].includes(type)) {
+
+            // } else {
+            //     done()
+            // }
+        },
+
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+
+        refreshChange () {
+            // this.onLoad(this.page, this.query)
+        },
+
+        onLoad (page, params = {}) {
+            this.loading = true
+            this.loading = false
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.avue-upload__icon {
+    line-height: 6;
+}
+</style>

--
Gitblit v1.9.3