fix:多选改checkbox

This commit is contained in:
zhongzm
2024-10-18 10:32:55 +08:00
parent d07230b582
commit 671c80972e
2 changed files with 111 additions and 74 deletions

View File

@@ -251,14 +251,14 @@ function fnGetListTitle() {
// 获取表头文字
getKPITitle(state.neType[0])
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
tableColumns.value = [];
const columns: ColumnsType = [];
for (const item of res.data) {
const kpiDisplay = item[`${language}Title`];
.then(res => {//处理getKPITitle返回的结果
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {//检查值
tableColumns.value = [];//设为空数组
const columns: ColumnsType = [];//初始化,构建新表头
for (const item of res.data) {//遍历res.data
const kpiDisplay = item[`${language}Title`];//提取标题kpiDisplay和ID标识kpiValue
const kpiValue = item[`kpiId`];
columns.push({
columns.push({//
title: kpiDisplay,
dataIndex: kpiValue,
align: 'left',
@@ -297,7 +297,7 @@ function fnGetListTitle() {
return false;
}
})
.then(result => {
.then(result => {//result是前一个.then返回的值(true or false)
result && fnGetList();
});
}
@@ -334,27 +334,27 @@ function fnChangShowType() {
/**绘制图表 */
function fnRanderChart() {
const container: HTMLElement | undefined = kpiChartDom.value;
if (!container) return;
const container: HTMLElement | undefined = kpiChartDom.value;//获取图表容器DOM元素
if (!container) return;//若没有,则退出函数
kpiChart.value = markRaw(echarts.init(container, 'light'));
const option: EChartsOption = {
//初始化Echarts图表实例应用light主题并赋值给kpiChart.valuemarkRaw是vue函数用于标记对象为不可响应
const option: EChartsOption = {//定义图表的配置对象tooltip的出发方式为axis
tooltip: {
trigger: 'axis',
position: function (pt: any) {
return [pt[0], '10%'];
},
},
xAxis: {
xAxis: {//x类别轴
type: 'category',
boundaryGap: false,
data: [], // 数据x轴
},
yAxis: {
yAxis: {//y类别轴
type: 'value',
boundaryGap: [0, '100%'],
},
legend: {
legend: {//图例垂直滚动
type: 'scroll',
orient: 'vertical',
top: 40,
@@ -367,13 +367,13 @@ function fnRanderChart() {
icon: 'circle',
selected: {},
},
grid: {
grid: {//网格区域边距
left: '10%',
right: '30%',
bottom: '20%',
},
dataZoom: [
{
{//启用图表的数据缩放范围90%-100%
type: 'inside',
start: 90,
end: 100,
@@ -385,9 +385,9 @@ function fnRanderChart() {
],
series: [], // 数据y轴
};
kpiChart.value.setOption(option);
kpiChart.value.setOption(option);//设置图表配置项应用到kpiChart实例上
// 创建 ResizeObserver 实例
// 创建 ResizeObserver 实例 监听图表容器大小变化,并在变化时调整图表大小
var observer = new ResizeObserver(entries => {
if (kpiChart.value) {
kpiChart.value.resize();
@@ -452,6 +452,7 @@ function fnRanderChartData() {
// 用降序就反转
let orgData = tableState.data;
console.log(orgData);
if (queryParams.sortOrder === 'desc') {
orgData = orgData.toReversed();
}