教师档案调整

This commit is contained in:
hb 2025-06-16 22:49:41 +08:00
parent 7a05e5e544
commit f60f7c759e
2 changed files with 14 additions and 29 deletions

View File

@ -122,7 +122,9 @@ const schema = reactive<FormsSchema[]>([
field: "qqtime", field: "qqtime",
label: "起聘时间", label: "起聘时间",
component: "BasicDateTimes", component: "BasicDateTimes",
componentProps: {}, componentProps: {
mode: "year-month",
},
}, },
{ {
field: "pywjh", field: "pywjh",

View File

@ -19,27 +19,10 @@ import { dicApi, findDicTreeByPidApi } from "@/api/system/dic";
import { useDataStore } from "@/store/modules/data"; import { useDataStore } from "@/store/modules/data";
import { map } from "lodash"; import { map } from "lodash";
import dayjs from "dayjs"; import dayjs from "dayjs";
import chinaCitys from "@/api/base/ChinaCitys.json";
const { getFile, setFile } = useDataStore(); const { getFile, setFile } = useDataStore();
const jsjg = ref(""); 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) => { const calculateYearDiff = (startDate: string) => {
if (!startDate) return ""; if (!startDate) return "";
@ -82,15 +65,15 @@ const [register, { getValue, setValue, setSchema }] = useForm({
label: "籍贯", label: "籍贯",
component: "BasicDataPicker", component: "BasicDataPicker",
componentProps: { componentProps: {
range: cityTreeData.value, api: findDicTreeByPidApi,
rangeKey: "text", param: { pid: 100 },
savaKey: "value", rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
onChange: (e: any) => { onChange: (e: any) => {
const selectedNodes = e.detail.data; jsjg.value = map(e.detail.value, (item) => {
if (selectedNodes && selectedNodes.length > 0) { return item.text;
jsjg.value = selectedNodes.map((node: any) => node.text).join(""); }).join("");
} },
}
}, },
}, },
{ {
@ -175,12 +158,12 @@ const [register, { getValue, setValue, setSchema }] = useForm({
}, },
{ {
field: "jsTime", field: "jsTime",
label: "任教开始时间", label: "教龄计算时间",
component: "BasicDateTime", component: "BasicDateTime",
componentProps: { componentProps: {
mode: "year-month", mode: "year-month",
ok: (e: any) => { ok: (e: any) => {
const yearDiff = calculateYearDiff(e); const yearDiff = calculateYearDiff(e.value);
setValue({ jl: yearDiff }); setValue({ jl: yearDiff });
}, },
}, },