linwe
2024-08-09 5e2aafeede13d337380f736567caf74f49713be7
src/views/propertySupervision/ownersCommittee.vue
@@ -4,30 +4,7 @@
      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="menuLeft">
        <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删
          除
        </el-button>
      </template> -->
      <!-- <template slot-scope="{type,size,row }" slot="menu">
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
          撤销
        </el-button>
        <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)">
          发布
        </el-button>
      </template> -->
      <template slot-scope="{ row, size }" slot="publish">
        <el-tag :size="size" :type="showStatus(row.publish, 1).type" v-text="showStatus(row.publish, 1).text">
        </el-tag>
      </template>
      <template slot-scope="{ row, size }" slot="iscomment">
        <el-tag :size="size" :type="showStatus(row.iscomment, 2).type" v-text="showStatus(row.iscomment, 2).text">
        </el-tag>
      </template>
    </avue-crud>
  </basic-container>
@@ -91,26 +68,25 @@
        datetime: "",
        selectionList: [],
        option: {
          labelWidth: 96,
          labelWidth: 120,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          menuWidth: 450,
          addBtn: false,
          menu: false,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          border: true,
          //stripe:true,
          index: true,
          addBtn: false,
          viewBtn: false,
          // selection: true,
          delBtn: false,
          editBtn: false,
          selection: false,
          excelBtn: false,
          menu: false,
          // excelBtn: true,
          dialogClickModal: false,
          column: [{
              label: "标题",
@@ -119,6 +95,7 @@
              row: true,
              searchSpan: 4,
              search: true,
              searchLabelWidth: 46,
              rules: [{
                required: true,
                message: "请输入业主大会标题",
@@ -141,6 +118,24 @@
              span: 24,
            },
            {
              hide: true,
              parent: false,
              label: "公示范围",
              prop: "articleList",
              type: 'tree',
              dicData: [],
              props: {
                label: "name",
                value: 'id'
              },
              span: 12,
              rules: [{
                required: true,
                message: "请选择公示范围",
                trigger: "blur",
              }, ],
            },
            {
              width: 100,
              label: "业主大会类型",
              prop: "type",
@@ -158,38 +153,6 @@
                label: "业主大会",
                value: 5,
              }],
            },
            // {
            //   label: "招标来源",
            //   prop: "sourceName",
            //   search: true,
            //   searchSpan: 4,
            //   span: 24,
            //   rules: [{
            //     required: true,
            //     message: "请输入招标类型",
            //     trigger: "blur",
            //   }, ],
            // },
            {
              label: "公示范围",
              prop: "articleList",
              span: 12,
              minRows: 2,
              type: "cascader",
              multiple: true,
              tags: true,
              dicData: [],
              rules: [{
                required: true,
                message: "请选择业主大会范围",
                trigger: "blur",
              }, ],
              props: {
                label: "name",
                value: 'id'
              },
              hide: true,
            },
            {
              label: "发布时间",
@@ -211,6 +174,44 @@
              }, ],
            },
            {
              // hide: true,
              parent: false,
              label: "小区名称",
              prop: "districtId",
              type: 'tree',
              dicUrl: `/api/blade-district/district/getDistrictTree`,
              props: {
                label: "name",
                value: "id"
              },
              defaultExpandedKeys: ["361102003"],
              span: 12,
              width: 220,
              overHidden: true,
            },
            {
              width: 110,
              label: "所属街道",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "streetName",
              search: true,
              searchSpan: 4
            },
            {
              width: 156,
              overHidden: true,
              label: "所属社区",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false,
              prop: "communityName",
              search: true,
              searchSpan: 4
            },
            {
              width: 144,
              label: "发布时间",
              prop: "createTime",
@@ -219,47 +220,50 @@
              valueFormat: "yyyy-MM-dd HH:mm:ss",
            },
            // {
            //   width: 100,
            //   label: "发布状态",
            //   prop: "publish",
            //   value: "0",
            //   slot: true,
            //   searchSpan: 4,
            //   search: true,
            //   type: "select",
            //   display: false,
            //   rules: [{
            //     required: true,
            //     message: "请选择发布状态",
            //     trigger: "blur",
            //   }, ],
            //   dicData: [{
            //       label: "未发布",
            //       value: "0",
            //     },
            //     {
            //       label: "已发布",
            //       value: "1",
            //     }
            //   ],
            // },
            // {
            //   width: 100,
            //   label: "评论区",
            //   prop: "iscomment",
            //   slot: true,
            //   type: "select",
            //   dicData: [{
            //       label: "关闭",
            //       value: "0",
            //     },
            //     {
            //       label: "开启",
            //       value: "1",
            //     }
            //   ],
            // },
            {
              width: 100,
              label: "发布状态",
              prop: "publish",
              value: "0",
              slot: true,
              searchSpan: 4,
              search: true,
              type: "select",
              display: false,
              rules: [{
                required: true,
                message: "请选择发布状态",
                trigger: "blur",
              }, ],
              dicData: [{
                  label: "未发布",
                  value: "0",
                },
                {
                  label: "已发布",
                  value: "1",
                }
              ],
            },
            {
              width: 100,
              label: "评论区",
              prop: "iscomment",
              slot: true,
              type: "switch",
              activeColor: "#13ce66",
              inactiveColor: "#ccc",
              value: '1',
              dicData: [{
                  label: "关闭",
                  value: "0",
                },
                {
                  label: "开启",
                  value: "1",
                }
              ],
            },
            {
              label: "内容",
              prop: "content",
@@ -343,6 +347,14 @@
      }
    },
    methods: {
      iscommentInput(e, data) {
        upcomment(data.id, e).then(() => {
          this.$message({
            type: "success",
            message: "操作成功!",
          })
        })
      },
      openDilog(row, type) {
        this.dialogVisibles = true
@@ -395,7 +407,10 @@
          })
          row.url = urls.join(",")
        }
        add(row).then(
        add({
          ...row,
          districtId: row.articleList
        }).then(
          () => {
            this.onLoad(this.page)
            this.$message({
@@ -422,7 +437,10 @@
          row.url = urls.join(",")
        }
        update(row).then(
        update({
          ...row,
          district_id: row.articleList
        }).then(
          () => {
            this.onLoad(this.page)
            this.$message({
@@ -460,6 +478,7 @@
      },
      searchChange(params, done) {
        this.query = params
        this.query.publish = 1
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
@@ -532,8 +551,8 @@
        if (dateTime) {
          values = {
            ...params,
            startTime: dateTime[0],
            endTime: dateTime[1],
            startTime: dateTime[0] + ' 00:00:01',
            endTime: dateTime[1] + ' 23:59:59',
            ...this.query,
          }
          values.dateTime = null
@@ -559,7 +578,9 @@
          this.loading = false
          this.selectionClear()
        })
        getDistrictTree(params = {}).then((res) => {
        getDistrictTree({
          filterFlag: 1
        }).then((res) => {
          const data = res.data.data
          this.districtTree = data
          const column = this.findObject(this.option.column, "articleList")
@@ -643,8 +664,16 @@
  }
</script>
<style>
<style lang="scss" scoped>
  .avue-upload__icon {
    line-height: 6;
  }
  :deep(.avue-form__menu--center) {
    text-align: left;
  }
  :deep(.avue-form__menu--center .el-button) {
    margin: 0 5px 0 0;
  }
</style>