Merge pull request 'master' (#25) from master into test

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/25
This commit is contained in:
springlog
2024-09-12 18:19:09 +00:00
5 changed files with 262 additions and 155 deletions

View File

@@ -1,133 +1,133 @@
<template> <template>
<div class="my"> <div class="my" style="margin-top:7vh ;">
<el-row :gutter="20"> <el-row :gutter="10">
<el-col :span="10" :xs="24"> <div class="mybox">
<el-card class="box-card1"> <el-col :span="infoWidth" :xs="24">
<!-- 标题 --> <el-card class="box-card1">
<template #header> <!-- 标题 -->
<div class="card-header"> <template #header>
<div>个人信息</div> <div class="card-header">
</div> <div v-if="isShowDiv"></div>
</template> <div style="font-weight: bold">个人信息 <span v-if="isShowPassword">:</span></div>
<div class="userDetail"> <el-button v-if="isShowDiv" @click="changePassword" type="primary" plain size="small">修改密码</el-button>
<div class="userInfo_item">
<div style="display: flex;align-items: center">
<el-icon size="18" style="margin-right: 5px">
<User/>
</el-icon>
用户名:
</div> </div>
<div>{{ userParams.userName }}</div>
</div> </template>
<div class="userInfo_item"> <div class="userDetail">
<div style="display: flex;align-items: center"> <div class="userInfo_item">
<el-icon size="18" style="margin-right: 5px"> <div style="display: flex;align-items: center" class="userInfo_label">
<User/> <el-icon size="18" style="margin-right: 5px">
</el-icon> <User />
用户名称: </el-icon>
<strong>工号 :</strong>
</div>
<div>{{ userParams.userNumber }}</div>
</div> </div>
<div>{{ userParams.nickName }}</div> <div class="userInfo_item">
</div> <div style="display: flex;align-items: center" class="userInfo_label">
<div class="userInfo_item"> <el-icon size="18" style="margin-right: 5px">
<div style="display: flex;align-items: center"> <Notification />
<el-icon size="18" style="margin-right: 5px"> </el-icon>
<Notification/> <strong>邮箱 :</strong>
</el-icon>
工号: </div>
<div>{{ userParams.email }}</div>
</div> </div>
<div>{{ userParams.workCode }}</div> <div class="userInfo_item">
</div> <div style="display: flex;align-items: center" class="userInfo_label">
<div class="userInfo_item"> <el-icon size="18" style="margin-right: 5px">
<div style="display: flex;align-items: center"> <Notification />
<el-icon size="18" style="margin-right: 5px"> </el-icon><strong>登录账号 :</strong>
<Phone/>
</el-icon> </div>
电话号码: <div>{{ userParams.loginAccount }}</div>
</div> </div>
<div>{{ userParams.mobile }}</div> <div class="userInfo_item">
</div> <div style="display: flex;align-items: center" class="userInfo_label">
<div class="userInfo_item"> <el-icon size="18" style="margin-right: 5px">
<div style="display: flex;align-items: center"> <Folder />
<el-icon size="18" style="margin-right: 5px"> </el-icon>
<House/> <strong>用户名称 :</strong>
</el-icon>
所属公司: </div>
<div>{{ userParams.userName }}</div>
</div> </div>
<div>{{ userParams.subCompanyName }}</div> <div class="userInfo_item">
</div> <div style="display: flex;align-items: center" class="userInfo_label">
<div class="userInfo_item"> <el-icon size="18" style="margin-right: 5px">
<div style="display: flex;align-items: center"> <Folder />
<el-icon size="18" style="margin-right: 5px"> </el-icon>
<FolderOpened/> <strong>手机号码 :</strong>
</el-icon>
所属部门: </div>
<div>{{ userParams.userPhone }}</div>
</div> </div>
<div>{{ userParams.departmentName }}</div> <div class="userInfo_item">
</div> <div style="display: flex;align-items: center" class="userInfo_label">
<div class="userInfo_item"> <el-icon size="18" style="margin-right: 5px">
<div style="display: flex;align-items: center"> <Folder />
<el-icon size="18" style="margin-right: 5px"> </el-icon>
<Folder/> <strong>账号类型 :</strong>
</el-icon>
岗位: </div>
<div>{{ userParams.accountType }}</div>
</div> </div>
<div>{{ userParams.jobActivityDesc }}</div>
</div> </div>
<div class="userInfo_item"> </el-card>
<div style="display: flex;align-items: center"> </el-col>
<el-icon size="18" style="margin-right: 5px"> <div class="line" v-if="isShowPassword"></div>
<Wallet/> <el-col :span="10" :xs="24" v-if="isShowPassword">
</el-icon> <el-card class="box-card">
账号类型: <!-- 标题 -->
<template #header>
<div class="card-header">
<div style="font-weight: bold">{{ isInitPassword ? '修改密码 :' : '初始化密码 :' }}</div>
</div> </div>
<div>{{ userParams.accountType === '0' ? '主账号' : '次账号' }}</div> </template>
<div class="card-body">
<el-form label-width="120px" ref="passwordRef" :model="userPassword" :rules="rules">
<el-form-item label="旧密码" prop="oldPassword" :required="true" style="text-align:left;margin: 7vh 0;"
v-if="isInitPassword">
<el-input placeholder="请输入旧密码" v-model="userPassword.oldPassword" type="password" :prefix-icon="Lock"
show-password="true" />
</el-form-item>
<el-form-item label="新密码" prop="newPassword" :required="true" style="text-align:left;margin: 7vh 0">
<el-input placeholder="请输入新密码" v-model="userPassword.newPassword" type="password" :prefix-icon="Lock"
show-password="true" />
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword" :required="true"
style="text-align:left;margin-top: 7vh;margin-bottom: 5vh">
<el-input placeholder="请确认新密码" v-model="userPassword.confirmPassword" type="password"
:prefix-icon="Lock" show-password="true" />
</el-form-item>
<el-form-item>
<div class="button-word">
<el-button color="#409eff" @click="handleSubmit" style="color: white">提交</el-button>
<el-button color="#409eff" @click="close" style="color: white">关闭</el-button>
</div>
</el-form-item>
</el-form>
</div> </div>
<div class="userInfo_item"> </el-card>
<div style="display: flex;align-items: center"> </el-col>
<el-icon size="18" style="margin-right: 5px"> </div>
<User/>
</el-icon>
所属角色:
</div>
<div>{{ belongToRole(userParams.roles) }}</div>
</div>
</div>
</el-card>
</el-col>
<el-col :span="14" :xs="24">
<el-card class="box-card">
<!-- 标题 -->
<template #header>
<div class="card-header">
<div>{{ isInitPassword ? '修改密码' : '初始化密码' }}</div>
</div>
</template>
<el-form label-width="120px" ref="passwordRef" :model="userPassword" :rules="rules">
<el-form-item label="旧密码" prop="oldPassword" :required="true" style="text-align:left" v-if="isInitPassword">
<el-input placeholder="请输入旧密码" v-model="userPassword.oldPassword" type="password"/>
</el-form-item>
<el-form-item label="新密码" prop="newPassword" :required="true" style="text-align:left">
<el-input placeholder="请输入新密码" v-model="userPassword.newPassword" type="password"/>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword" :required="true" style="text-align:left">
<el-input placeholder="请确认新密码" v-model="userPassword.confirmPassword" type="password"/>
</el-form-item>
<el-form-item>
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
<el-button @click="close">关闭</el-button>
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script setup> <script setup>
import {ElNotification} from 'element-plus' import { ElNotification } from 'element-plus'
import {useTagsView} from '@/stores/tagsview.js' import { useTagsView } from '@/stores/tagsview.js'
import {editPassword} from "@/api/auth/auth"; import { editPassword } from "@/api/auth/auth";
import { Lock } from '@element-plus/icons-vue'
import { ref } from 'vue';
const isInitPassword = ref(false); const infoWidth = ref(22)
const isShowDiv = ref(true)
const isShowPassword = ref(false);
const isInitPassword = ref(true);
const userParams = ref({}); const userParams = ref({});
const passwordRef = ref(); const passwordRef = ref();
const router = useRouter() const router = useRouter()
@@ -137,6 +137,7 @@ const userPassword = ref({
confirmPassword: '' confirmPassword: ''
}); });
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const validatePasswordComplexity = (rule, value, callback) => { const validatePasswordComplexity = (rule, value, callback) => {
const reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字1-9位 const reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字1-9位
if (!reg.test(value)) { if (!reg.test(value)) {
@@ -156,10 +157,10 @@ const validatePasswordEquality = (rule, value, callback) => {
} }
const rules = reactive({ const rules = reactive({
oldPassword: [ oldPassword: [
{required: true, message: "旧密码不能为空", trigger: ["change", "blur"]}, { required: true, message: "旧密码不能为空", trigger: ["change", "blur"] },
], ],
newPassword: [ newPassword: [
{required: true, message: "新密码不能为空", trigger: ["change", "blur"]}, { required: true, message: "新密码不能为空", trigger: ["change", "blur"] },
{ {
required: true, required: true,
trigger: ["change", "blur"], trigger: ["change", "blur"],
@@ -167,7 +168,7 @@ const rules = reactive({
} }
], ],
confirmPassword: [ confirmPassword: [
{required: true, message: "确认密码不能为空", trigger: ["change", "blur"]}, { required: true, message: "确认密码不能为空", trigger: ["change", "blur"] },
{ {
required: true, required: true,
trigger: ["change", "blur"], trigger: ["change", "blur"],
@@ -190,30 +191,58 @@ const belongToRole = (roles) => {
// 修改密码 // 修改密码
const handleSubmit = async () => { const handleSubmit = async () => {
editPassword({ ElMessageBox.confirm(
...userPassword.value '提交成功',
}).then(res => { {
ElNotification({ confirmButtonText: '关闭',
title: '提示', dangerouslyUseHTMLString: true,
message: res.msg, // type: 'warning',
type: res.code === 1000 ? 'success' : 'error' center: true,
}) showCancelButton: false,
if (res.code === 1000) { 'show-close': false,
passwordRef.value.resetFields() customStyle: {
} 'max-width': '15%',
height: '40%'
},
message: `<svg t="1726160648055" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2671" data-spm-anchor-id="a313x.search_index.0.i2.2bb23a81IdR6cV" xmlns:xlink="http://www.w3.org/1999/xlink" width="80" height="80"><path d="M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512z m-114.176-310.954667a53.333333 53.333333 0 0 0 75.434667 0l323.328-323.328a53.333333 53.333333 0 1 0-75.434667-75.434666l-287.914667 283.306666-128.853333-128.853333a53.333333 53.333333 0 1 0-75.434667 75.434667l168.874667 168.874666z" fill="#67c23a" p-id="2672" data-spm-anchor-id="a313x.search_index.0.i3.2bb23a81IdR6cV" class=""></path></svg>
<br><br><div style="font-size: 18px;text-align:center"> 提交成功</div><br><br>`
}
)
editPassword({
...userPassword.value
}).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
}) })
if (res.code === 1000) {
passwordRef.value.resetFields()
}
})
} }
// 关闭 // 关闭
const close = () => { const close = () => {
tagsViewStore.delVisitedViews(router.currentRoute.value.path) // tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push('/') // router.push('/')
isShowPassword.value = false
isShowDiv.value = true
infoWidth.value = 22
}
const changePassword = () => {
isShowPassword.value = true
isShowDiv.value = false
infoWidth.value = 10
} }
// onMounted(() => { // onMounted(() => {
// getInfo() // getInfo()
// }) // })
</script> </script>
<style lang="scss"> <style lang="scss">
body, div { body,
div {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@@ -222,6 +251,41 @@ body, div {
margin: 0 auto; margin: 0 auto;
margin-top: 20px; margin-top: 20px;
.mybox {
width: 100%;
display: flex;
justify-content: space-around;
}
.card-header {
display: flex;
justify-content: space-between
}
.box-card {
height: 100%;
// width: 100%;
// background-color: blue;
}
.card-body {
width: 90%;
// display: flex;
height: 45vh;
// background-color: red;
// justify-content: space-around;
// flex-direction: column;
}
.line {
border-left: 1px solid #000;
}
.userDetail { .userDetail {
.userImg { .userImg {
height: 170px; height: 170px;
@@ -239,21 +303,37 @@ body, div {
} }
.userInfo_item { .userInfo_item {
display: flex;align-items: center; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
height: 40px; // height: 70px;
border-bottom-style: solid; height: 9vh;
border-color: #daddd2; // border-bottom-style: solid;
border-width: 1px; // border-color: #daddd2;
// border-width: 1px;
//text-align: left; //text-align: left;
//line-height: 40px; //line-height: 40px;
} }
.userInfo_label {
width: 100%;
border-bottom-style: solid;
border-color: #daddd2;
border-width: 2px;
}
// //
//.userInfo_item > div { //.userInfo_item > div {
// float: right; // float: right;
//} //}
}
.button-word {
width: 100%;
display: flex;
justify-content: space-between;
}
}
</style> </style>

View File

@@ -4,14 +4,14 @@
:model="loginForm" :model="loginForm"
ref="formInstance" ref="formInstance"
:rules="rules" :rules="rules"
label-width="65px" label-width="70px"
> >
<h3>SmartOpsWeb</h3> <h3>工单管理系统</h3>
<el-form-item prop="username" label="账号"> <el-form-item prop="username" label="账号">
<el-input v-model="loginForm.username" :prefix-icon="User" ></el-input> <el-input v-model="loginForm.username" :prefix-icon="User" ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password" label="密码"> <el-form-item prop="password" label="密码">
<el-input v-model="loginForm.password" type="password" :prefix-icon="Lock" ></el-input> <el-input v-model="loginForm.password" type="password" :prefix-icon="Lock" :show-password="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" label="验证码" > <el-form-item prop="code" label="验证码" >
<div class="code"> <div class="code">
@@ -96,8 +96,8 @@ onBeforeUnmount(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
.login-box { .login-box {
height: 100%; height: 100%;
background-color: #4158D0; background-color: #F3F3F3;
background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%); //background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@@ -107,7 +107,36 @@ onBeforeUnmount(() => {
border-radius: 12px; border-radius: 12px;
width: 25%; width: 25%;
background-color: #fff; background-color: #fff;
.el-form-item {
margin-bottom: 25px;
:deep(.el-form-item__label) {
font-size: 15px;
}
.el-input {
height: 40px;
:deep(.el-input__inner) {
font-size: 18px;
}
:deep(.el-input__suffix) {
.el-input__password {
font-size: 20px;
}
}
:deep(.el-input__prefix ) {
.el-input__prefix-inner {
.el-icon {
font-size: 20px;
}
}
}
}
}
h3 { h3 {
width: 100%; width: 100%;
text-align: center; text-align: center;
@@ -129,7 +158,7 @@ onBeforeUnmount(() => {
flex: 2; flex: 2;
} }
img { img {
height: 32px; height: 40px;
flex: 1; flex: 1;
} }
} }

View File

@@ -1,6 +1,5 @@
<template> <template>
<fvSearchForm :searchConfig="searchConfig" @search="search"> <fvSearchForm :searchConfig="searchConfig" @search="search">
<FvSelect></FvSelect>
</fvSearchForm> </fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<WorkDialog ref="workDialogRef"></WorkDialog> <WorkDialog ref="workDialogRef"></WorkDialog>
@@ -59,7 +58,6 @@ const searchConfig = reactive([
cacheKey: 'work_order_status', cacheKey: 'work_order_status',
clearable: true, clearable: true,
filterable: true, filterable: true,
filterable: true,
}, },
component: shallowRef(fvSelect), component: shallowRef(fvSelect),
}, { }, {
@@ -83,7 +81,7 @@ const searchConfig = reactive([
}, },
{ {
label: '创建日期', label: '创建日期',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -92,7 +90,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '处理时间', label: '处理时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -101,7 +99,7 @@ const searchConfig = reactive([
component: 'el-date-picker', component: 'el-date-picker',
}, { }, {
label: '完成时间', label: '完成时间',
prop: 'requirementName', prop: 'requirementDate',
props: { props: {
placeholder: '请选择', placeholder: '请选择',
clearable: true, clearable: true,
@@ -245,8 +243,8 @@ const handleClose = (row) => {
'确定要关单吗?', '确定要关单吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )
@@ -269,8 +267,8 @@ const handleDelete = (row) => {
'确定要删除吗?', '确定要删除吗?',
'温馨提示', '温馨提示',
{ {
confirmButtonText: 'OK', confirmButtonText: '确定',
cancelButtonText: 'Cancel', cancelButtonText: '取消',
type: 'warning', type: 'warning',
} }
) )