Commit cbebde47 by 胡悦

用户名验证。添加loading

1 parent 96c1735d
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
:default-checked-keys="defaultCheckedKeys" :default-checked-keys="defaultCheckedKeys"
@check='check' @check='check'
@node-click='nodeClick' @node-click='nodeClick'
v-loading="loading"
gl-loading-text="拼命加载中"
gl-loading-icon="el-icon-loading"
></gl-tree> ></gl-tree>
</div> </div>
</template> </template>
...@@ -22,13 +25,14 @@ export default { ...@@ -22,13 +25,14 @@ export default {
data() { data() {
return { return {
data: null, data: null,
loading: true,
props: { props: {
label: 'text' label: 'text'
} }
} }
}, },
props: { props: {
keyFresh: Boolean, keyFresh: [Boolean, Array, Function],
showCheckbox: Boolean, showCheckbox: Boolean,
value: null, value: null,
defaultExpandAll: Boolean, defaultExpandAll: Boolean,
...@@ -69,11 +73,13 @@ export default { ...@@ -69,11 +73,13 @@ export default {
? findMenuTree.req().then(res => { ? findMenuTree.req().then(res => {
// console.log(res) // console.log(res)
this.data = fn(res, '#') this.data = fn(res, '#')
this.loading = false
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
: findDepartTree.req().then(res => { : findDepartTree.req().then(res => {
this.data = fn(res, '#') this.data = fn(res, '#')
this.loading = false
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<el-col :span="12"> <el-col :span="12">
<gl-form-item label="用户名" prop="username"> <gl-form-item label="用户名" prop="username">
<gl-input v-model="userManageForm.username" clearable></gl-input> <gl-input v-model="userManageForm.username" clearable></gl-input>
<!-- <div v-show="!isEdit" class="err">{{msg}}</div> -->
</gl-form-item> </gl-form-item>
</el-col> </el-col>
<gl-col :span="12"> <gl-col :span="12">
...@@ -20,12 +21,14 @@ ...@@ -20,12 +21,14 @@
</gl-col> </gl-col>
<gl-col :span="12"> <gl-col :span="12">
<gl-form-item label="手机号码" prop="mobile"> <gl-form-item label="手机号码" prop="mobile">
<gl-input v-model="userManageForm.mobile" placeholder='请输入手机号码' :prop="/1[358]\d{9}/" clearable></gl-input> <gl-masked v-model="userManageForm.mobile" :mask="[ 1, /[34578]/, /\d/, /\d/, /\d/,/\d/, /\d/, /\d/,/\d/, /\d/, /\d/]" placeholder='请输入手机号码' clearable></gl-masked>
<!-- <gl-input v-model="userManageForm.mobile" placeholder='请输入手机号码' :prop="tel" clearable></gl-input> -->
</gl-form-item> </gl-form-item>
</gl-col> </gl-col>
<gl-col :span="12"> <gl-col :span="12">
<gl-form-item label="注册IP" prop="joinip"> <gl-form-item label="注册IP" prop="joinip">
<gl-input v-model="userManageForm.joinip" clearable></gl-input> <gl-masked v-model="userManageForm.joinip" :mask="tel" placeholder='请输入手机号码' clearable></gl-masked>
<!-- <gl-input v-model="userManageForm.joinip" clearable></gl-input> -->
</gl-form-item> </gl-form-item>
</gl-col> </gl-col>
<gl-col :span="12"> <gl-col :span="12">
...@@ -89,6 +92,7 @@ export default { ...@@ -89,6 +92,7 @@ export default {
dialogFormVisible: Boolean, dialogFormVisible: Boolean,
userManageForm: Object, userManageForm: Object,
isEdit: Boolean isEdit: Boolean
// msg: String
}, },
components: { components: {
userForm userForm
...@@ -116,7 +120,7 @@ export default { ...@@ -116,7 +120,7 @@ export default {
placeholder: '', placeholder: '',
defaultExpandAll: true, defaultExpandAll: true,
val: '', val: '',
tel: '[ 1, /[34578]/, /d/{9}]', tel: "/\d{1,3}/, '.', /\d{1,3}/, '.', /\d{1,3}/,'.', /\d{1,3}/",
rules: { rules: {
username: [ username: [
{ required: true, message: '请输入用户名', trigger: 'blur' } { required: true, message: '请输入用户名', trigger: 'blur' }
...@@ -178,6 +182,14 @@ export default { ...@@ -178,6 +182,14 @@ export default {
return true return true
} }
}, },
// isPoneAvailable(pone) {
// this.tel = '/^[1][3,4,5,7,8][0-9]{9}$/'
// if (!this.tel.test(pone)) {
// return false
// } else {
// return true
// }
// },
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
this.userData = this.$deep_clone(this.userManageForm) this.userData = this.$deep_clone(this.userManageForm)
......
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
data: [], data: [],
column: roleDataColumn, column: roleDataColumn,
console: { console: {
show: true,
label: '操作', label: '操作',
prop: 'roleOptions', prop: 'roleOptions',
button: [{ button: [{
......
...@@ -42,6 +42,7 @@ export default { ...@@ -42,6 +42,7 @@ export default {
isEdit: true, isEdit: true,
departList: [], departList: [],
dialogFormVisible: false, dialogFormVisible: false,
// msg: '',
userManageForm: this.$deep_clone(userForm), userManageForm: this.$deep_clone(userForm),
userDetailVisible: false, userDetailVisible: false,
userDetailTitle: '用户详情', userDetailTitle: '用户详情',
...@@ -101,6 +102,7 @@ export default { ...@@ -101,6 +102,7 @@ export default {
} }
}, },
console: { console: {
show: true,
label: '操作', label: '操作',
prop: 'operation', prop: 'operation',
button: [{ button: [{
...@@ -119,8 +121,8 @@ export default { ...@@ -119,8 +121,8 @@ export default {
}, { }, {
label: '禁用', label: '禁用',
type: 'text', type: 'text',
formatter(index, column, rows) { formatter(row) {
column.label = rows[index].state < 1 ? '启动' : '禁用' return row.state < 1 ? '启动' : '禁用'
}, },
callback: (index, rows) => { callback: (index, rows) => {
this.$confirm('确定要修改这条数据?', '', { this.$confirm('确定要修改这条数据?', '', {
...@@ -209,9 +211,11 @@ export default { ...@@ -209,9 +211,11 @@ export default {
console.log(res) console.log(res)
this.message('操作成功', 'success') this.message('操作成功', 'success')
// this.createOrEditSuccess() // this.createOrEditSuccess()
this.dialogFormVisible = !this.dialogFormVisible
this.findUserList() this.findUserList()
}).catch(message => { }).catch(message => {
console.log(message) console.log(message)
// this.msg = message
this.message(message, 'error') this.message(message, 'error')
}) })
} }
...@@ -239,10 +243,18 @@ export default { ...@@ -239,10 +243,18 @@ export default {
// 接受子组件传递的值 // 接受子组件传递的值
handleUserFormData(isEdit, params) { handleUserFormData(isEdit, params) {
console.log(params) console.log(params)
this.userManageForm = {} // this.userManageForm = {}
!params && this.message('取消操作', 'info') if (params) {
params && this.updateUser_Post(params) this.updateUser_Post(params)
this.dialogFormVisible = !this.dialogFormVisible } else {
this.dialogFormVisible = !this.dialogFormVisible
this.message('取消操作', 'info')
}
// !params && this.message('取消操作', 'info')
// params && this.updateUser_Post(params)
// if (!params) {
// this.dialogFormVisible = !this.dialogFormVisible
// }
}, },
// 新增按钮 // 新增按钮
createUser(userManageForm) { createUser(userManageForm) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!