Explorar o código

feat: 数据导出超过2000条提示二维码修改为接口获取

zhangsiya hai 1 ano
pai
achega
e9f882b609

+ 36 - 17
apps/bigmember_pc/src/views/portrayal/components/DataExportTip.vue

@@ -12,7 +12,7 @@
         进行定制化导出
       </p>
       <div class="export-dialog-wx">
-        <img :src="getWxCustom" alt="" />
+        <img :src="kefuInfo.wxer" alt="" />
       </div>
       <p class="wx-code-label">客服微信</p>
       <el-button @click="$emit('setExport')" class="export-continue-btn"
@@ -27,7 +27,8 @@
 
 <script>
 import { Button, Checkbox } from 'element-ui'
-import { mapState } from 'vuex'
+// import { mapState } from 'vuex'
+import { getCustomInfo } from '@/api/modules/'
 export default {
   name: 'export-dialog-container',
   components: {
@@ -36,30 +37,48 @@ export default {
   },
   data() {
     return {
-      agreement: false
+      agreement: false,
+      kefuInfo: {}
     }
   },
+  created () {
+    this.getKefuInfo()
+  },
   watch: {
     agreement(newval) {
       this.$emit('checkBoxChange', newval)
     }
   },
   computed: {
-    ...mapState({
-      info: (state) => state.user.info
-    }),
-    getWxCustom() {
-      const customers = this.info.customers
-      if (customers && customers.length > 0) {
-        const getWxCode = customers.filter((v) => v.name === '高静')
-        if (getWxCode && getWxCode.length > 0) {
-          return getWxCode[0].wxer
-        } else {
-          return ''
-        }
-      } else {
-        return ''
+    // ...mapState({
+    //   info: (state) => state.user.info
+    // }),
+    // getWxCustom() {
+    //   const customers = this.info.customers
+    //   if (customers && customers.length > 0) {
+    //     const getWxCode = customers.filter((v) => v.name === '高静')
+    //     if (getWxCode && getWxCode.length > 0) {
+    //       return getWxCode[0].wxer
+    //     } else {
+    //       return ''
+    //     }
+    //   } else {
+    //     return ''
+    //   }
+    // }
+  },
+  methods: {
+    // 获取客服二维码信息
+    getKefuInfo () {
+      const params = {
+        type: 'kf'
       }
+      getCustomInfo(params).then(res => {
+        const { error_code: code, data } = res
+        if(code === 0 && data) {
+          this.kefuInfo = data
+        }
+      })
     }
   }
 }

+ 1 - 1
apps/bigmember_pc/vite.config.js

@@ -137,7 +137,7 @@ export default defineConfig({
   },
   server: {
     port: 8081,
-    proxy: useServerProxy('web'),
+    proxy: useServerProxy('web2'),
     host: '0.0.0.0'
   }
 })