|
@@ -21,11 +21,10 @@
|
|
|
<div class="newService-content-left-top">
|
|
|
<div class="flex head">
|
|
|
<div class="title">账号组列表</div>
|
|
|
- <el-button @click="handleAdd" class="serButton" size="small">新增</el-button>
|
|
|
+ <el-button class="serButton" size="small" @click="handleAdd">新增</el-button>
|
|
|
</div>
|
|
|
<div class="search">
|
|
|
- <el-input size="small" placeholder="请输入内容" clearable prefix-icon="el-icon-search" :filter-node-method="filterArrNode" v-model="search">
|
|
|
- </el-input>
|
|
|
+ <el-input v-model="search" size="small" placeholder="请输入内容" clearable prefix-icon="el-icon-search" :filter-node-method="filterArrNode" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="newService-content-left-bottom">
|
|
@@ -40,8 +39,8 @@
|
|
|
<span @click.stop="handleRemove(item)" class="error">删除</span>
|
|
|
</div>
|
|
|
</div> -->
|
|
|
- <el-tree ref="treeArr" :data="arrs" :props="defaultArrProps" highlight-current :filter-node-method="filterArrNode" default-expand-all node-key="user_group_id" @node-click="handleNodeClick" :expand-on-click-node="false">
|
|
|
- <span class="custom-tree-node" slot-scope="{ node,data }">
|
|
|
+ <el-tree ref="treeArr" :data="arrs" :props="defaultArrProps" highlight-current :filter-node-method="filterArrNode" default-expand-all node-key="user_group_id" :expand-on-click-node="false" @node-click="handleNodeClick">
|
|
|
+ <span slot-scope="{ node,data }" class="custom-tree-node">
|
|
|
<div class="flex">
|
|
|
<span class="customTxt">{{ node.label }}</span>
|
|
|
<span v-show="treeCheckId == data.user_group_id" class="customBtn">
|
|
@@ -54,7 +53,7 @@
|
|
|
</el-scrollbar>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <el-empty description="暂无数据"></el-empty>
|
|
|
+ <el-empty description="暂无数据" />
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -62,21 +61,20 @@
|
|
|
<div class="newUserManagement-content-right-top">
|
|
|
<div class="head flex">
|
|
|
<div class="title">账号组信息</div>
|
|
|
- <el-button @click="handleSave" type="primary" size="small" :disabled="editGroupDisabled">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" :disabled="editGroupDisabled" @click="handleSave">保存</el-button>
|
|
|
</div>
|
|
|
<div class="contents">
|
|
|
- <el-form :inline="true" :rules="rules" ref="form" :model="formInline" class="demo-form-inline">
|
|
|
+ <el-form ref="form" :inline="true" :rules="rules" :model="formInline" class="demo-form-inline">
|
|
|
<el-form-item prop="user_group_name" label="账号组名称">
|
|
|
- <el-input style="width:260px;margin-right: 30px;" size="small" v-model="formInline.user_group_name" placeholder="请输入账号组名称" :disabled="editGroupDisabled"></el-input>
|
|
|
+ <el-input v-model="formInline.user_group_name" style="width:260px;margin-right: 30px;" size="small" placeholder="请输入账号组名称" :disabled="editGroupDisabled" />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="up_user_group_name" label="上级用户组">
|
|
|
- <el-select style="width:260px;margin-right: 30px;" size="small" clearable v-model="formInline.up_user_group_id" placeholder="请选择上级用户组" :disabled="editGroupDisabled">
|
|
|
- <el-option v-for="item in arrTree" :key="item.user_group_id" :label="item.user_group_name" :value="item.user_group_id">
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="formInline.up_user_group_id" style="width:260px;margin-right: 30px;" size="small" clearable placeholder="请选择上级用户组" :disabled="editGroupDisabled">
|
|
|
+ <el-option v-for="item in arrTree" :key="item.user_group_id" :label="item.user_group_name" :value="item.user_group_id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述">
|
|
|
- <el-input style="width:260px;" size="small" v-model="formInline.user_group_comment" placeholder="请输入描述" :disabled="editGroupDisabled"></el-input>
|
|
|
+ <el-input v-model="formInline.user_group_comment" style="width:260px;" size="small" placeholder="请输入描述" :disabled="editGroupDisabled" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -84,12 +82,11 @@
|
|
|
<div class="newUserManagement-content-right-bottom">
|
|
|
<div class="head flex">
|
|
|
<div class="title">账号列表</div>
|
|
|
- <el-button @click="handleTableAdd" type="primary" size="small" :disabled="addUserDisabled">新增</el-button>
|
|
|
+ <el-button type="primary" size="small" :disabled="addUserDisabled" @click="handleTableAdd">新增</el-button>
|
|
|
</div>
|
|
|
<div class="contents">
|
|
|
<el-table :data="tableData" height="100%" border style="width: 100%">
|
|
|
- <el-table-column prop="user_name" label="用户名">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="user_name" label="用户名" />
|
|
|
<el-table-column prop="user_status" label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
<div>{{ scope.row.user_status ? '启用' :'禁用' }}</div>
|
|
@@ -97,14 +94,13 @@
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column prop="token_valid_duration" label="令牌有效时长">
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column prop="user_comment" label="描述">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="user_comment" label="描述" />
|
|
|
<el-table-column label="操作" width="235">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleTablepaswod(scope.row)" type="primary" plain size="small">修改密码 </el-button>
|
|
|
- <el-button @click="handleTableEdit(scope.row)" type="primary" plain size="small">编辑 </el-button>
|
|
|
+ <el-button type="primary" plain size="small" @click="handleTablepaswod(scope.row)">修改密码 </el-button>
|
|
|
+ <el-button type="primary" plain size="small" @click="handleTableEdit(scope.row)">编辑 </el-button>
|
|
|
<!-- <el-button @click="handleTableAuth(scope.row)" type="primary" plain size="small">账号授权 </el-button> -->
|
|
|
- <el-button @click="handleTableDel(scope.row)" type="danger" size="small">删除 </el-button>
|
|
|
+ <el-button type="danger" size="small" @click="handleTableDel(scope.row)">删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -120,14 +116,14 @@
|
|
|
<el-form-item label="账号密码" prop="user_pwd">
|
|
|
<div class="flex-wrap">
|
|
|
<el-input v-model="ruleForm.user_pwd" class="r25" size="small" placeholder="请输入密码" />
|
|
|
- <el-button size="small" @click="restPwd" style="position: relative;top: 4px;" class="r26" type="primary">生成密码</el-button>
|
|
|
+ <el-button size="small" style="position: relative;top: 4px;" class="r26" type="primary" @click="restPwd">生成密码</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot right">
|
|
|
- <el-button size="small" @click="handleOkSk('ruleForms')" class="r24" type="primary">确定</el-button>
|
|
|
- <el-button @click="eledite" size="small">取消</el-button>
|
|
|
+ <el-button size="small" class="r24" type="primary" @click="handleOkSk('ruleForms')">确定</el-button>
|
|
|
+ <el-button size="small" @click="eledite">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Dialog>
|
|
@@ -137,8 +133,8 @@
|
|
|
<div class="contents">
|
|
|
<el-form ref="ruleForm" :model="ruleForm" :rules="tableRules" label-width="100px" class="demo-ruleForm">
|
|
|
<el-form-item label="账号组关联" prop="user_gropu_id">
|
|
|
- <el-select style="width: 100%" size="small" v-model="ruleForm.user_group_id" placeholder="请选择">
|
|
|
- <el-option v-for="item in arrTree" :key="item.user_group_id" :label="item.user_group_name" :value="item.user_group_id"> </el-option>
|
|
|
+ <el-select v-model="ruleForm.user_group_id" style="width: 100%" size="small" placeholder="请选择">
|
|
|
+ <el-option v-for="item in arrTree" :key="item.user_group_id" :label="item.user_group_name" :value="item.user_group_id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="账号名称" prop="user_name">
|
|
@@ -166,8 +162,8 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot right">
|
|
|
- <el-button size="small" @click="handleOk('ruleForm')" class="r24" type="primary">确定</el-button>
|
|
|
- <el-button @click="eledite" size="small">取消</el-button>
|
|
|
+ <el-button size="small" class="r24" type="primary" @click="handleOk('ruleForm')">确定</el-button>
|
|
|
+ <el-button size="small" @click="eledite">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</Dialog>
|
|
@@ -179,7 +175,7 @@
|
|
|
label: 'role_name',
|
|
|
children: 'role_ID',
|
|
|
}" :default-checked-keys="checkedKeysTemp" @check="handleCheck" /> -->
|
|
|
- <el-checkbox v-model="item.role_status" v-for="(item, index) in tableCols" :key="index" @change="handleCheckedCitiesChange(item)">{{ item.role_name }}</el-checkbox>
|
|
|
+ <el-checkbox v-for="(item, index) in tableCols" :key="index" v-model="item.role_status" @change="handleCheckedCitiesChange(item)">{{ item.role_name }}</el-checkbox>
|
|
|
</div>
|
|
|
<div class="foot right t30">
|
|
|
<!-- <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button> -->
|
|
@@ -191,11 +187,11 @@
|
|
|
<div class="airportInfoDialog">
|
|
|
<div class="title del-title">删除</div>
|
|
|
<div class="content del-content">
|
|
|
- <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ rmTitle }}</span>
|
|
|
+ <span class="el-icon-error error r10" />您是否确认删除<span class="error l10">{{ rmTitle }}</span>
|
|
|
?
|
|
|
</div>
|
|
|
<div class="foot right Delfoot">
|
|
|
- <el-button size="small" class="r24" @click="tableRemove" type="danger">删除</el-button>
|
|
|
+ <el-button size="small" class="r24" type="danger" @click="tableRemove">删除</el-button>
|
|
|
<el-button size="small" @click="rmFlag = false">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -209,6 +205,7 @@ import Dialog from '@/layout/components/Dialog'
|
|
|
import pf from '@/layout/mixin/publicFunc'
|
|
|
import MD5 from 'blueimp-md5'
|
|
|
import { listToTree } from '@/utils/validate'
|
|
|
+import '@/config/staticConfig' // 按钮权限 全局自定义指令v-is
|
|
|
export default {
|
|
|
name: 'NewManageMent',
|
|
|
components: { Dialog },
|
|
@@ -238,25 +235,25 @@ export default {
|
|
|
user_group_name: [{ required: true, message: '请输入账号组名称', trigger: 'blur' }],
|
|
|
},
|
|
|
ruleForm: {
|
|
|
- "token_valid_time": null,
|
|
|
- "token_valid_duration": null,
|
|
|
- "user_code": null,
|
|
|
- "user_code_expire": null,
|
|
|
- "user_comment": null,
|
|
|
- "user_group_id": null,
|
|
|
- "user_id": null,
|
|
|
- "user_name": null,
|
|
|
- "user_pwd": null,
|
|
|
- "user_sec_pwd": null,
|
|
|
- "user_status": null,
|
|
|
- "user_token": null
|
|
|
+ 'token_valid_time': null,
|
|
|
+ 'token_valid_duration': null,
|
|
|
+ 'user_code': null,
|
|
|
+ 'user_code_expire': null,
|
|
|
+ 'user_comment': null,
|
|
|
+ 'user_group_id': null,
|
|
|
+ 'user_id': null,
|
|
|
+ 'user_name': null,
|
|
|
+ 'user_pwd': null,
|
|
|
+ 'user_sec_pwd': null,
|
|
|
+ 'user_status': null,
|
|
|
+ 'user_token': null
|
|
|
},
|
|
|
tableRules: {
|
|
|
- user_name: [{ required: true, message: "请输入账号名称", trigger: "blur" }],
|
|
|
+ user_name: [{ required: true, message: '请输入账号名称', trigger: 'blur' }],
|
|
|
user_group_id: [{ required: true, message: '请选择账号组', trigger: 'change' }],
|
|
|
- user_pwd: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
|
|
+ user_pwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
|
|
},
|
|
|
- paswordFlag: false,//修改密码
|
|
|
+ paswordFlag: false, // 修改密码
|
|
|
tableFlag: false,
|
|
|
title: '新增',
|
|
|
type: '',
|
|
@@ -287,14 +284,6 @@ export default {
|
|
|
treeCheckObj: {}
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- search (val) {
|
|
|
- this.$refs.treeArr.filter(val);
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- this.getTreeData()
|
|
|
- },
|
|
|
computed: {
|
|
|
dataList () {
|
|
|
return this.arrs
|
|
@@ -306,6 +295,14 @@ export default {
|
|
|
return !this.treeCheckId
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ search (val) {
|
|
|
+ this.$refs.treeArr.filter(val)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getTreeData()
|
|
|
+ },
|
|
|
methods: {
|
|
|
async getTreeData () {
|
|
|
const { code, returnData } = await this.getQueryListAuth(this.queryId)
|
|
@@ -318,8 +315,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
filterArrNode (value, data) {
|
|
|
- if (!value) return true;
|
|
|
- return data.user_group_name.indexOf(value) !== -1;
|
|
|
+ if (!value) return true
|
|
|
+ return data.user_group_name.indexOf(value) !== -1
|
|
|
},
|
|
|
handleAdd () {
|
|
|
this.type = 'add'
|
|
@@ -357,7 +354,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //清空表单
|
|
|
+ // 清空表单
|
|
|
clearForm () {
|
|
|
const data = this.formInline
|
|
|
for (const key in data) {
|
|
@@ -376,12 +373,12 @@ export default {
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
this.$refs['ruleForm'].resetFields()
|
|
|
- }, 50);
|
|
|
+ }, 50)
|
|
|
},
|
|
|
restPwd () {
|
|
|
this.ruleForm.user_pwd = '123!@#QWEqwe'
|
|
|
},
|
|
|
- //树删除
|
|
|
+ // 树删除
|
|
|
handleRemove (data) {
|
|
|
this.rmTitle = data.user_group_name
|
|
|
this.rmFlag = true
|
|
@@ -459,8 +456,7 @@ export default {
|
|
|
this.tipMsg(code)
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
@@ -494,7 +490,7 @@ export default {
|
|
|
this.tableCols = result.returnData
|
|
|
this.tableCols.forEach(element => {
|
|
|
element.user_id = row.user_id
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
if (msg.code == 0 && msg.returnData && msg.returnData.length) {
|
|
|
msg.returnData.forEach(element => {
|
|
@@ -502,8 +498,8 @@ export default {
|
|
|
if (res.role_ID == element.role_id) {
|
|
|
res.role_status = true
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
// console.log(this.tableCols)
|
|
|
// console.log(code)
|
|
@@ -605,8 +601,7 @@ export default {
|
|
|
this.clearTableForm()
|
|
|
this.tableFlag = false
|
|
|
this.paswordFlag = false
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
@@ -720,4 +715,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|