+
!['action', 'focususers', 'score'].includes(item.key))
+ .filter(item => !['action', 'focususers', 'score', 'selection'].includes(item.key))
.map((d, i) => ({
name: d.key,
sort: i,
@@ -323,7 +323,6 @@ export default {
key: d.name,
isShow: d.isShow,
type: d.type,
- width: d.width,
//20220415需求调整为标题可配置
disabled: d.name == '_' ? 1 : d.disabled,
isDisabled: d.name == 'title',
@@ -334,7 +333,29 @@ export default {
}));
// 页码
if (this.tableConfig.theadList.length <= 0) {
- this.tableConfig.theadList = theadList;
+ let newTheadList = [];
+ theadList.forEach((item) => {
+ if (item && item.key) {
+ newTheadList.push(this.getColumnWidth(item));
+ }
+ });
+ // 添加操作
+ let isAction = newTheadList.find(d => d.key === 'action');
+ let isSelection = newTheadList.find(d => d.key === 'selection');
+ if (!isAction) {
+ newTheadList.push({
+ key: 'action',
+ align: 'right',
+ width: 20,
+ isShow: 1
+ });
+ }
+ if (!isSelection) {
+ newTheadList.unshift({
+ key: 'selection'
+ });
+ }
+ this.tableConfig.theadList = [...newTheadList];
}
this.tableConfig.rowNum = data.rowNum;
this.tableConfig.pageSize = data.pageSize;
@@ -386,6 +407,15 @@ export default {
this.getListOperation(idList);
}
},
+ getColumnWidth(item = {}) {
+ const newItem = {...item };
+ if (item && item.key == 'focususers') {
+ // 解决关注工单字段,没有title导致页面宽度会有抖动的问题
+ newItem.width = 50;
+ newItem.style = {width: '50px', display: 'inline-block'};
+ }
+ return newItem;
+ },
checkExpire(timeList) {
let timeLeftMin, expireStatus, expireTimeMin, expiredSlaName, willOverTimeMin, willOverSlaName;
if (timeList && timeList.length > 0) {
@@ -462,24 +492,6 @@ export default {
}
});
});
- // 添加操作
- let isAction = this.tableConfig.theadList.find(d => d.key === 'action');
- if (!isAction) {
- this.tableConfig.theadList.push({
- //这个是最后一行操作栏
- key: 'action',
- align: 'right',
- width: 10,
- isShow: 1
- });
- }
- //选择列表
- let isSelection = this.tableConfig.theadList.find(d => d.key === 'selection');
- if (!isSelection) {
- this.tableConfig.theadList.unshift({
- key: 'selection'
- });
- }
}
});
},