|
@@ -29,7 +29,8 @@
|
|
|
>
|
|
|
<p class="font-big">{{values.existComputed}}</p>
|
|
|
<p class="exist-title">{{values.existTitle}}</p>
|
|
|
- <getCascader :RelationTypeName="RelationTypeName" :number="number"/>
|
|
|
+
|
|
|
+ <!-- <getCascader :RelationTypeName="RelationTypeName" :number="number"/>-->
|
|
|
<!-- <el-row :span="24" style="margin-top: 10px">-->
|
|
|
<!-- <el-col :span="8">-->
|
|
|
<!-- <p class="demonstration">{{values.originEquipment}}</p>-->
|
|
@@ -65,15 +66,51 @@
|
|
|
<!-- />-->
|
|
|
<!-- </el-col>-->
|
|
|
<!-- </el-row>-->
|
|
|
+ <el-row :gutter="20" style="margin-bottom: 20px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>源端设备类:</p>
|
|
|
+ <el-select
|
|
|
+ v-model="setValue"
|
|
|
+ placeholder="请选择"
|
|
|
+ :props="props"
|
|
|
+ multiple
|
|
|
+ disabled
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in setOriginOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>末端设备类:</p>
|
|
|
+ <el-select
|
|
|
+ v-model="setEndValue"
|
|
|
+ placeholder="请选择"
|
|
|
+ :props="props"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in setEndOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<footer
|
|
|
- slot="footer"
|
|
|
- class="dialog-footer "
|
|
|
- style="float: right"
|
|
|
+ slot="footer"
|
|
|
+ class="dialog-footer "
|
|
|
+ style="float: right"
|
|
|
>
|
|
|
<el-button @click="dialogTableVisibleMore = false">{{values.cancel}}</el-button>
|
|
|
<el-button
|
|
|
- type="primary"
|
|
|
- @click="computedUpdate"
|
|
|
+ type="primary"
|
|
|
+ @click="computedUpdate"
|
|
|
>{{values.promptly}}
|
|
|
</el-button>
|
|
|
</footer>
|
|
@@ -101,7 +138,40 @@
|
|
|
:visible.sync="dialogEquipment"
|
|
|
>
|
|
|
<h4>{{values.equipmentSetting}}</h4>
|
|
|
- <setCascader @change="changeCader" :RelationTypeName="RelationTypeName"/>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>源端设备类:</p>
|
|
|
+ <el-select
|
|
|
+ v-model="value"
|
|
|
+ placeholder="请选择"
|
|
|
+ multiple
|
|
|
+ @change="changeVal"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in oraginOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>末端设备类:</p>
|
|
|
+ <el-select
|
|
|
+ v-model="endValue"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in endOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ disabled
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- <setCascader @change="changeCader" :RelationTypeName="RelationTypeName"/>-->
|
|
|
<!-- <el-row :span="24" style="margin-top: 15px">-->
|
|
|
<!-- <el-col :span="8">-->
|
|
|
<!-- <p class="">{{values.originEquipment}}</p>-->
|
|
@@ -121,6 +191,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@click="handleAddSource"
|
|
|
+ :disabled="disabled"
|
|
|
>{{values.preservation}}
|
|
|
</el-button>
|
|
|
</footer>
|
|
@@ -234,21 +305,16 @@
|
|
|
<script>
|
|
|
import {mapGetters} from 'vuex'
|
|
|
import storage from '@/framework/utils/storage'
|
|
|
- import setCascader from "./setCascader";
|
|
|
- import getCascader from "./getCascader";
|
|
|
- import {addSource, calcSpecial} from "@/api/relation/api";
|
|
|
+ import {addSource, calcSpecial, sourceQuery} from "@/api/relation/api";
|
|
|
+ import deviceList from "@/data/deviceList.js"
|
|
|
|
|
|
export default {
|
|
|
name: "RelationMaintain",
|
|
|
props: ['values', 'isComputed', 'source', 'TableVisibleMoreLoading', 'ManualMaintenance'],
|
|
|
- components: {setCascader,getCascader},
|
|
|
created() {
|
|
|
- // this.showCascader()
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.$nextTick(() => {
|
|
|
- console.log(this.$refs.child1, '===')
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -290,13 +356,16 @@
|
|
|
ops: [],
|
|
|
filterOps: [],//为清空第二个选择器
|
|
|
isResouceShow: 0,
|
|
|
- assetOptions: [],
|
|
|
- assetValue: '',
|
|
|
- assetValueLast: '',
|
|
|
RelationTypeName: '',//卡片名称
|
|
|
- deviceGroup: [],
|
|
|
- deviceValue: '',
|
|
|
- number: 0
|
|
|
+ value: [],
|
|
|
+ oraginOption: [],
|
|
|
+ endValue: [],
|
|
|
+ endOption: [],
|
|
|
+ setValue: [],
|
|
|
+ setOriginOption: [],
|
|
|
+ setEndValue: [],
|
|
|
+ setEndOptions: [],
|
|
|
+ disabled: false
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -334,12 +403,37 @@
|
|
|
deepCopy(obj) {
|
|
|
return JSON.parse(JSON.stringify(obj))
|
|
|
},
|
|
|
- dialogEquipmentOpen(relation) {
|
|
|
+ //查询原末端回显数据
|
|
|
+ handleSourceQuery() {
|
|
|
+ let param = {
|
|
|
+ Filters: `ProjectId='${this.projectId}';CalcName='${this.RelationTypeName}'`
|
|
|
+ }
|
|
|
+ sourceQuery(param, res => {
|
|
|
+ this.value = []
|
|
|
+ this.setValue = []
|
|
|
+ res.Content && res.Content.forEach(({SourceType}) => this.value.push(SourceType))
|
|
|
+ //启动计算
|
|
|
+ res.Content && res.Content.forEach(({SourceType}) => this.setValue.push(SourceType))
|
|
|
+ // this.setOriginOption = this.oraginOption.forEach(i => this.setValue.includes(i.value))
|
|
|
+ this.changeVal(this.value)
|
|
|
+ this.setValue && this.handleSetValue()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ dialogEquipmentOpen(relation) { //设定源末端
|
|
|
this.RelationTypeName = relation.RelationTypeName
|
|
|
+ this.oraginOption = deviceList[relation.RelationTypeName] && deviceList[relation.RelationTypeName].filter(i => i.select)
|
|
|
+ this.data = deviceList[relation.RelationTypeName]
|
|
|
+ this.disabled = this.data != undefined ? false : true
|
|
|
+ // console.log(this.data, relation.RelationTypeName)
|
|
|
this.dialogEquipment = true
|
|
|
|
|
|
},
|
|
|
- changeCader(val) { //勾选的设备类
|
|
|
+ changeVal(val) {
|
|
|
+ // 末端展示数据
|
|
|
+ this.endOption = this.data && this.data.filter(i => !val.includes(i.value))
|
|
|
+ // 启动计算末端展示数据
|
|
|
+ // this.setEndOptions = this.data && this.data.filter(i => !val.includes(i.value))
|
|
|
+
|
|
|
this.sourceList = []
|
|
|
val.forEach(i => this.sourceList.push({
|
|
|
SourceType: i,
|
|
@@ -347,14 +441,17 @@
|
|
|
CalcName: this.RelationTypeName
|
|
|
}))
|
|
|
},
|
|
|
+
|
|
|
handleAddSource() { //保存设备类
|
|
|
- let params = {
|
|
|
- Content: this.sourceList
|
|
|
+ if (this.sourceList.length) {
|
|
|
+ let params = {
|
|
|
+ Content: this.sourceList
|
|
|
+ }
|
|
|
+ addSource(params, res => {
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ })
|
|
|
}
|
|
|
- addSource(params, res => {
|
|
|
- ++this.number
|
|
|
- this.$message.success('保存成功')
|
|
|
- })
|
|
|
+
|
|
|
this.dialogEquipment = false
|
|
|
},
|
|
|
// showCascader() {
|
|
@@ -374,10 +471,14 @@
|
|
|
// },
|
|
|
showCascader(relation) {
|
|
|
this.RelationTypeName = relation.RelationTypeName
|
|
|
- // this.$refs.getUpdate.getData()
|
|
|
|
|
|
|
|
|
},
|
|
|
+ handleSetValue() {
|
|
|
+ let device = deviceList[this.RelationTypeName]
|
|
|
+ this.setOriginOption = device && device.filter(i => this.setValue.includes(i.value))
|
|
|
+ this.setEndOptions = device && device.filter(i => !this.setValue.includes(i.value))
|
|
|
+ },
|
|
|
downloadProject(str) {
|
|
|
let relType = this.ManualMaintenance.RelationType ? `?relType=${this.ManualMaintenance.RelationType}` : ''
|
|
|
let zoneType = this.ManualMaintenance.ZoneType ? `&zoneType=${this.ManualMaintenance.ZoneType}` : null
|
|
@@ -534,3 +635,13 @@
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|