From f60f7c759eb054a64bc536dd008c31d202e1745c Mon Sep 17 00:00:00 2001 From: hb Date: Mon, 16 Jun 2025 22:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=A1=A3=E6=A1=88=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/hr/teacherProfile/TitleInfo.vue | 4 +- src/pages/view/hr/teacherProfile/index.vue | 39 ++++++------------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/pages/view/hr/teacherProfile/TitleInfo.vue b/src/pages/view/hr/teacherProfile/TitleInfo.vue index 9ff92bc..508948f 100644 --- a/src/pages/view/hr/teacherProfile/TitleInfo.vue +++ b/src/pages/view/hr/teacherProfile/TitleInfo.vue @@ -122,7 +122,9 @@ const schema = reactive([ field: "qqtime", label: "起聘时间", component: "BasicDateTimes", - componentProps: {}, + componentProps: { + mode: "year-month", + }, }, { field: "pywjh", diff --git a/src/pages/view/hr/teacherProfile/index.vue b/src/pages/view/hr/teacherProfile/index.vue index b01df4b..b0d53a5 100644 --- a/src/pages/view/hr/teacherProfile/index.vue +++ b/src/pages/view/hr/teacherProfile/index.vue @@ -19,27 +19,10 @@ import { dicApi, findDicTreeByPidApi } from "@/api/system/dic"; import { useDataStore } from "@/store/modules/data"; import { map } from "lodash"; import dayjs from "dayjs"; -import chinaCitys from "@/api/base/ChinaCitys.json"; const { getFile, setFile } = useDataStore(); const jsjg = ref(""); -// 转换省市区数据为树形结构 -const cityTreeData = computed(() => { - return chinaCitys.map(province => ({ - text: province.province, - value: province.code, - children: province.citys.map(city => ({ - text: city.city, - value: city.code, - children: city.areas.map(area => ({ - text: area.area, - value: area.code - })) - })) - })); -}); - // 计算日期与当前日期相差的年数 const calculateYearDiff = (startDate: string) => { if (!startDate) return ""; @@ -82,15 +65,15 @@ const [register, { getValue, setValue, setSchema }] = useForm({ label: "籍贯", component: "BasicDataPicker", componentProps: { - range: cityTreeData.value, - rangeKey: "text", - savaKey: "value", + api: findDicTreeByPidApi, + param: { pid: 100 }, + rangeKey: "dictionaryValue", + savaKey: "dictionaryCode", onChange: (e: any) => { - const selectedNodes = e.detail.data; - if (selectedNodes && selectedNodes.length > 0) { - jsjg.value = selectedNodes.map((node: any) => node.text).join(""); - } - } + jsjg.value = map(e.detail.value, (item) => { + return item.text; + }).join(""); + }, }, }, { @@ -175,12 +158,12 @@ const [register, { getValue, setValue, setSchema }] = useForm({ }, { field: "jsTime", - label: "任教开始时间", + label: "教龄计算时间", component: "BasicDateTime", componentProps: { mode: "year-month", ok: (e: any) => { - const yearDiff = calculateYearDiff(e); + const yearDiff = calculateYearDiff(e.value); setValue({ jl: yearDiff }); }, }, @@ -266,7 +249,7 @@ const [register, { getValue, setValue, setSchema }] = useForm({ component: "BasicInput", componentProps: {}, }, - /*{ + /* { field: "gwjbId", label: "岗位级别", component: "BasicPicker",