调整指令同步功能
This commit is contained in:
parent
09ffd9c027
commit
a8bae46128
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
};
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue