guoyuji
2024-07-10 15e254a574f0c8bc2f7054d9d09c89f95afdd6bb
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
1个文件已添加
8个文件已修改
152 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/lang/zh.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/userInfo/User.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/lang/zh.js
@@ -714,6 +714,10 @@
        ConfirmPasswordCannotBeEmpty:'确认密码不能为空',
        TheTwoPasswordsAreNotTheSame:'两次密码不相同',
        OldPasswordError:'旧密码错误',
        userName:'用户名称',
        changeUserName:'修改用户名称',
        userNameCannotBeEmpty:'用户名称不能为空',
    },
    orderBasicData:{
        order:'订单',
north-glass-erp/northglass-erp/src/router/index.js
@@ -72,12 +72,18 @@
              component: () => import('../views/system/userPassWord/UpdateUserPassWord.vue')
            },
            {
              path: 'updateUserName',
              name: 'updateUserName',
              component: () => import('../views/system/userPassWord/UpdateUserName.vue')
            },
            {
              name:'userPassWord',
              path: '',
              redirect:'/main/userPassWord/updateUserPassWord'
            }
          ]
        },
          //sd模块
        {
@@ -370,7 +376,7 @@
            {
              path: 'printCustomLabel',
              name: 'printCustomLabel',
              component: () => import('../views/pp/processCard/PrintCustomLabel1.vue'),
              component: () => import('../views/pp/processCard/PrintCustomLabel.vue'),
            },
            {
              path: 'printCustomLabelSemi',
@@ -380,7 +386,7 @@
            {
              path: 'printCustomLabelSemi2',
              name: 'printCustomLabelSemi2',
              component: () => import('../views/pp/processCard/PrintCustomLabelSemi.vue'),
              component: () => import('../views/pp/processCard/PrintCustomLabelSemi2.vue'),
            },
            {
              path: 'printLabel1',
north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue
New file
@@ -0,0 +1,102 @@
<script setup lang="ts">
import { reactive, ref } from 'vue'
import type { FormProps,FormInstance, FormRules } from 'element-plus'
import {ElMessage,ElMessageBox} from "element-plus";
import request from "@/utils/request";
import {Avatar, UserFilled} from "@element-plus/icons-vue";
import useUserInfoStore from "@/stores/userInfo";
import {useRoute, useRouter} from "vue-router";
import {useI18n} from "vue-i18n";
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
const userStore = useUserInfoStore()
//注册用户参数
const register = reactive({
  userId: userStore.user.id,
  userName: ''
})
const submitForm = () => {
  console.log(register.userName)
  if(register.userName==""||register.userName==null){
    ElMessage.warning(t('user.userNameCannotBeEmpty'))
    return
  }
      request.post('/user/updateUserName', register).then((res) => {
        if (res.data === true) {
          ElMessage.success(t('basicData.msg.saveSuccess'))
          router.push("/login")
        } else {
          ElMessage.error(t('basicData.msg.saveFail'))
          return false
        }
      }).catch(error => {
        ElMessage.error(t('basicData.msg.ServerConnectionError'))
        return false
      })
}
</script>
<template>
  <div id="main-div">
    <div id="register">
      <el-form
          label-width="100px"
          :model="register"
          ref="ruleFormRef"
          status-icon
          :rules="rules"
      >
        <el-form-item :label="$t('user.userName')">
          <el-input  type="text"   v-model="register.userName" />
        </el-form-item>
        <el-form-item >
          <el-button
              type="primary"
              @click="submitForm(ruleFormRef)"
          >{{ $t('basicData.save') }}
          </el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<style scoped>
#main-div{
  width: 1000px;
  height: 600px;
  margin: auto;
}
h2{
  text-align: center;
  width: 100vw;
  margin-top: 10vh;
}
#register{
  background-color: #FAFAFA;
  width: 50vw;
  height: 50vh;
  border-radius: 12px;
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 280px;
}
.el-form{
  max-width: 300px;
}
</style>
north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
@@ -6,9 +6,11 @@
import {Avatar, UserFilled} from "@element-plus/icons-vue";
import useUserInfoStore from "@/stores/userInfo";
import {useRoute, useRouter} from "vue-router";
import {useI18n} from "vue-i18n";
const router = useRouter()
const route = useRoute()
const { t } = useI18n()
const userStore = useUserInfoStore()
//注册用户参数
const register = reactive({
north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
@@ -20,6 +20,7 @@
    <div id="div-title">
      <el-breadcrumb :separator-icon="ArrowRight">
        <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/userPassWord/updateUserPassWord' }">{{$t('user.changePassword')}}</el-breadcrumb-item>
        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/userPassWord/updateUserName' }">{{$t('user.changeUserName')}}</el-breadcrumb-item>
        <el-breadcrumb-item v-show="false" @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/order/createOrder' }">{{$t('basicData.create')}}</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
@@ -61,4 +61,10 @@
    public Result updatePassWord(@RequestBody Map<String,Object> object){
        return Result.seccess( userService.updatePassWord(object));
    }
    @ApiOperation("修改用户名")
    @PostMapping("/updateUserName")
    public Result updateUserName(@RequestBody Map<String,Object> object){
        return Result.seccess( userService.updateUserName(object));
    }
}
north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
@@ -34,4 +34,6 @@
    Boolean userDelete(Integer id);
    Boolean updatePassWordById(Integer id,String passWord);
    Boolean updateUserNameById(Integer id,String userName);
}
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -108,6 +108,25 @@
    }
    @Transactional
    public Boolean updateUserName(Map<String,Object> object) {
        boolean saveState = false;
        int userId =0;
        String userName = "";
        if (object.get("userId") != null) {
            userId = Integer.parseInt(object.get("userId").toString());
        }
        if (object.get("userName") != null) {
            userName = object.get("userName").toString();
        }
        if (userMapper.updateUserNameById(userId,userName)){
            saveState = true;
        }
        return saveState;
    }
    /*----------------新版本登陆*/
    public UserDTO doLogin(UserDTO userDTO) {
        User user = userMapper.selectOne(new QueryWrapper<User>().
north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -78,4 +78,10 @@
        set password=#{passWord},update_time=now()
        where id=#{id}
    </update>
    <update id="updateUserNameById">
        update erp_user_info.user
        set user_name=#{userName},update_time=now()
        where id=#{id}
    </update>
</mapper>