|
@ -1,66 +1,77 @@ |
|
|
<template> |
|
|
<template> |
|
|
<Dialog v-model="modelVisible" title="情报板确认"> |
|
|
<div> |
|
|
<div v-if="type == 1" class="EventAddPlanDialog"> |
|
|
|
|
|
<h4>预案内容</h4> |
|
|
|
|
|
<dev class="listBox disPid"> |
|
|
<Dialog v-model="modelVisible" title="情报板确认"> |
|
|
<div class="tplItem"> |
|
|
<div v-if="type == 1" class="EventAddPlanDialog"> |
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
<h4>预案内容</h4> |
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
<dev class="listBox disPid"> |
|
|
<p class="btn"> |
|
|
<div class="tplItem"> |
|
|
<!-- <el-radio v-model="radio1" :label="1" @input="changeRadio(1)" /> --> |
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="automaticData"></BoardTplPreview> |
|
|
</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 class="infoBtnBox infoBtnBoxSm"> |
|
|
<div class="infoBtnBox infoBtnBoxSm"> |
|
|
<p class="btn"> |
|
|
<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> |
|
|
|
|
|
<!-- <p @click="____onEditTemplate(automaticData)" class="btn btnEdit" /> --> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</dev> |
|
|
</vuescroll> |
|
|
<h4>自动生成</h4> |
|
|
</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"> |
|
|
<dev class="listBox disPid"> |
|
|
<div v-for="(it, idx) in originalData[item]" :key="idx" class="tplItem"> |
|
|
<div class="tplItem"> |
|
|
<BoardTplPreview class="boardPreview" boardWH="1400*200" :tpl="it"></BoardTplPreview> |
|
|
<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> |
|
|
</div> |
|
|
</dev> |
|
|
</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> |
|
|
|
|
|
<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> |
|
|
<BoardInfoEditor @afterSubmit="____onEditSubmit" :mode="editDialog.mode" :type="editDialog.type" |
|
|
<template #footer v-if="type == 1"> |
|
|
:visible.sync="editDialog.visible" :screenSize="selectedSize" :tpl="editDialog.tpl"></BoardInfoEditor> |
|
|
<Button style="background: #C9C9C9;padding:0 24px;" |
|
|
</div> |
|
|
@click.native="modelVisible = false, submitting = false">取消</Button> |
|
|
|
|
|
<Button style="padding:0 24px;" @click.native="handleSubmit" :loading="submitting">确认</Button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</Dialog> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import vuescroll from "vuescroll"; |
|
|
import vuescroll from "vuescroll"; |
|
|
import scrollOptions from "@/common/scrollbar.js"; |
|
|
import scrollOptions from "@/common/scrollbar.js"; |
|
|
import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue"; |
|
|
import BoardTplPreview from "@screen/components/infoBoard/BoardTplPreview.vue"; |
|
|
|
|
|
import BoardInfoEditor from "@screen/components/infoBoard/BoardInfoEditor"; |
|
|
import Dialog from "@screen/components/Dialog/index"; |
|
|
import Dialog from "@screen/components/Dialog/index"; |
|
|
import Button from '@screen/components/Buttons/Button.vue'; |
|
|
import Button from '@screen/components/Buttons/Button.vue'; |
|
|
import { getTemplateList } from "@/api/board/template"; |
|
|
import { getTemplateList } from "@/api/board/template"; |
|
@ -72,6 +83,7 @@ export default { |
|
|
Button, |
|
|
Button, |
|
|
vuescroll, |
|
|
vuescroll, |
|
|
BoardTplPreview, |
|
|
BoardTplPreview, |
|
|
|
|
|
BoardInfoEditor |
|
|
}, |
|
|
}, |
|
|
model: { |
|
|
model: { |
|
|
prop: 'visible', |
|
|
prop: 'visible', |
|
@ -101,6 +113,12 @@ export default { |
|
|
itmData: {}, |
|
|
itmData: {}, |
|
|
automaticData: {}, |
|
|
automaticData: {}, |
|
|
originalData: {}, |
|
|
originalData: {}, |
|
|
|
|
|
editDialog: { |
|
|
|
|
|
mode: "", |
|
|
|
|
|
type: "", |
|
|
|
|
|
visible: false, |
|
|
|
|
|
tpl: {}, |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
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() { |
|
|
async getTemplateAutomatic() { |
|
|
let data = await this.getAutomatic(); |
|
|
let data = await this.getAutomatic(); |
|
|
console.log('dataaaa', data); |
|
|
console.log('dataaaa', data); |
|
|