|
@@ -10,19 +10,29 @@
|
|
|
<van-col span="24" class="otherInfo">
|
|
|
专利名称:<span>{{ item.patent_name || '暂无' }}</span>
|
|
|
</van-col>
|
|
|
- <!-- <van-col span="24" class="otherInfo">
|
|
|
+ <van-col span="24" class="otherInfo">
|
|
|
接收人:<span>{{ item.to_name || '暂无' }}</span>
|
|
|
- </van-col> -->
|
|
|
+ </van-col>
|
|
|
<van-col span="24" class="otherInfo">
|
|
|
发送时间:<span>{{ getDate(item.meta) }}</span>
|
|
|
</van-col>
|
|
|
</van-col>
|
|
|
<van-col span="24" class="btn">
|
|
|
- <van-button size="small" type="info" @click="download(item)">下载文件</van-button>
|
|
|
+ <van-button size="small" type="info" @click="toView(item.file_url)">查看文件</van-button>
|
|
|
</van-col>
|
|
|
</van-col>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
+ <van-dialog class="dialog" v-model="show" title="文件下载" :show-confirm-button="false" :show-cancel-button="true">
|
|
|
+ <van-col span="24" class="list" v-for="(item, index) in fileList" :key="index">
|
|
|
+ <van-col span="24" class="name"
|
|
|
+ >文件路径:<span>{{ item }}</span></van-col
|
|
|
+ >
|
|
|
+ <van-col span="24" class="btn">
|
|
|
+ <van-button type="info" size="small" @click="download(item)">下载文件</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -36,17 +46,21 @@ export default {
|
|
|
},
|
|
|
components: {},
|
|
|
data: function () {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ // 文件下载
|
|
|
+ show: false,
|
|
|
+ fileList: [],
|
|
|
+ };
|
|
|
},
|
|
|
created() {},
|
|
|
methods: {
|
|
|
+ // 查看文件
|
|
|
+ toView(data) {
|
|
|
+ this.$set(this, `fileList`, data);
|
|
|
+ this.show = true;
|
|
|
+ },
|
|
|
download(data) {
|
|
|
- if (data.file_url.length > 0) {
|
|
|
- let url = data.file_url.map((i) => i.url);
|
|
|
- window.location.href = `${process.env.VUE_APP_HOST}/${url[0]}`;
|
|
|
- } else {
|
|
|
- this.$toast({ type: `fail`, message: `未上传文件` });
|
|
|
- }
|
|
|
+ console.log(data);
|
|
|
},
|
|
|
getDate(val) {
|
|
|
let newDate = moment(val.createdAt).format('YYYY-MM-DD hh:mm:ss');
|
|
@@ -101,4 +115,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.dialog {
|
|
|
+ padding: 0 8px;
|
|
|
+ /deep/.van-dialog__content {
|
|
|
+ height: 350px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ .list {
|
|
|
+ .name {
|
|
|
+ font-size: 14px;
|
|
|
+ word-break: break-all;
|
|
|
+ color: #666;
|
|
|
+ margin: 0 0 5px 0;
|
|
|
+ span {
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|