BUG:原di函数在index.vue中已经无法获了到正确的值
This commit is contained in:
parent
96be81275a
commit
2368046a48
@ -148,7 +148,7 @@
|
|||||||
@:</template>
|
@:</template>
|
||||||
} else if(@column.EffectType == "Select") {
|
} else if(@column.EffectType == "Select") {
|
||||||
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
||||||
@:<el-tag :type="di('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{di('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name}}</el-tag>
|
@:<el-tag :type="dc('@(@column.DictTypeCode)', row.@(@column.LowerPropertyName))?.tagType"> {{dc('@(@column.DictTypeCode)', row.@column.LowerPropertyName)?.name||row.@column.LowerPropertyName)?.value}}</el-tag>
|
||||||
@:</template>
|
@:</template>
|
||||||
} else if(@column.EffectType == "EnumSelector") {
|
} else if(@column.EffectType == "EnumSelector") {
|
||||||
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
@:<template #row_@(@column.LowerPropertyName)="{ row }">
|
||||||
@ -195,10 +195,7 @@ import { Local } from '/@@/utils/storage';
|
|||||||
@:import { codeToName, getConstType } from "/@@/utils/constHelper";
|
@:import { codeToName, getConstType } from "/@@/utils/constHelper";
|
||||||
}
|
}
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "Select") || @Model.TableField.Any(x=>x.EffectType == "EnumSelector")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "Select") || @Model.TableField.Any(x=>x.EffectType == "EnumSelector")){
|
||||||
@:import { getDictLabelByVal as di, getDictDataList as dl } from '/@@/utils/dict-utils';
|
@:import { getDictLabelByCode as dc, getDictLabelByVal as dv, getDictDataList as dl } from '/@@/utils/dict-utils';
|
||||||
}
|
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "EnumSelector")){
|
|
||||||
@:import { getDictLabelByVal as dv } from '/@@/utils/dict-utils';
|
|
||||||
}
|
}
|
||||||
@if(@Model.TableField.Any(x=>x.EffectType == "DatePicker")){
|
@if(@Model.TableField.Any(x=>x.EffectType == "DatePicker")){
|
||||||
@:import { formatDate } from '/@@/utils/formatTime';
|
@:import { formatDate } from '/@@/utils/formatTime';
|
||||||
|
|||||||
@ -132,12 +132,13 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 根据字典类型和代码取字典项
|
// 根据字典类型和代码取字典项
|
||||||
getDictItemByCode(typePCode: string, val: string) {
|
getDictItemByCode(typePCode: string, code: string) {
|
||||||
if (val != undefined && val !== '') {
|
if (code != undefined && code !== '') {
|
||||||
const _val = val.toString();
|
const _code = code.toString();
|
||||||
const ds = this.getDictDatasByCode(typePCode);
|
console.log(ds);
|
||||||
for (const element of ds) {
|
for (const element of ds) {
|
||||||
if (element.code === _val) {
|
if (element.code === _code) {
|
||||||
|
console.log(element);
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,8 +21,12 @@ export function getDictValByLabel(dicName: string, dicItemCode: any): any {
|
|||||||
return stores.getDictValByLabel(dicName, dicItemCode);
|
return stores.getDictValByLabel(dicName, dicItemCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDictLabelByVal(dicName: string, dicItemCode: any): any {
|
export function getDictLabelByVal(dicName: string, dicItemValue: any): any {
|
||||||
return stores.getDictLabelByVal(dicName, dicItemCode);
|
return stores.getDictLabelByVal(dicName, dicItemValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDictLabelByCode(dicName: string, dicItemCode: any): any {
|
||||||
|
return stores.getDictItemByCode(dicName, dicItemCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// select 控件使用,用于获取字典列表,示例如下:
|
// select 控件使用,用于获取字典列表,示例如下:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user