|
@@ -5,7 +5,9 @@
|
|
|
<div class="flex1 ov-hd">
|
|
<div class="flex1 ov-hd">
|
|
|
<span class="f-s-18 c-333 f-w-6">编辑会议宣传门户</span>
|
|
<span class="f-s-18 c-333 f-w-6">编辑会议宣传门户</span>
|
|
|
<el-button @click="router.go(-1)" text type="primary">
|
|
<el-button @click="router.go(-1)" text type="primary">
|
|
|
- <el-icon><Back /></el-icon>
|
|
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Back />
|
|
|
|
|
+ </el-icon>
|
|
|
返回上一级
|
|
返回上一级
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -17,12 +19,14 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex1 ov-hd d-flex">
|
|
<div class="flex1 ov-hd d-flex">
|
|
|
<div class="bg-#f8f8f8 w-200 box-sizing-border over-auto">
|
|
<div class="bg-#f8f8f8 w-200 box-sizing-border over-auto">
|
|
|
- <MeetingTplList v-if="meetid" :meetid="meetid" @selectItem="selectItem" :list="list"></MeetingTplList>
|
|
|
|
|
|
|
+ <MeetingTplList v-if="meetid" :meetid="meetid" @selectItem="selectItem" :list="list" @addMeetingTpls="addMeetingTpls" @delete="deleteListTpl" @changeLabel="changeLabel"></MeetingTplList>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex1 ov-hd d-flex flex-cln a-c">
|
|
<div class="flex1 ov-hd d-flex flex-cln a-c">
|
|
|
- <div v-if="form.id" class="w-750 pd2-10-0 f-w-5">
|
|
|
|
|
- 页面名称
|
|
|
|
|
- <el-icon><EditPen /></el-icon>
|
|
|
|
|
|
|
+ <div v-if="form.id" @click="changeLabel(form)" class="w-750 pd2-10-0 f-w-5">
|
|
|
|
|
+ {{ form?.label }}
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <EditPen />
|
|
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
<MeetingTplH5 v-if="form.id" v-model="form" @activated="activated" @deleteItemEvents="deleteItemEvents"></MeetingTplH5>
|
|
<MeetingTplH5 v-if="form.id" v-model="form" @activated="activated" @deleteItemEvents="deleteItemEvents"></MeetingTplH5>
|
|
|
</div>
|
|
</div>
|
|
@@ -38,6 +42,8 @@ import router from '@/router';
|
|
|
import { MeetingTplH5, MeetingTplList, MeetingTplEvents } from '../../models';
|
|
import { MeetingTplH5, MeetingTplList, MeetingTplEvents } from '../../models';
|
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
|
import { httpRequests } from '@/utils/httpRequests';
|
|
import { httpRequests } from '@/utils/httpRequests';
|
|
|
|
|
+import { importFileGetUrls } from '@/utils/models';
|
|
|
|
|
+import { it } from 'node:test';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const dict = proxy?.useDict('page_event')
|
|
const dict = proxy?.useDict('page_event')
|
|
|
const { page_event } = toRefs<any>(dict);
|
|
const { page_event } = toRefs<any>(dict);
|
|
@@ -53,10 +59,9 @@ const activated = (item: any) => {
|
|
|
curEvent.value = item;
|
|
curEvent.value = item;
|
|
|
};
|
|
};
|
|
|
const selectItem = (item: any) => {
|
|
const selectItem = (item: any) => {
|
|
|
- form.value = item;
|
|
|
|
|
|
|
+ form.value = { ...item };
|
|
|
};
|
|
};
|
|
|
const saveEevent = (item: any) => {
|
|
const saveEevent = (item: any) => {
|
|
|
- console.log(item);
|
|
|
|
|
if (!form.value?.events || !form.value?.events.length) return;
|
|
if (!form.value?.events || !form.value?.events.length) return;
|
|
|
const index = form.value.events.findIndex((it: any) => it.id === item.id);
|
|
const index = form.value.events.findIndex((it: any) => it.id === item.id);
|
|
|
if (index === -1) return;
|
|
if (index === -1) return;
|
|
@@ -80,6 +85,67 @@ const getList = async () => {
|
|
|
if (!res || res.code !== 200) return;
|
|
if (!res || res.code !== 200) return;
|
|
|
list.value = res.data;
|
|
list.value = res.data;
|
|
|
};
|
|
};
|
|
|
|
|
+const addMeetingTpls = async () => {
|
|
|
|
|
+ const res: any[] = await importFileGetUrls(['png', 'jpg', 'jpeg'], true);
|
|
|
|
|
+ // 过滤掉code不为200的
|
|
|
|
|
+ if (!res || !res.length) return;
|
|
|
|
|
+ const datas = res.filter(item => item.code === 200).map(item => item.data);
|
|
|
|
|
+ const promises = datas.map(item => {
|
|
|
|
|
+ return httpRequests.post('/dgtmedicine/trainpage/add', {
|
|
|
|
|
+ trainId: meetid.value,
|
|
|
|
|
+ label: '页面名称',
|
|
|
|
|
+ img: item.url,
|
|
|
|
|
+ homeFlag: 0,
|
|
|
|
|
+ events: []
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ const results = await Promise.all(promises);
|
|
|
|
|
+ const successResults = results.filter(item => item && item.code === 200).map(item => item.data);
|
|
|
|
|
+ if (!successResults.length) return;
|
|
|
|
|
+ getList();
|
|
|
|
|
+}
|
|
|
|
|
+const deleteListTpl = async (item: any) => {
|
|
|
|
|
+ ElMessageBox({
|
|
|
|
|
+ title: '删除提示',
|
|
|
|
|
+ cancelButtonText: '我再看看',
|
|
|
|
|
+ confirmButtonText: '确认删除',
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ confirmButtonClass: 'el-button--danger',
|
|
|
|
|
+ message: h('p', null, [h('div', null, ``), h('div', null, [h('span', null, '删除后页面和触发事件将同步删除,无法撤回,请谨慎操作!')])]),
|
|
|
|
|
+ callback: async (action: string) => {
|
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
|
+ const res = await httpRequests.get(`/dgtmedicine/trainpage/remove/${item.id}`);
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ ElMessage.success('删除成功');
|
|
|
|
|
+ if (item.id === form.value.id) {
|
|
|
|
|
+ form.value = {};
|
|
|
|
|
+ curEvent.value = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ getList();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+const changeLabel = async (item: any) => {
|
|
|
|
|
+ const { value: label } = await ElMessageBox.prompt('请输入页面名称', '修改页面名称', {
|
|
|
|
|
+ confirmButtonText: '保存',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ inputValue: item.label,
|
|
|
|
|
+ inputPattern: /^(?!\s*$).+/,
|
|
|
|
|
+ inputErrorMessage: '页面名称不能为空'
|
|
|
|
|
+ });
|
|
|
|
|
+ if (label !== undefined) {
|
|
|
|
|
+ const res = await httpRequests.post('/dgtmedicine/trainpage/edit', { ...item, label });
|
|
|
|
|
+ if (res && res.code === 200) {
|
|
|
|
|
+ ElMessage.success('修改成功');
|
|
|
|
|
+ getList();
|
|
|
|
|
+ if (item.id === form.value.id) {
|
|
|
|
|
+ form.value.label = label;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getList();
|
|
getList();
|
|
|
});
|
|
});
|