10 changed files with 3276 additions and 2994 deletions
File diff suppressed because it is too large
@ -0,0 +1,50 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-12-03 14:29:45 |
|||
@ 备注: 树型组件 |
|||
--> |
|||
<script lang="ts" setup> |
|||
import { stringToObj } from "@/utils/DesignForm/form"; |
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
modelValue?: string; |
|||
disabled?: boolean; |
|||
action?: string; |
|||
name?: string; |
|||
fileList?: Object; |
|||
control?: Object; |
|||
config?: Object; |
|||
data?: Object; |
|||
options?: Object; |
|||
}>(), |
|||
{} |
|||
); |
|||
const emits = defineEmits<{ |
|||
(e: "update:modelValue", value: string): void; |
|||
}>(); |
|||
const value = computed({ |
|||
get: () => { |
|||
console.log("图片上传处理-112->", props.modelValue, stringToObj(props.modelValue)); |
|||
return stringToObj(props.modelValue); |
|||
}, |
|||
set: (newVal: any) => { |
|||
emits("update:modelValue", newVal); |
|||
return newVal; |
|||
}, |
|||
}); |
|||
const handleChange = () => {}; |
|||
const cascaderProps = { |
|||
label: "label", |
|||
value: "value", |
|||
children: "children", |
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-tree-select |
|||
v-model="value" |
|||
:data="props.data" |
|||
clearable |
|||
:render-after-expand="false" |
|||
/> |
|||
</template> |
|||
<style lang="scss" scoped></style> |
|||
File diff suppressed because it is too large
@ -0,0 +1,101 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-12-05 09:26:54 |
|||
@ 备注: 搜索用部门 |
|||
--> |
|||
<script lang="ts" setup> |
|||
import { orgAndPeople } from "@/api/displayboardapi/types"; |
|||
import { getPeopleKey, getUserCont } from "@/api/hr/people/index"; |
|||
import { govthree } from "@/api/opk/opk/api"; |
|||
|
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
modelValue: any; // 子表和弹性布局时时有传 |
|||
}>(), |
|||
{} |
|||
); |
|||
const emits = defineEmits(["update:modelValue"]); |
|||
const orgList = ref<orgAndPeople[]>(); |
|||
const orgLoading = ref(false); |
|||
const orgTree = { |
|||
label: "name", |
|||
children: "child", |
|||
}; |
|||
|
|||
const value = computed({ |
|||
get() { |
|||
console.log("行政组织-1--》", props.modelValue); |
|||
if ( |
|||
props.modelValue != "" && |
|||
props.modelValue != undefined && |
|||
props.modelValue != null |
|||
) { |
|||
return props.modelValue * 1; |
|||
} else { |
|||
return props.modelValue; |
|||
} |
|||
}, |
|||
set(newVal: any) { |
|||
emits("update:modelValue", newVal); |
|||
// updateModel(newVal) |
|||
return newVal; |
|||
}, |
|||
}); |
|||
|
|||
onMounted(() => { |
|||
orgLoading.value = true; |
|||
getUserCont() |
|||
.then((data: any) => { |
|||
let orgId = data.data.organization * 1; |
|||
let companyId = data.data.company * 1; |
|||
if (companyId == null || companyId == "" || companyId == "0" || companyId == 0) { |
|||
companyId = 309; |
|||
} |
|||
if (orgId == null || orgId == "" || orgId == "0" || orgId == 0) { |
|||
orgId = ""; |
|||
} |
|||
nextTick(() => { |
|||
govthree({ id: companyId, all: 1 }) |
|||
.then(({ data }) => { |
|||
orgList.value = data; |
|||
if ( |
|||
Number.isNaN(value.value) || |
|||
isNaN(value.value) || |
|||
value.value == null || |
|||
value.value == "" || |
|||
value.value == "0" || |
|||
value.value == 0 || |
|||
value.value == undefined |
|||
) { |
|||
nextTick(() => { |
|||
value.value = orgId; |
|||
console.log("行政组织---》", orgId, value.value); |
|||
}); |
|||
} |
|||
}) |
|||
.finally(() => { |
|||
orgLoading.value = false; |
|||
}); |
|||
}); |
|||
}) |
|||
.finally(() => { |
|||
orgLoading.value = false; |
|||
}); |
|||
}); |
|||
</script> |
|||
<template> |
|||
<el-tree-select |
|||
v-loading="orgLoading" |
|||
element-loading-text="Loading..." |
|||
v-model="value" |
|||
:data="orgList" |
|||
:props="orgTree" |
|||
:render-after-expand="false" |
|||
:filterable="true" |
|||
node-key="id" |
|||
clearable |
|||
check-strictly |
|||
style="width: 140px" |
|||
/> |
|||
</template> |
|||
<style lang="scss" scoped></style> |
|||
Loading…
Reference in new issue