1.屏蔽新增用户按钮,调整表单校验

master
x_z 3 years ago
parent aaa6c804a1
commit 02806afe41

@ -28,26 +28,28 @@
@click="onReset"
></el-button>
<el-button type="primary" icon="search" @click="onSubmit"
>查询</el-button
>查询
</el-button
>
<el-button type="primary" @click.native="handleForm(null, null)"
<!--<el-button type="primary" @click.native="handleForm(null, null)"
>新增</el-button
>
>-->
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%">
<el-table-column label="用户名" prop="userName" fixed> </el-table-column>
<el-table-column label="用户名" prop="userName" fixed></el-table-column>
<el-table-column label="用户昵称" prop="employeeName" fixed>
</el-table-column>
<el-table-column label="状态" fixed="">
<template slot-scope="scope">
<el-tag :type="scope.row.userFlag | statusFilterType">{{
scope.row.userFlag | statusFilterName
}}</el-tag>
}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="comments" fixed> </el-table-column>
<el-table-column label="备注" prop="comments" fixed></el-table-column>
<el-table-column
label="登录时间"
with="300"
@ -157,7 +159,8 @@
v-for="item in roles"
:key="item.id"
:label="item.id"
>{{ item.name }}</el-checkbox
>{{ item.name }}
</el-checkbox
>
</el-checkbox-group>
</el-form-item>
@ -169,7 +172,8 @@
size="small"
@click.native="formSubmit()"
:loading="formLoading"
>提交</el-button
>提交
</el-button
>
</div>
</el-dialog>
@ -177,16 +181,15 @@
</template>
<script>
import {
import {
authAdminList,
authAdminRoleList,
authAdminSave,
authAdminDelete,
roleCustomers
} from "../../../api/auth/authAdmin";
} from "../../../api/auth/authAdmin";
import store from "../../../store/index";
import store from "../../../store/index";
const formJson = {
const formJson = {
id: "",
passWord: "",
userName: "",
@ -194,8 +197,8 @@
employeeName: "",
userFlag: 1,
roles: []
};
export default {
};
export default {
data() {
let validatePass = (rule, value, callback) => {
if (value === "") {
@ -238,11 +241,11 @@
formRules: {},
addRules: {
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
{required: true, message: "请输入姓名", trigger: "blur"}
],
passWord: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ validator: validatePass, trigger: "blur" }
{required: true, message: "请输入密码", trigger: "blur"},
{validator: validatePass, trigger: "blur"}
],
checkPassword: [
{
@ -250,18 +253,18 @@
message: "请再次输入密码",
trigger: "blur"
},
{ validator: validatePass2, trigger: "blur" }
{validator: validatePass2, trigger: "blur"}
],
userFlag: [
{ required: true, message: "请选择状态", trigger: "change" }
{required: true, message: "请选择状态", trigger: "change"}
]
},
editRules: {
userName: [
{ required: true, message: "请输入姓名", trigger: "blur" }
{required: true, message: "请输入姓名", trigger: "blur"}
],
userFlag: [
{ required: true, message: "请选择状态", trigger: "change" }
{required: true, message: "请选择状态", trigger: "change"}
]
},
deleteLoading: false
@ -350,13 +353,7 @@
}
},
formSubmit() {
console.log(
this.formData.userName +
"-----" +
this.formData.employeeName +
this.formData.userFlag
);
this.$refs["dataForm"].validate(valid => {
this.$refs["formData"].validate(valid => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
@ -390,7 +387,7 @@
type: "warning"
})
.then(() => {
let para = { id: row.id };
let para = {id: row.id};
this.deleteLoading = true;
authAdminDelete(para)
.then(response => {
@ -431,7 +428,8 @@
return statusMap[status];
}
},
mounted() {},
mounted() {
},
created() {
//
let query = this.$route.query;
@ -442,7 +440,7 @@
//
this.getRoleList();
}
};
};
</script>
<style type="text/scss" lang="scss">

Loading…
Cancel
Save