Commit 6e22e34c authored by Davve's avatar Davve

账号不可编辑

parent 62f313f5
......@@ -10,13 +10,13 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="username" v-if="isShow">
<el-form-item v-if="isShow" style="margin-bottom: 40px;" prop="username">
<MDinput v-model="postForm.username" :maxlength="100" name="username" required disabled="disabled">
账号
</MDinput>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" prop="username" v-else>
<el-form-item v-else style="margin-bottom: 40px;" prop="username">
<MDinput v-model="postForm.username" :maxlength="100" name="username" required>
账号
</MDinput>
......@@ -27,7 +27,7 @@
<el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="password" v-show="is_show">
<el-form-item v-show="is_show" style="margin-bottom: 40px;" prop="password">
<MDinput v-model="postForm.password" :maxlength="100" name="password" required>
密码
</MDinput>
......@@ -76,24 +76,24 @@
</template>
<script>
import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件
import {validateURL} from '@/utils/validate'
import {CreateAccount, fetchAccountDetail,} from '@/api/account'
import {userSearch} from '@/api/remoteSearch'
import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件
import { validateURL } from '@/utils/validate'
import { CreateAccount, fetchAccountDetail } from '@/api/account'
import { userSearch } from '@/api/remoteSearch'
const defaultForm = {
const defaultForm = {
status: 'draft',
username: '',
password: '',
email: '',
phone: '',
nick_name: ''
}
}
export default {
export default {
name: 'GroupDetail',
components: {MDinput, Sticky},
components: { MDinput, Sticky },
props: {
isEdit: {
type: Boolean,
......@@ -122,7 +122,7 @@
type: 'error'
})
callback(new Error(rule.field + '为必传项'))
} else if ( value.length < 6) {
} else if (value.length < 6) {
this.$message({
message: '密码不得少于6位',
type: 'error'
......@@ -137,13 +137,13 @@
loading: false,
userListOptions: [],
rules: {
username: [{validator: validateRequire, trigger: 'blur'}],
nick_name: [{validator: validateRequire, trigger: 'blur'}],
email: [{validator: validateRequire, trigger: 'blur'}],
password: [{validator: validatePasswordLength, trigger: 'blur'}],
phone: [{validator: validateRequire, trigger: 'blur'}],
username: [{ validator: validateRequire, trigger: 'blur' }],
nick_name: [{ validator: validateRequire, trigger: 'blur' }],
email: [{ validator: validateRequire, trigger: 'blur' }],
password: [{ validator: validatePasswordLength, trigger: 'blur' }],
phone: [{ validator: validateRequire, trigger: 'blur' }]
},
is_show: true
isShow: false
}
},
created() {
......@@ -160,7 +160,7 @@
fetchData(id) {
fetchAccountDetail(id).then(response => {
this.postForm = response.data.data.data
this.is_show = false
this.isShow = true
}).catch(err => {
console.log(err)
})
......@@ -177,8 +177,8 @@
type: 'error',
duration: 2000
})
this.loading = false;
return false;
this.loading = false
return false
}
this.$notify({
title: '成功',
......@@ -189,7 +189,6 @@
setTimeout(() => {
this.$router.push('/account/list')
}, 1000)
}).catch(err => {
this.$notify({
title: '失败',
......@@ -197,7 +196,7 @@
type: 'danger',
duration: 2000
})
});
})
this.postForm.status = 'published'
this.loading = false
......@@ -214,7 +213,7 @@
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
......
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