chenrui  1 жил өмнө
parent
commit
53957d26e5

+ 3 - 2
src/components/SimpleQuery/index.vue

@@ -3,7 +3,7 @@
     <el-form ref="ruleForm" inline :model="tableForm">
       <el-form-item v-for="(item, index) in formItemArr" :key=" index" :rules="fromDataReq(item)" :prop="item.pagecode">
         <template v-if="fromDataType(item.datatype) == 'SELECT' || fromDataType(item.datatype) == 'SELECTS'">
-          <el-select class="input-shadow" size="small" :multiple="fromDataType(item.datatype) == 'SELECTS'?true:false" filterable default-first-option style="width: 100%" v-model="tableForm[item.pagecode]" @change="changeSelect(item.pagecode, item)" :placeholder="'请选择'+item.pagename" clearable @clear="tableForm[item.pagecode] = ''">
+          <el-select class="input-shadow" size="small" :disabled="item.disabled ? item.disabled : false" :multiple="fromDataType(item.datatype) == 'SELECTS'?true:false" filterable default-first-option style="width: 100%" v-model="tableForm[item.pagecode]" @change="changeSelect(item.pagecode, tableForm[item.pagecode])" :placeholder="'请选择'+item.pagename" clearable @clear="tableForm[item.pagecode] = ''">
             <el-option v-for="(itemParams,sindex) in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]+sindex" :label="itemParams[item['dropdownlistlabel']]" :value="itemParams[item['dropdownlistid']]">
             </el-option>
           </el-select>
@@ -185,7 +185,8 @@ export default {
       this.$emit('queryValue', this.queryContent)
     },
     //获取表单下拉数据
-    changeSelect (code) {
+    changeSelect (code,data) {
+      this.$emit('changeSelect', data)
       if (code == 'passparameters') return
       const datas = this.$store.state.auth.authMsg
       if (!datas?.length) return

+ 96 - 3
src/views/statisticsCharts/components/newBarStatisticsCharts.vue

@@ -10,14 +10,19 @@
       ref="headerWrapper"
       class="statstics-header"
     >
-      <StatisticsHeader
+    <PublicPageHeader class="TablePage_header" :page-title="dataTitle ? dataTitle : pageTitle">
+      <template slot="d_foot">
+        <SimpleQuery v-if="simpleQueryFlag" :selectOptions="advancedQueryValue" :simple-query-item="simpleQueryItem" @queryValue="queryValue" />
+      </template>
+    </PublicPageHeader>
+      <!-- <StatisticsHeader
         :title="`${chartsTitle}统计`"
         :custom-items="customFormItems"
         :items="formItems"
         :data="formData"
         @getFormData="getFormData"
         @export="exportHandler"
-      />
+      /> -->
     </div>
     <div class="statstics-content">
       <div
@@ -30,6 +35,9 @@
 </template>
 
 <script>
+import PublicPageHeader from '@/components/PublicPageHeader'
+import SimpleQuery from '@/components/SimpleQuery'
+import AuthButton from '@/components/AuthButton'
 import StatisticsHeader from './statisticsHeader.vue'
 import { TempQuery } from '@/api/temp'
 import { mapGetters } from 'vuex'
@@ -39,8 +47,16 @@ import FileSaver from 'file-saver'
 
 export default {
   name: 'CommonBarStatisticsCharts',
-  components: { StatisticsHeader },
+  components: { StatisticsHeader, PublicPageHeader, SimpleQuery, AuthButton},
   props: {
+    dataTitle: {
+      type: String,
+      default: ''
+    },
+    pageAuthtablesList: {
+      type: Object,
+      default: () => {},
+    },
     chartsTitle: {
       type: String,
       required: true,
@@ -230,10 +246,26 @@ export default {
         ],
       },
       admin: {},
+      pageQuery: {},
+      tableBtns: [], //表格按钮权限
+      pageTitle: '', //页面名称
+      pageServiceId: null, //表格serviceid
+      selected: 0, //是否勾选
+      triggerserviceid: null, //勾选后查询的serviceid
+      defaultfilter: { 1: 1 }, //默认查询参数
+      simpleQueryItem: [], //简易查询表单数据项
+      advancedQueryValue: [], //高级查询缓存值
+      simpleQueryFlag: false, //是否开启了简易查询
     }
   },
   computed: {
     ...mapGetters(['sidebar']),
+    pageAuthBtnQuery () {
+      return this.tableBtns.filter(item => item.servicetype == 0)[0]
+    },
+    pageAuthBtnAdd () {
+      return this.tableBtns.filter(item => item.servicetype == 2)[0]
+    },
   },
   watch: {
     // 监听数据变化 重绘图形
@@ -262,6 +294,12 @@ export default {
       deep: true,
       immediate: true,
     },
+    pageAuthtablesList: {
+      handler(obj) {
+        this.getPageTableSetting(obj.authArrs, obj.pageAuthtables)
+      },
+      deep: true,
+    }
   },
   mounted() {
     this.setChartHeight()
@@ -283,6 +321,61 @@ export default {
     }
   },
   methods: {
+    //根据页面table设置数据
+    getPageTableSetting (pageAuths, pageAuthtables) {
+      const authTableObj = pageAuthtables[0]
+      //获取当前页面table的配置
+      const { pagename, pageconfigurationid, serviceid, pagecode, userpermissionsid, defaultfilter, selected, triggerserviceid } = authTableObj
+      this.pageTitle = pagename
+      const currPageBtns = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item.pagetype == 'button')
+      if (currPageBtns?.length) this.tableBtns.push(...currPageBtns)
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      this.getColumnData(tableColumnArrs)
+    },
+    //获取表头数据
+    getColumnData (columnArrs = []) {
+      const returnData = [...columnArrs]
+      const simpleQueryItem = _.cloneDeep(returnData).filter((item) => item.easysearch && item.isfiltercolumn)
+      if (simpleQueryItem?.length) {
+        this.simpleQueryFlag = true
+        this.simpleQueryItem = simpleQueryItem
+      }
+    },
+        //格式化传递参数数据
+    formatDefault (item, data = {}) {
+      if (typeof item != 'string') return {}
+      const filterItem = {}
+      const parameters = item.replace('{', '').replace('}', '')
+      const parametersSplit = parameters?.split(',')
+      parametersSplit.map(item => {
+        const [key, val] = item?.split(':')
+        filterItem[key] = data[val]
+      })
+      return filterItem
+    },
+    //根据页面按钮设置表单form数据
+    getPageBtnFormSetting (pageAuths, pageAuthForms) {
+      const { pageconfigurationid } = [...pageAuthForms][0]
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      const formItemCopy = tableColumnArrs.filter((item) => item.isdisplay != 0)
+      this.formItem = _.orderBy(formItemCopy, ['displaynumber'], ['asc'])
+    },
+        //简易查询-确定
+    queryValue (dataRules) {
+      const arr = [...dataRules]
+      if (arr && arr.length) {
+        arr.forEach(item => {
+          item.value = typeof item.value == 'string' ? item.value.replace(/\s*/g, "") : item.value
+        })
+      }
+      this.defaultfilter = arr.length ? arr : { 1: 1 }
+      this.resetDatas()
+      let params = {}
+      this.defaultfilter.forEach(element => {
+        params[element.column] = element.value
+      });
+      this.getSingleChartsData(this.querySettings.serviceid, params)
+    },
     resetDatas() {
       this.hasChartData = false
       this.options.yAxis[0].max = 60000

+ 10 - 0
src/views/statisticsCharts/views/baggage/airlineStatisticsCharts.vue

@@ -1,6 +1,7 @@
 <template>
   <CommonBarStatisticsCharts
     charts-title="航线行李量"
+    :pageAuthtablesList="pageAuthtablesList"
     :query-settings="querySettings"
     :formItems="formItems"
     :formData="formData"
@@ -151,6 +152,10 @@ export default {
           requiredWarning: '请先选择时间范围',
         },
       ],
+      pageAuthtablesList: {
+        authArrs: [],
+        pageAuthtables:[]
+      },
     }
   },
   computed: {
@@ -169,12 +174,17 @@ export default {
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗 
       const pageAuths = this.authArrs
+      this.pageAuthtablesList.authArrs = pageAuths
       if (!pageAuths.length) return
       //获取当前页面权限类型
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       // console.log(pageAuthArrs)
       this.querySettings.serviceid = pageAuthArrs[0].serviceid
+       //获取图表权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'chart')
+      this.pageAuthtablesList.pageAuthtables = pageAuthtables
+      if (pageAuthtables?.length) return
     },
   },
 }

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

@@ -1,6 +1,7 @@
 <template>
   <CommonBarStatisticsCharts
     charts-title="行李数量"
+    :pageAuthtablesList="pageAuthtablesList"
     :query-settings="querySettings"
     :formItems="formItems"
     :formData="formData"
@@ -155,8 +156,17 @@ export default {
           requiredWarning: '请先选择统计时间范围',
         },
       ],
-      tableBtns: [], //表格按钮权限
-      simpleQueryItem: [], //简易查询表单数据项
+      pageAuthtablesList: {
+        authArrs: [],
+        pageAuthtables:[]
+      },
+      // tableBtns: [], //表格按钮权限
+      // pageTitle: '', //页面名称
+      // pageServiceId: null, //表格serviceid
+      // selected: 0, //是否勾选
+      // triggerserviceid: null, //勾选后查询的serviceid
+      // defaultfilter: { 1: 1 }, //默认查询参数
+      // simpleQueryItem: [], //简易查询表单数据项
     }
   },
   computed: {
@@ -175,33 +185,17 @@ export default {
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗 
       const pageAuths = this.authArrs
+      this.pageAuthtablesList.authArrs = pageAuths
       if (!pageAuths.length) return
       //获取当前页面权限类型
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       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)
+       //获取图表权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'chart')
+      this.pageAuthtablesList.pageAuthtables = pageAuthtables
+      if (pageAuthtables?.length) return
     },
   },
 }

+ 10 - 0
src/views/statisticsCharts/views/baggage/companyStatisticsCharts.vue

@@ -1,6 +1,7 @@
 <template>
   <CommonBarStatisticsCharts
     charts-title="航司行李量"
+    :pageAuthtablesList="pageAuthtablesList"
     :query-settings="querySettings"
     :formItems="formItems"
     :formData="formData"
@@ -153,6 +154,10 @@ export default {
           requiredWarning: '请先选择时间范围',
         },
       ],
+      pageAuthtablesList: {
+        authArrs: [],
+        pageAuthtables:[]
+      },
     }
   },
   computed: {
@@ -171,12 +176,17 @@ export default {
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗 
       const pageAuths = this.authArrs
+      this.pageAuthtablesList.authArrs = pageAuths
       if (!pageAuths.length) return
       //获取当前页面权限类型
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       // console.log(pageAuthArrs)
       this.querySettings.serviceid = pageAuthArrs[0].serviceid
+       //获取图表权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'chart')
+      this.pageAuthtablesList.pageAuthtables = pageAuthtables
+      if (pageAuthtables?.length) return
     },
   },
 }

+ 10 - 0
src/views/statisticsCharts/views/baggage/hourStatisticsCharts.vue

@@ -1,6 +1,7 @@
 <template>
   <CommonBarStatisticsCharts
     charts-title="行李小时量数量"
+    :pageAuthtablesList="pageAuthtablesList"
     :query-settings="querySettings"
     :formItems="formItems"
     :formData="formData"
@@ -69,6 +70,10 @@ export default {
           requiredWarning: '请先选择时间范围',
         },
       ],
+      pageAuthtablesList: {
+        authArrs: [],
+        pageAuthtables:[]
+      },
     }
   },
   computed: {
@@ -87,12 +92,17 @@ export default {
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗 
       const pageAuths = this.authArrs
+      this.pageAuthtablesList.authArrs = pageAuths
       if (!pageAuths.length) return
       //获取当前页面权限类型
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       // console.log(pageAuthArrs)
       this.querySettings.serviceid = pageAuthArrs[0].serviceid
+       //获取图表权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'chart')
+      this.pageAuthtablesList.pageAuthtables = pageAuthtables
+      if (pageAuthtables?.length) return
     },
   },
 }

+ 131 - 33
src/views/statisticsCharts/views/nodeStatisticsCharts.vue

@@ -1,7 +1,12 @@
 <template>
   <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="statstics-wrapper">
     <div ref="headerWrapper" class="statstics-header">
-      <StatisticsHeader title="扫描节点与位置分析" :items="formItems" :data="formData" with-setting @getFormData="getFormData" @export="exportHandler" @setting="settingHandler" />
+      <PublicPageHeader class="TablePage_header" :page-title="dataTitle ? dataTitle : pageTitle">
+      <template slot="d_foot">
+        <SimpleQuery v-if="simpleQueryFlag" :selectOptions="advancedQueryValue" :simple-query-item="simpleQueryItem" @queryValue="queryValue" @changeSelect="changeSelect"/>
+      </template>
+    </PublicPageHeader>
+      <!-- <StatisticsHeader title="扫描节点与位置分析" :items="formItems" :data="formData" with-setting @getFormData="getFormData" @export="exportHandler" @setting="settingHandler" /> -->
     </div>
     <div class="statstics-content">
       <div ref="myChart" class="node-statistics-chart" :style="{ height: chartHeight }" />
@@ -31,6 +36,8 @@
 
 <script>
 import StatisticsHeader from '../components/statisticsHeader.vue'
+import PublicPageHeader from '@/components/PublicPageHeader'
+import SimpleQuery from '@/components/SimpleQuery'
 import Dialog from '@/layout/components/Dialog'
 import { TempQuery } from '@/api/temp'
 import { mapGetters } from 'vuex'
@@ -40,7 +47,13 @@ import FileSaver from 'file-saver'
 
 export default {
   name: 'FlightStatisticsCharts',
-  components: { StatisticsHeader, Dialog },
+  components: { StatisticsHeader, Dialog, PublicPageHeader, SimpleQuery },
+  props: {
+    dataTitle: {
+      type: String,
+      default: ''
+    },
+  },
   data () {
     return {
       querySettings: {
@@ -242,7 +255,21 @@ export default {
       descriptions: {},
       loading: false,
       msgDatas: [],
-      msgObj: {}
+      msgObj: {},
+      pageAuthtablesList: {
+        authArrs: [],
+        pageAuthtables:[]
+      },
+      pageQuery: {},
+      tableBtns: [], //表格按钮权限
+      pageTitle: '', //页面名称
+      pageServiceId: null, //表格serviceid
+      selected: 0, //是否勾选
+      triggerserviceid: null, //勾选后查询的serviceid
+      defaultfilter: { 1: 1 }, //默认查询参数
+      simpleQueryItem: [], //简易查询表单数据项
+      advancedQueryValue: [], //高级查询缓存值
+      simpleQueryFlag: false, //是否开启了简易查询
     }
   },
   computed: {
@@ -273,17 +300,17 @@ export default {
       },
       deep: true,
     },
-    checkedSeriesData: {
-      handler (arr) {
-        this.echartsOptions.series[0].data = [
-          {
-            name: this.queryData[2],
-            value: arr,
-          },
-        ]
-      },
-      deep: true,
-    },
+    // checkedSeriesData: {
+    //   handler (arr) {
+    //     this.echartsOptions.series[0].data = [
+    //       {
+    //         name: this.queryData[2],
+    //         value: arr,
+    //       },
+    //     ]
+    //   },
+    //   deep: true,
+    // },
     // 监听数据变化 重绘图形
     echartsOptions: {
       handler (obj) {
@@ -373,13 +400,83 @@ export default {
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗 
       const pageAuths = this.authArrs
+      this.pageAuthtablesList.authArrs = pageAuths
       if (!pageAuths.length) return
       //获取当前页面权限类型
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       // console.log(pageAuthArrs)
       this.querySettings.serviceid = pageAuthArrs[0].serviceid
-      // this.getTips(pageAuthArrs[0].serviceid)
+       //获取图表权限
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'chart')
+      this.pageAuthtablesList.pageAuthtables = pageAuthtables
+      if (pageAuthtables?.length)
+      this.getPageTableSetting(pageAuths,pageAuthtables)
+    },
+    //根据页面table设置数据
+    getPageTableSetting (pageAuths, pageAuthtables) {
+      const authTableObj = pageAuthtables[0]
+      //获取当前页面table的配置
+      const { pagename, pageconfigurationid, serviceid, pagecode, userpermissionsid, defaultfilter, selected, triggerserviceid } = authTableObj
+      this.pageTitle = pagename
+      const currPageBtns = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item.pagetype == 'button')
+      if (currPageBtns?.length) this.tableBtns.push(...currPageBtns)
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      this.getColumnData(tableColumnArrs)
+    },
+    //获取表头数据
+    getColumnData (columnArrs = []) {
+      const returnData = [...columnArrs]
+      const simpleQueryItem = _.cloneDeep(returnData).filter((item) => item.easysearch && item.isfiltercolumn)
+      if (simpleQueryItem?.length) {
+        this.simpleQueryFlag = true
+        simpleQueryItem.forEach((element,index) => {
+          if (index !== 0) {
+            element.disabled = true
+          }
+        });
+        this.simpleQueryItem = simpleQueryItem
+      }
+      console.log(simpleQueryItem)
+    },
+    //简易查询-确定
+    queryValue (dataRules) {
+      const arr = [...dataRules]
+      if (arr && arr.length) {
+        arr.forEach(item => {
+          item.value = typeof item.value == 'string' ? item.value.replace(/\s*/g, "") : item.value
+        })
+      }
+      this.defaultfilter = arr.length ? arr : { 1: 1 }
+      let params = {}
+      this.defaultfilter.forEach(element => {
+        params[element.column] = element.value
+      });
+      this.queryChartsData(params)
+    },
+    changeSelect(data){
+      console.log(data)
+      if (data == '航线') {
+        this.simpleQueryItem.forEach((element,index) => {
+          if (element.pagename === '航线选择') {
+            element.disabled = false
+          } else if (index === 0) {
+            element.disabled = false
+          } else {
+            element.disabled = true
+          }
+        });
+      }else if (data == '航站') {
+        this.simpleQueryItem.forEach((element,index) => {
+          if (element.pagename !== '航线选择') {
+            element.disabled = false
+          }  else if (index === 0) {
+            element.disabled = false
+          } else {
+            element.disabled = true
+          }
+        });
+      }
     },
     hideTips (params) {
       if (params.componentType === 'radar') {
@@ -458,21 +555,21 @@ export default {
       //   this.$message.warning('请先选择统计时间范围')
       //   return
       // }
-      if (data.airline) {
-        data.airport = null
-        data.inOrOut = null
-      }
-      if (data.airport || data.inOrOut) {
-        data.airline = null
-      }
-      const dataObj = {
-        air_line: data.airline,
-        airport: data.airport,
-        io_type: data.inOrOut,
-        fd1: data.dateTime[0],
-        fd2: data.dateTime[1],
-      }
-      params.push(dataObj)
+      // if (data.airline) {
+      //   data.airport = null
+      //   data.inOrOut = null
+      // }
+      // if (data.airport || data.inOrOut) {
+      //   data.airline = null
+      // }
+      // const dataObj = {
+      //   air_line: data.airline,
+      //   airport: data.airport,
+      //   io_type: data.inOrOut,
+      //   fd1: data.dateTime[0],
+      //   fd2: data.dateTime[1],
+      // }
+      // params.push(dataObj)
       // if (data.range === '航线') {
       //   params.splice(1, 0, data.airline)
       // } else if (data.range === '航站') {
@@ -481,9 +578,9 @@ export default {
       //   params.splice(1, 0, '全部')
       // }
       // console.log(params)
-      this.queryData = params
-      let filter = params[0]
-      this.msgObj = { ...dataObj }
+      // this.queryData = params
+      let filter = data
+      // this.msgObj = { ...dataObj }
       try {
         this.echartsOptions.series[0].data = []
         this.tooltips.forEach(tooltip => (tooltip.ratio = '0%'))
@@ -751,6 +848,7 @@ export default {
 
 <style lang="scss" scoped>
 .statstics-wrapper {
+  padding: 24px;
   .statstics-content {
     background-color: #fff;
     position: relative;