浏览代码

修改数据

chenrui  1 年之前
父节点
当前提交
813d3fc27a

+ 1 - 1
src/views/statisticsCharts/components/newBarStatisticsCharts.vue

@@ -338,7 +338,7 @@ export default {
       this.loading = true
       try {
         const listValues = await this.getChartsData(id, params)
-        this.setChartsData(JSON.parse(listValues))
+        this.setChartsData(listValues)
       } catch (error) {
         this.$message.error(error.message)
       }

+ 23 - 0
src/views/statisticsCharts/views/baggage/baggageAllStatisticsCharts.vue

@@ -155,6 +155,8 @@ export default {
           requiredWarning: '请先选择统计时间范围',
         },
       ],
+      tableBtns: [], //表格按钮权限
+      simpleQueryItem: [], //简易查询表单数据项
     }
   },
   computed: {
@@ -179,6 +181,27 @@ export default {
       if (!pageAuthArrs.length) return
       // console.log(pageAuthArrs)
       this.querySettings.serviceid = pageAuthArrs[0].serviceid
+       //获取table权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'table')
+      if (pageAuthtables?.length) this.getPageTableSetting(pageAuths, pageAuthtables)
+      console.log(this.getPageTableSetting(pageAuths, pageAuthtables))
+    },
+    //根据页面table设置数据
+    getPageTableSetting (pageAuths, pageAuthtables) {
+      const authTableObj = pageAuthtables[0]
+      //获取当前页面table的配置
+      const { pagename, pageconfigurationid, serviceid, pagecode, userpermissionsid, defaultfilter, selected, triggerserviceid } = authTableObj
+      //获取当前页面table的按钮权限
+      const currPageBtns = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item.pagetype == 'button')
+      if (currPageBtns?.length) this.tableBtns.push(...currPageBtns)
+      this.authBtns = pageAuths.filter(item => item.superiorid == pageconfigurationid && item.pagetype == 'button')
+      this.pageServiceId = Object.keys(this.msgContent).length ? this.msgContent.serviceid : serviceid;
+      this.pageTitle = pagename
+      this.selected = selected
+      this.triggerserviceid = triggerserviceid
+      this.defaultfilter = Object.keys(this.pageQuery).length ? this.pageQuery : defaultfilter ? this.formatDefault(defaultfilter, authTableObj) : { 1: 1 }
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      this.getColumnData(tableColumnArrs)
     },
   },
 }