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 @@
-
-
- {{ item.text || item.label }}
+
+
+ {{ item.text || item.label }}
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