|
|
@ -167,10 +167,15 @@ |
|
|
|
</WgtTitle> |
|
|
|
<div class="partCon"> |
|
|
|
<vuescroll :ops="scrollOptions" class="templateBox"> |
|
|
|
<draggable tag="div" :list="templateAvailable" @end="____onDragendTemplate" ghostClass="ghost_class"> |
|
|
|
<div v-for="(item, index) in templateAvailable" :key="item.dictValue"> |
|
|
|
<!-- 原来是<el-collapse v-model="activeNames"> --> |
|
|
|
<h3>{{ item.dictLabel }}</h3> |
|
|
|
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem"> |
|
|
|
<div class="category" @click="templateAvailable[index].fold = !templateAvailable[index].fold"> |
|
|
|
{{ item.dictLabel }} |
|
|
|
<span :class="item.fold?'el-icon-arrow-down':'el-icon-arrow-up'"></span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="item.fold" v-for="(itm, indx) in item.list" :key="indx" class="tplItem"> |
|
|
|
<!-- 模板内容 --> |
|
|
|
<BoardTplPreview class="boardPreview" :boardWH="selectedSize" :tpl="itm"></BoardTplPreview> |
|
|
|
<!-- <div class="infoPreview"> |
|
|
@ -192,7 +197,9 @@ |
|
|
|
</el-tooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</draggable> |
|
|
|
</vuescroll> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -248,6 +255,7 @@ import InfoBoard from "@screen/mixins/InfoBoard"; |
|
|
|
import { initSearch } from "@screen/utils/enum/common.js" |
|
|
|
import { mapState } from "vuex"; |
|
|
|
|
|
|
|
import request from "@/utils/request"; |
|
|
|
export default { |
|
|
|
name: "DeviceBord", |
|
|
|
mixins: [InfoBoard], |
|
|
@ -411,6 +419,8 @@ export default { |
|
|
|
// 获取信息模板分类 |
|
|
|
____getTemplateCategory() { |
|
|
|
return this.getDicts("iot_template_category").then((res) => { |
|
|
|
res.data.forEach(x=>x.fold=false) |
|
|
|
res.data[0].fold = true; |
|
|
|
this.tplCategory = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
@ -575,6 +585,20 @@ export default { |
|
|
|
tpl, |
|
|
|
}; |
|
|
|
}, |
|
|
|
____onDragendTemplate(evt){ |
|
|
|
const newMap = this.templateAvailable.map(x=>x.dictCode); |
|
|
|
request({ |
|
|
|
url:'/business/boardTemplate/updateCategorySort', |
|
|
|
method:'post', |
|
|
|
data:{ |
|
|
|
"dictType":"iot_template_category", |
|
|
|
"ids":newMap |
|
|
|
} |
|
|
|
}).then(res=>{ |
|
|
|
console.log(res) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
____onDragend(evt) { |
|
|
|
// console.log(evt, this.selectedBdMsg , "拖拽结束+++=======") |
|
|
|
}, |
|
|
@ -787,7 +811,7 @@ export default { |
|
|
|
} |
|
|
|
this.templateAvailable = []; |
|
|
|
this.tplCategory.forEach((item, index) => { |
|
|
|
let arr = this.templateAll["" + index]; |
|
|
|
let arr = this.templateAll[item.dictValue]; |
|
|
|
if (arr.length > 0) { |
|
|
|
let temp = []; |
|
|
|
arr.forEach((tpl) => { |
|
|
@ -1374,3 +1398,19 @@ export default { |
|
|
|
/* 设置滚动条滑块圆角 */ |
|
|
|
} |
|
|
|
</style> |
|
|
|
<style> |
|
|
|
.category{ |
|
|
|
background:linear-gradient(to right, #1d637c00 0%, #1d637c 100%); |
|
|
|
margin: 10px 0px; |
|
|
|
padding: 10px; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
cursor: pointer; |
|
|
|
span{ |
|
|
|
font-weight: bold; |
|
|
|
margin-right: 10px; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|