This commit is contained in:
zdg 2024-08-07 12:26:30 +08:00
commit c9d377aa74
2 changed files with 28 additions and 7 deletions

View File

@ -23,7 +23,7 @@
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="editUserInfo">
<el-button type="primary" @click="editUserInfo" :loading="subjectLoading">
确定
</el-button>
</div>
@ -33,7 +33,7 @@
</template>
<script setup>
import { ref, onMounted, watch } from 'vue'
import { ref, watch } from 'vue'
import { listEvaluation } from '@/api/subject'
import { updateUserInfo } from '@/api/system/user'
import useUserStore from '@/store/modules/user'
@ -42,12 +42,20 @@ const userStore = useUserStore()
const { userId, userName } = userStore.user
const props = defineProps({
loginData: {
type: Object,
default(){
return {}
}
},
modelValue: {
type: Boolean,
default: false
},
})
const subjectLoading = ref(false)
// emit
const emit = defineEmits(['update:modelValue', 'onSuccess'])
@ -111,8 +119,18 @@ const editUserInfo = async () =>{
edustage: gradeVal.value,
edusubject: subjectVal.value
}
await updateUserInfo(data)
await userStore.getInfo()
//
//
subjectLoading.value = true
try {
//
await updateUserInfo(data)
await userStore.login(props.loginData)
await userStore.getInfo()
} finally {
subjectLoading.value = false
}
emit('onSuccess')
}
@ -148,5 +166,7 @@ watch(() => props.modelValue, (newVal) => {
-webkit-app-region: no-drag;
}
.el-select-dropdown__item{
-webkit-app-region: no-drag;
}
</style>

View File

@ -24,7 +24,7 @@
</div>
</div>
<!--选择学科-->
<SelectSubject v-model="isSubject" @onSuccess="successEditSubject" />
<SelectSubject v-model="isSubject" :loginData="loginForm" @onSuccess="successEditSubject"/>
</template>
<script setup>
import { onMounted, reactive, ref } from 'vue'
@ -35,7 +35,7 @@ import leftBg2 from '@/assets/images/login/left-bg2.png'
import WindowTools from '@/components/window-tools/index.vue'
import SelectSubject from '@/components/select-subject/index.vue'
const { BrowserWindow, session } = require('@electron/remote')
const { session } = require('@electron/remote')
const { ipcRenderer } = window.electron || {}
const formRef = ref()
@ -48,6 +48,7 @@ const loginForm = reactive({
password: '',
rememberMe: false
})
//
const rules = reactive({
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],