| | |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | export const getDictionaryBiz = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/dict-biz/dictionary', |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | | :label="item.itemName" |
| | | :value="item.itemValue" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | saveCodeClassifyValueOrder, |
| | | } from "@/api/code/codeClassifyValue"; |
| | | import { getDictionary } from "@/api/omd/enum"; |
| | | import { getDictionaryBiz } from "@/api/system/dictbiz"; |
| | | import optionBasic from "@/const/code/codebasic"; |
| | | import optionRule from "@/const/code/mdmrule"; |
| | | import attrOption from "@/const/code/selectAttrOptionDialog"; |
| | |
| | | this.$refs.crud.doLayout(); |
| | | this.$refs.crudBasic.doLayout(); |
| | | }); |
| | | }, |
| | | // 生命钩子函数 |
| | | beforeDestroy() { |
| | | // 清除指定缓存 |
| | | localStorage.removeItem('codeSecType'); |
| | | localStorage.removeItem('codeSecLength'); |
| | | localStorage.removeItem('codeFillType'); |
| | | localStorage.removeItem('codeLevelType'); |
| | | localStorage.removeItem('codeCutType'); |
| | | localStorage.removeItem('codeGetValueType'); |
| | | }, |
| | | methods: { |
| | | |
| | |
| | | this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType") || []; |
| | | }, |
| | | loadCodeFillSeparator() { |
| | | let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | if (enumCach == null) { |
| | | getDictionary("codeFillSeparator").then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | }); |
| | | } |
| | | //let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | //if (enumCach == null) { |
| | | getDictionaryBiz({code:"codeFillSeparator"}).then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | //console.log(this.enumParam.codeFillSeparator); |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | }); |
| | | //} |
| | | }, |
| | | loadCodeLevelType() { |
| | | this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") || []; |
| | |
| | | return { |
| | | state:this.vaildData(this.permission.flow_manager.flow_manager_state, false), |
| | | image:this.vaildData(this.permission.flow_manager.flow_manager_image, false), |
| | | delBtn: this.vaildData(this.permission.flow_manager.flow_manager_remove, false), |
| | | delBtn: this.vaildData(this.permission.flow_manager.flow_manager_delete, false), |
| | | }; |
| | | }, |
| | | ids() { |
| | |
| | | return { |
| | | addBtn: this.vaildData(this.permission.systemInfo.systemInfo_add, false), |
| | | editBtn: this.vaildData(this.permission.systemInfo.systemInfo_edit, false), |
| | | delBtn: this.vaildData(this.permission.systemInfo.systemInfo_remove, false), |
| | | delBtn: this.vaildData(this.permission.systemInfo.systemInfo_delete, false), |
| | | empower: this.vaildData(this.permission.systemInfo.systemInfo_empower, false), |
| | | } |
| | | }, |
| | |
| | | delBtn: this.vaildData(this.permission.dict.dict_delete, false), |
| | | editBtn: this.vaildData(this.permission.dict.dict_edit, false), |
| | | viewBtn: this.vaildData(this.permission.dict.dict_view, false), |
| | | settingBtn: this.vaildData(this.permission.dict.dict_config,false), |
| | | settingBtn: this.vaildData(this.permission.dict.dict_setting,false), |
| | | addChildBtn: this.vaildData(this.permission.dict.dict_add_child,false), |
| | | }; |
| | | }, |
| | |
| | | delBtn: this.vaildData(this.permission.dictbiz.dictbiz_delete, false), |
| | | editBtn: this.vaildData(this.permission.dictbiz.dictbiz_edit, false), |
| | | viewBtn: this.vaildData(this.permission.dictbiz.dictbiz_view, false), |
| | | settingBtn: this.vaildData(this.permission.dictbiz.dictbiz_config, false), |
| | | addChildBtn: this.vaildData(this.permission.dictbiz.dictbiz_add_child,false), |
| | | settingBtn: this.vaildData(this.permission.dictbiz.dictbiz_setting, false), |
| | | // addChildBtn: this.vaildData(this.permission.dictbiz.dictbiz_add_child,false), |
| | | }; |
| | | }, |
| | | ids() { |
| | |
| | | |
| | | @Override |
| | | public R checkOrInsert(DictBiz dictBiz) { |
| | | |
| | | LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()).eq(DictBiz::getDictValue, dictBiz.getDictValue()); |
| | | Long cnt = baseMapper.selectCount((Func.isEmpty(dictBiz.getId())) ? lqw : lqw.notIn(DictBiz::getId, dictBiz.getId())); |
| | | LambdaQueryWrapper<DictBiz> wrapper = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dictBiz.getCode()).eq(DictBiz::getDictKey, dictBiz.getDictKey()).eq(DictBiz::getDictValue, dictBiz.getDictValue()); |
| | | // Long cnt = baseMapper.selectCount((Func.isEmpty(dictBiz.getId())) ? lqw : lqw.notIn(DictBiz::getId, dictBiz.getId())); |
| | | Long cnt = baseMapper.selectCount(wrapper); |
| | | if (cnt > 0L) { |
| | | return R.fail("字典已经存在!"); |
| | | } |
| | | |
| | | // 根据code先查询是否已存在该字典,存在就需要将当前字典添加到该code下面 |
| | | LambdaQueryWrapper<DictBiz> wrappers = Wrappers.<DictBiz>query() |
| | | .lambda().eq(DictBiz::getCode, dictBiz.getCode()) |
| | | .eq(DictBiz::getParentId,BladeConstant.TOP_PARENT_ID) |
| | | .last("limit 1"); |
| | | DictBiz dbDictBiz = baseMapper.selectOne(wrappers); |
| | | // 当前code已存在,作为当前父字典 |
| | | if(Func.isNotEmpty(dbDictBiz)){ |
| | | dictBiz.setParentId(dbDictBiz.getId()); |
| | | } |
| | | // 是否为顶层字典 |
| | | if (Func.isEmpty(dictBiz.getParentId())) { |
| | | dictBiz.setParentId(BladeConstant.TOP_PARENT_ID); |
| | | } |
| | | dictBiz.setIsSealed(0); |
| | | dictBiz.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
| | | CacheUtil.clear(DICT_CACHE); |
| | | |
| | |
| | | return R.success("操作成功!"); |
| | | } |
| | | return R.fail("操作失败!"); |
| | | |
| | | } |
| | | |
| | | } |