|
|
@@ -48,17 +48,31 @@
|
|
|
<div class="table-operator" style="margin: 15px 0">
|
|
|
<a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
|
|
|
<a-button ghost type="danger" icon="download" @click="handleExportXls('角色信息')">导出</a-button>
|
|
|
- <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="url.importExcelUrl" @change="handleImportExcel">
|
|
|
+ <a-upload
|
|
|
+ name="file"
|
|
|
+ :show-upload-list="false"
|
|
|
+ :multiple="false"
|
|
|
+ :headers="tokenHeader"
|
|
|
+ :action="url.importExcelUrl"
|
|
|
+ @change="handleImportExcel"
|
|
|
+ >
|
|
|
<a-button ghost type="danger" icon="import">导入</a-button>
|
|
|
</a-upload>
|
|
|
|
|
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
|
|
<a-menu slot="overlay">
|
|
|
- <a-menu-item key="1"><a-icon type="highlight" />重置密码</a-menu-item>
|
|
|
- <a-menu-item key="2" @click="batchDel"><a-icon type="delete" />批量删除</a-menu-item>
|
|
|
+ <a-menu-item key="1">
|
|
|
+ <a-icon type="highlight" />
|
|
|
+ 重置密码
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item key="2" @click="batchDel">
|
|
|
+ <a-icon type="delete" />
|
|
|
+ 批量删除
|
|
|
+ </a-menu-item>
|
|
|
</a-menu>
|
|
|
<a-button style="margin-left: 8px">
|
|
|
- 批量操作 <a-icon type="down" />
|
|
|
+ 批量操作
|
|
|
+ <a-icon type="down" />
|
|
|
</a-button>
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
@@ -66,7 +80,8 @@
|
|
|
<!-- table区域-begin -->
|
|
|
<div>
|
|
|
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
|
|
- <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
|
|
|
+ <i class="anticon anticon-info-circle ant-alert-icon" /> 已选择 <a style="font-weight: 600">{{
|
|
|
+ selectedRowKeys.length }}</a>项
|
|
|
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
|
</div>
|
|
|
|
|
|
@@ -82,7 +97,20 @@
|
|
|
:row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
|
@change="handleTableChange"
|
|
|
>
|
|
|
-
|
|
|
+ <template slot="dept" slot-scope="text, record">
|
|
|
+ {{ record['dept'].deptName }}
|
|
|
+ </template>
|
|
|
+ <template slot="leader" slot-scope="text, record">
|
|
|
+ {{ record['dept'].leader }}
|
|
|
+ </template>
|
|
|
+ <template slot="status" slot-scope="text, record">
|
|
|
+ <a-switch
|
|
|
+ :checked="record.status==='0'?false:true"
|
|
|
+ checked-children="启用"
|
|
|
+ un-checked-children="停用"
|
|
|
+ @change="changeStatus({$event,record})"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a-button size="small" type="primary" @click="handleEdit(record)">
|
|
|
编辑
|
|
|
@@ -94,7 +122,12 @@
|
|
|
</a-button>
|
|
|
<a-menu slot="overlay">
|
|
|
<a-menu-item>
|
|
|
- <a href="javascript:;" @click="handlePer(record)">操作权限</a>
|
|
|
+ <a-popconfirm title="确认重置密码吗?" @confirm="() => rePwd(record)">
|
|
|
+ <a href="javascript:;">重置密码</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a href="javascript:;" @click="handlePer(record)">角色分配</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-item>
|
|
|
<a href="javascript:;" @click="loginLog(record)">登录日志</a>
|
|
|
@@ -113,6 +146,7 @@
|
|
|
</span>
|
|
|
</a-table>
|
|
|
<check-and-edit-model ref="modalForm" @ok="modalFormOk" />
|
|
|
+ <right-Tree ref="rightTree" @ok="updateQueryParam" />
|
|
|
</div>
|
|
|
<!-- table区域-end -->
|
|
|
<!-- 表单区域 -->
|
|
|
@@ -125,10 +159,14 @@ import { listMixin } from '@/mixin/listMixin'
|
|
|
import columns from './indexColumns'
|
|
|
import CheckAndEditModel from './CheckAndEditModel'
|
|
|
import leftTree from '@/components/leftTree'
|
|
|
+import { httpAction } from '@/api/request'
|
|
|
+import rightTree from './rightTree'
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
CheckAndEditModel,
|
|
|
- leftTree
|
|
|
+ leftTree,
|
|
|
+ rightTree
|
|
|
},
|
|
|
mixins: [listMixin],
|
|
|
data() {
|
|
|
@@ -138,8 +176,8 @@ export default {
|
|
|
// 表头
|
|
|
columns: columns(this),
|
|
|
url: {
|
|
|
- list: '/business/catenary/bus/zzdzxx/list',
|
|
|
- delete: '/business/catenary/bus/zzdzxx/',
|
|
|
+ list: '/system/user/list',
|
|
|
+ delete: '/system/user/',
|
|
|
exportXlsUrl: '/exportXlsUrl',
|
|
|
importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
|
|
|
}
|
|
|
@@ -152,9 +190,40 @@ export default {
|
|
|
this.queryParam.cate = data.id
|
|
|
this.loadData()
|
|
|
},
|
|
|
- handleLog() {},
|
|
|
- loginLog() {},
|
|
|
- handlePer() {}
|
|
|
+ rePwd(record) {
|
|
|
+ httpAction('/system/user/resetPwd', record, 'put').then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeStatus({ $event, record }) {
|
|
|
+ console.log($event, record)
|
|
|
+ record.status = $event ? '1' : '0'
|
|
|
+ httpAction('/system/user/changeStatus', record, 'put').then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ } else {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleLog() {
|
|
|
+ },
|
|
|
+ loginLog() {
|
|
|
+ },
|
|
|
+ handlePer() {
|
|
|
+ this.$refs.rightTree.title = '操作权限'
|
|
|
+ this.$refs.rightTree.treeKey = '/treeKey'
|
|
|
+ this.$refs.rightTree.treeList = '/system/user/authRole'
|
|
|
+ this.$refs.rightTree.show()
|
|
|
+ },
|
|
|
+ updateQueryParam(data) {
|
|
|
+ this.queryParam.unit = data.id
|
|
|
+ this.queryParam.unitName = data.departName
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|