2021-06-11 10:00:22 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<cn-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
v-model:custom-table-title="tools.customTableTitle"
|
|
|
|
|
:api="url"
|
|
|
|
|
:from="fromRoute.user"
|
2021-06-18 15:25:13 +08:00
|
|
|
:layout="['columnCustomize','elementSet']"
|
2021-06-11 10:00:22 +08:00
|
|
|
>
|
|
|
|
|
<template #top-tool-right>
|
|
|
|
|
<button
|
|
|
|
|
id="account-add"
|
|
|
|
|
v-has="'user_add'"
|
|
|
|
|
class="top-tool-btn margin-r-10"
|
|
|
|
|
type="button"
|
|
|
|
|
@click="add"
|
|
|
|
|
>
|
2021-06-18 15:25:13 +08:00
|
|
|
<i class="cn-icon-add cn-icon"/>
|
2021-06-11 10:00:22 +08:00
|
|
|
</button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #default>
|
|
|
|
|
<user-table
|
|
|
|
|
ref="dataTable"
|
|
|
|
|
v-loading="tools.loading"
|
|
|
|
|
:api="url"
|
|
|
|
|
:custom-table-title="tools.customTableTitle"
|
|
|
|
|
:height="mainTableHeight"
|
|
|
|
|
:table-data="tableData"
|
2021-06-16 15:01:58 +08:00
|
|
|
@delete="del"
|
2021-06-11 10:00:22 +08:00
|
|
|
@edit="edit"
|
|
|
|
|
@orderBy="tableDataSort"
|
|
|
|
|
@reload="getTableData"
|
|
|
|
|
@selectionChange="selectionChange"
|
|
|
|
|
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
<template #pagination>
|
2021-06-11 16:59:16 +08:00
|
|
|
<pagination ref="pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
|
2021-06-11 10:00:22 +08:00
|
|
|
</template>
|
|
|
|
|
</cn-data-list>
|
|
|
|
|
<transition name="right-box">
|
|
|
|
|
<user-box
|
|
|
|
|
v-if="rightBox.show"
|
|
|
|
|
:object="object"
|
|
|
|
|
@close="closeRightBox"
|
|
|
|
|
/>
|
|
|
|
|
</transition>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import cnDataList from '@/components/table/CnDataList'
|
|
|
|
|
import dataListMixin from '@/mixins/dataList'
|
|
|
|
|
import userTable from '@/components/table/settings/UserTable'
|
|
|
|
|
import userBox from '@/components/rightBox/settings/UserBox'
|
|
|
|
|
import { put } from '@/utils/http'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'User',
|
2021-06-11 16:59:16 +08:00
|
|
|
mixins: [dataListMixin],
|
2021-06-11 10:00:22 +08:00
|
|
|
components: {
|
|
|
|
|
cnDataList,
|
|
|
|
|
userTable,
|
|
|
|
|
userBox
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
url: 'sys/user',
|
|
|
|
|
blankObject: { // 空白对象
|
|
|
|
|
id: '',
|
|
|
|
|
name: '',
|
|
|
|
|
username: '',
|
|
|
|
|
email: '',
|
|
|
|
|
pin: '',
|
|
|
|
|
mobile: '',
|
2021-06-16 15:01:58 +08:00
|
|
|
status: 1,
|
2021-06-11 10:00:22 +08:00
|
|
|
roleIds: '',
|
|
|
|
|
pinChange: ''
|
|
|
|
|
},
|
|
|
|
|
tableId: 'userTable'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2021-06-16 15:28:06 +08:00
|
|
|
|
2021-06-11 10:00:22 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|