|
@@ -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}统计`"
|
|
|
:data="formData"
|
|
|
:items="formItems"
|
|
|
:custom-items="customFormItems"
|
|
|
@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,
|
|
@@ -234,12 +250,34 @@ export default {
|
|
|
},
|
|
|
totalCount: [{ value: 0 }],
|
|
|
categoryDatas: [],
|
|
|
+ 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: {
|
|
|
+ pageAuthtablesList: {
|
|
|
+ handler(obj) {
|
|
|
+ this.getPageTableSetting(obj.authArrs, obj.pageAuthtables)
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
pieTitle: {
|
|
|
handler(val) {
|
|
|
this.options.title.text = val
|
|
@@ -322,6 +360,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.getMultipleChartsData(this.querySettings.serviceid, [params])
|
|
|
+ },
|
|
|
legendFormatter(name) {
|
|
|
const index = this.categoryDatas.findIndex(
|
|
|
category => category.name === name
|
|
@@ -583,6 +676,9 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.statstics-wrapper{
|
|
|
+ padding: 24px;
|
|
|
+}
|
|
|
.statistics-chart {
|
|
|
width: 100%;
|
|
|
}
|