2021-04-16 21:10:31 +08:00
|
|
|
<template>
|
|
|
|
|
<div style="height: 100%">
|
|
|
|
|
<nz-data-list
|
|
|
|
|
ref="dataList"
|
|
|
|
|
:api="url"
|
|
|
|
|
:custom-table-title.sync="tools.customTableTitle"
|
|
|
|
|
:from="fromRoute.apiKey"
|
2021-08-23 18:50:08 +08:00
|
|
|
:layout="['searchInput', 'elementSet', 'pagination']"
|
2021-06-18 10:43:48 +08:00
|
|
|
:search-msg="searchMsg"
|
|
|
|
|
@search="search">
|
2021-04-16 21:10:31 +08:00
|
|
|
<template v-slot:top-tool-left>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:top-tool-right>
|
2021-09-08 16:22:49 +08:00
|
|
|
<button id="api-key-add" v-has="'system_apiKey_add'" :title="$t('config.system.notification.create')" class="top-tool-btn" type="button" @click="addApiKey">
|
2021-04-16 21:10:31 +08:00
|
|
|
<i class="nz-icon-create-square nz-icon"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:default="slotProps">
|
|
|
|
|
<api-key-table
|
|
|
|
|
ref="dataTable"
|
2021-05-18 19:18:14 +08:00
|
|
|
v-loading="tools.loading"
|
2021-10-22 17:47:42 +08:00
|
|
|
:loading="tools.loading"
|
2021-04-16 21:10:31 +08:00
|
|
|
:table-id="tableId"
|
|
|
|
|
:api="url"
|
|
|
|
|
:custom-table-title="tools.customTableTitle"
|
|
|
|
|
:height="mainTableHeight"
|
|
|
|
|
:table-data="tableData"
|
|
|
|
|
@del="del"
|
|
|
|
|
@edit="edit"
|
|
|
|
|
@orderBy="tableDataSort"
|
|
|
|
|
@reload="getTableData"
|
|
|
|
|
@selectionChange="selectionChange"
|
|
|
|
|
@showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"
|
|
|
|
|
></api-key-table>
|
|
|
|
|
</template>
|
|
|
|
|
</nz-data-list>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import apiKeyTable from './apiKeyTable'
|
|
|
|
|
import dataListMixin from '@/components/common/mixin/dataList'
|
|
|
|
|
import nzDataList from '@/components/common/table/nzDataList'
|
|
|
|
|
import { parentTableCommon } from './systemCommon'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'apiKeyTab',
|
|
|
|
|
components: { nzDataList, apiKeyTable },
|
|
|
|
|
mixins: [dataListMixin, parentTableCommon],
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
url: '/sys/apiKey',
|
|
|
|
|
tableId: 'apiKeyTable',
|
|
|
|
|
searchMsg: { // 给搜索框子组件传递的信息
|
|
|
|
|
zheze_none: true,
|
|
|
|
|
searchLabelList: [{
|
|
|
|
|
id: 1,
|
|
|
|
|
name: 'ID',
|
|
|
|
|
type: 'input',
|
|
|
|
|
label: 'ids',
|
|
|
|
|
disabled: false
|
|
|
|
|
}, {
|
|
|
|
|
id: 5,
|
|
|
|
|
name: this.$t('overall.name'),
|
|
|
|
|
type: 'input',
|
|
|
|
|
label: 'name',
|
|
|
|
|
disabled: false
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
addApiKey: function () {
|
|
|
|
|
this.$refs.dataTable.addApiKey()
|
2021-04-21 18:24:25 +08:00
|
|
|
this.$refs.dataTable.getRoles()
|
2021-04-22 18:03:56 +08:00
|
|
|
}
|
2021-04-16 21:10:31 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
</style>
|