Lou
2024-04-03 d6bcbf09ab54fb46f5e690de0c08ea2b638d7f91
src/views/article/discussionManage.vue
@@ -19,8 +19,14 @@
          编辑议题
        </el-button>
        <el-button icon="el-icon-user" :size="size" :type="type" @click.stop="openUserPopup(row, 1)">
        <el-button icon="el-icon-user" :size="size" v-if="row.articleType != 4" :type="type"
          @click.stop="openUserPopup(row, 0)">
          参与用户
        </el-button>
        <el-button icon="el-icon-user" v-if="row.articleType == 4" :size="size" :type="type"
          @click.stop="handleExport(row)">
          导出投票结果
        </el-button>
        <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)">
@@ -79,6 +85,21 @@
  } from "vuex"
  import deitDiscussion from "./components/deitDiscussion"
  import discussionManageChild from "./components/discussionManageChild"
  import NProgress from 'nprogress'
  import 'nprogress/nprogress.css'
  import Qs from "qs"
  import {
    exportBlob
  } from "@/api/common"
  import {
    getToken
  } from '@/util/auth'
  import {
    downloadXls
  } from "@/util/util"
  import {
    dateNow
  } from "@/util/date"
  export default {
    components: {
@@ -168,7 +189,7 @@
                label: "name",
                value: 'id'
              },
              hide: true,
              // hide: true,
            },
            {
              width: 110,
@@ -488,6 +509,29 @@
      }
    },
    methods: {
      handleExport(row) {
        this.$confirm("是否导出投票结果数据?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          NProgress.start()
          this.query = {}
          this.query.articleId = row.id
          this.query.districtId = row.articleRange
          var data = {
            ...this.query
          }
          data = Qs.stringify(data)
          exportBlob(
              `/api/blade-userTopics/userTopics/exportDataIndex?${this.website.tokenHeader}=${getToken()}&` + data)
            .then(
              res => {
                downloadXls(res.data, `投票结果${dateNow()}.xlsx`)
                NProgress.done()
              })
        })
      },
      iscommentInput(e, data) {
        upcomment(data.id, e).then(() => {
          this.$message({
@@ -513,8 +557,8 @@
        })
      },
      openUserPopup(row) {
        this.$refs.DeitDiscussion.openUser(row)
      openUserPopup(row, type) {
        this.$refs.DeitDiscussion.openUser(row, type)
      },
      openDilog(row, type) {
@@ -697,7 +741,7 @@
          this.page.total = data.total
          this.data = data.records
          this.data.forEach(item => {
            // item.articleRange = JSON.parse(item.articleRange)
            item.articleList = JSON.parse(item.articleRange)
            if (item.url.length > 0) {
              var urls = []
              var names = item.url.split(",")
@@ -710,7 +754,9 @@
          this.loading = false
          this.selectionClear()
        })
        getDistrictTree(params = {}).then((res) => {
        getDistrictTree(params = {
          filterFlag: 1
        }).then((res) => {
          const data = res.data.data
          this.districtTree = data
          const column = this.findObject(this.option.column, "articleList")
@@ -798,4 +844,4 @@
  .avue-upload__icon {
    line-height: 6;
  }
</style>
</style>