|
@@ -591,18 +591,39 @@
|
|
|
<el-form-item label="内容" v-else-if="content.contentType == 21">
|
|
<el-form-item label="内容" v-else-if="content.contentType == 21">
|
|
|
<div>
|
|
<div>
|
|
|
<el-card class="box-card">
|
|
<el-card class="box-card">
|
|
|
|
|
+ <el-form-item label="直播分组"
|
|
|
|
|
+ required
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="content.liveGroupTypeId"
|
|
|
|
|
+ placeholder="请选择直播分组"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :disabled="formType == 3"
|
|
|
|
|
+ @change="liveGroupTypeChange(content)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in liveGroupTypeList"
|
|
|
|
|
+ :key="dict.id"
|
|
|
|
|
+ :label="dict.liveGroupType"
|
|
|
|
|
+ :value="dict.id"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="直播间"
|
|
<el-form-item label="直播间"
|
|
|
required
|
|
required
|
|
|
>
|
|
>
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="content.liveId"
|
|
v-model="content.liveId"
|
|
|
- placeholder="请选择直播间"
|
|
|
|
|
|
|
+ placeholder="请先选择直播分组"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
filterable
|
|
filterable
|
|
|
|
|
+ :disabled="formType == 3 || !content.liveGroupTypeId"
|
|
|
@change="liveChange(content)"
|
|
@change="liveChange(content)"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="dict in liveList"
|
|
|
|
|
|
|
+ v-for="dict in (content.meta && content.meta.liveList ? content.meta.liveList : [])"
|
|
|
:key="dict.liveId"
|
|
:key="dict.liveId"
|
|
|
:label="dict.liveName"
|
|
:label="dict.liveName"
|
|
|
:value="parseInt(dict.liveId)"
|
|
:value="parseInt(dict.liveId)"
|
|
@@ -953,7 +974,7 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 改状态 -->
|
|
|
|
|
|
|
+ <!-- 改状态(已停用,暂注释)
|
|
|
<div v-if="ruleItem.type == 5"
|
|
<div v-if="ruleItem.type == 5"
|
|
|
style="
|
|
style="
|
|
|
background-color: #fdfdfd;
|
|
background-color: #fdfdfd;
|
|
@@ -1017,6 +1038,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ -->
|
|
|
|
|
|
|
|
<!-- 添加内容节点 -->
|
|
<!-- 添加内容节点 -->
|
|
|
<el-link
|
|
<el-link
|
|
@@ -1253,7 +1275,7 @@ import {
|
|
|
} from "@/api/app/sop/template";
|
|
} from "@/api/app/sop/template";
|
|
|
import {courseList, videoList} from "@/api/app/course";
|
|
import {courseList, videoList} from "@/api/app/course";
|
|
|
import { getPackageOptions,} from "@/api/app/pkg";
|
|
import { getPackageOptions,} from "@/api/app/pkg";
|
|
|
-// import { getLiveOptions,} from "@/api/app/live";
|
|
|
|
|
|
|
+import { getLiveOptions as fetchLiveOptionsApi, getLiveGroupTypeList as fetchLiveGroupTypeListApi } from "@/api/app/live";
|
|
|
import { listRole } from '@/api/app/user/userList';
|
|
import { listRole } from '@/api/app/user/userList';
|
|
|
import { getTagByIds } from "@/api/app/tag/tagGroup";
|
|
import { getTagByIds } from "@/api/app/tag/tagGroup";
|
|
|
import ImageUpload from "@/views/qw/sop/ImageUpload";
|
|
import ImageUpload from "@/views/qw/sop/ImageUpload";
|
|
@@ -1296,6 +1318,7 @@ export default {
|
|
|
msgTypeOptions: [],//消息类别选项
|
|
msgTypeOptions: [],//消息类别选项
|
|
|
courseList: [],//默认科普
|
|
courseList: [],//默认科普
|
|
|
pkgList: [],//默认疗法
|
|
pkgList: [],//默认疗法
|
|
|
|
|
+ liveGroupTypeList: [],//直播分组
|
|
|
liveList: [],//默认直播间
|
|
liveList: [],//默认直播间
|
|
|
productList: [],//默认民品列表
|
|
productList: [],//默认民品列表
|
|
|
medicinesList: [],//默认药品列表
|
|
medicinesList: [],//默认药品列表
|
|
@@ -1401,7 +1424,8 @@ export default {
|
|
|
this.sysFsSopWatchStatus = response.data;
|
|
this.sysFsSopWatchStatus = response.data;
|
|
|
});
|
|
});
|
|
|
this.getDicts("app_sop_msg_type").then(response => {
|
|
this.getDicts("app_sop_msg_type").then(response => {
|
|
|
- this.msgTypeOptions = response.data;
|
|
|
|
|
|
|
+ // 改状态(dictValue=5)已停用,页面过滤掉该选项
|
|
|
|
|
+ this.msgTypeOptions = (response.data || []).filter(d => Number(d.dictValue) !== 5);
|
|
|
});
|
|
});
|
|
|
this.getDicts("app_normal_disabled_status").then(response => {
|
|
this.getDicts("app_normal_disabled_status").then(response => {
|
|
|
this.statusOptions = response.data;
|
|
this.statusOptions = response.data;
|
|
@@ -1409,28 +1433,23 @@ export default {
|
|
|
const [
|
|
const [
|
|
|
courseInfo,
|
|
courseInfo,
|
|
|
defaultPkg,
|
|
defaultPkg,
|
|
|
- defaultLive,
|
|
|
|
|
- defaultProduct,
|
|
|
|
|
- defaultMedicines,
|
|
|
|
|
- defaultShortVideo,
|
|
|
|
|
|
|
+ defaultLiveGroup,
|
|
|
defaultArticle,
|
|
defaultArticle,
|
|
|
defaultOpenClassVideo,
|
|
defaultOpenClassVideo,
|
|
|
] = await Promise.all([
|
|
] = await Promise.all([
|
|
|
this.getCourseList(null, null),
|
|
this.getCourseList(null, null),
|
|
|
this.getPkgList(null, null),
|
|
this.getPkgList(null, null),
|
|
|
- this.getLiveList(),
|
|
|
|
|
- this.getProductList(null, null),
|
|
|
|
|
- this.getMedicinesList(null, null),
|
|
|
|
|
- this.getShortVideoList(null, null),
|
|
|
|
|
|
|
+ this.fetchLiveGroupTypeList(),
|
|
|
this.getArticleList(null, null),
|
|
this.getArticleList(null, null),
|
|
|
this.getOpenClassVideoList(null, null),
|
|
this.getOpenClassVideoList(null, null),
|
|
|
]);
|
|
]);
|
|
|
this.courseList = courseInfo.list;
|
|
this.courseList = courseInfo.list;
|
|
|
this.pkgList = defaultPkg.data;
|
|
this.pkgList = defaultPkg.data;
|
|
|
- this.liveList = defaultLive.data;
|
|
|
|
|
- this.productList = defaultProduct.data;
|
|
|
|
|
- this.medicinesList = defaultMedicines.data;
|
|
|
|
|
- this.shortVideoList = defaultShortVideo.data;
|
|
|
|
|
|
|
+ this.liveGroupTypeList = defaultLiveGroup.rows || defaultLiveGroup.data || [];
|
|
|
|
|
+ // 民品/药品/短视频接口暂不放开,避免控制台报错
|
|
|
|
|
+ // this.productList = ...
|
|
|
|
|
+ // this.medicinesList = ...
|
|
|
|
|
+ // this.shortVideoList = ...
|
|
|
this.articleList = defaultArticle.data;
|
|
this.articleList = defaultArticle.data;
|
|
|
this.openClassVideoList = defaultOpenClassVideo.data;
|
|
this.openClassVideoList = defaultOpenClassVideo.data;
|
|
|
},
|
|
},
|
|
@@ -1457,12 +1476,22 @@ export default {
|
|
|
};
|
|
};
|
|
|
return await getPackageOptions(data);
|
|
return await getPackageOptions(data);
|
|
|
},
|
|
},
|
|
|
- // /**
|
|
|
|
|
- // * 获取直播间下拉
|
|
|
|
|
- // */
|
|
|
|
|
- // async getLiveList() {
|
|
|
|
|
- // return await getLiveOptions();
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取直播分组下拉
|
|
|
|
|
+ */
|
|
|
|
|
+ async fetchLiveGroupTypeList() {
|
|
|
|
|
+ return await fetchLiveGroupTypeListApi({ pageNum: 1, pageSize: 999 });
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取直播间下拉
|
|
|
|
|
+ * @param liveGroupType 直播分组id
|
|
|
|
|
+ */
|
|
|
|
|
+ async fetchLiveOptionsByGroup(liveGroupType) {
|
|
|
|
|
+ if (!liveGroupType) {
|
|
|
|
|
+ return { data: [] };
|
|
|
|
|
+ }
|
|
|
|
|
+ return await fetchLiveOptionsApi({ liveGroupType });
|
|
|
|
|
+ },
|
|
|
// /**
|
|
// /**
|
|
|
// * 获取民品列表
|
|
// * 获取民品列表
|
|
|
// * @param keyword
|
|
// * @param keyword
|
|
@@ -1708,6 +1737,21 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //直播
|
|
|
|
|
+ else if (contentType === 21) {
|
|
|
|
|
+ if (setting.liveGroupTypeId) {
|
|
|
|
|
+ let liveRes = await this.fetchLiveOptionsByGroup(setting.liveGroupTypeId);
|
|
|
|
|
+ this.$set(setting, 'meta', {
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: liveRes.data || liveRes.rows || [],
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$set(setting, 'meta', {
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: [],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//民品
|
|
//民品
|
|
|
else if(contentType === 22) {
|
|
else if(contentType === 22) {
|
|
|
if (!setting.productId) {
|
|
if (!setting.productId) {
|
|
@@ -1938,20 +1982,24 @@ export default {
|
|
|
this.$message.error("疗法不能为空")
|
|
this.$message.error("疗法不能为空")
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ if ([21].includes(Number(dcs.contentType)) && this.isEmpty(dcs.liveGroupTypeId)) {
|
|
|
|
|
+ this.$message.error("直播分组不能为空")
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
if ([21].includes(Number(dcs.contentType)) && this.isEmpty(dcs.liveId)) {
|
|
if ([21].includes(Number(dcs.contentType)) && this.isEmpty(dcs.liveId)) {
|
|
|
this.$message.error("直播间不能为空")
|
|
this.$message.error("直播间不能为空")
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //规则消息类别-改状态(绑定/解绑-标签/客服)
|
|
|
|
|
- else if (dc.type == 5) {
|
|
|
|
|
- if (this.isEmpty(dc.addTag) && this.isEmpty(dc.delTag)
|
|
|
|
|
- && this.isEmpty(dc?.addCustomer) && this.isEmpty(dc?.delCustomer)) {
|
|
|
|
|
- this.$message.error(`第${j + 1}条规则配置错误,未改动任何状态`);
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //规则消息类别-改状态(绑定/解绑-标签/客服)(已停用,暂注释)
|
|
|
|
|
+ // else if (dc.type == 5) {
|
|
|
|
|
+ // if (this.isEmpty(dc.addTag) && this.isEmpty(dc.delTag)
|
|
|
|
|
+ // && this.isEmpty(dc?.addCustomer) && this.isEmpty(dc?.delCustomer)) {
|
|
|
|
|
+ // this.$message.error(`第${j + 1}条规则配置错误,未改动任何状态`);
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
@@ -2275,6 +2323,34 @@ export default {
|
|
|
this.$set(content, 'packageImgUrl', selectedPkg.imgUrl);
|
|
this.$set(content, 'packageImgUrl', selectedPkg.imgUrl);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 直播分组切换
|
|
|
|
|
+ * @param content
|
|
|
|
|
+ */
|
|
|
|
|
+ async liveGroupTypeChange(content) {
|
|
|
|
|
+ this.$set(content, 'liveId', null);
|
|
|
|
|
+ this.$set(content, 'liveTitle', null);
|
|
|
|
|
+ this.$set(content, 'liveImgUrl', null);
|
|
|
|
|
+ if (!content.liveGroupTypeId) {
|
|
|
|
|
+ this.$set(content, 'meta', {
|
|
|
|
|
+ ...(content.meta || {}),
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: [],
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(content, 'meta', {
|
|
|
|
|
+ ...(content.meta || {}),
|
|
|
|
|
+ liveLoading: true,
|
|
|
|
|
+ liveList: [],
|
|
|
|
|
+ });
|
|
|
|
|
+ const liveRes = await this.fetchLiveOptionsByGroup(content.liveGroupTypeId);
|
|
|
|
|
+ this.$set(content, 'meta', {
|
|
|
|
|
+ ...(content.meta || {}),
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: liveRes.data || liveRes.rows || [],
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 直播间切换
|
|
* 直播间切换
|
|
|
* @param content
|
|
* @param content
|
|
@@ -2282,7 +2358,8 @@ export default {
|
|
|
liveChange(content) {
|
|
liveChange(content) {
|
|
|
content.liveTitle = null;
|
|
content.liveTitle = null;
|
|
|
content.liveImgUrl = null;
|
|
content.liveImgUrl = null;
|
|
|
- const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
|
|
|
|
|
|
|
+ const list = (content.meta && content.meta.liveList) ? content.meta.liveList : [];
|
|
|
|
|
+ const selectedLive = list.find(live => parseInt(live.liveId) === parseInt(content.liveId));
|
|
|
if (selectedLive) {
|
|
if (selectedLive) {
|
|
|
content.liveTitle = selectedLive.liveName; // 自动填充标题
|
|
content.liveTitle = selectedLive.liveName; // 自动填充标题
|
|
|
content.liveImgUrl = selectedLive.liveImgUrl; // 自动填充封面
|
|
content.liveImgUrl = selectedLive.liveImgUrl; // 自动填充封面
|
|
@@ -2426,6 +2503,21 @@ export default {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //直播
|
|
|
|
|
+ else if (contentType === 21) {
|
|
|
|
|
+ if (setting.liveGroupTypeId) {
|
|
|
|
|
+ let liveRes = await this.fetchLiveOptionsByGroup(setting.liveGroupTypeId);
|
|
|
|
|
+ this.$set(setting, 'meta', {
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: liveRes.data || liveRes.rows || [],
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$set(setting, 'meta', {
|
|
|
|
|
+ liveLoading: false,
|
|
|
|
|
+ liveList: [],
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//民品
|
|
//民品
|
|
|
else if(contentType === 22) {
|
|
else if(contentType === 22) {
|
|
|
if (!setting.productId) {
|
|
if (!setting.productId) {
|