|
@@ -1,59 +1,67 @@
|
|
|
-<script setup lang="ts">
|
|
|
+<script lang="ts">
|
|
|
import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
|
|
|
import {useVModel} from "@vueuse/core/index";
|
|
|
import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
|
|
|
import XEUtils from "xe-utils";
|
|
|
+import {defineComponent} from "vue";
|
|
|
+import {getPersonnelAll} from "@/api/public-api";
|
|
|
|
|
|
-const props = defineProps({
|
|
|
- ...CyComboGridProps,
|
|
|
- tableHeader: {
|
|
|
- type: Array,
|
|
|
- default: () => [
|
|
|
- {code: 'codeRs', name: '工号', width: '50px'},
|
|
|
- {code: 'label', name: '名称', width: '80px'},
|
|
|
- {code: 'deptCodeName', name: '科室', width: '90px'},
|
|
|
- {code: 'title', name: '职称', width: '90px'},
|
|
|
- ]
|
|
|
- },
|
|
|
- filterSpecifiedEncoding: {
|
|
|
- type: Array,
|
|
|
- default: () => []
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
-const emits = defineEmits([
|
|
|
- 'update:modelValue'
|
|
|
-])
|
|
|
-
|
|
|
-const mValue = useVModel(props, 'modelValue', emits)
|
|
|
+const staffSelect = ref<any[]>([])
|
|
|
|
|
|
-const tempData = computed(() => {
|
|
|
- if (props.filterSpecifiedEncoding?.length > 0) {
|
|
|
- return staffSelect.value.filter(item => props.filterSpecifiedEncoding?.includes(item.value))
|
|
|
- }
|
|
|
- return staffSelect.value
|
|
|
+getPersonnelAll().then(res => {
|
|
|
+ // @ts-ignore
|
|
|
+ staffSelect.value = res
|
|
|
})
|
|
|
|
|
|
-const tempBind = computed(() => {
|
|
|
- const temp: any = {}
|
|
|
- for (const key in props) {
|
|
|
- if (XEUtils.has(CyComboGridProps, key)) {
|
|
|
- // @ts-ignore
|
|
|
- temp[key] = props[key]
|
|
|
+export default defineComponent({
|
|
|
+ name: 'SystemStaffSelect',
|
|
|
+ components: {CyComboGrid},
|
|
|
+ props: {
|
|
|
+ ...CyComboGridProps,
|
|
|
+ tableHeader: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [
|
|
|
+ {code: 'codeRs', name: '工号', width: '50px'},
|
|
|
+ {code: 'label', name: '名称', width: '80px'},
|
|
|
+ {code: 'deptCodeName', name: '科室', width: '90px'},
|
|
|
+ {code: 'title', name: '职称', width: '90px'},
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ filterSpecifiedEncoding: {
|
|
|
+ type: Array,
|
|
|
+ default: () => []
|
|
|
}
|
|
|
- }
|
|
|
- return temp
|
|
|
-})
|
|
|
-</script>
|
|
|
+ },
|
|
|
+ emits: [
|
|
|
+ 'update:modelValue'
|
|
|
+ ],
|
|
|
+ setup(props, {emit}) {
|
|
|
+ const mValue = useVModel(props, 'modelValue', emit)
|
|
|
|
|
|
+ const tempData = computed(() => {
|
|
|
+ if (props.filterSpecifiedEncoding?.length > 0) {
|
|
|
+ return staffSelect.value.filter(item => props.filterSpecifiedEncoding?.includes(item.value))
|
|
|
+ }
|
|
|
+ return staffSelect.value
|
|
|
+ })
|
|
|
|
|
|
-<script lang="ts">
|
|
|
-import {getPersonnelAll} from "@/api/public-api";
|
|
|
+ const tempBind = computed(() => {
|
|
|
+ const temp: any = {}
|
|
|
+ for (const key in props) {
|
|
|
+ if (XEUtils.has(CyComboGridProps, key)) {
|
|
|
+ // @ts-ignore
|
|
|
+ temp[key] = props[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+ })
|
|
|
|
|
|
-const staffSelect = ref<any[]>([])
|
|
|
-
|
|
|
-getPersonnelAll().then(res => {
|
|
|
- staffSelect.value = res as any[]
|
|
|
+ return {
|
|
|
+ tempBind,
|
|
|
+ tempData,
|
|
|
+ mValue
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
</script>
|