|
@@ -11,6 +11,19 @@
|
|
padding: 5px 10px;
|
|
padding: 5px 10px;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
+.tableTop{
|
|
|
|
+ position: relative;
|
|
|
|
+ padding-bottom: 15px;
|
|
|
|
+ border-bottom: 1px solid #e0e0e0;
|
|
|
|
+ .selectTime{
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ }
|
|
|
|
+ .add{
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style>
|
|
<style>
|
|
/* .data-display-statistics .ant-card-body {
|
|
/* .data-display-statistics .ant-card-body {
|
|
@@ -165,7 +178,7 @@ th div {
|
|
<a-row :gutter="10" style="margin-top:10px">
|
|
<a-row :gutter="10" style="margin-top:10px">
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-card style="width:100%;">
|
|
<a-card style="width:100%;">
|
|
- <div
|
|
|
|
|
|
+ <div class="tableTop"
|
|
style="display:flex;margin-bottom:15px"
|
|
style="display:flex;margin-bottom:15px"
|
|
v-show="
|
|
v-show="
|
|
role.roleCode == 'operator' ||
|
|
role.roleCode == 'operator' ||
|
|
@@ -174,7 +187,7 @@ th div {
|
|
role.roleCode == 'operationAssistant' ||
|
|
role.roleCode == 'operationAssistant' ||
|
|
role.roleCode == 'touTiaoOperationManager'
|
|
role.roleCode == 'touTiaoOperationManager'
|
|
"
|
|
"
|
|
- >
|
|
|
|
|
|
+ >
|
|
<a-select
|
|
<a-select
|
|
style="width: 120px"
|
|
style="width: 120px"
|
|
v-model="statHour"
|
|
v-model="statHour"
|
|
@@ -184,7 +197,8 @@ th div {
|
|
>
|
|
>
|
|
<a-select-option v-for="item of 24" :key="item - 1" :value="item - 1">{{ item - 1 }}</a-select-option>
|
|
<a-select-option v-for="item of 24" :key="item - 1" :value="item - 1">{{ item - 1 }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
- <a-button type="primary" @click="exportExcel" style="margin-left:15px">导出</a-button>
|
|
|
|
|
|
+ <a-button type="primary" @click="exportExcel" style="margin-left:15px">导出报表</a-button>
|
|
|
|
+ <a-button type='primary' class="add" @click="customColumns" >自定义列</a-button>
|
|
</div>
|
|
</div>
|
|
<a-table
|
|
<a-table
|
|
:columns="columns"
|
|
:columns="columns"
|
|
@@ -192,8 +206,9 @@ th div {
|
|
bordered
|
|
bordered
|
|
id="outTable"
|
|
id="outTable"
|
|
:pagination="false"
|
|
:pagination="false"
|
|
- :scroll="{ x: 1900 }"
|
|
|
|
|
|
+ :scroll="{ x: scrollX }"
|
|
></a-table>
|
|
></a-table>
|
|
|
|
+ <customColumn :visible='visible' :listNum='listNum' :fiexColumn='columnsFixd' @closeCustomColumn='closeCustomColumn' @changeColumn='changeColumn' />
|
|
</a-card>
|
|
</a-card>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -201,6 +216,7 @@ th div {
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+
|
|
import ARow from 'ant-design-vue/es/grid/Row'
|
|
import ARow from 'ant-design-vue/es/grid/Row'
|
|
import ACol from 'ant-design-vue/es/grid/Col'
|
|
import ACol from 'ant-design-vue/es/grid/Col'
|
|
import countTo from 'vue-count-to'
|
|
import countTo from 'vue-count-to'
|
|
@@ -213,7 +229,7 @@ import Treeselect from './components/Treeselect.vue'
|
|
|
|
|
|
import { getAction, postAction, postFile } from '@/api/manage'
|
|
import { getAction, postAction, postFile } from '@/api/manage'
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
-
|
|
|
|
|
|
+import customColumn from './components/customColumn.vue'
|
|
// 引入基本模板
|
|
// 引入基本模板
|
|
let echarts = require('echarts/lib/echarts')
|
|
let echarts = require('echarts/lib/echarts')
|
|
// 引入柱状图组件
|
|
// 引入柱状图组件
|
|
@@ -591,7 +607,8 @@ export default {
|
|
countTo,
|
|
countTo,
|
|
lifting,
|
|
lifting,
|
|
timeCheck,
|
|
timeCheck,
|
|
- Treeselect
|
|
|
|
|
|
+ Treeselect,
|
|
|
|
+ customColumn,
|
|
},
|
|
},
|
|
|
|
|
|
data: function() {
|
|
data: function() {
|
|
@@ -658,7 +675,10 @@ export default {
|
|
],
|
|
],
|
|
noTitleKey: 'cost',
|
|
noTitleKey: 'cost',
|
|
role: { roleCode: '' },
|
|
role: { roleCode: '' },
|
|
- statDate: ''
|
|
|
|
|
|
+ statDate: '',
|
|
|
|
+ visible:false,//自定义页面的打开
|
|
|
|
+ listNum:[],
|
|
|
|
+ scrollX:0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -679,8 +699,39 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
moment,
|
|
moment,
|
|
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
|
|
|
+ //弹出框打开,自定义列
|
|
|
|
+ customColumns() {
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.listNum = [...this.columns]
|
|
|
|
+ },
|
|
|
|
+ closeCustomColumn(){
|
|
|
|
+ this.visible=false;
|
|
|
|
+ },
|
|
|
|
+ //自定义之后修改父元素表头
|
|
|
|
+ changeColumn(val){
|
|
|
|
+ this.columns=[...val];
|
|
|
|
+ if(this.columns.length> this.columnsFixd.length){
|
|
|
|
+ this.scrollX=200*(this.columns.length-this.columnsFixd.length)
|
|
|
|
+ }else{
|
|
|
|
+ this.scrollX=0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ tableHandle() {
|
|
|
|
+ // this.listNum = [...this.columns]
|
|
|
|
+ // console.log(this.listNum.length, this.columns)
|
|
|
|
+
|
|
|
|
+ if (this.listNum.length >= 9 || this.columns.length >= 9) {
|
|
|
|
+ this.tableWidth = 120
|
|
|
|
+ this.scrollX = this.columns.length * 120
|
|
|
|
+ // console.log(this.scrollX)
|
|
|
|
+ } else {
|
|
|
|
+ this.scrollX = 0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
disabledDate(current) {
|
|
disabledDate(current) {
|
|
return current && current > moment().endOf('day')
|
|
return current && current > moment().endOf('day')
|
|
},
|
|
},
|