【修改】各类bug修复

This commit is contained in:
zer0Black
2022-04-09 11:14:29 +08:00
parent 0529449685
commit 9669685464
12 changed files with 100 additions and 32 deletions
@@ -62,8 +62,9 @@
import { getAction } from '@/api/manage'
import Ellipsis from '@/components/Ellipsis'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import { cloneObject, pushIfNotExist } from '@/utils/util'
import { pushIfNotExist } from '@/utils/util'
import JSelectBizQueryItem from './JSelectBizQueryItem'
import {cloneDeep} from 'lodash'
export default {
name: 'JSelectBizComponentModal',
@@ -177,11 +178,22 @@
computed: {
// 表头
innerColumns() {
let columns = cloneObject(this.columns)
let columns = cloneDeep(this.columns)
columns.forEach(column => {
// 给所有的列加上过长裁剪
if (this.ellipsisLength !== -1) {
column.customRender = (text) => this.renderEllipsis(text)
let myCustomRender = column.customRender
column.customRender = (text, record, index) => {
let value = text
if (typeof myCustomRender === 'function') {
// noinspection JSVoidFunctionReturnValueUsed
value = myCustomRender(text, record, index)
}
if (typeof value === 'string') {
return this.renderEllipsis(value)
}
return value
}
}
})
return columns
@@ -192,7 +204,7 @@
deep: true,
immediate: true,
handler(val) {
this.innerValue = cloneObject(val)
this.innerValue = cloneDeep(val)
this.selectedRowKeys = []
this.valueWatchHandler(val)
this.queryOptionsByValue(val)
@@ -21,8 +21,8 @@
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
:expandAction="false"
:expandedKeys.sync="expandedKeys"
@select="onDepSelect"
:load-data="onLoadDepartment"
/>
</a-card>
</a-col>
@@ -63,7 +63,7 @@
<script>
import {filterObj} from '@/utils/util'
import {queryDepartTreeList, getUserList, queryUserByDepId} from '@/api/api'
import {queryDepartTreeList, getUserList, queryUserByDepId, queryDepartTreeSync} from '@/api/api'
import { getAction } from '@/api/manage'
export default {
@@ -300,14 +300,35 @@
})
},
queryDepartTree() {
queryDepartTreeList().then((res) => {
//update-begin-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
this.expandedKeys = []
this.departTree = []
queryDepartTreeSync().then((res) => {
if (res.success) {
this.departTree = res.result;
// 默认展开父节点
this.expandedKeys = this.departTree.map(item => item.id)
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
this.departTree.push(temp)
}
}
})
},
onLoadDepartment(treeNode){
return new Promise(resolve => {
queryDepartTreeSync({pid:treeNode.dataRef.id}).then((res) => {
if (res.success) {
//判断chidlren是否为空,并修改isLeaf属性值
if(res.result.length == 0){
treeNode.dataRef['isLeaf']=true
return;
}else{
treeNode.dataRef['children']= res.result;
}
}
})
resolve();
});
},
//update-end-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
modalFormOk() {
this.loadData();
}