zhongrj
2024-01-05 335642b3d8a4cdda3d43ea5a784087bdccdd2f73
src/views/article/components/publicSignUpChild.vue
@@ -2,8 +2,8 @@
  <basicContainer>
    <avue-crud :data="data" ref="crud" :table-loading="loading" @current-change="currentChange"
      @search-change="searchChange" @search-reset="searchReset" @size-change="sizeChange" :option="option"
      v-model="data" :page="page" @selection-change="selectionChange" @row-del="rowDel" @refresh-change="refreshChange"
      @on-load="onLoad">
            v-model="data" :page="page" @selection-change="selectionChange" @row-del="rowDel"
            @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> -->
@@ -46,14 +46,14 @@
    addPd,
    updatePd,
    removePd,
  } from "@/api/discuss/publicDiscuss";
} from "@/api/discuss/publicDiscuss"
  import {
    getPageUser,
  } from "@/api/discuss/userPublicEnroll";
  import option from "@/option/discuss/publicDiscuss";
} from "@/api/discuss/userPublicEnroll"
import option from "@/option/discuss/publicDiscuss"
  import {
    mapGetters
  } from "vuex";
} from "vuex"
  import {
    getDictionary
  } from '@/api/system/dict'
@@ -74,7 +74,9 @@
            label: '手机',
            prop: 'phone'
          }, {
            label: '小区',
                    width: 220,
                    overHidden: true,
                    label: '小区名称',
            prop: 'aoiName'
          }, {
            label: '地址',
@@ -239,11 +241,11 @@
    computed: {
      ...mapGetters(["permission"]),
      ids() {
        let ids = [];
            let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
                ids.push(ele.id)
            })
            return ids.join(",")
      }
    },
    methods: {
@@ -253,12 +255,12 @@
      },
      getUser(page, params = {}) {
        getPageUser(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.pageUser.total = data.total;
          this.dataUser = data.records;
          this.loading = false;
          this.selectionClear();
        });
                const data = res.data.data
                this.pageUser.total = data.total
                this.dataUser = data.records
                this.loading = false
                this.selectionClear()
            })
      },
      userHandleClose() {
        this.dialogVisiblesUser = false
@@ -270,7 +272,7 @@
      openDilog(row, type) {
        this.dialogVisibles = true
        this.discussForm = row
        let times = new Date(row.endTime).getTime();
            let times = new Date(row.endTime).getTime()
        this.discussForm.endTime = times
        console.table(this.discussForm)
        if (type == 0) {
@@ -281,35 +283,35 @@
      },
      searchHide() {
        this.search = !this.search;
            this.search = !this.search
      },
      searchChange() {
        this.onLoad(this.page);
            this.onLoad(this.page)
      },
      searchReset() {
        this.query = {};
        this.page.currentPage = 1;
        this.onLoad(this.page);
            this.query = {}
            this.page.currentPage = 1
            this.onLoad(this.page)
      },
      handleSubmit(form, done) {
        done()
        if (!this.discussForm.id) {
          addPd(this.discussForm).then(() => {
            this.dialogVisibles = false
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
        } else {
          updatePd(this.discussForm).then(() => {
            this.dialogVisibles = false
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
                    })
          })
        }
      },
@@ -322,21 +324,21 @@
        this.title = '编辑'
        this.box = true
        getDetailPd(row.id).then(res => {
          this.form = res.data.data;
        });
                this.form = res.data.data
            })
      },
      handleView(row) {
        this.title = '查看'
        this.view = true;
        this.box = true;
            this.view = true
            this.box = true
        getDetailPd(row.id).then(res => {
          this.form = res.data.data;
        });
                this.form = res.data.data
            })
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
                this.$message.warning("请选择至少一条数据")
                return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
@@ -344,16 +346,16 @@
            type: "warning"
          })
          .then(() => {
            return removePd(this.ids);
                    return removePd(this.ids)
          })
          .then(() => {
            this.selectionClear();
            this.onLoad(this.page);
                    this.selectionClear()
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
@@ -362,50 +364,50 @@
            type: "warning"
          })
          .then(() => {
            return remove(row.id);
                    return remove(row.id)
          })
          .then(() => {
            this.onLoad(this.page);
                    this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
                    })
                })
      },
      beforeClose(done) {
        done()
        this.form = {};
        this.view = false;
            this.form = {}
            this.view = false
      },
      selectionChange(list) {
        this.selectionList = list;
            this.selectionList = list
      },
      selectionClear() {
        this.selectionList = [];
            this.selectionList = []
        // this.$refs.table.clearSelection();
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage;
        this.onLoad(this.page);
            this.page.currentPage = currentPage
            this.onLoad(this.page)
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize;
        this.onLoad(this.page);
            this.page.pageSize = pageSize
            this.onLoad(this.page)
      },
      onLoad(page, params = {
        eventType: 0
      }) {
        this.loading = true;
            this.loading = true
        getListPd(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();
        });
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
      }
    }
  };
}
</script>
<style lang="scss" scoped>