|
@@ -29,7 +29,8 @@
|
|
|
>
|
|
|
<p class="font-big">{{values.existComputed}}</p>
|
|
|
<p class="exist-title">{{values.existTitle}}</p>
|
|
|
- <getCascader :RelationTypeName="RelationTypeName"/>
|
|
|
+
|
|
|
+ <!-- <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>
|
|
@@ -181,6 +252,8 @@
|
|
|
:on-progress="progress"
|
|
|
:on-success="success"
|
|
|
:on-error="error"
|
|
|
+
|
|
|
+
|
|
|
accept="xlsx,xls"
|
|
|
>
|
|
|
<i class="el-icon-upload"/>
|
|
@@ -232,18 +305,16 @@
|
|
|
<script>
|
|
|
import {mapGetters} from 'vuex'
|
|
|
import storage from '@/framework/utils/storage'
|
|
|
- import setCascader from "./setCascader";
|
|
|
- import getCascader from "./getCascader";
|
|
|
- import {addSource} 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() {
|
|
|
+
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -285,14 +356,19 @@
|
|
|
ops: [],
|
|
|
filterOps: [],//为清空第二个选择器
|
|
|
isResouceShow: 0,
|
|
|
- assetOptions: [],
|
|
|
- assetValue: '',
|
|
|
- assetValueLast: '',
|
|
|
RelationTypeName: '',//卡片名称
|
|
|
- deviceGroup: [],
|
|
|
- deviceValue: '',
|
|
|
+ value: [],
|
|
|
+ oraginOption: [],
|
|
|
+ endValue: [],
|
|
|
+ endOption: [],
|
|
|
+ setValue: [],
|
|
|
+ setOriginOption: [],
|
|
|
+ setEndValue: [],
|
|
|
+ setEndOptions: [],
|
|
|
+ disabled: false
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
computed: {
|
|
|
...mapGetters('layout', ['projectId']),
|
|
|
headers() {
|
|
@@ -327,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,
|
|
@@ -340,29 +441,43 @@
|
|
|
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.$message.success('保存成功')
|
|
|
- })
|
|
|
+
|
|
|
this.dialogEquipment = false
|
|
|
},
|
|
|
- showCascader() {
|
|
|
- ++this.isResouceShow
|
|
|
- let copy = this.deepCopy(this.source)
|
|
|
- copy.forEach(item => {
|
|
|
- item.Items.forEach(child => {
|
|
|
- child.lId = this.list.length
|
|
|
- this.list.push(child)
|
|
|
- child.Items.forEach(i => {
|
|
|
- i.lId = i.Id + i.BlockId
|
|
|
- i.IsSource == true && this.ops.push([child.lId, i.lId])
|
|
|
- i.IsSource == false && this.filterOps.push([child.lId, i.lId])
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
+ // showCascader() {
|
|
|
+ // ++this.isResouceShow
|
|
|
+ // let copy = this.deepCopy(this.source)
|
|
|
+ // copy.forEach(item => {
|
|
|
+ // item.Items.forEach(child => {
|
|
|
+ // child.lId = this.list.length
|
|
|
+ // this.list.push(child)
|
|
|
+ // child.Items.forEach(i => {
|
|
|
+ // i.lId = i.Id + i.BlockId
|
|
|
+ // i.IsSource == true && this.ops.push([child.lId, i.lId])
|
|
|
+ // i.IsSource == false && this.filterOps.push([child.lId, i.lId])
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ showCascader(relation) {
|
|
|
+ this.RelationTypeName = relation.RelationTypeName
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ 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}` : ''
|
|
@@ -371,7 +486,7 @@
|
|
|
if (str === 'excel') {
|
|
|
relType = this.ManualMaintenance.RelationType ? `&relType=${this.ManualMaintenance.RelationType}` : ''
|
|
|
// url = `/api/datacenter/graphic/export?code=对象ID${relType}${zoneType}`
|
|
|
- if(zoneType) {
|
|
|
+ if (zoneType) {
|
|
|
url = '/api/datacenter/graphic/export?code=对象ID' + relType + zoneType
|
|
|
|
|
|
} else {
|
|
@@ -468,9 +583,16 @@
|
|
|
// this.dialogTableVisibleMore = false
|
|
|
//
|
|
|
// }
|
|
|
- this.resultOrigin.push(...this.resultEnd)
|
|
|
- this.$emit('openComputed', this.resultOrigin)
|
|
|
+ // this.resultOrigin.push(...this.resultEnd)
|
|
|
+ // this.$emit('openComputed', this.resultOrigin)
|
|
|
this.dialogTableVisibleMore = false
|
|
|
+ let params = {
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ RelationType: this.isComputed.RelationType
|
|
|
+ }
|
|
|
+ calcSpecial(params, res => {
|
|
|
+ this.$message.success('计算成功')
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
}
|
|
@@ -513,3 +635,13 @@
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|