|
|
|
@ -21,9 +21,10 @@ |
|
|
|
|
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label-width="150px" label="共享范围" prop="agencyIdArray"> |
|
|
|
<el-cascader class="cell-width-1" ref="agencyIdArray" :clearable="false" filterable |
|
|
|
:filter-method="filter" v-model.trim="agencyIdArray" :options="orgOptions" |
|
|
|
:props="orgOptionProps" :show-all-levels="false" @change="handleChangeAgency" |
|
|
|
<el-cascader class="cell-width-1" ref="myCascader" :clearable="false" filterable @change="handleCascaderChange" |
|
|
|
:filter-method="filter" :options="orgOptions" |
|
|
|
:props="orgOptionProps" :show-all-levels="false" |
|
|
|
collapse-tags |
|
|
|
> |
|
|
|
<template v-slot:tag="{ value, label, index }"> |
|
|
|
<!-- 自定义标签渲染,去掉叉号 --> |
|
|
|
@ -69,7 +70,8 @@ |
|
|
|
value: 'orgId', |
|
|
|
label: 'orgName', |
|
|
|
children: 'subOrgList', |
|
|
|
checkStrictly: true |
|
|
|
checkStrictly: true, |
|
|
|
expandTrigger:'click' |
|
|
|
}, |
|
|
|
orgOptions: [], |
|
|
|
fileList:[], |
|
|
|
@ -118,14 +120,19 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
handleChangeAgency(val){ |
|
|
|
this.formData.sharedScope="" |
|
|
|
if (val.length > 0) { |
|
|
|
this.formData.sharedScope = val.toString(); |
|
|
|
} else { |
|
|
|
this.formData.sharedScope = ""; // 或者设置默认值 |
|
|
|
} |
|
|
|
|
|
|
|
handleCascaderChange(selectedValues) { |
|
|
|
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data |
|
|
|
console.log(selectedValues,obj,this.agencyIdArray,"Sdjksdflkj"); |
|
|
|
// 遍历当前选中的值,如果是父节点,则选中其所有子节点 |
|
|
|
obj.subOrgList.forEach(value => { |
|
|
|
console.log(value,"dsfjkhfsdl"); |
|
|
|
this.agencyIdArray.push(value.orgId) |
|
|
|
// const node = this.findNodeByValue(this.orgOptions, value); |
|
|
|
// if (node && node.children) { |
|
|
|
// findChildren([node]); |
|
|
|
// } |
|
|
|
}); |
|
|
|
// this.agencyIdArray = Array.from(allSelected); // 赋值回去 |
|
|
|
}, |
|
|
|
filter(node, keyword) { |
|
|
|
return node.data.agencyName.includes(keyword) |
|
|
|
|