|
@@ -5,12 +5,10 @@
|
|
|
<el-step title="步骤2" description="确定值得处理方式"></el-step>
|
|
|
<el-step title="步骤3" description="确认并维护涉及到得原始点位对应得设备标识"></el-step>
|
|
|
</el-steps>
|
|
|
- <div class="collapse-item" v-if="activeName == 0">
|
|
|
+ <div class="collapse-item" v-show="activeName == 0">
|
|
|
<el-form class="form" :rules="rules" ref="form" :model="form1" label-width="120px">
|
|
|
- <el-form-item label="对应数据字典" prop="dict"
|
|
|
- :rules="[{ required: true, message: '请输入对应数据字典', trigger: 'change' },{ validator: validateDict, trigger: ['blur', 'change'] }]">
|
|
|
- <el-cascader style="width: 100%;" :options="options" v-model="form1.dict" @change="handleChange" :props="props" filterable
|
|
|
- @active-item-change="handleItemChange"></el-cascader>
|
|
|
+ <el-form-item label="对应数据字典" prop="dict">
|
|
|
+ <dictionary-cas @change="changeDictionaryCas" ref="dictionaryCas"></dictionary-cas>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="flex-around">
|
|
@@ -20,7 +18,7 @@
|
|
|
</div>
|
|
|
<div class="point-despoint">
|
|
|
<p class="center">数据字典值说明</p>
|
|
|
- <p class="content-view p10">{{delDataSource(unitObj.dataSource)}}</p>
|
|
|
+ <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="center">
|
|
@@ -35,7 +33,7 @@
|
|
|
</div>
|
|
|
<div class="point-despoint">
|
|
|
<p class="center">数据字典值说明</p>
|
|
|
- <p class="content-view p10">{{delDataSource(unitObj.dataSource)}}</p>
|
|
|
+ <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
|
|
@@ -78,6 +76,7 @@ import enumHandle from '@/components/config_point/step3_edit/enum_handle'
|
|
|
import formulaHandle from '@/components/config_point/step3_edit/formula_handle'
|
|
|
import splitHandle from '@/components/config_point/step3_edit/split_handle'
|
|
|
import handsontableComponent from "@/components/common/handsontable"
|
|
|
+import dictionaryCas from '@/components/config_point/dictionaryCascader'
|
|
|
import {
|
|
|
mapGetters,
|
|
|
mapActions
|
|
@@ -114,15 +113,10 @@ export default {
|
|
|
return {
|
|
|
activeName: 0,
|
|
|
form1: {
|
|
|
- dict: []
|
|
|
+ dict: 1
|
|
|
},
|
|
|
options: [],
|
|
|
dataDict: {}, //数据字典
|
|
|
- props: {
|
|
|
- value: 'code',
|
|
|
- label: 'name',
|
|
|
- children: 'content'
|
|
|
- },
|
|
|
infoDict: {}, //信息点字典
|
|
|
InfomationPoint: null, //信息点
|
|
|
unitObj: {}, //传给自动单位转换的obj
|
|
@@ -172,15 +166,17 @@ export default {
|
|
|
enumHandle,
|
|
|
formulaHandle,
|
|
|
splitHandle,
|
|
|
- handsontableComponent
|
|
|
+ handsontableComponent,
|
|
|
+ dictionaryCas
|
|
|
},
|
|
|
methods: {
|
|
|
getMain(param) {
|
|
|
this.activeName = 0
|
|
|
this.dealType = {}
|
|
|
this.form1 = {
|
|
|
- dict: []
|
|
|
+ dict: 1
|
|
|
}
|
|
|
+ this.$refs.dictionaryCas.setCascaderVal([''])
|
|
|
this.form2 = {
|
|
|
ValueDescription: '',
|
|
|
DataRuleType: '无需处理,直接使用'
|
|
@@ -264,29 +260,21 @@ export default {
|
|
|
next() {
|
|
|
var that = this;
|
|
|
if (this.activeName == 0) {
|
|
|
- this.$refs.form.validate((isOk, obj) => {
|
|
|
- if (isOk) {
|
|
|
- this.form2 = Object.assign(this.form2, this.form1)
|
|
|
+ this.$refs.dictionaryCas.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
this.activeName += 1
|
|
|
} else {
|
|
|
this.errMsg()
|
|
|
}
|
|
|
})
|
|
|
} else if (this.activeName == 1) {
|
|
|
- this.$refs['form2'].validate(valid => {
|
|
|
+ this.$refs.form2.validate(valid => {
|
|
|
if (valid) {
|
|
|
var flag = this.form2.DataRuleType
|
|
|
var isNext = true;
|
|
|
switch (flag) {
|
|
|
case '无需处理,直接使用':
|
|
|
- // this.$refs.noHandle.getForm(noHandle => {
|
|
|
- // if (noHandle) {
|
|
|
this.saveForm(this.form2, {})
|
|
|
- // } else {
|
|
|
- // isNext = false
|
|
|
- // this.errMsg()
|
|
|
- // }
|
|
|
- // })
|
|
|
break
|
|
|
case '需自动单位转换':
|
|
|
this.$refs.autoHandle.getForm(autoHandle => {
|
|
@@ -369,17 +357,21 @@ export default {
|
|
|
saveForm(basic, other) {
|
|
|
let type = basic.DataRuleType
|
|
|
let basicParams = {
|
|
|
- SpecialtyCode: basic.dict[0],
|
|
|
- SystemCode: basic.dict[1], //code
|
|
|
- EquipmentTypeCode: basic.dict[2],
|
|
|
- InfomationPointCode: basic.dict[3],
|
|
|
- Specialty: this.dataDict[basic.dict[0]].name, //专业
|
|
|
- System: this.dataDict[basic.dict[1]].name, //系统
|
|
|
- EquipmentType: this.dataDict[basic.dict[2]].name, //设备
|
|
|
- InfomationPoint: this.InfomationPoint, //信息点
|
|
|
+ InfomationPointCode: this.dictionaryData[this.dictionaryData.length - 1], //信息点code
|
|
|
+ InfomationPoint: this.dictionaryNames[this.dictionaryNames.length - 1], //信息点名称
|
|
|
DataRuleType: basic.DataRuleType, //值处理方式
|
|
|
- // DataSourceId: '4',
|
|
|
- // PointId: this.editData.Point.Id //点位ID
|
|
|
+ Type: this.dictionaryNames[0], //一级分类名称
|
|
|
+ TypeCode: this.dictionaryData[0], //一级分类code
|
|
|
+ }
|
|
|
+ if (this.dictionaryData.length == 3) {
|
|
|
+ //设备-部件-空间
|
|
|
+ basicParams.EquipmentTypeCode = this.dictionaryData[1]
|
|
|
+ basicParams.EquipmentType = this.dictionaryNames[1]
|
|
|
+ } else if (this.dictionaryData.length == 4) { //专业系统
|
|
|
+ basicParams.SpecialtyCode = this.dictionaryData[1]
|
|
|
+ basicParams.Specialty = this.dictionaryNames[1]
|
|
|
+ basicParams.SystemCode = this.dictionaryNames[2]
|
|
|
+ basicParams.System = this.dictionaryNames[2]
|
|
|
}
|
|
|
let otherParams = {}
|
|
|
switch (type) {
|
|
@@ -498,10 +490,6 @@ export default {
|
|
|
cb()
|
|
|
}
|
|
|
},
|
|
|
- handleChange(arr) {
|
|
|
- this.unitObj = this.infoDict[arr[3]]
|
|
|
- this.InfomationPoint = this.unitObj.infoPointName
|
|
|
- },
|
|
|
handleItemChange(val) {
|
|
|
if (val.length == 3) {
|
|
|
let params = {
|
|
@@ -512,7 +500,7 @@ export default {
|
|
|
let data = res.Content
|
|
|
let arr = data
|
|
|
.filter(item => {
|
|
|
- return item.inputMode == 'L'
|
|
|
+ return item.inputMode == 'L' || item.inputMode == 'M'
|
|
|
})
|
|
|
.map(item => {
|
|
|
return {
|
|
@@ -547,17 +535,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //缓存数据字典
|
|
|
- getDataDict(arr) {
|
|
|
- for (var i = 0; i < arr.length; i++) {
|
|
|
- // this.dataDict[arr[i].code] = arr[i]
|
|
|
- if (arr[i].content && arr[i].content.length > 0) {
|
|
|
- this.getDataDict(arr[i].content)
|
|
|
- } else {
|
|
|
- this.$set(arr[i], 'content', [])
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
getEqAll() {
|
|
|
let params = {
|
|
|
format: true
|
|
@@ -586,23 +563,27 @@ export default {
|
|
|
},
|
|
|
//处理函数
|
|
|
delDataSource(val) {
|
|
|
-
|
|
|
if (!val) {
|
|
|
return '--'
|
|
|
}
|
|
|
- if (typeof val == 'string') {
|
|
|
- if (!!val) {
|
|
|
- return val
|
|
|
- } else {
|
|
|
- return '无信息带你单位及值说明'
|
|
|
- }
|
|
|
- } else {
|
|
|
- let str = ''
|
|
|
- val.forEach(el => {
|
|
|
- str += el.code + '.' + el.name + ' '
|
|
|
- })
|
|
|
- return str
|
|
|
- }
|
|
|
+ val = JSON.parse(val)
|
|
|
+ let str = ''
|
|
|
+ val.forEach(el => {
|
|
|
+ str += el.Code + '.' + el.Name + ' '
|
|
|
+ })
|
|
|
+ return str
|
|
|
+ },
|
|
|
+ //对应数据字典变化
|
|
|
+ changeDictionaryCas({ val, labels }) {
|
|
|
+ this.dictionaryData = val;
|
|
|
+ this.dictionaryNames = labels
|
|
|
+ this.infoDict = this.$refs.dictionaryCas.pointDataSource
|
|
|
+ this.unitObj = this.infoDict[val[val.length - 1]]
|
|
|
+ console.log(11111111111)
|
|
|
+ console.log(val[val.length - 1])
|
|
|
+ console.log(this.infoDict)
|
|
|
+ console.log(this.unitObj)
|
|
|
+ this.InfomationPoint = this.unitObj.infoPointName
|
|
|
}
|
|
|
}
|
|
|
}
|