Browse Source

没有字典导致没有枚举值问题处理

dev_web_online
安虹睿 2 years ago
parent
commit
92e59025a7
  1. 6
      fe/PC/src/components/umyTable/index.vue
  2. 6
      fe/PC/src/filters/index.js
  3. 4
      fe/PC/src/utils/index.js

6
fe/PC/src/components/umyTable/index.vue

@ -702,9 +702,9 @@ export default {
background: #f6f7fb !important;
border: none !important;
&:last-child{
background: unset !important;
}
// &:last-child{
// background: unset !important;
// }
}
::v-deep .el-form-item__error{
position: relative;

6
fe/PC/src/filters/index.js

@ -114,6 +114,12 @@ export function isTableColumns(data) {
return isData
}
/**
* @param {*} index 枚举值
* @param {*} text 枚举函数名称
* @param {*} prop 返回字段
* @param {*} type dictType
*/
export function trigger(index, text, prop, type) {
let Function = statusType.default[text]
return Function(index, prop, type)

4
fe/PC/src/utils/index.js

@ -386,12 +386,14 @@ export function removeClass(ele, cls) {
//返回
export function Enum(status, index, prop) {
let _no_text = '无'
if(!status)return _no_text
if (index != undefined) { //如果传入的是index
if (prop === 'color') {
const domColor = status[index] ? status[index][prop] : ""
return 'color:' + domColor
} else {
const dom = status[index] ? status[index][prop] : "无"
const dom = status[index] ? status[index][prop] : _no_text
return dom
}
} else {

Loading…
Cancel
Save