This commit is contained in:
yangjun 2025-08-04 15:17:00 +08:00
commit 5e29db84a2
14 changed files with 765 additions and 70 deletions

View File

@ -2,7 +2,7 @@
VITE_USE_MOCK = false
# 发布路径
VITE_PUBLIC_PATH = /biz101
VITE_PUBLIC_PATH = /biz103
# 是否启用gzip或brotli压缩
# 选项值: gzip | brotli | none
@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
#后台接口父地址(必填)
VITE_GLOB_API_URL=/nursingunit101
VITE_GLOB_API_URL=/nursingunit103
#后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit101
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit103
# 接口父路径前缀
VITE_GLOB_API_URL_PREFIX=

View File

@ -16,7 +16,7 @@ enum Api {
getTableList = '/sys/user/queryUserComponentData',
getCategoryData = '/sys/category/loadAllData',
getNuList = '/iot/tplink/cameraInfo/nuList',
getOrgName = '/sys/api/getOrgName',
getOrgInfo = '/sys/api/getOrgInfo',
}
/**
@ -89,6 +89,14 @@ export const loadDictItem = (params?) => {
export const getDictItems = (dictCode) => {
return defHttp.get({ url: Api.getDictItems + dictCode }, { joinTime: false });
};
/**
* code加载字典text
*/
export const getDictItemsByOrgCode = (dictCode, orgCode) => {
return defHttp.get({ url: Api.getDictItems + dictCode + '/' + orgCode }, { joinTime: false });
};
/**
* modal选择列表加载list
*/
@ -164,6 +172,6 @@ export const uploadMyFile = (url, data) => {
*
* @param params
*/
export const getOrgName = () => {
return defHttp.get({ url: Api.getOrgName });
export const getOrgInfo = () => {
return defHttp.get({ url: Api.getOrgInfo });
};

View File

@ -11,7 +11,7 @@
import { defineComponent, computed, watch, watchEffect, ref, unref } from 'vue';
import { propTypes } from '/@/utils/propTypes';
import { useAttrs } from '/@/hooks/core/useAttrs';
import { getDictItems } from "@/api/common/api";
import { getDictItems, getDictItemsByOrgCode } from "@/api/common/api";
export default defineComponent({
name: 'JCheckbox',
@ -23,6 +23,7 @@ export default defineComponent({
type: Array,
default: () => [],
},
orgCode: '',//
},
emits: ['change', 'update:value', 'upDictCode'],
setup(props, { emit }) {
@ -82,16 +83,27 @@ export default defineComponent({
temp = encodeURI(temp);
}
//update-end-author:taoyan date:2022-6-21 for:
getDictItems(temp).then((res) => {
if (res) {
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
//console.info('res', dictOptions.value);
emit('upDictCode', checkOptions.value)
} else {
console.error('getDictItems error: : ', res);
checkOptions.value = [];
}
});
if (!!props.orgCode) {
getDictItemsByOrgCode(temp, props.orgCode).then((res) => {
if (res) {
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
//console.info('res', dictOptions.value);
} else {
console.error('getDictItems error: : ', res);
checkOptions.value = [];
}
});
} else {
getDictItems(temp).then((res) => {
if (res) {
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
//console.info('res', dictOptions.value);
} else {
console.error('getDictItems error: : ', res);
checkOptions.value = [];
}
});
}
}
/**

View File

@ -77,6 +77,7 @@ export default defineComponent({
},
style: propTypes.any,
ignoreDisabled: propTypes.bool.def(false),
orgCode: '',//
},
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
setup(props, { emit, refs }) {
@ -127,7 +128,7 @@ export default defineComponent({
async function initDictData() {
let { dictCode, stringToNumber } = props;
//Code,
const dictData = await initDictOptions(dictCode);
const dictData = await initDictOptions(dictCode, props.orgCode);
dictOptions.value = dictData.reduce((prev, next) => {
if (next) {
const value = next['value'];

View File

@ -76,7 +76,7 @@ import LoginSelect from '/@/views/sys/login/LoginSelect.vue';
import { useUserStore } from '/@/store/modules/user';
import { useI18n } from '/@/hooks/web/useI18n';
import Aide from "@/views/dashboard/ai/components/aide/index.vue"
import { getOrgName } from '@/api/common/api'
import { getOrgInfo } from '@/api/common/api'
const { t } = useI18n();
export default defineComponent({
@ -187,7 +187,7 @@ export default defineComponent({
}
onMounted(() => {
getOrgName().then(res => {
getOrgInfo().then(res => {
orgName.value = res.orgName
})
showLoginSelect();

17
src/utils/cache/cacheUtil.ts vendored Normal file
View File

@ -0,0 +1,17 @@
import { refreshCache, queryAllDictItems } from '/@/views/system/dict/dict.api';
import { removeAuthCache, setAuthCache } from '/@/utils/auth';
import { DB_DICT_DATA_KEY } from '/@/enums/cacheEnum';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
//刷新缓存
export async function clearCache() {
const result = await refreshCache();
if (result.success) {
const res = await queryAllDictItems();
removeAuthCache(DB_DICT_DATA_KEY);
setAuthCache(DB_DICT_DATA_KEY, res.result);
userStore.setAllDictItems(res.result);
} else {
}
}

View File

@ -27,11 +27,12 @@ export const getDictItemsByCode = (code) => {
/**
*
* @param dictCode Code
* @param orgCode
* @return List<Map>
*/
export const initDictOptions = (code) => {
export const initDictOptions = (code, orgCode = '') => {
//1.优先从缓存中读取字典配置
if (getDictItemsByCode(code)) {
if (getDictItemsByCode(code) && !orgCode) {
return new Promise((resolve, reject) => {
resolve(getDictItemsByCode(code));
});
@ -43,7 +44,11 @@ export const initDictOptions = (code) => {
code = encodeURI(code);
}
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
if (!orgCode) {
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
} else {
return defHttp.get({ url: `/sys/dict/getDictItems/${code}/${orgCode}` });
}
};
/**
*

View File

@ -1,16 +1,17 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/sysconfig/sysConfig/list',
save='/sysconfig/sysConfig/add',
edit='/sysconfig/sysConfig/edit',
save = '/sysconfig/sysConfig/add',
edit = '/sysconfig/sysConfig/edit',
deleteOne = '/sysconfig/sysConfig/delete',
deleteBatch = '/sysconfig/sysConfig/deleteBatch',
importExcel = '/sysconfig/sysConfig/importExcel',
exportXls = '/sysconfig/sysConfig/exportXls',
queryByKey = '/sysconfig/sysConfig/queryByKey',
}
/**
@ -30,16 +31,23 @@ export const getImportUrl = Api.importExcel;
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
* key获取数据
* @param params key
* @returns
*/
export const queryByKey = (params) => defHttp.get({ url: Api.queryByKey, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
};
/**
*
@ -54,12 +62,12 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
},
});
}
};
/**
*
@ -69,4 +77,4 @@ export const batchDelete = (params, handleSuccess) => {
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
};

View File

@ -1,12 +1,12 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/services/serviceDirective/list',
save='/services/serviceDirective/add',
edit='/services/serviceDirective/edit',
save = '/services/serviceDirective/add',
edit = '/services/serviceDirective/edit',
deleteOne = '/services/serviceDirective/delete',
deleteBatch = '/services/serviceDirective/deleteBatch',
importExcel = '/services/serviceDirective/importExcel',
@ -16,9 +16,25 @@ enum Api {
tree = '/services/serviceDirective/tree',
queryById = '/services/serviceDirective/queryById',
syncMediaForBiz = '/services/serviceDirective/syncMediaForBiz',
syncMediaForAllBiz= '/services/serviceDirective/syncMediaForAllBiz',
syncMediaForAllBiz = '/services/serviceDirective/syncMediaForAllBiz',
listByDS = '/services/serviceDirective/listByDS',
idListByDS = '/services/serviceDirective/idListByDS',
syncDirective = '/services/serviceDirective/syncDirective',
}
/**
* -
* @param params
*/
export const listByDS = (params) => defHttp.get({ url: Api.listByDS, params });
/**
*
* @param params id
* @returns
*/
export const idListByDS = (params) => defHttp.get({ url: Api.idListByDS, params });
/**
* api
* @param params
@ -42,11 +58,11 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
};
/**
*
@ -61,12 +77,12 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
},
});
}
};
/**
*
@ -76,7 +92,7 @@ export const batchDelete = (params, handleSuccess) => {
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
};
/**
*
@ -84,12 +100,12 @@ export const saveOrUpdate = (params, isUpdate) => {
*/
export const asyncFunc = (params) => {
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
}
};
/**
*
* @param params
* @returns
* @param params
* @returns
*/
export const tree = () => defHttp.get({ url: Api.tree });
@ -107,4 +123,13 @@ export const syncMediaForBiz = (params) => {
*/
export const syncMediaForAllBiz = (params) => {
return defHttp.post({ url: Api.syncMediaForAllBiz, params });
};
};
/**
*
* @param params
* @returns
*/
export const syncDirective = (dataSourceCode: string, params: any) => {
return defHttp.post({ url: `${Api.syncDirective}?sourceOrgCode=${encodeURIComponent(dataSourceCode)}`, params });
};

View File

@ -128,6 +128,8 @@
preIcon="tabler:settings">配置情绪标签</a-button>
<!-- <a-button type="primary" class="btnPrivate" @click="handleAdd"
preIcon="ant-design:plus-outlined">新增服务指令</a-button> -->
<a-button type="primary" class="btnPrivate" @click="handleDirectiveMainOpen" v-show="isShowDM"
preIcon="ant-design:profile-outlined">指令库</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
@ -274,6 +276,8 @@ 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 { queryByKey } from '/@/views/admin/sysconfig/SysConfig.api'
import { getOrgInfo } from '@/api/common/api'
const insRegisterModal = ref();
const catRegisterModal = ref();
@ -304,6 +308,7 @@ const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const treeData = ref<any>([]);
const userStore = useUserStore();
const isShowDM = ref(false)//
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@ -360,6 +365,7 @@ const categoryOpen = ref(false)//服务类别抽屉
const typeOpen = ref(false)//
const bodyTagOpen = ref(false)//
const emotionTagOpen = ref(false)//
const mainOrgCode = ref()//
/**
* 高级查询事件
@ -971,6 +977,20 @@ function initTree() {
})
}
/**
* 查看指令库
*/
function handleDirectiveMainOpen() {
registerModal.value?.openDM(mainOrgCode.value)
}
async function getDirectiveMainOrgCode() {
let { orgCode } = await getOrgInfo()
let { configValue } = await queryByKey({ key: 'directive_main_org_code' })
mainOrgCode.value = configValue
if (orgCode != configValue) isShowDM.value = true
}
//
onMounted(() => {
if (audioPlayer.value) {
@ -979,6 +999,7 @@ onMounted(() => {
});
}
initTree()
getDirectiveMainOrgCode()
});
</script>

View File

@ -0,0 +1,169 @@
import { BasicColumn } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '分类标签',
align: 'center',
dataIndex: 'instructionTagId_dictText',
width: 100,
// customCell: (record, index, column) => {
// if (record.instructionRowSpan != null) {
// return { rowSpan: record.instructionRowSpan };
// }
// },
},
{
title: '服务类别',
align: 'center',
dataIndex: 'categoryId_dictText',
// customCell: (record, index, column) => {
// if (record.categoryRowSpan != null) {
// return { rowSpan: record.categoryRowSpan };
// }
// },
},
{
title: '服务类型',
align: 'center',
dataIndex: 'typeId_dictText',
// customCell: (record, index, column) => {
// if (record.typeRowSpan != null) {
// return { rowSpan: record.typeRowSpan };
// }
// },
},
{
title: '服务指令',
align: 'center',
dataIndex: 'directiveName',
},
{
title: '体型标签',
align: 'center',
dataIndex: 'bodyTagList',
width: 150,
ellipsis: false,
// format(text, record, index) {
// if (!!text) {
// return text.map((item) => item.tagName).join('、');
// } else {
// return '-';
// }
// },
},
{
title: '情绪标签',
align: 'center',
dataIndex: 'emotionTagList',
width: 150,
ellipsis: false,
// format(text, record, index) {
// if (!!text) {
// return text.map((item) => item.tagName).join('、');
// } else {
// return '-';
// }
// },
},
{
title: '收费价格',
align: 'center',
dataIndex: 'tollPrice',
width: 100,
},
{
title: '提成价格',
align: 'center',
dataIndex: 'comPrice',
},
{
title: '医保报销',
align: 'center',
dataIndex: 'izReimbursement_dictText',
width: 100,
},
{
title: '机构优惠',
align: 'center',
dataIndex: 'izPreferential_dictText',
width: 100,
},
{
title: '周期类型',
align: 'center',
dataIndex: 'cycleType_dictText',
},
{
title: '服务时长(分钟)',
align: 'center',
dataIndex: 'serviceDuration',
width: 135,
},
{
title: '指令状态',
align: 'center',
dataIndex: 'status_dictText',
width: 100,
},
{
title: '是否启用',
align: 'center',
dataIndex: 'izEnabled_dictText',
width: 100,
},
// {
// title: '服务指令图片',
// align: 'center',
// dataIndex: 'previewFile',
// customRender: render.renderImage,
// },
{
title: '服务指令描述',
align: 'center',
dataIndex: 'serviceContent',
width: 200,
},
// {
// title: '指令音频文件',
// align: 'center',
// dataIndex: 'mp3File',
// width: 120,
// },
// {
// title: '指令视频文件',
// align: 'center',
// dataIndex: 'mp4File',
// width: 120,
// },
// {
// title: '即时指令图标',
// align: 'center',
// dataIndex: 'immediateFile',
// customRender: render.renderImage,
// },
];
// 高级查询数据
export const superQuerySchema = {
categoryId: { title: '服务类别', order: 0, view: 'list', type: 'string', dictCode: '' },
typeId: { title: '服务类型', order: 1, view: 'list', type: 'string', dictCode: '' },
instructionTagId: { title: '分类标签', order: 2, view: 'list', type: 'string', dictCode: 'instruction_tag' },
directiveName: { title: '服务指令', order: 3, view: 'text', type: 'string' },
tollPrice: { title: '收费价格', order: 4, view: 'number', type: 'number' },
comPrice: { title: '提成价格', order: 5, view: 'number', type: 'number' },
izReimbursement: { title: '医保报销', order: 6, view: 'radio', type: 'string', dictCode: '' },
izPreferential: { title: '机构优惠', order: 7, view: 'radio', type: 'string', dictCode: '' },
chargingFrequency: { title: '收费频次', order: 8, view: 'list', type: 'string', dictCode: '' },
cycleType: { title: '周期类型', order: 9, view: 'list', type: 'string', dictCode: '' },
sort: { title: '排序', order: 10, view: 'number', type: 'number' },
serviceContent: { title: '服务说明', order: 11, view: 'textarea', type: 'string' },
serviceDuration: { title: '服务时长(分钟)', order: 12, view: 'text', type: 'string' },
izEnabled: { title: '是否启用', order: 13, view: 'radio', type: 'string', dictCode: '' },
createBy: { title: '创建人', order: 14, view: 'text', type: 'string' },
createTime: { title: '创建日期', order: 15, view: 'datetime', type: 'string' },
updateBy: { title: '更新人', order: 16, view: 'text', type: 'string' },
updateTime: { title: '更新日期', order: 17, view: 'datetime', type: 'string' },
mp3File: { title: '语音文件', order: 18, view: 'file', type: 'string' },
mp4File: { title: '视频文件', order: 19, view: 'file', type: 'string' },
};

View File

@ -8,7 +8,7 @@
<a-col :span="12">
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
<j-dict-select-tag v-model:value="formData.instructionTagId"
<j-dict-select-tag v-model:value="formData.instructionTagId" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" :disabled="!!formData.id" />
</a-form-item>
@ -17,14 +17,16 @@
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
name="categoryId">
<j-dict-select-tag type="list" v-model:value="formData.categoryId" :disabled="!!formData.id"
:dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear @upDictCode="upCategoryDictCode" />
:orgCode="mainOrgCode" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
@upDictCode="upCategoryDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
name="typeId">
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
:disabled="!!formData.id" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
:orgCode="mainOrgCode" :disabled="!!formData.id" placeholder="请选择服务类型" allowClear
@upDictCode="upTypeDictCode" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -81,14 +83,14 @@
<a-col :span="24">
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
:wrapperCol="wrapperCol2" name="typeId">
<JCheckbox v-model:value="formData.bodyTags"
<JCheckbox v-model:value="formData.bodyTags" :orgCode="mainOrgCode"
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`"
@upDictCode="upBodyTagsDictCode" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
<JCheckbox v-model:value="formData.emotionTags"
<JCheckbox v-model:value="formData.emotionTags" :orgCode="mainOrgCode"
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`"
@upDictCode="upEmotionTagsDictCode" />
</a-form-item>
@ -102,11 +104,10 @@
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-col :span="12" v-show="showMedia">
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
<span v-if="disabled && !formData.previewFile">暂无文件</span>
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile"
>
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile">
</JImageUpload>
</a-form-item>
</a-col>
@ -117,24 +118,22 @@
</a-form-item>
</a-col>
</a-row>
<a-row v-show="!disabled">
<a-row v-show="!disabled && showMedia">
<a-col :span="12">
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
></j-upload>
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"></j-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
></j-upload>
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<JFormContainer style="margin-top: -40px;">
<JFormContainer style="margin-top: -40px;" v-show="showMedia">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="ConfigServiceDirectiveForm">
@ -166,8 +165,7 @@
<a-col :span="12">
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
<span v-if="disabled && !formData.immediateFile">暂无文件</span>
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile"
>
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile">
</JImageUpload>
</a-form-item>
</a-col>
@ -196,6 +194,7 @@ const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true },
mainOrgCode: '',
});
const formRef = ref();
@ -407,12 +406,14 @@ function add() {
edit({});
}
const needWatch = ref(false)
const showMedia = ref(true)
/**
* 编辑
* isEditMedia_是否为编辑指令资源 隐藏业务字段
*/
function edit(record, isEditMedia_ = false) {
function edit(record, isEditMedia_ = false, showMedia_ = true) {
needWatch.value = false
showMedia.value = showMedia_
setTimeout(() => {
needWatch.value = true
}, 1000)

View File

@ -12,9 +12,17 @@
</template>
<a-spin :spinning="loading">
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false"></ConfigServiceDirectiveForm>
:formBpm="false" :mainOrgCode="mainOrgCode"></ConfigServiceDirectiveForm>
</a-spin>
</j-modal>
<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>
</template>
<script lang="ts" setup>
@ -22,10 +30,14 @@ import { ref, nextTick, defineExpose, defineProps } from 'vue';
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { saveOrUpdate, queryById } from '../ConfigServiceDirective.api';
import { saveOrUpdate, queryById, syncDirective } from '../ConfigServiceDirective.api';
import DirectiveRespositoryList from './DirectiveRespositoryList.vue'
import { clearCache } from '/@/utils/cache/cacheUtil'
const mainOrgCode = ref('')
const dmRef = ref()
const loading = ref(false)
const { createMessage } = useMessage();
const { createMessage, createConfirm } = useMessage();
const props = defineProps({
});
const title = ref<string>('');
@ -34,6 +46,13 @@ const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
const opeType = ref('')// add edit editMedia- look audit auditMedia-
const dmVisible = ref(false)
function handleCancelDM() {
dmVisible.value = false
clearCache()
emit('success')
}
/**
* 新增
@ -50,11 +69,12 @@ function add() {
* 编辑
* @param record
*/
function edit(record) {
function edit(record, editMedia = false, showMedia = true) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
mainOrgCode.value = record.orgCode_
nextTick(() => {
registerForm.value.edit(record);
registerForm.value.edit(record, editMedia, showMedia);
});
}
@ -154,6 +174,37 @@ function queryByIdFunc(id) {
})
}
function openDM(orgCode) {
dmVisible.value = true
mainOrgCode.value = orgCode
nextTick(() => {
dmRef.value?.init()
})
}
function handlePullDM() {
let selectedData = dmRef.value?.getSelectedIds()
if (!selectedData.count) {
createMessage.warning('未选择服务指令')
return
}
createConfirm({
iconType: 'warning',
title: '镜像确认',
content: '是否确认将<span style="font-weight:500;color:#efac0e;"> ' + selectedData.count + ' </span>条服务指令拉取到本平台?',
okText: '确认',
cancelText: '取消',
onOk: () => {
syncDirective(mainOrgCode.value, { syncIds: selectedData.ids, })
createMessage.success('已开始自动拉取,请耐心等待')
dmRef.value?.init()
}
});
}
defineExpose({
add,
edit,
@ -163,6 +214,7 @@ defineExpose({
queryByIdFunc,
opeType,
queryAndEditMedia,
openDM,
});
</script>

View File

@ -0,0 +1,376 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<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 order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" />
</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" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" />
</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" :orgCode="mainOrgCode"
:dictCode="`nu_config_service_type,type_name,id,del_flag = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
placeholder="请选择服务类型" allowClear :ignoreDisabled="true" />
</a-form-item>
</a-col>
<a-col :lg="6">
<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' 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' 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 :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: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" @success="handleSuccess" :mainOrgCode="mainOrgCode">
</ConfigServiceDirectiveModal>
</div>
</template>
<script lang="ts" name="serviceDirective-configServiceDirective" setup>
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 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";
const props = defineProps({
mainOrgCode: '',
});
const formRef = ref();
const queryParam = reactive<any>({
instructionTagId: '',
categoryId: '',
typeId: '',
});
watch(
() => queryParam.instructionTagId,
() => {
queryParam.categoryId = ''
queryParam.typeId = ''
}
)
//
watch(
() => queryParam.categoryId,
() => {
queryParam.typeId = ''
}
)
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '服务指令',
api: listByDS,
columns,
canResize: false,
useSearchForm: false,
showIndexColumn: true,
scroll: { y: '58vh' },
pagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '50', '100'],
},
actionColumn: {
width: 200,
fixed: 'right',
},
beforeFetch: async (params) => {
// let res = await idListByDS({ dataSourceCode: 'master' })
params.dataSourceCode = props.mainOrgCode
params.excludeIds = excludeIds.value
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery);
},
},
exportConfig: {
name: "服务指令",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.opeType = 'look';
record.orgCode_ = props.mainOrgCode
registerModal.value.edit(record, false, false);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
]
}
/**
* 查询
*/
function searchQuery(reloadTree = true) {
reload()
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields(); //
// queryParam
queryParam.instructionTagId = '';
queryParam.categoryId = '';
queryParam.typeId = '';
queryParam.directiveName = ''; //
queryParam.bodyTags = '';
queryParam.emotionTags = '';
queryParam.izEnabled = '';
//
reload()
}
let rangeField = 'tollPrice,comPrice,'
/**
* 设置范围查询条件
*/
async function setRangeQuery() {
let queryParamClone = cloneDeep(queryParam);
if (rangeField) {
let fieldsValue = rangeField.split(',');
fieldsValue.forEach(item => {
if (queryParamClone[item]) {
let range = queryParamClone[item];
queryParamClone[item + '_begin'] = range[0];
queryParamClone[item + '_end'] = range[1];
delete queryParamClone[item];
} else {
queryParamClone[item + '_begin'] = '';
queryParamClone[item + '_end'] = '';
}
})
}
return queryParamClone;
}
const excludeIds = ref('')
async function init() {
let { ids } = getSelectedIds();
let res = await idListByDS({ dataSourceCode: 'master' });
// ID
let existingExcludeIds = res.records.map(item => item.id);
// ids
if (ids) {
const idsToAdd = ids.split(',');
existingExcludeIds = [...existingExcludeIds, ...idsToAdd];
}
// excludeIds.value
excludeIds.value = [...new Set(existingExcludeIds)];
reload();
}
/**
* 获取到已选择的所有id
*/
function getSelectedIds() {
const ids = selectedRowKeys.value.join(',');
const count = selectedRowKeys.value.length;
return { ids, count }; // ID
}
//
onMounted(() => {
});
defineExpose({
getSelectedIds,
init
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
audio::-webkit-media-controls-timeline {
display: none;
}
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
display: none;
}
.btnPrivate {
height: 34px;
margin-left: 4px;
}
.node-title {
display: inline-flex;
align-items: center;
}
.action-icon {
margin-left: 4px;
cursor: pointer;
}
:deep(.centered-dropdown) {
position: fixed;
left: 50% !important;
top: 50% !important;
transform: translate(-50%, -50%) !important;
max-height: 80vh;
overflow-y: auto;
.ant-dropdown-menu {
max-height: 70vh;
overflow-y: auto;
}
}
</style>