linwei
2024-01-17 e44ebe68e07fc2e96bf0d23e6e1a9ccf4c6e59b8
src/views/article/components/deitDiscussion.vue
@@ -40,7 +40,7 @@
      </div>
    </el-dialog>
    <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="50%" :before-close="userHandleClose">
    <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose">
      <avue-crud :data="userData" :page="userPage" :option="userOption"></avue-crud>
    </el-dialog>
  </div>
@@ -58,6 +58,8 @@
  import {
    getPage
  } from "@/api/discuss/userTopics"
  import website from '@/config/website'
  import {
@@ -186,23 +188,49 @@
        userData: [],
        userOption: {
          labelWidth: 96,
          searchLabelWidth: 96,
          searchShow: true,
          searchMenuSpan: 3,
          // menuWidth: 500,
          height: "auto",
          calcHeight: 54,
          dialogWidth: 950,
          tip: false,
          border: false,
          //stripe:true,
          index: true,
          editBtn: false,
          addBtn: false,
          menu: false,
          viewBtn: false,
          selection: true,
          excelBtn: true,
          dialogClickModal: false,
          column: [{
            label: '姓名',
            prop: 'name'
            prop: 'name',
            searchSpan: 4,
            search: true,
          }, {
            label: '头像',
            prop: 'avatar'
          }, {
            label: '手机',
            prop: 'phone'
            prop: 'phone',
            searchSpan: 4,
            search: true,
          }, {
            label: '小区',
            prop: 'aoiName'
          }, {
            label: '地址',
            prop: 'addressName'
          }, {
            label: '签名',
            type: 'upload',
            listType: "picture-img",
            prop: 'signaturePath'
          }, {
            label: '时间',
            prop: 'createTime'
@@ -215,19 +243,45 @@
          currentPage: 1,
          total: 0
        },
        query: {},
      }
    },
    watch: {},
    methods: {
      userHandleClose() {
        this.popupTableUserShow = false
      },
      searchReset() {
        this.query = {}
        this.getUserPage(this.userPage)
      },
      searchChange(params, done) {
        this.query = params
        this.userPage.currentPage = 1
        this.getUserPage(this.userPage, params)
        done()
      },
      initData(newData) {
        this.editFlag = false
        this.popupTableShow = true
        this.articleId = newData.id
        this.onLoad()
        this.query.level = 1
        this.query.articleId = this.articleId
        this.onLoad(this.userPage, this.query)
      },
      // initData(newData) {
      //   this.editFlag = false
      //   this.popupTableShow = true
      //   this.articleId = newData.id
      //   this.onLoad()
      // },
      handleClose() {
        this.popupTableShow = false
@@ -301,7 +355,7 @@
            return remove(row.id)
          })
          .then(() => {
            this.onLoad()
            this.getUserPage(this.userPage)
            this.$message({
              type: "success",
@@ -340,7 +394,7 @@
      openUser(row, type = 0) {
        this.popupTableUserShow = true
        this.query = {}
        if (type == 0) {
          this.userParams = {
            articleId: row.id
@@ -358,18 +412,21 @@
          const data = res.data.data
          this.userPage.total = data.total
          this.userData = data.records
          this.userData.forEach(item => {
            if (item.avatar.length > 0) {
              item.avatar = website.minioUrl + item.avatar
            }
            if (item.signaturePath && item.signaturePath.length > 0) {
              item.signaturePath = website.minioUrl + item.signaturePath
              // console.log("=====>", item.signaturePath)
            }
          })
        })
      },
      onLoad() {
      onLoad(page, params = {}) {
        this.loading = true
        let params = {
          level: 1,
          articleId: this.articleId
        }
        getLists(1, 100, Object.assign(params, this.query)).then(res => {
        getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data
          this.data = data
          this.loading = false
@@ -379,4 +436,4 @@
  }
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>