更新
This commit is contained in:
@ -2,7 +2,9 @@ import axios from 'axios';
|
||||
import store from '@/store';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { isCheckTimeout } from '@/utils/auth';
|
||||
import { saveAs } from 'file-saver'
|
||||
import { tansParams, blobValidate } from "@/utils/ruoyi";
|
||||
let downloadLoadingInstance;
|
||||
const service = axios.create({
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
timeout: 100000
|
||||
@ -64,12 +66,6 @@ service.interceptors.response.use(
|
||||
) {
|
||||
store.dispatch('user/logout');
|
||||
}
|
||||
// ElMessage({
|
||||
// message: error.message,
|
||||
// grouping: true,
|
||||
// type: 'error'
|
||||
// })
|
||||
// return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
@ -77,27 +73,17 @@ service.interceptors.response.use(
|
||||
|
||||
// 通用下载方法
|
||||
export function download(url, params, filename, config) {
|
||||
return service.post(url, params, {
|
||||
transformRequest: [(params) => { return tansParams(params) }],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
responseType: 'blob',
|
||||
...config
|
||||
}).then(async (data) => {
|
||||
const isBlob = blobValidate(data);
|
||||
let token = localStorage.getItem('token')
|
||||
return axios.post(url, params, {"Content-type": "multipart/form-data",headers:{"Authorization": `${token}`}}).then( async (data) => {
|
||||
const isBlob = blobValidate(data.data);
|
||||
console.log(isBlob,'====data');
|
||||
if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
const blob = new Blob([data.data])
|
||||
saveAs(blob, filename)
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||
Message.error(errMsg);
|
||||
ElMessage.error('网络异常');
|
||||
}
|
||||
downloadLoadingInstance.close();
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
Message.error('下载文件出现错误,请联系管理员!')
|
||||
downloadLoadingInstance.close();
|
||||
// downloadLoadingInstance.close();
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,6 @@
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="布控监视管理">
|
||||
<!-- <el-button>
|
||||
<span style="vertical-align: middle">调级</span>
|
||||
</el-button>
|
||||
<el-button>
|
||||
<span style="vertical-align: middle">导出</span>
|
||||
</el-button>
|
||||
<el-button>
|
||||
<span style="vertical-align: middle">导入</span>
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="addEdit('add', '')">
|
||||
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
|
@ -16,9 +16,9 @@
|
||||
<el-button type="primary" size="small" @click="isImport = true">
|
||||
<span style="vertical-align: middle">导入内容</span>
|
||||
</el-button>
|
||||
<el-button type="danger" size="small">
|
||||
<el-button type="danger" size="small" @click="deleteRow(idsTop)">
|
||||
<el-icon style="vertical-align: middle"><Delete /></el-icon>
|
||||
<span style="vertical-align: middle">删除</span>
|
||||
<span style="vertical-align: middle">批量删除</span>
|
||||
</el-button>
|
||||
</PageTitle>
|
||||
<MyTable
|
||||
@ -28,7 +28,7 @@
|
||||
:key="pageData.keyCount"
|
||||
:tableConfiger="pageData.tableConfiger0"
|
||||
:controlsWidth="pageData.controlsWidth"
|
||||
@chooseData="chooseData"
|
||||
@chooseData="chooseDataTop"
|
||||
>
|
||||
<template #fjLx="{ row }">
|
||||
<DictTag :tag="false" :value="row.fjLx" :options="D_GS_RQFJ_LX" />
|
||||
@ -37,7 +37,7 @@
|
||||
<template #controls="{ row }">
|
||||
<el-link size="small" type="success" @click="handleData('edit', row)">编辑</el-link>
|
||||
<el-link size="small" type="primary" @click="handleData('info', row)">查看</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteRow(row.id)">删除</el-link>
|
||||
<el-link size="small" type="danger" @click="deleteRow([row.id])">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<div class="ww100 flex just-center mt8">
|
||||
@ -140,6 +140,7 @@ const btnsList = reactive(['级别变更','警种变更','指定分配','添加
|
||||
|
||||
const chooselx = ref('')
|
||||
const isShow = ref(false)
|
||||
const idsTop = ref([])
|
||||
const ids = ref([])
|
||||
|
||||
const addFormDiloag = ref();
|
||||
@ -152,7 +153,7 @@ const pageData = reactive({
|
||||
keyCount: 0,
|
||||
tableConfiger0: {
|
||||
rowHieght: 61,
|
||||
showSelectType: "null",
|
||||
showSelectType: "checkBox",
|
||||
loading: false
|
||||
},
|
||||
tableConfiger: {
|
||||
@ -223,10 +224,14 @@ const getList = () => {
|
||||
//获取模型识别列表
|
||||
const getModelList = () => {
|
||||
let data = { ...pageData.pageConfiger };
|
||||
pageData.tableConfiger0.loading = true;
|
||||
qcckGet(data, "/mosty-gsxt/tbGsxtRqfjRy/selectPage").then((res) => {
|
||||
pageData.tableConfiger0.loading = false;
|
||||
pageData.tableData2 = res.records || [];
|
||||
pageData.total = res.total;
|
||||
ids.value = []
|
||||
}).catch(()=>{
|
||||
pageData.tableConfiger0.loading = false;
|
||||
})
|
||||
};
|
||||
//新增- 编辑
|
||||
@ -237,14 +242,23 @@ const handleData = (type, row) => {
|
||||
const intelligent = () => {
|
||||
IntelligentParsingRef.value.init();
|
||||
};
|
||||
|
||||
|
||||
// 选择数据
|
||||
const chooseDataTop = (val) =>{
|
||||
if(Array.isArray(val)) idsTop.value = val.map(item=>item.id);
|
||||
}
|
||||
|
||||
//删除操作
|
||||
const deleteRow = (id) => {
|
||||
const deleteRow = (ids) => {
|
||||
proxy.$confirm("确定要删除", "警告", {type: "warning"}).then(() => {
|
||||
ids.forEach(id=>{
|
||||
qcckGet({}, "/mosty-gsxt/tbGsxtRqfjNr/closeById/" + id).then((res) => {
|
||||
ElMessage.success("删除成功");
|
||||
getList();
|
||||
})
|
||||
}).catch(() => {});
|
||||
})
|
||||
})
|
||||
};
|
||||
const deleteRowBottom = (id) => {
|
||||
proxy.$confirm("确定要删除", "警告", {type: "warning"}).then(() => {
|
||||
@ -252,7 +266,7 @@ const deleteRowBottom = (id) => {
|
||||
ElMessage.success("删除成功");
|
||||
getModelList();
|
||||
})
|
||||
}).catch(() => {});
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@ -272,7 +286,7 @@ const chooseType = (val)=>{
|
||||
isShow.value = true;
|
||||
break;
|
||||
case '导出':
|
||||
download("/mosty-api/mosty-gsxt/tbGsxtRqfjRy/exportRyfjFxjg", {},`模型智能识别/LP解析结果_${new Date().getTime()}.xlsx`);
|
||||
// download("/mosty-api/mosty-gsxt/tbGsxtRqfjRy/exportRyfjFxjg", {"bkBt":"1"},`模型智能识别/LP解析结果_${new Date().getTime()}.xlsx`);
|
||||
break;
|
||||
case '批量删除':
|
||||
if(ids.value.length == 0) return ElMessage.warning("请选择对应删除的数据");
|
||||
|
@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="布控区域" />
|
||||
<PageTitle title="布控区域" >
|
||||
<el-button type="primary" @click="handleRow('add', '')">
|
||||
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleRow('moreDelete', '')">批量删除</el-button>
|
||||
</PageTitle>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
<div ref="searchBox">
|
||||
@ -9,13 +15,6 @@
|
||||
</div>
|
||||
<!-- 按钮组 -->
|
||||
<div class="content">
|
||||
<div class="btns">
|
||||
<el-button type="primary" @click="handleRow('add', '')">
|
||||
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
||||
<span style="vertical-align: middle">新增</span>
|
||||
</el-button>
|
||||
<el-button type="danger" @click="handleRow('moreDelete', '')">批量删除</el-button>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="tabBox">
|
||||
<MyTable
|
||||
@ -205,7 +204,7 @@ const handleSwitch = (row) =>{
|
||||
}
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 292;
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 272;
|
||||
window.onresize = function () {
|
||||
tabHeightFn();
|
||||
};
|
||||
|
Reference in New Issue
Block a user