mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 09:43:32 +00:00
[Update] 修改list table
This commit is contained in:
@@ -42,7 +42,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
genericOptions(data) {
|
||||
console.log(data)
|
||||
const _this = this // 透传This
|
||||
Object.keys(data).forEach(function(key) {
|
||||
if (data[key].filter) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<TableAction :table-url="tableConfig.url" :search-table="search" v-bind="headerActions" :selected-rows="selectedRows" :reload-table="reloadTable" />
|
||||
<el-card class="table-content" shadow="never">
|
||||
<IBox class="table-content">
|
||||
<AutoDataTable :key="tableConfig.url" ref="dataTable" :config="tableConfig" @selection-change="handleSelectionChange" />
|
||||
<Dialog :title="$tc('Export')" :visible.sync="showExportDialog" center @confirm="handleDialogConfirm('export')" @cancel="handleDialogCancel('export')">
|
||||
<el-form>
|
||||
@@ -35,14 +35,14 @@
|
||||
</el-upload>
|
||||
</div>
|
||||
</Dialog>
|
||||
</el-card>
|
||||
</IBox>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable no-unused-vars */
|
||||
import AutoDataTable from '../AutoDataTable'
|
||||
import Dialog from '../Dialog'
|
||||
import IBox from '../IBox'
|
||||
import TableAction from './TableAction'
|
||||
import { createSourceIdCache } from '@/api/common'
|
||||
|
||||
@@ -51,7 +51,8 @@ export default {
|
||||
components: {
|
||||
AutoDataTable,
|
||||
TableAction,
|
||||
Dialog
|
||||
Dialog,
|
||||
IBox
|
||||
},
|
||||
props: {
|
||||
// 定义 table 的配置
|
||||
@@ -140,7 +141,6 @@ export default {
|
||||
return this.downloadCsv(url)
|
||||
},
|
||||
handleImport() {
|
||||
|
||||
},
|
||||
async downloadUpdateTempUrl() {
|
||||
var resources = []
|
||||
|
@@ -16,4 +16,5 @@ export { default as ActiveCard } from './ActiveCard'
|
||||
export { default as Select2 } from './Select2'
|
||||
export { default as SvgIcon } from './SvgIcon'
|
||||
export { default as TreeTable } from './TreeTable'
|
||||
export { default as IBox } from './IBox'
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
</Page>
|
||||
</template>
|
||||
<script>
|
||||
import { Page, IBox } from '@/layout/components'
|
||||
import { IBox } from '@/components'
|
||||
import { Page } from '@/layout/components'
|
||||
import AutoDataForm from '@/components/AutoDataForm'
|
||||
export default {
|
||||
name: 'GenericCreateUpdatePage',
|
||||
@@ -35,7 +36,7 @@ export default {
|
||||
},
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
default: null
|
||||
},
|
||||
initial: {
|
||||
type: Object,
|
||||
@@ -116,13 +117,18 @@ export default {
|
||||
return this.getUrl()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
async mounted() {
|
||||
this.loading = true
|
||||
if (this.method === 'put') {
|
||||
this.getObjectDetail()
|
||||
if (this.object === null) {
|
||||
await this.getObjectDetail()
|
||||
} else {
|
||||
this.form = this.object
|
||||
}
|
||||
} else {
|
||||
this.form = Object.assign(this.form, this.initial)
|
||||
this.loading = false
|
||||
}
|
||||
this.loading = false
|
||||
},
|
||||
methods: {
|
||||
handleSubmit(values) {
|
||||
@@ -155,13 +161,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getObjectDetail() {
|
||||
this.$axios.get(this.totalUrl).then(data => {
|
||||
async getObjectDetail() {
|
||||
return this.$axios.get(this.totalUrl).then(data => {
|
||||
this.form = data
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,5 @@ export { default as TagsView } from './TagsView'
|
||||
export { default as GenericDetailPage } from './GenericDetailPage'
|
||||
export { default as TabPage } from './TabPage'
|
||||
export { default as Footer } from './Footer'
|
||||
export { default as IBox } from './IBox'
|
||||
export { default as GenericListPage } from './GenericListPage'
|
||||
export { default as GenericCreateUpdatePage } from './GenericCreateUpdatePage'
|
||||
|
@@ -22,12 +22,8 @@ export default {
|
||||
detailRoute: 'UserGroupDetail'
|
||||
},
|
||||
headerActions: {
|
||||
createRoute: 'UserGroupCreate',
|
||||
performBulkDelete: function(rows) {
|
||||
console.log('hello')
|
||||
}
|
||||
},
|
||||
helpMessage: '用户列表'
|
||||
createRoute: 'UserGroupCreate'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user