mirror of
https://gitee.com/maimengcloud/xm-ui-web.git
synced 2025-12-30 10:12:26 +00:00
kpi
This commit is contained in:
@@ -146,7 +146,7 @@ import { MdpFormMixin } from '../../mdp-ui/mixin/MdpFormMixin.js';
|
||||
methods: {
|
||||
//页面初始化需要配置的特殊逻辑写这里
|
||||
initCurrData(){
|
||||
|
||||
debugger
|
||||
if(this.item && this.item.id){
|
||||
if(this.currOpType=='add'){
|
||||
this.editForm.itemId=this.item.id
|
||||
@@ -158,6 +158,12 @@ import { MdpFormMixin } from '../../mdp-ui/mixin/MdpFormMixin.js';
|
||||
}else{
|
||||
if(!this.editForm.extVals||this.editForm.extVals=="[]"){
|
||||
this.editForm.extVals=this.item.extInfos
|
||||
}else if(this.item.extInfos){
|
||||
let extValsList=JSON.parse(this.editForm.extVals)
|
||||
let extInfosList=JSON.parse(this.item.extInfos)
|
||||
let list=extInfosList.filter(k=>!extValsList.find(e=>e.id==k.id))
|
||||
list.forEach(k=>extValsList.push(k))
|
||||
this.editForm.extVals=JSON.stringify(extValsList)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,9 +180,6 @@ import { MdpFormMixin } from '../../mdp-ui/mixin/MdpFormMixin.js';
|
||||
params[fieldName]=$event
|
||||
return true;
|
||||
},
|
||||
setPks(rows,params){
|
||||
params.$pks=[{itemId:this.dataBak.itemId,id:this.dataBak.id}]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<span style="width:99%;">
|
||||
<span v-if="showStyle=='origin'||showStyle==''||!showStyle" :title="title">
|
||||
<el-select v-if="showType=='select'" :style="{width:width?width:'auto'}" :multiple-limit="limit" :no-data-text="noDataText" :no-match-text="noMatchText" :popper-class="popperClass" :reserve-keyword="reserveKeyword" :size="size" :multiple="multiple" :placeholder="placeholder" :disabled="disabled" class="my-select" ref="selectRef" v-model="myVal" @change="onChange" :clearable="clearable" @visible-change="$emit('visible-change',$event)" @focus="$emit('focus',$event)" @blur="$emit('blur',$event)" @clear="$emit('clear',$event)" @click="$emit('click',$event)" @remove-tag="$emit('remove-tag',$event)" append-to-body :filterable="filterable">
|
||||
<el-select v-if="showType=='select'" :style="{width:width?width:'auto'}" :multiple-limit="limit" :no-data-text="noDataText" :no-match-text="noMatchText" :popper-class="popperClass" :reserve-keyword="reserveKeyword" :size="size" :multiple="multiple" :collapse-tags="collapseTags" :placeholder="placeholder" :disabled="disabled" class="my-select" ref="selectRef" v-model="myVal" @change="onChange" :clearable="clearable" @visible-change="$emit('visible-change',$event)" @focus="$emit('focus',$event)" @blur="$emit('blur',$event)" @clear="$emit('clear',$event)" @click="$emit('click',$event)" @remove-tag="$emit('remove-tag',$event)" append-to-body :filterable="filterable">
|
||||
|
||||
<el-option disabled value="" style="height:40px;">
|
||||
<slot name="toolbar">
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
<template>
|
||||
<mdp-dialog append-to-body width="60%" top="20px" ref="parentDialog">
|
||||
<template #default>
|
||||
<XmKpiTree showConfirm subOpType="select"
|
||||
<XmKpiTree showConfirm subOpType="select" multiple
|
||||
:sel-project="selProject"
|
||||
@confirm="(kpi)=>onParentKpiSelected(kpi)"
|
||||
@confirm="(kpis)=>onParentKpiSelected(kpis)"
|
||||
/>
|
||||
</template>
|
||||
</mdp-dialog>
|
||||
<mdp-dialog width="80%" ref="tplKpiDialog" title="选中需要导入的指标">
|
||||
<template #default>
|
||||
<el-form label-position="left">
|
||||
<mdp-lr-box :lspan="12" :gutter="20">
|
||||
<mdp-lr-box :lspan="16" :gutter="20">
|
||||
<template #left>
|
||||
<el-form-item label="指标选择">
|
||||
<mdp-select itemCode="xm_kpi_tpl" multiple v-model="xmKpiTplDict" width="100%" @change2="(l)=>onXmKpiTplSelect(l)"/>
|
||||
<mdp-select itemCode="xm_kpi_tpl" :collapseTags="true" multiple v-model="xmKpiTplDict" width="100%" @change2="(l)=>onXmKpiTplSelect(l)"/>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="指标预览">
|
||||
<div>
|
||||
<el-steps v-if="xmKpiList && xmKpiList.length>0"
|
||||
direction="vertical" space="60px"
|
||||
direction="vertical" space="80px" width="100%"
|
||||
>
|
||||
<el-step style="cursor:pointer;" @click="onStepClick(item)" :title="item.kpiName" :status="'wait'" v-for="(item,index) in xmKpiList" :key="index">
|
||||
<el-step style="cursor:pointer;width:100%;" @click="onStepClick(item)" :title="item.kpiName" :status="'wait'" v-for="(item,index) in xmKpiList" :key="index">
|
||||
<template #icon>
|
||||
<icon :icon="item.icon"/>
|
||||
<icon :icon="item.icon" v-if="item.icon"/>
|
||||
</template>
|
||||
<template #description>
|
||||
<div>
|
||||
<div style="width:100%;">
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="6">
|
||||
职能分类:<mdp-select showStyle="tag" itemCode="kclass" v-model="item.kclass" width="100%"/>
|
||||
<el-col :span="4">
|
||||
职能:<mdp-select showStyle="tag" itemCode="kclass" v-model="item.kclass" width="100%" :disabled="true"/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="10">
|
||||
目标值:<el-text size="small">{{ item.targetValue }}</el-text>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
权重:<el-text size="small">{{ item.weight }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
数据来源: <mdp-select showStyle="tag" itemCode="data_link" multiple v-model="item.dataLink" width="100%"/>
|
||||
数据来源: <mdp-select showStyle="tag" itemCode="dataLink" multiple v-model="item.dataLink" width="100%" :disabled="true"/>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -111,7 +111,7 @@ export default {
|
||||
load:{init:false},
|
||||
project:{},
|
||||
xmKpiList:[],
|
||||
xmKpiTplDict:[],
|
||||
xmKpiTplDict:'',
|
||||
tpl:{
|
||||
xmKpis:[], //待导入的指标
|
||||
sourceDeptid:'',//源头部门
|
||||
@@ -125,11 +125,13 @@ export default {
|
||||
}
|
||||
}, //end data
|
||||
methods: {
|
||||
onParentKpiSelected(kpi){
|
||||
if(kpi?.id){
|
||||
onParentKpiSelected(kpis){
|
||||
if(kpis && kpis.length>0){
|
||||
this.tpl.parentId=kpi.id
|
||||
this.tpl.parentName=kpi.name
|
||||
this.$refs['parentDialog'].close();
|
||||
}else{
|
||||
this.$notify.error("请选择指标")
|
||||
}
|
||||
|
||||
},
|
||||
@@ -138,20 +140,26 @@ export default {
|
||||
},
|
||||
onXmKpiTplSelect(xmKpiTplDict){
|
||||
this.xmKpiList=xmKpiTplDict.map(d=>{
|
||||
let extInfo=d.extVals
|
||||
let extInfosList=[]
|
||||
if(extInfo){
|
||||
if(Array.isArray(extInfo)){
|
||||
extInfosList=extInfo
|
||||
}else{
|
||||
extInfosList=JSON.parse(extInfo)
|
||||
}
|
||||
}else{
|
||||
extInfosList=[]
|
||||
}
|
||||
let extInfoObj={}
|
||||
extInfosList.forEach(d=>{
|
||||
extInfoObj[d.id]=d.value
|
||||
})
|
||||
return {
|
||||
id:d.id,
|
||||
kpiName:d.name,
|
||||
kpiIndex:d.id,
|
||||
targetValue:d.extInfo.targetValue,
|
||||
remark:d.extInfo.remark,
|
||||
kclass:d.extInfo.kclass,
|
||||
kresult:d.extInfo.kresult,
|
||||
ktype:d.extInfo.ktype,
|
||||
dataLink:d.extInfo.dataLink,
|
||||
parentId:d.extInfo.parentId,
|
||||
rateType:d.extInfo.rateType,
|
||||
calcType:d.extInfo.calcType,
|
||||
weight:d.extInfo.weight,
|
||||
kpiIndex:d.id,
|
||||
...extInfoObj,
|
||||
deptid:this.userInfo.deptid,
|
||||
branchId:this.userInfo.branchId,
|
||||
kselfUserid:this.userInfo.userid,
|
||||
|
||||
Reference in New Issue
Block a user