|
@@ -18,7 +18,7 @@
|
|
|
<p class="background" :style="{ 'background-image': `url(${setBackground})`, 'color': setColor }">{{
|
|
|
setGooseOrSv }}</p>
|
|
|
</div>
|
|
|
- <div class="rightBox">
|
|
|
+ <div class="rightBox" v-loading="loading">
|
|
|
<h1 style="
|
|
|
border-bottom: 1px solid #7484AB;
|
|
|
width: 73%;
|
|
@@ -26,14 +26,13 @@
|
|
|
padding-bottom: 10px;
|
|
|
">{{ endTxt }}</h1>
|
|
|
<div>
|
|
|
- <div style="margin-bottom: 10px;" v-for="(item, index) in outList">
|
|
|
+ <!-- <div style="margin-bottom: 10px;" v-for="(item, index) in outList">
|
|
|
<div
|
|
|
style="width: 80%;display: flex;justify-content: space-around;align-items: center;margin: 0 auto;">
|
|
|
<span style="display: block;border: 1px solid #2B5AE5;width: 42px;height: 42px;"
|
|
|
@click="toggleVisibility(index)">
|
|
|
- <svg v-show="visibleItems.includes(item)" t="1704938867254" class="icon"
|
|
|
- viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4269"
|
|
|
- width="40" height="40">
|
|
|
+ <svg v-show="isVisible(item)" t="1704938867254" class="icon" viewBox="0 0 1024 1024"
|
|
|
+ version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4269" width="40" height="40">
|
|
|
<path
|
|
|
d="M392.533333 806.4L85.333333 503.466667l59.733334-59.733334 247.466666 247.466667L866.133333 213.333333l59.733334 59.733334L392.533333 806.4z"
|
|
|
fill="#2B5AE5" p-id="4270"></path>
|
|
@@ -42,7 +41,12 @@
|
|
|
<span style="display: block;" :class="getClass(index)">{{ item.fcda_name
|
|
|
}}</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
+ <el-checkbox-group v-model="checkList" @change="checkChange">
|
|
|
+ <el-checkbox v-for="(item, index) in outList" :label="item.id" :key="item.id">
|
|
|
+ {{ item.fcda_name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -103,8 +107,12 @@ export default {
|
|
|
let numStatus = ref(0)//判断goose还是sv
|
|
|
let visibleItems = ref([])//选择的数组
|
|
|
let fcdaIds = ref("")//需要的fcda_ids
|
|
|
- let leftIndex = ref(0)//左侧选择的输出下标
|
|
|
+ let leftIndex = ref(-1)//左侧选择的输出下标
|
|
|
let leftFcda = ref("")//左侧的fcdaid
|
|
|
+ let together = ref("")//绑定的id
|
|
|
+ let checkList = ref([])//select数据
|
|
|
+ let loading = ref(false)
|
|
|
+ let arrNew = ref([])//新的存储fdcdids
|
|
|
watch(() => props.modelId, (newVal) => {
|
|
|
modelIds.value = newVal
|
|
|
})
|
|
@@ -130,12 +138,12 @@ export default {
|
|
|
model_id: modelIds.value - 0,
|
|
|
ied_type: starts.value.ied_type,
|
|
|
}).then(res => {
|
|
|
- if(res.code == 0){
|
|
|
+ if (res.code == 0) {
|
|
|
curList.value = res.data
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
- message:res.msg,
|
|
|
- type:"error"
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -143,12 +151,12 @@ export default {
|
|
|
model_id: modelIds.value - 0,
|
|
|
ied_type: ends.value.ied_type,
|
|
|
}).then(res => {
|
|
|
- if(res.code == 0){
|
|
|
+ if (res.code == 0) {
|
|
|
outList.value = res.data
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
- message:res.msg,
|
|
|
- type:"error"
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -160,6 +168,9 @@ export default {
|
|
|
}
|
|
|
// 确认关闭模态框
|
|
|
function sureClose() {
|
|
|
+ if (leftFcda.value == '') {
|
|
|
+ leftFcda.value = curList.value[0].id
|
|
|
+ }
|
|
|
flow.saveModelOn({
|
|
|
model_id: modelIds.value - 0,
|
|
|
from_ied_type: starts.value.ied_type,
|
|
@@ -168,10 +179,20 @@ export default {
|
|
|
to_fcda_ids: fcdaIds.value,
|
|
|
goosesv: setGooseOrSv.value,
|
|
|
}).then(res => {
|
|
|
- console.log(res, '设置');
|
|
|
+ if (res.code == 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: "关联成功!"
|
|
|
+ })
|
|
|
+ dialogVisible.value = false
|
|
|
+ emit("lineBack", dialogVisible.value)
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: res.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- dialogVisible.value = false
|
|
|
- emit("lineBack", dialogVisible.value)
|
|
|
}
|
|
|
// 返回goose还是sv
|
|
|
const setGooseOrSv = computed(() => {
|
|
@@ -197,28 +218,57 @@ export default {
|
|
|
return 'blue'
|
|
|
}
|
|
|
})
|
|
|
- // 获取fcda_ids
|
|
|
- function toggleVisibility(index) {
|
|
|
- const item = outList.value[index];
|
|
|
- const itemIndex = visibleItems.value.findIndex((i) => i === item);
|
|
|
- if (itemIndex === -1) {
|
|
|
- visibleItems.value.push(item);
|
|
|
- } else {
|
|
|
- visibleItems.value.splice(itemIndex, 1);
|
|
|
- }
|
|
|
- fcdaIds.value = visibleItems.value.map((item, index) => {
|
|
|
- return item.id
|
|
|
- }).join(",")
|
|
|
- };
|
|
|
// 下标选择
|
|
|
function setIndex(row, num) {
|
|
|
- leftFcda.value = row.id
|
|
|
- leftIndex.value = num
|
|
|
+ loading.value = true
|
|
|
+ flow.getModelOn({
|
|
|
+ model_id: modelIds.value - 0,
|
|
|
+ from_fcda_id: row.id - 0
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data != null) {
|
|
|
+ together.value = res.data
|
|
|
+ checkList.value = together.value.map(item => item.to_fcda_id);
|
|
|
+ fcdaIds.value = res.data.map(item => {
|
|
|
+ return item.to_fcda_id
|
|
|
+ }).join(",")
|
|
|
+ loading.value = false
|
|
|
+ } else {
|
|
|
+ together.value = []
|
|
|
+ checkList.value = []
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (row || num) {
|
|
|
+ leftFcda.value = row.id
|
|
|
+ leftIndex.value = num
|
|
|
+ }
|
|
|
}
|
|
|
- // 设置多选span的class
|
|
|
- function getClass(index) {
|
|
|
- const item = outList.value[index];
|
|
|
- return visibleItems.value.includes(item) ? 'results' : 'anthers';
|
|
|
+ // function isVisible(item) {
|
|
|
+ // if (together.value.length > 0) {
|
|
|
+ // loading.value = false
|
|
|
+ // return together.value.some((togetherItem) => togetherItem.to_fcda_id === item.id);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // // 设置多选span的class
|
|
|
+ // function getClass(index) {
|
|
|
+ // const item = outList.value[index];
|
|
|
+ // return visibleItems.value.includes(item) ? 'results' : 'anthers';
|
|
|
+ // }
|
|
|
+ // // 获取fcda_ids
|
|
|
+ // function toggleVisibility(index) {
|
|
|
+ // const item = outList.value[index];
|
|
|
+ // const itemIndex = visibleItems.value.findIndex((i) => i === item);
|
|
|
+ // if (itemIndex === -1) {
|
|
|
+ // visibleItems.value.push(item);
|
|
|
+ // } else {
|
|
|
+ // visibleItems.value.splice(itemIndex, 1);
|
|
|
+ // }
|
|
|
+ // fcdaIds.value = visibleItems.value.map((item, index) => {
|
|
|
+ // return item.id
|
|
|
+ // }).join(",")
|
|
|
+ // };
|
|
|
+ function checkChange(e) {
|
|
|
+ fcdaIds.value = e.join(",")
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
reload()
|
|
@@ -239,13 +289,19 @@ export default {
|
|
|
setBackground,//判断显示背景图
|
|
|
setColor,//判断文字颜色
|
|
|
visibleItems,//选择的数组
|
|
|
- toggleVisibility,//模拟多选框方法
|
|
|
+ // toggleVisibility,//模拟多选框方法
|
|
|
fcdaIds,//需要的fcda_ids
|
|
|
leftIndex,//左侧下标选择
|
|
|
setIndex,//下标选择函数
|
|
|
- getClass,//设置多选span的class函数
|
|
|
+ // getClass,//设置多选span的class函数
|
|
|
leftFcda,//左侧单选的fcdaid
|
|
|
outList,//箭头指向端list
|
|
|
+ together,//绑定的id
|
|
|
+ // isVisible,
|
|
|
+ loading,
|
|
|
+ checkList,
|
|
|
+ checkChange,
|
|
|
+ arrNew,//新的存储ids
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -341,4 +397,36 @@ export default {
|
|
|
background-position: 100% 50%;
|
|
|
line-height: calc(100vh - 850px);
|
|
|
}
|
|
|
+
|
|
|
+:deep(.el-checkbox__inner) {
|
|
|
+ width: 40px !important;
|
|
|
+ height: 40px !important;
|
|
|
+ background-color: white !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-checkbox__inner::after) {
|
|
|
+ height: 30px !important;
|
|
|
+ left: 11px !important;
|
|
|
+ width: 15px !important;
|
|
|
+ top: -2px !important;
|
|
|
+ border-color: #2B5AE5;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-checkbox__input.is-checked .el-checkbox__inner::after) {
|
|
|
+ border-color: #2B5AE5;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-checkbox) {
|
|
|
+ width: 300px !important;
|
|
|
+ height: 50px !important;
|
|
|
+ margin-right: 0 !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-checkbox__label) {
|
|
|
+ width: 202px !important;
|
|
|
+ height: 42px !important;
|
|
|
+ margin-left: 10px !important;
|
|
|
+ line-height: 42px !important;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|