| | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <div class="pag-container"> |
| | | <el-pagination |
| | | v-model:current-page="data.queryParams.pageNum" |
| | | v-model:page-size="data.queryParams.pageSize" |
| | | :page-sizes="[10,15,20,25]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <!-- <div style="display: flex;align-items: center;justify-content: right;margin-top: 10px">--> |
| | | <!-- <el-button v-if="state.form.id && data.isAdmin" type="danger" @click="deleteData">删除</el-button>--> |
| | | <!-- <el-button v-if="data.isAdmin" type="primary" @click="addData()">保存</el-button>--> |
| | |
| | | type: 3, |
| | | companyId: null, |
| | | itemId: null, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }, |
| | | companyList: [], |
| | | projectList: [], |
| | |
| | | companyId: state.form.companyId, |
| | | catalogueId: state.form.catalogueId, |
| | | type: 2, |
| | | itemId: data.queryParams.itemId |
| | | itemId: data.queryParams.itemId, |
| | | pageSize: data.queryParams.pageSize, |
| | | pageNum: data.queryParams.pageNum |
| | | } |
| | | const res = await getProductFilePage(queryParams) |
| | | if (res.code == 200) { |
| | |
| | | fileNameSimple: item.fileName.split('.')[0] |
| | | } |
| | | }) |
| | | total.value = res.data.total |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const handleSizeChange = (val) => { |
| | | data.queryParams.pageSize = val |
| | | getFileList() |
| | | } |
| | | const handleCurrentChange = (val) => { |
| | | data.queryParams.pageNum = val |
| | | getFileList() |
| | | } |
| | | const openFile = async(path)=>{ |
| | | const ext = path.split('.').pop().toLowerCase(); |
| | |
| | | console.log('取消预览') |
| | | }); |
| | | return |
| | | } |
| | | }else if(ext === 'pdf' || ext === 'png' || ext === 'jpg'|| ext === 'jpeg'){ |
| | | window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank'); |
| | | }else { |
| | | try { |
| | | // 1. 获取文件 |
| | | const response = await fetch(import.meta.env.VITE_APP_BASE_API + '/' + path); |
| | |
| | | console.error('预览失败:', error); |
| | | alert(`预览失败: ${error.message}`); |
| | | } |
| | | } |
| | | |
| | | } |
| | | const downloadFile = (e)=>{ |
| | | axios.get(import.meta.env.VITE_APP_BASE_API + '/' +e.filePath,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`},responseType: 'blob'}).then(res=>{ |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .app-container{ |
| | | .pag-container{ |
| | | float: right; |
| | | margin-top: 10px; |
| | | } |
| | | .bottom{ |
| | | display: flex; |
| | | width: auto; |