|
@@ -1,7 +1,22 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <SearchBoxVue :data="searchData" :codes="tableShowCode" @search="handleSearch" @reset="handleReset" @codesChange="handleCodesChange" @create="handleCreate" />
|
|
|
|
- <TableBoxVue :loading="loading" :data="tableData" :codes="tableShowCode" style="margin-top: -40px;" @download="handleDownLoad" @edit="handleEdit" @refresh="handleRefresh" />
|
|
|
|
|
|
+ <SearchBoxVue
|
|
|
|
+ :data="searchData"
|
|
|
|
+ :codes="tableShowCode"
|
|
|
|
+ @search="handleSearch"
|
|
|
|
+ @reset="handleReset"
|
|
|
|
+ @codesChange="handleCodesChange"
|
|
|
|
+ @create="handleCreate"
|
|
|
|
+ />
|
|
|
|
+ <TableBoxVue
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :data="tableData"
|
|
|
|
+ :codes="tableShowCode"
|
|
|
|
+ style="margin-top: -40px"
|
|
|
|
+ @export="handleExport"
|
|
|
|
+ @edit="handleEdit"
|
|
|
|
+ @refresh="handleRefresh"
|
|
|
|
+ />
|
|
<pagination
|
|
<pagination
|
|
:auto-scroll="false"
|
|
:auto-scroll="false"
|
|
:total="paginationData.total"
|
|
:total="paginationData.total"
|
|
@@ -10,14 +25,18 @@
|
|
@pagination="handlePagination"
|
|
@pagination="handlePagination"
|
|
/>
|
|
/>
|
|
<!-- 新建、编辑 -->
|
|
<!-- 新建、编辑 -->
|
|
- <CreateDaialogVue v-if="createData.bSwitch" :data="createData" @refresh="handleRefresh" />
|
|
|
|
|
|
+ <CreateDaialogVue
|
|
|
|
+ v-if="createData.bSwitch"
|
|
|
|
+ :data="createData"
|
|
|
|
+ @refresh="handleRefresh"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import SearchBoxVue from './components/SearchBox.vue'
|
|
import SearchBoxVue from './components/SearchBox.vue'
|
|
import TableBoxVue from './components/TableBox.vue'
|
|
import TableBoxVue from './components/TableBox.vue'
|
|
-import { userSearchLogExport } from '@/api/excel'
|
|
|
|
|
|
+import { illnessExport } from '@/api/excel'
|
|
import { illnessList } from '@/api/knowledge'
|
|
import { illnessList } from '@/api/knowledge'
|
|
import CreateDaialogVue from './components/CreateDaialog.vue'
|
|
import CreateDaialogVue from './components/CreateDaialog.vue'
|
|
import { dateFormat } from '@/filters/index'
|
|
import { dateFormat } from '@/filters/index'
|
|
@@ -143,20 +162,31 @@ export default {
|
|
page,
|
|
page,
|
|
page_size
|
|
page_size
|
|
}
|
|
}
|
|
- params.createStartTime = createStartTime ? dateFormat(createStartTime, 'YYYYMMDD') : ''
|
|
|
|
- params.createEndTime = createEndTime ? dateFormat(createEndTime, 'YYYYMMDD') : ''
|
|
|
|
- params.updateStartTime = updateStartTime ? dateFormat(updateStartTime, 'YYYYMMDD') : ''
|
|
|
|
- params.updateEndTime = updateEndTime ? dateFormat(updateEndTime, 'YYYYMMDD') : ''
|
|
|
|
|
|
+ params.createStartTime = createStartTime
|
|
|
|
+ ? dateFormat(createStartTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.createEndTime = createEndTime
|
|
|
|
+ ? dateFormat(createEndTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.updateStartTime = updateStartTime
|
|
|
|
+ ? dateFormat(updateStartTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.updateEndTime = updateEndTime
|
|
|
|
+ ? dateFormat(updateEndTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
this.loading = true
|
|
this.loading = true
|
|
- illnessList(params).then(res => {
|
|
|
|
- const { p } = res
|
|
|
|
- this.paginationData.total = p.count
|
|
|
|
- this.tableData = p.list
|
|
|
|
- }).catch(error => {
|
|
|
|
- console.log(error)
|
|
|
|
- }).finally(() => {
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
|
|
+ illnessList(params)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ const { p } = res
|
|
|
|
+ this.paginationData.total = p.count
|
|
|
|
+ this.tableData = p.list
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ console.log(error)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 分页
|
|
// 分页
|
|
handlePagination(param) {
|
|
handlePagination(param) {
|
|
@@ -195,22 +225,65 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 导出
|
|
// 导出
|
|
- handleDownLoad() {
|
|
|
|
- const { name, dep_id, time, keyword } = this.searchData
|
|
|
|
|
|
+ handleExport() {
|
|
|
|
+ const {
|
|
|
|
+ FLAG,
|
|
|
|
+ KSMC,
|
|
|
|
+ JBMC,
|
|
|
|
+ BM,
|
|
|
|
+ JBBM,
|
|
|
|
+ JBZD,
|
|
|
|
+ ZZ,
|
|
|
|
+ TZ,
|
|
|
|
+ YP,
|
|
|
|
+ ZL,
|
|
|
|
+ JC,
|
|
|
|
+ JJ,
|
|
|
|
+ BFZ,
|
|
|
|
+ CKWX,
|
|
|
|
+ createStartTime,
|
|
|
|
+ createEndTime,
|
|
|
|
+ updateStartTime,
|
|
|
|
+ updateEndTime,
|
|
|
|
+ SSMC,
|
|
|
|
+ SSBM
|
|
|
|
+ } = this.searchData
|
|
const params = {
|
|
const params = {
|
|
- name,
|
|
|
|
- dep_id,
|
|
|
|
- keyword
|
|
|
|
- }
|
|
|
|
- if (time && time.length) {
|
|
|
|
- params.start_time = time[0]
|
|
|
|
- params.end_time = time[1]
|
|
|
|
|
|
+ FLAG,
|
|
|
|
+ KSMC,
|
|
|
|
+ JBMC,
|
|
|
|
+ BM,
|
|
|
|
+ JBBM,
|
|
|
|
+ JBZD,
|
|
|
|
+ ZZ,
|
|
|
|
+ TZ,
|
|
|
|
+ YP,
|
|
|
|
+ ZL,
|
|
|
|
+ JC,
|
|
|
|
+ JJ,
|
|
|
|
+ BFZ,
|
|
|
|
+ CKWX,
|
|
|
|
+ SSMC,
|
|
|
|
+ SSBM
|
|
}
|
|
}
|
|
- userSearchLogExport(params).then(res => {
|
|
|
|
|
|
+ params.createStartTime = createStartTime
|
|
|
|
+ ? dateFormat(createStartTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.createEndTime = createEndTime
|
|
|
|
+ ? dateFormat(createEndTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.updateStartTime = updateStartTime
|
|
|
|
+ ? dateFormat(updateStartTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ params.updateEndTime = updateEndTime
|
|
|
|
+ ? dateFormat(updateEndTime, 'YYYYMMDD')
|
|
|
|
+ : ''
|
|
|
|
+ illnessExport(params).then((res) => {
|
|
const content = res.data // 后台返回二进制数据
|
|
const content = res.data // 后台返回二进制数据
|
|
const blob = new Blob([content])
|
|
const blob = new Blob([content])
|
|
- const fileName = `科研探索日志.csv`
|
|
|
|
- if ('download' in document.createElement('a')) { // 非IE下载
|
|
|
|
|
|
+ const fileName = `疾病库.csv`
|
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
|
+ // 非IE下载
|
|
const elink = document.createElement('a')
|
|
const elink = document.createElement('a')
|
|
elink.download = fileName
|
|
elink.download = fileName
|
|
elink.style.display = 'none'
|
|
elink.style.display = 'none'
|
|
@@ -219,7 +292,8 @@ export default {
|
|
elink.click()
|
|
elink.click()
|
|
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
|
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
|
document.body.removeChild(elink)
|
|
document.body.removeChild(elink)
|
|
- } else { // IE10+下载
|
|
|
|
|
|
+ } else {
|
|
|
|
+ // IE10+下载
|
|
navigator.msSaveBlob(blob, fileName)
|
|
navigator.msSaveBlob(blob, fileName)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -242,5 +316,4 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-
|
|
|
|
</style>
|
|
</style>
|