Commit 143c534c by 高源

标签点击切换变色,选中变色

parent a26f01c8
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div style="margin-bottom: 5px;margin-right: 1px;white-space: wrap;display: flex;width: 88%;"> <div style="margin-bottom: 5px;margin-right: 1px;white-space: wrap;display: flex;width: 88%;">
<draggable v-model="treeNode" chosenClass="chosen" forceFallback="true" group="people" animation="1000" @start="onStart" @end="onEnd" v-if="isChildrenTree == false"> <draggable v-model="treeNode" chosenClass="chosen" forceFallback="true" group="people" animation="1000" @start="onStart" @end="onEnd" v-if="isChildrenTree == false">
<transition-group> <transition-group>
<el-tag class="boxtags" :key="tag.tagId" v-for="(tag, index) in treeNode" @click="selectTag(tag)"> <el-tag class="boxtags" :key="tag.tagId" v-for="(tag, index) in treeNode" @click="selectTag(tag)" :style="{backgroundColor: tag.Kvid==Kvid?'#68C23A!important':'#409EFF'}">
<div style="display: flex;align-items: center;height: 25px;position: relative;"> <div style="display: flex;align-items: center;height: 25px;position: relative;">
<span style="min-width: 40px;display: flex;align-items: center;"> <span style="min-width: 40px;display: flex;align-items: center;">
<div class="circle">{{ index + 1 }}</div> <div class="circle">{{ index + 1 }}</div>
...@@ -62,13 +62,13 @@ ...@@ -62,13 +62,13 @@
</draggable> </draggable>
<draggable v-model="childrenTreeNode" chosenClass="chosen" forceFallback="true" group="people" animation="1000" @start="onStart" @end="onEnd" v-if="isChildrenTree == true"> <draggable v-model="childrenTreeNode" chosenClass="chosen" forceFallback="true" group="people" animation="1000" @start="onStart" @end="onEnd" v-if="isChildrenTree == true">
<transition-group> <transition-group>
<el-tag class="boxtags" :key="item.tagId" v-for="(item, index) in childrenTreeNode" @click="selectTag(item)"> <el-tag class="boxtags" :key="item.tagId" v-for="(item, index) in childrenTreeNode" @click="selectTag(item)" :style="{backgroundColor: item.Kvid==Kvid?'#68C23A!important':'#409EFF'}">
<div style="display: flex;align-items: center;height: 30px;position: relative;"> <div style="display: flex;align-items: center;height: 25px;position: relative;">
<span style="min-width: 40px;display: flex;align-items: center;"> <span style="min-width: 40px;display: flex;align-items: center;">
<div class="circle">{{ index + 1 }}</div> <div class="circle">{{ index + 1 }}</div>
<span style="margin-left: 2px;">{{ item.actionName }}</span> <span style="margin-left: 2px;">{{ item.actionName }}</span>
</span> </span>
<img id="closeimg" @click="handleClose(item)" style="width: 20px;position: absolute;top: -8px;right: -18px;" src="./assets/close.svg"> <img id="closeimg" @click="handleClose(item)" style="width: 17px;position: absolute;top: -6px;right: -16px;" src="./assets/close.svg">
</div> </div>
</el-tag> </el-tag>
</transition-group> </transition-group>
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
dynamicTagObj: {}, dynamicTagObj: {},
parentTree: [], parentTree: [],
childrenTreeNode: [], childrenTreeNode: [],
kvid: null, Kvid: null,
parentKvid: null, parentKvid: null,
isChildrenTree: false, isChildrenTree: false,
treeNode: [], treeNode: [],
...@@ -302,13 +302,14 @@ export default { ...@@ -302,13 +302,14 @@ export default {
this.dynamicTagObj = {} this.dynamicTagObj = {}
this.actionName = "新建动作" this.actionName = "新建动作"
this.actionType = "" this.actionType = ""
this.kvid = null this.Kvid = null
let obj = {} let obj = {}
obj.taskName = this.taskName obj.taskName = this.taskName
obj.taskAddress = this.taskAddress obj.taskAddress = this.taskAddress
this.dynamicTagObj.actionName = '新建动作' this.dynamicTagObj.actionName = '新建动作'
this.dynamicTagObj.actionType = this.actionType this.dynamicTagObj.actionType = this.actionType
this.dynamicTagObj.tagId = this.tagId++ this.dynamicTagObj.tagId = this.tagId++
this.dynamicTagObj.isActive = true
this.Kvid = Math.floor(Math.random() * 100001); this.Kvid = Math.floor(Math.random() * 100001);
this.dynamicTagObj.actionConfigs = this.actionConfigs this.dynamicTagObj.actionConfigs = this.actionConfigs
this.dynamicTagObj.Kvid = this.Kvid this.dynamicTagObj.Kvid = this.Kvid
...@@ -330,6 +331,7 @@ export default { ...@@ -330,6 +331,7 @@ export default {
} }
this.isChildrenTree = false this.isChildrenTree = false
} }
console.log(this.dynamicTagObj)
}, },
// 进入容器 // 进入容器
toActions () { toActions () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment