Commit a8ddbc49 authored by 李苏's avatar 李苏 💬

录入调整。定制修改密码。样式属性调整

parent cecda52d
<template>
<div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
@toggleClick="toggleSideBar" />
<!-- 修改密码-->
<el-dialog :append-to-body='true' title="修改密码" :visible.sync="settingVisible" width="40%">
<el-dialog :close-on-click-modal='false' :append-to-body='true' title="修改密码" :visible.sync="settingVisible" width="40%">
<div>
<el-form ref="form" :model="users" :rules="rules" label-width="80px">
<el-form-item label="旧密码" prop="oldPassword">
<el-input v-model="users.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
<el-input v-model="users.oldPassword" placeholder="请输入旧密码" type="password" show-password />
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input v-model="users.newPassword" placeholder="请输入新密码" type="password" show-password/>
<el-input v-model="users.newPassword" placeholder="请输入新密码" type="password" show-password />
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="users.confirmPassword" placeholder="请确认新密码" type="password" show-password/>
<el-input v-model="users.confirmPassword" placeholder="请确认新密码" type="password" show-password />
</el-form-item>
</el-form>
</div>
......@@ -26,15 +27,15 @@
<!-- -->
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu">
<div style="height: 100%;float: left;">
<search id="header-search" class="right-menu-item" />
</div>
<div v-if="systemInfo.length!=0" style="height: 100%;width: 200px;float: left;">
<ChangeProject/>
<ChangeProject />
</div>
<template v-if="device!=='mobile'">
......@@ -68,19 +69,23 @@
</template>
<script>
import { mapGetters } from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import { updatePassword } from "common/src/api/development/development.js";
import ChangeProject from './changeProject.vue';
import {
mapGetters
} from 'vuex'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import {
updatePassword
} from "common/src/api/development/development.js";
import ChangeProject from './changeProject.vue';
export default {
export default {
components: {
Breadcrumb,
TopNav,
......@@ -92,11 +97,21 @@ export default {
RuoYiDoc,
ChangeProject
},
mounted(){
this.user=localStorage.getItem('username')||'用户'
mounted() {
this.user = localStorage.getItem('username') || '用户'
},
data(){
data() {
const validateContent = (rule, value, callback) => {
const regex =/^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[@$!%*?&])[A-Za-z0-9@$!%*?&]+$/;
if (!regex.test(value)) {
callback(new Error('请输入包含数字、字母(大小写)和特殊符号(@$!%*?&)的组合'));
} else {
callback();
}
};
const equalToPassword = (rule, value, callback) => {
if (this.users.newPassword !== value) {
callback(new Error("两次输入的密码不一致"));
......@@ -104,33 +119,55 @@ export default {
callback();
}
};
return{
return {
users: {
oldPassword: undefined,
newPassword: undefined,
confirmPassword: undefined
},
user:'用户',
settingVisible:false,
user: '用户',
settingVisible: false,
// 表单校验
rules: {
oldPassword: [
{ required: true, message: "旧密码不能为空", trigger: "blur" }
],
newPassword: [
{ required: true, message: "新密码不能为空", trigger: "blur" },
{ min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" }
oldPassword: [{
required: true,
message: "旧密码不能为空",
trigger: "blur"
}],
newPassword: [{
required: true,
message: "新密码不能为空",
trigger: "blur"
},
{
min: 12,
max: 20,
message: "长度在 12 到 20 个字符",
trigger: "blur"
},
{
required: true,
validator: validateContent,
trigger: 'blur'
}
],
confirmPassword: [
{ required: true, message: "确认密码不能为空", trigger: "blur" },
{ required: true, validator: equalToPassword, trigger: "blur" }
confirmPassword: [{
required: true,
message: "确认密码不能为空",
trigger: "blur"
},
{
required: true,
validator: equalToPassword,
trigger: "blur"
}
]
}
}
},
computed: {
systemInfo(){
let data=this.$store.getters.systemInfo||[]
systemInfo() {
let data = this.$store.getters.systemInfo || []
return data
},
...mapGetters([
......@@ -159,15 +196,15 @@ export default {
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
let params={
let params = {
oldPassword: Base64.encode(this.users.oldPassword),
newPassword: Base64.encode(this.users.newPassword),
newPasswordConfirm: Base64.encode(this.users.confirmPassword)
}
updatePassword(params).then(res=>{
if(res.success){
updatePassword(params).then(res => {
if (res.success) {
this.$success('密码修改成功!')
this.settingVisible=false
this.settingVisible = false
}
})
......@@ -177,8 +214,8 @@ export default {
}
});
},
showItem(){
this.settingVisible=true
showItem() {
this.settingVisible = true
},
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
......@@ -189,7 +226,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$post('/logout').finally(()=>{
this.$post('/logout').finally(() => {
localStorage.clear()
this.$store.dispatch('LogOut').then(() => {
location.href = '/index';
......@@ -201,16 +238,16 @@ export default {
}).catch(() => {});
}
}
}
}
</script>
<style lang="scss" scoped>
.navbar {
.navbar {
height: 50px;
overflow: hidden;
position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08);
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
.hamburger-container {
line-height: 46px;
......@@ -218,7 +255,7 @@ export default {
float: left;
cursor: pointer;
transition: background .3s;
-webkit-tap-highlight-color:transparent;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, .025)
......@@ -290,5 +327,5 @@ export default {
}
}
}
}
}
</style>
<template>
<RelDialog @getForm='getForm' width="50%" :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<RelDialog :changeAddParams='changeAddParams' :changeEditParams='changeEditParams' @getForm='getForm' width="50%" :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<el-form slot="form" ref="form" :model="form" label-width="120px" :rules="rules">
<el-row :gutter="20" :app="this">
<EditColItem :required="item.required||false" :readonly="item.readonly?true:false "
......@@ -10,7 +10,7 @@
<el-form-item label="异物图片">
<el-upload ref="upload" :headers='{
Gtoken
}' :action="`${baseurl}/ywxxgl/uywsjlr/attachment/upload`" list-type="picture-card"
}' :action="`${baseurl}/attachment/upload/tmp`" list-type="picture-card"
:on-preview="handlePictureCardPreview" :on-success='success' :on-remove="handleRemove" :data="{
groupid:'',
folder:'uywsjlr'
......@@ -54,6 +54,7 @@
mixins: [editMixin],
data() {
return {
attachmentList:[],
showList:[],
baseurl: baseurl,
Gtoken: Gtoken,
......@@ -131,15 +132,40 @@
}
},
methods: {
changeEditParams(params){
let attachments=[]
this.attachmentList.forEach(item=>{
attachments.push({
id:item
})
})
this.showList.forEach(item=>{
attachments.push({
id:item.id
})
})
params.attachments=attachments
},
changeAddParams(params){
let attachments=[]
this.attachmentList.forEach(item=>{
attachments.push({
id:item
})
})
params.attachments=attachments
},
handleRemove(file, fileList) {
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
attachmentList.push(item.response.data.records.id)
}
})
this.form.attachmentList = attachmentList
console.log(this.form.attachmentList)
this.attachmentList = attachmentList
console.log(this.attachmentList)
},
handlePictureCardPreview(file) {
......@@ -153,11 +179,11 @@
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
attachmentList.push(item.response.data.records.id)
}
})
this.form.attachmentList = attachmentList
this.attachmentList = attachmentList
} else {
const delIndex = fileList.findIndex(item => item.uid === file.uid);
......@@ -173,16 +199,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
this.$post('ywxxgl/uywsjlr/attachment/delete', {
id: [id]
}).then(res => {
if (res.success) {
this.showList.splice(index, 1)
this.$success('操作成功')
}
})
})
},
......
......@@ -12,7 +12,7 @@
<!-- 嵌入默认页面额外弹框的插槽 ctx.pagePage来操作默认页面 -->
</template>
<template #toolbar="ctx">
<AttachFileShow :app='ctx.basePage'></AttachFileShow>
<!-- <AttachFileShow :app='ctx.basePage'></AttachFileShow> -->
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="demo(ctx.basePage)" size='mini' type="primary">示例按钮</el-button> -->
</template>
......
......@@ -54,14 +54,12 @@
}' :data="{
groupid:'',
folder:'usbjx'
}" class="upload-demo" :action="`${baseurl}/jxgl/usbjx/attachment/upload`"
}" class="upload-demo" :action="`${baseurl}/attachment/upload/tmp`"
:on-success='success' :on-remove="handleRemove" :file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
<div v-if="type!='add'">
<span style="line-height: 40px;font-size: 12px;font-weight: 700;color: #666;">附件列表</span>
<div class="download padding-10">
......@@ -93,7 +91,7 @@
{{item.name}}
</div>
<div class="size">
{{item.size}}
{{ sizeFormatter(item.size) }}
</div>
<div class="down">
<el-button @click="download(item)" size="mini" type="success">下载文件</el-button>
......@@ -164,21 +162,11 @@
},
data() {
return {
form: {
attachmentList: []
},
attachmentList:[],
Gtoken: Gtoken,
baseurl: baseurl,
fileList: [],
downList: [{
name: '测试1',
size: '200kb',
},
{
name: '测试2',
size: '2030kb',
}
downList: [
],
showDialog: false,
DialogWidth: '40vw',
......@@ -323,6 +311,14 @@
}
},
methods: {
sizeFormatter(bytes){
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
},
download(item){
let url=`jxgl/usbjx/attachment/download/${item.id}`
this.$cDownload(url, {},item.name)
......@@ -333,24 +329,17 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$post('jxgl/usbjx/attachment/delete', {
id: [id]
}).then(res => {
if (res.success) {
this.downList.splice(index, 1)
this.$success('操作成功')
}
})
})
},
handleRemove(file, fileList) {
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
attachmentList.push(item.response.data.records.id)
}
})
this.form.attachmentList = attachmentList
this.attachmentList = attachmentList
},
success(res, file, fileList) {
......@@ -362,10 +351,10 @@
let attachmentList = []
fileList.forEach(item => {
if (item.status == 'success') {
attachmentList.push(item.response.data.id)
attachmentList.push(item.response.data.records.id)
}
})
this.form.attachmentList = attachmentList
this.attachmentList = attachmentList
} else {
const delIndex = fileList.findIndex(item => item.uid === file.uid);
if (delIndex !== -1) {
......@@ -380,18 +369,19 @@
groupid: form.id,
}).then(res => {
res.data.records.forEach(item => {
autoAttachDownload({}, 'jxgl/usbjx', item.id).then(res => {
let blob = new Blob([res], {
type: 'application/' + item.type + ';charset=UTF-8',
});
let url = URL.createObjectURL(blob)
let uitem = {
url,
id: item.id
}
this.downList.push(uitem)
this.downList.push(item)
// autoAttachDownload({}, 'jxgl/usbjx', item.id).then(res => {
// let blob = new Blob([res], {
// type: 'application/' + item.type + ';charset=UTF-8',
// });
// let url = URL.createObjectURL(blob)
// let uitem = {
// url,
// id: item.id
// }
// this.downList.push(uitem)
})
// })
......@@ -427,7 +417,14 @@
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.type == 'add') {
let attachments=[]
this.attachmentList.forEach(item=>{
attachments.push({
id:item
})
})
let params = {
attachments,
details: [{
id: 'U_JXGJ',
records: [...this.editTableData1] || []
......@@ -448,6 +445,7 @@
this.$success('添加成功')
this.$refs.reldialog.closeAll()
let newData = this.form
newData.id=res.data.id
this.app.$refs.TablePager.tableData.unshift(newData)
/* 总数据++ */
this.app.$refs.TablePager.total+=1
......@@ -458,8 +456,25 @@
}
})
}else if(this.type=='edit'){
/* 修改的时候先拿去加载的文件list
和上传的list 混合然后上传
*/
let attachments=[]
this.attachmentList.forEach(item=>{
attachments.push({
id:item
})
})
this.downList.forEach(item=>{
attachments.push({
id:item
})
})
let params = {
attachments,
details: [{
id: 'U_JXGJ',
records: [...this.editTableData1] || []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment