|
|
|
@ -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 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 { |
|
|
|
|
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(); |
|
|
|
@ -63,10 +84,8 @@ const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ |
|
|
|
|
schemas: searchFormSchema, |
|
|
|
|
autoSubmitOnEnter: true, |
|
|
|
|
showAdvancedButton: true, |
|
|
|
|
fieldMapToNumber: [ |
|
|
|
|
], |
|
|
|
|
fieldMapToTime: [ |
|
|
|
|
], |
|
|
|
|
fieldMapToNumber: [], |
|
|
|
|
fieldMapToTime: [], |
|
|
|
|
}, |
|
|
|
|
actionColumn: { |
|
|
|
|
width: 120, |
|
|
|
@ -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,24 +186,28 @@ 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(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 操作栏 |
|
|
|
|
*/ |
|
|
|
@ -194,6 +220,7 @@ function getTableAction(record){ |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 下拉操作栏 |
|
|
|
|
*/ |
|
|
|
@ -222,6 +249,7 @@ function getDropDownAction(record){ |
|
|
|
|
:deep(.ant-input-number) { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.button-container { |
|
|
|
|
text-align: center; |
|
|
|
|
} |
|
|
|
|