|
|
@ -1,66 +1,77 @@ |
|
|
|
<template> |
|
|
|
<Dialog v-model="modelVisible" title="情报板确认"> |
|
|
|
<div v-if="type == 1" class="EventAddPlanDialog"> |
|
|
|
<h4>预案内容</h4> |
|
|
|
<dev class="listBox disPid"> |
|
|
|
<div class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
|
<p class="btn"> |
|
|
|
<!-- <el-radio v-model="radio1" :label="1" @input="changeRadio(1)" /> --> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</dev> |
|
|
|
<h4>自动生成</h4> |
|
|
|
<dev class="listBox disPid"> |
|
|
|
<div class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
|
<p class="btn"> |
|
|
|
<!-- <el-radio v-model="radio1" :label="2" @input="changeRadio(2)" /> --> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</dev> |
|
|
|
<h4>情报板模版</h4> |
|
|
|
<vuescroll :ops="scrollOptions" class="listBox"> |
|
|
|
<div v-for="(item) in templateAvailable" :key="item.dictValue"> |
|
|
|
<h5>{{ item.dictLabel }}</h5> |
|
|
|
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="itm"></BoardTplPreview> |
|
|
|
<div> |
|
|
|
|
|
|
|
|
|
|
|
<Dialog v-model="modelVisible" title="情报板确认"> |
|
|
|
<div v-if="type == 1" class="EventAddPlanDialog"> |
|
|
|
<h4>预案内容</h4> |
|
|
|
<dev class="listBox disPid"> |
|
|
|
<div class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
|
<p class="btn"> |
|
|
|
<el-radio v-model="radio1" :label="itm.id" @input="changeRadio(itm)" /> |
|
|
|
<el-radio v-model="radio1" :label="1" @input="changeRadio(automaticData)" /> |
|
|
|
</p> |
|
|
|
<!-- <p @click="____onEditTemplate(automaticData)" class="btn btnEdit" /> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</vuescroll> |
|
|
|
</div> |
|
|
|
<div v-if="type == 2" class="EventAddPlanDialog"> |
|
|
|
<div v-for="(item, index) in Object.keys(originalData)" :key="index"> |
|
|
|
<h4>{{ item }}</h4> |
|
|
|
</dev> |
|
|
|
<h4>自动生成</h4> |
|
|
|
<dev class="listBox disPid"> |
|
|
|
<div v-for="(it, idx) in originalData[item]" :key="idx" class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="it"></BoardTplPreview> |
|
|
|
<div class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
|
<p class="btn"> |
|
|
|
<el-radio v-model="radio1" :label="2" @input="changeRadio(automaticData)" /> |
|
|
|
</p> |
|
|
|
<!-- <p @click="____onEditTemplate(automaticData)" class="btn btnEdit" /> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</dev> |
|
|
|
<h4>情报板模版</h4> |
|
|
|
<vuescroll :ops="scrollOptions" class="listBox"> |
|
|
|
<div v-for="(item) in templateAvailable" :key="item.dictValue"> |
|
|
|
<h5>{{ item.dictLabel }}</h5> |
|
|
|
<div v-for="(itm, indx) in item.list" :key="indx" class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="itm"></BoardTplPreview> |
|
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
|
<!-- <p class="btn"> |
|
|
|
<el-radio v-model="radio1" :label="itm.id" @input="changeRadio(itm)" /> |
|
|
|
</p> --> |
|
|
|
<p @click="____onEditTemplate(itm)" class="btn btnEdit" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</vuescroll> |
|
|
|
</div> |
|
|
|
<div v-if="type == 2" class="EventAddPlanDialog"> |
|
|
|
<div v-for="(item, index) in Object.keys(originalData)" :key="index"> |
|
|
|
<h4>{{ item }}</h4> |
|
|
|
<dev class="listBox disPid"> |
|
|
|
<div v-for="(it, idx) in originalData[item]" :key="idx" class="tplItem"> |
|
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="it"></BoardTplPreview> |
|
|
|
</div> |
|
|
|
</dev> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<template #footer v-if="type == 1"> |
|
|
|
<Button style="background: #C9C9C9;padding:0 24px;" |
|
|
|
@click.native="modelVisible = false, submitting = false">取消</Button> |
|
|
|
<Button style="padding:0 24px;" @click.native="handleSubmit" :loading="submitting">确认</Button> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
<template #footer v-if="type == 1"> |
|
|
|
<Button style="background: #C9C9C9;padding:0 24px;" |
|
|
|
@click.native="modelVisible = false, submitting = false">取消</Button> |
|
|
|
<Button style="padding:0 24px;" @click.native="handleSubmit" :loading="submitting">确认</Button> |
|
|
|
</template> |
|
|
|
</Dialog> |
|
|
|
<BoardInfoEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type" |
|
|
|
:visible.sync="editDialog.visible" :screenSize="selectedSize" :tpl="editDialog.tpl"></BoardInfoEditor> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import vuescroll from "vuescroll"; |
|
|
|
import scrollOptions from "@/common/scrollbar.js"; |
|
|
|
import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue"; |
|
|
|
import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor"; |
|
|
|
import Dialog from "@screen/components/Dialog/index"; |
|
|
|
import Button from '@screen/components/Buttons/Button.vue'; |
|
|
|
import { getTemplateList } from "@/api/board/template"; |
|
|
@ -72,6 +83,7 @@ export default { |
|
|
|
Button, |
|
|
|
vuescroll, |
|
|
|
BoardTplPreview, |
|
|
|
BoardInfoEditor |
|
|
|
}, |
|
|
|
model: { |
|
|
|
prop: 'visible', |
|
|
@ -101,6 +113,12 @@ export default { |
|
|
|
itmData: {}, |
|
|
|
automaticData: {}, |
|
|
|
originalData: {}, |
|
|
|
editDialog: { |
|
|
|
mode: "", |
|
|
|
type: "", |
|
|
|
visible: false, |
|
|
|
tpl: {}, |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
@ -174,6 +192,39 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
____onEditTemplate(tpl) { |
|
|
|
this.editDialog = { |
|
|
|
visible: true, |
|
|
|
mode: "edit", |
|
|
|
type: "template", |
|
|
|
tpl, |
|
|
|
}; |
|
|
|
}, |
|
|
|
//提交之后的回调 |
|
|
|
____onEditSubmit(para) { |
|
|
|
this.editDialog.tpl = {}; |
|
|
|
this.editDialog.visible = false; |
|
|
|
|
|
|
|
if (para.type == "device") { |
|
|
|
if (para.mode == "edit") { |
|
|
|
this.selectedBdMsg[this.boardItemEdtingIndex] = para.data; |
|
|
|
} else { |
|
|
|
this.selectedBdMsg.push(_.cloneDeep(para.data)); |
|
|
|
} |
|
|
|
} else if (para.mode == "toDevice") { |
|
|
|
this.selectedBdMsg.push(_.cloneDeep(para.data)); |
|
|
|
} else { |
|
|
|
this.____refreshPageData(para); |
|
|
|
} |
|
|
|
}, |
|
|
|
____refreshPageData(para) { |
|
|
|
if (para.type == "template") { |
|
|
|
this.____getAllTemplate().then((res) => { |
|
|
|
this.____setAvailableTemplate(); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} |
|
|
|
}, |
|
|
|
async getTemplateAutomatic() { |
|
|
|
let data = await this.getAutomatic(); |
|
|
|
console.log('dataaaa', data); |
|
|
|