mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
parent
c510dc4ba6
commit
02d6c44956
|
@ -57,15 +57,13 @@ export const exportData = (fileName: string, data: Array<any>) => {
|
|||
* @param sheetNameKey data中的键名 对应表页名称
|
||||
* @param sheetDataKey data中的键名 对应表数据
|
||||
*/
|
||||
export const exportMultiData = (fileName: string, data: Array<any>, sheetNameKey: string, sheetDataKey: string) => {
|
||||
export const exportMultiData = (fileName: string, data: Array<any>) => {
|
||||
if (data.length < 1) return
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.forEach(item => {
|
||||
XLSX.utils.book_append_sheet(
|
||||
wb,
|
||||
XLSX.utils.json_to_sheet(item[sheetDataKey]),
|
||||
item[sheetNameKey] instanceof Date ? dateFormater('yyyy-MM-dd HH:mm:ss', item[sheetNameKey]) : item[sheetNameKey]
|
||||
XLSX.utils.json_to_sheet(data),
|
||||
"Sheet1"
|
||||
)
|
||||
})
|
||||
XLSX.writeFile(wb, fileName + '.xls'); // 导出Excel
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
<template>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100" :disabled="type === 'view'">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<!-- <el-form-item label="类型" prop="type">
|
||||
<el-input :model-value="formData.type"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input :model-value="formData.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP地址" prop="ip">
|
||||
<el-input :model-value="formData.ip"></el-input>
|
||||
<el-form-item label="IP地址" prop="remoteAddr">
|
||||
<el-input :model-value="formData.remoteAddr"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求方式" prop="requestMethod">
|
||||
<el-input :model-value="formData.requestMethod"></el-input>
|
||||
<el-form-item label="请求方式" prop="method">
|
||||
<el-input :model-value="formData.method"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求时间" prop="requestTime">
|
||||
<el-input :model-value="dateFormater('yyyy-MM-dd HH:mm:ss', formData.requestTime)"></el-input>
|
||||
<el-form-item label="请求时间" prop="createTime">
|
||||
<el-input :model-value="dateFormater('yyyy-MM-dd HH:mm:ss', formData.createTime)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作人" prop="operator">
|
||||
<el-input :model-value="formData.operator"></el-input>
|
||||
<el-form-item label="操作人" prop="createBy">
|
||||
<el-input :model-value="formData.createBy"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
@ -57,9 +57,11 @@ defineExpose({
|
|||
formData,
|
||||
resetData,
|
||||
})
|
||||
|
||||
function close() {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function resetData() {
|
||||
formRef.value.resetFields()
|
||||
formData.value = {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<div class="button-part" style="justify-content: space-between;">
|
||||
<el-button icon="Delete" @click="removeData()">删除</el-button>
|
||||
<TableAbility @searchBtn="isSearch = !isSearch" @refreshBtn="init"
|
||||
@downloadBtn="exportData('日志数据', tableData)"></TableAbility>
|
||||
@downloadBtn="exportMultiData('日志数据', tableData)"></TableAbility>
|
||||
</div>
|
||||
<div class="table-part">
|
||||
<el-table ref="tableRef" v-loading="loading" :data="tableData" height="100%" border show-overflow-tooltip
|
||||
|
@ -63,7 +63,7 @@ import {onMounted, ref} from 'vue'
|
|||
import LoginChart from './chart/login-chart.vue'
|
||||
import CommonPagination from '@/components/common-pagination.vue'
|
||||
import LogForm from './form/log-form.vue'
|
||||
import {exportData, tableRemoveRow} from '@/utils/table-util'
|
||||
import {exportData, exportMultiData, tableRemoveRow} from '@/utils/table-util'
|
||||
import {dateFormater} from '@/utils/date-util'
|
||||
import * as logManageApi from '@/api/log-manage'
|
||||
import {ElMessage} from "element-plus";
|
||||
|
@ -127,6 +127,7 @@ const viewData = (e: any) => {
|
|||
formDialogTitle.value = '详情'
|
||||
setTimeout(() => {
|
||||
logFormRef.value.resetData()
|
||||
console.log(e)
|
||||
logFormRef.value.formData = JSON.parse(JSON.stringify(e))
|
||||
}, 0)
|
||||
}
|
||||
|
|
|
@ -18,23 +18,11 @@
|
|||
<el-input v-model="formData.性别" readonly placeholder="请输入" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="科室" prop="科室" :label-width="rightWidth">
|
||||
<el-input v-model="formData.科室" readonly placeholder="请输入" ></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身高" prop="身高">
|
||||
<el-input v-model="formData.身高" readonly placeholder="请输入身高"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="有无病史" prop="有无病史" :label-width="rightWidth">
|
||||
<el-input v-model="formData.有无病史" readonly placeholder="请输入身高"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
|
@ -42,24 +30,13 @@
|
|||
<el-input v-model="formData.体重" readonly placeholder="请输入体重"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="病史名称" prop="病史名称" :label-width="rightWidth">
|
||||
<el-input v-model="formData.病史名称" readonly placeholder="请输入病史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄" prop="年龄">
|
||||
<el-input v-model="formData.年龄" readonly placeholder="请输入年龄"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="过敏史名称" prop="过敏史名称" :label-width="rightWidth">
|
||||
<el-input v-model="formData.过敏史名称" readonly placeholder="请输入过敏史"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="电话" prop="电话">
|
||||
|
@ -67,22 +44,15 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院时间" prop="住院时间" :label-width="rightWidth">
|
||||
<el-form-item label="手术时间" prop="住院时间" :label-width="rightWidth">
|
||||
<el-input v-model="formData.住院时间" readonly placeholder="请输入住院时间"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <div v-if="type === 'add'" style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<el-button class="f18" type="primary" @click="saveData">确认</el-button>
|
||||
</div>-->
|
||||
<!-- <div v-else-if="type === 'edit'" style="text-align: right;">-->
|
||||
</el-form>
|
||||
<div style="text-align: right;">
|
||||
<el-button class="f18" @click="close">取消</el-button>
|
||||
<!-- <el-button class="f18" type="primary" @click="saveData">更新</el-button>-->
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script lang='ts' setup>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<TableAbility :isDownload="tableData && tableData.length > 0" @searchBtn="isSearch = !isSearch"
|
||||
@refreshBtn="queryData(queryParams)"
|
||||
|
||||
@downloadBtn="exportMultiData('电子病史', tableData, 'startTime', 'data')">
|
||||
@downloadBtn="exportMultiData('电子病史', tableData)">
|
||||
</TableAbility>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -481,7 +481,9 @@ const viewPatientInfo = () => {
|
|||
currentRemote.value.date).then(res => {
|
||||
if (res.code == 0) {
|
||||
patientsFormRef.value.resetData()
|
||||
patientsFormRef.value.formData = JSON.parse(JSON.stringify(res.data))
|
||||
const formData = JSON.parse(JSON.stringify(res.data))
|
||||
formData.性别 = formData.性别 == 'M' ? '男' : "女"
|
||||
patientsFormRef.value.formData = formData
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user