From 8e68b3cefdf22c2eb37e02e2bafa06013bab5053 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 03 Sep 2021 17:56:39 +0800
Subject: [PATCH] 注册
---
src/views/zc/zc.vue | 21 ++++++++++
src/page/login/codelogin.vue | 65 +++++---------------------------
2 files changed, 31 insertions(+), 55 deletions(-)
diff --git a/src/page/login/codelogin.vue b/src/page/login/codelogin.vue
index 92ed3a5..b5129c0 100644
--- a/src/page/login/codelogin.vue
+++ b/src/page/login/codelogin.vue
@@ -51,7 +51,7 @@
<i slot="prefix" class="icon-shouji"/>
</el-input>
</el-form-item>
- <avue-input-tree style="width:580px !important" :defaultExpandAll="loginForm.defaultFlag" v-model="loginForm.deptid" placeholder="请选择部门"
+ <avue-input-tree style="width:580px !important" :defaultExpandAll="false" v-model="loginForm.deptid" placeholder="请选择部门"
type="tree"
:dic="dic"></avue-input-tree>
<el-form-item class="z-login-submit-prv">
@@ -110,7 +110,6 @@
dicr: [],
msgKey: false,
loginForm: {
- defaultFlag: false,
cardid: "",
username: "",
sname: "",
@@ -136,13 +135,12 @@
created() {
this.msgText = this.config.MSGINIT;
this.msgTime = this.config.MSGTIME;
- defaultFlag
},
mounted() {
var that = this;
ss().then(res => {
- console.log(that.ergodicData(res.data.data), 898989)
- that.dic = that.ergodicData(res.data.data)
+ console.log(that.processingData(res.data.data), 898989)
+ that.dic = that.processingData(res.data.data)
});
},
computed: {
@@ -157,65 +155,26 @@
},
props: [],
methods: {
- ergodicData(val) {
- var arr = []
- val.forEach((item, index) => {
+ processingData(val) {
- arr.push({label: item.title, value: item.value, id: item.id, parent_id: item.parent_id})
+ for (var i = 0; i < val.length; i++) {
+ val[i].label = val[i].title
- if (item.hasChildren == true) {
+ if (val[i].hasChildren == true) {
- var arrOne = []
+ if (val[i].children && val[i].children.length > 0) {
- if (item.children && item.children.length > 0) {
+ this.processingData(val[i].children)
- item.children.forEach((childItem, childIndex) => {
-
- arrOne.push({
- label: childItem.title,
- value: childItem.value,
- id: childItem.id,
- parent_id: childItem.parent_id
- })
-
-
- if (childItem.hasChildren == true) {
-
- var arrTwo = []
-
- if (childItem.children && childItem.children.length > 0) {
-
- childItem.children.forEach((findItem, findIndex) => {
-
- arrTwo.push({
- label: findItem.title,
- value: findItem.value,
- id: findItem.id,
- parent_id: findItem.parent_id
- })
-
- })
-
- }
-
- arrOne[childIndex].children = arrTwo
-
- }
-
- })
+ }
}
- arr[index].children = arrOne
-
}
-
- })
-
- return arr;
+ return val
},
clearValidate(formName) {
@@ -237,7 +196,6 @@
this.loginForm.password = ""
this.loginForm.password2 = ""
this.loginForm.deptid = ""
- this.loginForm.defaultFlag = false
this.$notify({
title: '注册成功,待审核',
type: 'warning'
@@ -255,7 +213,6 @@
this.loginForm.password = ""
this.loginForm.password2 = ""
this.loginForm.deptid = ""
- this.loginForm.defaultFlag = false
var zs = document.querySelector('.z');
zs.style.display = 'none';
this.clearValidate('loginForm')
diff --git a/src/views/zc/zc.vue b/src/views/zc/zc.vue
index 92df91e..c95d4b0 100644
--- a/src/views/zc/zc.vue
+++ b/src/views/zc/zc.vue
@@ -79,6 +79,7 @@
label: "账号",
searchSpan:4,
display: false,
+ search: true,
disabled:true,
prop: "username",
},
@@ -92,6 +93,7 @@
{
label: "姓名",
display: false,
+ search: true,
searchSpan:4,
disabled:true,
prop: "sname",
@@ -105,7 +107,17 @@
{
label: "部门",
editDisplay: false,
- prop: "deptid",
+ prop: "deptName",
+ },
+ {
+ label: "角色",
+ prop: "parentId",
+ hide: true,
+ dicData: [],
+ type: "tree",
+ props: {
+ label: "title"
+ },
},
{
label: "审核状态",
@@ -154,7 +166,14 @@
}
},
methods: {
+ initData(){
+ getRoleTree().then(res => {
+ const column = this.findObject(this.option.column, "parentId");
+ column.dicData = res.data.data;
+ });
+ },
handleEdit (row, index) {
+ this.initData();
this.$refs.crud.rowEdit(row, index);
},
rowSave(row, done, loading) {
--
Gitblit v1.9.3