Merge branch 'feature/1.0版本页面优化' of http://62.234.217.137:3000/Big-Data-Lab/CET-vue-3.0 into feature/1.0版本页面优化

This commit is contained in:
Xubx 2024-10-17 14:12:31 +08:00
commit 54d1bcb9aa
4 changed files with 752 additions and 291 deletions

View File

@ -67,6 +67,10 @@
getCollegeRate: '/cet/getRateByCollege', getCollegeRate: '/cet/getRateByCollege',
getAllRate: '/cet/getAllRate', getAllRate: '/cet/getAllRate',
getCollegeMajor: '/cet/getCollegeMajor', getCollegeMajor: '/cet/getCollegeMajor',
getMajor: '/cet/getMajorByCollege',
getMajorRate: '/cet/getRateByMajor',
getRateByMajor: '/cet/getRateByMajor', getRateByMajor: '/cet/getRateByMajor',
}, },
map1loading: false, map1loading: false,
@ -114,6 +118,8 @@
this.oneentrydate = '2017'; this.oneentrydate = '2017';
} }
this.query(query, college, [this.oneentrydate]); this.query(query, college, [this.oneentrydate]);
this.majorPassRate();
this.gradePassRate();
}, },
async majorQuery() { async majorQuery() {
if (this.majorentrydate.length == 0) { if (this.majorentrydate.length == 0) {
@ -254,32 +260,108 @@
}; };
myChart.setOption(collegeOption); myChart.setOption(collegeOption);
}, },
// //
majorPassRate() { async majorPassRate() {
var myChart = echarts.init(document.getElementById('map3')); var myChart = echarts.init(document.getElementById('map3'));
var option = { const name = '西语学院';
//let entrydate = this.oneentrydate.map((item) => item.value);
//console.log(entrydata, 'entrydata');
let queryParams = {
college: [[name]],
entrydate: [this.oneentrydate],
level: 'cet4',
};
let url = this.Url.getMajorRate;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
console.log(myChart, 'mychart');
if (!result) {
return;
}
console.log(result.data, 'result');
//result = result.data[name];
// result.data
const majors = Object.keys(result.data); //
const passRates = majors.map((major) => {
const entries = result.data[major];
return entries.length > 0 ? parseFloat(entries[0].passRate) : 0; //
});
let xData = majors.map((label) => label.split('').join('\n')); //x
var majorOption = {
tooltip: {
trigger: 'item',
conginee: false,
//
itemStytle: {
fontSize: 100,
},
formatter: function (params) {
// %
return `${params.marker}${params.name} ${params.value}%`;
},
},
title: { title: {
text: '西语学院各专业四级通过率', text: name + '各专业四级通过率',
textStyle: { textStyle: {
fontSize: 14, fontSize: 14,
}, },
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: ['英语', '翻译', '法语', '葡萄牙语', '西班牙语'], data: xData,
axisLabel: {
interval: 0, //x
//rotate: -10, //30
},
//data: result.map((item) => item.major),
//data: ['', '', '', '', '西'],
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
}, },
series: [ series: [
{ {
data: [200, 150, 80, 70, 110, 130], label: {
show: true,
fontSize: 14,
overflow: 'truncate',
position: 'top',
formatter: function (params) {
//
return params.value + '%';
},
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
//
label: {
show: false,
fontSize: 14,
fontWeight: 'bold',
},
},
data: passRates,
//data: result.map((item) => item.passRate),
//data: [200, 150, 80, 70, 110, 130],
type: 'bar', type: 'bar',
}, },
], ],
animationDurationUpdate: 500,
}; };
myChart.setOption(option); myChart.setOption(majorOption);
}, },
dataChart(data, tab) { dataChart(data, tab) {
let seriesData = []; let seriesData = [];
let xData = []; let xData = [];
@ -531,6 +613,7 @@
}, },
]; ];
myChart.setOption(option, true); myChart.setOption(option, true);
// 使 // 使
myChart.on('click', async (params) => { myChart.on('click', async (params) => {
let name = params.name; let name = params.name;
@ -620,6 +703,98 @@
// this.college = [params]; // this.college = [params];
// this.query(tab, this.college, this.entrydate); // this.query(tab, this.college, this.entrydate);
//
let querMajorParam = {
college: [[name]],
entrydate: [this.oneentrydate],
level: 'cet4',
};
let urlMajor = this.Url.getMajorRate;
console.log(querMajorParam, 'querMajorParam');
let resultMajor = await defHttp.post({ url: urlMajor, data: querMajorParam });
console.log(myChart, 'mychart');
if (!resultMajor) {
return;
}
console.log(resultMajor.data, 'resultMajor');
//result = result.data[name];
// result.data
const majors = Object.keys(resultMajor.data); //
const passRates = majors.map((major) => {
const entries = resultMajor.data[major];
return entries.length > 0 ? parseFloat(entries[0].passRate) : 0; //
});
xData = majors.map((label) => label.split('').join('\n')); //x
var majorOption = {
tooltip: {
trigger: 'item',
conginee: false,
//
itemStytle: {
fontSize: 100,
},
},
title: {
text: name + '各专业四级通过率',
textStyle: {
fontSize: 14,
},
},
xAxis: {
type: 'category',
data: xData,
axisLabel: {
interval: 0, //x
//rotate: -10, //30
},
//data: result.map((item) => item.major),
//data: ['', '', '', '', '西'],
},
yAxis: {
type: 'value',
},
series: [
{
//
label: {
show: true,
fontSize: 14,
overflow: 'truncate',
position: 'top',
formatter: function (params) {
//
return params.value + '%';
},
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
//
label: {
show: false,
fontSize: 14,
fontWeight: 'bold',
},
},
data: passRates,
//data: result.map((item) => item.passRate),
//data: [200, 150, 80, 70, 110, 130],
type: 'bar',
},
],
animationDurationUpdate: 500,
};
console.log(majorOption, 'majorOption');
var map3Chart = echarts.init(document.getElementById('map3'));
map3Chart.setOption(majorOption, true);
} }
}); });
}, },

View File

@ -83,6 +83,9 @@
getCollege: '/cet/getCollege', getCollege: '/cet/getCollege',
getRate: '/cet/getRateByAllBatch', getRate: '/cet/getRateByAllBatch',
getCollegeMajor: '/cet/getCollegeMajor', getCollegeMajor: '/cet/getCollegeMajor',
getRateByMajor: '/cet/getgetRateByMajor',
getRateByMajorAndLastestBatch: '/cet/getRateByMajorAndLastestBatch',
getRateByEntryDate: '/cet/getRateByEntryDate',
}, },
loading: false, loading: false,
collegeOptions: [], collegeOptions: [],
@ -182,86 +185,39 @@
myChart.setOption(option); myChart.setOption(option);
}, },
//--- //--
draPieChart_Pass() { async draPieChart_Participate() {
//console.log(this.passRatePie); console.log(this.collegeMajor, 'collegeMajor');
//console.log('piedata', piedata); let college = this.collegeMajor[0];
let myChart = echarts.init(document.getElementById('pass_Piechart')); let major = this.collegeMajor[1];
console.log(college, major, 'college major');
let option = {
tooltip: {
trigger: '',
conginee: false,
//
itemStytle: {
fontSize: 100,
},
},
title: {
//text: '/',
left: 'left',
top: '0%',
textStyle: {
fontSize: 14,
},
},
legend: {
top: '5%',
left: 'center',
},
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
series: [
{
name: '学院/专业每个批次通过人数饼图',
type: 'pie',
radius: ['0', '100%'],
top: 80,
itemStyle: {
borderRadius: 5,
borderColor: '#fff',
borderWideth: 2,
},
label: {
show: true,
fontSize: 14,
overflow: 'truncate',
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
label: {
show: true,
fontSize: 15,
fontWeight: 'bold',
},
},
data: [
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
},
],
};
myChart.setOption(option);
},
//---
draPieChart_Participate() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('participate_Piechart')); let myChart = echarts.init(document.getElementById('participate_Piechart'));
let queryParams = {
college: college,
major: major,
level: 'cet4',
};
let url = this.Url.getRateByMajorAndLastestBatch;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
if (!result) {
return;
}
console.log(result.data, 'result');
// 使 API
let chartData = result.data.map((item) => ({
name: item.entryDate + '级',
value: item.passRate,
}));
let option = { let option = {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
conginee: false, //conginee: false,
// //
itemStytle: { itemStytle: {
// //
@ -272,14 +228,14 @@
fontSize: 100, fontSize: 100,
}, },
}, },
// title: { title: {
// text: '/', text: '最新批次每一年级的通过率饼图',
// left: 'top', left: 'top',
// top: '0%', top: '0%',
// textStyle: { textStyle: {
// fontSize: 12, fontSize: 12,
// }, },
// }, },
legend: { legend: {
top: '5%', top: '5%',
left: 'center', left: 'center',
@ -302,7 +258,7 @@
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'], color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
series: [ series: [
{ {
name: '学院/专业该批次通过人数饼图', name: college + '/' + major + '该批次通过人数饼图',
type: 'pie', type: 'pie',
radius: ['50%', '100%'], radius: ['50%', '100%'],
center: ['50%', '50%'], center: ['50%', '50%'],
@ -337,13 +293,7 @@
fontWeight: 'bold', fontWeight: 'bold',
}, },
}, },
data: [ data: chartData,
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
}, },
{ {
type: 'pie', type: 'pie',
@ -366,13 +316,7 @@
tooltip: { tooltip: {
show: false, show: false,
}, },
data: [ data: chartData,
{ value: 1048, name: '计算机' },
{ value: 735, name: '东语' },
{ value: 580, name: '物理' },
{ value: 484, name: '大数据' },
{ value: 300, name: '树莓' },
],
}, },
], ],
}; };
@ -386,6 +330,142 @@
}); });
}, },
//--/
async draPieChart_Pass() {
//console.log(this.passRatePie);
//console.log('piedata', piedata);
let myChart = echarts.init(document.getElementById('pass_Piechart'));
let college = this.collegeMajor[0];
let major = this.collegeMajor[1];
let queryParams = {
college: college,
major: major,
level: 'cet4',
};
let url = this.Url.getRateByEntryDate;
console.log(queryParams, 'queryParams');
let result = await defHttp.post({ url: url, data: queryParams });
if (!result) {
return;
}
console.log(result, 'result');
// result
let xData = result.data.map((item) => item.entryDate); // X
let values = result.data.map((item) => item.passRate); //
console.log(xData, values, 'xData values');
let option = {
grid: {
left: '15%', //
top: '20%', //
right: '10%', //
bottom: '10%', //
},
tooltip: {
trigger: 'item',
formatter: function (params) {
// %
return `${params.marker}${params.name} ${params.value}%`;
},
},
title: {
text: college + '/' + '每个年级的通过率柱状图',
left: 'left',
top: '0%',
textStyle: {
fontSize: 14,
},
},
xAxis: {
type: 'category',
data: xData,
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value}%', // Y
},
},
series: [
{
data: values,
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)',
},
label: {
show: true, //
position: 'top', //
formatter: '{c}%', //
},
},
],
};
//let option = {
// tooltip: {
// trigger: 'item',
// conginee: false,
// //
// itemStytle: {
// fontSize: 100,
// },
// },
// title: {
// text: '/',
// left: 'left',
// top: '0%',
// textStyle: {
// fontSize: 14,
// },
// },
// legend: {
// top: '5%',
// left: 'center',
// },
// color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
// series: [
// {
// name: '/',
// type: 'pie',
// radius: ['0', '100%'],
// top: 80,
// itemStyle: {
// borderRadius: 5,
// borderColor: '#fff',
// borderWideth: 2,
// },
// label: {
// show: true,
// fontSize: 14,
// overflow: 'truncate',
// },
// emphasis: {
// itemStyle: {
// shadowBlur: 10,
// shadowOffsetX: 0,
// shadowColor: 'rgba(0, 0, 0, 0.5)',
// },
// label: {
// show: true,
// fontSize: 15,
// fontWeight: 'bold',
// },
// },
// data: [
// { value: 1048, name: '' },
// { value: 735, name: '' },
// { value: 580, name: '' },
// { value: 484, name: '' },
// { value: 300, name: '' },
// ],
// },
// ],
//};
myChart.setOption(option);
},
// //
async getBatch() { async getBatch() {
const getBatch = await defHttp.get({ url: this.Url.getBatch }); const getBatch = await defHttp.get({ url: this.Url.getBatch });
@ -440,6 +520,7 @@
level: 'cet4', level: 'cet4',
}; };
data = await defHttp.get({ url: this.Url.getRate, params }); data = await defHttp.get({ url: this.Url.getRate, params });
console.log(data, 'data');
} finally { } finally {
this.loading = false; this.loading = false;
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -79,7 +79,37 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import * as echarts from 'echarts';
import { message } from 'ant-design-vue';
export default {
data() {
return {
activeKey: '1',
allCollege: [],
showBox: false,
showGroup: false,
oneentrydate: null,
collegeentrydate: [],
majorentrydate: [],
lastMajorEntrydate: [],
checkedOptions: [],
collegetab2: [],
collegeMajorOptions: [],
collegeMajor: [],
Url: {
getBatch: '/cet/getBatch',
getEntrydate: '/cet/getEntrydate',
getCollege: '/cet/getCollege',
getCollegeRate: '/cet/getRateByCollege',
getAllRate: '/cet/getAllRate',
getCollegeMajor: '/cet/getCollegeMajor',
getRateByMajor: '/cet/getRateByMajor',
},
tab1loading: false,
tab2loading: false,
tab3loading: false,
export default { export default {
data() { data() {
return { return {
@ -203,6 +233,26 @@
} }
}, },
//
async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor });
//map
this.collegeMajorOptions = res.collegeMajor.map((item) => {
return {
value: item.college,
label: item.college,
children: item.major.map((major) => {
return {
value: major,
label: major,
};
}),
};
});
// this.collegeMajor = [''];
console.log(this.collegeMajor, 'collegeMajor');
console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
},
// //
async getCollegeMajorData() { async getCollegeMajorData() {
const res = await defHttp.get({ url: this.Url.getCollegeMajor }); const res = await defHttp.get({ url: this.Url.getCollegeMajor });
@ -224,11 +274,20 @@
console.log(this.collegeMajorOptions, 'collegeMajorOptions1'); console.log(this.collegeMajorOptions, 'collegeMajorOptions1');
}, },
getCollegeOptions() {
defHttp.get({ url: this.Url.getCollege }).then((res) => {
this.collegeOptions = res.colleges;
//
getCollegeOptions() { getCollegeOptions() {
defHttp.get({ url: this.Url.getCollege }).then((res) => { defHttp.get({ url: this.Url.getCollege }).then((res) => {
this.collegeOptions = res.colleges; this.collegeOptions = res.colleges;
// //
// this.collegeOptions.unshift({ value: '', label: '' });
// this.collegeOptions.forEach(option => {
// if (option.value !== '') {
// option.disabled = true;
//}
// this.collegeOptions.unshift({ value: '', label: '' }); // this.collegeOptions.unshift({ value: '', label: '' });
// this.collegeOptions.forEach(option => { // this.collegeOptions.forEach(option => {
// if (option.value !== '') { // if (option.value !== '') {
@ -324,6 +383,117 @@
this.majorLength--; this.majorLength--;
}, },
// //
onMajorCollegeChange(value) {
let val = value.target.value;
console.log(val, 'value');
console.log(this.collegeMajorOptions.find((item) => item.value == val).children, 'majorOptions');
this.majorOptions = this.collegeMajorOptions.find((item) => item.value == val).children;
//this.majorCheckOnthis.lastCollegeMajorthis.lastCollegeMajorthis.majorCheckOn,
// for (let i = 0; i < this.majorCheckOn.length; i++) {
// if (!this.lastCollegeMajor.includes(this.majorCheckOn[i])) {
// this.lastCollegeMajor.push(this.majorCheckOn[i]);
// }
// }
// for (let i = 0; i < this.lastCollegeMajor.length; i++) {
// if (!this.majorCheckOn.includes(this.lastCollegeMajor[i])) {
// this.lastCollegeMajor.splice(i, 1);
// console.log("splice")
// }
// }
// this.lastCollegeMajor = this.majorCheckOn;
console.log(this.lastCollegeMajor, 'lastCollegeMajor');
this.majorCheckOn = this.lastCollegeMajor.map((item) => item[1]);
console.log(this.majorCheckOn, 'majorCheckOn');
},
// });
// this.college = [''];
// this.collegetab2 = ['', ''];
console.log(this.collegeOptions, 'collegeOptions');
});
},
onMajorEntrydateChange(value) {
console.log(value, 'value');
if (value.length > 5) {
//valuethis.lastMajorEntrydate
for (let i = 0; i < value.length; i++) {
if (!this.lastMajorEntrydate.includes(value[i])) {
message.error('最多选择五个');
//value[i]
value.splice(i, 1);
return;
}
}
}
this.lastMajorEntrydate = value;
},
//
onCollegeChange(value) {
console.log(value, 'value');
if (value.length > 5) {
message.error('最多选择五个');
//lastCollegevaluelastCollege
for (let i = 0; i < value.length; i++) {
if (!this.lastCollege.includes(value[i])) {
value.splice(i, 1);
return;
}
}
return;
}
this.lastCollege = value;
},
//
onCollegeEntrydateChange(value) {
console.log(value, 'value');
if (value.length > 5) {
message.error('最多选择五个');
//lastCollegeEntrydatevaluelastCollegeEntrydate
for (let i = 0; i < value.length; i++) {
if (!this.lastCollegeEntrydate.includes(value[i])) {
value.splice(i, 1);
return;
}
}
return;
}
this.lastCollegeEntrydate = value;
},
//
onCollegeMajorChange(value) {
//valuethis.lastCollegeMajorvaluethis.lastCollegeMajor,this.majorOptionsthis.lastCollegeMajorvalue
for (let i = 0; i < value.length; i++) {
if (!this.lastCollegeMajor.map((item) => item[1]).includes(value[i])) {
if (this.majorLength == 5) {
message.error('最多选择五个');
//valuevalue[i]
value.splice(i, 1);
return;
}
this.lastCollegeMajor.push([this.collegeMajor, value[i]]);
this.majorLength++;
}
}
for (let i = 0; i < this.lastCollegeMajor.length; i++) {
if (!value.includes(this.lastCollegeMajor[i][1])) {
//this.majorOptions
if (this.majorOptions.find((item) => item.value == this.lastCollegeMajor[i][1])) {
this.lastCollegeMajor.splice(i, 1);
console.log('splice');
this.majorLength--;
}
}
}
console.log(value, 'value');
},
removeTag(index) {
if (this.majorCheckOn.includes(this.lastCollegeMajor[index][1])) {
let index1 = this.majorCheckOn.indexOf(this.lastCollegeMajor[index][1]);
this.majorCheckOn.splice(index1, 1);
}
this.lastCollegeMajor.splice(index, 1);
this.majorLength--;
},
//
onMajorCollegeChange(value) { onMajorCollegeChange(value) {
let val = value.target.value; let val = value.target.value;
console.log(val, 'value'); console.log(val, 'value');
@ -347,6 +517,20 @@
console.log(this.majorCheckOn, 'majorCheckOn'); console.log(this.majorCheckOn, 'majorCheckOn');
}, },
clearMajor() {
this.majorCheckOn = [];
this.lastCollegeMajor = [];
this.majorLength = 0;
},
clearCollege() {
this.collegetab2 = [];
this.collegeentrydate = [];
this.lastCollege = [];
this.lastCollegeEntrydate = [];
},
//tab2\3
drawChart(data, tab) {
let seriesData = [];
clearMajor() { clearMajor() {
this.majorCheckOn = []; this.majorCheckOn = [];
this.lastCollegeMajor = []; this.lastCollegeMajor = [];
@ -754,7 +938,21 @@
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
} }
.container {
display: flex;
background-color: #fff;
padding: 15px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
.query {
//
display: flex;
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
.query { .query {
// //
display: flex; display: flex;
@ -763,6 +961,11 @@
margin-left: 24px; margin-left: 24px;
} }
.tab3 {
justify-content: flex-start;
align-items: center;
margin-left: 24px;
}
.tab3 { .tab3 {
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
@ -774,4 +977,9 @@
color: rgb(8, 8, 8); color: rgb(8, 8, 8);
font-weight: bold; font-weight: bold;
} }
.title {
font-size: 34px;
color: rgb(8, 8, 8);
font-weight: bold;
}
</style> </style>

View File

@ -1,9 +1,10 @@
<template> <template>
<div style="background: #ececec; padding-top: 0px;padding-left: 20px;padding-right: 20px;padding-bottom: 20px;"> <div style="background: #ececec; padding-top: 0px; padding-left: 20px; padding-right: 20px; padding-bottom: 20px">
    <a-card title="考场座位查询" :bordered="false">    
<a-card title="考场座位查询" :bordered="false">
<a-row> <a-row>
<a-col :span="5"> <a-col :span="5">
<locationaTree ref="locationaTrees" :height="700" @onSelect="onSelect"></locationaTree> <locationaTree ref="locationaTrees" :height="700" @on-select="onSelect" />
</a-col> </a-col>
<a-col :span="19"> <a-col :span="19">
<!--引用表格--> <!--引用表格-->
@ -12,19 +13,19 @@
<template #tableTitle> <template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
@click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item key="1" @click="batchHandleDelete"> <a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon> <Icon icon="ant-design:delete-outlined" />
删除 删除
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</template> </template>
<a-button>批量操作 <a-button
<Icon icon="mdi:chevron-down"></Icon> >批量操作
<Icon icon="mdi:chevron-down" />
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<!-- 高级查询 --> <!-- 高级查询 -->
@ -35,11 +36,10 @@
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" /> <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template> </template>
<!--字段回显插槽--> <!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }"> <template #bodyCell="{ column, record, index, text }"> </template>
</template>
</BasicTable> </BasicTable>
<!-- 表单区域 --> <!-- 表单区域 -->
<CetLocationModal @register="registerModal" @success="handleSuccess"></CetLocationModal> <CetLocationModal @register="registerModal" @success="handleSuccess" />
</a-col> </a-col>
</a-row> </a-row>
</a-card> </a-card>
@ -50,9 +50,9 @@
import { ref, reactive, computed, unref } from 'vue'; import { ref, reactive, computed, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage' import { useListPage } from '/@/hooks/system/useListPage';
import CetLocationModal from './components/CetLocationModal.vue' import CetLocationModal from './components/CetLocationModal.vue';
import locationaTree from './components/locationaTree.vue' import locationaTree from './components/locationaTree.vue';
import { columns, searchFormSchema, superQuerySchema } from './CetLocation.data'; import { columns, searchFormSchema, superQuerySchema } from './CetLocation.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetLocation.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetLocation.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
@ -75,31 +75,29 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
schemas: searchFormSchema, schemas: searchFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
showAdvancedButton: true, showAdvancedButton: true,
fieldMapToNumber: [ fieldMapToNumber: [],
], fieldMapToTime: [],
fieldMapToTime: [
],
}, },
actionColumn: { actionColumn: {
width: 120, width: 120,
fixed: 'right' fixed: 'right',
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
return Object.assign(params, queryParam); return Object.assign(params, queryParam);
}, },
}, },
exportConfig: { exportConfig: {
name: "cet_location", name: 'cet_location',
url: getExportUrl, url: getExportUrl,
params: queryParam, params: queryParam,
}, },
importConfig: { importConfig: {
url: getImportUrl, url: getImportUrl,
success: handleSuccess success: handleSuccess,
}, },
}) });
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
// //
const superQueryConfig = reactive(superQuerySchema); const superQueryConfig = reactive(superQuerySchema);
@ -118,10 +116,10 @@ function handleSuperQuery(params) {
*/ */
function onSelect(selectedRowKeys) { function onSelect(selectedRowKeys) {
// //
selectedRowKeys = selectedRowKeys.join(',') selectedRowKeys = selectedRowKeys.join(',');
console.log(selectedRowKeys) console.log(selectedRowKeys);
queryParam.id = selectedRowKeys queryParam.id = selectedRowKeys;
reload() reload();
} }
/** /**
* 新增事件 * 新增事件
@ -178,8 +176,8 @@ function getTableAction(record) {
{ {
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
} },
] ];
} }
/** /**
* 下拉操作栏 * 下拉操作栏
@ -189,18 +187,17 @@ function getDropDownAction(record) {
{ {
label: '详情', label: '详情',
onClick: handleDetail.bind(null, record), onClick: handleDetail.bind(null, record),
}, { },
{
label: '删除', label: '删除',
popConfirm: { popConfirm: {
title: '是否确认删除', title: '是否确认删除',
confirm: handleDelete.bind(null, record), confirm: handleDelete.bind(null, record),
placement: 'topLeft', placement: 'topLeft',
},
},
];
} }
}
]
}
</script> </script>
<style scoped></style> <style scoped></style>