From a5c990745a463bc3b0d3eccf87228d922134614b Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Fri, 19 Apr 2024 17:09:54 +0800
Subject: [PATCH] 题目+轮播图+议事

---
 src/views/publicSecurity/keynotePlaceManage.vue        |    1 
 src/views/article/components/discussionManageChild.vue |   18 +++
 src/views/article/rotation.vue                         |    2 
 src/views/patrol/addsubject.vue                        |   27 ++--
 src/api/patrol/patrolGroup.js                          |    2 
 src/views/patrol/subject.vue                           |   11 +
 src/views/patrol/editsubject.vue                       |  253 ++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 293 insertions(+), 21 deletions(-)

diff --git a/src/api/patrol/patrolGroup.js b/src/api/patrol/patrolGroup.js
index e6e6b61..01ee11e 100644
--- a/src/api/patrol/patrolGroup.js
+++ b/src/api/patrol/patrolGroup.js
@@ -22,7 +22,7 @@
 
 export const remove = (ids) => {
   return request({
-    url: '/api/patrol/patrolGroup/remove',
+    url: '/api/patrol/patrolGroup/deleteBatch',
     method: 'post',
     params: {
       ids,
diff --git a/src/views/article/components/discussionManageChild.vue b/src/views/article/components/discussionManageChild.vue
index 3adc6a6..490fc81 100644
--- a/src/views/article/components/discussionManageChild.vue
+++ b/src/views/article/components/discussionManageChild.vue
@@ -218,6 +218,24 @@
             },
 
             {
+              label: "开始时间",
+              span: 12,
+              offset: 8,
+              row: true,
+              prop: "startTime",
+              type: "datetime",
+              format: "yyyy-MM-dd HH:mm:ss",
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
+              // format: "yyyy-MM-dd hh:mm:ss",
+              // valueFormat: "yyyy-MM-dd hh:mm:ss",
+              rules: [{
+                required: true,
+                message: "请选择开始时间",
+                trigger: "blur",
+              }, ],
+            },
+
+            {
               label: "截止时间",
               span: 12,
               offset: 8,
diff --git a/src/views/article/rotation.vue b/src/views/article/rotation.vue
index 9f2219a..a66d748 100644
--- a/src/views/article/rotation.vue
+++ b/src/views/article/rotation.vue
@@ -178,7 +178,7 @@
               editDisplay: false,
               addDisplay: false,
               type: 'select',
-              dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&eventType=1&districtId={{rotationRange}}`,
+              dicUrl: `/api/blade-article/article/getArticleByDistrictId?type=4&publish=1&eventType=1&districtId={{rotationRange}}`,
               formslot: true,
               // cascader: ['vote'],
               props: {
diff --git a/src/views/patrol/addsubject.vue b/src/views/patrol/addsubject.vue
index e1f3dd6..60445cc 100644
--- a/src/views/patrol/addsubject.vue
+++ b/src/views/patrol/addsubject.vue
@@ -1,7 +1,7 @@
 <template>
-  <el-dialog :title="this.id ? '修改' : '新增'" width="60%" modal-append-to-body="false" append-to-body="true"
-    :close-on-click-model="true" :visible.sync="visible" @close="closeDialog">
-    <avue-form ref="form" :option="option" v-model="form" @submit="submit"></avue-form>
+  <el-dialog :title="'新增'" width="60%" modal-append-to-body="false" append-to-body="true" :close-on-click-model="true"
+    :visible.sync="visible" @close="closeDialog">
+    <avue-form v-show="isShow" ref="form" :option="option" v-model="form" @submit="submit"></avue-form>
   </el-dialog>
 </template>
 
@@ -15,6 +15,7 @@
     name: "add",
     data() {
       return {
+        isShow: false,
         inputs: {
           input1: 1,
         },
@@ -169,20 +170,16 @@
       },
       //初始化
       inits(row) {
-        // var formula = "2 + 3 * (4 - 1)"; // 要转换的字符串表达式
-        // var result = eval(formula); // 调用eval()函数进行计算
-        // console.log(result); // 输出结果:9
-        // console.table(row); // 输出结果为 "2"
-        // this.id = id || 0;
         this.visible = true;
+        this.isShow = true;
         this.form = row
-        // this.list = [{
-        //   data: 1
-        // }];
-        // if (this.id) {
-        //   //查询题目信息
-        //   this.getSubjectInfo(id);
-        // }
+      },
+
+      //初始化
+      init() {
+        this.visible = true;
+        this.isShow = true;
+        this.form = {}
       },
 
       //加一行
diff --git a/src/views/patrol/editsubject.vue b/src/views/patrol/editsubject.vue
new file mode 100644
index 0000000..beea736
--- /dev/null
+++ b/src/views/patrol/editsubject.vue
@@ -0,0 +1,253 @@
+<template>
+  <el-dialog :title="'修改'" width="60%" modal-append-to-body="false" append-to-body="true" :close-on-click-model="true"
+    :visible.sync="visible" @close="closeDialog">
+    <avue-form v-show="isShow" ref="form" :option="option" v-model="form" @submit="submit"></avue-form>
+  </el-dialog>
+</template>
+
+<script>
+  import {
+    // getList,
+    addTwo
+  } from "@/api/patrol/patrolGroup";
+
+  export default {
+    name: "edit",
+    data() {
+      return {
+        isShow: false,
+        inputs: {
+          input1: 1,
+        },
+        editFlag: false,
+        optionContentAId: null,
+        optionContentBId: null,
+        optionContentCId: null,
+        optionContentDId: null,
+        optionContentEId: null,
+        arrContent: ["1"],
+        list: [{
+            data: 1,
+          },
+          {
+            data: 1,
+          },
+          {
+            data: 1,
+          },
+        ],
+        visible: false,
+        choicesType: "0",
+        loading: false,
+        form: {},
+        option: {
+          height: "auto",
+          calcHeight: 80,
+          tip: false,
+          searchShow: true,
+          searchMenuSpan: 6,
+          border: true, //liu
+          stripe: true,
+          align: "center",
+          index: true,
+          selection: true,
+          viewBtn: true,
+          defaultExpandAll: true,
+          dialogClickModal: false,
+          column: [{
+              label: "类型",
+              prop: "type",
+              type: "select",
+              props: {
+                label: "title",
+                value: "key",
+              },
+              dicUrl: "/api/blade-system/dict-biz/tree?code=subject_max",
+              rules: [{
+                required: true,
+                message: "请选择类型",
+                trigger: "blur",
+              }, ],
+              span: 24,
+            },
+            {
+              prop: "id",
+              display: false,
+              type: 'input',
+            },
+            {
+              label: "题目名称",
+              prop: "name",
+              search: true,
+              type: "textarea",
+              rules: [{
+                required: true,
+                message: "请输入题目名称",
+                trigger: "blur",
+              }, ],
+              span: 24,
+            },
+            {
+              label: '选项内容',
+              prop: 'patrolGroupItemList',
+              type: 'dynamic',
+              span: 24,
+              children: {
+                align: 'center',
+                headerAlign: 'center',
+                rowAdd: (done) => {
+                  // this.$message.success('新增回调');
+                  done({
+                    input: '默认值'
+                  });
+                },
+                rowDel: (row, done) => {
+                  if (row.id) {
+                    row.isDeleted = 1
+                    this.deleteList.push(row)
+
+                  }
+                  // this.$message.success('删除回调' + JSON.stringify(row));
+                  done();
+                },
+                column: [{
+                  label: '选项标题',
+                  prop: 'itemsName',
+                  type: 'input',
+                  rules: [{
+                    required: true,
+                    message: "请输入选项标题",
+                    trigger: "blur",
+                  }, ],
+                }, {
+                  label: '选项类型',
+                  prop: 'type',
+                  type: "select",
+                  props: {
+                    label: "title",
+                    value: "key",
+                  },
+                  dicUrl: "/api/blade-system/dict-biz/tree?code=subject",
+                  rules: [{
+                    required: true,
+                    message: "请输入选项类型",
+                    trigger: "blur",
+                  }, ],
+                }]
+              }
+            },
+          ],
+        },
+        formCheckbox: {},
+
+        formJudge: {},
+        formFill: {},
+        deleteList: [],
+
+        data: [{
+          discussContent: '',
+          optionContent: ''
+        }, {
+          discussContent: '',
+          optionContent: ''
+        }],
+      };
+    },
+    computed: {
+      // ...mapState({
+      //   userInfo: (state) => state.user.userInfo,
+      // }),
+    },
+    mounted() {},
+    methods: {
+      add() {
+        this.editFlag = true
+      },
+
+      edit(row) {
+        this.disCussFrom = row
+        this.editFlag = true
+      },
+      //初始化
+      inits(row) {
+        this.visible = true;
+        this.isShow = true;
+        this.form = row
+      },
+
+      //初始化
+      init() {
+        this.visible = true;
+        this.isShow = true;
+        this.$refs.form.resetFields();
+        this.form = {}
+      },
+
+      //加一行
+      addRows() {
+        //获取已有行的数据
+        // debugger;
+        if (this.index == 6) {
+          return;
+        }
+        this.index++;
+        this.list.push({
+          data: this.index,
+        });
+        this.inputs[`input${this.index + 1}`] = "";
+      },
+      //减一行
+      deleteRows(index) {
+        if (this.index == 1) {
+          return;
+        }
+        this.index--;
+        this.list.splice(index, 1);
+      },
+      //单选题提交(新增)数据
+      submit(row, done, loading) {
+        var that = this;
+        // console.table(this.deleteList)
+        row.patrolGroupItemList = row.patrolGroupItemList.concat(this.deleteList)
+        addTwo(row).then(
+          () => {
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            });
+            that.visible = false;
+            that.$refs.form.resetFields();
+            this.$emit('refreshPage');
+            done();
+          },
+          (error) => {
+            window.console.log(error);
+            loading();
+          }
+        );
+      },
+      //关闭窗口清除数据
+      closeDialog() {
+        this.$refs.form.resetFields();
+      },
+    },
+  };
+</script>
+<style scoped>
+  .optionContent-suffix {
+    margin-top: 5px;
+  }
+
+  .optionContent-suffix span {
+    margin-left: -20px;
+  }
+
+  .optionContent-suffix .optionContent-input {
+    width: 90%;
+    margin-left: 10px;
+  }
+
+  .optionContent-suffix .optionContent-botton {
+    margin-left: 10px;
+  }
+</style>
\ No newline at end of file
diff --git a/src/views/patrol/subject.vue b/src/views/patrol/subject.vue
index a50a253..a29c4fe 100644
--- a/src/views/patrol/subject.vue
+++ b/src/views/patrol/subject.vue
@@ -8,7 +8,7 @@
       @search-reset="questionBankSearchReset" @current-change="questionBankCurrentChange"
       @size-change="questionBankSizeChange" @row-del="questionBankHandleDel" @on-load="questionBankOnLoad">
       <template slot="menuLeft">
-        <el-button type="primary" size="small" icon="el-icon-plus" @click="questionBankHandleAdd">新 增
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="questionBankHandleAdd()">新 增
         </el-button>
       </template>
 
@@ -30,6 +30,7 @@
       </avue-form>
     </el-dialog> -->
     <addsubject ref="addsubject" v-on:refreshPage="refreshPage"></addsubject>
+    <editsubject ref="editsubject" v-on:refreshPage="refreshPage"></editsubject>
   </basic-container>
 </template>
 
@@ -40,6 +41,7 @@
   } from "@/api/patrol/patrolGroup";
 
   import addsubject from "./addsubject.vue";
+  import editsubject from "./editsubject.vue";
   // import {
   //   mapGetters,
   //   mapState
@@ -50,7 +52,8 @@
   } from "@/util/auth";
   export default {
     components: {
-      addsubject
+      addsubject,
+      editsubject
     },
     data() {
       return {
@@ -187,10 +190,10 @@
         this.questionBankOnLoad(this.questionBankPage);
       },
       questionBankHandleAdd() {
-        this.$refs.addsubject.inits();
+        this.$refs.addsubject.init();
       },
       questionBankHandleEdit(row) {
-        this.$refs.addsubject.inits(row);
+        this.$refs.editsubject.inits(row);
       },
       questionBankOnLoad(page, params = {}) {
         params = this.questionBankSearch;
diff --git a/src/views/publicSecurity/keynotePlaceManage.vue b/src/views/publicSecurity/keynotePlaceManage.vue
index 952b112..ff77f74 100644
--- a/src/views/publicSecurity/keynotePlaceManage.vue
+++ b/src/views/publicSecurity/keynotePlaceManage.vue
@@ -822,6 +822,7 @@
         let values = {
           ...params,
         }
+        values.type = 1
 
         this.loading = true
         getTaskPlaceSelfCheckList(page.currentPage, page.pageSize, values).then((res) => {

--
Gitblit v1.9.3