-- 项目创建修改

This commit is contained in:
yuping
2022-12-02 16:24:42 +08:00
parent d42e3442c5
commit 54031306de
10 changed files with 1204 additions and 3638 deletions

View File

@@ -0,0 +1,62 @@
<template>
<a-tree-select
v-model:value="id"
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
placeholder="自动带出 可修改"
allow-clear
:tree-data="options"
:fieldNames="{
children: 'treeChildList',
label: 'name',
value: 'id',
}"
:disabled="viewDetail ? true : false"
@change="change"
dropdownClassName="treeDropdown"
>
</a-tree-select>
</template>
<script>
import {onMounted, reactive, toRefs, watch} from "vue";
import {useStore} from "vuex";
export default {
name: "OrgClass",
props: {
modelValue: {
type: Number,
},
name: {
type: String,
},
disabled: {
type: Boolean,
default: false
},
},
setup(props, ctx) {
const store = useStore();
const state = reactive({
options: [],
id: props.value
});
watch(state.id, () => {
ctx.emit('update:modelValue', state.id)
})
onMounted(() => {
state.options = [{id: props.modelValue, name: props.name}, ...store.state.orgtreeList]
})
function change(key, obj) {
ctx.emit('update:name', obj[0])
}
return {
...toRefs(state),
change
};
},
};
</script>