服务指令同步(临时提交)

This commit is contained in:
1378012178@qq.com 2025-07-24 14:21:05 +08:00
parent 7545b0174c
commit c67b40acca
4 changed files with 115 additions and 44 deletions

View File

@ -3,7 +3,7 @@
<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"
style="padding: 8px;">
<a-card :class="{ 'selected-card': selectedOrgCodes.includes(item.orgCode) }"
<a-card :class="{ 'selected-card': selectedOrgCodes.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)">
@ -13,8 +13,8 @@
<div>
<span style="font-weight: bold;">{{ item.departName }}</span>
<!-- 如果是已选择显示"已选择" -->
<span v-if="selectedOrgCodes.includes(item.orgCode)"
style="color: green; font-size: 12px; margin-left: 8px;">已选择</span>
<span style="color: green; font-size: 12px; margin-left: 8px;"
v-if="selectedOrgCodes.some(org => org.orgCode === item.orgCode)">已选择</span>
</div>
</a-col>
<a-col :span="2" style="text-align: center; padding-top: 4px;">
@ -82,16 +82,16 @@ function handleCardClick(item: any) {
if (props.showChoose) { //
if (props.allowMultipleSelection) {
//
if (selectedOrgCodes.value.includes(item.orgCode)) {
selectedOrgCodes.value = selectedOrgCodes.value.filter(code => code !== item.orgCode)
if (selectedOrgCodes.value.some(selected => selected.orgCode === item.orgCode)) {
selectedOrgCodes.value = selectedOrgCodes.value.filter(selected => selected.orgCode !== item.orgCode)
} else {
selectedOrgCodes.value.push(item.orgCode)
selectedOrgCodes.value.push(item) //
}
} else {
//
selectedOrgCodes.value = [item.orgCode]
selectedOrgCodes.value = [item] //
}
emit('handleOrgChoose', selectedOrgCodes.value)
emit('handleOrgChoose', selectedOrgCodes.value) //
}
}

View File

@ -16,6 +16,7 @@ export const columns: BasicColumn[] = [
title: '服务类别',
align: 'center',
dataIndex: 'categoryId_dictText',
width: 100,
customCell: (record, index, column) => {
if (record.categoryRowSpan != null) {
return { rowSpan: record.categoryRowSpan };
@ -26,6 +27,7 @@ export const columns: BasicColumn[] = [
title: '服务类型',
align: 'center',
dataIndex: 'typeId_dictText',
width: 100,
customCell: (record, index, column) => {
if (record.typeRowSpan != null) {
return { rowSpan: record.typeRowSpan };
@ -98,18 +100,19 @@ export const columns: BasicColumn[] = [
title: '周期类型',
align: 'center',
dataIndex: 'cycleType_dictText',
width: 100,
},
{
title: '服务时长(分钟)',
align: 'center',
dataIndex: 'serviceDuration',
width: 135,
width: 80,
},
{
title: '是否启用',
align: 'center',
dataIndex: 'izEnabled_dictText',
width: 100,
width: 80,
},
];

View File

@ -8,24 +8,27 @@
<a-col :lg="6">
<a-form-item name="instructionTagId">
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag v-model:value="queryParam.instructionTagId" dictCode="instruction_tag"
:ignoreDisabled="true" placeholder="请选分类标签" allowClear />
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
: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>
</a-col>
<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"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 order by sort asc`"
:ignoreDisabled="true" placeholder="请选择服务类别" allow-clear />
: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>
</a-col>
<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"
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = ${queryParam.categoryId || -1} order by sort asc`"
placeholder="请选择服务类型" :ignoreDisabled="true" allowClear />
: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>
</a-col>
<a-col :lg="6">
@ -54,22 +57,21 @@
<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 />
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear @select="reload()" />
</a-form-item>
</a-col>
<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>
</a-row>
</a-form>
</div>
<!-- 新增按钮行 -->
<a-row :gutter="24" style="margin-top: -10px;padding-left: 20px;padding-right: 20px;">
<a-col :lg="3" :push="21">
<a-button type="primary" @click="selectAll">一键全选</a-button>
@ -79,7 +81,11 @@
<a-row :gutter="24" style="padding-left: 20px;padding-right: 20px;">
<a-col :lg="12" :sm="24">
<!-- 引用表格 -->
<a-tag color="blue" style="margin-left: 10px;margin-top: 10px;">源数据</a-tag>
<a-tag color="blue" style="margin-left: 10px;margin-top: 10px;">源数据 - {{ sourceOrgInfo.departName }}</a-tag>
<a-radio-group v-model:value="sourceType" size="small" @change="sourceTypeChanged">
<a-radio-button value="all">全部</a-radio-button>
<a-radio-button value="unsel">未选择</a-radio-button>
</a-radio-group>
<BasicTable @register="registerTable" :dataSource="leftList" size="small" :rowClassName="rowClassName"
:scroll="{ y: '46vh' }">
<template #tableTitle></template>
@ -102,7 +108,8 @@
</a-col>
<a-col :lg="12" :sm="24">
<a-tag color="green" style="margin-left: 10px;margin-top: 10px;">已选择 {{ rightList.length }} </a-tag>
<BasicTable :dataSource="rightList" :columns="columns" size="small" :scroll="{ y: '46vh' }">
<BasicTable :dataSource="rightList" :columns="columns" size="small" :scroll="{ y: '46vh' }"
:pagination="{ current: 1, pageSize: 50, total: rightList.length, showSizeChanger: true, pageSizeOptions: ['10', '20', '50', '100'] }">
</BasicTable>
</a-col>
</a-row>
@ -111,7 +118,7 @@
</template>
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
import { ref, reactive, onMounted } from 'vue';
import { ref, reactive, onMounted, watch } from 'vue';
import { BasicTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceDirective.data';
@ -124,6 +131,8 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
const leftList = ref<any[]>([]); //
const rightList = ref<any[]>([]); //
const sourceOrgInfo = ref({})//
const sourceType = ref('all')
const selectedRecordIds = ref<string[]>([]); // ID
const formRef = ref();
const queryParam = reactive<any>({});
@ -185,7 +194,17 @@ function searchReset() {
}
function init(record) {
queryParam.dataSourceCode = record.orgCode;
sourceOrgInfo.value = record.orgInfo
//
{
rightList.value = []
leftList.value = []
selectedRecordIds.value = []
formRef.value.resetFields();
selectedRowKeys.value = [];
sourceType.value = 'all'
}
queryParam.dataSourceCode = record.orgInfo.orgCode;
reload();
}
@ -221,18 +240,22 @@ function rowClassName(record: any) {
*/
function selectAll() {
listByDS({
dataSourceCode: queryParam.dataSourceCode,
...queryParam,
pageNo: 1,
pageSize: -1,
instructionTagId: queryParam.instructionTagId,
categoryId: queryParam.categoryId,
typeId: queryParam.typeId,
directiveName: queryParam.directiveName,
izEnabled: queryParam.izEnabled
}).then(res => {
rightList.value = [...res.records]; //
leftList.value = [];
const allRecords = res.records || [];
//
const unselectedRecords = allRecords.filter(record => !selectedRecordIds.value.includes(record.id));
if (unselectedRecords.length) {
//
rightList.value.push(...unselectedRecords);
// id id
selectedRecordIds.value.push(...unselectedRecords.map(r => r.id));
//
rightList.value = [...rightList.value];
selectedRecordIds.value = [...selectedRecordIds.value];
}
})
}
@ -240,12 +263,31 @@ function selectAll() {
* 全部移除将右侧数据移回左侧
*/
function removeAll() {
leftList.value = [...rightList.value]; //
rightList.value = []; //
selectedRecordIds.value = []
}
function sourceTypeChanged(val_) {
if (val_.target.value == 'all') {
//
queryParam.excludeIds = null
} else {
//
queryParam.excludeIds = selectedRecordIds.value.join(',')
}
reload()
}
watch(
() => queryParam.directiveName,
(newVal) => {
reload()
}
);
defineExpose({
init,
rightList,
});
</script>

View File

@ -34,38 +34,54 @@
<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>操作指引</span>
<span>操作指引1如何选择将需要同步的服务指令通过选择一键全选按钮添加至右侧已选择列表中,如需移除请点击移除全部移除按钮2搜索区域可对左侧列表进行筛选3左侧列表上方全部/未选择可快速切换源数据列表便于更清晰的查看需要处理的服务指令</span>
</div>
<DirectiveChooseCom ref="directiveChooseRef"></DirectiveChooseCom>
</div>
<!-- 第四步选择目标机构 -->
<div v-show="stepVal === 3">
<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操作指引①选择点击需要同步的业务机构卡片选中目标平台②编辑点击页面右下角的下一步进入指令编辑页面编辑同步内容2详情按钮可查看对应平台现有服务指令</span>
<span>1操作指引1如果选择在右侧卡片中通过点击卡片选择需要同步指令的目标平台可多选2左侧列表为待同步服务指令3点击右下方确认按钮开始自动同步同步只会将对应平台未有指令进行新增不会改变其原有指令字段</span>
</div>
<OrgListCom class="step-content" ref="orgListComRef" :allowMultipleSelection="true" :showChoose="true"
@handleOrgDetail="handleDetail" @handleOrgChoose="orgTargetChangedFunc" />
<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' }"
: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"
@handleOrgDetail="handleDetail" @handleOrgChoose="orgTargetChangedFunc" />
</a-col>
</a-row>
</div>
<ConfigServiceDirectiveListModal class="step-content" ref="configServiceDirectiveListModal" />
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { ref, watch, toRaw } from 'vue';
import { InfoCircleOutlined } from '@ant-design/icons-vue';
import OrgListCom from '/@/views/synchronization/directive/orgCom/OrgListCom.vue';
import ConfigServiceDirectiveListModal from '/@/views/synchronization/directive/serviceDirective/ConfigServiceDirectiveListModal.vue';
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';
const stepVal = ref(0);
const configServiceDirectiveListModal = ref();
const orgInfo = ref([])
const { createMessage } = useMessage();
const directiveChooseRef = ref()
const leftList = ref<any[]>([]);
function init(record: any) {
console.log('init:', record);
}
function handleDetail(record: any) {
@ -79,6 +95,16 @@ function changeStepVal(isAdd) {
createMessage.warning('请选择源数据机构!');
return
}
if (stepVal.value == 2) {
if (toRaw(directiveChooseRef.value?.rightList).length == 0) {
createMessage.warning('请选择服务指令!');
return
} else {
leftList.value = [...directiveChooseRef.value?.rightList];
}
}
stepVal.value = stepVal.value + 1
} else {
stepVal.value = stepVal.value - 1
@ -96,9 +122,9 @@ function orgTargetChangedFunc(orgInfo_) {
watch(
() => stepVal.value,
(newstepVal) => {
if (newstepVal == 2) {
directiveChooseRef?.value?.init({ orgCode: orgInfo.value[0] })
(newstepVal, oldValue) => {
if (newstepVal == 2 && oldValue == 1) {
directiveChooseRef?.value?.init({ orgInfo: orgInfo.value[0] })
}
}
);