feature/1.0版本页面优化 #1
|
@ -67,6 +67,10 @@
|
|||
getCollegeRate: '/cet/getRateByCollege',
|
||||
getAllRate: '/cet/getAllRate',
|
||||
getCollegeMajor: '/cet/getCollegeMajor',
|
||||
|
||||
getMajor: '/cet/getMajorByCollege',
|
||||
getMajorRate: '/cet/getRateByMajor',
|
||||
|
||||
getRateByMajor: '/cet/getRateByMajor',
|
||||
},
|
||||
map1loading: false,
|
||||
|
@ -114,6 +118,8 @@
|
|||
this.oneentrydate = '2017';
|
||||
}
|
||||
this.query(query, college, [this.oneentrydate]);
|
||||
this.majorPassRate();
|
||||
this.gradePassRate();
|
||||
},
|
||||
async majorQuery() {
|
||||
if (this.majorentrydate.length == 0) {
|
||||
|
@ -254,32 +260,108 @@
|
|||
};
|
||||
myChart.setOption(collegeOption);
|
||||
},
|
||||
|
||||
// 各专业通过率
|
||||
majorPassRate() {
|
||||
async majorPassRate() {
|
||||
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: {
|
||||
text: '西语学院各专业四级通过率',
|
||||
text: name + '各专业四级通过率',
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['英语', '翻译', '法语', '葡萄牙语', '西班牙语'],
|
||||
data: xData,
|
||||
axisLabel: {
|
||||
interval: 0, //代表显示所有x轴标签显示
|
||||
//rotate: -10, //代表倾斜30度显示
|
||||
},
|
||||
//data: result.map((item) => item.major),
|
||||
//data: ['英语', '翻译', '法语', '葡萄牙语', '西班牙语'],
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
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',
|
||||
},
|
||||
],
|
||||
animationDurationUpdate: 500,
|
||||
};
|
||||
myChart.setOption(option);
|
||||
myChart.setOption(majorOption);
|
||||
},
|
||||
|
||||
dataChart(data, tab) {
|
||||
let seriesData = [];
|
||||
let xData = [];
|
||||
|
@ -531,6 +613,7 @@
|
|||
},
|
||||
];
|
||||
myChart.setOption(option, true);
|
||||
|
||||
// 使用刚指定的配置项和数据显示图表。
|
||||
myChart.on('click', async (params) => {
|
||||
let name = params.name;
|
||||
|
@ -620,6 +703,98 @@
|
|||
// this.college = [params];
|
||||
|
||||
// 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);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -83,6 +83,9 @@
|
|||
getCollege: '/cet/getCollege',
|
||||
getRate: '/cet/getRateByAllBatch',
|
||||
getCollegeMajor: '/cet/getCollegeMajor',
|
||||
getRateByMajor: '/cet/getgetRateByMajor',
|
||||
getRateByMajorAndLastestBatch: '/cet/getRateByMajorAndLastestBatch',
|
||||
getRateByEntryDate: '/cet/getRateByEntryDate',
|
||||
},
|
||||
loading: false,
|
||||
collegeOptions: [],
|
||||
|
@ -182,86 +185,39 @@
|
|||
myChart.setOption(option);
|
||||
},
|
||||
|
||||
//绘画饼图--每个批次通过-数据分析
|
||||
draPieChart_Pass() {
|
||||
//console.log(this.passRatePie);
|
||||
//console.log('piedata', piedata);
|
||||
let myChart = echarts.init(document.getElementById('pass_Piechart'));
|
||||
//绘画饼图--最新批次每一年级的通过率饼图
|
||||
async draPieChart_Participate() {
|
||||
console.log(this.collegeMajor, 'collegeMajor');
|
||||
let college = this.collegeMajor[0];
|
||||
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 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 = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
conginee: false,
|
||||
//conginee: false,
|
||||
//字体大小
|
||||
itemStytle: {
|
||||
// 设置阴影效果
|
||||
|
@ -272,14 +228,14 @@
|
|||
fontSize: 100,
|
||||
},
|
||||
},
|
||||
// title: {
|
||||
// text: '学院/专业该批次通过人数饼图',
|
||||
// left: 'top',
|
||||
// top: '0%',
|
||||
// textStyle: {
|
||||
// fontSize: 12,
|
||||
// },
|
||||
// },
|
||||
title: {
|
||||
text: '最新批次每一年级的通过率饼图',
|
||||
left: 'top',
|
||||
top: '0%',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'center',
|
||||
|
@ -302,7 +258,7 @@
|
|||
color: ['#b3cde0', '#6497b1', '#005b96', '#03396c', '#e5e5e5'],
|
||||
series: [
|
||||
{
|
||||
name: '学院/专业该批次通过人数饼图',
|
||||
name: college + '/' + major + '该批次通过人数饼图',
|
||||
type: 'pie',
|
||||
radius: ['50%', '100%'],
|
||||
center: ['50%', '50%'],
|
||||
|
@ -337,13 +293,7 @@
|
|||
fontWeight: 'bold',
|
||||
},
|
||||
},
|
||||
data: [
|
||||
{ value: 1048, name: '计算机' },
|
||||
{ value: 735, name: '东语' },
|
||||
{ value: 580, name: '物理' },
|
||||
{ value: 484, name: '大数据' },
|
||||
{ value: 300, name: '树莓' },
|
||||
],
|
||||
data: chartData,
|
||||
},
|
||||
{
|
||||
type: 'pie',
|
||||
|
@ -366,13 +316,7 @@
|
|||
tooltip: {
|
||||
show: false,
|
||||
},
|
||||
data: [
|
||||
{ value: 1048, name: '计算机' },
|
||||
{ value: 735, name: '东语' },
|
||||
{ value: 580, name: '物理' },
|
||||
{ value: 484, name: '大数据' },
|
||||
{ value: 300, name: '树莓' },
|
||||
],
|
||||
data: chartData,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@ -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() {
|
||||
const getBatch = await defHttp.get({ url: this.Url.getBatch });
|
||||
|
@ -440,6 +520,7 @@
|
|||
level: 'cet4',
|
||||
};
|
||||
data = await defHttp.get({ url: this.Url.getRate, params });
|
||||
console.log(data, 'data');
|
||||
} finally {
|
||||
this.loading = false;
|
||||
this.$nextTick(() => {
|
||||
|
|
|
@ -71,14 +71,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import * as echarts from 'echarts';
|
||||
import bar from '/@/components/Scrollbar/src/bar';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { last } from 'xe-utils';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import * as echarts from 'echarts';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
export default {
|
||||
name: 'Analysis',
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activeKey: '1',
|
||||
|
@ -129,6 +126,13 @@ export default {
|
|||
lastCollegeEntrydate: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getCollegeOptions();
|
||||
// this.getBatch();
|
||||
this.getEntrydate();
|
||||
this.allQuery();
|
||||
this.getCollegeMajorData();
|
||||
},
|
||||
methods: {
|
||||
onMajorChange(value) {
|
||||
console.log(value, 'value');
|
||||
|
@ -888,42 +892,35 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getCollegeOptions();
|
||||
// this.getBatch();
|
||||
this.getEntrydate();
|
||||
this.allQuery();
|
||||
this.getCollegeMajorData();
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container {
|
||||
.container {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
|
||||
}
|
||||
}
|
||||
|
||||
.query {
|
||||
.query {
|
||||
//居左
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.tab3 {
|
||||
.tab3 {
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
.title {
|
||||
font-size: 34px;
|
||||
color: rgb(8, 8, 8);
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<div style="background: #ececec; padding-top: 0px;padding-left: 20px;padding-right: 20px;padding-bottom: 20px;">
|
||||
<a-card title="考场座位查询" :bordered="false">
|
||||
<div style="background: #ececec; padding-top: 0px; padding-left: 20px; padding-right: 20px; padding-bottom: 20px">
|
||||
|
||||
<a-card title="考场座位查询" :bordered="false">
|
||||
<a-row>
|
||||
<a-col :span="5">
|
||||
<locationaTree ref="locationaTrees" :height="700" @onSelect="onSelect"></locationaTree>
|
||||
<locationaTree ref="locationaTrees" :height="700" @on-select="onSelect" />
|
||||
</a-col>
|
||||
<a-col :span="19">
|
||||
<!--引用表格-->
|
||||
|
@ -12,19 +13,19 @@
|
|||
<template #tableTitle>
|
||||
<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>
|
||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined"
|
||||
@click="onImportXls">导入</j-upload-button>
|
||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<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>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
<a-button
|
||||
>批量操作
|
||||
<Icon icon="mdi:chevron-down" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
|
@ -35,11 +36,10 @@
|
|||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index, text }"> </template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<CetLocationModal @register="registerModal" @success="handleSuccess"></CetLocationModal>
|
||||
<CetLocationModal @register="registerModal" @success="handleSuccess" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
|
@ -47,24 +47,24 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="CET-cetLocation" setup>
|
||||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage'
|
||||
import CetLocationModal from './components/CetLocationModal.vue'
|
||||
import locationaTree from './components/locationaTree.vue'
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CetLocation.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetLocation.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { ref, reactive, computed, unref } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import CetLocationModal from './components/CetLocationModal.vue';
|
||||
import locationaTree from './components/locationaTree.vue';
|
||||
import { columns, searchFormSchema, superQuerySchema } from './CetLocation.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './CetLocation.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
const queryParam = reactive<any>({});
|
||||
const checkedKeys = ref<Array<string | number>>([]);
|
||||
const userStore = useUserStore();
|
||||
//注册model
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'cet_location',
|
||||
api: list,
|
||||
|
@ -75,132 +75,129 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
schemas: searchFormSchema,
|
||||
autoSubmitOnEnter: true,
|
||||
showAdvancedButton: true,
|
||||
fieldMapToNumber: [
|
||||
],
|
||||
fieldMapToTime: [
|
||||
],
|
||||
fieldMapToNumber: [],
|
||||
fieldMapToTime: [],
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right'
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "cet_location",
|
||||
name: 'cet_location',
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
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);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
reload();
|
||||
}
|
||||
/*
|
||||
}
|
||||
/*
|
||||
* 树查询
|
||||
*/
|
||||
function onSelect(selectedRowKeys) {
|
||||
function onSelect(selectedRowKeys) {
|
||||
//将其切分为字符串
|
||||
selectedRowKeys = selectedRowKeys.join(',')
|
||||
console.log(selectedRowKeys)
|
||||
queryParam.id = selectedRowKeys
|
||||
reload()
|
||||
}
|
||||
/**
|
||||
selectedRowKeys = selectedRowKeys.join(',');
|
||||
console.log(selectedRowKeys);
|
||||
queryParam.id = selectedRowKeys;
|
||||
reload();
|
||||
}
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
function handleAdd() {
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
function handleEdit(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: true,
|
||||
});
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
openModal(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
showFooter: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
/**
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
]
|
||||
}
|
||||
/**
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Loading…
Reference in New Issue