Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_vue
This commit is contained in:
commit
5e29db84a2
|
@ -2,7 +2,7 @@
|
||||||
VITE_USE_MOCK = false
|
VITE_USE_MOCK = false
|
||||||
|
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /biz101
|
VITE_PUBLIC_PATH = /biz103
|
||||||
|
|
||||||
# 是否启用gzip或brotli压缩
|
# 是否启用gzip或brotli压缩
|
||||||
# 选项值: gzip | brotli | none
|
# 选项值: gzip | brotli | none
|
||||||
|
@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
|
||||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
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=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
|
@ -16,7 +16,7 @@ enum Api {
|
||||||
getTableList = '/sys/user/queryUserComponentData',
|
getTableList = '/sys/user/queryUserComponentData',
|
||||||
getCategoryData = '/sys/category/loadAllData',
|
getCategoryData = '/sys/category/loadAllData',
|
||||||
getNuList = '/iot/tplink/cameraInfo/nuList',
|
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) => {
|
export const getDictItems = (dictCode) => {
|
||||||
return defHttp.get({ url: Api.getDictItems + dictCode }, { joinTime: false });
|
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
|
* 部门用户modal选择列表加载list
|
||||||
*/
|
*/
|
||||||
|
@ -164,6 +172,6 @@ export const uploadMyFile = (url, data) => {
|
||||||
* 获取机构名称
|
* 获取机构名称
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const getOrgName = () => {
|
export const getOrgInfo = () => {
|
||||||
return defHttp.get({ url: Api.getOrgName });
|
return defHttp.get({ url: Api.getOrgInfo });
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
import { defineComponent, computed, watch, watchEffect, ref, unref } from 'vue';
|
import { defineComponent, computed, watch, watchEffect, ref, unref } from 'vue';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||||
import { getDictItems } from "@/api/common/api";
|
import { getDictItems, getDictItemsByOrgCode } from "@/api/common/api";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'JCheckbox',
|
name: 'JCheckbox',
|
||||||
|
@ -23,6 +23,7 @@ export default defineComponent({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
orgCode: '',//组织机构编码 会切换数据源
|
||||||
},
|
},
|
||||||
emits: ['change', 'update:value', 'upDictCode'],
|
emits: ['change', 'update:value', 'upDictCode'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
@ -82,16 +83,27 @@ export default defineComponent({
|
||||||
temp = encodeURI(temp);
|
temp = encodeURI(temp);
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||||
getDictItems(temp).then((res) => {
|
if (!!props.orgCode) {
|
||||||
|
getDictItemsByOrgCode(temp, props.orgCode).then((res) => {
|
||||||
if (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 }));
|
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);
|
//console.info('res', dictOptions.value);
|
||||||
emit('upDictCode', checkOptions.value)
|
|
||||||
} else {
|
} else {
|
||||||
console.error('getDictItems error: : ', res);
|
console.error('getDictItems error: : ', res);
|
||||||
checkOptions.value = [];
|
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 = [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -77,6 +77,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
style: propTypes.any,
|
style: propTypes.any,
|
||||||
ignoreDisabled: propTypes.bool.def(false),
|
ignoreDisabled: propTypes.bool.def(false),
|
||||||
|
orgCode: '',//组织机构编码 会切换数据源
|
||||||
},
|
},
|
||||||
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
|
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
|
@ -127,7 +128,7 @@ export default defineComponent({
|
||||||
async function initDictData() {
|
async function initDictData() {
|
||||||
let { dictCode, stringToNumber } = props;
|
let { dictCode, stringToNumber } = props;
|
||||||
//根据字典Code, 初始化字典数组
|
//根据字典Code, 初始化字典数组
|
||||||
const dictData = await initDictOptions(dictCode);
|
const dictData = await initDictOptions(dictCode, props.orgCode);
|
||||||
dictOptions.value = dictData.reduce((prev, next) => {
|
dictOptions.value = dictData.reduce((prev, next) => {
|
||||||
if (next) {
|
if (next) {
|
||||||
const value = next['value'];
|
const value = next['value'];
|
||||||
|
|
|
@ -76,7 +76,7 @@ import LoginSelect from '/@/views/sys/login/LoginSelect.vue';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import Aide from "@/views/dashboard/ai/components/aide/index.vue"
|
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();
|
const { t } = useI18n();
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
|
@ -187,7 +187,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOrgName().then(res => {
|
getOrgInfo().then(res => {
|
||||||
orgName.value = res.orgName
|
orgName.value = res.orgName
|
||||||
})
|
})
|
||||||
showLoginSelect();
|
showLoginSelect();
|
||||||
|
|
|
@ -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 {
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,11 +27,12 @@ export const getDictItemsByCode = (code) => {
|
||||||
/**
|
/**
|
||||||
* 获取字典数组
|
* 获取字典数组
|
||||||
* @param dictCode 字典Code
|
* @param dictCode 字典Code
|
||||||
|
* @param orgCode 机构编码 查询相应数据源字典
|
||||||
* @return List<Map>
|
* @return List<Map>
|
||||||
*/
|
*/
|
||||||
export const initDictOptions = (code) => {
|
export const initDictOptions = (code, orgCode = '') => {
|
||||||
//1.优先从缓存中读取字典配置
|
//1.优先从缓存中读取字典配置
|
||||||
if (getDictItemsByCode(code)) {
|
if (getDictItemsByCode(code) && !orgCode) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(getDictItemsByCode(code));
|
resolve(getDictItemsByCode(code));
|
||||||
});
|
});
|
||||||
|
@ -43,7 +44,11 @@ export const initDictOptions = (code) => {
|
||||||
code = encodeURI(code);
|
code = encodeURI(code);
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||||
|
if (!orgCode) {
|
||||||
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
|
return defHttp.get({ url: `/sys/dict/getDictItems/${code}` });
|
||||||
|
} else {
|
||||||
|
return defHttp.get({ url: `/sys/dict/getDictItems/${code}/${orgCode}` });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* 获取字典数组
|
* 获取字典数组
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/sysconfig/sysConfig/list',
|
list = '/sysconfig/sysConfig/list',
|
||||||
save='/sysconfig/sysConfig/add',
|
save = '/sysconfig/sysConfig/add',
|
||||||
edit='/sysconfig/sysConfig/edit',
|
edit = '/sysconfig/sysConfig/edit',
|
||||||
deleteOne = '/sysconfig/sysConfig/delete',
|
deleteOne = '/sysconfig/sysConfig/delete',
|
||||||
deleteBatch = '/sysconfig/sysConfig/deleteBatch',
|
deleteBatch = '/sysconfig/sysConfig/deleteBatch',
|
||||||
importExcel = '/sysconfig/sysConfig/importExcel',
|
importExcel = '/sysconfig/sysConfig/importExcel',
|
||||||
exportXls = '/sysconfig/sysConfig/exportXls',
|
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 });
|
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 params
|
||||||
* @param handleSuccess
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params, handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
|
@ -54,12 +62,12 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
okText: '确认',
|
okText: '确认',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
|
@ -69,4 +77,4 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
};
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from "/@/hooks/web/useMessage";
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
const { createConfirm } = useMessage();
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/services/serviceDirective/list',
|
list = '/services/serviceDirective/list',
|
||||||
save='/services/serviceDirective/add',
|
save = '/services/serviceDirective/add',
|
||||||
edit='/services/serviceDirective/edit',
|
edit = '/services/serviceDirective/edit',
|
||||||
deleteOne = '/services/serviceDirective/delete',
|
deleteOne = '/services/serviceDirective/delete',
|
||||||
deleteBatch = '/services/serviceDirective/deleteBatch',
|
deleteBatch = '/services/serviceDirective/deleteBatch',
|
||||||
importExcel = '/services/serviceDirective/importExcel',
|
importExcel = '/services/serviceDirective/importExcel',
|
||||||
|
@ -16,9 +16,25 @@ enum Api {
|
||||||
tree = '/services/serviceDirective/tree',
|
tree = '/services/serviceDirective/tree',
|
||||||
queryById = '/services/serviceDirective/queryById',
|
queryById = '/services/serviceDirective/queryById',
|
||||||
syncMediaForBiz = '/services/serviceDirective/syncMediaForBiz',
|
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
|
* 导出api
|
||||||
* @param params
|
* @param params
|
||||||
|
@ -42,11 +58,11 @@ export const queryById = (params) => defHttp.get({ url: Api.queryById, params })
|
||||||
* @param params
|
* @param params
|
||||||
* @param handleSuccess
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params, handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
|
@ -61,12 +77,12 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
okText: '确认',
|
okText: '确认',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
|
@ -76,7 +92,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步数据
|
* 同步数据
|
||||||
|
@ -84,7 +100,7 @@ export const saveOrUpdate = (params, isUpdate) => {
|
||||||
*/
|
*/
|
||||||
export const asyncFunc = (params) => {
|
export const asyncFunc = (params) => {
|
||||||
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
return defHttp.post({ url: Api.async, params }, { isTransformResponse: false });
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取树结构
|
* 获取树结构
|
||||||
|
@ -108,3 +124,12 @@ export const syncMediaForBiz = (params) => {
|
||||||
export const syncMediaForAllBiz = (params) => {
|
export const syncMediaForAllBiz = (params) => {
|
||||||
return defHttp.post({ url: Api.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 });
|
||||||
|
};
|
||||||
|
|
|
@ -128,6 +128,8 @@
|
||||||
preIcon="tabler:settings">配置情绪标签</a-button>
|
preIcon="tabler:settings">配置情绪标签</a-button>
|
||||||
<!-- <a-button type="primary" class="btnPrivate" @click="handleAdd"
|
<!-- <a-button type="primary" class="btnPrivate" @click="handleAdd"
|
||||||
preIcon="ant-design:plus-outlined">新增服务指令</a-button> -->
|
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>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
|
@ -274,6 +276,8 @@ import { Empty } from 'ant-design-vue';
|
||||||
import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue'
|
import InstructionTagModal from '/@/views/services/InstructionTag/components/InstructionTagModal.vue'
|
||||||
import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue'
|
import ConfigServiceCategoryModal from '/@/views/services/serviceCategory/components//ConfigServiceCategoryModal.vue'
|
||||||
import ConfigServiceTypeModal from '/@/views/services/serviceType/components//ConfigServiceTypeModal.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 insRegisterModal = ref();
|
||||||
const catRegisterModal = ref();
|
const catRegisterModal = ref();
|
||||||
|
@ -304,6 +308,7 @@ const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const treeData = ref<any>([]);
|
const treeData = ref<any>([]);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const isShowDM = ref(false)//是否展示指令库功能
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
|
@ -360,6 +365,7 @@ const categoryOpen = ref(false)//服务类别抽屉
|
||||||
const typeOpen = ref(false)//服务类型抽屉
|
const typeOpen = ref(false)//服务类型抽屉
|
||||||
const bodyTagOpen = ref(false)//体型标签抽屉
|
const bodyTagOpen = ref(false)//体型标签抽屉
|
||||||
const emotionTagOpen = 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(() => {
|
onMounted(() => {
|
||||||
if (audioPlayer.value) {
|
if (audioPlayer.value) {
|
||||||
|
@ -979,6 +999,7 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initTree()
|
initTree()
|
||||||
|
getDirectiveMainOrgCode()
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -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' },
|
||||||
|
};
|
|
@ -8,7 +8,7 @@
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
|
||||||
id="ConfigServiceDirectiveForm-instructionTagId" name="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`"
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" :disabled="!!formData.id" />
|
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" :disabled="!!formData.id" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -17,14 +17,16 @@
|
||||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
||||||
name="categoryId">
|
name="categoryId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.categoryId" :disabled="!!formData.id"
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||||
name="typeId">
|
name="typeId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -81,14 +83,14 @@
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||||
:wrapperCol="wrapperCol2" name="typeId">
|
: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`"
|
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`"
|
||||||
@upDictCode="upBodyTagsDictCode" />
|
@upDictCode="upBodyTagsDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
|
<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`"
|
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`"
|
||||||
@upDictCode="upEmotionTagsDictCode" />
|
@upDictCode="upEmotionTagsDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -102,11 +104,10 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12">
|
<a-col :span="12" v-show="showMedia">
|
||||||
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
||||||
<span v-if="disabled && !formData.previewFile">暂无文件</span>
|
<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>
|
</JImageUpload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -117,24 +118,22 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row v-show="!disabled">
|
<a-row v-show="!disabled && showMedia">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"
|
<j-upload v-model:value="formData.mp3File" accept=".mp3" :maxCount="1"></j-upload>
|
||||||
></j-upload>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"
|
<j-upload v-model:value="formData.mp4File" accept=".mp4" :maxCount="1"></j-upload>
|
||||||
></j-upload>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
</JFormContainer>
|
</JFormContainer>
|
||||||
<JFormContainer style="margin-top: -40px;">
|
<JFormContainer style="margin-top: -40px;" v-show="showMedia">
|
||||||
<template #detail>
|
<template #detail>
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigServiceDirectiveForm">
|
name="ConfigServiceDirectiveForm">
|
||||||
|
@ -166,8 +165,7 @@
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
||||||
<span v-if="disabled && !formData.immediateFile">暂无文件</span>
|
<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>
|
</JImageUpload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -196,6 +194,7 @@ const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: () => ({}) },
|
formData: { type: Object, default: () => ({}) },
|
||||||
formBpm: { type: Boolean, default: true },
|
formBpm: { type: Boolean, default: true },
|
||||||
|
mainOrgCode: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -407,12 +406,14 @@ function add() {
|
||||||
edit({});
|
edit({});
|
||||||
}
|
}
|
||||||
const needWatch = ref(false)
|
const needWatch = ref(false)
|
||||||
|
const showMedia = ref(true)
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
* isEditMedia_是否为编辑指令资源 (隐藏业务字段)
|
* isEditMedia_是否为编辑指令资源 (隐藏业务字段)
|
||||||
*/
|
*/
|
||||||
function edit(record, isEditMedia_ = false) {
|
function edit(record, isEditMedia_ = false, showMedia_ = true) {
|
||||||
needWatch.value = false
|
needWatch.value = false
|
||||||
|
showMedia.value = showMedia_
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
needWatch.value = true
|
needWatch.value = true
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
|
@ -12,9 +12,17 @@
|
||||||
</template>
|
</template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
<ConfigServiceDirectiveForm ref="registerForm" v-if="visible" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||||
:formBpm="false"></ConfigServiceDirectiveForm>
|
:formBpm="false" :mainOrgCode="mainOrgCode"></ConfigServiceDirectiveForm>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</j-modal>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -22,10 +30,14 @@ import { ref, nextTick, defineExpose, defineProps } from 'vue';
|
||||||
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
import ConfigServiceDirectiveForm from './ConfigServiceDirectiveForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
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 loading = ref(false)
|
||||||
const { createMessage } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
});
|
});
|
||||||
const title = ref<string>('');
|
const title = ref<string>('');
|
||||||
|
@ -34,6 +46,13 @@ const disableSubmit = ref<boolean>(false);
|
||||||
const registerForm = ref();
|
const registerForm = ref();
|
||||||
const emit = defineEmits(['register', 'success']);
|
const emit = defineEmits(['register', 'success']);
|
||||||
const opeType = ref('')//操作类型 add新增 edit编辑 editMedia主列表-指令资源 look详情 audit审核 auditMedia审核列表-指令资源
|
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
|
* @param record
|
||||||
*/
|
*/
|
||||||
function edit(record) {
|
function edit(record, editMedia = false, showMedia = true) {
|
||||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
|
mainOrgCode.value = record.orgCode_
|
||||||
nextTick(() => {
|
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({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
|
@ -163,6 +214,7 @@ defineExpose({
|
||||||
queryByIdFunc,
|
queryByIdFunc,
|
||||||
opeType,
|
opeType,
|
||||||
queryAndEditMedia,
|
queryAndEditMedia,
|
||||||
|
openDM,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue