From 3c91057fb631695cc6edad5b876d58421dc10419 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 13 Jun 2024 17:45:27 +0800
Subject: [PATCH] 修复报错

---
 src/views/publicSecurity/ninePlaceManage/patrolRecord.vue |   32 +-
 src/views/discuss/userTopics.vue                          |   64 +++----
 src/views/publicSecurity/place.vue                        |    2 
 src/views/discuss/publicDiscuss.vue                       |  376 ++++++++++++++++++++--------------------
 src/views/publicSecurity/patrolRecord.vue                 |   28 --
 5 files changed, 236 insertions(+), 266 deletions(-)

diff --git a/src/views/discuss/publicDiscuss.vue b/src/views/discuss/publicDiscuss.vue
index 6e8fa27..f095de5 100644
--- a/src/views/discuss/publicDiscuss.vue
+++ b/src/views/discuss/publicDiscuss.vue
@@ -31,19 +31,15 @@
       <el-row>
         <!-- 列表模块 -->
         <el-table ref="table" v-loading="loading" :size="option.size" @selection-change="selectionChange" :data="data"
-                  style="width: 100%"
-                  :border="option.border">
+          style="width: 100%" :border="option.border">
           <el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>
           <el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>
           <el-table-column v-if="option.index" label="#" type="index" width="50" align="center">
           </el-table-column>
           <template v-for="(item,index) in option.column">
             <!-- table字段 -->
-            <el-table-column v-if="item.hide!==true"
-                             :prop="item.prop"
-                             :label="item.label"
-                             :width="item.width"
-                             :key="index">
+            <el-table-column v-if="item.hide!==true" :prop="item.prop" :label="item.label" :width="item.width"
+              :key="index">
             </el-table-column>
           </template>
           <!-- 操作栏模块 -->
@@ -58,15 +54,9 @@
       </el-row>
       <el-row>
         <!-- 分页模块 -->
-        <el-pagination
-          align="right" background
-          @size-change="sizeChange"
-          @current-change="currentChange"
-          :current-page="page.currentPage"
-          :page-sizes="[10, 20, 30, 40, 50, 100]"
-          :page-size="page.pageSize"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="page.total">
+        <el-pagination align="right" background @size-change="sizeChange" @current-change="currentChange"
+          :current-page="page.currentPage" :page-sizes="[10, 20, 30, 40, 50, 100]" :page-size="page.pageSize"
+          layout="total, sizes, prev, pager, next, jumper" :total="page.total">
         </el-pagination>
       </el-row>
       <!-- 表单模块 -->
@@ -76,7 +66,8 @@
         </el-form>
         <!-- 表单按钮 -->
         <span v-if="!view" slot="footer" class="dialog-footer">
-          <el-button type="primary" icon="el-icon-circle-check" :size="option.size" @click="handleSubmit">提 交</el-button>
+          <el-button type="primary" icon="el-icon-circle-check" :size="option.size" @click="handleSubmit">提
+            交</el-button>
           <el-button icon="el-icon-circle-close" :size="option.size" @click="box = false">取 消</el-button>
         </span>
       </el-dialog>
@@ -85,186 +76,195 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/discuss/publicDiscuss";
+  import {
+    getList,
+    getDetail,
+    add,
+    // update,
+    // remove
+  } from "@/api/discuss/publicDiscuss";
   import option from "@/option/discuss/publicDiscuss";
-  import {mapGetters} from "vuex";
-  import {getDictionary} from '@/api/system/dict'
+  import {
+    mapGetters
+  } from "vuex";
+  import {
+    getDictionary
+  } from '@/api/system/dict'
 
-export default {
-  data() {
-    return {
-      // 弹框标题
-      title: '',
-      // 是否展示弹框
-      box: false,
-      // 是否显示查询
-      search: true,
-      // 加载中
-      loading: true,
-      // 是否为查看模式
-      view: false,
-      // 查询信息
-      query: {},
-      // 分页信息
-      page: {
-        currentPage: 1,
-        pageSize: 10,
-        total: 40
+  export default {
+    data() {
+      return {
+        // 弹框标题
+        title: '',
+        // 是否展示弹框
+        box: false,
+        // 是否显示查询
+        search: true,
+        // 加载中
+        loading: true,
+        // 是否为查看模式
+        view: false,
+        // 查询信息
+        query: {},
+        // 分页信息
+        page: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 40
+        },
+        // 表单数据
+        form: {},
+        // 选择行
+        selectionList: [],
+        // 表单配置
+        option: option,
+        // 表单列表
+        data: [],
+      }
+    },
+    mounted() {
+      this.init();
+      this.onLoad(this.page);
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      init() {},
+      searchHide() {
+        this.search = !this.search;
       },
-      // 表单数据
-      form: {},
-      // 选择行
-      selectionList: [],
-      // 表单配置
-      option: option,
-      // 表单列表
-      data: [],
-    }
-  },
-  mounted() {
-    this.init();
-    this.onLoad(this.page);
-  },
-  computed: {
-    ...mapGetters(["permission"]),
-    ids() {
-      let ids = [];
-      this.selectionList.forEach(ele => {
-        ids.push(ele.id);
-      });
-      return ids.join(",");
-    }
-  },
-  methods: {
-    init() {
-    },
-    searchHide() {
-      this.search = !this.search;
-    },
-    searchChange() {
-      this.onLoad(this.page);
-    },
-    searchReset() {
-      this.query = {};
-      this.page.currentPage = 1;
-      this.onLoad(this.page);
-    },
-    handleSubmit() {
-      if (!this.form.id) {
-        add(this.form).then(() => {
-          this.box = false;
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+      searchChange() {
+        this.onLoad(this.page);
+      },
+      searchReset() {
+        this.query = {};
+        this.page.currentPage = 1;
+        this.onLoad(this.page);
+      },
+      handleSubmit() {
+        if (!this.form.id) {
+          add(this.form).then(() => {
+            this.box = false;
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+        } else {
+          // update(this.form).then(() => {
+          //   this.box = false;
+          //   this.onLoad(this.page);
+          //   this.$message({
+          //     type: "success",
+          //     message: "操作成功!"
+          //   });
+          // })
+        }
+      },
+      handleAdd() {
+        this.title = '新增'
+        this.form = {}
+        this.box = true
+      },
+      handleEdit(row) {
+        this.title = '编辑'
+        this.box = true
+        getDetail(row.id).then(res => {
+          this.form = res.data.data;
         });
-      } else {
-        update(this.form).then(() => {
-          this.box = false;
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+      },
+      handleView(row) {
+        this.title = '查看'
+        this.view = true;
+        this.box = true;
+        getDetail(row.id).then(res => {
+          this.form = res.data.data;
+        });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            // return remove(this.ids);
+          })
+          .then(() => {
+            this.selectionClear();
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
-        })
-      }
-    },
-    handleAdd() {
-      this.title = '新增'
-      this.form = {}
-      this.box = true
-    },
-    handleEdit(row) {
-      this.title = '编辑'
-      this.box = true
-      getDetail(row.id).then(res => {
-        this.form = res.data.data;
-      });
-    },
-    handleView(row) {
-      this.title = '查看'
-      this.view = true;
-      this.box = true;
-      getDetail(row.id).then(res => {
-        this.form = res.data.data;
-      });
-    },
-    handleDelete() {
-      if (this.selectionList.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(this.ids);
-        })
-        .then(() => {
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            // return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      beforeClose(done) {
+        done()
+        this.form = {};
+        this.view = false;
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.table.clearSelection();
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage;
+        this.onLoad(this.page);
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize;
+        this.onLoad(this.page);
+      },
+      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.loading = false;
           this.selectionClear();
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
         });
-    },
-    rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return remove(row.id);
-        })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
-          });
-        });
-    },
-    beforeClose(done) {
-      done()
-      this.form = {};
-      this.view = false;
-    },
-    selectionChange(list) {
-      this.selectionList = list;
-    },
-    selectionClear() {
-      this.selectionList = [];
-      this.$refs.table.clearSelection();
-    },
-    currentChange(currentPage) {
-      this.page.currentPage = currentPage;
-      this.onLoad(this.page);
-    },
-    sizeChange(pageSize) {
-      this.page.pageSize = pageSize;
-      this.onLoad(this.page);
-    },
-    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.loading = false;
-        this.selectionClear();
-      });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.el-pagination {
-  margin-top: 20px;
-}
-</style>
+  .el-pagination {
+    margin-top: 20px;
+  }
+</style>
\ No newline at end of file
diff --git a/src/views/discuss/userTopics.vue b/src/views/discuss/userTopics.vue
index 739f093..af74493 100644
--- a/src/views/discuss/userTopics.vue
+++ b/src/views/discuss/userTopics.vue
@@ -1,30 +1,12 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
-               :table-loading="loading"
-               :data="data"
-               :page.sync="page"
-               :permission="permissionList"
-               :before-open="beforeOpen"
-               v-model="form"
-               ref="crud"
-               @row-update="rowUpdate"
-               @row-save="rowSave"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :permission="permissionList"
+      :before-open="beforeOpen" v-model="form" ref="crud" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
       <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.userTopics_delete"
-                   @click="handleDelete">删 除
+        <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.userTopics_delete"
+          @click="handleDelete">删 除
         </el-button>
       </template>
     </avue-crud>
@@ -32,9 +14,17 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/discuss/userTopics";
+  import {
+    getList,
+    getDetail,
+    add,
+    update,
+    remove
+  } from "@/api/discuss/userTopics";
   import option from "@/option/discuss/userTopics";
-  import {mapGetters} from "vuex";
+  import {
+    mapGetters
+  } from "vuex";
 
   export default {
     data() {
@@ -99,10 +89,10 @@
       },
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(row.id);
           })
@@ -120,10 +110,10 @@
           return;
         }
         this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
           .then(() => {
             return remove(this.ids);
           })
@@ -161,10 +151,10 @@
         this.selectionList = [];
         this.$refs.crud.toggleSelection();
       },
-      currentChange(currentPage){
+      currentChange(currentPage) {
         this.page.currentPage = currentPage;
       },
-      sizeChange(pageSize){
+      sizeChange(pageSize) {
         this.page.pageSize = pageSize;
       },
       refreshChange() {
@@ -185,4 +175,4 @@
 </script>
 
 <style>
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
index 5667986..05e657f 100644
--- a/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
+++ b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
@@ -113,7 +113,7 @@
     remove,
     update,
     add,
-    getNotice,
+    // getNotice,
     upcomment
   } from "@/api/patrol/placeChek"
 
@@ -513,20 +513,20 @@
       },
       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
-          })
+          // 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()
@@ -769,4 +769,4 @@
       }
     }
   }
-</style>
+</style>
\ No newline at end of file
diff --git a/src/views/publicSecurity/patrolRecord.vue b/src/views/publicSecurity/patrolRecord.vue
index 6cdee2b..e5237c2 100644
--- a/src/views/publicSecurity/patrolRecord.vue
+++ b/src/views/publicSecurity/patrolRecord.vue
@@ -1,7 +1,7 @@
 <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"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
       @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">
@@ -56,7 +56,6 @@
     remove,
     update,
     add,
-    getNotice,
     upcomment
   } from "@/api/patrol/placeChek"
 
@@ -277,26 +276,7 @@
             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
       },
@@ -357,11 +337,11 @@
               type: "success",
               message: "操作成功!",
             })
-            done()
+            // done()
           },
           (error) => {
             window.console.log(error)
-            loading()
+            // loading()
           }
         )
       },
diff --git a/src/views/publicSecurity/place.vue b/src/views/publicSecurity/place.vue
index 3a89237..2b1f668 100644
--- a/src/views/publicSecurity/place.vue
+++ b/src/views/publicSecurity/place.vue
@@ -977,7 +977,7 @@
       handleImport() {
         this.excelBox = true
       },
-      uploadAfter(res, done, loading, column) {
+      uploadAfter(res, done, loading) {
         this.excelBox = false
         this.onLoad(this.page)
         this.$message({

--
Gitblit v1.9.3