业务端服务指令功能调整:

1)去除标准指令库、差异比对、差异指令功能
	2)去除所有标准指令库概念先关操作及代码逻辑
	3)任一机构均可创建任意分类标签、服务类别、服务类型、服务指令以及编辑任意字段
	4)新增镜像码管理功能:未生成镜像码机构自动生成镜像码,可更新镜像码,更新后旧的镜像码将失效;可通过复制按钮快速复制镜像码
	5)新增服务指令库功能:需要先输入周正确的镜像码后,可查看对应机构所有服务指令,并可“镜像”到本机构中,如果分类标签、服务类别、服务类型、服务名称汉字完全一致,则认定为同一服务指令,不会重复镜像
This commit is contained in:
1378012178@qq.com 2025-12-19 10:09:19 +08:00
parent 9343ca60ee
commit 771ee9e3b2
5 changed files with 246 additions and 574 deletions

View File

@ -23,6 +23,9 @@ enum Api {
syncDirective = '/services/serviceDirective/syncDirective',
useOrStopCascade = '/services/serviceDirective/useOrStopCascade',
compareList = '/services/serviceDirective/compareList',
getSyncCode = '/services/serviceDirective/getSyncCode',
updateSyncCode = '/services/serviceDirective/updateSyncCode',
getOrgCodeBySyncCode = '/services/serviceDirective/getOrgCodeBySyncCode',
}
/**
@ -155,6 +158,27 @@ export const useOrStopCascade = (params) => {
/**
*
* @param params compareOrgCode
* @returns
* @returns
*/
export const compareList = (params) => defHttp.get({ url: Api.compareList, params });
export const compareList = (params) => defHttp.get({ url: Api.compareList, params });
/**
*
* @param params
* @returns
*/
export const getSyncCode = (params) => defHttp.get({ url: Api.getSyncCode, params }, { isTransformResponse: false });
/**
*
* @param params
* @returns
*/
export const updateSyncCode = (params) => defHttp.get({ url: Api.updateSyncCode, params }, { isTransformResponse: false });
/**
*
* @param params
* @returns
*/
export const getOrgCodeBySyncCode = (params) => defHttp.get({ url: Api.getOrgCodeBySyncCode, params }, { isTransformResponse: false });

View File

@ -34,14 +34,9 @@
</a-radio-group>
</div>
<!-- <div v-if="treeLoading"
style="width: 350px; height: 20vh; display: flex; justify-content: center; align-items: center;">
<a-spin tip="加载中..."></a-spin>
</div> -->
<a-empty v-if="!treeLoading && treeLoading" />
<a-button v-if="!treeLoading && treeData.length < 1" type="link" class="btnPrivate" @click="addInstruction"
v-show="mainOrgCode == ownOrgCode" preIcon="ant-design:plus-outlined">新增分类标签</a-button>
preIcon="ant-design:plus-outlined">新增分类标签</a-button>
<a-menu v-model:openKeys="openKeys" v-model:selectedKeys="selectedKeys" style="width: 100%;margin-top: 50px;"
mode="inline" @openChange="onOpenChange">
<template v-for="item in treeData">
@ -77,7 +72,6 @@
</span>
</template>
<!-- 第二层判断是否有下级 -->
<template v-for="child in item.children">
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0"
@ -145,7 +139,7 @@
class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')' }}
<span v-if="childFour?.izEnabled == 'N' && childFour.level != 5"
style="color:red;">(已停用)</span>
<span v-show="childFour.showContent">
<span v-show="childFour.showContent">
<a-dropdown :open="menuState[childFour?.key]?.open"
@openChange="onMenuOpenChange(childFour.key, $event)">
<template #overlay>
@ -157,7 +151,7 @@
<span style=" color:#1890FF;margin-left: 5px;">{{ itemMenu.label }}</span>
</a-menu-item>
</a-menu>
</template>
</template>
<Icon style="color:#1890FF;" :icon="iconClass(childFour.level)" class="action-icon"
@mouseenter="onNodeIconEnter(childFour, childFour.children)"
@mouseleave="onNodeIconLeave(childFour)" />
@ -253,40 +247,8 @@
</span>
</a-menu-item>
</template>
</a-menu>
<!-- <a-tree class="container-height" style="padding-top: 40px;" v-if="!treeLoading && treeData.length > 0"
:tree-data="treeData" v-model:expandedKeys="expandedKeys" expandAction="click" @select="handleTreeSelect">
<template #title="{ data }">
<span class="node-title" @mouseenter="onNodeEnter(data, data.children, $event)"
@mouseleave="onNodeLeave(data)">
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-if="data.level == 1" style="margin-right: 5px;"/>
<span v-if="data.level == 4">{{ data?.title + '(' + data?.cycleTypeName + ')' }}</span>
<span v-else>{{ data?.title }}</span>
<span v-if="data?.izEnabled == 'N' && data.level != 5" style="color:red;">(已停用)</span>
<a-dropdown :open="menuState[data?.key]?.open" @openChange="onMenuOpenChange(data.key, $event)">
<template #overlay>
<a-menu>
<a-menu-item v-for="item in menuItems(data)" :key="item.key" :disabled="!item.canAdd"
class="nu-menu-item" @click="() => { closeAllMenus(); item.action(data) }">
<Icon style="color:#1890FF;" :icon="item.icon" class="action-icon"></Icon>
<span style=" color:#1890FF;margin-left: 5px;">{{ item.label }}</span>
</a-menu-item>
</a-menu>
</template>
<Icon v-show="data.showIcon && data.level != 5" style="color:#1890FF;" :icon="iconClass(data.level)"
class="action-icon" @mouseenter="onNodeIconEnter(data, data.children)"
@mouseleave="onNodeIconLeave(data)" />
</a-dropdown>
</span>
</template>
</a-tree> -->
</div>
<div style="width:calc(100% - 370px);float: left; background-color: white;border-radius: 8px;"
class="container-height">
@ -294,25 +256,10 @@
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<!-- <a-button type="primary" class="btnPrivate" @click="handleinstructionTag"
preIcon="tabler:settings">配置分类标签</a-button>
<a-button type="primary" class="btnPrivate" @click="handleCategory"
preIcon="tabler:settings">配置服务类别</a-button>
<a-button type="primary" class="btnPrivate" @click="handleType" preIcon="tabler:settings">配置服务类型</a-button> -->
<!-- <a-button type="primary" class="btnPrivate" @click="handleBodyTag"
preIcon="tabler:settings">配置体型标签</a-button>
<a-button type="primary" class="btnPrivate" @click="handleEmotionTag"
preIcon="tabler:settings">配置情绪标签</a-button> -->
<!-- <a-button type="primary" class="btnPrivate" @click="handleAdd"
preIcon="ant-design:plus-outlined">新增服务指令</a-button> -->
<a-button type="primary" @click="handleDirectiveMainOpen" v-show="isShowDM"
preIcon="ant-design:profile-outlined">标准指令库</a-button>
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
@click="handleCompare">差异比对</a-button>
<a-button type="primary" preIcon="ant-design:eye-outlined" v-show="ownOrgCode == mainOrgCode"
@click="handleLookNewDirectives">差异指令</a-button>
<!-- <a-button type="primary" @click="handleBatchAdd" preIcon="ant-design:plus-outlined">批量新增</a-button>
<a-button type="primary" @click="onAbnormalListOpen" preIcon="ant-design:edit-twotone">停用指令</a-button> -->
<a-button type="primary" @click="directiveSyncCodeMangeFunc" v-show="!!ownOrgCode"
preIcon="ant-design:setting-outlined">镜像码管理</a-button>
<a-button type="primary" @click="handleDirectiveMainOpen"
preIcon="ant-design:profile-outlined">服务指令库</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
@ -324,38 +271,6 @@
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else type="link" class="btnPrivate" @click="openAudioModal(text)">播放</a-button>
</template>
<!-- <template v-if="column.dataIndex === 'previewFile'">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<img v-else :src="getFileAccessHttpUrl(text)" alt="图片不存在" class="cellIamge" />
</template> -->
<!-- <template v-if="column.dataIndex === 'mp3File'">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<div v-else style="display: flex; align-items: center; gap: 8px;">
<audio ref="audioPlayer" :src="getFileAccessHttpUrl(text)" hidden></audio>
<a-button v-if="!currentPlayingAudio || currentPlayingAudio !== text" type="link" @click="playAudio(text)"
preIcon="ant-design:play-circle-outlined">
播放
</a-button>
<template v-else>
<a-button v-if="isPlaying" type="link" @click="pauseAudio" preIcon="ant-design:pause-circle-outlined">
暂停
</a-button>
<a-button v-else type="link" @click="resumeAudio" preIcon="ant-design:play-circle-outlined">
播放
</a-button>
<a-button type="link" @click="restartAudio" preIcon="ant-design:reload-outlined">
重播
</a-button>
<a-button type="link" @click="stopAudio" preIcon="ant-design:stop-outlined">
停止
</a-button>
</template>
</div>
</template> -->
<template v-if="column.dataIndex === 'mp4File'">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else type="link" class="btnPrivate" @click="openVideoModal(text)">播放</a-button>
@ -371,12 +286,10 @@
</template>
</BasicTable>
</div>
</div>
<!-- 表单区域 -->
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess"
:isMain="!!mainOrgCode && !!ownOrgCode && mainOrgCode == ownOrgCode">
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess" :isMain="true">
</ConfigServiceDirectiveModal>
</div>
@ -404,31 +317,6 @@
<ConfigServiceTypeList v-if="typeOpen"></ConfigServiceTypeList>
</a-drawer>
<!-- 体型标签 -->
<!-- <a-drawer title="体型标签" width="60vw" :open="bodyTagOpen" @close="onBodyTagClose">
<template #footer>
<a-button type="primary" @click="onBodyTagClose" style="float: right;">关闭</a-button>
</template>
<BodyTagList v-if="bodyTagOpen"></BodyTagList>
</a-drawer> -->
<!-- 情绪标签 -->
<!-- <a-drawer title="情绪标签" width="60vw" :open="emotionTagOpen" @close="onEmotionTagClose">
<template #footer>
<a-button type="primary" @click="onEmotionTagClose" style="float: right;">关闭</a-button>
</template>
<EmotionTagList v-if="emotionTagOpen"></EmotionTagList>
</a-drawer> -->
<!-- 差异比对 -->
<a-drawer title="差异比对" width="80vw" :open="compareListOpen" @close="onCompareListClose"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '0' }">
<template #footer>
<a-button type="primary" @click="onCompareListClose" style="margin-right: 10px;">关闭</a-button>
</template>
<CompareDirectiveList ref="compareListRef" v-if="compareListOpen" :ownOrgCode="ownOrgCode" :ownOrgName="ownOrgName">
</CompareDirectiveList>
</a-drawer>
<!-- 批量新增 -->
<a-drawer title="批量新增" width="80vw" :open="batchAddOpen" @close="onBatchAddClose"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '0' }">
@ -462,6 +350,28 @@
</div>
</a-drawer>
<!-- 镜像码管理 -->
<a-drawer v-model:visible="syncCodeVisible" title="镜像码管理" width="40vw" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ height: '100%', display: 'flex', padding: '14px', flexDirection: 'column', overflow: 'auto' }"
wrapClassName="org-list-modal" @cancel="syncCodeVisible = false">
<template #footer>
<a-button @click="syncCodeVisible = false" type="primary">关闭</a-button>
</template>
<a-spin :spinning="!syncCode">
<div style="padding: 14px; background-color: white; display: flex; align-items: center;">
<a-row style="width: 100%;">
<a-col :span="16" style="display: flex; align-items: center;">
<span style="font-weight: bold;">镜像码{{ syncCode }}</span><span></span>
</a-col>
<a-col :push="3" :span="5" style="display: flex; align-items: center;">
<a-button @click="copySyncCodeFunc()" type="primary" style="margin-right: 8px;">复制</a-button>
<a-button @click="updateSyncCodeFunc()" type="primary">更新</a-button>
</a-col>
</a-row>
</div>
</a-spin>
</a-drawer>
<!-- 音频播放 -->
<a-modal v-model:visible="showAudioModal" title="音频播放" :footer="null" @cancel="closeAudioModal"
:bodyStyle="{ padding: '0', maxHeight: '80vh', overflow: 'auto' }" :keyboard="true">
@ -491,24 +401,18 @@ import { ref, reactive, watch, onMounted, computed, nextTick } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
import { list, batchAdd, deleteOne, batchDelete, getImportUrl, getExportUrl, tree } from './ConfigServiceDirective.api';
import { list, batchAdd, deleteOne, batchDelete, getImportUrl, getExportUrl, tree, getSyncCode, updateSyncCode } from './ConfigServiceDirective.api';
import ConfigServiceDirectiveModal from './components/ConfigServiceDirectiveModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { cloneDeep } from "lodash-es";
import ConfigServiceCategoryList from '../serviceCategory/ConfigServiceCategoryList.vue';
import InstructionTag from '../instructiontag/InstructionTag.vue';
import ConfigServiceTypeList from '../serviceType/ConfigServiceTypeList.vue';
import BodyTagList from '/@/views/services/directivetag/bodytag/BodyTagList.vue';
import EmotionTagList from '/@/views/services/directivetag/emotiontag/EmotionTagList.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { Empty } from 'ant-design-vue';
import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue'
import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue'
import ConfigServiceTypeModal from '/@/views/services/serviceType/components//ConfigServiceTypeModal.vue'
import DirectiveMediaList from '/@/views/services/directivemedia/DirectiveMediaList.vue'
import { queryByKey } from '/@/views/admin/sysconfig/SysConfig.api'
import { getOrgInfo } from '@/api/common/api'
import { useMessage } from '/@/hooks/web/useMessage';
import AbnormalDirectiveList from './components/AbnormalDirectiveList.vue'
@ -531,8 +435,8 @@ const dmRef = ref()
const abnormalListOpen = ref(false)
const abnormalListRef = ref()
const newDirectiveVisible = ref(false)
const compareListRef = ref()
const compareListOpen = ref(false)
const syncCodeVisible = ref(false)
const queryParam = reactive<any>({
instructionTagId: '',
categoryId: '',
@ -554,11 +458,8 @@ watch(
queryParam.typeId = ''
}
)
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const treeData = ref<any>([]);
const userStore = useUserStore();
const isShowDM = ref(false)//
const selectedKeys = ref<any>([]);
const openKeys = ref<any>([]);
//table
@ -609,65 +510,16 @@ const wrapperCol = reactive({
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
const insTagOpen = ref(false)//
const categoryOpen = ref(false)//
const typeOpen = ref(false)//
const bodyTagOpen = ref(false)//
const emotionTagOpen = ref(false)//
const mainOrgCode = ref()//
const ownOrgCode = ref('') //
const ownOrgName = ref('') //
const filterIzEnabled = ref('enabled')///
const directiveMainOrgInfo = ref()
function onOpenChange(record: string[]) {
console.log("🚀 ~ onOpenChange ~ record:", record)
selectedKeys.value = record
// const latestOpenKey = record.find(key => state.openKeys.indexOf(key) === -1);
// if (state.rootSubmenuKeys.indexOf(latestOpenKey!) === -1) {
// state.openKeys = openKeys;
// } else {
// state.openKeys = latestOpenKey ? [latestOpenKey] : [];
// }
}
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.opeType = 'add';
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.opeType = 'edit';
registerModal.value.edit(record);
}
/**
* 编辑指令资源
*/
function handleMedia(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.opeType = 'editMedia';
registerModal.value.editMedia(record);
}
/**
@ -697,14 +549,6 @@ function getTableAction(record) {
label: '详情',
onClick: handleDetail.bind(null, record),
},
// {
// label: '',
// onClick: handleEdit.bind(null, record)
// },
// {
// label: '',
// onClick: handleMedia.bind(null, record)
// },
];
}
@ -740,34 +584,6 @@ function expandTreeNodeToLevel4(directiveData: any) {
selectedKeys.value = [directiveData.instructionTagId, directiveData.categoryId, directiveData.typeId, directiveData.id]
openKeys.value = [directiveData.instructionTagId, directiveData.categoryId, directiveData.typeId, directiveData.id]
// //
// expandedKeys.value = [];
// //
// const findAndExpandNode = (nodes: any[], level: number, directiveData: any) => {
// for (const node of nodes) {
// // level directiveData
// if (level === 1 && node.instructionId === directiveData.instructionTagId) {
// expandedKeys.value.push(node.key);
// if (node.children && node.children.length > 0) {
// findAndExpandNode(node.children, 2, directiveData);
// }
// } else if (level === 2 && node.categoryId === directiveData.categoryId) {
// expandedKeys.value.push(node.key);
// if (node.children && node.children.length > 0) {
// findAndExpandNode(node.children, 3, directiveData);
// }
// } else if (level === 3 && node.typeId === directiveData.typeId) {
// expandedKeys.value.push(node.key);
// if (node.children && node.children.length > 0) {
// findAndExpandNode(node.children, 4, directiveData);
// }
// } else if (level === 4 && node.key === directiveData.id) {
// expandedKeys.value.push(node.key);
// }
// }
// };
// //
// findAndExpandNode(treeData.value, 1, directiveData);
}
/**
@ -813,8 +629,6 @@ function searchReset() {
queryParam.bodyTags = '';
queryParam.emotionTags = '';
queryParam.id = '';
// queryParam.izEnabled = '';
//
reload().then(() => {
initTree();
@ -846,27 +660,6 @@ async function setRangeQuery() {
return queryParamClone;
}
//
function handleinstructionTag() {
insTagOpen.value = true
}
//
function handleCategory() {
categoryOpen.value = true
}
//
function handleType() {
typeOpen.value = true
}
//
function handleBodyTag() {
bodyTagOpen.value = true
}
//
function handleEmotionTag() {
emotionTagOpen.value = true
}
//
function onInsTagClose() {
insTagOpen.value = false
@ -879,14 +672,6 @@ function onCategoryClose() {
function onTypeClose() {
typeOpen.value = false
}
//
function onBodyTagClose() {
bodyTagOpen.value = false
}
//
function onEmotionTagClose() {
emotionTagOpen.value = false
}
const showAudioModal = ref(false); //
const audioUrl = ref(''); // URL
@ -929,79 +714,14 @@ const closeVideoModal = () => {
};
//
const currentPlayingAudio = ref<string | null>(null);
const isPlaying = ref(false);
//
const playAudio = (url: string) => {
if (currentPlayingAudio.value && currentPlayingAudio.value !== url) {
//
stopAudio();
}
currentPlayingAudio.value = url;
isPlaying.value = true;
// audio
if (audioPlayer.value) {
audioPlayer.value.src = getFileAccessHttpUrl(url);
audioPlayer.value.play().catch(e => {
isPlaying.value = false;
currentPlayingAudio.value = null;
});
}
};
const pauseAudio = () => {
if (audioPlayer.value) {
audioPlayer.value.pause();
isPlaying.value = false;
}
};
const resumeAudio = () => {
if (audioPlayer.value) {
audioPlayer.value.play().catch(e => {
});
isPlaying.value = true;
}
};
const restartAudio = () => {
if (audioPlayer.value) {
audioPlayer.value.currentTime = 0;
audioPlayer.value.play().catch(e => {
});
isPlaying.value = true;
}
};
const stopAudio = () => {
if (audioPlayer.value) {
audioPlayer.value.pause();
audioPlayer.value.currentTime = 0;
isPlaying.value = false;
currentPlayingAudio.value = null;
}
};
const clickCount = ref(0);
const treeChildData = ref<any>([]);
const expandedKeys = ref<string[]>([]);
// node hover
const menuState = reactive<Record<string, { timer?: number, openedByClick: boolean, open: boolean }>>({
})
function onNodeEnter(node, level, event) {
node.showIcon = true
}
function onNodeLeave(node) {
node.showIcon = false
}
function onNodeIconEnter(node, level) {
//
@ -1034,14 +754,6 @@ function onNodeIconLeave(node) {
delete s.timer
}
}
//
function openMenu(node, level, ev) {
closeAllMenus();
const key = node.key
if (!menuState[key]) menuState[key] = { openedByClick: false, open: false }
menuState[key].openedByClick = true
menuState[key].open = true
}
// Dropdown openChange
function onMenuOpenChange(key: string, open: boolean) {
@ -1216,23 +928,13 @@ function usingDirective(data) {
function stopDirective(data) {
registerModal.value.usingOrStop(data.key, 'N', true);
}
//
function bodyTagsDetail(data) {
}
//
function emotionTagsDetail(data) {
}
//
function menuItems(data) {
if (data.level === 1) {
const items = [
{ key: 'addIns', label: '新增分类标签', icon: 'ant-design:plus-outlined', canAdd: true, action: addInstruction }
]
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
items.push({ key: 'addIns', label: '新增分类标签', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: addInstruction },)
}
if (data.canAdd) {
items.push({ key: 'addCat', label: '新增服务类别', icon: 'ant-design:plus-outlined', canAdd: data.canAdd, action: addCategory })
}
@ -1256,10 +958,7 @@ function menuItems(data) {
} else if (data.izEnabled === 'Y') {
items.push({ key: 'stopCat', label: '停用服务类别', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopCategory })
}
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
items.push({ key: 'editCatImg', label: '修改类别图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editCategoryAnimationPath },)
}
items.push({ key: 'editCatImg', label: '修改类别图片', icon: 'ant-design:plus-outlined', canAdd: true, action: editCategoryAnimationPath },)
return items
}
else if (data.level === 3) {
@ -1274,42 +973,13 @@ function menuItems(data) {
} else if (data.izEnabled === 'Y') {
items.push({ key: 'stopTyp', label: '停用服务类型', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopType })
}
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
items.push({ key: 'editTypeImg', label: '修改类型图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editTypeAnimationPath },)
}
items.push({ key: 'editTypeImg', label: '修改类型图片', icon: 'ant-design:plus-outlined', canAdd: true, action: editTypeAnimationPath },)
return items
}
// else if (data.level === 4) {
// const items = [
// { key: 'editDir', label: '', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y', action: editDirective },
// { key: 'editMedia', label: '', icon: 'ant-design:edit-outlined', canAdd: data.canAdd && data.izEnabled == 'Y' && mainOrgCode.value == ownOrgCode.value, action: editMedia },
// ]
// // if (data.canAdd) {
// // items.push({ key: 'addDir', label: '', icon: 'ant-design:plus-outlined', canAdd: data.canAdd , action: addDirective })
// // }
// if (data.izEnabled === 'N') {
// items.push({ key: 'usingDir', label: '', icon: 'ant-design:check-circle-outlined', canAdd: data.canAdd, action: usingDirective })
// } else if (data.izEnabled === 'Y') {
// items.push({ key: 'stopDir', label: '', icon: 'ant-design:stop-outlined', canAdd: data.canAdd, action: stopDirective })
// }
// if (data?.bodyTagList?.length > 0) {
// items.push({ key: 'bodyTagsDetail', label: '', icon: 'ant-design:stop-outlined', canAdd: true, action: bodyTagsDetail })
// }
// if (data?.emotionTagList?.length > 0) {
// items.push({ key: 'emotionTagsDetail', label: '', icon: 'ant-design:stop-outlined', canAdd: true, action: emotionTagsDetail })
// }
// return items
// }
return []
}
// key
function setDefaultExpanded(nodes: any[]) {
// expandedKeys.value.push(nodes[0].key)
// expandedKeys.value.push(nodes[0]?.children?.[0]?.key)
// expandedKeys.value.push(nodes[0]?.children?.[0]?.children?.[0]?.key)
}
const treeLoading = ref(false)
function reloadTree() {
@ -1376,23 +1046,13 @@ async function initTree() {
* 查看指令库
*/
function handleDirectiveMainOpen() {
registerModal.value?.openDM(mainOrgCode.value)
registerModal.value?.openDM()
}
async function getDirectiveMainOrgCode() {
let { orgCode, orgName } = await getOrgInfo()
ownOrgCode.value = orgCode
ownOrgName.value = orgName
let { configValue } = await queryByKey({ key: 'directive_main_org_code' })
mainOrgCode.value = configValue
if (orgCode != configValue) isShowDM.value = true
}
function handleBatchAdd() {
batchAddOpen.value = true
nextTick(() => {
dmRef.value?.init()
})
}
function onBatchAddClose() {
@ -1407,13 +1067,6 @@ function onBatchAddSubmit() {
})
}
function onAbnormalListOpen() {
abnormalListOpen.value = true
nextTick(() => {
abnormalListRef.value?.reload()
})
}
function onAbnormalListClose() {
abnormalListOpen.value = false
searchQuery(true, true)
@ -1430,10 +1083,6 @@ async function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
}
}
async function handleLookNewDirectives() {
await refreshDMExistedIds(directiveMainOrgInfo.value, true)
newDirectiveVisible.value = true
}
/**
* 关闭新增指令
*/
@ -1441,17 +1090,57 @@ function handleCancelNewDirective() {
newDirectiveVisible.value = false
}
/**
* 差异比对
*/
function handleCompare() {
compareListOpen.value = true
const syncCode = ref('')
//
async function directiveSyncCodeMangeFunc() {
syncCode.value = ''
syncCodeVisible.value = true
if (!syncCode.value) {
let res = await getSyncCode({ 'orgCode': ownOrgCode.value })
syncCode.value = res.result
}
}
function onCompareListClose() {
compareListOpen.value = false
async function updateSyncCodeFunc() {
createConfirm({
iconType: 'warning',
title: '更新镜像码',
content: '更新后旧的镜像码无法继续使用,是否确认更新?',
onOk:async () => {
syncCode.value = ''
let res = await updateSyncCode({ 'orgCode': ownOrgCode.value })
syncCode.value = res.result
},
onCancel() { },
});
}
function copySyncCodeFunc() {
//
const textArea = document.createElement('textarea');
textArea.value = syncCode.value;
document.body.appendChild(textArea);
textArea.select();
try {
//
const successful = document.execCommand('copy');
if (successful) {
createMessage.success('复制成功');
} else {
createMessage.error('复制失败');
}
} catch (err) {
console.error('复制失败:', err);
createMessage.error('复制失败');
} finally {
// DOM
document.body.removeChild(textArea);
}
}
//
onMounted(() => {
if (audioPlayer.value) {

View File

@ -116,44 +116,38 @@
<a-row style="padding: 0px 20px;">
<a-col :span="24" v-show="directiveMediaBtnValue == 0">
<JImageUploadtz v-if="opeType == 'dmlook'"
:value="!!formData.previewFile ? formData.previewFile : defaultPrePic" maxCount="1"
:disabled="disabled || !isMain" />
:value="!!formData.previewFile ? formData.previewFile : defaultPrePic" maxCount="1" />
<JImageUploadtz v-else v-model:value="formData.previewFile" maxCount="1" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" />
</a-col>
<a-col :span="24" v-show="directiveMediaBtnValue == 1">
<JImageUploadtz v-if="opeType == 'dmlook'"
:value="!!formData.previewFileSmall ? formData.previewFileSmall : defaultPreSmallPic" maxCount="1"
:disabled="disabled || !isMain" />
:value="!!formData.previewFileSmall ? formData.previewFileSmall : defaultPreSmallPic" maxCount="1" />
<JImageUploadtz v-else v-model:value="formData.previewFileSmall" maxCount="1" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" />
</a-col>
<a-col :span="24" v-show="directiveMediaBtnValue == 2">
<JUploadMP3 v-if="opeType == 'dmlook'" :value="formData.mp3File" maxCount="1"
:disabled="disabled || !isMain" />
<JUploadMP3 v-if="opeType == 'dmlook'" :value="formData.mp3File" maxCount="1" />
<JUploadMP3 v-else v-model:value="formData.mp3File" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" />
</a-col>
<a-col :span="24" v-show="directiveMediaBtnValue == 3">
<JUploadMP4 v-if="opeType == 'dmlook'" :value="formData.mp4File" maxCount="1" fileType="mp4"
:disabled="disabled || !isMain" />
<JUploadMP4 v-if="opeType == 'dmlook'" :value="formData.mp4File" maxCount="1" fileType="mp4" />
<JUploadMP4 v-else v-model:value="formData.mp4File" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" fileType="mp4"
:disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" fileType="mp4" />
</a-col>
<a-col :span="24" v-show="directiveMediaBtnValue == 4">
<JImageUploadtz v-if="opeType == 'dmlook'"
:value="!!formData.immediateFile ? formData.immediateFile : defaultImmediatePic" maxCount="1"
:disabled="disabled || !isMain" />
:value="!!formData.immediateFile ? formData.immediateFile : defaultImmediatePic" maxCount="1" />
<JImageUploadtz v-else v-model:value="formData.immediateFile" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" />
</a-col>
<a-col :span="24" v-show="directiveMediaBtnValue == 5">
<JImageUploadtz v-if="opeType == 'dmlook'"
:value="!!formData.immediateFileFocus ? formData.immediateFileFocus : defaultImmediatePic"
maxCount="1" :disabled="disabled || !isMain" />
maxCount="1" />
<JImageUploadtz v-else v-model:value="formData.immediateFileFocus" :toOpe="true"
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" />
</a-col>
</a-row>
<a-row style="padding: 20px;">

View File

@ -1,51 +1,23 @@
<template>
<!-- <j-modal :title="title" width="70vw" :visible="visible" @ok="handleOk"
:okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"
:maskClosable="false">
<template #footer>
<a-button @click="handleCancel">关闭</a-button>
<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>
<a-button type="primary" @click="handleMediaSyncAllPlat" v-show="opeType == 'editMedia'">同步</a-button>
</template>
<a-spin :spinning="loading">
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false" :mainOrgCode="mainOrgCode"></ConfigServiceDirectiveForm>
</a-spin>
</j-modal> -->
<a-drawer :title="title" width="80vw" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancel"
:bodyStyle="{ background: 'linear-gradient(135deg, #f1f7ff 0%, #f1f7ff 100%)',padding: '14px' }">
:bodyStyle="{ background: 'linear-gradient(135deg, #f1f7ff 0%, #f1f7ff 100%)', padding: '14px' }">
<a-spin :spinning="loading">
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false" :mainOrgCode="mainOrgCode" :mediaApiAddress="mediaApiAddress" :opeType="opeType"
:isMain="isMain">
:formBpm="false" :mediaApiAddress="mediaApiAddress" :opeType="opeType">
</ConfigServiceDirectiveForm>
</a-spin>
<template #footer>
<a-button @click="handleCancel" style="margin-right: 8px;">关闭</a-button>
<a-button @click="handleOk" v-show="opeType == 'add' || opeType == 'edit' || opeType == 'editMedia'"
:loading="loading" style="margin-right: 8px;">确定</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>
<a-button type="primary" @click="handleMediaSyncAllPlat" v-show="opeType == 'editMedia'">同步</a-button> -->
</template>
</a-drawer>
<!-- <j-modal :title="'指令库'" :fullscreen="true" width="100vw" :visible="dmVisible" @cancel="handleCancelDM"
:maskClosable="false">
<template #footer>
<a-button @click="handleCancelDM">关闭</a-button>
<a-button @click="handlePullDM">镜像</a-button>
</template>
<DirectiveRespositoryList ref="dmRef" :mainOrgCode="mainOrgCode"></DirectiveRespositoryList>
</j-modal> -->
<a-drawer :title="'标准指令库'" width="80vw" v-model:visible="dmVisible" :closable="true"
:footer-style="{ textAlign: 'right' }" @close="handleCancelDM" :maskClosable="true">
<a-spin :spinning="loading">
<DirectiveRespositoryList ref="dmRef" :mainOrgCode="mainOrgCode"></DirectiveRespositoryList>
<DirectiveRespositoryList ref="dmRef"></DirectiveRespositoryList>
</a-spin>
<template #footer>
<a-button @click="handleCancelDM" style="margin-right: 8px;">关闭</a-button>
@ -63,7 +35,6 @@ import { saveOrUpdate, useOrStopCascade, queryById, syncDirective } from '../Con
import DirectiveRespositoryList from './DirectiveRespositoryList.vue'
import { clearCache } from '/@/utils/cache/cacheUtil'
const mainOrgCode = ref('')
const dmRef = ref()
const loading = ref(false)
const { createMessage, createConfirm } = useMessage();
@ -103,7 +74,6 @@ function add() {
function edit(record, editMedia = false, showMedia = true) {
title.value = disableSubmit.value ? '详情' : opeType.value == 'add' ? '新增' : '编辑';
visible.value = true;
mainOrgCode.value = record.orgCode_
nextTick(() => {
registerForm.value.edit(record, editMedia, showMedia, disableSubmit.value);
});
@ -145,27 +115,6 @@ function handleOk() {
registerForm.value.submitForm();
}
/**
* 暂存
*/
function handleSave() {
registerForm.value.submitForm();
}
/**
* 给审核对应的业务平台同步资源
*/
function handleMediaAsync() {
registerForm.value.syncMediaForBizFunc();
}
/**
* 给所有业务平台同步资源
*/
function handleMediaSyncAllPlat() {
registerForm.value.syncMediaForAllBizFunc();
}
/**
* form保存回调事件
*/
@ -207,13 +156,8 @@ function queryByIdFunc(id) {
})
}
function openDM(orgCode) {
function openDM() {
dmVisible.value = true
mainOrgCode.value = orgCode
nextTick(() => {
dmRef.value?.init()
})
}
function handlePullDM() {
@ -224,6 +168,11 @@ function handlePullDM() {
return
}
if (!dmRef.value.targetOrgCode) {
createMessage.warning('机构不存在')
return
}
createConfirm({
iconType: 'warning',
title: '镜像确认',
@ -231,8 +180,8 @@ function handlePullDM() {
okText: '确认',
cancelText: '取消',
onOk: () => {
syncDirective(mainOrgCode.value, { syncIds: selectedData.ids, })
createMessage.success('从标准指令库开始拉取')
syncDirective(dmRef.value.targetOrgCode, { syncIds: selectedData.ids, })
createMessage.success('指令拉取请1分钟后重新查看')
// dmRef.value?.init()
handleCancelDM()
}

View File

@ -1,96 +1,99 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol" style="padding-top: 20px;">
<a-row :gutter="24">
<a-col :lg="5">
<a-form-item name="instructionTagId">
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag v-model:value="queryParam.instructionTagId" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol" style="padding-top: 20px;">
<a-row :gutter="24">
<a-col :lg="5">
<a-form-item name="targetOrgCode">
<template #label><span title="镜像码">镜像码</span></template>
<JInput v-model:value="targetOrgCodeSV" placeholder="请输入镜像码" allowClear />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="categoryId">
<template #label><span title="服务类别">服务类别</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 'Y' and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="typeId">
<template #label><span title="服务类型">服务类型</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 'Y' and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="directiveName">
<template #label><span title="服务指令">服务指令</span></template>
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令名称" allowClear />
</a-form-item>
</a-col>
<!-- <a-col :lg="6">
<a-form-item name="bodyTags">
<template #label><span title="体型标签">体型标签</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.bodyTags" :orgCode="mainOrgCode"
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = '0' and iz_enabled = 'Y' order by sort asc`"
:ignoreDisabled="true" placeholder="请选择体型标签" allowClear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="emotionTags">
<template #label><span title="情绪标签">情绪标签</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.emotionTags" :orgCode="mainOrgCode"
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = '0' and iz_enabled = 'Y' order by sort asc`"
:ignoreDisabled="true" placeholder="请选择情绪标签" allowClear />
</a-form-item>
</a-col> -->
<!-- <a-col :lg="6">
<a-form-item name="izEnabled">
<template #label><span title="是否启用">是否启用</span></template>
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
</a-form-item>
</a-col> -->
<a-col :span="2">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
<!-- 表单区域 -->
<ConfigServiceDirectiveModal ref="registerModal" :mediaApiAddress="mediaApiAddress" @success="handleSuccess"
:mainOrgCode="mainOrgCode">
</ConfigServiceDirectiveModal>
<a-col :span="2">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchOrgCode">查询</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-spin :spinning="!targetOrgCode">
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol" style="padding-top: 20px;">
<a-row :gutter="24">
<a-col :lg="5">
<a-form-item name="instructionTagId">
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag v-model:value="queryParam.instructionTagId" :orgCode="targetOrgCode"
v-if="!!targetOrgCode"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="categoryId">
<template #label><span title="服务类别">服务类别</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId" :orgCode="targetOrgCode"
v-if="!!targetOrgCode"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 'Y' and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="typeId">
<template #label><span title="服务类型">服务类型</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId" :orgCode="targetOrgCode"
v-if="!!targetOrgCode"
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 'Y' and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="5">
<a-form-item name="directiveName">
<template #label><span title="服务指令">服务指令</span></template>
<JInput v-model:value="queryParam.directiveName" placeholder="请输入服务指令名称" allowClear />
</a-form-item>
</a-col>
<a-col :span="2">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
<!-- 表单区域 -->
<ConfigServiceDirectiveModal ref="registerModal" :mediaApiAddress="mediaApiAddress" @success="handleSuccess"
:targetOrgCode="targetOrgCode">
</ConfigServiceDirectiveModal>
</div>
</a-spin>
</template>
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
@ -98,16 +101,18 @@ import { ref, reactive, watch, onMounted, computed } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
import { listByDS, idListByDS, deleteOne, batchDelete, getImportUrl, getExportUrl, tree } from '../ConfigServiceDirective.api';
import { listByDS, idListByDS, deleteOne, batchDelete, getImportUrl, getExportUrl, tree, getOrgCodeBySyncCode } from '../ConfigServiceDirective.api';
import ConfigServiceDirectiveModal from './ConfigServiceDirectiveModal.vue'
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { cloneDeep } from "lodash-es";
import { getOrgInfo, getMediaUrlByOrgCode } from '@/api/common/api'
import { useMessage } from '/@/hooks/web/useMessage';
const props = defineProps({
mainOrgCode: '',
});
const { createMessage, createConfirm } = useMessage();
const directiveSyncCode = ref('')//
const targetOrgCode = ref('')//
const targetOrgCodeSV = ref()
const mediaApiAddress = ref()//
const orgName = ref('')
const formRef = ref();
@ -155,7 +160,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
},
beforeFetch: async (params) => {
let rangerQuery = await setRangeQuery();
params.dataSourceCode = props.mainOrgCode
params.dataSourceCode = targetOrgCode.value
if (excludeIds.value.length) {
params.excludeIds = excludeIds.value.join(',')
}
@ -194,7 +199,7 @@ const wrapperCol = reactive({
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.opeType = 'dmlook';
record.orgCode_ = props.mainOrgCode
record.orgCode_ = targetOrgCode.value
registerModal.value.edit(record, false, true);
}
@ -322,19 +327,30 @@ function getSelectedIds() {
return { ids, count }; // ID
}
async function searchOrgCode() {
let res = await getOrgCodeBySyncCode({ 'syncCode': targetOrgCodeSV.value })
if (!res.result || res.result == -1) {
createMessage.error('镜像码错误');
} else {
targetOrgCode.value = res.result
init()
}
}
//
onMounted(() => {
getOrgInfo().then(res => {
orgName.value = res.orgName
})
getMediaUrlByOrgCode({ orgCode: props.mainOrgCode }).then(res => {
getMediaUrlByOrgCode({ orgCode: '1' }).then(res => {
mediaApiAddress.value = res.mediaUrl
})
});
defineExpose({
getSelectedIds,
init
init,
targetOrgCode,
});
</script>