Commit 6565999d by wenyi.chen

线上更新

parent 8b5b0dc9
import request from '/@/utils/request';
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
*
*/
export function excelFileApi() {
return {
taskExportFile: (data) => {
return request({
url: '/api/taskExportFile',
method: 'post',
data,
});
},
normExportFile: (data) => {
return request({
url: '/api/normExportFile',
method: 'post',
data,
});
},
};
}
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<el-select v-model="state.formItem.addItem.refer_type" placeholder="请选择信源等级"> <el-select v-model="state.formItem.addItem.refer_type" placeholder="请选择信源等级">
<el-option label="官网/政府" value="1"></el-option> <el-option label="官网/政府" value="1"></el-option>
<el-option label="权威媒体" value="2"></el-option> <el-option label="权威媒体" value="2"></el-option>
<el-option label=" " value="3"></el-option> <el-option label="其他信源" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index"> <el-form-item label="标题" :prop="'userFilled.' + index+ '.name'" v-for="(item, index) in state.formItem.userFilled" :key="index">
......
...@@ -53,10 +53,11 @@ ...@@ -53,10 +53,11 @@
<span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span> <span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="280" fixed="right" align="center"> <el-table-column label="操作" width="380" fixed="right" align="center">
<template #default="scope"> <template #default="scope">
<el-button size="small" type="primary" @click="details(scope.row.id)">查看详情</el-button> <el-button size="small" type="primary" @click="details(scope.row.id)">查看详情</el-button>
<el-button size="small" type="danger" @click="edit(scope.row.id)">修改指标</el-button> <el-button size="small" type="danger" @click="edit(scope.row.id)">修改指标</el-button>
<el-button size="small" type="warning" @click="exportFile(scope.row.id)">导出数据</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -80,6 +81,7 @@ ...@@ -80,6 +81,7 @@
import { getCurrentInstance } from 'vue'; import { getCurrentInstance } from 'vue';
import { normApi } from '/@/api/norm/index'; import { normApi } from '/@/api/norm/index';
import { taskPackageApi } from '/@/api/taskPackage/index'; import { taskPackageApi } from '/@/api/taskPackage/index';
import { excelFileApi } from '/@/api/excelFile/index';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
// 引入组件 // 引入组件
...@@ -190,6 +192,26 @@ const details= (norm_id) => { ...@@ -190,6 +192,26 @@ const details= (norm_id) => {
const edit= (norm_id) => { const edit= (norm_id) => {
EditDialogRef.value.openDialog(norm_id); EditDialogRef.value.openDialog(norm_id);
} }
// 导出文件
const exportFile= (id) => {
let query = {id:id}
excelFileApi().normExportFile(query).then(res => {
if(res.data){
let url = res.data;
const iframe = document.createElement('iframe'); // 创建一个HTML 元素
iframe.style.display = 'none'; // 隐藏iframe 防止影响页面
iframe.style.height = 0; // 高度设置0 防止影响页面
iframe.src = url;// 下载链接
document.body.appendChild(iframe); // 这一行必须,iframe挂在到dom树上才会发请求 // 5分钟之后删除
setTimeout(() => { iframe.remove(); }, 5 * 60 * 1000);
ElMessage.success('导出成功,请点击下载列表查看!');
}else{
ElMessage.error('导出失败!');
}
}).catch(() => {
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -40,11 +40,12 @@ ...@@ -40,11 +40,12 @@
<span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span> <span style="color:#F56C6C">{{scope.row.collectsQuantity}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250" fixed="right" align="center"> <el-table-column label="操作" width="350" fixed="right" align="center">
<template #default="scope"> <template #default="scope">
<!-- <el-button size="small" link type="primary" @click="details(scope.row.id)">发布指标</el-button> --> <!-- <el-button size="small" link type="primary" @click="details(scope.row.id)">发布指标</el-button> -->
<el-button size="small" type="primary" @click="details(scope.row.id)">详情与发布</el-button> <el-button size="small" type="primary" @click="details(scope.row.id)">详情与发布</el-button>
<el-button size="small" type="danger" @click="edit(scope.row)">修改任务</el-button> <el-button size="small" type="danger" @click="edit(scope.row)">修改任务</el-button>
<el-button size="small" type="warning" @click="exportFile(scope.row.id)">导出数据</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -66,6 +67,7 @@ ...@@ -66,6 +67,7 @@
<script setup name="taskPackage-list"> <script setup name="taskPackage-list">
import { getCurrentInstance } from 'vue'; import { getCurrentInstance } from 'vue';
import { taskPackageApi } from '/@/api/taskPackage/index'; import { taskPackageApi } from '/@/api/taskPackage/index';
import { excelFileApi } from '/@/api/excelFile/index';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
// 引入组件 // 引入组件
...@@ -152,6 +154,27 @@ const edit= (row) => { ...@@ -152,6 +154,27 @@ const edit= (row) => {
AddDialogRef.value.openDialog(row); AddDialogRef.value.openDialog(row);
} }
// 导出文件
const exportFile= (id) => {
let query = {id:id}
excelFileApi().taskExportFile(query).then(res => {
if(res.data){
let url = res.data;
const iframe = document.createElement('iframe'); // 创建一个HTML 元素
iframe.style.display = 'none'; // 隐藏iframe 防止影响页面
iframe.style.height = 0; // 高度设置0 防止影响页面
iframe.src = url;// 下载链接
document.body.appendChild(iframe); // 这一行必须,iframe挂在到dom树上才会发请求 // 5分钟之后删除
setTimeout(() => { iframe.remove(); }, 5 * 60 * 1000);
ElMessage.success('导出成功,请点击下载列表查看!');
}else{
ElMessage.error('导出失败!');
}
}).catch(() => {
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -37,7 +37,8 @@ const viteConfig = defineConfig((mode) => { ...@@ -37,7 +37,8 @@ const viteConfig = defineConfig((mode) => {
hmr: true, hmr: true,
proxy: { proxy: {
'/dev': { '/dev': {
target: 'https://data-collect.raisound.com/smart-detection', target: 'http://gcspider.raisound.com:81/data-collect-api',
// target: 'https://data-collect.raisound.com/smart-detection',
// target: 'http://192.168.10.168/data-collect-api', // target: 'http://192.168.10.168/data-collect-api',
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment