| | |
| | | console.log(2, activatedElement) |
| | | this.modelerStore.element = activatedElement; |
| | | this.elementId = activatedElement.id; |
| | | // 确保elementId值没变也要更新form组件选中的值 |
| | | if (this.formVisible) { |
| | | console.log(this.modelerStore.element.businessObject.formKey, "新的值") |
| | | this.$refs.formSelect.init() |
New file |
| | |
| | | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | :visible.sync="fileDialogVisible" |
| | | ref="formDialogRef" |
| | | width="35%" |
| | | append-to-body |
| | | close-on-click-modal |
| | | @close="closeDialog" |
| | | > |
| | | <template slot="title"> |
| | | <span style="padding-bottom: 18px"> |
| | | {{ isImportOrExport ? '请按照需求导出目标内容' : '请按照模板样式上传项目文件' }} |
| | | </span> |
| | | </template> |
| | | <template slot="default"> |
| | | <div v-if="!isImportOrExport" class="dialog-content"> |
| | | <el-upload |
| | | ref="uploadRef" |
| | | class="upload-demo" |
| | | :action="uploadUrl" |
| | | :limit="1" |
| | | :accept="accept" |
| | | :headers=" uploadHeaders" |
| | | :disabled="uploadIsUploading" |
| | | :on-progress="handleFileUploadProgress" |
| | | :on-success="handleFileSuccess" |
| | | :auto-upload="false" |
| | | drag |
| | | > |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">请上传<em>Zip</em>文件,大小在<em>100M</em>以内</div> |
| | | </el-upload> |
| | | <span>仅允许导入zip格式文件。</span> |
| | | <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="handleDownloadFile">下载模板</el-link> |
| | | </div> |
| | | <div v-else-if="isImportOrExport" class="dialog-content"> |
| | | <el-button class="export-button" @click="handleDownloadTargetList">导出目标列表内容</el-button> |
| | | <el-button class="export-button">导出所有列表内容</el-button> |
| | | <el-button class="export-button">导出目标项目详情</el-button> |
| | | <el-button class="export-button">导出所有项目详情</el-button> |
| | | </div> |
| | | </template> |
| | | <template slot="footer"> |
| | | <div v-if="!isImportOrExport" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitFileForm">确 定</el-button> |
| | | <el-button @click="closeDialog">取 消</el-button> |
| | | </div> |
| | | <div v-else-if="isImportOrExport"></div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { globalHeaders } from '@/utils/request'; |
| | | |
| | | export default { |
| | | name: 'FileDialog', |
| | | props: { |
| | | isImportOrExport: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | fileDialogVisible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | currentColumns: { |
| | | type: Array, |
| | | default: function () { |
| | | return []; |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadRef: null, |
| | | targetColumn: [], |
| | | accept: `.zip`, |
| | | uploadUrl: '/project/import', |
| | | uploadHeaders: globalHeaders(), |
| | | uploadIsUploading: false |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleFileUploadProgress() { |
| | | this.uploadIsUploading = true; |
| | | }, |
| | | handleFileSuccess(response, file) { |
| | | this.uploadIsUploading = false; |
| | | if (this.uploadRef) { |
| | | this.uploadRef.handleRemove(file); |
| | | } |
| | | if (response.code === 200) { |
| | | this.$emit('fileDialogCancel'); |
| | | this.$message({ |
| | | message: response.msg, |
| | | type: 'success' |
| | | }); |
| | | } else { |
| | | this.$message.error(response.msg); |
| | | } |
| | | }, |
| | | handleDownloadFile() { |
| | | const self = this; |
| | | // fetch(`${process.env.VITE_APP_BASE_API}/project/export/template`, { |
| | | // method: 'GET', |
| | | // headers: self.upload.headers |
| | | // }) |
| | | // .then(response => response.blob()) |
| | | // .then(blob => { |
| | | // const url = window.URL.createObjectURL(blob); |
| | | // const a = document.createElement('a'); |
| | | // a.style.display = 'none'; |
| | | // a.href = url; |
| | | // a.download = `项目文件模板_${new Date().getTime()}.zip`; |
| | | // document.body.appendChild(a); |
| | | // a.click(); |
| | | // window.URL.revokeObjectURL(url); |
| | | // }) |
| | | // .catch(error => { |
| | | // console.error('文件下载失败:', error); |
| | | // }); |
| | | }, |
| | | submitFileForm() { |
| | | if (this.uploadRef) { |
| | | this.uploadRef.submit(); |
| | | } |
| | | }, |
| | | closeDialog() { |
| | | this.$emit('fileDialogCancel'); |
| | | }, |
| | | handleDownloadTargetList() { |
| | | console.log('导出目标列表内容', this.currentColumns); |
| | | this.targetColumn = this.currentColumns.filter(item => item.visible); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.uploadRef = this.$refs.uploadRef; |
| | | }, |
| | | created() { |
| | | |
| | | this.isFileDialogVisible = this.fileDialogVisible; |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .dialog-content { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | flex-direction: column; |
| | | height: 300px; |
| | | |
| | | .export-button { |
| | | margin-left: 0; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | .dialog-footer { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | .upload-demo { |
| | | width: 100%; |
| | | } |
| | | ::v-deep .el-upload{ |
| | | width: 100%; |
| | | } |
| | | ::v-deep .el-upload .el-upload-dragger{ |
| | | width: 100%; |
| | | } |
| | | </style> |
| | |
| | | :show-overflow-tooltip="true"> |
| | | <el-table-column type="selection" width="55" align="center"/> |
| | | <!-- 动态列 --> |
| | | <el-table-column |
| | | v-for="item in columns" |
| | | :key="item.id" |
| | | v-if="item.visible" |
| | | :prop="item.id" |
| | | :label="item.label" |
| | | :min-width="item.minWidth" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <!-- 使用具名插槽 --> |
| | | <template v-if="item.slotName"> |
| | | <!-- projectStatus插槽 --> |
| | | <template v-if="item.slotName === 'projectStatus'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- projectColorCode插槽 --> |
| | | <template v-if="item.slotName === 'projectColorCode'"> |
| | | <el-text class="mx-1 has-dot">{{ '自定义样式' }}<span class="dot" style="margin-left: 5px"></span></el-text> |
| | | </template> |
| | | <!-- projectType插槽 --> |
| | | <template v-if="item.slotName === 'projectType'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- investType插槽 --> |
| | | <template v-if="item.slotName === 'investType'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- planStartTime插槽 --> |
| | | <template v-if="item.slotName === 'planStartTime'"> |
| | | {{ '自定义样式' }} |
| | | </template> |
| | | <el-table-column |
| | | v-for="item in columns" |
| | | :key="item.id" |
| | | v-if="item.visible" |
| | | :prop="item.id" |
| | | :label="item.label" |
| | | :min-width="item.minWidth" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <!-- 使用具名插槽 --> |
| | | <template v-if="item.slotName"> |
| | | <!-- projectStatus插槽 --> |
| | | <template v-if="item.slotName === 'projectStatus'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- 默认显示 --> |
| | | <span v-else>{{ scope.row[item.id] }}</span> |
| | | <!-- projectColorCode插槽 --> |
| | | <template v-if="item.slotName === 'projectColorCode'"> |
| | | <el-text class="mx-1 has-dot">{{ '自定义样式' }}<span class="dot" style="margin-left: 5px"></span></el-text> |
| | | </template> |
| | | <!-- projectType插槽 --> |
| | | <template v-if="item.slotName === 'projectType'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- investType插槽 --> |
| | | <template v-if="item.slotName === 'investType'"> |
| | | <el-text class="mx-1">{{ '自定义样式' }}</el-text> |
| | | </template> |
| | | <!-- planStartTime插槽 --> |
| | | <template v-if="item.slotName === 'planStartTime'"> |
| | | {{ '自定义样式' }} |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- 默认显示 --> |
| | | <span v-else>{{ scope.row[item.id] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <!-- 操作列 --> |
| | | <el-table-column label="操作" width="140" align="center" > |
New file |
| | |
| | | export const current = [ |
| | | {id: 'projectName', label: '项目名称', visible: true}, |
| | | {id: 'projectOwnerUnit', label: '业主单位', visible: true}, |
| | | {id: 'projectColorCode', label: '项目码', slotName: 'projectColorCode', visible: true}, |
| | | {id: 'projectCode', label: '项目代码', visible: true}, |
| | | {id: 'projectType', label: '项目类型', slotName: 'projectType', visible: true}, |
| | | {id: 'projectPhase', label: '项目阶段', visible: true}, |
| | | {id: 'totalInvestment', label: '总投资额', visible: true}, |
| | | {id: 'yearInvestAmount', label: '本年计划投资', visible: true}, |
| | | {id: 'planStartTime', label: '项目年份', slotName: 'planStartTime', visible: true}, |
| | | {id: 'projectStatus', label: '项目状态', slotName: 'projectStatus', visible: true}, |
| | | {id: 'investType', label: '投资类别', slotName: 'investType', visible: true}, |
| | | {id: 'content', label: '建设内容', visible: false}, |
| | | {id: 'fundType', label: '资金类型', visible: false}, |
| | | {id: 'projectContactPerson', label: '项目联系人', visible: false}, |
| | | {id: 'contact', label: '联系方式', visible: false}, |
| | | {id: 'engineeringIdList', label: '关联工程', visible: false}, |
| | | {id: 'competentDepartmentList', label: '主管部门', visible: false}, |
| | | {id: 'area', label: '行政区划', visible: false}, |
| | | {id: 'managementCentralizationList', label: '管理归口', visible: false}, |
| | | {id: 'projectApprovalType', label: '项目审批类型', visible: false}, |
| | | {id: 'importanceType', label: '重点分类', visible: false}, |
| | | {id: 'setTime', label: '立项时间', visible: false}, |
| | | {id: 'planCompleteTime', label: '计划竣工时间', visible: false}, |
| | | {id: 'winUnit', label: '中标单位', visible: false}, |
| | | {id: 'winAmount', label: '中标金额', visible: false}, |
| | | {id: 'winTime', label: '中标时间', visible: false}, |
| | | {id: 'year', label: '年度投资计划', visible: false}, |
| | | {id: 'address', label: '项目地址', visible: false}, |
| | | {id: 'projectBudget', label: '项目预算', visible: false}, |
| | | {id: 'beCrossRegion', label: '建设地点是否跨域', visible: false}, |
| | | {id: 'constructionLocation', label: '项目建设地点', visible: false}, |
| | | {id: 'detailedAddress', label: '建设详细地址', visible: false}, |
| | | {id: 'beCompensationProject', label: '是否是补码项目', visible: false}, |
| | | {id: 'compensationReason', label: '补码原因', visible: false}, |
| | | {id: 'plannedStartDate', label: '计划开工时间', visible: false}, |
| | | {id: 'expectedCompletionDate', label: '拟建成时间', visible: false}, |
| | | {id: 'nationalIndustryClassification', label: '国际行业分类', visible: false}, |
| | | {id: 'industryClassification', label: '所属行业分类', visible: false}, |
| | | {id: 'projectNature', label: '项目建成性质', visible: false}, |
| | | {id: 'projectAttribute', label: '项目属性', visible: false}, |
| | | {id: 'useEarth', label: '是否使用土地', visible: false}, |
| | | {id: 'contentScale', label: '主要建设内容及规模', visible: false}, |
| | | {id: 'code', label: '建管平台代码', visible: false}, |
| | | {id: 'projectUnit', label: '项目单位', visible: false}, |
| | | {id: 'projectUnitType', label: '项目单位类型', visible: false}, |
| | | {id: 'registrationType', label: '登记注册类型', visible: false}, |
| | | {id: 'holdingSituation', label: '控股情况', visible: false}, |
| | | {id: 'certificateType', label: '证照类型', visible: false}, |
| | | {id: 'certificateNumber', label: '证件号码', visible: false}, |
| | | {id: 'registeredAddress', label: '注册地址', visible: false}, |
| | | {id: 'registeredCapital', label: '注册资金', visible: false}, |
| | | {id: 'legal_representative', label: '法人代表', visible: false}, |
| | | {id: 'fixedPhone', label: '固定电话', visible: false}, |
| | | {id: 'legalPersonIdcard', label: '法人身份证号', visible: false}, |
| | | {id: 'projectContactPerson', label: '项目联系人', visible: false}, |
| | | {id: 'phone', label: '移动电话', visible: false}, |
| | | {id: 'contactIdcard', label: '联系人身份证号', visible: false}, |
| | | {id: 'wechat', label: '微信号', visible: false}, |
| | | {id: 'contactAddress', label: '联系人通讯地址', visible: false}, |
| | | {id: 'postCode', label: '邮政编码', visible: false}, |
| | | {id: 'email', label: '电子邮箱', visible: false}, |
| | | {id: 'totalInvestment', label: '项目总投资额', visible: false}, |
| | | {id: 'principal', label: '项目本金', visible: false}, |
| | | {id: 'governmentInvestmentTotal', label: '政府投资', visible: false}, |
| | | {id: 'centralInvestmentTotal', label: '中央投资', visible: false}, |
| | | {id: 'centralBudgetInvestment', label: '中央预算投资', visible: false}, |
| | | {id: 'centralFiscalInvestment', label: '中央财政', visible: false}, |
| | | {id: 'centralSpecialBondInvestment', label: '中央专项债券筹集的专项建设资金', visible: false}, |
| | | {id: 'centralSpecialFundInvestment', label: '中央专项建设基金', visible: false}, |
| | | {id: 'provincialInvestmentTotal', label: '省级投资', visible: false}, |
| | | {id: 'provincialBudgetInvestment', label: '省预算内投资', visible: false}, |
| | | {id: 'provincialFiscalInvestment', label: '省财政性建设投资', visible: false}, |
| | | {id: 'provincialSpecialFundInvestment', label: '省专项建设资金', visible: false}, |
| | | {id: 'cityInvestmentTotal', label: '市(州)投资', visible: false}, |
| | | {id: 'cityBudgetInvestment', label: '市(州)预算内投资', visible: false}, |
| | | {id: 'cityFiscalInvestment', label: '市(州)财政性投资', visible: false}, |
| | | {id: 'citySpecialFundInvestment', label: '市(州)专项资金', visible: false}, |
| | | {id: 'countyInvestmentTotal', label: '县(市、区)投资', visible: false}, |
| | | {id: 'countyBudgetInvestment', label: '区(县)预算内投资', visible: false}, |
| | | {id: 'countyFiscalInvestment', label: '区(县)财政性建设资金', visible: false}, |
| | | {id: 'countySpecialFundInvestment', label: '区(县)专项资金', visible: false}, |
| | | {id: 'domesticLoanTotal', label: '国内贷款', visible: false}, |
| | | {id: 'bankLoan', label: '银行贷款', visible: false}, |
| | | {id: 'foreignInvestmentTotal', label: '外商投资', visible: false}, |
| | | {id: 'enterpriseSelfRaisedTotal', label: '企业自筹', visible: false}, |
| | | {id: 'otherInvestmentTotal', label: '其他投资', visible: false} |
| | | ]; |
| | | export const currentRest = [ |
| | | { id: 'projectName', label: '项目名称', visible: true }, |
| | | { id: 'projectOwnerUnit', label: '业主单位', visible: true }, |
| | | { id: 'projectColorCode', label: '项目码', slotName: 'projectColorCode', visible: true }, |
| | | { id: 'projectCode', label: '项目代码', visible: true }, |
| | | { id: 'projectType', label: '项目类型', slotName: 'projectType', visible: true }, |
| | | { id: 'projectPhase', label: '项目阶段', visible: true }, |
| | | { id: 'totalInvestment', label: '总投资额', visible: true }, |
| | | { id: 'yearInvestAmount', label: '本年计划投资', visible: true }, |
| | | { id: 'planStartTime', label: '项目年份', slotName: 'planStartTime', visible: true }, |
| | | { id: 'projectStatus', label: '项目状态', slotName: 'projectStatus', visible: true }, |
| | | { id: 'investType', label: '投资类别', slotName: 'investType', visible: true }, |
| | | { id: 'content', label: '建设内容', visible: false }, |
| | | { id: 'fundType', label: '资金类型', visible: false }, |
| | | { id: 'projectContactPerson', label: '项目联系人', visible: false }, |
| | | { id: 'contact', label: '联系方式', visible: false }, |
| | | { id: 'engineeringIdList', label: '关联工程', visible: false }, |
| | | { id: 'competentDepartmentList', label: '主管部门', visible: false }, |
| | | { id: 'area', label: '行政区划', visible: false }, |
| | | { id: 'managementCentralizationList', label: '管理归口', visible: false }, |
| | | { id: 'projectApprovalType', label: '项目审批类型', visible: false }, |
| | | { id: 'importanceType', label: '重点分类', visible: false }, |
| | | { id: 'setTime', label: '立项时间', visible: false }, |
| | | { id: 'planCompleteTime', label: '计划竣工时间', visible: false }, |
| | | { id: 'winUnit', label: '中标单位', visible: false }, |
| | | { id: 'winAmount', label: '中标金额', visible: false }, |
| | | { id: 'winTime', label: '中标时间', visible: false }, |
| | | { id: 'year', label: '年度投资计划', visible: false }, |
| | | { id: 'address', label: '项目地址', visible: false }, |
| | | { id: 'projectBudget', label: '项目预算', visible: false }, |
| | | { id: 'beCrossRegion', label: '建设地点是否跨域', visible: false }, |
| | | { id: 'constructionLocation', label: '项目建设地点', visible: false }, |
| | | { id: 'detailedAddress', label: '建设详细地址', visible: false }, |
| | | { id: 'beCompensationProject', label: '是否是补码项目', visible: false }, |
| | | { id: 'compensationReason', label: '补码原因', visible: false }, |
| | | { id: 'plannedStartDate', label: '计划开工时间', visible: false }, |
| | | { id: 'expectedCompletionDate', label: '拟建成时间', visible: false }, |
| | | { id: 'nationalIndustryClassification', label: '国际行业分类', visible: false }, |
| | | { id: 'industryClassification', label: '所属行业分类', visible: false }, |
| | | { id: 'projectNature', label: '项目建成性质', visible: false }, |
| | | { id: 'projectAttribute', label: '项目属性', visible: false }, |
| | | { id: 'useEarth', label: '是否使用土地', visible: false }, |
| | | { id: 'contentScale', label: '主要建设内容及规模', visible: false }, |
| | | { id: 'code', label: '建管平台代码', visible: false }, |
| | | { id: 'projectUnit', label: '项目单位', visible: false }, |
| | | { id: 'projectUnitType', label: '项目单位类型', visible: false }, |
| | | { id: 'registrationType', label: '登记注册类型', visible: false }, |
| | | { id: 'holdingSituation', label: '控股情况', visible: false }, |
| | | { id: 'certificateType', label: '证照类型', visible: false }, |
| | | { id: 'certificateNumber', label: '证件号码', visible: false }, |
| | | { id: 'registeredAddress', label: '注册地址', visible: false }, |
| | | { id: 'registeredCapital', label: '注册资金', visible: false }, |
| | | { id: 'legal_representative', label: '法人代表', visible: false }, |
| | | { id: 'fixedPhone', label: '固定电话', visible: false }, |
| | | { id: 'legalPersonIdcard', label: '法人身份证号', visible: false }, |
| | | { id: 'projectContactPerson', label: '项目联系人', visible: false }, |
| | | { id: 'phone', label: '移动电话', visible: false }, |
| | | { id: 'contactIdcard', label: '联系人身份证号', visible: false }, |
| | | { id: 'wechat', label: '微信号', visible: false }, |
| | | { id: 'contactAddress', label: '联系人通讯地址', visible: false }, |
| | | { id: 'postCode', label: '邮政编码', visible: false }, |
| | | { id: 'email', label: '电子邮箱', visible: false }, |
| | | { id: 'totalInvestment', label: '项目总投资额', visible: false }, |
| | | { id: 'principal', label: '项目本金', visible: false }, |
| | | { id: 'governmentInvestmentTotal', label: '政府投资', visible: false }, |
| | | { id: 'centralInvestmentTotal', label: '中央投资', visible: false }, |
| | | { id: 'centralBudgetInvestment', label: '中央预算投资', visible: false }, |
| | | { id: 'centralFiscalInvestment', label: '中央财政', visible: false }, |
| | | { id: 'centralSpecialBondInvestment', label: '中央专项债券筹集的专项建设资金', visible: false }, |
| | | { id: 'centralSpecialFundInvestment', label: '中央专项建设基金', visible: false }, |
| | | { id: 'provincialInvestmentTotal', label: '省级投资', visible: false }, |
| | | { id: 'provincialBudgetInvestment', label: '省预算内投资', visible: false }, |
| | | { id: 'provincialFiscalInvestment', label: '省财政性建设投资', visible: false }, |
| | | { id: 'provincialSpecialFundInvestment', label: '省专项建设资金', visible: false }, |
| | | { id: 'cityInvestmentTotal', label: '市(州)投资', visible: false }, |
| | | { id: 'cityBudgetInvestment', label: '市(州)预算内投资', visible: false }, |
| | | { id: 'cityFiscalInvestment', label: '市(州)财政性投资', visible: false }, |
| | | { id: 'citySpecialFundInvestment', label: '市(州)专项资金', visible: false }, |
| | | { id: 'countyInvestmentTotal', label: '县(市、区)投资', visible: false }, |
| | | { id: 'countyBudgetInvestment', label: '区(县)预算内投资', visible: false }, |
| | | { id: 'countyFiscalInvestment', label: '区(县)财政性建设资金', visible: false }, |
| | | { id: 'countySpecialFundInvestment', label: '区(县)专项资金', visible: false }, |
| | | { id: 'domesticLoanTotal', label: '国内贷款', visible: false }, |
| | | { id: 'bankLoan', label: '银行贷款', visible: false }, |
| | | { id: 'foreignInvestmentTotal', label: '外商投资', visible: false }, |
| | | { id: 'enterpriseSelfRaisedTotal', label: '企业自筹', visible: false }, |
| | | { id: 'otherInvestmentTotal', label: '其他投资', visible: false } |
| | | ]; |