调整指令同步功能

This commit is contained in:
1378012178@qq.com 2025-07-25 15:10:12 +08:00
parent 09ffd9c027
commit a8bae46128
4 changed files with 55 additions and 16 deletions

View File

@ -69,6 +69,7 @@ const props = defineProps({
title: { type: String, default: '' },
allowMultipleSelection: { type: Boolean, default: false }, //
layout: { type: String, default: 'full' }, // : 'full' 'half'
excludeOrgCode: { type: String, default: '' }//
})
const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
@ -112,6 +113,7 @@ function reload() {
queryParam.pageSize = -1
}
getOrgInfo(queryParam).then(res => {
res.records = res.records.filter(o => o.orgCode != props.excludeOrgCode)
orgTableList.value = res
})
}
@ -123,6 +125,7 @@ function searchReset() {
queryParam.pageSize = -1
}
getOrgInfo(queryParam).then(res => {
res.records = res.records.filter(o => o.orgCode != props.excludeOrgCode)
orgTableList.value = res
})
}

View File

@ -7,6 +7,7 @@ enum Api {
list = '/services/serviceDirective/list',
listByDS = '/services/serviceDirective/listByDS',
queryById = '/services/serviceDirective/queryById',
syncDirective = '/services/serviceDirective/syncDirective',
}
/**
@ -20,4 +21,13 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
* -
* @param params
*/
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, params });
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, params });
/**
*
* @param params
* @returns
*/
export const syncDirective = (params) => {
return defHttp.get({ url: Api.syncDirective, params });
};

View File

@ -8,7 +8,8 @@
<a-col :lg="6">
<a-form-item name="instructionTagId">
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
<j-dict-select-tag v-model:value="queryParam.instructionTagId" v-if="showJSCom"
:orgCode="sourceOrgInfo?.orgCode"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @select="reload()" />
</a-form-item>
@ -17,7 +18,8 @@
<a-col :lg="6">
<a-form-item name="categoryId">
<template #label><span title="服务类别">服务类别</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId" v-if="showJSCom"
:orgCode="sourceOrgInfo?.orgCode"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" @select="reload()" />
</a-form-item>
@ -26,7 +28,8 @@
<a-col :lg="6">
<a-form-item name="typeId">
<template #label><span title="服务类型">服务类型</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.typeId"
<j-dict-select-tag type="list" v-model:value="queryParam.typeId" v-if="showJSCom"
:orgCode="sourceOrgInfo?.orgCode"
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" @select="reload()" />
</a-form-item>
@ -63,9 +66,9 @@
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<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:search-outlined" @click="searchQuery">查询</a-button> -->
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button> -->
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
@ -133,6 +136,7 @@ const leftList = ref<any[]>([]); // 左侧列表的数据
const rightList = ref<any[]>([]); //
const sourceOrgInfo = ref({})//
const sourceType = ref('all')
const showJSCom = ref(false)
const selectedRecordIds = ref<string[]>([]); // ID
const formRef = ref();
const queryParam = reactive<any>({});
@ -285,9 +289,17 @@ watch(
}
);
function controlShowJSCom() {
showJSCom.value = false
setTimeout(() => {
showJSCom.value = true
}, 1000)
}
defineExpose({
init,
rightList,
controlShowJSCom,
});
</script>

View File

@ -1,10 +1,10 @@
<template>
<div class="p-2" style="padding: 10px;">
<a-steps v-model:current="stepVal" size="small" style="margin: 0; width: 95%; margin: 0 auto;">
<a-step title="功能说明" disabled/>
<a-step title="选择源数据业务平台" disabled/>
<a-step title="选择服务指令" disabled/>
<a-step title="选择目标业务平台" disabled/>
<a-step title="功能说明" disabled />
<a-step title="选择源数据业务平台" disabled />
<a-step title="选择服务指令" disabled />
<a-step title="选择目标业务平台" disabled />
</a-steps>
</div>
@ -25,7 +25,8 @@
<div v-show="stepVal === 1">
<div style="margin: 10px 0 16px 100px; display: flex; align-items: center; font-size: 16px; color: #8B0000;">
<InfoCircleOutlined style="color: #1890ff; margin-right: 6px;" />
<span style="padding-right: 60px;">操作指引1如何选择源数据平台点击对应机构卡片即可2如何进入服务指令选择页面请点击页面右下方下一步按钮3详情按钮查看对应平台现有服务指令</span>
<span
style="padding-right: 60px;">操作指引1如何选择源数据平台点击对应机构卡片即可2如何进入服务指令选择页面请点击页面右下方下一步按钮3详情按钮查看对应平台现有服务指令</span>
</div>
<OrgListCom class="step-content" ref="orgListComRef" :showChoose="true" @handleOrgDetail="handleDetail"
@handleOrgChoose="orgSourceChangedFunc" />
@ -34,7 +35,8 @@
<div v-show="stepVal === 2">
<div style="margin: 10px 0 16px 100px; display: flex; align-items: center; font-size: 16px; color: #8B0000;">
<InfoCircleOutlined style="color: #1890ff; margin-right: 6px;" />
<span style="padding-right: 60px;">操作指引1如何选择服务指令将需要同步的服务指令通过选择一键全选按钮添加至右侧已选择列表中,如需移除请点击移除全部移除按钮2搜索区域可对左侧列表进行筛选3左侧列表上方全部/未选择可快速切换源数据列表便于更清晰的查看需要处理的服务指令</span>
<span
style="padding-right: 60px;">操作指引1如何选择服务指令将需要同步的服务指令通过选择一键全选按钮添加至右侧已选择列表中,如需移除请点击移除全部移除按钮2搜索区域可对左侧列表进行筛选3左侧列表上方全部/未选择可快速切换源数据列表便于更清晰的查看需要处理的服务指令</span>
</div>
<DirectiveChooseCom ref="directiveChooseRef"></DirectiveChooseCom>
</div>
@ -42,7 +44,8 @@
<div v-show="stepVal === 3" style="overflow-x: hidden;">
<div style="margin: 10px 0 16px 100px; display: flex; align-items: center; font-size: 16px; color: #8B0000;">
<InfoCircleOutlined style="color: #1890ff; margin-right: 6px;" />
<span style="padding-right: 60px;">操作指引1如何选择目标业务平台在右侧卡片中通过点击卡片方式选择需要同步指令的目标平台可多选也可通过全选/清空功能按钮进行快捷操作2左侧列表为待同步服务指令3点击右下方确认按钮开始自动同步同步只会将对应平台未有指令进行新增不会改变其原有指令字段</span>
<span
style="padding-right: 60px;">操作指引1如何选择目标业务平台在右侧卡片中通过点击卡片方式选择需要同步指令的目标平台可多选也可通过全选/清空功能按钮进行快捷操作2左侧列表为待同步服务指令3点击右下方确认按钮开始自动同步同步只会将对应平台未有指令进行新增不会改变其原有指令字段</span>
</div>
<a-row :gutter="24" style="padding-left: 20px;padding-right: 20px;">
<a-col :lg="12" :sm="24">
@ -68,8 +71,9 @@
@click="targetOrgListComRef?.checkAllOrEmpty(false)">清空</a-button>
</div>
</div>
<OrgListCom ref="targetOrgListComRef" :layout="'half'" :allowMultipleSelection="true" :showChoose="true"
@handleOrgDetail="handleDetail" @handleOrgChoose="orgTargetChangedFunc" />
<OrgListCom ref="targetOrgListComRef" :layout="'half'" :excludeOrgCode="orgInfo[0]?.orgCode"
:allowMultipleSelection="true" :showChoose="true" @handleOrgDetail="handleDetail"
@handleOrgChoose="orgTargetChangedFunc" />
</a-col>
</a-row>
</div>
@ -85,6 +89,7 @@ import DirectiveChooseCom from '/@/views/synchronization/directive/serviceDirect
import { useMessage } from '/@/hooks/web/useMessage';
import { columns } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.data';
import { BasicTable } from '/@/components/Table';
import { syncDirective } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.api';
const emit = defineEmits(['closeModal']);
const stepVal = ref(0);
@ -94,6 +99,7 @@ const { createMessage } = useMessage();
const directiveChooseRef = ref()
const leftList = ref<any[]>([]);
const targetOrgListComRef = ref()
const syncOrgs = ref([])
function init(record: any) {
@ -129,16 +135,19 @@ function changeStepVal(isAdd) {
///
function orgSourceChangedFunc(orgInfo_) {
orgInfo.value = orgInfo_
directiveChooseRef.value?.controlShowJSCom()
}
///
function orgTargetChangedFunc(orgInfo_) {
syncOrgs.value = orgInfo_
}
watch(
() => stepVal.value,
(newstepVal, oldValue) => {
if (newstepVal == 2 && oldValue == 1) {
targetOrgListComRef.value?.reload()
directiveChooseRef?.value?.init({ orgInfo: orgInfo.value[0] })
}
if (newstepVal == 3) {
@ -152,6 +161,11 @@ function syncFunc() {
if (!targetOrgListComRef.value?.selectedOrgs?.length) {
createMessage.warning('请选择业务平台')
} else {
syncDirective({
dataSourceCode: orgInfo.value[0].orgCode,
syncIds: leftList.value.map(d => d.id).join(','),
syncOrgCodes: syncOrgs.value.map(o => o.orgCode).join(','),
})
createMessage.success('已开始自动同步')
emit('closeModal')
}