教师档案调整

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",
label: "起聘时间",
component: "BasicDateTimes",
componentProps: {},
componentProps: {
mode: "year-month",
},
},
{
field: "pywjh",

View File

@ -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 });
},
},