|
|
|
@ -4,18 +4,22 @@ |
|
|
|
|
<BasicTable @register="registerTable" :rowSelection="rowSelection"> |
|
|
|
|
<!--插槽:table标题--> |
|
|
|
|
<template #tableTitle> |
|
|
|
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 上传附件</a-button> |
|
|
|
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 上传附件 |
|
|
|
|
</a-button> |
|
|
|
|
</template> |
|
|
|
|
<!--操作栏--> |
|
|
|
|
<template #action="{ record }"> |
|
|
|
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> |
|
|
|
|
<TableAction :actions="getTableAction(record)" |
|
|
|
|
:dropDownActions="getDropDownAction(record)"/> |
|
|
|
|
</template> |
|
|
|
|
<!--字段回显插槽--> |
|
|
|
|
<template v-slot:bodyCell="{ column, record, index, text }"> |
|
|
|
|
<template v-if="column.dataIndex==='fileUrl'"> |
|
|
|
|
<!--文件字段回显插槽--> |
|
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
|
|
|
|
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> |
|
|
|
|
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" |
|
|
|
|
size="small" @click="downloadFile(text)">下载 |
|
|
|
|
</a-button> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</BasicTable> |
|
|
|
@ -23,7 +27,17 @@ |
|
|
|
|
<ProjectFileModal @register="registerModal" @success="handleSuccess"></ProjectFileModal> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<BasicTable title="单位管理员上传附件" @register="depfileTable" /> |
|
|
|
|
<BasicTable title="单位管理员上传附件" @register="depfileTable"> |
|
|
|
|
<template v-slot:bodyCell="{ column, record, index, text }"> |
|
|
|
|
<template v-if="column.dataIndex==='upfile'"> |
|
|
|
|
<!--文件字段回显插槽--> |
|
|
|
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
|
|
|
|
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" |
|
|
|
|
size="small" @click="downloadFile(text)">下载 |
|
|
|
|
</a-button> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</BasicTable> |
|
|
|
|
</div> |
|
|
|
|
<div class="button-container"> |
|
|
|
|
<a-button type="primary" @click="goBack">返回</a-button> |
|
|
|
@ -31,18 +45,25 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" name="projectFile-projectFile" setup> |
|
|
|
|
import {ref, reactive, computed, unref} from 'vue'; |
|
|
|
|
import {BasicTable, useTable, TableAction} from '/@/components/Table'; |
|
|
|
|
import {reactive, ref} from 'vue'; |
|
|
|
|
import {BasicTable, TableAction, useTable} from '/@/components/Table'; |
|
|
|
|
import {useModal} from '/@/components/Modal'; |
|
|
|
|
import { useListPage } from '/@/hooks/system/useListPage' |
|
|
|
|
import {useListPage} from '/@/hooks/system/useListPage' |
|
|
|
|
import ProjectFileModal from '/@/views/projectFile/components/ProjectFileModal.vue' |
|
|
|
|
import {columns, searchFormSchema, superQuerySchema} from '/@/views/projectFile/ProjectFile.data'; |
|
|
|
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from '/@/views/projectFile/ProjectFile.api'; |
|
|
|
|
import { downloadFile } from '/@/utils/common/renderUtils'; |
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
|
import { |
|
|
|
|
batchDelete, |
|
|
|
|
deleteOne, |
|
|
|
|
getExportUrl, |
|
|
|
|
getImportUrl, |
|
|
|
|
list |
|
|
|
|
} from '/@/views/projectFile/ProjectFile.api'; |
|
|
|
|
import {downloadFile} from '/@/utils/common/renderUtils'; |
|
|
|
|
import {useUserStore} from '/@/store/modules/user'; |
|
|
|
|
import {useRoute, useRouter} from "vue-router"; |
|
|
|
|
import {listDepFile} from "@/views/depfile/Depfile.api"; |
|
|
|
|
import {columns2} from "@/views/depfile/Depfile.data"; |
|
|
|
|
|
|
|
|
|
const queryParam = reactive<any>({}); |
|
|
|
|
const checkedKeys = ref<Array<string | number>>([]); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
@ -51,33 +72,31 @@ const route = useRoute(); |
|
|
|
|
//注册model |
|
|
|
|
const [registerModal, {openModal}] = useModal(); |
|
|
|
|
//注册table数据 |
|
|
|
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
|
|
|
|
tableProps:{ |
|
|
|
|
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({ |
|
|
|
|
tableProps: { |
|
|
|
|
title: '项目书附件', |
|
|
|
|
api: listByProjectId, |
|
|
|
|
// api: list, |
|
|
|
|
columns, |
|
|
|
|
canResize:false, |
|
|
|
|
canResize: false, |
|
|
|
|
formConfig: { |
|
|
|
|
//labelWidth: 120, |
|
|
|
|
schemas: searchFormSchema, |
|
|
|
|
autoSubmitOnEnter:true, |
|
|
|
|
showAdvancedButton:true, |
|
|
|
|
fieldMapToNumber: [ |
|
|
|
|
], |
|
|
|
|
fieldMapToTime: [ |
|
|
|
|
], |
|
|
|
|
autoSubmitOnEnter: true, |
|
|
|
|
showAdvancedButton: true, |
|
|
|
|
fieldMapToNumber: [], |
|
|
|
|
fieldMapToTime: [], |
|
|
|
|
}, |
|
|
|
|
actionColumn: { |
|
|
|
|
width: 120, |
|
|
|
|
fixed:'right' |
|
|
|
|
fixed: 'right' |
|
|
|
|
}, |
|
|
|
|
beforeFetch: (params) => { |
|
|
|
|
return Object.assign(params, queryParam); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
exportConfig: { |
|
|
|
|
name:"项目书附件", |
|
|
|
|
name: "项目书附件", |
|
|
|
|
url: getExportUrl, |
|
|
|
|
params: queryParam, |
|
|
|
|
}, |
|
|
|
@ -87,7 +106,7 @@ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext |
|
|
|
|
const [registerTable, {reload}, {rowSelection, selectedRowKeys}] = tableContext |
|
|
|
|
|
|
|
|
|
// 高级查询配置 |
|
|
|
|
const superQueryConfig = reactive(superQuerySchema); |
|
|
|
@ -135,6 +154,7 @@ function handleSuperQuery(params) { |
|
|
|
|
}); |
|
|
|
|
reload(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增事件 |
|
|
|
|
*/ |
|
|
|
@ -144,6 +164,7 @@ function handleAdd() { |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑事件 |
|
|
|
|
*/ |
|
|
|
@ -154,6 +175,7 @@ function handleEdit(record: Recordable) { |
|
|
|
|
showFooter: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 详情 |
|
|
|
|
*/ |
|
|
|
@ -164,28 +186,32 @@ function handleDetail(record: Recordable) { |
|
|
|
|
showFooter: false, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function handleDelete(record) { |
|
|
|
|
await deleteOne({id: record.id}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除事件 |
|
|
|
|
*/ |
|
|
|
|
async function batchHandleDelete() { |
|
|
|
|
await batchDelete({ids: selectedRowKeys.value}, handleSuccess); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 成功回调 |
|
|
|
|
*/ |
|
|
|
|
function handleSuccess() { |
|
|
|
|
(selectedRowKeys.value = []) && reload(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getTableAction(record){ |
|
|
|
|
function getTableAction(record) { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
label: '编辑', |
|
|
|
@ -194,10 +220,11 @@ function getTableAction(record){ |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 下拉操作栏 |
|
|
|
|
*/ |
|
|
|
|
function getDropDownAction(record){ |
|
|
|
|
function getDropDownAction(record) { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
label: '详情', |
|
|
|
@ -218,11 +245,12 @@ function getDropDownAction(record){ |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
|
:deep(.ant-picker), |
|
|
|
|
:deep(.ant-input-number){ |
|
|
|
|
:deep(.ant-picker), |
|
|
|
|
:deep(.ant-input-number) { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
.button-container { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.button-container { |
|
|
|
|
text-align: center; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|