|
@@ -162,7 +162,7 @@
|
|
|
<li class="target-li" v-for="(list, index) in targetList" :key="index">
|
|
|
<span class="li-tag">{{ list.tag }}</span>
|
|
|
<el-select v-model="list.target" v-loadMore="searchLoad" :filterable="!list.target" clearable
|
|
|
- placeholder="请输入指标名称" style="width: 400px" @change="chooseTarget"
|
|
|
+ placeholder="请输入指标名称" style="width: 400px" @change="(val)=>{chooseTargetList(val,index)}"
|
|
|
@clear="clearHandle(index)" remote :remote-method="searchTarget"
|
|
|
@click.native="inputFocusHandle">
|
|
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
@@ -171,20 +171,76 @@
|
|
|
:value="item.EdbInfoId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
-
|
|
|
<i class="el-icon-tickets" style="color:#409EFF;font-size:18px"
|
|
|
@click="$emit('lookHistory',list.target)" v-if="list.target" />
|
|
|
-
|
|
|
- <i class="el-icon-error del-tag" v-if="index > 1" @click="delTarget(index)" />
|
|
|
+ <i class="el-icon-error del-tag" v-if="index > 1" @click="delTargetList(index)" />
|
|
|
<span class="target-date" v-if="list.start_date">{{
|
|
|
- `${list.start_date}至${list.end_date}`
|
|
|
- }}</span>
|
|
|
+ `${list.start_date}至${list.end_date}`
|
|
|
+ }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<span class="add-icon" @click="addTargetHandle">
|
|
|
<i class="el-icon-circle-plus-outline" style="color: #5882ef; font-size: 16px" />
|
|
|
添加更多指标
|
|
|
</span>
|
|
|
+ <ul class="form-ul">
|
|
|
+ <li class="form-li" v-for="(list, index) in targetList" :key="index">
|
|
|
+ <span class="li-tag">{{ list.tag }}</span>
|
|
|
+ <el-form :ref="`list_form_${index}`"
|
|
|
+ label-position="right"
|
|
|
+ inline
|
|
|
+ label-width="0px"
|
|
|
+ :model="targetList[index]"
|
|
|
+ :rules="formRules"
|
|
|
+ >
|
|
|
+ <el-form-item prop="targetName">
|
|
|
+ <el-input
|
|
|
+ v-model="targetList[index].targetName"
|
|
|
+ style="width: 340px"
|
|
|
+ placeholder="请输入指标名称"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="unit">
|
|
|
+ <selectUnit
|
|
|
+ v-model="targetList[index].unit"
|
|
|
+ style="width: 340px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="menu">
|
|
|
+ <el-cascader v-if="isOpenSmooth"
|
|
|
+ v-model="targetList[index].menu"
|
|
|
+ :options="catalogArr"
|
|
|
+ :props="levelProps"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择指标目录"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="frequency">
|
|
|
+ <el-select
|
|
|
+ v-model="targetList[index].frequency"
|
|
|
+ placeholder="请选择频度"
|
|
|
+ style="width: 340px"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in frequencyArr"
|
|
|
+ :key="item"
|
|
|
+ :label="item"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="alphaValue">
|
|
|
+ <el-input
|
|
|
+ v-model.trim="targetList[index].alphaValue"
|
|
|
+ style="width: 340px"
|
|
|
+ placeholder="请输入alpha值"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
<div class="dia-bot" v-if="!operationForm.view">
|
|
|
<el-button
|
|
@@ -293,7 +349,11 @@ export default {
|
|
|
dataList:[],
|
|
|
|
|
|
/* 批量 */
|
|
|
- targetList:[],
|
|
|
+ targetList:[/* {
|
|
|
+ tag:'A',
|
|
|
+ target:123456 //edbid
|
|
|
+ ...formData
|
|
|
+ } */],
|
|
|
formDataList:[],
|
|
|
|
|
|
loading:false,
|
|
@@ -315,12 +375,16 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+ if(this.computedSource===2){
|
|
|
+ this.addTargetHandle()
|
|
|
+ this.addTargetHandle()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
init(){
|
|
|
- this.$refs.form.resetFields();
|
|
|
+ this.$refs.form&&(this.$refs.form.resetFields());
|
|
|
Object.assign(this.$data, this.$options.data());
|
|
|
},
|
|
|
searchLoad() {
|
|
@@ -373,6 +437,20 @@ export default {
|
|
|
this.dataList = [];
|
|
|
}
|
|
|
},
|
|
|
+ chooseTargetList(val,index){
|
|
|
+ if(val){
|
|
|
+ const obj = this.searchOptions.find(item => item.EdbInfoId === val);
|
|
|
+ const {tag,target} = this.targetList[index]
|
|
|
+ this.targetList[index] = {
|
|
|
+ tag,target,
|
|
|
+ targetName:`${obj.EdbName}指数修匀`,
|
|
|
+ unit:obj.Unit,
|
|
|
+ frequency:obj.Frequency,
|
|
|
+ menu:obj.ClassifyId||'',
|
|
|
+ alphaValue:obj.Formula||''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
setDefaultOption(obj,type){
|
|
|
this.formData = {
|
|
|
targetName:`${obj.EdbName}${type==='edit'?'':'指数修匀'}`,
|
|
@@ -411,10 +489,32 @@ export default {
|
|
|
window.open(href,'_blank');
|
|
|
}
|
|
|
},
|
|
|
- delTarget(){},
|
|
|
scrollHandle(){},
|
|
|
+ delTarget(){},
|
|
|
+ delTargetList(index){
|
|
|
+ this.targetList.splice(index, 1);
|
|
|
+ },
|
|
|
+ clearHandle(index){
|
|
|
+ console.log('?clear',index)
|
|
|
+ const item = {...{tag:tag_arr[index],target:''},..._.cloneDeep(this.formData)}
|
|
|
+ this.targetList.splice(index,1,item)
|
|
|
+ },
|
|
|
+
|
|
|
+ addTargetHandle(){
|
|
|
+ if(this.targetList.length >= 26){
|
|
|
+ this.$message.warning('添加指标个数已达上限')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let tag = 'A'
|
|
|
+ let index = -1
|
|
|
+ if(this.targetList.length>=1){
|
|
|
+ tag = this.targetList[this.targetList.length-1].tag;
|
|
|
+ index = tag_arr.findIndex(item => item === tag);
|
|
|
+ }
|
|
|
+ const item = {...{tag:tag_arr[index+1],target:''},..._.cloneDeep(this.formData)}
|
|
|
+ this.targetList.push(item)
|
|
|
+ },
|
|
|
async saveHandle(){
|
|
|
- console.log('aaa?')
|
|
|
if(!this.select_target){
|
|
|
this.$message.warning('指标不能为空')
|
|
|
return
|