完成教师档案

This commit is contained in:
Net 2025-05-13 15:39:44 +08:00
parent 6696e5986e
commit 333316f207
20 changed files with 1053 additions and 508 deletions

View File

@ -1,26 +1,20 @@
// 参数接口
// 响应接口
import {get, post} from "@/utils/request";
import { get, post } from "@/utils/request";
/**
*
*/
export const serverTimeApi = async () => {
return await get('/api/server/serverTime')
}
export const standardWordsRandomApi = async () => {
return await get('/api/standardWords/findRandom')
}
export const cmsArticleFindPageApi = async (params: any) => {
return await get("/api/cmsArticle/findPage", params);
export const xqgwFindAllApi = async () => {
return await get("/api/xqgw/findAll");
};
export const agencyAgencyListApi = async () => {
return await get("/api/agency/agencyList");
export const xqxjFindAllApi = async () => {
return await get("/api/xqxj/findAll");
};
export const serverCheckInRangeTimeApi = async () => {
return await get("/api/server/checkInRangeTime");
export const findAllNjBjTreeApi = async () => {
return await get("/api/nj/findAllNjBjTree");
};
export const jsConfirmJsDataApi = async (params: any) => {
return await post("/api/js/confirmJsData", params);
};

View File

@ -1,9 +1,13 @@
import {get, post} from "@/utils/request";
import { get, post } from "@/utils/request";
//字典接口
export const dicApi = async (param: { pid: number }) => {
return await get("/api/dic/findByPid", param);
};
//字典接口
export const findDicTreeByPidApi = async (param: { pid: number }) => {
return await get("/api/dic/findDicTreeByPid", param);
};
//根据id查询部门
export const deptFindAllDeptsByPidApi = async (param: { pid: number }) => {
@ -12,11 +16,25 @@ export const deptFindAllDeptsByPidApi = async (param: { pid: number }) => {
//刷新token
export const refreshTokenApi = async (param: { refresh_token: string }) => {
return await post("/userlogin/refresh-token?refresh_token=" + param.refresh_token, param);
return await post(
"/userlogin/refresh-token?refresh_token=" + param.refresh_token,
param
);
};
//修改用户部门
export const userSaveApi = async (param: { id: string, deptId: string, deptName: string }) => {
return await post("/api/user/save?deptId=" + param.deptId + '&deptName=' + param.deptName + '&id=' + param.id, param);
export const userSaveApi = async (param: {
id: string;
deptId: string;
deptName: string;
}) => {
return await post(
"/api/user/save?deptId=" +
param.deptId +
"&deptName=" +
param.deptName +
"&id=" +
param.id,
param
);
};

View File

@ -1,14 +1,28 @@
//登录接口
import {get, post} from "@/utils/request";
import { get, post } from "@/utils/request";
//密码登录接口
export const loginPass = async (param: { username: string, password: string, openId: number | string }) => {
return await post("/userlogin/check?username=" + param.username + '&password=' + param.password + '&openId=' + param.openId, param
)
;
export const loginPass = async (param: {
username: string;
password: string;
openId: number | string;
}) => {
return await post(
"/userlogin/check?username=" +
param.username +
"&password=" +
param.password +
"&openId=" +
param.openId,
param
);
};
//验证码登录接口
export const loginCode = async (param: { phone: string | number, code: string | number, openId: number | string }) => {
export const loginCode = async (param: {
phone: string | number;
code: string | number;
openId: number | string;
}) => {
return await post("/open/sms/checkCode", param);
};
//验证码登录接口
@ -16,7 +30,7 @@ export const loginCheckCode = async (param: any) => {
return await post("/open/sms/checkCode", param);
};
//获取验证码接口
export const sendCodeApi = async (param:any) => {
export const sendCodeApi = async (param: any) => {
return await get("/open/sms/sendCode", param);
};
@ -35,15 +49,20 @@ export const authenticationApi = async (param: { userId: string }) => {
return await get("/api/authentication/find-by-user", param);
};
// 汇兴小程序登录
export const huiXingLoginApi = async (param: { token: string }) => {
return await post("/userlogin/appCheck?token=" + param.token, param);
};
//获取公众号票据
export const wxConfigApi = async (param: any) => {
return await post("/userlogin/wxConfig", param);
};
export const checkOpenId = async (param: { openId: string | number, appCode: string }) => {
return await post("/open/sms/checkOpenId", param);
export const checkOpenId = async (param: {
openId: string | number;
appCode: string;
}) => {
return await post("/open/login/js/checkUser", param);
};
export const updateUserApi = async (param: any) => {
return await post("/open/login/js/updateUser", param);
};
export const findJsByPhoneApi = async (param: any) => {
return await get("/api/js/findJsByPhone", param);
};

View File

@ -1,69 +1,124 @@
<template>
<uni-data-picker :popup-title="'请选择'+attrs.label"
<view>
<u-loading-icon
:show="loadingShow"
style="justify-content: start"
size="20"
/>
<uni-data-picker
v-if="!loadingShow"
:popup-title="'请选择' + attrs.label"
:localdata="range"
v-model="newValue"
:map="{text:attrs.componentProps.rangeKey,value:attrs.componentProps.savaKey}"
@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
:map="{
text: attrs.componentProps.rangeKey,
value: attrs.componentProps.savaKey,
}"
@change="onchange"
@nodeclick="onnodeclick"
@popupopened="onpopupopened"
@popupclosed="onpopupclosed"
:readonly="!!attrs.componentProps.disabled"
v-bind="attrs.componentProps"
>
<template #default="{data, error, options}">
<template #default="{ data, error, options }">
<view class="flex-row items-center justify-between py-7 font-13">
<view v-if="error">
<text style="color: red">{{ error }}</text>
</view>
<view v-else-if="data.length" class="flex-row">
<view v-for="(item,index) in data" :key="index" class="selected-item">
<view
v-for="(item, index) in data"
:key="index"
class="selected-item"
>
<text>{{ item.text }}</text>
</view>
</view>
<view class="color-9" v-else-if="!attrs.componentProps.disabled">
<text v-if="attrs.componentProps&&attrs.componentProps.placeholder">{{
attrs.componentProps.placeholder
}}
<text
v-if="attrs.componentProps && attrs.componentProps.placeholder"
>{{ attrs.componentProps.placeholder }}
</text>
<text v-else>请选择{{ attrs.label }}</text>
</view>
<view v-else></view>
<uni-icons type="right" size="18" color="#999999" v-if="!attrs.componentProps.disabled"/>
<uni-icons
type="right"
size="18"
color="#999999"
v-if="!attrs.componentProps.disabled"
/>
</view>
</template>
</uni-data-picker>
</view>
</template>
<script setup>
const props = defineProps(['modelValue'])
const emit = defineEmits(['update:modelValue'])
import { isFunction, map } from "lodash";
const props = defineProps(["modelValue"]);
const emit = defineEmits(["update:modelValue"]);
const newValue = computed({
get() {
return props.modelValue
return props.modelValue;
},
set(value) {
emit('update:modelValue', value)
}
})
const attrs = useAttrs()
emit("update:modelValue", value);
},
});
const attrs = useAttrs();
if (!newValue.value) {
newValue.value = '0'
newValue.value = "0";
}
const range = ref(attrs.componentProps && attrs.componentProps.range || [])
const range = computed({
get() {
if (attrs.componentProps && attrs.componentProps.range) {
return attrs.componentProps.range;
} else {
return [];
}
},
set(value) {
attrs.componentProps.range = value;
},
});
const loadingShow = ref(false);
function initapi() {
if (attrs.componentProps.api && isFunction(attrs.componentProps.api)) {
loadingShow.value = true;
attrs.componentProps.api(attrs.componentProps.param || null).then((res) => {
attrs.componentProps.range =
res[attrs.componentProps.resultKey || "result"];
if (
attrs.componentProps.request &&
isFunction(attrs.componentProps.request)
) {
attrs.componentProps.request(attrs.componentProps.range);
}
loadingShow.value = false;
});
}
}
initapi();
function onchange(e) {
if (
attrs.componentProps.onChange &&
isFunction(attrs.componentProps.onChange)
) {
attrs.componentProps.onChange(e);
}
}
function onnodeclick() {
function onnodeclick() {}
}
function onpopupopened() {}
function onpopupopened() {
}
function onpopupclosed() {
}
function onpopupclosed() {}
</script>
<style lang="scss" scoped>

View File

@ -14,6 +14,7 @@
<FormBasicDataPicker v-bind="attrs" v-if="isShow('BasicDataPicker')" v-model="newValue"/>
<FormBasicSearchList v-bind="attrs" v-if="isShow('BasicSearchList')" v-model="newValue"/>
<FormBasicDateTimes v-bind="attrs" v-if="isShow('BasicDateTimes')" v-model="newValue"/>
<FormBasicTree v-bind="attrs" v-if="isShow('BasicTree')" v-model="newValue"/>
</view>
</template>

View File

@ -26,6 +26,7 @@ type Component =
| 'BasicDataPicker'
| 'BasicSearchList'
| 'BasicDateTimes'
| 'BasicTree'
interface FormsSchema {
field?: string,

View File

@ -1,15 +1,15 @@
const ip: string = "dj.zhongjingzh.com";
const ip: string = "192.168.8.35:8897";
//打包服务器接口代理标识
const SERVERAGENT: string = "/";
//本地代理url地址,配置了就启动代理,没配置就不启动代理
export const HOMEAGENT: string = "";
// 接口地址
export const BASE_URL: string =
process.env.NODE_ENV == "development" ? `http://${ip}/yqdj` : SERVERAGENT;
process.env.NODE_ENV == "development" ? `http://${ip}/zhxy` : SERVERAGENT;
// WebSocket地址
export const BASE_WS_URL: string = `wss://${ip}`;
//图片地址
export const BASE_IMAGE_URL: string = `http://${ip}`;
export const BASE_IMAGE_URL: string = `http://${ip}/zhxy`;
//存token的key
export const AUTH_KEY: string = "satoken";
//token过期返回状态码
@ -17,7 +17,7 @@ export const RESULT_CODE_NOT_LOGIN: number = 10;
//是否打印接口日志
export const ISREQUESTLOG: boolean = false;
//是否打开登录页面拦截
export const ISROUTERINTERCEPT: boolean = false;
export const ISROUTERINTERCEPT: boolean = true;
//配置路由白名单
export const WHITELIST: WhiteList = [];
//主题颜色

View File

@ -1,24 +1,79 @@
<template>
<view class="wh-full">
<BasicLoading :isShow="isShow" bgColor="#fff" isShowTitle textColor="#000" title="启动中..." :type="1"/>
<BasicLoading
:isShow="isShow"
bgColor="#fff"
isShowTitle
textColor="#000"
title="启动中..."
:type="1"
/>
</view>
</template>
<script lang="ts" setup>
import {onShow} from "@dcloudio/uni-app";
import {isTabBar} from "@/utils/uniapp";
import pages from '@/pages.json'
import { onLoad } from "@dcloudio/uni-app";
import pages from "@/pages.json";
import { useDataStore } from "@/store/modules/data";
import { useUserStore } from "@/store/modules/user";
import { checkOpenId, findJsByPhoneApi } from "@/api/system/login";
import { isTabBar } from "@/utils/uniapp";
const isShow = ref(true)
onShow(async () => {
const { setGlobal } = useDataStore();
const { afterLoginAction } = useUserStore();
const { setFile, getFile } = useDataStore();
const isShow = ref(true);
function toHome() {
if (isTabBar()) {
uni.switchTab({
url: '/' + (pages as any).tabBar.list[0].pagePath
})
url: "/" + (pages as any).tabBar.list[0].pagePath,
});
} else {
uni.reLaunch({
url: '/' + pages.pages[1].path
})
url: "/" + pages.pages[1].path,
});
}
})
}
onLoad(async (data: any) => {
data.openId = "123";
if (data && data.openId) {
setGlobal(data);
checkOpenId({ openId: data.openId, appCode: "JS" })
.then(async (res) => {
if (res.resultCode == 1) {
if (res.result) {
afterLoginAction(res.result);
const findJsByPhoneResult = await findJsByPhoneApi({
phone: res.result.telephone,
});
if (findJsByPhoneResult.resultCode == 1) {
if (findJsByPhoneResult.result) {
if (findJsByPhoneResult.result["confirmStatus"] == "A") {
toHome();
} else {
setFile({
...findJsByPhoneResult.result,
...getFile,
});
setTimeout(() => {
uni.reLaunch({
url: "/pages/view/hr/teacherProfile/index",
});
}, 1500);
}
} else {
toHome();
}
}
} else {
uni.reLaunch({
url: "/pages/system/login/login",
});
}
}
})
.catch((err) => {});
}
});
</script>

View File

@ -44,7 +44,7 @@
<input
class="input-field"
type="text"
v-model="formData.name"
v-model="formData.loginName"
placeholder="请输入姓名"
/>
</view>
@ -87,14 +87,24 @@
import { ref, reactive, computed } from "vue";
import CustomUpload from "/src/components/BasicUpload/CustomUpload.vue";
import { onUnmounted } from "vue";
import { hideLoading, showLoading } from "@/utils/uniapp";
import { hideLoading, isTabBar, showLoading } from "@/utils/uniapp";
import { attachmentUpload } from "@/api/system/upload";
import { useDataStore } from "@/store/modules/data";
import {
findJsByPhoneApi,
sendCodeApi,
updateUserApi,
} from "@/api/system/login";
import { useUserStore } from "@/store/modules/user";
import pages from "@/pages.json";
const { getGlobal } = useDataStore();
const formData = reactive({
name: "",
loginName: "",
phone: "",
code: "",
avatar_url: "",
avatarUrl: "",
openId: getGlobal.openId,
appCode: "JS",
});
const countdown = ref(60);
@ -104,7 +114,7 @@ const countdownText = computed(() => {
return isCountingDown.value ? `${countdown.value}s后重试` : "获取验证码";
});
const handleGetCode = () => {
const handleGetCode = async () => {
if (isCountingDown.value) {
return;
}
@ -114,7 +124,14 @@ const handleGetCode = () => {
}
console.log("获取验证码,手机号:", formData.phone);
const result = await sendCodeApi({
phone: formData.phone,
});
if (result.resultCode == 1) {
uni.showToast({ title: "验证码发送成功", icon: "success" });
} else {
uni.showToast({ title: "验证码发送失败", icon: "none" });
}
isCountingDown.value = true;
countdown.value = 60; //
timer = setInterval(() => {
@ -128,25 +145,70 @@ const handleGetCode = () => {
}, 1000);
};
const handleVerify = () => {
function toHome() {
if (isTabBar()) {
uni.switchTab({
url: "/" + (pages as any).tabBar.list[0].pagePath,
});
} else {
uni.reLaunch({
url: "/" + pages.pages[1].path,
});
}
}
const { afterLoginAction } = useUserStore();
const { setFile } = useDataStore();
const handleVerify = async () => {
if (
!formData.name ||
!formData.loginName ||
!formData.phone ||
!formData.code ||
!formData.avatar_url
!formData.avatarUrl
) {
uni.showToast({ title: "请填写完整的验证信息", icon: "none" });
return;
}
console.log("提交验证信息:", formData);
uni.showToast({ title: "验证成功 (模拟)", icon: "success" });
const result = await updateUserApi({
loginName: formData.loginName,
phone: formData.phone,
code: formData.code,
avatarUrl: formData.avatarUrl,
openId: getGlobal.openId,
appCode: "JS",
});
if (result.resultCode == 1) {
afterLoginAction(result.result);
uni.showToast({ title: "验证成功", icon: "success" });
const findJsByPhoneResult = await findJsByPhoneApi({
phone: formData.phone,
});
if (findJsByPhoneResult.resultCode == 1) {
if (findJsByPhoneResult.result) {
if (findJsByPhoneResult.result["confirmStatus"] == "A") {
toHome();
} else {
setFile(findJsByPhoneResult.result);
setTimeout(() => {
uni.reLaunch({
url: "/pages/view/hr/teacherProfile/index",
});
}, 1500);
}
} else {
toHome();
}
}
} else {
uni.showToast({ title: result.message || "验证失败", icon: "none" });
}
};
async function afterRead(event: any) {
showLoading({ title: "上传中" });
const { result } = await attachmentUpload(event.tempFilePaths[0]);
hideLoading();
formData.avatar_url = result[0].filePath;
formData.avatarUrl = result[0].filePath;
}
onUnmounted(() => {
@ -304,3 +366,6 @@ input::placeholder {
font-size: 14px;
}
</style>
function updateUserApi(arg0: { loginName: string; phone: string; code: string;
avatarUrl: string; }) { throw new Error("Function not implemented."); }

View File

@ -30,44 +30,47 @@
<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"/>
<u-button text="下一步" class="mr-15 mr-7" type="primary" @click="submit"/>
</view>
</template>
</BasicLayout>
</template>
<script lang="ts" setup>
import { dicApi } from "@/api/system/dic";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useDataStore } from "@/store/modules/data";
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
field: "brgxId",
label: "与本人关系",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1066646708 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "nl",
field: "name",
label: "姓名",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "address",
label: "地址",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "lxdh",
label: "联系电话",
component: "BasicInput",
required: true,
componentProps: {},
},
]);
@ -80,6 +83,13 @@ function addEducation() {
education.xl.push({ value: {} });
}
const { getFile, setFile } = useDataStore();
if (getFile.jjlxrList && getFile.jjlxrList.length > 0) {
education.xl = map(getFile.jjlxrList, (item) => {
return { value: item };
});
}
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
@ -87,14 +97,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
jjlxrList: map(education.xl, (item) => {
return item.value;
}),
});
navigateTo("/pages/view/hr/teacherProfile/PersonalHonor");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -29,8 +29,18 @@
</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"/>
<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>
@ -38,50 +48,39 @@
<script lang="ts" setup>
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { navigateTo,navigateBack } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { useDataStore } from "@/store/modules/data";
import { navigateTo, navigateBack } from "@/utils/uniapp";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
field: "gztime",
label: "时间",
component: "BasicDateTimes",
required: true,
componentProps: {},
},
{
field: "nl",
field: "gzdw",
label: "学校/单位",
component: "BasicDateTimes",
required: true,
component: "BasicInput",
componentProps: {},
},
{
field: "yhzgx",
field: "zmr",
label: "证明人",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "lxfs",
label: "联系方式",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "zw",
label: "职务",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
label: "联系电话",
component: "BasicInput",
required: true,
componentProps: {},
},
]);
@ -90,6 +89,13 @@ const education = reactive<any>({
xl: [{ value: {} }],
});
const { getFile, setFile } = useDataStore();
if (getFile.gzjlList && getFile.gzjlList.length > 0) {
education.xl = map(getFile.gzjlList, (item) => {
return { value: item };
});
}
function addEducation() {
education.xl.push({ value: {} });
}
@ -101,14 +107,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
gzjlList: map(education.xl, (item) => {
return item.value;
}),
});
navigateTo("/pages/view/hr/teacherProfile/EmergencyContact");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -29,87 +29,108 @@
</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"/>
<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>
</template>
<script lang="ts" setup>
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { navigateTo,navigateBack } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
<script lang="ts" setup>
import { dicApi } from "@/api/system/dic";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useDataStore } from "@/store/modules/data";
import { navigateTo, navigateBack } from "@/utils/uniapp";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
const schema = reactive<FormsSchema[]>([
{
field: "jtcygxId",
label: "与本人关系",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1066646708 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "xm",
label: "与本人关系",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "nl",
label: "姓名",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "cstime",
label: "出生日期",
component: "BasicInput",
required: true,
component: "BasicDateTimes",
componentProps: {},
},
{
field: "yhzgx",
field: "gzdw",
label: "工作单位",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "zw",
label: "职务",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "lxdh",
label: "联系电话",
component: "BasicInput",
required: true,
componentProps: {},
},
]);
]);
const education = reactive<any>({
const education = reactive<any>({
xl: [{ value: {} }],
});
const { getFile, setFile } = useDataStore();
if (getFile.jtcyList && getFile.jtcyList.length > 0) {
education.xl = map(getFile.jtcyList, (item) => {
return { value: item };
});
function addEducation() {
}
function addEducation() {
education.xl.push({ value: {} });
}
}
function deleteMemberFamily(index: number, item: any) {
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
education.xl = list;
}
}
function submit() {
function submit() {
setFile({
...getFile,
jtcyList: map(education.xl, (item) => {
return item.value;
}),
});
navigateTo("/pages/view/hr/teacherProfile/ExperienceInfo");
}
</script>
<style>
.delete-icon {
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>
}
</style>

View File

@ -36,7 +36,7 @@
@click="navigateBack"
/>
<u-button
text="提交"
text="下一步"
class="mr-15 mr-7"
type="primary"
@click="submit"
@ -47,44 +47,40 @@
</template>
<script lang="ts" setup>
import { dicApi } from "@/api/system/dic";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useDataStore } from "@/store/modules/data";
import { navigateTo, navigateBack } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
field: "hjjbId",
label: "获奖级别",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1472324538 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "nl",
field: "bjdw",
label: "颁奖单位",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
label: "获奖类型",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "hjtime",
label: "获奖时间",
component: "BasicDateTimes",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "hjfjId",
label: "上传证书",
component: "BasicUpload",
required: true,
itemProps: {
labelPosition: "top",
},
@ -100,6 +96,13 @@ function addEducation() {
education.xl.push({ value: {} });
}
const { getFile, setFile } = useDataStore();
if (getFile.grRyList && getFile.grRyList.length > 0) {
education.xl = map(getFile.grRyList, (item) => {
return { value: item };
});
}
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
@ -107,15 +110,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
grRyList: map(education.xl, (item) => {
return { ...item.value, hjlxId: "GRRY" };
}),
});
navigateTo("/pages/view/hr/teacherProfile/PublicClassAwards");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -29,59 +29,93 @@
</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"/>
<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 lang="ts" setup>
import {
findAllNjBjTreeApi,
xqgwFindAllApi,
xqxjFindAllApi,
} from "@/api/base/server";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { navigateTo,navigateBack } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { useDataStore } from "@/store/modules/data";
import { navigateTo, navigateBack } from "@/utils/uniapp";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
field: "gwjbId",
label: "岗位级别",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: xqgwFindAllApi,
rangeKey: "gwmc",
savaKey: "id",
},
},
{
field: "nl",
field: "gwrztime",
label: "岗位任职时间",
component: "BasicDateTimes",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "gwrznx",
label: "岗位任职年限",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "xj",
label: "薪级",
component: "BasicPicker",
componentProps: {
api: xqxjFindAllApi,
rangeKey: "xjmc",
savaKey: "id",
},
},
{
field: "zrxk",
label: "主任学科",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
label: "班主任",
field: "jrxk",
label: "兼任学科",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "bzrBjId",
label: "班主任班级",
component: "BasicDataPicker",
componentProps: {
api: findAllNjBjTreeApi,
rangeKey: "title",
savaKey: "key",
},
},
{
field: "dzzw",
label: "党政职务",
component: "BasicInput",
required: true,
componentProps: {},
},
]);
@ -90,6 +124,13 @@ const education = reactive<any>({
xl: [{ value: {} }],
});
const { getFile, setFile } = useDataStore();
if (getFile.rgqkList && getFile.rgqkList.length > 0) {
education.xl = map(getFile.rgqkList, (item) => {
return { value: item };
});
}
function addEducation() {
education.xl.push({ value: {} });
}
@ -101,14 +142,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
rgqkList: map(education.xl, (item) => {
return item.value;
}),
});
navigateTo("/pages/view/hr/teacherProfile/FamilyInfo");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -29,50 +29,57 @@
</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"/>
<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 lang="ts" setup>
import { dicApi } from "@/api/system/dic";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import Template from "@/components/BasicQrcode/_template/template.vue";
import { navigateTo,navigateBack } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { useDataStore } from "@/store/modules/data";
import { navigateTo, navigateBack } from "@/utils/uniapp";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
label: "获奖级别",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1472324538 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "nl",
field: "bjdw",
label: "颁奖单位",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
label: "获奖类型",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "hjtime",
label: "获奖时间",
component: "BasicDateTimes",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "hjfjId",
label: "上传证书",
component: "BasicUpload",
required: true,
@ -91,6 +98,13 @@ function addEducation() {
education.xl.push({ value: {} });
}
const { getFile, setFile } = useDataStore();
if (getFile.gkkRyList && getFile.gkkRyList.length > 0) {
education.xl = map(getFile.gkkRyList, (item) => {
return { value: item };
});
}
function deleteMemberFamily(index: number, item: any) {
const list = cloneDeep(education.xl);
list.splice(index, 1);
@ -98,14 +112,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
gkkRyList: map(education.xl, (item) => {
return { ...item.value, hjlxId: "GKKHJQK" };
}),
});
navigateTo("/pages/view/hr/teacherProfile/RecordMaterials");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -26,20 +26,24 @@
<script setup lang="ts">
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { hideLoading, navigateBack, navigateTo, showLoading } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
const leaveId = ref<string | null>(null);
const signCompRef = ref<any>(null);
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useDataStore } from "@/store/modules/data";
import { jsConfirmJsDataApi } from "@/api/base/server";
const [register, { getValue }] = useForm({
const signTitle = ref<string>("签名");
const [register, { getValue, setValue }] = useForm({
formsProps: {
labelWidth: 120,
},
schema: [
{
field: "ttlx",
label: "上传人像页",
field: "sfzrxy",
label: "身份证人像页",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
@ -47,8 +51,8 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
label: "上传国徽页",
field: "sfzghy",
label: "身份证国徽页",
component: "BasicUpload",
itemProps: {
labelPosition: "top",
@ -56,7 +60,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "dyxlbyz",
label: "第一学历毕业证",
component: "BasicUpload",
itemProps: {
@ -65,7 +69,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "dyxlxwz",
label: "第一学历学位证",
component: "BasicUpload",
itemProps: {
@ -74,7 +78,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "zgxlbyz",
label: "最高学历毕业证",
component: "BasicUpload",
itemProps: {
@ -83,7 +87,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "zgxlxwz",
label: "最高学历学位证",
component: "BasicUpload",
itemProps: {
@ -92,7 +96,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "pthzm",
label: "普通话证明",
component: "BasicUpload",
itemProps: {
@ -101,7 +105,7 @@ const [register, { getValue }] = useForm({
componentProps: {},
},
{
field: "ttlx",
field: "jszgz",
label: "教师资格证",
component: "BasicUpload",
itemProps: {
@ -112,17 +116,41 @@ const [register, { getValue }] = useForm({
],
});
const { getFile, setFile } = useDataStore();
setValue(getFile);
const sign_file = ref<string>("");
async function submit() {
const value = await getValue();
if (!sign_file.value) {
const data = await signCompRef.value.getSyncSignature();
console.log(data);
sign_file.value = data.base64;
}
showLoading("提交中...");
const params = {
...getFile,
...value,
sign_file: sign_file.value,
};
setFile(params);
const res = await jsConfirmJsDataApi(params);
hideLoading();
if (res.resultCode === 1) {
uni.switchTab({
url: "/pages/base/message/index",
});
uni.showToast({
title: "提交成功",
icon: "success",
});
} else {
uni.showToast({
title: "提交失败",
icon: "none",
});
}
}
</script>
<style lang="scss" scoped>
.delete-icon {
position: absolute;
right: 0;
top: 0;
z-index: 1;
}
</style>
<style lang="scss" scoped></style>

View File

@ -20,7 +20,7 @@
</view>
<view
class="flex-row items-center justify-center pb-10 pt-5"
style="border: 1px solid #E8E8E8"
style="border: 1px solid #e8e8e8"
@click="addEducation"
>
<uni-icons type="plus" size="16" color="#447ADE"></uni-icons>
@ -29,73 +29,100 @@
</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"/>
<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 lang="ts" setup>
import { dicApi } from "@/api/system/dic";
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { useDataStore } from "@/store/modules/data";
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
import { cloneDeep, map } from "lodash";
const schema = reactive<FormsSchema[]>([
{
field: "xm",
field: "zcdjId",
label: "职称等级",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 836722710 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
{
field: "nl",
label: "职称类别",
component: "BasicInput",
required: true,
componentProps: {},
},
// {
// field: "zclbId",
// label: "",
// component: "BasicPicker",
// componentProps: {
// api: dicApi,
// param: { pid: 385536488 },
// rangeKey: "dictionaryValue",
// savaKey: "dictionaryCode",
// },
// },
{
field: "yhzgx",
field: "zczyId",
label: "职称专业",
component: "BasicInput",
required: true,
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 2130488509 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "yhzgx",
field: "zcspjg",
label: "职称审批机关",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "zcbzwh",
label: "职称批准文号",
component: "BasicInput",
required: true,
componentProps: {},
},
{
field: "yhzgx",
field: "zcpztime",
label: "职称批准年月",
component: "BasicInput",
required: true,
component: "BasicDateTimes",
componentProps: {},
},
{
field: "yhzgx",
field: "zczsbh",
label: "职称证书编号",
component: "BasicInput",
required: true,
componentProps: {},
},
]);
const { getFile, setFile } = useDataStore();
const education = reactive<any>({
xl: [{ value: {} }],
});
if (getFile.zcxxList && getFile.zcxxList.length > 0) {
education.xl = map(getFile.zcxxList, (item) => {
return { value: item };
});
}
function addEducation() {
education.xl.push({ value: {} });
}
@ -107,14 +134,20 @@ function deleteMemberFamily(index: number, item: any) {
}
function submit() {
setFile({
...getFile,
zcxxList: map(education.xl, (item) => {
return item.value;
}),
});
navigateTo("/pages/view/hr/teacherProfile/PositionInfo");
}
</script>
<style>
.delete-icon {
position: absolute;
right: 0;
top: 0;
right: -13px;
top: -14px;
z-index: 1;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<BasicLayout>
<view class="p-15">
<view class="px-15 pb-15">
<BasicForm @register="register"> </BasicForm>
</view>
<template #bottom>
@ -12,7 +12,7 @@
@click="navigateBack"
/>
<u-button
text="提交"
text="下一步"
class="mr-15 mr-7"
type="primary"
@click="submit"
@ -23,227 +23,365 @@
</template>
<script setup lang="ts">
import { ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { navigateBack, navigateTo } from "@/utils/uniapp";
import { cloneDeep } from "lodash";
const leaveId = ref<string | null>(null);
import { useForm } from "@/components/BasicForm/hooks/useForm";
import { dicApi, findDicTreeByPidApi } from "@/api/system/dic";
import { useDataStore } from "@/store/modules/data";
import { map } from "lodash";
import dayjs from "dayjs";
const [register, { getValue }] = useForm({
const { getFile, setFile } = useDataStore();
const jsjg = ref("");
//
const calculateYearDiff = (startDate: string) => {
if (!startDate) return "";
const start = dayjs(startDate);
const now = dayjs();
return now.diff(start, "year");
};
const [register, { getValue, setValue }] = useForm({
schema: [
{
field: "ttlx",
title: "基础信息",
},
{
field: "jsdah",
label: "档案号",
component: "BasicInput",
componentProps: {
disabled: true,
},
},
{
field: "jsxm",
label: "姓名",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "籍贯",
field: "jsxbId",
label: "性别",
component: "BasicPicker",
componentProps: {},
componentProps: {
api: dicApi,
param: { pid: 13001 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "jsjgId",
label: "籍贯",
component: "BasicDataPicker",
componentProps: {
api: findDicTreeByPidApi,
param: { pid: 3701 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
onChange: (e: any) => {
jsjg.value = map(e.detail.value, (item) => {
return item.text;
}).join("");
},
},
},
{
field: "mzId",
label: "民族",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 19204295 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "sfzh",
label: "身份证号",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "age",
label: "年龄",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "cstime",
label: "出生日期",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
field: "zzmmId",
label: "政治面貌",
component: "BasicPicker",
componentProps: {},
componentProps: {
api: dicApi,
param: { pid: 385536488 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
label: "联系电话",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "电子邮箱",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "rdtime",
label: "入党时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
label: "参公时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
label: "工龄",
field: "lxdh",
label: "联系电话",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "教龄计算年月",
component: "BasicDateTimes",
field: "dzyx",
label: "电子邮箱",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "教龄",
field: "sbkh",
label: "社保卡号",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "进入本单位时间",
component: "BasicDateTimes",
componentProps: {},
title: "学历情况",
},
{
field: "ttlx",
label: "进入单位年限",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "进入来源",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "dyxlId",
label: "初始学历",
component: "BasicPicker",
componentProps: {},
componentProps: {
api: dicApi,
param: { pid: 1914632204 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "dybyyx",
label: "全日制学历毕业院校",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
label: "最后学历",
field: "dybyzy",
label: "全日制学历专业",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "zhxlId",
label: "最后学历",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1914632204 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "zhbyyx",
label: "最后学历毕业院校",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "zhbyzy",
label: "最后学历专业",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "zhbynytime",
label: "最后学历毕业年月",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
field: "xwlbId",
label: "学位类别",
component: "BasicPicker",
componentProps: {},
},
{
field: "ttlx",
label: "学位",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "xw",
label: "学位",
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1513282965 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "xwzy",
label: "学位专业",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
title: "教师资格",
},
{
field: "zgxdId",
label: "教师资格学段",
component: "BasicInput",
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1680570189 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "zgxkId",
label: "教师资格学科",
component: "BasicInput",
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 1029593616 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "zgzs",
label: "教师资格证书号",
component: "BasicInput",
componentProps: {},
},
{
field: "ttlx",
field: "zgnytime",
label: "教师资格取得年月",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
field: "zgzctime",
label: "教师资格注册时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
title: "任职情况",
},
{
field: "cgtime",
label: "参公时间",
component: "BasicDateTimes",
componentProps: {
change: (e: any) => {
const yearDiff = calculateYearDiff(e);
setValue({ jsgl: yearDiff });
},
},
},
{
field: "jsgl",
label: "工龄",
component: "BasicInput",
componentProps: {
disabled: true,
placeholder: "请选择参公时间",
},
},
{
field: "jrdwtime",
label: "进入本单位时间",
component: "BasicDateTimes",
componentProps: {
change: (e: any) => {
const yearDiff = calculateYearDiff(e);
setValue({ jrdwnx: yearDiff });
},
},
},
{
field: "jrdwnx",
label: "进入本单位年限",
component: "BasicInput",
componentProps: {
placeholder: "请选择进入本单位时间",
disabled: true,
},
},
{
field: "jsTime",
label: "教龄时间",
component: "BasicDateTimes",
componentProps: {
change: (e: any) => {
const yearDiff = calculateYearDiff(e);
setValue({ jl: yearDiff });
},
},
},
{
field: "jl",
label: "教龄",
component: "BasicInput",
componentProps: {
disabled: true,
placeholder: "请选择教龄时间",
},
},
{
field: "jrly",
label: "进入来源",
component: "BasicInput",
componentProps: {},
},
{
field: "bzqkId",
label: "编制情况",
component: "BasicInput",
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 290357612 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "zdqkId",
label: "在岗情况",
component: "BasicInput",
componentProps: {},
component: "BasicPicker",
componentProps: {
api: dicApi,
param: { pid: 810984651 },
rangeKey: "dictionaryValue",
savaKey: "dictionaryCode",
},
},
{
field: "ttlx",
field: "fzgsj",
label: "非在岗时间",
component: "BasicDateTimes",
componentProps: {},
},
{
field: "ttlx",
label: "社保卡号",
component: "BasicInput",
componentProps: {},
},
],
});
setValue(getFile);
function submit() {
async function submit() {
try {
const value = await getValue();
setFile({ ...getFile, ...value, jsjg: jsjg.value });
navigateTo("/pages/view/hr/teacherProfile/TitleInfo");
} catch (error) {}
}
</script>

View File

@ -1,23 +1,37 @@
import {defineStore} from "pinia";
import { defineStore } from "pinia";
export const useDataStore = defineStore({
id: 'data',
id: "data",
state: () => ({
data: {}
data: {},
global: {},
file: {},
}),
getters: {
getData(): any {
return this.data
}
return this.data;
},
getGlobal(): any {
return this.global;
},
getFile(): any {
return this.file;
},
},
actions: {
setData(data: any) {
this.data = data
}
this.data = data;
},
setGlobal(data: any) {
this.global = data;
},
setFile(data: any) {
this.file = data;
},
},
persist: {
enabled: true,
detached: true,
H5Storage: localStorage
H5Storage: localStorage,
},
})
});

View File

@ -80,7 +80,7 @@ export const useUserStore = defineStore({
if (value[AUTH_KEY]) {
this.setToken(value[AUTH_KEY])
}
authenticationApi({userId: value.userid}).then(({result}) => {
authenticationApi({userId: value.id}).then(({result}) => {
if (result) {
this.setAuth(result)
}