[update] 树形弹窗组件

This commit is contained in:
lideqin
2024-08-06 18:19:39 +08:00
parent f6e647a3ae
commit cbd18a1244
2 changed files with 29 additions and 6 deletions
@@ -9,7 +9,7 @@
@ok="handleOk"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<div class="modal-content">
<a-input-search style="margin-bottom: 1px" :placeholder="$t('pleaseEnter') + $t('treeSelection.primaryNodeName')" @search="onSearch" />
<a-tree
ref="tree"
@@ -34,7 +34,16 @@
<span v-else>{{name}}</span>
</template>
</a-tree>
</a-spin>
</div>
<p class="modal-content-title">{{ $t('treeSelection.selectedData') }}</p>
<div v-if="dataSourceRight && dataSourceRight.length > 0" class="name-content">
<div v-for="(item, index) in dataSourceRight" :key="item.code" class="name-div">
{{ item.name }}
<a-icon type="close" @click="handleDelete(item, index)" />
</div>
</div>
<a-empty v-else />
</j-modal>
</template>
@@ -97,6 +106,17 @@ export default {
type: String,
default: 'name',
required: false
},
dictId: {
type: String,
required: false,
default: ''
},
// 懒加载接口,默认是涉及系统/部件的懒加载接口
lazyLoadHref: {
type: String,
required: false,
default: '/laws/dictTree/getChild'
}
},
computed: {
@@ -229,10 +249,7 @@ export default {
getTreeData () {
this.confirmLoading = true
const params = {}
// 查询条件的名称
params[this.searchFieldName] = this.searchValue
// 展开的节点
// params.expandedKeys = this.expandedKeys.join(',')
params.dictId = this.dictId
getAction(this.optionsHref, params).then(res => {
if (res.success) {
this.treeData = res.result.records || res.result
@@ -10,6 +10,7 @@
:value="value"
:storeField="storeField"
:textField="textField"
:dict-id="dictId"
:options-href="optionsHref"
@ok="handleOK"/>
</div>
@@ -75,6 +76,11 @@ export default {
type: String,
required: false,
default: ''
},
dictId: {
type: String,
required: false,
default: ''
}
},
data () {