123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- <template>
- <div class="export-excel">
- <el-dialog
- :title="values.relation_maintenance"
- :visible.sync="dialogExport"
- >
- <p class="option-tip">{{values.optionTips}}</p>
- <el-row :span="24">
- <el-col :span="8">
- <p>
- <i class="iconfont icon-doc-line"/>
- {{values.currentNum}}{{length}}
- </p>
- <a :href="downloadProject('excel')">
- <!-- <a :href=`/api/datacenter/graphic/export?code=对象ID${localStorage.getItem('RelationType')?relType=${localStorage.getItem('RelationType')} : null}${ localStorage.getItem('ZoneType') ? `&zoneType=${localStorage.getItem('ZoneType')}` : null}` >-->
- <el-button
- type="primary"
- class="mt-10"
- >
- {{values.download}}
- </el-button>
- </a>
- </el-col>
- <el-col :span="10">
- {{values.lastTime}}
- </el-col>
- </el-row>
- <el-upload
- class="upload-demo"
- :drag="true"
- action="/api/datacenter/graphic/import"
- multiple
- :show-file-list='false'
- name="file"
- :headers="headers"
- :data="dataId"
- :on-progress="progress"
- :on-success="success"
- :on-error="error"
- >
- <i class="el-icon-upload"/>
- <div
- class="el-upload__text"
- v-html="values.uploadTxt"
- />
- <div class="upload__tip danger" slot="tip">{{ values.uploadTips}}</div>
- </el-upload>
- </el-dialog>
- <!--手动编辑:手动维护.process结束-->
- <el-dialog
- :title="values.relation_maintenance"
- :visible.sync="dialogProcess"
- >
- <div class="block">
- <el-timeline>
- <el-timeline-item
- v-for="(activity, index) in activities"
- :key="index"
- :icon="activity.icon"
- :type="activity.type"
- :color="activity.color"
- :size="activity.size"
- >
- {{activity.content}}
- </el-timeline-item>
- </el-timeline>
- </div>
- <!-- 下载报告-->
- <a :href="downloadProject('report')">
- <el-button>{{values.downloadFile}}</el-button>
- </a>
- <footer
- slot="footer"
- class="dialog-footer "
- >
- <el-button @click="errBack">{{values.back}}</el-button>
- <el-button
- type="primary"
- @click="finish"
- >{{values.done}}
- </el-button>
- </footer>
- </el-dialog>
- </div>
- </template>
- <script>
- import {mapGetters} from 'vuex'
- import storage from '@/framework/utils/storage'
- export default {
- name: "exportExcel",
- props: ['values','length'],
- data() {
- return {
- // relationCount:localStorage.getItem('count'),
- dialogExport: false,
- dialogProcess: false,
- activities: [{
- content: '数据文件处理中..',
- size: 'large',
- type: 'primary',
- icon: 'el-icon-check',
- color: '#0bbd87'
- }, {
- content: '数据处理成功',
- color: '#0bbd87',
- icon: 'el-icon-check',
- size: 'large',
- type: 'primary',
- }],
- }
- },
- computed: {
- ...mapGetters('layout', ['projectId']),
- headers() {
- return {
- 'ProjectId': this.projectId,
- 'Comming': 'adm',
- 'Account': storage.get("user_name")
- }
- },
- dataId() {
- return {
- relType: localStorage.getItem('RelationType') || '',
- zoneType: localStorage.getItem('ZoneType') || '',
- projectId: this.projectId
- }
- },
- },
- methods: {
- downloadProject(str) {
- let relType = localStorage.getItem('RelationType') != '' ? `?relType=${localStorage.getItem('RelationType')}` : '';
- let zoneType = localStorage.getItem('ZoneType') != '' ? `&zoneType=${localStorage.getItem('ZoneType')}` : '';
- let url;
- if (str === 'excel') {
- relType = localStorage.getItem('RelationType') ? `&relType=${localStorage.getItem('RelationType')}` : '';
- url = `/api/datacenter/graphic/export?projectId=${this.projectId}&code=对象ID${relType}${zoneType}`
- } else {
- url = `/api/datacenter/graphic/report-downloads${relType}${zoneType}`
- }
- return url
- },
- progress(event, file, fileList) {
- // console.log(event.file, fileList)
- },
- success(event, file, fileList) {
- this.dialogExport = true
- this.dialogProcess = true
- },
- error(event, file, fileList) {
- this.dialogExport = true
- this.dialogProcess = true
- },
- errBack() {
- this.dialogProcess = false
- },
- finish() {
- this.dialogProcess = false
- this.dialogExport = false
- },
- }
- }
- </script>
- <style scoped lang="less">
- .export-excel {
- .mt-10 {
- margin-top: 10px;
- }
- .danger {
- color: #d9001b;
- }
- .font-big {
- font-weight: 600;
- }
- .exist-title {
- font-size: 12px;
- color: #AAAAAA;
- }
- .option-tip {
- font-size: 18px;
- font-weight: 600;
- }
- .upload-demo {
- margin: 20px 0;
- }
- /deep/ .el-upload-dragger {
- width: 600px;
- margin: 0 auto;
- }
- }
- </style>
|