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