|
@@ -1209,12 +1209,20 @@ export default {
|
|
|
|
|
|
// 设置表格字段样式
|
|
// 设置表格字段样式
|
|
async setFieldStyleData(tableList) {
|
|
async setFieldStyleData(tableList) {
|
|
|
|
+ console.log(JSON.parse(JSON.stringify(tableList)));
|
|
let fieldConditionList = this.styleList.filter(
|
|
let fieldConditionList = this.styleList.filter(
|
|
(item) => item.styleType == 1 || item.styleType == 2
|
|
(item) => item.styleType == 1 || item.styleType == 2
|
|
);
|
|
);
|
|
if (!fieldConditionList.length) return tableList;
|
|
if (!fieldConditionList.length) return tableList;
|
|
let res = await this.setDictStyleData();
|
|
let res = await this.setDictStyleData();
|
|
- this.dictStyleObj = res;
|
|
|
|
|
|
+
|
|
|
|
+ this.dictStyleObj = res.reduce((pre, item) => {
|
|
|
|
+ return {
|
|
|
|
+ ...pre,
|
|
|
|
+ ...item,
|
|
|
|
+ };
|
|
|
|
+ }, {});
|
|
|
|
+ // console.log("this.dictStyleObj", this.dictStyleObj);
|
|
tableList.forEach((row) => {
|
|
tableList.forEach((row) => {
|
|
// if (!row.styleFieldObj) row.styleFieldObj = {};
|
|
// if (!row.styleFieldObj) row.styleFieldObj = {};
|
|
for (let i = 0; i < fieldConditionList.length; i++) {
|
|
for (let i = 0; i < fieldConditionList.length; i++) {
|
|
@@ -1261,11 +1269,10 @@ export default {
|
|
(item) => item.styleType == 2
|
|
(item) => item.styleType == 2
|
|
);
|
|
);
|
|
if (!fieldConditionList.length) return;
|
|
if (!fieldConditionList.length) return;
|
|
-
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- fieldConditionList.forEach((item) => {
|
|
|
|
|
|
+ let PromiseList = fieldConditionList.map((item) => {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ let temp = {};
|
|
try {
|
|
try {
|
|
- let temp = {};
|
|
|
|
listData({
|
|
listData({
|
|
isEnablePaging: false,
|
|
isEnablePaging: false,
|
|
dictType: item.styleCondtion,
|
|
dictType: item.styleCondtion,
|
|
@@ -1278,6 +1285,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ return Promise.all(PromiseList);
|
|
},
|
|
},
|
|
|
|
|
|
// 内链页面跳转
|
|
// 内链页面跳转
|