Merge branch 'feature-particulate-renpy' of http://git.hivekion.com:3000/xiaoguangbin/AnalysisSystemForRadionuclide_vue into feature-particulate-renpy

This commit is contained in:
orgin 2023-08-02 08:48:49 +08:00
commit 0d2d8c1018
7 changed files with 45 additions and 15 deletions

View File

@ -19,7 +19,6 @@
</a-table>
</template>
<script>
import {cloneDeep} from 'lodash'
export default {
props: {
list: {
@ -47,34 +46,47 @@ export default {
selectedRowKeys: {
type: Array
},
selectionRows: {
type: Array
},
canSelect: {
type: Boolean,
default: true
},
multiple: {
type: Boolean,
default: false
}
},
data() {
return {
innerSelectedRowKeys: cloneDeep(this.selectedRowKeys) || []
innerSelectedRowKeys: [],
innerSelectedRows: []
}
},
methods: {
// /
customRow(record) {
let _this = this
const key = record[this.rowKey]
return {
class: _this.innerSelectedRowKeys.includes(record[_this.rowKey]) ? 'ant-table-row-selected' : '',
class: this.innerSelectedRowKeys.includes(key) ? 'ant-table-row-selected' : '',
on: {
click: () => {
if(!_this.canSelect) {
if(!this.canSelect) {
return
}
if (_this.innerSelectedRowKeys.includes(record[_this.rowKey])) {
_this.innerSelectedRowKeys = []
if (this.innerSelectedRowKeys.includes(key)) {
const findIndex = this.innerSelectedRowKeys.findIndex(k => k == key)
this.innerSelectedRowKeys.splice(findIndex, 1)
} else {
_this.innerSelectedRowKeys = [record[_this.rowKey]]
if(this.multiple) {
this.innerSelectedRowKeys.push(key)
}
_this.$emit('update:selectedRowKeys', _this.innerSelectedRowKeys)
_this.$emit("detail",record)
else {
this.innerSelectedRowKeys = [key]
}
}
this.$emit("detail",record)
}
}
}
@ -84,8 +96,15 @@ export default {
}
},
watch: {
selectedRowKeys () {
this.innerSelectedRowKeys = cloneDeep(this.selectedRowKeys)
selectedRowKeys (val) {
this.innerSelectedRowKeys = val
},
innerSelectedRowKeys () {
this.$emit('update:selectedRowKeys', this.innerSelectedRowKeys)
this.innerSelectedRows = this.innerSelectedRowKeys.map((key) => {
return this.list.find(item => item[this.rowKey] === key)
})
this.$emit('update:selectionRows', this.innerSelectedRows)
}
},
computed: {

View File

@ -73,6 +73,7 @@ export default {
getAction(url, params).then((res) => {
if (res.code && res.code==500) {
_this.fileSrc = ""
this.$message.warning("This operation fails. Contact your system administrator")
} else {
const blob = new Blob([res], { type: 'text/plain' })
_this.fileSrc = window.URL.createObjectURL(blob)

View File

@ -146,6 +146,7 @@ export default {
}
},
searchQueryData() {
this.loading = true
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
if (days <= 10) {
this.isImmediate = false
@ -155,6 +156,7 @@ export default {
pageSize: 10
}
getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success) {
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size

View File

@ -135,6 +135,7 @@ export default {
}
},
searchQueryData() {
this.loading = true
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
if (days <= 10) {
this.isImmediate = false
@ -149,6 +150,7 @@ export default {
pageSize: 10
}
getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success) {
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size

View File

@ -16,7 +16,6 @@
:list="dataSource"
:pagination="ipagination"
:loading="loading"
:canSelect="false"
@change="handleTableChange"
@detail="handleDetail"
>
@ -137,10 +136,12 @@ export default {
this.isFileDetail = flag
},
handleDetail(record) {
console.log(record);
this.currSampleId = record.sohId
this.isFileDetail = true
},
searchQueryData() {
this.loading = true
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
if (days <= 10) {
this.isImmediate = false
@ -155,6 +156,7 @@ export default {
pageSize: 10
}
getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success) {
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size

View File

@ -73,7 +73,7 @@ const columns = [
]
import { compareDate } from "../../commom"
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '../../../../api/manage'
import { getAction, getFileAction } from '../../../../api/manage'
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
import FileDetail from "../../fileDetail.vue"
export default {
@ -141,6 +141,7 @@ export default {
this.isFileDetail = true
},
searchQueryData() {
this.loading = true
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
if (days <= 10) {
this.isImmediate = false
@ -155,6 +156,7 @@ export default {
pageSize: 10
}
getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success) {
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size

View File

@ -73,7 +73,7 @@ const columns = [
]
import { compareDate } from "../../commom"
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction } from '../../../../api/manage'
import { getAction, getFileAction } from '../../../../api/manage'
import dateFormat from '../../../../components/jeecg/JEasyCron/format-date'
import FileDetail from "../../fileDetail.vue"
export default {
@ -141,6 +141,7 @@ export default {
this.isFileDetail = true
},
searchQueryData() {
this.loading = true
let days = compareDate(this.queryParam.startTime, this.queryParam.endTime)
if (days <= 10) {
this.isImmediate = false
@ -155,6 +156,7 @@ export default {
pageSize: 10
}
getAction(this.url.list, params).then((res) => {
this.loading = false
if (res.success) {
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size