diff --git a/src/api/common/api.ts b/src/api/common/api.ts index 7065ceb..1f755f9 100644 --- a/src/api/common/api.ts +++ b/src/api/common/api.ts @@ -14,7 +14,7 @@ enum Api { getDictItems = '/sys/dict/getDictItems/', getTableList = '/sys/user/queryUserComponentData', getCategoryData = '/sys/category/loadAllData', - getNuList = '/iot/cameraInfo/nuList',//后期调整 + getNuList = '/iot/cameraInfo/nuList', //后期调整 } /** @@ -87,6 +87,12 @@ 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 */ diff --git a/src/components/Form/src/jeecg/components/JCheckbox.vue b/src/components/Form/src/jeecg/components/JCheckbox.vue index 6b25089..214a67d 100644 --- a/src/components/Form/src/jeecg/components/JCheckbox.vue +++ b/src/components/Form/src/jeecg/components/JCheckbox.vue @@ -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'], setup(props, { emit }) { @@ -82,15 +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); - } 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 = []; + } + }); + } } /** diff --git a/src/components/Form/src/jeecg/components/JDictSelectTag.vue b/src/components/Form/src/jeecg/components/JDictSelectTag.vue index 88f12aa..74bb3bd 100644 --- a/src/components/Form/src/jeecg/components/JDictSelectTag.vue +++ b/src/components/Form/src/jeecg/components/JDictSelectTag.vue @@ -76,6 +76,7 @@ export default defineComponent({ }, style: propTypes.any, ignoreDisabled: propTypes.bool.def(false), + orgCode:'',//组织机构编码 会切换数据源 }, emits: ['options-change', 'change', 'update:value'], setup(props, { emit, refs }) { @@ -126,7 +127,8 @@ 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']; diff --git a/src/components/Form/src/jeecg/components/JSelectMultiple.vue b/src/components/Form/src/jeecg/components/JSelectMultiple.vue index 3e7dab9..c4d8b4d 100644 --- a/src/components/Form/src/jeecg/components/JSelectMultiple.vue +++ b/src/components/Form/src/jeecg/components/JSelectMultiple.vue @@ -1,164 +1,170 @@ diff --git a/src/utils/dict/index.ts b/src/utils/dict/index.ts index cdf4f8a..642292a 100644 --- a/src/utils/dict/index.ts +++ b/src/utils/dict/index.ts @@ -22,16 +22,16 @@ export const getDictItemsByCode = (code) => { //update-end-author:liusq---date:2023-10-13--for:【issues/777】列表 分类字典不显示 // update-end--author:liaozhiyang---date:20230908---for:【QQYUN-6417】生产环境字典慢的问题 - }; /** * 获取字典数组 * @param dictCode 字典Code + * @param orgCode 机构编码 查询相应数据源字典 * @return List */ -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 +43,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}` }); + } }; /** * 获取字典数组 diff --git a/src/views/serviceDirective/directiveTag/DirectiveTag.api.ts b/src/views/serviceDirective/directiveTag/DirectiveTag.api.ts deleted file mode 100644 index 257ffa5..0000000 --- a/src/views/serviceDirective/directiveTag/DirectiveTag.api.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { defHttp } from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/directiveTag/directiveTag/list', - save='/directiveTag/directiveTag/add', - edit='/directiveTag/directiveTag/edit', - deleteOne = '/directiveTag/directiveTag/delete', - deleteBatch = '/directiveTag/directiveTag/deleteBatch', - importExcel = '/directiveTag/directiveTag/importExcel', - exportXls = '/directiveTag/directiveTag/exportXls', -} - -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; - -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; - -/** - * 列表接口 - * @param params - */ -export const list = (params) => defHttp.get({ url: Api.list, params }); - -/** - * 删除单个 - * @param params - * @param handleSuccess - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} - -/** - * 批量删除 - * @param params - * @param handleSuccess - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} - -/** - * 保存或者更新 - * @param params - * @param isUpdate - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({ url: url, params }, { isTransformResponse: false }); -} diff --git a/src/views/serviceDirective/directiveTag/DirectiveTag.data.ts b/src/views/serviceDirective/directiveTag/DirectiveTag.data.ts deleted file mode 100644 index 654237b..0000000 --- a/src/views/serviceDirective/directiveTag/DirectiveTag.data.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '标签名称', - align: "center", - dataIndex: 'tagName' - }, - { - title: '排序', - align: "center", - dataIndex: 'sort' - }, - { - title: '是否启用', - align: "center", - dataIndex: 'izEnabled_dictText' - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - tagName: {title: '标签名称',order: 0,view: 'text', type: 'string',}, - sort: {title: '排序',order: 1,view: 'number', type: 'number',}, - izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: 'iz_enabled',}, -}; diff --git a/src/views/serviceDirective/directiveTag/DirectiveTagList.vue b/src/views/serviceDirective/directiveTag/DirectiveTagList.vue deleted file mode 100644 index c5ce308..0000000 --- a/src/views/serviceDirective/directiveTag/DirectiveTagList.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/directiveTag/components/DirectiveTagForm.vue b/src/views/serviceDirective/directiveTag/components/DirectiveTagForm.vue deleted file mode 100644 index c452842..0000000 --- a/src/views/serviceDirective/directiveTag/components/DirectiveTagForm.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/directiveTag/components/DirectiveTagModal.vue b/src/views/serviceDirective/directiveTag/components/DirectiveTagModal.vue deleted file mode 100644 index 494db25..0000000 --- a/src/views/serviceDirective/directiveTag/components/DirectiveTagModal.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - diff --git a/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.api.ts b/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.api.ts deleted file mode 100644 index 3e9727e..0000000 --- a/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.api.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { defHttp } from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/serviceCategory/configServiceCategory/list', - save='/serviceCategory/configServiceCategory/add', - edit='/serviceCategory/configServiceCategory/edit', - deleteOne = '/serviceCategory/configServiceCategory/delete', - deleteBatch = '/serviceCategory/configServiceCategory/deleteBatch', - importExcel = '/serviceCategory/configServiceCategory/importExcel', - exportXls = '/serviceCategory/configServiceCategory/exportXls', -} - -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; - -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; - -/** - * 列表接口 - * @param params - */ -export const list = (params) => defHttp.get({ url: Api.list, params }); - -/** - * 删除单个 - * @param params - * @param handleSuccess - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} - -/** - * 批量删除 - * @param params - * @param handleSuccess - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} - -/** - * 保存或者更新 - * @param params - * @param isUpdate - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({ url: url, params }, { isTransformResponse: false }); -} diff --git a/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.data.ts b/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.data.ts deleted file mode 100644 index 8f25327..0000000 --- a/src/views/serviceDirective/serviceCategory/ConfigServiceCategory.data.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '服务类别', - align: "center", - dataIndex: 'categoryName' - }, - { - title: '排序', - align: "center", - sorter: true, - dataIndex: 'sort' - }, - { - title: '是否启用', - align: "center", - dataIndex: 'izEnabled_dictText' - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - categoryName: {title: '服务类别',order: 0,view: 'text', type: 'string',}, - sort: {title: '排序',order: 1,view: 'number', type: 'number',}, - izEnabled: {title: '是否启用',order: 2,view: 'radio', type: 'string',dictCode: '',}, -}; diff --git a/src/views/serviceDirective/serviceCategory/ConfigServiceCategoryList.vue b/src/views/serviceDirective/serviceCategory/ConfigServiceCategoryList.vue deleted file mode 100644 index 5478a29..0000000 --- a/src/views/serviceDirective/serviceCategory/ConfigServiceCategoryList.vue +++ /dev/null @@ -1,274 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryForm.vue b/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryForm.vue deleted file mode 100644 index 2799128..0000000 --- a/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryForm.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryModal.vue b/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryModal.vue deleted file mode 100644 index c91ff3e..0000000 --- a/src/views/serviceDirective/serviceCategory/components/ConfigServiceCategoryModal.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - diff --git a/src/views/serviceDirective/serviceDirective/ConfigServiceDirectiveList.vue b/src/views/serviceDirective/serviceDirective/ConfigServiceDirectiveList.vue deleted file mode 100644 index 33a5abb..0000000 --- a/src/views/serviceDirective/serviceDirective/ConfigServiceDirectiveList.vue +++ /dev/null @@ -1,487 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/serviceType/ConfigServiceType.api.ts b/src/views/serviceDirective/serviceType/ConfigServiceType.api.ts deleted file mode 100644 index 1af3d97..0000000 --- a/src/views/serviceDirective/serviceType/ConfigServiceType.api.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { defHttp } from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/ServiceType/configServiceType/list', - save='/ServiceType/configServiceType/add', - edit='/ServiceType/configServiceType/edit', - deleteOne = '/ServiceType/configServiceType/delete', - deleteBatch = '/ServiceType/configServiceType/deleteBatch', - importExcel = '/ServiceType/configServiceType/importExcel', - exportXls = '/ServiceType/configServiceType/exportXls' -} - -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; - -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; - -/** - * 列表接口 - * @param params - */ -export const list = (params) => defHttp.get({ url: Api.list, params }); - -/** - * 删除单个 - * @param params - * @param handleSuccess - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} - -/** - * 批量删除 - * @param params - * @param handleSuccess - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} - -/** - * 保存或者更新 - * @param params - * @param isUpdate - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({ url: url, params }, { isTransformResponse: false }); -} - - diff --git a/src/views/serviceDirective/serviceType/ConfigServiceType.data.ts b/src/views/serviceDirective/serviceType/ConfigServiceType.data.ts deleted file mode 100644 index 01db948..0000000 --- a/src/views/serviceDirective/serviceType/ConfigServiceType.data.ts +++ /dev/null @@ -1,37 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '服务类别', - align: "center", - dataIndex: 'categoryId_dictText' - }, - { - title: '服务类型', - align: "center", - dataIndex: 'typeName' - }, - { - title: '排序', - align: "center", - sorter: true, - dataIndex: 'sort' - }, - { - title: '是否启用', - align: "center", - dataIndex: 'izEnabled_dictText' - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - categoryId: {title: '服务类别id',order: 0,view: 'list', type: 'string',dictCode: '',}, - typeName: {title: '服务类型名称',order: 1,view: 'text', type: 'string',}, - sort: {title: '排序',order: 2,view: 'number', type: 'number',}, - izEnabled: {title: '是否启用',order: 3,view: 'text', type: 'string',}, -}; diff --git a/src/views/serviceDirective/serviceType/ConfigServiceTypeList.vue b/src/views/serviceDirective/serviceType/ConfigServiceTypeList.vue deleted file mode 100644 index a4c007d..0000000 --- a/src/views/serviceDirective/serviceType/ConfigServiceTypeList.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/serviceType/components/ConfigServiceTypeForm.vue b/src/views/serviceDirective/serviceType/components/ConfigServiceTypeForm.vue deleted file mode 100644 index ac48a81..0000000 --- a/src/views/serviceDirective/serviceType/components/ConfigServiceTypeForm.vue +++ /dev/null @@ -1,176 +0,0 @@ - - - - - diff --git a/src/views/serviceDirective/serviceType/components/ConfigServiceTypeModal.vue b/src/views/serviceDirective/serviceType/components/ConfigServiceTypeModal.vue deleted file mode 100644 index 0b17b0d..0000000 --- a/src/views/serviceDirective/serviceType/components/ConfigServiceTypeModal.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - diff --git a/src/views/serviceDirective/serviceDirective/ConfigServiceDirective.api.ts b/src/views/services/serviceDirective/ConfigServiceDirective.api.ts similarity index 100% rename from src/views/serviceDirective/serviceDirective/ConfigServiceDirective.api.ts rename to src/views/services/serviceDirective/ConfigServiceDirective.api.ts diff --git a/src/views/serviceDirective/serviceDirective/ConfigServiceDirective.data.ts b/src/views/services/serviceDirective/ConfigServiceDirective.data.ts similarity index 93% rename from src/views/serviceDirective/serviceDirective/ConfigServiceDirective.data.ts rename to src/views/services/serviceDirective/ConfigServiceDirective.data.ts index b2f5157..2c9e383 100644 --- a/src/views/serviceDirective/serviceDirective/ConfigServiceDirective.data.ts +++ b/src/views/services/serviceDirective/ConfigServiceDirective.data.ts @@ -5,6 +5,17 @@ import { render } from '/@/utils/common/renderUtils'; import { getWeekMonthQuarterYear } from '/@/utils'; //列表数据 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', @@ -25,26 +36,29 @@ 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: 'directiveName', }, { - title: '指令标签', + title: '体型标签', align: 'center', - dataIndex: 'tagList', + dataIndex: 'bodyTagList', + width: 150, + ellipsis: false, + format(text, record, index) { + if (!!text && text.length > 0) { + return text.map((item) => item.tagName).join('、'); + } else { + return '-'; + } + }, + }, + { + title: '情绪标签', + align: 'center', + dataIndex: 'emotionTagList', width: 150, ellipsis: false, format(text, record, index) { diff --git a/src/views/serviceDirective/serviceDirective/ConfigServiceDirectiveListCom.vue b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue similarity index 100% rename from src/views/serviceDirective/serviceDirective/ConfigServiceDirectiveListCom.vue rename to src/views/services/serviceDirective/ConfigServiceDirectiveList.vue diff --git a/src/views/serviceDirective/serviceDirective/components/ConfigServiceDirectiveForm.vue b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue similarity index 87% rename from src/views/serviceDirective/serviceDirective/components/ConfigServiceDirectiveForm.vue rename to src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue index 93661d0..fca42df 100644 --- a/src/views/serviceDirective/serviceDirective/components/ConfigServiceDirectiveForm.vue +++ b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue @@ -5,10 +5,18 @@ + + + + + - @@ -16,15 +24,8 @@ - - - - - - + @@ -33,7 +34,7 @@ - - + - + @@ -96,17 +90,23 @@ --> - - + + + + + + - +