|
@@ -11,7 +11,7 @@
|
|
|
<el-button type="primary" :icon="Plus" @click="openDialog('add')">新增</el-button>-->
|
|
|
</template>
|
|
|
<template #operation="{data}">
|
|
|
- <el-button type="info" @click="openDialog('detail',data)">查看</el-button>
|
|
|
+ <el-button type="info" @click="getDataFile(data)">查看</el-button>
|
|
|
<el-button v-if="store.isManager" type="info" @click="openDialog('edit',data)">修改</el-button>
|
|
|
<el-button v-if="store.isManager" type="info" @click="deleteObj(data)">删除</el-button>
|
|
|
</template>
|
|
@@ -40,6 +40,8 @@ import PolicyRegulationInformationSettingDialog
|
|
|
import {handleMes} from "@/units/element-ui/tip";
|
|
|
import {InsertSyslog} from "@/units/use-method/user-log";
|
|
|
import {closeShowLoading, showLoading} from "@/units/element-loading/element-loader";
|
|
|
+import axios from "axios";
|
|
|
+import {baseUrl} from "@/service/config";
|
|
|
export default {
|
|
|
name: "PolicyRegulationInformation",
|
|
|
components:{PolicyRegulationInformationSettingDialog, CommonLayout},
|
|
@@ -84,6 +86,39 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ function getDataFile(data){
|
|
|
+ let type = "";
|
|
|
+ if(data.TYPE =="本市"){
|
|
|
+ type="bs"
|
|
|
+ }else if(data.TYPE =="国家"){
|
|
|
+ type="gj"
|
|
|
+ }else if(data.TYPE =="市住建委"){
|
|
|
+ type="zjw"
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ "fileName":data.FILENAME + data.FILETYPE,
|
|
|
+ "type":type
|
|
|
+ }
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ url: '/api/XyxxApi/xyptFileDocument', // 请求地址
|
|
|
+ data: obj, // 参数
|
|
|
+ responseType: "blob", // 表明返回服务器返回的数据类型
|
|
|
+ }).then((res) => {
|
|
|
+ debugger
|
|
|
+ const blob = res.data;
|
|
|
+ if(blob.type==="application/octet-stream"){
|
|
|
+ const download_url = window.URL.createObjectURL(blob); //数据流作为下载的源
|
|
|
+ const eleLink = document.createElement('a'); //创建一个a标签
|
|
|
+ eleLink.href = download_url; //下载的文件连接,实际就是下载的数据流
|
|
|
+ eleLink.download = obj.fileName; //下载的文件名称
|
|
|
+ document.body.appendChild(eleLink)
|
|
|
+ eleLink.click() //模拟下载文件
|
|
|
+ window.URL.revokeObjectURL(download_url)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
return {
|
|
|
policyRegulationInformation,
|
|
|
policyRegulationInformationHeader,
|
|
@@ -94,6 +129,7 @@ export default {
|
|
|
isEditDialogShow,
|
|
|
dialogOperationType,
|
|
|
currentDialogOpObj,
|
|
|
+ getDataFile,
|
|
|
store
|
|
|
}
|
|
|
|