|
@@ -48,18 +48,13 @@
|
|
<div class="imgUpdate">
|
|
<div class="imgUpdate">
|
|
<div class="img-tit">设计图</div>
|
|
<div class="img-tit">设计图</div>
|
|
<div class="btn-list">
|
|
<div class="btn-list">
|
|
- <Button @click="tap" type="default">上传文件</Button>
|
|
+ <Button type="default">上传文件</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="imgUpdate">
|
|
<div class="imgUpdate">
|
|
<div class="img-tit">附加数据</div>
|
|
<div class="img-tit">附加数据</div>
|
|
<div class="textarea">
|
|
<div class="textarea">
|
|
- <el-input
|
|
+ <el-input type="textarea" :rows="2" placeholder="请输入内容">
|
|
- type="textarea"
|
|
|
|
- :rows="2"
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- v-model="textarea"
|
|
|
|
- >
|
|
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -72,8 +67,11 @@
|
|
:width="200"
|
|
:width="200"
|
|
iconType="search"
|
|
iconType="search"
|
|
placeholder="搜索信息点"
|
|
placeholder="搜索信息点"
|
|
|
|
+ v-model="getPressMsg"
|
|
|
|
+ @pressEnter="pressEnter"
|
|
|
|
+ @clear="pressEnter"
|
|
/>
|
|
/>
|
|
- <div class="msgPoint-list">
|
|
+ <div class="msgPoint-list" v-show="!pressMsgData.length">
|
|
<div class="type-list" v-for="(item, key) in msgData" :key="key">
|
|
<div class="type-list" v-for="(item, key) in msgData" :key="key">
|
|
<div class="type-title" @click="clips(item)">
|
|
<div class="type-title" @click="clips(item)">
|
|
<i
|
|
<i
|
|
@@ -87,13 +85,25 @@
|
|
<el-collapse-transition>
|
|
<el-collapse-transition>
|
|
<ul class="list" v-show="item.showChildren">
|
|
<ul class="list" v-show="item.showChildren">
|
|
<li v-for="(a, b) in item.children" :key="'i' + b">
|
|
<li v-for="(a, b) in item.children" :key="'i' + b">
|
|
- <Checkbox :checked="checked1" @change="handleChange" />
|
|
+ <Checkbox
|
|
|
|
+ :checked="a.checked ? 'checked' : 'uncheck'"
|
|
|
|
+ @change="changeCheck(a)"
|
|
|
|
+ />
|
|
<p>{{ a.msgName }}</p>
|
|
<p>{{ a.msgName }}</p>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</el-collapse-transition>
|
|
</el-collapse-transition>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <ul class="msgPoint-list-press" v-show="pressMsgData.length">
|
|
|
|
+ <li v-for="(a, b) in pressMsgData" :key="b">
|
|
|
|
+ <Checkbox
|
|
|
|
+ :checked="a.checked ? 'checked' : 'uncheck'"
|
|
|
|
+ @change="changeCheck(a)"
|
|
|
|
+ />
|
|
|
|
+ <p>{{ a.msgName }}</p>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
</div>
|
|
</div>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
@@ -101,7 +111,9 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { msgData } from "./msgData.js";
|
|
import { msgData } from "./msgData.js";
|
|
|
|
+//
|
|
export default {
|
|
export default {
|
|
|
|
+ props: ["InfoPointList", "EquipId"],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
activeName: "first",
|
|
activeName: "first",
|
|
@@ -110,6 +122,8 @@ export default {
|
|
checked1: "checked",
|
|
checked1: "checked",
|
|
isShow: true,
|
|
isShow: true,
|
|
msgData: [],
|
|
msgData: [],
|
|
|
|
+ pressMsgData: [], // 搜索后得信息点数组
|
|
|
|
+ getPressMsg: "", //输入信息
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -123,47 +137,82 @@ export default {
|
|
changeWidth() {},
|
|
changeWidth() {},
|
|
changeHeight() {},
|
|
changeHeight() {},
|
|
eforeAvatarUpload() {},
|
|
eforeAvatarUpload() {},
|
|
- handleChange(v, obj) {
|
|
+ // 切换选中选项
|
|
- console.log(obj);
|
|
+ changeCheck(item) {
|
|
- this.checked1 = v;
|
|
+ item.checked = !item.checked;
|
|
},
|
|
},
|
|
- },
|
|
+ // 搜索回车操作
|
|
- mounted() {
|
|
+ pressEnter() {
|
|
- let arr = [];
|
|
+ const list = [];
|
|
- msgData.forEach((item) => {
|
|
+ if (!this.getPressMsg) {
|
|
- if (arr.length) {
|
|
+ this.pressMsgData = [];
|
|
- let index = -1;
|
|
+ return;
|
|
- arr.forEach((aItem) => {
|
|
+ }
|
|
- if (aItem.msgTypeId == item.msgTypeId) {
|
|
+ // 对信息点相同得提取出来
|
|
- index = 1;
|
|
+ this.msgData.forEach((item) => {
|
|
- aItem.children.push(item);
|
|
+ item.children.forEach((a) => {
|
|
- aItem.number++;
|
|
+ if (a.msgName.includes(this.getPressMsg)) {
|
|
|
|
+ list.push(a);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if (index == -1) {
|
|
+ });
|
|
- let obj = {
|
|
+ this.pressMsgData = list;
|
|
- msgTypeId: item.msgTypeId,
|
|
+ },
|
|
- msgType: item.msgType,
|
|
+ },
|
|
- children: [item],
|
|
+ watch: {
|
|
- number: 1,
|
|
+ EquipId(val) {
|
|
- showChildren: true,
|
|
+ console.log("EquipId", val);
|
|
- };
|
|
+ // 模拟接口
|
|
- arr.push(obj);
|
|
+ setTimeout(() => {
|
|
|
|
+ let arr = [];
|
|
|
|
+ // 勾选设备中选中的对象
|
|
|
|
+ if (this.InfoPointList && this.InfoPointList.length) {
|
|
|
|
+ msgData.map((item) => {
|
|
|
|
+ this.InfoPointList.forEach((a) => {
|
|
|
|
+ if (a.id == item.id) {
|
|
|
|
+ item.checked = true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- } else {
|
|
+ // 生成二级树
|
|
- let obj = {
|
|
+ msgData.forEach((item) => {
|
|
- msgTypeId: item.msgTypeId,
|
|
+ if (arr.length) {
|
|
- msgType: item.msgType,
|
|
+ let index = -1;
|
|
- children: [],
|
|
+ arr.forEach((aItem) => {
|
|
- number: 1,
|
|
+ if (aItem.msgTypeId == item.msgTypeId) {
|
|
- showChildren: true,
|
|
+ index = 1;
|
|
- };
|
|
+ aItem.children.push(item);
|
|
- obj.children.push(item);
|
|
+ aItem.number++;
|
|
- arr.push(obj);
|
|
+ }
|
|
- }
|
|
+ });
|
|
- });
|
|
+ if (index == -1) {
|
|
- this.msgData = arr;
|
|
+ let obj = {
|
|
- console.log(this.msgData);
|
|
+ msgTypeId: item.msgTypeId,
|
|
|
|
+ msgType: item.msgType,
|
|
|
|
+ children: [item],
|
|
|
|
+ number: 1,
|
|
|
|
+ showChildren: true,
|
|
|
|
+ };
|
|
|
|
+ arr.push(obj);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let obj = {
|
|
|
|
+ msgTypeId: item.msgTypeId,
|
|
|
|
+ msgType: item.msgType,
|
|
|
|
+ children: [],
|
|
|
|
+ number: 1,
|
|
|
|
+ showChildren: true,
|
|
|
|
+ };
|
|
|
|
+ obj.children.push(item);
|
|
|
|
+ arr.push(obj);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.msgData = arr;
|
|
|
|
+ console.log('this.msgData',this.msgData )
|
|
|
|
+ }, 1000);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -245,6 +294,22 @@ p {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .msgPoint-list-press {
|
|
|
|
+ margin-top: 12px;
|
|
|
|
+ li {
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 40px;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ p {
|
|
|
|
+ margin-left: 12px;
|
|
|
|
+ }
|
|
|
|
+ &:hover {
|
|
|
|
+ background: #f5f6f7;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.caret-icon {
|
|
.caret-icon {
|
|
animation: nowhirling 0.2s linear forwards;
|
|
animation: nowhirling 0.2s linear forwards;
|