|
@@ -2,7 +2,7 @@
|
|
|
<div id="c-download">
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main" v-loading="loading">
|
|
|
- <cTable :fields="fields" :opera="[]" :list="list" @query="search" :usePage="false"> </cTable>
|
|
|
+ <cTable :fields="fields" :opera="opera" :list="list" @query="search" :usePage="false" @down="toDown"> </cTable>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
@@ -14,15 +14,21 @@ import type { Ref } from 'vue';
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
|
|
|
// 接口
|
|
|
-import { MissionStore } from '@common/src/stores/mission';
|
|
|
+
|
|
|
+import { PatentStore } from '@common/src/stores/patent/patent'; //
|
|
|
import type { IQueryResult } from '@/util/types.util';
|
|
|
-const missionAxios = MissionStore();
|
|
|
+const patentAxios = PatentStore();
|
|
|
|
|
|
// 加载中
|
|
|
const loading: Ref<any> = ref(false);
|
|
|
|
|
|
const list: Ref<any> = ref([]);
|
|
|
-const fields: Ref<any> = ref([{ label: '文件', model: 'name' }]);
|
|
|
+const fields: Ref<any> = ref([
|
|
|
+ { label: '下载进度', model: 'progress' },
|
|
|
+ { label: '备注', model: 'remark' },
|
|
|
+ { label: '文件', model: 'uri' }
|
|
|
+]);
|
|
|
+let opera: Ref<any[]> = ref([{ label: '下载', method: 'down' }]);
|
|
|
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
@@ -31,8 +37,16 @@ onMounted(async () => {
|
|
|
loading.value = false;
|
|
|
});
|
|
|
const search = async () => {
|
|
|
- let res: IQueryResult = await missionAxios.query({});
|
|
|
- console.log(res);
|
|
|
+ let res: IQueryResult = await patentAxios.pqueue();
|
|
|
+ if (res.errcode == '0') {
|
|
|
+ list.value = [res.data];
|
|
|
+ }
|
|
|
+};
|
|
|
+// 下载
|
|
|
+const toDown = (data) => {
|
|
|
+ if (data && data.uri) {
|
|
|
+ window.open(`${import.meta.env.VITE_APP_HOST}/${data.uri}`);
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="scss"></style>
|