服务指令同步
This commit is contained in:
parent
b1d6bf3b7b
commit
fcb5541fec
|
@ -85,8 +85,8 @@
|
|||
<span class="node-title" @mouseenter="onNodeEnter(data, data.children, $event)"
|
||||
@mouseleave="onNodeLeave(data)">
|
||||
<div v-if="data.level == 5">
|
||||
<div><strong>体型标签:</strong>{{data?.bodyTagList?.map(tag => tag.tagName).join('、')}}</div>
|
||||
<div><strong>情绪标签:</strong>{{data?.emotionTagList?.map(tag => tag.tagName).join('、')}}</div>
|
||||
<div><strong>体型标签:</strong>{{data?.bodyTagList?.map(tag => tag.tagName).join('、') || '-'}}</div>
|
||||
<div><strong>情绪标签:</strong>{{data?.emotionTagList?.map(tag => tag.tagName).join('、') || '-'}}</div>
|
||||
</div>
|
||||
<span v-else-if="data.level == 4">{{ data?.title + '(' + data?.cycleTypeName + ')' }}</span>
|
||||
<span v-else>{{ data?.title }}</span>
|
||||
|
@ -479,12 +479,13 @@ function expandTreeNodeToLevel4(directiveData: any) {
|
|||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload().then(() => {
|
||||
const dataSource = getDataSource();
|
||||
if (dataSource.length === 1) {
|
||||
const directiveData = dataSource[0]; // 获取该结果的所有字段
|
||||
expandTreeNodeToLevel4(directiveData); // 调用展开树的方法
|
||||
if (!!queryParam.directiveName || !!queryParam.bodyTags || !!queryParam.emotionTags || !!queryParam.izEnabled) {
|
||||
queryParam.instructionTagId = '';
|
||||
queryParam.categoryId = '';
|
||||
queryParam.typeId = '';
|
||||
}
|
||||
reload().then(() => {
|
||||
initTree();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -507,9 +508,7 @@ function searchReset() {
|
|||
|
||||
// 刷新数据
|
||||
reload().then(() => {
|
||||
// 清空之前展开的节点
|
||||
expandedKeys.value = [];
|
||||
setDefaultExpanded(treeData.value);
|
||||
initTree();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -795,11 +794,13 @@ function stopType(data) {
|
|||
//新增服务指令
|
||||
function addDirective(data) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.opeType = 'add';
|
||||
registerModal.value.edit({ instructionTagId: data.instructionId, categoryId: data.categoryId, typeId: data.typeId });
|
||||
}
|
||||
//编辑务指令
|
||||
function editDirective(data) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.opeType = 'edit';
|
||||
registerModal.value.queryByIdFunc(data.key);
|
||||
}
|
||||
//指令资源
|
||||
|
@ -873,9 +874,9 @@ function menuItems(data) {
|
|||
{ key: 'editDir', label: '编辑服务指令', icon: 'ant-design:edit-outlined', action: editDirective },
|
||||
{ key: 'editMedia', label: '编辑指令资源', icon: 'ant-design:edit-outlined', action: editMedia },
|
||||
]
|
||||
if (data.canAdd) {
|
||||
items.push({ key: 'addDir', label: '新增服务指令', icon: 'ant-design:plus-outlined', action: addDirective })
|
||||
}
|
||||
// if (data.canAdd) {
|
||||
// items.push({ key: 'addDir', label: '新增服务指令', icon: 'ant-design:plus-outlined', action: addDirective })
|
||||
// }
|
||||
if (data.izEnabled === '1') {
|
||||
items.push({ key: 'usingDir', label: '启用服务指令', icon: 'ant-design:check-circle-outlined', action: usingDirective })
|
||||
} else if (data.izEnabled === '0') {
|
||||
|
@ -945,13 +946,8 @@ function handleTreeSelect(selectedKeys: string[], { node }: any) {
|
|||
// 触发查询
|
||||
searchQuery();
|
||||
}
|
||||
// 添加音频结束监听
|
||||
onMounted(() => {
|
||||
if (audioPlayer.value) {
|
||||
audioPlayer.value.addEventListener('ended', () => {
|
||||
isPlaying.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function initTree() {
|
||||
treeLoading.value = true
|
||||
tree().then(res => {
|
||||
treeData.value = res;
|
||||
|
@ -962,6 +958,16 @@ onMounted(() => {
|
|||
.finally(() => {
|
||||
treeLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 添加音频结束监听
|
||||
onMounted(() => {
|
||||
if (audioPlayer.value) {
|
||||
audioPlayer.value.addEventListener('ended', () => {
|
||||
isPlaying.value = false;
|
||||
});
|
||||
}
|
||||
initTree()
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -366,9 +366,12 @@ const formComputedData = computed(() => {
|
|||
watch(
|
||||
() => formData.instructionTagId,
|
||||
(newInstructionTagId) => {
|
||||
if (!newInstructionTagId) {
|
||||
if (needWatch.value) {
|
||||
formData.categoryId = ''
|
||||
formData.typeId = ''
|
||||
formData.cycleType = ''
|
||||
}
|
||||
if (!newInstructionTagId) {
|
||||
categoryDictCode.value = 'nu_config_service_category,category_name,id,1=2';
|
||||
} else {
|
||||
categoryDictCode.value = `nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${newInstructionTagId}' order by sort asc`;
|
||||
|
@ -378,26 +381,41 @@ watch(
|
|||
watch(
|
||||
() => formData.categoryId,
|
||||
(newCategoryId) => {
|
||||
if (!newCategoryId) {
|
||||
if (needWatch.value) {
|
||||
formData.typeId = ''
|
||||
formData.cycleType = ''
|
||||
}
|
||||
if (!newCategoryId) {
|
||||
typeDictCode.value = 'nu_config_service_type,type_name,id,del_flag = 99 order by sort asc';
|
||||
} else {
|
||||
typeDictCode.value = `nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${newCategoryId}' order by sort asc`;
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => formData.typeId,
|
||||
(newTypeId) => {
|
||||
if (needWatch.value) {
|
||||
formData.cycleType = ''
|
||||
}
|
||||
}
|
||||
);
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
const needWatch = ref(false)
|
||||
/**
|
||||
* 编辑
|
||||
* isEditMedia_是否为编辑指令资源 (隐藏业务字段)
|
||||
*/
|
||||
function edit(record, isEditMedia_ = false) {
|
||||
needWatch.value = false
|
||||
setTimeout(() => {
|
||||
needWatch.value = true
|
||||
}, 1000)
|
||||
isEditMedia.value = isEditMedia_
|
||||
formData.bodyTags = ''
|
||||
formData.emotionTags = ''
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
:maskClosable="false">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancel">关闭</a-button>
|
||||
<a-button @click="handleOk"
|
||||
v-show="opeType == 'add' || opeType == 'edit' || opeType == 'audit' || opeType == 'audit' || opeType == 'editMedia'"
|
||||
<a-button @click="handleOk" v-show="opeType == 'add' || opeType == 'edit' || opeType == 'editMedia'"
|
||||
:loading="loading">确定</a-button>
|
||||
<!-- <a-button @click="handleSave" v-show="opeType == 'editMedia' || opeType == 'auditMedia'">暂存</a-button>
|
||||
<a-button type="primary" @click="handleMediaAsync" v-show="opeType == 'auditMedia'">同步</a-button>
|
||||
|
|
Loading…
Reference in New Issue