Merge branch 'feature-analysis-RLR-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into master-dev
This commit is contained in:
commit
54aa84f31f
|
@ -1,11 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<custom-modal v-model="visible" :width="1200" title="File List">
|
<custom-modal v-model="visible" :width="1200" title="File List">
|
||||||
<search-form :items="formItems" v-model="queryParam" @search="searchQuery"></search-form>
|
<search-form :items="formItems" v-model="queryParam" @search="handleSearch"></search-form>
|
||||||
<custom-table
|
<custom-table
|
||||||
|
rowKey="name"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:list="dataSource"
|
:list="dataSource"
|
||||||
:loading="loading"
|
:loading="isLoading"
|
||||||
:pagination="ipagination"
|
:pagination="pagination"
|
||||||
:selectedRowKeys.sync="selectedRowKeys"
|
:selectedRowKeys.sync="selectedRowKeys"
|
||||||
:selectionRows.sync="selectionRows"
|
:selectionRows.sync="selectionRows"
|
||||||
:scroll="{ y: 440 }"
|
:scroll="{ y: 440 }"
|
||||||
|
@ -20,7 +21,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction } from '@/api/manage'
|
||||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
||||||
import ModalMixin from '@/mixins/ModalMixin'
|
import ModalMixin from '@/mixins/ModalMixin'
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
@ -29,79 +29,98 @@ const columns = [
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
width: '45%',
|
width: '45%',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
ellipsis: true
|
ellipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'UpdateDate',
|
title: 'UpdateDate',
|
||||||
dataIndex: 'updateDate',
|
dataIndex: 'updateDate',
|
||||||
align: 'left'
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Size',
|
title: 'Size',
|
||||||
dataIndex: 'size',
|
dataIndex: 'size',
|
||||||
align: 'left'
|
align: 'left',
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const formItems = [
|
const formItems = [
|
||||||
{
|
{
|
||||||
label: '',
|
label: '',
|
||||||
type: 'a-input',
|
type: 'a-input',
|
||||||
name: 'searchName',
|
name: 'name',
|
||||||
props: {
|
props: {
|
||||||
placeholder: 'search...'
|
placeholder: 'search...',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [ModalMixin, JeecgListMixin],
|
mixins: [ModalMixin],
|
||||||
data() {
|
data() {
|
||||||
this.columns = columns
|
this.columns = columns
|
||||||
this.formItems = formItems
|
this.formItems = formItems
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
inited: false,
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
|
dataSource: [],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectionRows: []
|
selectionRows: [],
|
||||||
|
pagination: {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
pageSizeOptions: ['10', '20', '30'],
|
||||||
|
showTotal: (total, range) => {
|
||||||
|
const { current, pageSize } = this.pagination
|
||||||
|
return `Total ${total} items Page ${current} / ${Math.ceil(total / pageSize)}`
|
||||||
|
},
|
||||||
|
showQuickJumper: true,
|
||||||
|
showSizeChanger: true,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
beforeModalOpen() {
|
beforeModalOpen() {
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
},
|
if(!this.inited) {
|
||||||
|
this.inited = true
|
||||||
loadData(arg) {
|
this.getList()
|
||||||
//加载数据 若传入参数1则加载第一页的内容
|
|
||||||
if (arg === 1) {
|
|
||||||
this.ipagination.current = 1
|
|
||||||
}
|
}
|
||||||
this.onClearSelected()
|
|
||||||
|
|
||||||
const params = this.getQueryParams() //查询条件
|
|
||||||
const searchName = this.queryParam.searchName
|
|
||||||
params.name = searchName
|
|
||||||
this.loading = true
|
|
||||||
getAction('/spectrumFile/get', params)
|
|
||||||
.then(res => {
|
|
||||||
if (res.success) {
|
|
||||||
this.dataSource = res.result.records
|
|
||||||
this.dataSource.forEach((item, index) => {
|
|
||||||
item.id = index
|
|
||||||
})
|
|
||||||
if (res.result.total) {
|
|
||||||
this.ipagination.total = res.result.total
|
|
||||||
} else {
|
|
||||||
this.ipagination.total = 0
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$message.warning(res.message)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async getList() {
|
||||||
|
try {
|
||||||
|
this.isLoading = true
|
||||||
|
const params = {
|
||||||
|
...this.queryParam,
|
||||||
|
pageNo: this.pagination.current,
|
||||||
|
pageSize: this.pagination.pageSize,
|
||||||
|
}
|
||||||
|
const { success, result, message } = await getAction('/spectrumFile/get', params)
|
||||||
|
if (success) {
|
||||||
|
this.dataSource = result.records
|
||||||
|
this.pagination.total = result.total
|
||||||
|
} else {
|
||||||
|
this.$message.error(message)
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleTableChange(pagination, filters, sorter) {
|
||||||
|
this.pagination = pagination
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSearch() {
|
||||||
|
this.pagination.current = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
|
||||||
async handleOk() {
|
async handleOk() {
|
||||||
if (!this.selectedRowKeys.length) {
|
if (!this.selectedRowKeys.length) {
|
||||||
this.$message.warn('Please Select A File to Compare')
|
this.$message.warn('Please Select A File to Compare')
|
||||||
|
@ -110,8 +129,8 @@ export default {
|
||||||
|
|
||||||
this.$emit('fileSelect', this.selectionRows[0].name)
|
this.$emit('fileSelect', this.selectionRows[0].name)
|
||||||
this.visible = false
|
this.visible = false
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user