|
|
<template>
|
|
|
<div>
|
|
|
<el-button
|
|
|
<!-- <el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
plain
|
|
|
@click="handleAddClick"
|
|
|
>配置表头</el-button
|
|
|
>
|
|
|
<el-table :data="formData" style="width: 100%">
|
|
|
>-->
|
|
|
<span>表头设置</span>
|
|
|
<el-table :data="formDataNew" style="width: 100%">
|
|
|
<el-table-column prop="name" label="名称" width="60" />
|
|
|
<el-table-column prop="key" label="key值" width="70" />
|
|
|
<el-table-column prop="width" label="宽度" width="50" />
|
...
|
...
|
@@ -104,6 +105,21 @@ |
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
title="表头数据"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="60%"
|
|
|
:before-close="handleClose"
|
|
|
>
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button size="mini" @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
|
<el-button size="mini" type="primary" @click="handleSaveClick"
|
|
|
>确 定</el-button
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- <el-dialog
|
|
|
title="性能指标"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="60%"
|
...
|
...
|
@@ -135,7 +151,7 @@ |
|
|
<template #default="scope">{{ scope.row.policyNum>0?'':'暂无' }}</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
<!– 分页 –>
|
|
|
<div style='text-align: left;background-color: white'>
|
|
|
<el-pagination
|
|
|
v-if="currentPage"
|
...
|
...
|
@@ -158,12 +174,13 @@ |
|
|
>
|
|
|
</el-tooltip>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</el-dialog>-->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import {getKpiPage} from "@/api/platform";
|
|
|
import {getKpiPage,getDetailTableData} from "@/api/platform";
|
|
|
import {formatDate} from "../../../../../filter";
|
|
|
import {mapGetters} from "vuex";
|
|
|
export default {
|
|
|
model: {
|
|
|
prop: "formData",
|
...
|
...
|
@@ -173,9 +190,9 @@ export default { |
|
|
formData: Array
|
|
|
},
|
|
|
watch:{
|
|
|
headTable:{
|
|
|
tableHeads:{
|
|
|
handler(val){
|
|
|
console.log("*(*(",val)
|
|
|
this.setFormData();
|
|
|
},
|
|
|
deep:true
|
|
|
}
|
...
|
...
|
@@ -219,9 +236,11 @@ export default { |
|
|
value:'textToBg'
|
|
|
}
|
|
|
],//关联组件
|
|
|
formDataNew:this.formData,//表头数据
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(['tableHeads']),
|
|
|
//获取url地址中的token
|
|
|
getUrlToken(){
|
|
|
let locationUrl=this.$route.query;
|
...
|
...
|
@@ -234,7 +253,15 @@ export default { |
|
|
return urlObj;
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.setFormData();
|
|
|
},
|
|
|
methods: {
|
|
|
setFormData(){
|
|
|
if(this.tableHeads){
|
|
|
this.formDataNew=this.tableHeads;
|
|
|
}
|
|
|
},
|
|
|
//搜索指标
|
|
|
searchKpi(){
|
|
|
this.getKpi();
|
...
|
...
|
@@ -252,20 +279,6 @@ export default { |
|
|
this.tableData=data;
|
|
|
}
|
|
|
},
|
|
|
//回显数据
|
|
|
setCheckedData(){
|
|
|
/*if(this.multipleSelection && this.multipleSelection.length>0){
|
|
|
this.tableData.map(item=>{
|
|
|
this.multipleSelection.map(v=>{
|
|
|
if(item.kpiId==v.kpiId){
|
|
|
setTimeout(()=>{
|
|
|
this.$refs.multipleTableRef.toggleRowSelection(item)
|
|
|
},300)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}*/
|
|
|
},
|
|
|
//多选操作
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val
|
...
|
...
|
@@ -325,7 +338,6 @@ export default { |
|
|
handleSaveClick() {
|
|
|
if (this.flag) {
|
|
|
// 新增
|
|
|
// this.formData.push(this.rowFormData);
|
|
|
let arr=[];
|
|
|
if(this.primaryTypeFlg){
|
|
|
//追加
|
...
|
...
|
@@ -333,7 +345,7 @@ export default { |
|
|
this.multipleSelection.map((item,index)=>{
|
|
|
arr1.push({name:item.kpiName,key:item.kpiId,width:'50%',sort:false,columnSort:index,componentName:1})
|
|
|
})
|
|
|
arr=this.formData.concat(arr1);
|
|
|
arr=this.formDataNew.concat(arr1);
|
|
|
}else{
|
|
|
//重新选择
|
|
|
this.multipleSelection.map((item,index)=>{
|
...
|
...
|
@@ -341,19 +353,19 @@ export default { |
|
|
})
|
|
|
}
|
|
|
|
|
|
this.formData=arr;
|
|
|
this.formData.sort(this.compare('columnSort'));
|
|
|
this.formDataNew=arr;
|
|
|
this.formDataNew.sort(this.compare('columnSort'));
|
|
|
this.dialogVisible = false;
|
|
|
} else {
|
|
|
// 编辑
|
|
|
this.formData[this.indexEditor] = this.rowFormData;
|
|
|
this.$set(this.formData, this.indexEditor, this.rowFormData);
|
|
|
this.formData.sort(this.compare('columnSort'));
|
|
|
this.formDataNew[this.indexEditor] = this.rowFormData;
|
|
|
this.$set(this.formDataNew, this.indexEditor, this.rowFormData);
|
|
|
this.formDataNew.sort(this.compare('columnSort'));
|
|
|
this.editDialogVisible = false;
|
|
|
}
|
|
|
console.log("AVX", this.formData)
|
|
|
this.$emit("input", this.formData);
|
|
|
this.$emit("change", this.formData);
|
|
|
console.log("AVX", this.formDataNew)
|
|
|
this.$emit("input", this.formDataNew);
|
|
|
this.$emit("change", this.formDataNew);
|
|
|
},
|
|
|
//数组排序
|
|
|
compare(property){
|
...
|
...
|
@@ -365,10 +377,10 @@ export default { |
|
|
},
|
|
|
// 删除
|
|
|
handleDeleteClick(index,row) {
|
|
|
this.formData.splice(index, 1);
|
|
|
this.formDataNew.splice(index, 1);
|
|
|
this.setTableChecked(row.key);
|
|
|
this.$emit("input", this.formData);
|
|
|
this.$emit("change", this.formData);
|
|
|
this.$emit("input", this.formDataNew);
|
|
|
this.$emit("change", this.formDataNew);
|
|
|
},
|
|
|
//设置表格选中状态
|
|
|
setTableChecked(kpiId){
|
...
|
...
|
|