|
@@ -1,77 +1,83 @@
|
|
|
<script lang="ts">
|
|
|
import CyComboGridProps from "@/components/cy/combo-grid/src/CyComboGridProps";
|
|
|
-import {useVModel} from "@vueuse/core/index";
|
|
|
+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";
|
|
|
+import { defineComponent } from "vue";
|
|
|
+import { getStaffHaveYbCode } from "@/api/public-api";
|
|
|
|
|
|
-const staffSelect = ref<any[]>([])
|
|
|
+const staffSelect = ref<any[]>([]);
|
|
|
|
|
|
-getPersonnelAll().then(res => {
|
|
|
+getStaffHaveYbCode().then(res => {
|
|
|
// @ts-ignore
|
|
|
- staffSelect.value = res
|
|
|
-})
|
|
|
+ staffSelect.value = res;
|
|
|
+});
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'SystemStaffSelect',
|
|
|
- components: {CyComboGrid},
|
|
|
+ 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'},
|
|
|
- ]
|
|
|
+ { code: "codeRs", name: "工号", width: "50px" },
|
|
|
+ { code: "label", name: "名称", width: "80px" },
|
|
|
+ { code: "deptCodeName", name: "科室", width: "90px" },
|
|
|
+ { code: "title", name: "职称", width: "90px" },
|
|
|
+ ],
|
|
|
},
|
|
|
filterSpecifiedEncoding: {
|
|
|
type: Array,
|
|
|
- default: () => []
|
|
|
- }
|
|
|
+ default: () => [],
|
|
|
+ },
|
|
|
},
|
|
|
- emits: [
|
|
|
- 'update:modelValue'
|
|
|
- ],
|
|
|
- setup(props, {emit}) {
|
|
|
- const mValue = useVModel(props, 'modelValue', emit)
|
|
|
+ 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.filter(item =>
|
|
|
+ props.filterSpecifiedEncoding?.includes(item.value)
|
|
|
+ );
|
|
|
}
|
|
|
- return staffSelect.value
|
|
|
- })
|
|
|
+ return staffSelect.value;
|
|
|
+ });
|
|
|
|
|
|
const tempBind = computed(() => {
|
|
|
- const temp: any = {}
|
|
|
+ const temp: any = {};
|
|
|
for (const key in props) {
|
|
|
if (XEUtils.has(CyComboGridProps, key)) {
|
|
|
// @ts-ignore
|
|
|
- temp[key] = props[key]
|
|
|
+ temp[key] = props[key];
|
|
|
}
|
|
|
}
|
|
|
- return temp
|
|
|
- })
|
|
|
+ return temp;
|
|
|
+ });
|
|
|
|
|
|
return {
|
|
|
tempBind,
|
|
|
tempData,
|
|
|
- mValue
|
|
|
- }
|
|
|
+ mValue,
|
|
|
+ };
|
|
|
},
|
|
|
-})
|
|
|
-
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
<template>
|
|
|
<CyComboGrid
|
|
|
- v-bind="tempBind"
|
|
|
- :local-search-key="['codeRs','pyCode', 'dcode', 'code', 'name', 'value', 'label']"
|
|
|
- :data="tempData"
|
|
|
- v-model="mValue"
|
|
|
+ v-bind="tempBind"
|
|
|
+ :local-search-key="[
|
|
|
+ 'codeRs',
|
|
|
+ 'pyCode',
|
|
|
+ 'dcode',
|
|
|
+ 'code',
|
|
|
+ 'name',
|
|
|
+ 'value',
|
|
|
+ 'label',
|
|
|
+ ]"
|
|
|
+ :data="tempData"
|
|
|
+ v-model="mValue"
|
|
|
/>
|
|
|
</template>
|