@leevan/jtui 2.0.24 → 2.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/tableTest/table-ptbg.vue +2 -2
- package/lib/jtui.common.js +54 -50
- package/lib/jtui.umd.js +54 -50
- package/lib/jtui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/jt-table/index.vue +10 -7
- package/packages/jt-table-pc/data2.js +1 -1
package/package.json
CHANGED
|
@@ -1050,6 +1050,9 @@ export default {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
},
|
|
1053
|
+
objectTxt(cellValue){
|
|
1054
|
+
return typeof cellValue == 'object' && cellValue !=null ? JSON.stringify(cellValue) : cellValue
|
|
1055
|
+
},
|
|
1053
1056
|
//枚举转换
|
|
1054
1057
|
formatEnum({ column, cellValue }) {
|
|
1055
1058
|
try {
|
|
@@ -1074,16 +1077,16 @@ export default {
|
|
|
1074
1077
|
></span>`;
|
|
1075
1078
|
}
|
|
1076
1079
|
});
|
|
1077
|
-
return str ? str : cellValue;
|
|
1080
|
+
return str ? str : this.objectTxt(cellValue);
|
|
1078
1081
|
} else {
|
|
1079
1082
|
let item = data.html.find((item) => item.value == cellValue);
|
|
1080
1083
|
return item
|
|
1081
1084
|
? `<span class="jtIcon ${item.icon}" style="color:${item.color};font-size:${item.size}px"></span>`
|
|
1082
|
-
: cellValue;
|
|
1085
|
+
: this.objectTxt(cellValue);
|
|
1083
1086
|
}
|
|
1084
1087
|
} else if (data.htmlType == "a") {
|
|
1085
1088
|
let item = data.html.find((item) => item.value == cellValue);
|
|
1086
|
-
return item ? `<a href="javascript:">${cellValue}</a>` : cellValue;
|
|
1089
|
+
return item ? `<a href="javascript:">${cellValue}</a>` : this.objectTxt(cellValue);
|
|
1087
1090
|
}else if(data.htmlType == 'tag'){
|
|
1088
1091
|
let item = data.html.find((item) => item.value == cellValue);
|
|
1089
1092
|
return item ? `<span style="
|
|
@@ -1098,17 +1101,17 @@ export default {
|
|
|
1098
1101
|
border-radius: 4px;
|
|
1099
1102
|
box-sizing: border-box;
|
|
1100
1103
|
white-space: nowrap;
|
|
1101
|
-
">${item.label}</span>` : cellValue;
|
|
1104
|
+
">${item.label}</span>` : this.objectTxt(cellValue);
|
|
1102
1105
|
}
|
|
1103
1106
|
} else if (data && "enum" in data) {
|
|
1104
1107
|
let item = data.enum.find((item) => item.value == cellValue);
|
|
1105
|
-
return item ? item.label : cellValue;
|
|
1108
|
+
return item ? item.label : this.objectTxt(cellValue);
|
|
1106
1109
|
} else {
|
|
1107
|
-
return cellValue;
|
|
1110
|
+
return this.objectTxt(cellValue);
|
|
1108
1111
|
}
|
|
1109
1112
|
} catch (error) {
|
|
1110
1113
|
console.log(error);
|
|
1111
|
-
return cellValue;
|
|
1114
|
+
return this.objectTxt(cellValue);
|
|
1112
1115
|
}
|
|
1113
1116
|
},
|
|
1114
1117
|
//全局排序自定义排序方法
|