lin
2024-04-19 a5c990745a463bc3b0d3eccf87228d922134614b
题目+轮播图+议事
6 files modified
1 files added
314 ■■■■■ changed files
src/api/patrol/patrolGroup.js 2 ●●● patch | view | raw | blame | history
src/views/article/components/discussionManageChild.vue 18 ●●●●● patch | view | raw | blame | history
src/views/article/rotation.vue 2 ●●● patch | view | raw | blame | history
src/views/patrol/addsubject.vue 27 ●●●●● patch | view | raw | blame | history
src/views/patrol/editsubject.vue 253 ●●●●● patch | view | raw | blame | history
src/views/patrol/subject.vue 11 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/keynotePlaceManage.vue 1 ●●●● patch | view | raw | blame | history
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,
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,
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: {
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 = {}
      },
      //加一行
src/views/patrol/editsubject.vue
New file
@@ -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>
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;
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) => {