fix : 优化审批记录、用户账号切换点击位置、所属公司选择框
This commit is contained in:
@@ -89,7 +89,6 @@ const props = defineProps({
|
||||
type: Boolean
|
||||
}
|
||||
});
|
||||
const isChooseAll = ref(true);
|
||||
let selectItem = reactive({
|
||||
type: -1,
|
||||
value: "0"
|
||||
@@ -138,22 +137,14 @@ const checkBoxChange = (val) => {
|
||||
}
|
||||
const matterTree = (list, flag) => {
|
||||
list.forEach(item => {
|
||||
if (!flag&&item.value!==-1) {
|
||||
if (!flag) {
|
||||
tree.value.setChecked(item, false)
|
||||
}
|
||||
if (item.children !== undefined) {
|
||||
matterTree(item.children)
|
||||
matterTree(item.children, false)
|
||||
}
|
||||
})
|
||||
}
|
||||
// const cancelAll = () => {
|
||||
// isChooseAll.value = true
|
||||
// tree.value.setCheckedNodes([])
|
||||
// }
|
||||
// const chooseAll = () => {
|
||||
// isChooseAll.value = false
|
||||
// matterTree(dataList.value)
|
||||
// }
|
||||
const getList = () => {
|
||||
getSubCompOpt().then(res => {
|
||||
dataList.value = [
|
||||
@@ -176,15 +167,26 @@ const filterNode = (value, data) => {
|
||||
const show = () => {
|
||||
//用于弹开部门选择
|
||||
visible.value = true;
|
||||
selectList.value = _value.value
|
||||
defaultChecked.value = _value.value.map(item => item.value)
|
||||
if(selectList.value.length==0){
|
||||
selectList.value=[]
|
||||
defaultChecked.value =[]
|
||||
}else {
|
||||
selectList.value = _value.value
|
||||
defaultChecked.value = _value.value.map(item => item.value)
|
||||
}
|
||||
getList()
|
||||
};
|
||||
const handleChange = (data, checked) => {
|
||||
if (data.value == -1&&checked) {
|
||||
// tree.value.setCheckedNodes(['-1'])
|
||||
matterTree(dataList.value, false)
|
||||
// return;
|
||||
if (data.value == -1) {
|
||||
if(checked){
|
||||
checkStrictly.value = false
|
||||
const index = checkList.value.indexOf('2')
|
||||
if (index != -1) {
|
||||
checkList.value.splice(index, 1)
|
||||
}
|
||||
matterTree(dataList.value[0].children, false)
|
||||
tree.value.setChecked(data,true);
|
||||
}
|
||||
}
|
||||
// 左侧有选择框 + 多选
|
||||
if (props.multiple) {
|
||||
|
||||
Reference in New Issue
Block a user