Эх сурвалжийг харах

feat: 修改密码用户姓名显示问题修复

chenhao 2 жил өмнө
parent
commit
a9cbb4aed1

+ 4 - 6
src/components/shared/UpdateUserPwd.vue

@@ -15,7 +15,6 @@ import useFetch from '@/hooks/useFetch'
 import useVModel from '@/hooks/useVModel'
 import useVModel from '@/hooks/useVModel'
 import useVW from '@/hooks/useVW'
 import useVW from '@/hooks/useVW'
 import useForm from '@/hooks/useForm'
 import useForm from '@/hooks/useForm'
-import useMainStore from '@/store/main'
 import BaseForm from '@/components/element/BaseForm.vue'
 import BaseForm from '@/components/element/BaseForm.vue'
 import BaseDialog from '@/components/element/BaseDialog.vue'
 import BaseDialog from '@/components/element/BaseDialog.vue'
 import ConfirmButton from '@/components/common/ConfirmButton.vue'
 import ConfirmButton from '@/components/common/ConfirmButton.vue'
@@ -23,25 +22,24 @@ import ConfirmButton from '@/components/common/ConfirmButton.vue'
 import type { EpFormItem, EpFormRules } from 'global-type'
 import type { EpFormItem, EpFormRules } from 'global-type'
 
 
 const props = defineProps<{
 const props = defineProps<{
+  userName: string
   modelValue: boolean
   modelValue: boolean
 }>()
 }>()
 
 
 const visible = useVModel(props, 'modelValue')
 const visible = useVModel(props, 'modelValue')
 
 
-const mainStore = useMainStore()
-
 const { formRef, elFormRef } = useForm()
 const { formRef, elFormRef } = useForm()
 
 
 const userModel = reactive<{ name: string; password: string; rePassword?: string }>({
 const userModel = reactive<{ name: string; password: string; rePassword?: string }>({
-  name: '',
+  name: props.userName,
   password: '',
   password: '',
   rePassword: '',
   rePassword: '',
 })
 })
 
 
 watch(
 watch(
-  () => mainStore.myUserInfo,
+  () => props.userName,
   () => {
   () => {
-    userModel.name = mainStore?.myUserInfo?.name || ''
+    userModel.name = props.userName
   }
   }
 )
 )
 
 

+ 2 - 1
src/components/shared/UserInfo.vue

@@ -3,7 +3,7 @@
     <span>{{ info.userName }}</span>
     <span>{{ info.userName }}</span>
     <span class="m-l-base">{{ info.roleName }}</span>
     <span class="m-l-base">{{ info.roleName }}</span>
   </div>
   </div>
-  <update-user-pwd v-model="visibleUpdatePwd"></update-user-pwd>
+  <update-user-pwd v-model="visibleUpdatePwd" :user-name="info.name || ''"></update-user-pwd>
 </template>
 </template>
 
 
 <script setup lang="ts" name="UserInfo">
 <script setup lang="ts" name="UserInfo">
@@ -18,6 +18,7 @@ const info = computed(() => {
   return {
   return {
     userName: [loginName, name].filter(Boolean).join('-'),
     userName: [loginName, name].filter(Boolean).join('-'),
     roleName,
     roleName,
+    name,
   }
   }
 })
 })
 
 

+ 2 - 1
src/modules/admin-data/paper/components/standard.vue

@@ -3,7 +3,7 @@
     ref="formRef"
     ref="formRef"
     :label-width="useVW(88)"
     :label-width="useVW(88)"
     :groups="groups"
     :groups="groups"
-    :rule="rules"
+    :rules="rules"
     :items="items"
     :items="items"
     :model="model"
     :model="model"
     :disabled="loading"
     :disabled="loading"
@@ -98,6 +98,7 @@ watch(
 const rules: EpFormRules = {
 const rules: EpFormRules = {
   subjectCode: [{ required: true, message: '请选择科目' }],
   subjectCode: [{ required: true, message: '请选择科目' }],
   mainNumber: [{ required: true, message: '请选择大题' }],
   mainNumber: [{ required: true, message: '请选择大题' }],
+  file: [{ required: true, message: '请选择导入文件' }],
 }
 }
 
 
 const groups: FormGroup[] = [
 const groups: FormGroup[] = [

+ 4 - 0
src/modules/analysis/personnel-statistics/components/StatisticsGroup.vue

@@ -17,6 +17,7 @@
 import BaseTable from '@/components/element/BaseTable.vue'
 import BaseTable from '@/components/element/BaseTable.vue'
 import VueECharts from 'vue-echarts'
 import VueECharts from 'vue-echarts'
 import useVW, { usePX } from '@/hooks/useVW'
 import useVW, { usePX } from '@/hooks/useVW'
+import useFetch from '@/hooks/useFetch'
 
 
 import type { ExtractApiResponse } from 'api-type'
 import type { ExtractApiResponse } from 'api-type'
 import type { EpTableColumn } from 'global-type'
 import type { EpTableColumn } from 'global-type'
@@ -60,6 +61,9 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
   { align: 'center', label: '速度', prop: 'markingRate', width: usePX(40) },
   { align: 'center', label: '速度', prop: 'markingRate', width: usePX(40) },
   { align: 'center', label: '综合系数', prop: 'integration', width: usePX(64) },
   { align: 'center', label: '综合系数', prop: 'integration', width: usePX(64) },
 ]
 ]
+
+const { fetch: getStatisticObjectiveByGroup, result: objectiveByGroup } = useFetch('getStatisticObjectiveByGroup')
+const { fetch: getStatisticSubjectiveByGroup, result: subjectiveByGroup } = useFetch('getStatisticSubjectiveByGroup')
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">