|
@@ -27,7 +27,7 @@
|
|
|
</data-form>
|
|
|
</el-col>
|
|
|
</span>
|
|
|
- <span v-else>
|
|
|
+ <span v-else-if="display == 'import'">
|
|
|
<el-col :span="24" class="top">
|
|
|
<el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
</el-col>
|
|
@@ -53,6 +53,14 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</span>
|
|
|
+ <span v-else-if="display == 'export'">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <el-button type="primary" size="mini" @click="back">返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="exportList">
|
|
|
+ <data-table :fields="exportfields" :opera="exportopera" :data="exportList" @bottom="bottomBtn" :usePage="false"></data-table>
|
|
|
+ </el-col>
|
|
|
+ </span>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -141,6 +149,16 @@ export default {
|
|
|
fileForm: {},
|
|
|
// 错误信息
|
|
|
errorList: [],
|
|
|
+ // 任务列表
|
|
|
+ exportopera: [
|
|
|
+ {
|
|
|
+ label: '下载',
|
|
|
+ icon: 'el-icon-bottom',
|
|
|
+ method: 'bottom',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ exportfields: [{ label: '标题', prop: 'title' }],
|
|
|
+ exportList: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -148,7 +166,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...patent(['query', 'fetch', 'update', 'create', 'delete']),
|
|
|
- ...patentImport({ importCreate: 'create' }),
|
|
|
+ ...patentImport({ importCreate: 'create', importExport: 'export', importQuery: 'query' }),
|
|
|
// 查询列表
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
let res = await this.query({ skip, limit, ...info });
|
|
@@ -212,6 +230,7 @@ export default {
|
|
|
this.form = {};
|
|
|
this.fileForm = {};
|
|
|
this.errorList = [];
|
|
|
+ this.exportList = [];
|
|
|
this.display = 'list';
|
|
|
this.search();
|
|
|
},
|
|
@@ -223,9 +242,11 @@ export default {
|
|
|
importBtn() {
|
|
|
this.display = 'import';
|
|
|
},
|
|
|
+ // 文件上传
|
|
|
importSuccess({ type, data }) {
|
|
|
if (data.uri) this.$set(this.fileForm, `uri`, data.uri);
|
|
|
},
|
|
|
+ // 确认导入
|
|
|
async importSubmit() {
|
|
|
let data = this.fileForm;
|
|
|
let res = await this.importCreate(data);
|
|
@@ -243,9 +264,22 @@ export default {
|
|
|
this.back();
|
|
|
}
|
|
|
},
|
|
|
- // 导出书卷
|
|
|
- importOut() {
|
|
|
- alert('导出数据');
|
|
|
+ // 导出数据
|
|
|
+ async importOut() {
|
|
|
+ // 创建任务
|
|
|
+ let res = await this.importExport();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.display = 'export';
|
|
|
+ // 查询任务列表
|
|
|
+ let arr = await this.importQuery();
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
+ this.$set(this, 'exportList', arr.data);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 下载
|
|
|
+ bottomBtn({ data }) {
|
|
|
+ console.log(data);
|
|
|
},
|
|
|
},
|
|
|
computed: {
|