|
|
@@ -20,17 +20,40 @@
|
|
|
<el-tooltip
|
|
|
content="添加纬度"
|
|
|
placement="bottom-start"
|
|
|
- v-if="curEdit.type === 'scatter' || curEdit.type === 'radar'"
|
|
|
+ v-if="
|
|
|
+ curEdit.type === 'scatter' ||
|
|
|
+ curEdit.type === 'radar' ||
|
|
|
+ curEdit.type === 'sankeyDiagram' ||
|
|
|
+ curEdit.type === 'Heatmap'
|
|
|
+ "
|
|
|
>
|
|
|
<i
|
|
|
- @click="
|
|
|
- formLabelAlign.Xdata.push({ lable: '', data: [], id: '' })
|
|
|
- "
|
|
|
+ @click="handleLatitude('init')"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
style="font-size: 20px"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
+ <el-tooltip
|
|
|
+ content="按顺序添加纬度,不添加则不显示图表"
|
|
|
+ placement="bottom-start"
|
|
|
+ v-if="
|
|
|
+ curEdit.type === 'sankeyDiagram' || curEdit.type === 'Heatmap'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-if="curEdit.type === 'sankeyDiagram'"
|
|
|
+ style="color: red; font-size: 12px"
|
|
|
+ >
|
|
|
+ 源纬度-目标纬度
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="curEdit.type === 'Heatmap'"
|
|
|
+ style="color: red; font-size: 12px"
|
|
|
+ >
|
|
|
+ 横轴纬度-纵轴纬度
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
<template v-for="(item, ind) in formLabelAlign.Xdata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
@@ -45,11 +68,16 @@
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
- v-if="curEdit.type === 'scatter' || curEdit.type === 'radar'"
|
|
|
+ v-if="
|
|
|
+ curEdit.type === 'scatter' ||
|
|
|
+ curEdit.type === 'radar' ||
|
|
|
+ curEdit.type === 'sankeyDiagram' ||
|
|
|
+ curEdit.type === 'Heatmap'
|
|
|
+ "
|
|
|
:content="
|
|
|
formLabelAlign.Xdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
@@ -81,7 +109,16 @@
|
|
|
"
|
|
|
>
|
|
|
<span>指标值</span>
|
|
|
- <el-tooltip content="添加指标值" placement="bottom-start">
|
|
|
+ <el-tooltip
|
|
|
+ content="添加指标值"
|
|
|
+ placement="bottom-start"
|
|
|
+ v-if="
|
|
|
+ curEdit.type !== 'roseChart' &&
|
|
|
+ curEdit.type !== 'pie' &&
|
|
|
+ curEdit.type !== 'sankeyDiagram' &&
|
|
|
+ curEdit.type !== 'Heatmap'
|
|
|
+ "
|
|
|
+ >
|
|
|
<i
|
|
|
@click="handleMetrics('init')"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
@@ -89,6 +126,16 @@
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
+ <el-tooltip
|
|
|
+ content="按顺序添加指标值,不添加则不显示图表"
|
|
|
+ placement="bottom-start"
|
|
|
+ v-if="curEdit.type === 'boxPlot'"
|
|
|
+ >
|
|
|
+ <div style="color: red; font-size: 12px">
|
|
|
+ 最小值-Q1-中位数-Q3-最大值
|
|
|
+ </div>
|
|
|
+ </el-tooltip>
|
|
|
+
|
|
|
<template v-for="(item, ind) in formLabelAlign.Ydata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
@@ -103,10 +150,16 @@
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="
|
|
|
+ curEdit.type !== 'roseChart' &&
|
|
|
+ curEdit.type !== 'pie' &&
|
|
|
+ curEdit.type !== 'sankeyDiagram' &&
|
|
|
+ curEdit.type !== 'Heatmap'
|
|
|
+ "
|
|
|
:content="
|
|
|
formLabelAlign.Ydata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
@@ -129,8 +182,10 @@
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
- <el-form-item v-if="curEdit.type === 'pareto'" label="柱纬度标签">
|
|
|
+ <el-form-item
|
|
|
+ v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
|
|
|
+ label="线纬度标签"
|
|
|
+ >
|
|
|
<div
|
|
|
slot="label"
|
|
|
style="
|
|
|
@@ -139,37 +194,37 @@
|
|
|
justify-content: space-between;
|
|
|
"
|
|
|
>
|
|
|
- <span>柱纬度标签</span>
|
|
|
- <el-tooltip content="添加纬度" placement="bottom-start">
|
|
|
+ <span>线纬度标签</span>
|
|
|
+ <!-- <el-tooltip content="添加纬度" placement="bottom-start">
|
|
|
<i
|
|
|
@click="
|
|
|
- formLabelAlign.BarXdata.push({ lable: '', data: [], id: '' })
|
|
|
+ formLabelAlign.LineXdata.push({ lable: '', data: [], id: '' })
|
|
|
"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
style="font-size: 20px"
|
|
|
></i>
|
|
|
- </el-tooltip>
|
|
|
+ </el-tooltip> -->
|
|
|
</div>
|
|
|
- <template v-for="(item, ind) in formLabelAlign.BarXdata">
|
|
|
+ <template v-for="(item, ind) in formLabelAlign.LineXdata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
style="margin: 5px 0"
|
|
|
:key="ind + 'select'"
|
|
|
- v-model="formLabelAlign.BarXdata[ind].id"
|
|
|
+ v-model="formLabelAlign.LineXdata[ind].id"
|
|
|
placeholder="请先进行数据配置"
|
|
|
:disabled="disabled"
|
|
|
- @change="handleXdata('bar')"
|
|
|
+ @change="handleXdata('line')"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <el-tooltip
|
|
|
+ <!-- <el-tooltip
|
|
|
:content="
|
|
|
- formLabelAlign.BarXdata.length <= 1
|
|
|
+ formLabelAlign.LineXdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -177,19 +232,22 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- :disabled="formLabelAlign.BarXdata.length <= 1"
|
|
|
- @click="removeXdata(ind, 'bar')"
|
|
|
+ :disabled="formLabelAlign.LineXdata.length <= 1"
|
|
|
+ @click="removeXdata(ind, 'line')"
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-delete"
|
|
|
style="font-size: 16px; color: red; padding: 0 0 0 10px"
|
|
|
></i
|
|
|
></el-button>
|
|
|
- </el-tooltip>
|
|
|
+ </el-tooltip> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="curEdit.type === 'pareto'" label="柱指标值">
|
|
|
+ <el-form-item
|
|
|
+ v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
|
|
|
+ label="线指标值"
|
|
|
+ >
|
|
|
<div
|
|
|
slot="label"
|
|
|
style="
|
|
|
@@ -198,35 +256,40 @@
|
|
|
justify-content: space-between;
|
|
|
"
|
|
|
>
|
|
|
- <span>柱指标值</span>
|
|
|
- <el-tooltip content="添加柱指标值" placement="bottom-start">
|
|
|
+ <span>线指标值</span>
|
|
|
+ <el-tooltip
|
|
|
+ content="添加线指标值"
|
|
|
+ placement="bottom-start"
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
+ >
|
|
|
<i
|
|
|
- @click="handleMetrics('bar')"
|
|
|
+ @click="handleMetrics('line')"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
style="font-size: 20px"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <template v-for="(item, ind) in formLabelAlign.BarYdata">
|
|
|
+ <template v-for="(item, ind) in formLabelAlign.LineYdata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
style="margin: 5px 0"
|
|
|
:key="ind + 'select' + 'zhibiao'"
|
|
|
- v-model="formLabelAlign.BarYdata[ind].id"
|
|
|
+ v-model="formLabelAlign.LineYdata[ind].id"
|
|
|
placeholder="请先进行数据配置"
|
|
|
:disabled="disabled"
|
|
|
- @change="handleYdata(ind, 'bar')"
|
|
|
+ @change="handleYdata(ind, 'line')"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.BarYdata.length <= 1
|
|
|
+ formLabelAlign.LineYdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -234,8 +297,8 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- :disabled="formLabelAlign.BarYdata.length <= 1"
|
|
|
- @click="removeYdata(ind, 'bar')"
|
|
|
+ :disabled="formLabelAlign.LineYdata.length <= 1"
|
|
|
+ @click="removeYdata(ind, 'line')"
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-delete"
|
|
|
@@ -246,10 +309,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
|
|
|
- label="线纬度标签"
|
|
|
- >
|
|
|
+ <el-form-item v-if="curEdit.type === 'pareto'" label="柱纬度标签">
|
|
|
<div
|
|
|
slot="label"
|
|
|
style="
|
|
|
@@ -258,37 +318,42 @@
|
|
|
justify-content: space-between;
|
|
|
"
|
|
|
>
|
|
|
- <span>线纬度标签</span>
|
|
|
- <el-tooltip content="添加纬度" placement="bottom-start">
|
|
|
+ <span>柱纬度标签</span>
|
|
|
+ <el-tooltip
|
|
|
+ content="添加纬度"
|
|
|
+ placement="bottom-start"
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
+ >
|
|
|
<i
|
|
|
@click="
|
|
|
- formLabelAlign.LineXdata.push({ lable: '', data: [], id: '' })
|
|
|
+ formLabelAlign.BarXdata.push({ lable: '', data: [], id: '' })
|
|
|
"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
style="font-size: 20px"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <template v-for="(item, ind) in formLabelAlign.LineXdata">
|
|
|
+ <template v-for="(item, ind) in formLabelAlign.BarXdata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
style="margin: 5px 0"
|
|
|
:key="ind + 'select'"
|
|
|
- v-model="formLabelAlign.LineXdata[ind].id"
|
|
|
+ v-model="formLabelAlign.BarXdata[ind].id"
|
|
|
placeholder="请先进行数据配置"
|
|
|
:disabled="disabled"
|
|
|
- @change="handleXdata('line')"
|
|
|
+ @change="handleXdata('bar')"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.LineXdata.length <= 1
|
|
|
+ formLabelAlign.BarXdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -296,8 +361,8 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- :disabled="formLabelAlign.LineXdata.length <= 1"
|
|
|
- @click="removeXdata(ind, 'line')"
|
|
|
+ :disabled="formLabelAlign.BarXdata.length <= 1"
|
|
|
+ @click="removeXdata(ind, 'bar')"
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-delete"
|
|
|
@@ -308,10 +373,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="curEdit.type === 'pareto' || curEdit.type === 'Cp'"
|
|
|
- label="线指标值"
|
|
|
- >
|
|
|
+ <el-form-item v-if="curEdit.type === 'pareto'" label="柱指标值">
|
|
|
<div
|
|
|
slot="label"
|
|
|
style="
|
|
|
@@ -320,35 +382,40 @@
|
|
|
justify-content: space-between;
|
|
|
"
|
|
|
>
|
|
|
- <span>线指标值</span>
|
|
|
- <el-tooltip content="添加线指标值" placement="bottom-start">
|
|
|
+ <span>柱指标值</span>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
+ content="添加柱指标值"
|
|
|
+ placement="bottom-start"
|
|
|
+ >
|
|
|
<i
|
|
|
- @click="handleMetrics('line')"
|
|
|
+ @click="handleMetrics('bar')"
|
|
|
class="el-icon-circle-plus-outline"
|
|
|
style="font-size: 20px"
|
|
|
></i>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <template v-for="(item, ind) in formLabelAlign.LineYdata">
|
|
|
+ <template v-for="(item, ind) in formLabelAlign.BarYdata">
|
|
|
<div class="attributeItemData">
|
|
|
<el-select
|
|
|
style="margin: 5px 0"
|
|
|
:key="ind + 'select' + 'zhibiao'"
|
|
|
- v-model="formLabelAlign.LineYdata[ind].id"
|
|
|
+ v-model="formLabelAlign.BarYdata[ind].id"
|
|
|
placeholder="请先进行数据配置"
|
|
|
:disabled="disabled"
|
|
|
- @change="handleYdata(ind, 'line')"
|
|
|
+ @change="handleYdata(ind, 'bar')"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.LineYdata.length <= 1
|
|
|
+ formLabelAlign.BarYdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -356,8 +423,8 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- :disabled="formLabelAlign.LineYdata.length <= 1"
|
|
|
- @click="removeYdata(ind, 'line')"
|
|
|
+ :disabled="formLabelAlign.BarYdata.length <= 1"
|
|
|
+ @click="removeYdata(ind, 'bar')"
|
|
|
>
|
|
|
<i
|
|
|
class="el-icon-delete"
|
|
|
@@ -406,7 +473,7 @@
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
@@ -463,7 +530,7 @@
|
|
|
v-for="item in selectData"
|
|
|
:label="item.label"
|
|
|
:value="item.id"
|
|
|
- :key="item.id"
|
|
|
+ :key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
@@ -493,26 +560,45 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
label="X轴名称"
|
|
|
- v-if="curEdit.type !== 'pie' && curEdit.type !== 'radar'"
|
|
|
+ v-if="
|
|
|
+ curEdit.type !== 'pie' &&
|
|
|
+ curEdit.type !== 'radar' &&
|
|
|
+ curEdit.type !== 'roseChart' &&
|
|
|
+ curEdit.type !== 'sankeyDiagram'
|
|
|
+ "
|
|
|
>
|
|
|
<el-input v-model="formLabelAlign.Xlable"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
label="Y轴名称"
|
|
|
- v-if="curEdit.type !== 'pie' && curEdit.type !== 'radar'"
|
|
|
+ v-if="
|
|
|
+ curEdit.type !== 'pie' &&
|
|
|
+ curEdit.type !== 'radar' &&
|
|
|
+ curEdit.type !== 'roseChart' &&
|
|
|
+ curEdit.type !== 'pareto' &&
|
|
|
+ curEdit.type !== 'sankeyDiagram'
|
|
|
+ "
|
|
|
>
|
|
|
<el-input v-model="formLabelAlign.Ylable"></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="柱Y轴名称" v-if="curEdit.type === 'pareto'">
|
|
|
+ <el-input v-model="formLabelAlign.YRightLable"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="线Y轴名称" v-if="curEdit.type === 'pareto'">
|
|
|
+ <el-input v-model="formLabelAlign.YLeftLable"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div style="margin: 20px 0">
|
|
|
<el-divider style="height: 2px"></el-divider>
|
|
|
</div>
|
|
|
- <el-collapse v-if="formLabelAlign.Ydata[0].data.length > 0">
|
|
|
+ <el-collapse
|
|
|
+ v-if="filteredYData.length > 0 && filteredYData[0].data.length > 0"
|
|
|
+ >
|
|
|
<el-collapse-item
|
|
|
- v-for="(itemFilter, filterInd) in formLabelAlign.Ydata"
|
|
|
+ v-for="(itemFilter, filterInd) in filteredYData"
|
|
|
:title="itemFilter.label || `数据筛选`"
|
|
|
:name="itemFilter.id"
|
|
|
- :key="itemFilter.id"
|
|
|
+ :key="itemFilter.id + filterInd"
|
|
|
>
|
|
|
<el-form
|
|
|
label-position="top"
|
|
|
@@ -596,8 +682,16 @@ import {
|
|
|
handleScatterChartLogic,
|
|
|
handleRadarChartLogic,
|
|
|
handleCpChartLogic,
|
|
|
+ handleRoseChartChartLogic,
|
|
|
+ handlePieChartLogic,
|
|
|
+ handlestackedBarChartLogic,
|
|
|
+ handleParetoChartLogic,
|
|
|
+ handleBoxPlotChartLogic,
|
|
|
+ handleSankeyDiagramPlotChartLogic,
|
|
|
+ handleHeatmapPlotChartLogic,
|
|
|
} from "./chartLogic/index";
|
|
|
import Vue from "vue";
|
|
|
+import { constructNow } from "date-fns";
|
|
|
export default {
|
|
|
name: "title",
|
|
|
props: {
|
|
|
@@ -699,6 +793,8 @@ export default {
|
|
|
text: "",
|
|
|
Xlable: "",
|
|
|
Ylable: "",
|
|
|
+ YRightLable: "",
|
|
|
+ YLeftLable: "",
|
|
|
},
|
|
|
disabled: true,
|
|
|
selectData: [], //可选择的数据
|
|
|
@@ -709,8 +805,33 @@ export default {
|
|
|
currentChartList: "currentChartList",
|
|
|
dataBaseCheckList: "dataBaseCheckList",
|
|
|
}),
|
|
|
+ filteredYData() {
|
|
|
+ const { type } = this.curEdit;
|
|
|
+ const { BarYdata, LineYdata, ScatterYdata, Ydata } = this.formLabelAlign;
|
|
|
+ if (type === "pareto") {
|
|
|
+ console.log([...BarYdata, ...LineYdata], "[...BarYdata, ...LineYdata]");
|
|
|
+ return [...LineYdata, ...BarYdata];
|
|
|
+ } else if (type === "Cp") {
|
|
|
+ return [...LineYdata, ...ScatterYdata];
|
|
|
+ } else if (
|
|
|
+ [
|
|
|
+ "bar",
|
|
|
+ "line",
|
|
|
+ "radar",
|
|
|
+ "scatter",
|
|
|
+ "pie",
|
|
|
+ "roseChart",
|
|
|
+ "stackedBar",
|
|
|
+ "boxPlot",
|
|
|
+ "sankeyDiagram",
|
|
|
+ "Heatmap",
|
|
|
+ ].includes(type)
|
|
|
+ ) {
|
|
|
+ return Ydata;
|
|
|
+ }
|
|
|
+ return []; // 默认返回空数组
|
|
|
+ },
|
|
|
},
|
|
|
-
|
|
|
watch: {
|
|
|
curEdit() {
|
|
|
this.changeData();
|
|
|
@@ -736,18 +857,44 @@ export default {
|
|
|
deep: true, // 深度监听
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.changeData();
|
|
|
- },
|
|
|
methods: {
|
|
|
...mapMutations("dragChart", [
|
|
|
"updateChart",
|
|
|
"setCurEdit",
|
|
|
"setFormFilterAlignData",
|
|
|
]),
|
|
|
+ handleLatitude(type) {
|
|
|
+ switch (type) {
|
|
|
+ case "init":
|
|
|
+ console.log(this.curEdit.type, this.formLabelAlign.Xdata.length);
|
|
|
+ if (
|
|
|
+ (this.curEdit.type === "sankeyDiagram" ||
|
|
|
+ this.curEdit.type === "Heatmap") &&
|
|
|
+ this.formLabelAlign.Xdata.length >= 2
|
|
|
+ ) {
|
|
|
+ this.$message.warning(
|
|
|
+ "纬度请根据上方红色字提示的进行添加且只能添加两个纬度标签"
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.formLabelAlign.Xdata.push({ lable: "", data: [], id: "" });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
handleMetrics(type) {
|
|
|
+ console.log(type, "tianjia yige");
|
|
|
switch (type) {
|
|
|
case "init":
|
|
|
+ if (
|
|
|
+ this.curEdit.type === "boxPlot" &&
|
|
|
+ this.formLabelAlign.Ydata.length >= 5
|
|
|
+ ) {
|
|
|
+ this.$message.warning(
|
|
|
+ "箱线图指标只允许添加最小值, Q1, 中位数, Q3, 最大值几位"
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
this.formLabelAlign.Ydata.push({ lable: "", data: [], id: "" });
|
|
|
this.formFilterAlign.push({
|
|
|
filters: [],
|
|
|
@@ -875,11 +1022,55 @@ export default {
|
|
|
});
|
|
|
return axisData;
|
|
|
},
|
|
|
+ removeYdata(index, type) {
|
|
|
+ const { BarYdata, LineYdata, ScatterYdata, Ydata } = this.formLabelAlign;
|
|
|
+ switch (type) {
|
|
|
+ case "init":
|
|
|
+ this.formLabelAlign.Ydata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ case "bar":
|
|
|
+ this.formLabelAlign.BarYdata.splice(index, 1); // 删除当前项
|
|
|
|
|
|
+ break;
|
|
|
+ case "line":
|
|
|
+ this.formLabelAlign.LineYdata.splice(index, 1); // 删除当前项
|
|
|
+ if (this.curEdit.type === "Cp") {
|
|
|
+ this.formFilterAlign.splice(index, 1);
|
|
|
+ }
|
|
|
+ //这里需要处理this.formFilterAlign.filter(item)
|
|
|
+ break;
|
|
|
+ case "scatter":
|
|
|
+ if (this.curEdit.type === "Cp") {
|
|
|
+ this.formFilterAlign.splice(
|
|
|
+ this.formLabelAlign.LineYdata.length + index,
|
|
|
+ 1
|
|
|
+ );
|
|
|
+ }
|
|
|
+ this.formLabelAlign.ScatterYdata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeXdata(index, type) {
|
|
|
+ switch (type) {
|
|
|
+ case "init":
|
|
|
+ this.formLabelAlign.Xdata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ case "bar":
|
|
|
+ this.formLabelAlign.BarXdata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ case "line":
|
|
|
+ this.formLabelAlign.LineXdata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ case "scatter":
|
|
|
+ this.formLabelAlign.ScatterXdata.splice(index, 1); // 删除当前项
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
changeData() {
|
|
|
if (this.$refs.form) {
|
|
|
this.$refs.form.resetFields();
|
|
|
}
|
|
|
+ console.log(this.formFilterAlign, "this.formFilterAlign 默认");
|
|
|
// 图表内容回显图表配置赋值
|
|
|
if (this.curEdit && this.curEdit.option) {
|
|
|
// 使用 this.$set 替代直接赋值
|
|
|
@@ -887,6 +1078,14 @@ export default {
|
|
|
text: this.curEdit.option.title?.text || "",
|
|
|
Xlable: this.curEdit.option.xAxis?.name || "",
|
|
|
Ylable: this.curEdit.option.yAxis?.name || "",
|
|
|
+ YRightLable:
|
|
|
+ this.curEdit.type === "pareto"
|
|
|
+ ? this.curEdit.option.yAxis[1].name
|
|
|
+ : "",
|
|
|
+ YLeftLable:
|
|
|
+ this.curEdit.type === "pareto"
|
|
|
+ ? this.curEdit.option.yAxis[0].name
|
|
|
+ : "",
|
|
|
Xdata:
|
|
|
this.curEdit.Xdata.length > 0
|
|
|
? this.curEdit.Xdata
|
|
|
@@ -969,26 +1168,79 @@ export default {
|
|
|
],
|
|
|
});
|
|
|
// 查找是否存在数据
|
|
|
- const index = this.curEdit.formFilterAlignData.findIndex(
|
|
|
+ const index = this.currentChartList.findIndex(
|
|
|
(item) => item.id === this.curEdit.id
|
|
|
);
|
|
|
if (index !== -1) {
|
|
|
this.$set(
|
|
|
this,
|
|
|
"formFilterAlign",
|
|
|
- this.curEdit.formFilterAlignData[index]?.data
|
|
|
+ this.curEdit.formFilterAlignData.length > 0
|
|
|
+ ? this.curEdit.formFilterAlignData
|
|
|
+ : this.curEdit.type === "Cp" || this.curEdit.type === "pareto"
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : [
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ ]
|
|
|
);
|
|
|
} else {
|
|
|
- this.$set(this, "formFilterAlign", [
|
|
|
- {
|
|
|
- filters: [],
|
|
|
- filterType1: "",
|
|
|
- number1: null,
|
|
|
- filterType2: "",
|
|
|
- number2: null,
|
|
|
- radio: null,
|
|
|
- },
|
|
|
- ]);
|
|
|
+ this.$set(
|
|
|
+ this,
|
|
|
+ "formFilterAlign",
|
|
|
+ this.curEdit.type === "Cp" || this.curEdit.type === "pareto"
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ : [
|
|
|
+ {
|
|
|
+ filters: [],
|
|
|
+ filterType1: "",
|
|
|
+ number1: null,
|
|
|
+ filterType2: "",
|
|
|
+ number2: null,
|
|
|
+ radio: null,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ );
|
|
|
}
|
|
|
} else {
|
|
|
this.$message.warning("请选择一个图表进行编辑");
|
|
|
@@ -998,7 +1250,6 @@ export default {
|
|
|
changeChart(isFilter) {
|
|
|
if (!this.curEdit?.option) return; // 确保 curEdit 和 option 存在
|
|
|
const item = JSON.parse(JSON.stringify(this.curEdit));
|
|
|
-
|
|
|
if (this.curEdit.type === "scatter" || this.curEdit.type === "radar") {
|
|
|
//判断散点选择的是否为number 或可转为number
|
|
|
const isAllNumbers = (data) =>
|
|
|
@@ -1058,6 +1309,62 @@ export default {
|
|
|
isFilter,
|
|
|
this.curEdit.type
|
|
|
);
|
|
|
+ } else if (this.curEdit.type === "roseChart") {
|
|
|
+ handleRoseChartChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "pie") {
|
|
|
+ handlePieChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "stackedBar") {
|
|
|
+ handlestackedBarChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "pareto") {
|
|
|
+ handleParetoChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "boxPlot") {
|
|
|
+ handleBoxPlotChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "sankeyDiagram") {
|
|
|
+ handleSankeyDiagramPlotChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
+ } else if (this.curEdit.type === "Heatmap") {
|
|
|
+ handleHeatmapPlotChartLogic(
|
|
|
+ item,
|
|
|
+ this.formLabelAlign,
|
|
|
+ this.formFilterAlign,
|
|
|
+ isFilter,
|
|
|
+ this.curEdit.type
|
|
|
+ );
|
|
|
}
|
|
|
//设置仓库
|
|
|
this.setFormFilterAlignData({
|
|
|
@@ -1066,42 +1373,13 @@ export default {
|
|
|
});
|
|
|
this.updateChart({
|
|
|
...item,
|
|
|
- Ydata: this.formLabelAlign.Ydata,
|
|
|
+ LineYdata: this.formLabelAlign.LineYdata,
|
|
|
+ ScatterYdata: this.formLabelAlign.ScatterYdata,
|
|
|
+ BarYdata: this.formLabelAlign.BarYdata,
|
|
|
+ Ydata: this.formLabelAlign.Ydata, //还是给所有的数据保存起来了,并不是过滤后的数据
|
|
|
formFilterAlignData: this.formFilterAlign,
|
|
|
}); // 更新图表
|
|
|
},
|
|
|
- removeYdata(index, type) {
|
|
|
- switch (type) {
|
|
|
- case "init":
|
|
|
- this.formLabelAlign.Ydata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "bar":
|
|
|
- this.formLabelAlign.BarYdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "line":
|
|
|
- this.formLabelAlign.LineYdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "scatter":
|
|
|
- this.formLabelAlign.ScatterYdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
- removeXdata(index, type) {
|
|
|
- switch (type) {
|
|
|
- case "init":
|
|
|
- this.formLabelAlign.Xdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "bar":
|
|
|
- this.formLabelAlign.BarXdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "line":
|
|
|
- this.formLabelAlign.LineXdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- case "scatter":
|
|
|
- this.formLabelAlign.ScatterXdata.splice(index, 1); // 删除当前项
|
|
|
- break;
|
|
|
- }
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|