12 changed files with 884 additions and 167 deletions
@ -0,0 +1,137 @@ |
|||||
|
<template> |
||||
|
<!-- 自定义表单 --> |
||||
|
<BasicModal v-bind="$attrs" @register="registerModal" title="月度期刊详情" width="1200px" :showOkBtn="false" :showCancelBtn="false"> |
||||
|
|
||||
|
<el-divider content-position="left">资料信息</el-divider> |
||||
|
<BasicForm @register="registerProjectForm" /> |
||||
|
<el-divider content-position="left">上传期刊资料</el-divider> |
||||
|
<el-form ref="importFormRef" > |
||||
|
|
||||
|
<el-form-item label="上传文件:"> |
||||
|
<el-upload class="upload-demo" ref="upload" action :http-request="httpRequest" :before-upload="beforeUpload" |
||||
|
:on-exceed="handleExceed" :limit="1" :on-remove="removeFile"> |
||||
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click="submitImportForm">上传</el-button> |
||||
|
<el-button type="info" @click="dialogVisible">关闭窗口</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</BasicModal> |
||||
|
</template> |
||||
|
<script lang="ts" name="addAndModify" setup> |
||||
|
import { ref, reactive, defineProps, watchEffect } from 'vue' |
||||
|
import { useForm, BasicForm } from '@/components/Form'; |
||||
|
import { iconicformSchemas } from './iconic.data'; |
||||
|
import { modifyPeriodicallab, addPeriodicallab, getperiodicallabById } from './iconic.api'; |
||||
|
import { ElMessage } from 'element-plus' |
||||
|
import { useModalInner, BasicModal } from '@/components/Modal'; |
||||
|
const [registerModal, { closeModal }] = useModalInner(init); |
||||
|
|
||||
|
|
||||
|
let fileList = reactive<Array<any>>([]); |
||||
|
let id = ref() |
||||
|
const emit = defineEmits(['close']); |
||||
|
|
||||
|
async function init(data) { |
||||
|
fileList.pop() |
||||
|
if (data.id != null) { |
||||
|
id.value = data.id |
||||
|
let param: any = { |
||||
|
id: data.id |
||||
|
} |
||||
|
let res = await getperiodicallabById(param) |
||||
|
console.log("结果是", res) |
||||
|
setFieldsValue(res) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//项目入库详情 |
||||
|
const [registerProjectForm, { setFieldsValue: setFieldsValue, getFieldsValue, validate }] = useForm({ |
||||
|
//注册表单列 |
||||
|
schemas: iconicformSchemas, |
||||
|
showActionButtonGroup: false, |
||||
|
//回车提交 |
||||
|
// autoSubmitOnEnter: true, |
||||
|
// //不显示重置按钮 |
||||
|
// showResetButton: false, |
||||
|
//自定义提交按钮文本和图标 |
||||
|
// submitButtonOptions: { text: '提交', preIcon: '' }, |
||||
|
//查询列占比 24代表一行 取值范围 0-24 |
||||
|
// actionColOptions: { span: 17 }, |
||||
|
labelCol: { style: { width: '120px' } }, |
||||
|
wrapperCol: { style: { width: 'auto' } }, |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
// 覆盖默认的上传行为,可以自定义上传的实现,将上传的文件依次添加到fileList数组中,支持多个文件 |
||||
|
function httpRequest(option) { |
||||
|
fileList.push(option) |
||||
|
} |
||||
|
function removeFile(option) { |
||||
|
for (let i = 0; i < fileList.length; i++) { |
||||
|
if (fileList[i].file.name == option.name) { |
||||
|
fileList.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
console.log(fileList, option) |
||||
|
|
||||
|
} |
||||
|
// 上传前处理 |
||||
|
function beforeUpload(file) { |
||||
|
let fileSize = file.size |
||||
|
const FIVE_M = 500 * 1024 * 1024; |
||||
|
//大于5M,不允许上传 |
||||
|
if (fileSize > FIVE_M) { |
||||
|
ElMessage.error("最大上传500M") |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
return true |
||||
|
} |
||||
|
// 文件数量过多时提醒 |
||||
|
function handleExceed() { |
||||
|
ElMessage.warning("最多只能上传一个文件") |
||||
|
} |
||||
|
//导入Excel病种信息数据 |
||||
|
async function submitImportForm() { |
||||
|
if (await validate()) { |
||||
|
|
||||
|
let data = await getFieldsValue() |
||||
|
console.log("data", data) |
||||
|
// 使用form表单的数据格式 |
||||
|
const params = new FormData() |
||||
|
if (id.value != null) { |
||||
|
//说明是修改 |
||||
|
if(fileList.length>0){ |
||||
|
params.append('file', fileList[0].file) |
||||
|
} |
||||
|
params.append("id", id.value) |
||||
|
params.append("name", data.name) |
||||
|
params.append("periods", data.periods) |
||||
|
params.append("publishTime", data.publishTime) |
||||
|
await modifyPeriodicallab(params) |
||||
|
} else { |
||||
|
if (fileList.length == 0) { |
||||
|
ElMessage.warning("请上传文件") |
||||
|
return; |
||||
|
} |
||||
|
params.append('file', fileList[0].file) |
||||
|
params.append("name", data.name) |
||||
|
params.append("periods", data.periods) |
||||
|
params.append("publishTime", data.publishTime) |
||||
|
await addPeriodicallab(params) |
||||
|
} |
||||
|
dialogVisible() |
||||
|
} |
||||
|
} |
||||
|
function dialogVisible() { |
||||
|
closeModal() |
||||
|
emit("close") |
||||
|
} |
||||
|
</script> |
||||
|
<style></style> |
@ -0,0 +1,23 @@ |
|||||
|
import { defHttp } from '@/utils/http/axios'; |
||||
|
import { downloadFile } from "../../../api/common/api" |
||||
|
|
||||
|
export enum Api { |
||||
|
periodicallabPageList = '/huzhouPeriodicallab/periodicallabPageList', |
||||
|
addPeriodicallab="/huzhouPeriodicallab/addPeriodicallab", |
||||
|
modifyPeriodicallab = '/huzhouPeriodicallab/modifyPeriodicallab', |
||||
|
getperiodicallabById="/huzhouPeriodicallab/getperiodicallabById", |
||||
|
deletePeriodicallab = '/huzhouPeriodicallab/deletePeriodicallab', |
||||
|
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles", |
||||
|
} |
||||
|
|
||||
|
export const periodicallabPageList = (params) => defHttp.get({ url: Api.periodicallabPageList, params }) |
||||
|
export const getperiodicallabById = (params) => defHttp.get({ url: Api.getperiodicallabById, params }) |
||||
|
export const batchdownloadPeriodicallabFiles = (params) => downloadFile(Api.batchdownloadPeriodicallabFiles,"批量导出.zip",params) |
||||
|
export const addPeriodicallab = (params?) =>defHttp.post({ url: Api.addPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params }) |
||||
|
|
||||
|
export const modifyPeriodicallab = (params?) =>defHttp.post({ url: Api.modifyPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params }) |
||||
|
|
||||
|
export const deletePeriodicallab = (params?) =>defHttp.post({ url: Api.deletePeriodicallab, params }) |
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,68 @@ |
|||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
|
||||
|
|
||||
|
export const iconiccolumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '文件名称', |
||||
|
width: 250, |
||||
|
dataIndex: 'name', |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
title: '文件类别', |
||||
|
width: 150, |
||||
|
dataIndex: 'periods', |
||||
|
}, |
||||
|
{ |
||||
|
title: '发布日期', |
||||
|
width: 200, |
||||
|
dataIndex: 'publishTime', |
||||
|
}, |
||||
|
]; |
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '文件类别', |
||||
|
field: 'periods', |
||||
|
component: 'Input', |
||||
|
colProps: { span: 5 }, |
||||
|
}, |
||||
|
{ |
||||
|
label: '发布日期', |
||||
|
field: 'publishTime', |
||||
|
component: 'Input', |
||||
|
colProps: { span: 5 }, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
]; |
||||
|
export const iconicformSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '文件名称', |
||||
|
field: 'name', |
||||
|
component: 'Input', |
||||
|
required: true, |
||||
|
colProps: { span: 12 }, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '文件类别', |
||||
|
field: 'periods', |
||||
|
required: true, |
||||
|
component: 'Input', |
||||
|
colProps: { span: 6 }, |
||||
|
|
||||
|
}, { |
||||
|
label: '发布日期', |
||||
|
field: 'publishTime', |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
valueFormat: 'YYYY-MM-DD', |
||||
|
|
||||
|
}, |
||||
|
required: true, |
||||
|
colProps: { span: 6}, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
]; |
@ -0,0 +1,115 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!--引用表格--> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #action="{ record }"> |
||||
|
<!-- <TableAction :actions="getTableAction(record)" /> --> |
||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> |
||||
|
</template> |
||||
|
<template #tableTitle> |
||||
|
<el-button type="primary" round @click="handleAdd" v-if="isShowByRoles('manageOrg')">新增信息材料</el-button> |
||||
|
<el-button type="primary" round @click="handleBatchdownload"> 批量导出</el-button> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
<addAndModify @register="registerSubmitProjectArchive" @close="closeModel" /> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" name="system-user" setup> |
||||
|
//ts语法 |
||||
|
import { ref } from 'vue'; |
||||
|
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table'; |
||||
|
import { useModal } from '@/components/Modal'; |
||||
|
import { downloadResource } from "../../../api/common/api" |
||||
|
import { isShowByRoles } from '@/views/projectLib/projectInfo/projectInfo.api'; |
||||
|
|
||||
|
import { iconiccolumns, searchFormSchema } from './iconic.data'; |
||||
|
import addAndModify from "./addAndModify.vue" |
||||
|
import { periodicallabPageList, batchdownloadPeriodicallabFiles, deletePeriodicallab } from './iconic.api'; |
||||
|
import { fi } from 'element-plus/es/locale'; |
||||
|
const [registerSubmitProjectArchive, { openModal }] = useModal(); |
||||
|
const [registerTable, { reload, getForm }] = useTable({ |
||||
|
title: '月度期刊信息', |
||||
|
api: periodicallabPageList, |
||||
|
columns: iconiccolumns, |
||||
|
useSearchForm: true, |
||||
|
actionColumn: { |
||||
|
width: 140, |
||||
|
title: '操作', |
||||
|
dataIndex: 'action', |
||||
|
slots: { customRender: 'action' }, |
||||
|
}, |
||||
|
//表单查询项设置 |
||||
|
formConfig: { |
||||
|
schemas: searchFormSchema, |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function getTableAction(record): ActionItem[] { |
||||
|
return [ |
||||
|
{ |
||||
|
label: '下载', |
||||
|
onClick: handledown.bind(null, record), |
||||
|
} |
||||
|
|
||||
|
]; |
||||
|
} |
||||
|
function getDropDownAction(record): ActionItem[] { |
||||
|
return [ |
||||
|
{ |
||||
|
label: '修改', |
||||
|
ifShow: () => { |
||||
|
return isShowByRoles('manageOrg') |
||||
|
}, |
||||
|
onClick: handleModify.bind(null, record) |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
ifShow: () => { |
||||
|
return isShowByRoles('manageOrg') |
||||
|
}, |
||||
|
popConfirm: { |
||||
|
title: '确定删除吗?', |
||||
|
confirm: handleDelete.bind(null, record), |
||||
|
}, |
||||
|
} |
||||
|
|
||||
|
]; |
||||
|
} |
||||
|
function handleAdd() { |
||||
|
openModal(true, { id: null }) |
||||
|
} |
||||
|
function handleModify(record) { |
||||
|
openModal(true, { id: record.id }) |
||||
|
|
||||
|
} |
||||
|
function handleSubmit(record) { |
||||
|
|
||||
|
|
||||
|
} |
||||
|
function handledown(record) { |
||||
|
let param = { |
||||
|
path: record.documentPath, |
||||
|
fileName: record.documentName |
||||
|
} |
||||
|
downloadResource("/huzhouUploadfileinfo/downloadfile", record.documentName, param) |
||||
|
|
||||
|
} |
||||
|
async function handleDelete(record) { |
||||
|
await deletePeriodicallab({ id: record.id }) |
||||
|
reload() |
||||
|
} |
||||
|
function handleBatchdownload() { |
||||
|
let { getFieldsValue } = getForm() |
||||
|
let fromData = getFieldsValue() |
||||
|
batchdownloadPeriodicallabFiles(fromData) |
||||
|
} |
||||
|
function closeModel() { |
||||
|
reload() |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,137 @@ |
|||||
|
<template> |
||||
|
<!-- 自定义表单 --> |
||||
|
<BasicModal v-bind="$attrs" @register="registerModal" title="月度期刊详情" width="1200px" :showOkBtn="false" :showCancelBtn="false"> |
||||
|
|
||||
|
<el-divider content-position="left">资料信息</el-divider> |
||||
|
<BasicForm @register="registerProjectForm" /> |
||||
|
<el-divider content-position="left">上传期刊资料</el-divider> |
||||
|
<el-form ref="importFormRef" > |
||||
|
|
||||
|
<el-form-item label="上传文件:"> |
||||
|
<el-upload class="upload-demo" ref="upload" action :http-request="httpRequest" :before-upload="beforeUpload" |
||||
|
:on-exceed="handleExceed" :limit="1" :on-remove="removeFile"> |
||||
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> |
||||
|
<div slot="tip" class="el-upload__tip">文件大小且不超过500M</div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" @click="submitImportForm">上传</el-button> |
||||
|
<el-button type="info" @click="dialogVisible">关闭窗口</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
</BasicModal> |
||||
|
</template> |
||||
|
<script lang="ts" name="addAndModify" setup> |
||||
|
import { ref, reactive, defineProps, watchEffect } from 'vue' |
||||
|
import { useForm, BasicForm } from '@/components/Form'; |
||||
|
import { mechanismformSchemas } from './mechanism.data'; |
||||
|
import { modifyPeriodicallab, addPeriodicallab, getperiodicallabById } from './mechanism.api'; |
||||
|
import { ElMessage } from 'element-plus' |
||||
|
import { useModalInner, BasicModal } from '@/components/Modal'; |
||||
|
const [registerModal, { closeModal }] = useModalInner(init); |
||||
|
|
||||
|
|
||||
|
let fileList = reactive<Array<any>>([]); |
||||
|
let id = ref() |
||||
|
const emit = defineEmits(['close']); |
||||
|
|
||||
|
async function init(data) { |
||||
|
fileList.pop() |
||||
|
if (data.id != null) { |
||||
|
id.value = data.id |
||||
|
let param: any = { |
||||
|
id: data.id |
||||
|
} |
||||
|
let res = await getperiodicallabById(param) |
||||
|
console.log("结果是", res) |
||||
|
setFieldsValue(res) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//项目入库详情 |
||||
|
const [registerProjectForm, { setFieldsValue: setFieldsValue, getFieldsValue, validate }] = useForm({ |
||||
|
//注册表单列 |
||||
|
schemas: mechanismformSchemas, |
||||
|
showActionButtonGroup: false, |
||||
|
//回车提交 |
||||
|
// autoSubmitOnEnter: true, |
||||
|
// //不显示重置按钮 |
||||
|
// showResetButton: false, |
||||
|
//自定义提交按钮文本和图标 |
||||
|
// submitButtonOptions: { text: '提交', preIcon: '' }, |
||||
|
//查询列占比 24代表一行 取值范围 0-24 |
||||
|
// actionColOptions: { span: 17 }, |
||||
|
labelCol: { style: { width: '120px' } }, |
||||
|
wrapperCol: { style: { width: 'auto' } }, |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
// 覆盖默认的上传行为,可以自定义上传的实现,将上传的文件依次添加到fileList数组中,支持多个文件 |
||||
|
function httpRequest(option) { |
||||
|
fileList.push(option) |
||||
|
} |
||||
|
function removeFile(option) { |
||||
|
for (let i = 0; i < fileList.length; i++) { |
||||
|
if (fileList[i].file.name == option.name) { |
||||
|
fileList.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
console.log(fileList, option) |
||||
|
|
||||
|
} |
||||
|
// 上传前处理 |
||||
|
function beforeUpload(file) { |
||||
|
let fileSize = file.size |
||||
|
const FIVE_M = 500 * 1024 * 1024; |
||||
|
//大于5M,不允许上传 |
||||
|
if (fileSize > FIVE_M) { |
||||
|
ElMessage.error("最大上传500M") |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
return true |
||||
|
} |
||||
|
// 文件数量过多时提醒 |
||||
|
function handleExceed() { |
||||
|
ElMessage.warning("最多只能上传一个文件") |
||||
|
} |
||||
|
//导入Excel病种信息数据 |
||||
|
async function submitImportForm() { |
||||
|
if (await validate()) { |
||||
|
|
||||
|
let data = await getFieldsValue() |
||||
|
console.log("data", data) |
||||
|
// 使用form表单的数据格式 |
||||
|
const params = new FormData() |
||||
|
if (id.value != null) { |
||||
|
//说明是修改 |
||||
|
if(fileList.length>0){ |
||||
|
params.append('file', fileList[0].file) |
||||
|
} |
||||
|
params.append("id", id.value) |
||||
|
params.append("name", data.name) |
||||
|
params.append("periods", data.periods) |
||||
|
params.append("publishTime", data.publishTime) |
||||
|
await modifyPeriodicallab(params) |
||||
|
} else { |
||||
|
if (fileList.length == 0) { |
||||
|
ElMessage.warning("请上传文件") |
||||
|
return; |
||||
|
} |
||||
|
params.append('file', fileList[0].file) |
||||
|
params.append("name", data.name) |
||||
|
params.append("periods", data.periods) |
||||
|
params.append("publishTime", data.publishTime) |
||||
|
await addPeriodicallab(params) |
||||
|
} |
||||
|
dialogVisible() |
||||
|
} |
||||
|
} |
||||
|
function dialogVisible() { |
||||
|
closeModal() |
||||
|
emit("close") |
||||
|
} |
||||
|
</script> |
||||
|
<style></style> |
@ -0,0 +1,115 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<!--引用表格--> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #action="{ record }"> |
||||
|
<!-- <TableAction :actions="getTableAction(record)" /> --> |
||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> |
||||
|
</template> |
||||
|
<template #tableTitle> |
||||
|
<el-button type="primary" round @click="handleAdd" v-if="isShowByRoles('manageOrg')">新增信息材料</el-button> |
||||
|
<el-button type="primary" round @click="handleBatchdownload"> 批量导出</el-button> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
<addAndModify @register="registerSubmitProjectArchive" @close="closeModel" /> |
||||
|
|
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" name="system-user" setup> |
||||
|
//ts语法 |
||||
|
import { ref } from 'vue'; |
||||
|
import { ActionItem, BasicTable, TableAction, useTable } from '@/components/Table'; |
||||
|
import { useModal } from '@/components/Modal'; |
||||
|
import { downloadResource } from "../../../api/common/api" |
||||
|
import { isShowByRoles } from '@/views/projectLib/projectInfo/projectInfo.api'; |
||||
|
|
||||
|
import { mechanismcolumns, searchFormSchema } from './mechanism.data'; |
||||
|
import addAndModify from "./addAndModify.vue" |
||||
|
import { periodicallabPageList, batchdownloadPeriodicallabFiles, deletePeriodicallab } from './mechanism.api'; |
||||
|
import { fi } from 'element-plus/es/locale'; |
||||
|
const [registerSubmitProjectArchive, { openModal }] = useModal(); |
||||
|
const [registerTable, { reload, getForm }] = useTable({ |
||||
|
title: '月度期刊信息', |
||||
|
api: periodicallabPageList, |
||||
|
columns: mechanismcolumns, |
||||
|
useSearchForm: true, |
||||
|
actionColumn: { |
||||
|
width: 140, |
||||
|
title: '操作', |
||||
|
dataIndex: 'action', |
||||
|
slots: { customRender: 'action' }, |
||||
|
}, |
||||
|
//表单查询项设置 |
||||
|
formConfig: { |
||||
|
schemas: searchFormSchema, |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function getTableAction(record): ActionItem[] { |
||||
|
return [ |
||||
|
{ |
||||
|
label: '下载', |
||||
|
onClick: handledown.bind(null, record), |
||||
|
} |
||||
|
|
||||
|
]; |
||||
|
} |
||||
|
function getDropDownAction(record): ActionItem[] { |
||||
|
return [ |
||||
|
{ |
||||
|
label: '修改', |
||||
|
ifShow: () => { |
||||
|
return isShowByRoles('manageOrg') |
||||
|
}, |
||||
|
onClick: handleModify.bind(null, record) |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
ifShow: () => { |
||||
|
return isShowByRoles('manageOrg') |
||||
|
}, |
||||
|
popConfirm: { |
||||
|
title: '确定删除吗?', |
||||
|
confirm: handleDelete.bind(null, record), |
||||
|
}, |
||||
|
} |
||||
|
|
||||
|
]; |
||||
|
} |
||||
|
function handleAdd() { |
||||
|
openModal(true, { id: null }) |
||||
|
} |
||||
|
function handleModify(record) { |
||||
|
openModal(true, { id: record.id }) |
||||
|
|
||||
|
} |
||||
|
function handleSubmit(record) { |
||||
|
|
||||
|
|
||||
|
} |
||||
|
function handledown(record) { |
||||
|
let param = { |
||||
|
path: record.documentPath, |
||||
|
fileName: record.documentName |
||||
|
} |
||||
|
downloadResource("/huzhouUploadfileinfo/downloadfile", record.documentName, param) |
||||
|
|
||||
|
} |
||||
|
async function handleDelete(record) { |
||||
|
await deletePeriodicallab({ id: record.id }) |
||||
|
reload() |
||||
|
} |
||||
|
function handleBatchdownload() { |
||||
|
let { getFieldsValue } = getForm() |
||||
|
let fromData = getFieldsValue() |
||||
|
batchdownloadPeriodicallabFiles(fromData) |
||||
|
} |
||||
|
function closeModel() { |
||||
|
reload() |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,23 @@ |
|||||
|
import { defHttp } from '@/utils/http/axios'; |
||||
|
import { downloadFile } from "../../../api/common/api" |
||||
|
|
||||
|
export enum Api { |
||||
|
periodicallabPageList = '/huzhouPeriodicallab/periodicallabPageList', |
||||
|
addPeriodicallab="/huzhouPeriodicallab/addPeriodicallab", |
||||
|
modifyPeriodicallab = '/huzhouPeriodicallab/modifyPeriodicallab', |
||||
|
getperiodicallabById="/huzhouPeriodicallab/getperiodicallabById", |
||||
|
deletePeriodicallab = '/huzhouPeriodicallab/deletePeriodicallab', |
||||
|
batchdownloadPeriodicallabFiles="/huzhouPeriodicallab/batchdownloadPeriodicallabFiles", |
||||
|
} |
||||
|
|
||||
|
export const periodicallabPageList = (params) => defHttp.get({ url: Api.periodicallabPageList, params }) |
||||
|
export const getperiodicallabById = (params) => defHttp.get({ url: Api.getperiodicallabById, params }) |
||||
|
export const batchdownloadPeriodicallabFiles = (params) => downloadFile(Api.batchdownloadPeriodicallabFiles,"批量导出.zip",params) |
||||
|
export const addPeriodicallab = (params?) =>defHttp.post({ url: Api.addPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params }) |
||||
|
|
||||
|
export const modifyPeriodicallab = (params?) =>defHttp.post({ url: Api.modifyPeriodicallab,headers:{ "Content-Type": "multipart/form-data" }, params }) |
||||
|
|
||||
|
export const deletePeriodicallab = (params?) =>defHttp.post({ url: Api.deletePeriodicallab, params }) |
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,68 @@ |
|||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
|
||||
|
|
||||
|
export const mechanismcolumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '文件名称', |
||||
|
width: 250, |
||||
|
dataIndex: 'name', |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
title: '文件类别', |
||||
|
width: 150, |
||||
|
dataIndex: 'periods', |
||||
|
}, |
||||
|
{ |
||||
|
title: '发布日期', |
||||
|
width: 200, |
||||
|
dataIndex: 'publishTime', |
||||
|
}, |
||||
|
]; |
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '文件类别', |
||||
|
field: 'periods', |
||||
|
component: 'Input', |
||||
|
colProps: { span: 5 }, |
||||
|
}, |
||||
|
{ |
||||
|
label: '发布日期', |
||||
|
field: 'publishTime', |
||||
|
component: 'Input', |
||||
|
colProps: { span: 5 }, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
]; |
||||
|
export const mechanismformSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '文件名称', |
||||
|
field: 'name', |
||||
|
component: 'Input', |
||||
|
required: true, |
||||
|
colProps: { span: 12 }, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '文件类别', |
||||
|
field: 'periods', |
||||
|
required: true, |
||||
|
component: 'Input', |
||||
|
colProps: { span: 6 }, |
||||
|
|
||||
|
}, { |
||||
|
label: '发布日期', |
||||
|
field: 'publishTime', |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
valueFormat: 'YYYY-MM-DD', |
||||
|
|
||||
|
}, |
||||
|
required: true, |
||||
|
colProps: { span: 6}, |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
]; |
Loading…
Reference in new issue