New file |
| | |
| | | <template> |
| | | <div class="policy-info"> |
| | | <el-form ref="demoFormRef" :disabled="disabled" :model="fileIdList" class="dialog_form"> |
| | | <el-row :gutter="0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="附件:" label-width="100px" prop="appendix" style="width: 100%"> |
| | | <div style="display: flex;gap: 10px"> |
| | | <file-upload v-model="documentsInfoList" |
| | | :fileType="accept" |
| | | :isShowTip="false"/> |
| | | <div v-if="documentsInfoList.length === 0" style="color: #a9afbc">支持上传PDF格式文件</div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | export default { |
| | | props: { |
| | | disabled: { |
| | | required: true, |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | fileIdList: [], |
| | | documentsInfoList: [], |
| | | accept: ['pdf', 'docx', 'xlsx', 'jpg','jpeg'], |
| | | }; |
| | | }, |
| | | watch: { |
| | | // 监听 documentsInfoList 的变化,并更新 fileIdList |
| | | documentsInfoList(newVal) { |
| | | this.fileIdList = newVal.map(item => item.fileId); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleRemove(file) { |
| | | if (file) { |
| | | this.fileIdList = this.documentsInfoList.map(item => item.fileId); |
| | | localStorage.setItem('fileIdList', JSON.stringify(file)); |
| | | } |
| | | }, |
| | | handleAdd(file) { |
| | | if (file && file.length > 0) { |
| | | localStorage.setItem('fileIdList', JSON.stringify(file)); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .item { |
| | | width: 100%; |
| | | } |
| | | |
| | | .documents-info-items { |
| | | display: inline-block; |
| | | width: 100%; |
| | | height: 130px; |
| | | border: 1px solid #dbdeea; |
| | | background-color: #f3f7fc; |
| | | |
| | | .upload-files-items { |
| | | margin-top: 10px; |
| | | margin-left: 50px; |
| | | } |
| | | } |
| | | |
| | | .input-row { |
| | | display: flex; |
| | | width: 100%; |
| | | |
| | | .input-item { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | |
| | | import InvestmentFunds from '@/views/projectEngineering/projectLibrary/component/investmentFunds'; |
| | | import LegalPerson from '@/views/projectEngineering/projectLibrary/component/legalPerson'; |
| | | import PolicyInfo from '@/views/projectEngineering/projectLibrary/component/PolicyInfo'; |
| | | // import DocumentsInfo from '@/components/DocumentsInfo.vue'; |
| | | import DocumentsInfo from '@/views/projectEngineering/projectLibrary/component/DocumentsInfo'; |
| | | import { addProject, getProject, updateProject, getProjectCode } from '@/api/projectInfo'; |
| | | |
| | | export default { |
| | |
| | | { |
| | | label: '相关文书', |
| | | value: '相关文书', |
| | | componentName: 'DocumentsInfo' |
| | | componentName: DocumentsInfo |
| | | } |
| | | ], |
| | | childRef: null, |
| | | // 假设这些状态是从 Vuex 中获取的,或者你可以直接在 data 中定义它们 |
| | | // projectForm, investment, investmentFunds, legalPerson, resetPlanLibrary, investmentProjectPolicyComplianceDTO, fileIdList, documentsInfoList, projectList, fileList |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // 假设 resetPlanLibrary 是从某个地方引入或定义的,你需要确保它在你的组件中可用 |
| | | // resetPlanLibrary() { ... } |
| | | }, |
| | | created() { |
| | | // 在组件创建时获取项目信息,如果 id 存在 |
| | |
| | | this.getProjectInfo(this.id); |
| | | } else { |
| | | this.getProjectCodeApi(); |
| | | // 初始化或重置状态 |
| | | // this.resetPlanLibrary(); |
| | | } |
| | | }, |
| | | |