160 lines
3.6 KiB
Vue
Raw Normal View History

2025-06-10 16:27:34 +08:00
<template>
<BasicLayout>
<view class="px-15 pb-15">
<BasicForm @register="register"> </BasicForm>
</view>
<template #bottom>
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="上一步"
class="ml-15 mr-7"
:plain="true"
@click="navigateBack"
/>
<u-button
text="下一步"
class="mr-15 mr-7"
type="primary"
@click="submit"
/>
</view>
</template>
</BasicLayout>
</template>
<script setup lang="ts">
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { dicApi } from "@/api/system/dic";
import { useDataStore } from "@/store/modules/data";
import {
findAllNjBjTree,
findAllXxXqNjTree,
kmFindAllApi,
} from "@/api/base/server";
const { getFile, setFile } = useDataStore();
const [register, { getValue, setValue }] = useForm({
schema: [
{
field: "dzzw",
label: "党政职务:",
component: "BasicCheckbox",
itemProps: {
labelPosition: "top",
},
componentProps: {
api: dicApi,
multiple: true,
param: { pid: 1063530116 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "qtzw",
label: "其他职务",
2025-06-10 23:40:49 +08:00
component: "BasicCheckbox",
itemProps: {
labelPosition: "top",
},
componentProps: {
api: dicApi,
multiple: true,
param: { pid: 246682695 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
2025-06-10 16:27:34 +08:00
},
2025-06-11 23:35:00 +08:00
// {
// field: "zrxk",
// label: "主任学科",
// component: "BasicPicker",
// componentProps: {
// api: kmFindAllApi,
// rangeKey: "kmmc",
// savaKey: "id",
// },
// },
// {
// field: "zrbj",
// label: "主任班级",
// component: "BasicPicker",
// componentProps: {
// api: findAllNjBjTree,
// rangeKey: "title",
// savaKey: "key",
// },
// },
// {
// field: "jrxk",
// label: "兼任学科",
// component: "BasicPicker",
// componentProps: {
// api: kmFindAllApi,
// rangeKey: "kmmc",
// savaKey: "id",
// },
// },
// {
// field: "jrbj",
// label: "兼任班级",
// component: "BasicPicker",
// componentProps: {
// api: findAllNjBjTree,
// rangeKey: "title",
// savaKey: "key",
// },
// },
2025-06-10 16:27:34 +08:00
{
field: "njId",
label: "所属年级",
component: "BasicTree",
componentProps: {
api: findAllXxXqNjTree,
rangeKey: "title",
savaKey: "key",
},
},
2025-06-11 23:35:00 +08:00
// {
// field: "bzrBjId",
// label: "班主任班级",
// component: "BasicTree",
// componentProps: {
// api: findAllNjBjTree,
// rangeKey: "title",
// savaKey: "key",
// },
// },
2025-06-10 16:27:34 +08:00
],
});
2025-06-15 11:26:51 +08:00
if (getFile.dzzw && typeof getFile.dzzw == "string") {
2025-06-15 11:22:28 +08:00
setValue({ ...getFile, dzzw: getFile.dzzw.split(",") });
} else {
2025-06-15 11:26:51 +08:00
if (getFile.qtzw && typeof getFile.qtzw == "string") {
2025-06-15 11:22:28 +08:00
setValue({ ...getFile, qtzw: getFile.qtzw.split(",") });
} else {
setValue({ ...getFile, dzzw: [], qtzw: [] });
}
}
2025-06-10 16:27:34 +08:00
async function submit() {
try {
const value = await getValue();
setFile({ ...getFile, ...value });
navigateTo("/pages/view/hr/teacherProfile/TitleInfo");
} catch (error) {}
}
</script>
<style lang="scss" scoped>
.delete-icon {
position: absolute;
right: 0;
top: 0;
z-index: 1;
}
</style>