更新
This commit is contained in:
@ -73,17 +73,24 @@ service.interceptors.response.use(
|
|||||||
|
|
||||||
// 通用下载方法
|
// 通用下载方法
|
||||||
export function download(url, params, filename, config) {
|
export function download(url, params, filename, config) {
|
||||||
let token = localStorage.getItem('token')
|
return service.post(url, params, {
|
||||||
return axios.post(url, params, {"Content-type": "multipart/form-data",headers:{"Authorization": `${token}`}}).then( async (data) => {
|
transformRequest: [(params) => { return tansParams(params) }],
|
||||||
const isBlob = blobValidate(data.data);
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||||
console.log(isBlob,'====data');
|
responseType: 'blob',
|
||||||
|
...config
|
||||||
|
}).then(async (data) => {
|
||||||
|
const isBlob = blobValidate(data);
|
||||||
if (isBlob) {
|
if (isBlob) {
|
||||||
const blob = new Blob([data.data])
|
const blob = new Blob([data])
|
||||||
saveAs(blob, filename)
|
saveAs(blob, filename)
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('网络异常');
|
const resText = await data.text();
|
||||||
|
const rspObj = JSON.parse(resText);
|
||||||
|
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
|
||||||
|
ElMessage.error(errMsg);
|
||||||
}
|
}
|
||||||
// downloadLoadingInstance.close();
|
}).catch((r) => {
|
||||||
|
ElMessage.error('下载文件出现错误,请联系管理员!')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="titleBox">
|
<div class="titleBox">
|
||||||
<PageTitle title="人力情报信息采集流转">
|
<PageTitle title="人力情报信息采集流转">
|
||||||
<el-button type="primary">
|
<el-button type="primary" @click="exportFile">
|
||||||
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
<el-icon style="vertical-align: middle"><CirclePlus /></el-icon>
|
||||||
<span style="vertical-align: middle">导出</span>
|
<span style="vertical-align: middle">导出</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -85,6 +85,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { download } from "@/utils/request";
|
||||||
import * as MOSTY from "@/components/MyComponents/index";
|
import * as MOSTY from "@/components/MyComponents/index";
|
||||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
@ -211,6 +212,12 @@ const delDictItem = (id) =>{
|
|||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const exportFile = () =>{
|
||||||
|
window.open('/mosty-api/mosty-gsxt/qbcj/exportQbsjcjDc?cjLx=1')
|
||||||
|
// download("/mosty-api/mosty-gsxt/qbcj/exportQbsjcjDc",{},`情报采集流转_${new Date().getTime()}.xlsx`);
|
||||||
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
const addEdit = (type, row) => {
|
const addEdit = (type, row) => {
|
||||||
isShow.value = true;
|
isShow.value = true;
|
||||||
|
@ -88,12 +88,8 @@ import { reactive, ref, getCurrentInstance } from "vue";
|
|||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { SGXTQTSQLX } = proxy.$dict("SGXTQTSQLX"); //获取字典数据
|
const { SGXTQTSQLX } = proxy.$dict("SGXTQTSQLX"); //获取字典数据
|
||||||
const emits = defineEmits(['close'])
|
const emits = defineEmits(['close'])
|
||||||
const listQuery = ref({
|
const listQuery = ref({});
|
||||||
dateRange:timeSlotChange('天'),
|
const active = ref(-1);
|
||||||
hskssj:timeSlotChange('天')[0]+' 00:00:00',
|
|
||||||
hsjssj:timeSlotChange('天')[1]+' 23:59:59',
|
|
||||||
});
|
|
||||||
const active = ref(0);
|
|
||||||
const time = reactive([
|
const time = reactive([
|
||||||
{ label: "今天", value: "10" },
|
{ label: "今天", value: "10" },
|
||||||
{ label: "本周", value: "20" },
|
{ label: "本周", value: "20" },
|
||||||
@ -154,11 +150,11 @@ const onSearch = (val) =>{
|
|||||||
loadDate()
|
loadDate()
|
||||||
}
|
}
|
||||||
const reset = (val) =>{
|
const reset = (val) =>{
|
||||||
active.value = 0;
|
|
||||||
listQuery.value = {};
|
listQuery.value = {};
|
||||||
listQuery.value.dateRange = timeSlotChange('天');
|
active.value = -1;
|
||||||
listQuery.value.hskssj = timeSlotChange('天')[0] + ' 00:00:00';
|
listQuery.value.dateRange = '';
|
||||||
listQuery.value.hsjssj = timeSlotChange('天')[1] + ' 23:59:59';
|
listQuery.value.hskssj = '';
|
||||||
|
listQuery.value.hsjssj = '';
|
||||||
loadDate()
|
loadDate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ import { ref, watch ,defineProps,nextTick } from "vue";
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
echartsId:{
|
echartsId:{
|
||||||
type:String,
|
type:String,
|
||||||
default:'barId'
|
default:'lineId'
|
||||||
},
|
},
|
||||||
color:{
|
color:{
|
||||||
type:String,
|
type:String,
|
||||||
default:'#0072ff'
|
default:'lineId'
|
||||||
},
|
},
|
||||||
data:{
|
data:{
|
||||||
type:Array,
|
type:Array,
|
||||||
@ -72,7 +72,7 @@ const initChart = (data) => {
|
|||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "",
|
name: "情报反馈统计",
|
||||||
type: "pie",
|
type: "pie",
|
||||||
radius: ["40%", "75%"],
|
radius: ["40%", "75%"],
|
||||||
center: ["30%", "50%"],
|
center: ["30%", "50%"],
|
||||||
|
Reference in New Issue
Block a user