|
@@ -55,7 +55,11 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<!-- 间隔、装置列表 -->
|
|
|
- <div class="gapAndUnit" v-if="false">
|
|
|
+ <div>
|
|
|
+ <el-button style="width: 200px;height: 30px;" @click="backMent">返回</el-button>
|
|
|
+ <el-button style="width: 200px;height: 30px;" @click="saveMent" type="primary">保存</el-button>
|
|
|
+ </div>
|
|
|
+ <div class="gapAndUnit" v-if="successScd">
|
|
|
<!-- 间隔列表 -->
|
|
|
<div class="gapBox">
|
|
|
<div style="display: flex;justify-content: flex-start;align-items: center;margin: 5px;">
|
|
@@ -66,10 +70,11 @@
|
|
|
<span>间隔列表</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <p :class="jgSelect == index ? 'result' : ''" v-for="(item, index) in jgList"
|
|
|
+ <!-- <p :class="jgSelect == index ? 'result' : ''" v-for="(item, index) in jgList"
|
|
|
style="text-align: left;cursor: pointer;" @click="jgClick(item, index)">
|
|
|
{{ item.name }}
|
|
|
- </p>
|
|
|
+ </p> -->
|
|
|
+ <el-tree :props="anyProps" :data="anyData" @node-click="handleCheckChange" />
|
|
|
</div>
|
|
|
<!-- 装置列表 -->
|
|
|
<div class="unitBox">
|
|
@@ -81,17 +86,24 @@
|
|
|
<span>装置列表——间隔:<em>{{ jg }}</em></span>
|
|
|
</div>
|
|
|
<div style="margin-left: 5px;">
|
|
|
- <span>检测模型:<em v-for="(item, index) in mx">{{ mx[index] }}</em></span>
|
|
|
+ <!-- <span>检测模型:<em v-for="(item, index) in mx">{{ mx[index] }}</em></span> -->
|
|
|
+ <el-button type="primary" size="small" plain @click="checkTime">选择装置</el-button>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
- <div style="display: flex;justify-content: flex-start;align-items: center;">
|
|
|
- <p class="chooseSpan" v-for="(item, index) in mx">{{ mx[index] }}</p>
|
|
|
+ <div v-loading="iedLoading">
|
|
|
+ <!-- <div v-for="(item, index) in mx">
|
|
|
+ {{ item.ied_name }}
|
|
|
+ </div> -->
|
|
|
+ <el-tag v-for="(item, index) in mx" :key="item.ied_name" size="large" class="mx-1" type="info"
|
|
|
+ closable effect="plain" @close="tagClose(item, index)">
|
|
|
+ {{ item.ied_name }}
|
|
|
+ </el-tag>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <el-button style="width: 200px;height: 30px;" @click="backMent">返回</el-button>
|
|
|
- <el-button style="width: 200px;height: 30px;" @click="saveMent" type="primary">保存</el-button>
|
|
|
+ <div v-if="successScd">
|
|
|
+ <el-button style="width: 200px;height: 30px;" type="primary" @click="iedSave">保存</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 模态框组件 -->
|
|
@@ -99,6 +111,8 @@
|
|
|
<LookScd v-if="scdLooks" :scdLooks="scdLooks" @nowBack="nowBack" @lookNum="lookNum"></LookScd>
|
|
|
<ModelTree v-if="treeMool" :treeMool="treeMool" @treeBack="treeBack" @treeNum="treeNum"></ModelTree>
|
|
|
<FlashCreate v-if="fcModal" :fcModal="fcModal" @fcBack="fcBack"></FlashCreate>
|
|
|
+ <CheckIed v-if="iedModal" :iedModal="iedModal" :loadScdId="loadScdId" @iedBack="iedBack"
|
|
|
+ @iedArrBack="iedArrBack"></CheckIed>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -113,6 +127,7 @@ import cid from '@/api/cid/cid';
|
|
|
import LookScd from '../modalComp/LookScd.vue';
|
|
|
import ModelTree from '../modalComp/ModelTree.vue';
|
|
|
import FlashCreate from '../modalComp/FlashCreate.vue';
|
|
|
+import CheckIed from '../modalComp/CheckIed.vue';
|
|
|
import { ElMessage, ElLoading } from 'element-plus';
|
|
|
export default {
|
|
|
props: {
|
|
@@ -165,6 +180,16 @@ export default {
|
|
|
let fcModal = ref(false)//创建变电站模态框
|
|
|
let scdLoading = ref(false)//上传scd文件后进行分析
|
|
|
let loadScdId = ref(0)//上传成功后拿到的scdid
|
|
|
+ let successScd = ref(false)//保存任务后继续选择的间隔模型
|
|
|
+ let iedModal = ref(false)//checkied.vue模态框状态
|
|
|
+ let loadAreaId = ref("")
|
|
|
+ let iedName = ref("")//一串ied名称字符串
|
|
|
+ let iedLoading = ref(false)//加载ied
|
|
|
+ let anyProps = ref({
|
|
|
+ label: "area_name",
|
|
|
+ id: "area_id",
|
|
|
+ })
|
|
|
+ let anyData = ref([])
|
|
|
function searchAllFlash() {
|
|
|
flashPower.getAllArea({}).then(res => {
|
|
|
flashPower.getAllFlashPower({ pid: res.data[0].pid }).then(res => {
|
|
@@ -183,6 +208,7 @@ export default {
|
|
|
//变电站下拉框change事件
|
|
|
function flashChange(e) {
|
|
|
// searchScd(e)
|
|
|
+ newMission.value.flashId = e
|
|
|
}
|
|
|
function bmChange(e) {
|
|
|
newMission.value.reportNow = e.id
|
|
@@ -213,7 +239,7 @@ export default {
|
|
|
function saveMent() {//保存检测任务
|
|
|
task.createTask({
|
|
|
name: newMission.value.misName,
|
|
|
- station_id: 861,
|
|
|
+ station_id: newMission.value.flashId - 0,
|
|
|
memo: newMission.value.misMes,
|
|
|
report_id: newMission.value.reportNow - 0,
|
|
|
scd_id: loadScdId.value - 0,
|
|
@@ -225,8 +251,11 @@ export default {
|
|
|
type: "success"
|
|
|
})
|
|
|
// emit("createBack", 0)
|
|
|
- scd.getLoadScd({scd_id:loadScdId.value-0}).then(res=>{
|
|
|
- console.log(res,'rsssss');
|
|
|
+ scd.getLoadScd({ scd_id: loadScdId.value - 0 }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ successScd.value = true
|
|
|
+ anyData.value = res.data
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -253,6 +282,47 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ function handleCheckChange(e) {
|
|
|
+ loadAreaId.value = e.area_id
|
|
|
+ iedLoading.value = true
|
|
|
+ scd.getTikIed({ scd_id: loadScdId.value - 0, area_id: e.area_id - 0 }).then(res => {
|
|
|
+ if (res.data != null) {
|
|
|
+ mx.value = res.data
|
|
|
+ iedName.value = mx.value.map(item => item.ied_name).join(',')
|
|
|
+ iedLoading.value = false
|
|
|
+ } else {
|
|
|
+ mx.value = []
|
|
|
+ iedLoading.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function iedSave() {
|
|
|
+ scd.stickIed({ scd_id: loadScdId.value - 0, area_id: loadAreaId.value - 0, ied_ids: iedName.value }).then(res => {
|
|
|
+ console.log(res, 'res');
|
|
|
+ if (res.code == 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: "添加ied成功!",
|
|
|
+ duration: 1500,
|
|
|
+ })
|
|
|
+ emit("createBack", 0)
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: res.msg,
|
|
|
+ duration: 1500,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function tagClose(row, num) {
|
|
|
+ mx.value.splice(mx.value.indexOf(row), 1)
|
|
|
+ iedName.value = mx.value.map(item => item.ied_name).join(', ');
|
|
|
+ console.log(iedName,'iedname');
|
|
|
+ }
|
|
|
+ function checkTime() {
|
|
|
+ iedModal.value = true
|
|
|
+ }
|
|
|
function addFlash() {
|
|
|
fcModal.value = true
|
|
|
}
|
|
@@ -267,7 +337,7 @@ export default {
|
|
|
}
|
|
|
function treeNum(data, name) {
|
|
|
mxId.value = data
|
|
|
- mx.value = name
|
|
|
+ // mx.value = name
|
|
|
cmodel.value = name.toString()
|
|
|
}
|
|
|
function lookNum(name, id) {
|
|
@@ -280,6 +350,14 @@ export default {
|
|
|
function fcBack(data) {
|
|
|
fcModal.value = data
|
|
|
}
|
|
|
+ function iedBack(data) {
|
|
|
+ iedModal.value = data
|
|
|
+ }
|
|
|
+ function iedArrBack(data) {
|
|
|
+ mx.value = mx.value.concat(data)
|
|
|
+ iedName.value = mx.value.map(item => item.ied_name).join(', ');
|
|
|
+ }
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
searchAllFlash()
|
|
|
})
|
|
@@ -307,7 +385,6 @@ export default {
|
|
|
mxList,//模型列表
|
|
|
treeNum,//modelTree.vue返回的id函数
|
|
|
mxId,//模型id
|
|
|
- lookNum,//lookscd.vue返回的scd名称和id函数
|
|
|
rmList,//报告模板列表
|
|
|
scdId,//lookscd.vue返回的数据
|
|
|
scdName,//lookscd.vue返回的数据
|
|
@@ -320,13 +397,27 @@ export default {
|
|
|
fcBack,//flashcreate.vue返回的模态框值
|
|
|
nowUpload,//文件上传
|
|
|
scdLoading,
|
|
|
- loadScdId//上传成功后拿到的scdid
|
|
|
+ loadScdId,//上传成功后拿到的scdid
|
|
|
+ successScd,//保存任务后继续选择的间隔模型
|
|
|
+ handleCheckChange,//树形组件
|
|
|
+ anyData,
|
|
|
+ anyProps,
|
|
|
+ iedModal,//checkied.vue模态框状态
|
|
|
+ iedBack,//checkied.vue返回模态框状态
|
|
|
+ checkTime,//打开选择ied
|
|
|
+ iedArrBack,//checkied.vue返回选择数组
|
|
|
+ tagClose,
|
|
|
+ loadAreaId,//area_id
|
|
|
+ iedSave,//保存ied状态
|
|
|
+ iedName,//一串ied字符串
|
|
|
+ iedLoading,
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
LookScd,
|
|
|
ModelTree,//选择模型
|
|
|
FlashCreate,//创建变电站
|
|
|
+ CheckIed,//选择ied
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -396,4 +487,8 @@ em {
|
|
|
text-align: center;
|
|
|
line-height: 30px;
|
|
|
}
|
|
|
+.mx-1{
|
|
|
+ margin-right: 10px;
|
|
|
+ border: 1px solid #5779D7;
|
|
|
+}
|
|
|
</style>
|