指令同步(临时版)

This commit is contained in:
1378012178@qq.com 2025-07-24 15:38:03 +08:00
parent 00c55e83be
commit 09ffd9c027
3 changed files with 95 additions and 38 deletions

View File

@ -1,23 +1,24 @@
<template>
<div class="p-2">
<a-row>
<a-col v-for="item in orgTableList.records" :key="item.id" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6"
<a-row :style="props.layout === 'half' ? { height: '68vh', overflow: 'auto' } : {}">
<a-col v-for="item in orgTableList.records" :key="item.id" :xs="24" :sm="24" :md="props.layout == 'full' ? 12 : 8"
:lg="props.layout == 'full' ? 12 : 8" :xl="props.layout == 'full' ? 8 : 8" :xxl="props.layout == 'full' ? 6 : 8"
style="padding: 8px;">
<a-card :class="{ 'selected-card': selectedOrgCodes.some(org => org.orgCode === item.orgCode) }"
<a-card :class="{ 'selected-card': selectedOrgs.some(org => org.orgCode === item.orgCode) }"
style="width: 100%; border-radius: 8px; " :headStyle="{ height: '60px', padding: '0 24px' }"
:style="{ cursor: showChoose ? 'pointer' : 'default' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }"
@click="handleCardClick(item)">
<template #title>
<a-row style="font-weight: normal;">
<a-col :span="22" style="font-size: 14px; padding-top: 4px;">
<a-col :span="props.layout == 'full' ? 22 : 21" style="font-size: 14px; padding-top: 4px;">
<div>
<span style="font-weight: bold;">{{ item.departName }}</span>
<!-- 如果是已选择显示"已选择" -->
<span style="color: green; font-size: 12px; margin-left: 8px;"
v-if="selectedOrgCodes.some(org => org.orgCode === item.orgCode)">已选择</span>
v-if="selectedOrgs.some(org => org.orgCode === item.orgCode)">已选择</span>
</div>
</a-col>
<a-col :span="2" style="text-align: center; padding-top: 4px;">
<a-col :span="props.layout == 'full' ? 2 : 3" style="text-align: center; padding-top: 4px;">
<div class="zxClass">{{ item.orgCode }}</div>
</a-col>
</a-row>
@ -41,7 +42,7 @@
</p>
</a-card>
</a-col>
<a-col v-if="orgTableList.total == 0">
<a-col v-if="orgTableList.length == 0">
<div style="margin: 30px auto;">
<a-empty />
</div>
@ -49,7 +50,8 @@
</a-row>
<div
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;"
v-show="props.layout == 'full'">
<span style="margin-right: 10px;"> {{ orgTableList.total }} 条数据</span>
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
show-quick-jumper :total="orgTableList.total" @change="reload" />
@ -65,7 +67,8 @@ import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api'
const props = defineProps({
showChoose: { type: Boolean, default: false },
title: { type: String, default: '' },
allowMultipleSelection: { type: Boolean, default: false }, //
allowMultipleSelection: { type: Boolean, default: false }, //
layout: { type: String, default: 'full' }, // : 'full' 'half'
})
const emit = defineEmits(['handleOrgDetail', 'handleOrgChoose'])
@ -75,23 +78,23 @@ const queryParam = reactive<any>({})
const pageParams = ref({ pageNo: 1, pageSize: 8 })
// ID
const selectedOrgCodes = ref<string[]>([])
const selectedOrgs = ref<string[]>([])
/** 点击卡片选择 */
function handleCardClick(item: any) {
if (props.showChoose) { //
if (props.allowMultipleSelection) {
//
if (selectedOrgCodes.value.some(selected => selected.orgCode === item.orgCode)) {
selectedOrgCodes.value = selectedOrgCodes.value.filter(selected => selected.orgCode !== item.orgCode)
if (selectedOrgs.value.some(selected => selected.orgCode === item.orgCode)) {
selectedOrgs.value = selectedOrgs.value.filter(selected => selected.orgCode !== item.orgCode)
} else {
selectedOrgCodes.value.push(item) //
selectedOrgs.value.push(item) //
}
} else {
//
selectedOrgCodes.value = [item] //
selectedOrgs.value = [item] //
}
emit('handleOrgChoose', selectedOrgCodes.value) //
emit('handleOrgChoose', selectedOrgs.value) //
}
}
@ -105,6 +108,9 @@ function reload() {
queryParam.pageSize = pageParams.value.pageSize
queryParam.pageNo = pageParams.value.pageNo
queryParam.title = props.title
if (props.layout == 'half') {
queryParam.pageSize = -1
}
getOrgInfo(queryParam).then(res => {
orgTableList.value = res
})
@ -113,11 +119,33 @@ function reload() {
/** 重置搜索条件 */
function searchReset() {
queryParam.title = null
if (props.layout == 'half') {
queryParam.pageSize = -1
}
getOrgInfo(queryParam).then(res => {
orgTableList.value = res
})
}
//
function checkAllOrEmpty(isCheckAll = true) {
if (isCheckAll) {
//
orgTableList.value.records.forEach(item => {
// selectedOrgs
if (!selectedOrgs.value.some(selected => selected.orgCode === item.orgCode)) {
selectedOrgs.value.push(item);
}
});
} else {
// selectedOrgs
selectedOrgs.value = [];
}
// handleOrgChoose
emit('handleOrgChoose', selectedOrgs.value);
}
//
onMounted(() => {
reload()
@ -125,7 +153,9 @@ onMounted(() => {
defineExpose({
reload,
searchReset
searchReset,
selectedOrgs,
checkAllOrEmpty,
})
</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="功能说明" />
<a-step title="选择源数据业务平台" />
<a-step title="选择服务指令" />
<a-step title="选择目标业务平台" />
<a-step title="功能说明" disabled/>
<a-step title="选择源数据业务平台" disabled/>
<a-step title="选择服务指令" disabled/>
<a-step title="选择目标业务平台" disabled/>
</a-steps>
</div>
@ -17,7 +17,7 @@
<li><b>作用</b>服务指令分发至业务平台</li>
<li><b>流程</b>选择源数据业务平台 选择服务指令 选择目标业务平台</li>
<li><b>确认</b>点击右下角确认按钮开始自动同步</li>
<li><b>注意</b>如有不熟悉功能按键可在对应界面上方查看操作指引</li>
<li><b>注意</b>如有不熟悉功能按键可在对应界面上方查看操作指引</li>
</ul>
</div>
</div>
@ -25,7 +25,7 @@
<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>操作指引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 +34,7 @@
<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>操作指引1如何选择将需要同步的服务指令通过选择一键全选按钮添加至右侧已选择列表中,如需移除请点击移除全部移除按钮2搜索区域可对左侧列表进行筛选3左侧列表上方全部/未选择可快速切换源数据列表便于更清晰的查看需要处理的服务指令</span>
<span style="padding-right: 60px;">操作指引1如何选择服务指令将需要同步的服务指令通过选择一键全选按钮添加至右侧已选择列表中,如需移除请点击移除全部移除按钮2搜索区域可对左侧列表进行筛选3左侧列表上方全部/未选择可快速切换源数据列表便于更清晰的查看需要处理的服务指令</span>
</div>
<DirectiveChooseCom ref="directiveChooseRef"></DirectiveChooseCom>
</div>
@ -42,20 +42,33 @@
<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>1操作指引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">
<!-- 引用表格 -->
<a-tag color="green" style="margin-left: 10px;margin-top: 10px;">已选择 {{ leftList?.length }} </a-tag>
<BasicTable :dataSource="leftList" :columns="columns" size="small" :scroll="{ y: '63vh' }"
<a-tag color="green" style="margin-left: 10px;margin-top: 10px;">待同步 {{ leftList?.length }} </a-tag>
<BasicTable :dataSource="leftList" :columns="columns" size="small" :scroll="{ y: '61vh' }"
:showIndexColumn="false"
:pagination="{ current: 1, pageSize: 50, total: leftList.length, showSizeChanger: true, pageSizeOptions: ['10', '20', '50', '100'] }">
</BasicTable>
</a-col>
<a-col :lg="12" :sm="24">
<a-tag color="green" style="margin-left: 10px;margin-top: 10px;">目标平台 - 已选择 3 </a-tag>
<OrgListCom class="step-content" ref="orgListComRef" :allowMultipleSelection="true" :showChoose="true"
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 10px;">
<!-- 目标平台标签保持在当前位置 -->
<a-tag color="orange" style="margin-left: 20px;">
目标平台 - 已选择 {{ targetOrgListComRef?.selectedOrgs?.length }}
</a-tag>
<!-- 两个按钮靠右显示 -->
<div style="margin-right: 30px;">
<a-button type="primary" size="small" style="margin-left: 10px;"
@click="targetOrgListComRef?.checkAllOrEmpty(true)">全选</a-button>
<a-button type="primary" size="small" style="margin-left: 10px;"
@click="targetOrgListComRef?.checkAllOrEmpty(false)">清空</a-button>
</div>
</div>
<OrgListCom ref="targetOrgListComRef" :layout="'half'" :allowMultipleSelection="true" :showChoose="true"
@handleOrgDetail="handleDetail" @handleOrgChoose="orgTargetChangedFunc" />
</a-col>
</a-row>
@ -71,14 +84,16 @@ import ConfigServiceDirectiveListModal from '/@/views/synchronization/directive/
import DirectiveChooseCom from '/@/views/synchronization/directive/serviceDirective/DirectiveChooseCom.vue'
import { useMessage } from '/@/hooks/web/useMessage';
import { columns } from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirective.data';
import { BasicTable, TableAction } from '/@/components/Table';
import { BasicTable } from '/@/components/Table';
const emit = defineEmits(['closeModal']);
const stepVal = ref(0);
const configServiceDirectiveListModal = ref();
const orgInfo = ref([])
const { createMessage } = useMessage();
const directiveChooseRef = ref()
const leftList = ref<any[]>([]);
const targetOrgListComRef = ref()
function init(record: any) {
@ -126,13 +141,27 @@ watch(
if (newstepVal == 2 && oldValue == 1) {
directiveChooseRef?.value?.init({ orgInfo: orgInfo.value[0] })
}
if (newstepVal == 3) {
targetOrgListComRef.value?.checkAllOrEmpty(false)
}
}
);
//
function syncFunc() {
if (!targetOrgListComRef.value?.selectedOrgs?.length) {
createMessage.warning('请选择业务平台')
} else {
createMessage.success('已开始自动同步')
emit('closeModal')
}
}
defineExpose({
init,
stepVal,
changeStepVal,
syncFunc,
});
</script>

View File

@ -7,10 +7,11 @@
v-show="!!registerForm && (registerForm?.stepVal == 1 || registerForm?.stepVal == 2 || registerForm?.stepVal == 3)">上一步</a-button>
<a-button @click="nextStep"
v-show="!!registerForm && (registerForm?.stepVal == 0 || registerForm?.stepVal == 1 || registerForm?.stepVal == 2)">下一步</a-button>
<a-button type="primary" @click="handleOk" v-show="!!registerForm && registerForm?.stepVal == 3">确认</a-button>
<a-button @click="registerForm?.syncFunc" type="primary"
v-show="!!registerForm && registerForm?.stepVal == 3">确认</a-button>
</template>
<SyncStepList ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"
:fullscreen="true" style="height:100vh;" />
:fullscreen="true" style="height:100vh;" @closeModal="closeModal" />
</j-modal>
</template>
@ -40,13 +41,6 @@ function init(record: any) {
});
}
/**
* 点击确定触发表单提交
*/
function handleOk() {
//
}
/**
* 子组件提交完成回调
*/
@ -76,6 +70,10 @@ function handleCancel() {
visible.value = false;
}
function closeModal() {
visible.value = false;
}
defineExpose({
init,
disableSubmit,