|
@@ -1,100 +1,85 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-collapse v-if="renderData.length" v-model="activeName" @change="collapseChange" accordion>
|
|
|
- <el-collapse-item name="1">
|
|
|
- <template slot="title">①确定与数据字典中信息点得对应
|
|
|
- </template>
|
|
|
- <div class="collapse-item">
|
|
|
- <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>
|
|
|
- </el-form>
|
|
|
- <div class="mess-main">
|
|
|
- <div></div>
|
|
|
- <div></div>
|
|
|
- </div>
|
|
|
- <div class="center">
|
|
|
- <el-button>下一步</el-button>
|
|
|
- </div>
|
|
|
+ <el-steps :active="activeName" align-center>
|
|
|
+ <el-step title="步骤1" description="确定与数据字典中信息点得对应"></el-step>
|
|
|
+ <el-step title="步骤2" description="确定值得处理方式"></el-step>
|
|
|
+ <el-step title="步骤3" description="确认并维护涉及到得原始点位对应得设备标识"></el-step>
|
|
|
+ </el-steps>
|
|
|
+ <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>
|
|
|
+ </el-form>
|
|
|
+ <div class="mess-main">
|
|
|
+ <div>
|
|
|
+ <p>原始点位说明</p>
|
|
|
+ <p></p>
|
|
|
</div>
|
|
|
- </el-collapse-item>
|
|
|
- <el-collapse-item name="2">
|
|
|
- <template slot="title">
|
|
|
- ②确定值得处理方式
|
|
|
- </template>
|
|
|
- <div class="collapse-item">
|
|
|
- <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
|
|
|
- <el-form-item label='值处理方式' prop='DataRuleType'>
|
|
|
- <el-select v-model='form2.DataRuleType' placeholder='请选择'>
|
|
|
- <el-option
|
|
|
- v-for='item in handleTypeArr'
|
|
|
- :key='item.value'
|
|
|
- :label='item.label'
|
|
|
- :value='item.value'
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <!-- components -->
|
|
|
- <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
|
|
|
- <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
|
|
|
- <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
|
|
|
- <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
|
|
|
- <split-handle :devFlag="false" ref='splitHandle' v-else></split-handle>
|
|
|
- </el-form>
|
|
|
+ <div>
|
|
|
+ <p>数据字典值说明</p>
|
|
|
+ <p></p>
|
|
|
</div>
|
|
|
- </el-collapse-item>
|
|
|
- <el-collapse-item name="3">
|
|
|
- <template slot="title">
|
|
|
- 三确认并维护涉及到得原始呆腻味对应得设备标识
|
|
|
- </template>
|
|
|
- <div class="collapse-item">
|
|
|
- <handsontable-component ref="handsontable"></handsontable-component>
|
|
|
</div>
|
|
|
- </el-collapse-item>
|
|
|
- </el-collapse>
|
|
|
- <div v-else class="center">
|
|
|
- 暂无数据
|
|
|
+ <div class="center">
|
|
|
+ <el-button @click="next">下一步</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="collapse-item" v-show="activeName == 1">
|
|
|
+ <div class="flex-around">
|
|
|
+ <div class="point-despoint"></div>
|
|
|
+ <div class="point-despoint"></div>
|
|
|
+ </div>
|
|
|
+ <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
|
|
|
+ <el-form-item label='值处理方式' prop='DataRuleType'>
|
|
|
+ <el-select v-model='form2.DataRuleType' placeholder='请选择'>
|
|
|
+ <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- components -->
|
|
|
+ <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
|
|
|
+ <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
|
|
|
+ <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
|
|
|
+ <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
|
|
|
+ <split-handle :devFlag="false" ref='splitHandle' v-else></split-handle>
|
|
|
+ </el-form>
|
|
|
+ <div class="center">
|
|
|
+ <el-button>下一步</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="collapse-item" v-show="activeName == 2">
|
|
|
+ <handsontable-component ref="handsontable"></handsontable-component>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-//components
|
|
|
-import noHandle from '@/components/config_point/step3_edit/no_handle'
|
|
|
-import autoHandle from '@/components/config_point/step3_edit/auto_handle'
|
|
|
-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 { getEquipmentAll, getQueryProperty } from '@/fetch/data_plat'
|
|
|
-import { batchCreate } from '@/fetch/point_http'
|
|
|
+ //components
|
|
|
+ import noHandle from '@/components/config_point/step3_edit/no_handle'
|
|
|
+ import autoHandle from '@/components/config_point/step3_edit/auto_handle'
|
|
|
+ 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 {
|
|
|
+ getEquipmentAll,
|
|
|
+ getQueryProperty
|
|
|
+ } from '@/fetch/data_plat'
|
|
|
+ import {
|
|
|
+ batchCreate
|
|
|
+ } from '@/fetch/point_http'
|
|
|
export default {
|
|
|
name: "tempsThree",
|
|
|
props: {
|
|
|
renderData: {
|
|
|
- type:Array,
|
|
|
- default: function(){
|
|
|
+ type: Array,
|
|
|
+ default: function() {
|
|
|
return []
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- activeName: 1,
|
|
|
+ activeName: 0,
|
|
|
form1: {
|
|
|
dict: []
|
|
|
},
|
|
@@ -107,8 +92,7 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
infoDict: {}, //信息点字典
|
|
|
InfomationPoint: null, //信息点
|
|
|
unitObj: {}, //传给自动单位转换的obj
|
|
|
- handleTypeArr: [
|
|
|
- {
|
|
|
+ handleTypeArr: [{
|
|
|
label: '无需处理,直接使用',
|
|
|
value: '无需处理,直接使用'
|
|
|
},
|
|
@@ -130,11 +114,15 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
}
|
|
|
],
|
|
|
form2: {
|
|
|
- ValueDescription: '',
|
|
|
+ ValueDescription: '',
|
|
|
DataRuleType: '无需处理,直接使用'
|
|
|
},
|
|
|
rules: {
|
|
|
- DataRuleType: [{ required: true, message: '请选择值处理方式', trigger: 'change' }]
|
|
|
+ DataRuleType: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择值处理方式',
|
|
|
+ trigger: 'change'
|
|
|
+ }]
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -143,7 +131,7 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
this.init()
|
|
|
console.log(this.renderData)
|
|
|
},
|
|
|
- components:{
|
|
|
+ components: {
|
|
|
noHandle,
|
|
|
autoHandle,
|
|
|
enumHandle,
|
|
@@ -154,13 +142,12 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
methods: {
|
|
|
collapseChange(val) {
|
|
|
console.log(this.activeName)
|
|
|
- if(this.activeName == 3){
|
|
|
+ if (this.activeName == 3) {
|
|
|
let setting = {
|
|
|
data: this.renderData,
|
|
|
maxRows: this.length,
|
|
|
- colHeaders: ['设备标识','原始点位描述','位置标签','备注'],
|
|
|
- columns: [
|
|
|
- {
|
|
|
+ colHeaders: ['设备标识', '原始点位描述', '位置标签', '备注'],
|
|
|
+ columns: [{
|
|
|
data: 'EquipmentMark'
|
|
|
},
|
|
|
{
|
|
@@ -182,6 +169,9 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ next(){
|
|
|
+ this.activeName += 1
|
|
|
+ },
|
|
|
validateDict(rule, value, cb) {
|
|
|
if (value.length < 4) {
|
|
|
cb(new Error('请选到第四级(可能本设备没有信息点)'))
|
|
@@ -190,13 +180,18 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
}
|
|
|
},
|
|
|
handleChange(arr) {
|
|
|
+ console.log(arr, 'arr')
|
|
|
+ console.log(this.infoDict, 'infoDict')
|
|
|
this.unitObj = this.infoDict[arr[3]]
|
|
|
- console.log(this.unitObj)
|
|
|
this.InfomationPoint = this.unitObj.infoPointName
|
|
|
},
|
|
|
handleItemChange(val) {
|
|
|
+ console.log(val, 'vals')
|
|
|
if (val.length == 3) {
|
|
|
- let params = { type: val[2] }
|
|
|
+ let params = {
|
|
|
+ type: val[2]
|
|
|
+ }
|
|
|
+ console.log(params, 'params')
|
|
|
getQueryProperty(params, res => {
|
|
|
if (res.Result == 'success') {
|
|
|
let data = res.Content
|
|
@@ -214,9 +209,9 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
data.forEach(item => {
|
|
|
this.infoDict[item.infoPointCode] = item
|
|
|
})
|
|
|
+ console.log(this.infoDict)
|
|
|
this.optionObj = {}
|
|
|
this.getOptionItem(this.options, val[2])
|
|
|
-
|
|
|
if (arr.length) {
|
|
|
this.optionObj.content = arr
|
|
|
} else {
|
|
@@ -233,11 +228,15 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
}
|
|
|
if (arr[i].content && arr[i].content.length > 0) {
|
|
|
this.getOptionItem(arr[i].content, code)
|
|
|
+ }else{
|
|
|
+ this.$set(arr,'content',[])
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
getEqAll() {
|
|
|
- let params = { format: true }
|
|
|
+ let params = {
|
|
|
+ format: true
|
|
|
+ }
|
|
|
getEquipmentAll(params, res => {
|
|
|
if (res.Result == 'success') {
|
|
|
this.options = res.Content
|
|
@@ -252,8 +251,17 @@ import { batchCreate } from '@/fetch/point_http'
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+ .flex-around {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ .point-despoint {
|
|
|
+ width: 160px;
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ height: 100px;
|
|
|
+ }
|
|
|
+ }
|
|
|
.collapse-item {
|
|
|
- height: 170px;
|
|
|
+ height: 190px;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
</style>
|