|
|
@@ -84,7 +84,7 @@
|
|
|
<el-tooltip
|
|
|
content="添加指标值"
|
|
|
placement="bottom-start"
|
|
|
- v-if="curEdit.type !== 'roseChart'"
|
|
|
+ v-if="curEdit.type !== 'roseChart' && curEdit.type !== 'pie'"
|
|
|
>
|
|
|
<i
|
|
|
@click="handleMetrics('init')"
|
|
|
@@ -93,6 +93,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
|
|
|
@@ -111,7 +121,7 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
- v-if="curEdit.type !== 'roseChart'"
|
|
|
+ v-if="curEdit.type !== 'roseChart' && curEdit.type !== 'pie'"
|
|
|
:content="
|
|
|
formLabelAlign.Ydata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
@@ -134,7 +144,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="
|
|
|
@@ -143,26 +156,26 @@
|
|
|
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"
|
|
|
@@ -171,9 +184,9 @@
|
|
|
:key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <el-tooltip
|
|
|
+ <!-- <el-tooltip
|
|
|
:content="
|
|
|
- formLabelAlign.BarXdata.length <= 1
|
|
|
+ formLabelAlign.LineXdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -181,19 +194,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="
|
|
|
@@ -202,24 +218,28 @@
|
|
|
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"
|
|
|
@@ -229,8 +249,9 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.BarYdata.length <= 1
|
|
|
+ formLabelAlign.LineYdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -238,8 +259,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"
|
|
|
@@ -250,10 +271,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="
|
|
|
@@ -262,26 +280,30 @@
|
|
|
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> -->
|
|
|
+ </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"
|
|
|
@@ -290,9 +312,10 @@
|
|
|
:key="item.id + ind"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <!-- <el-tooltip
|
|
|
+ <el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.LineXdata.length <= 1
|
|
|
+ formLabelAlign.BarXdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -300,22 +323,19 @@
|
|
|
>
|
|
|
<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"
|
|
|
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' || curEdit.type === 'Cp'"
|
|
|
- label="线指标值"
|
|
|
- >
|
|
|
+ <el-form-item v-if="curEdit.type === 'pareto'" label="柱指标值">
|
|
|
<div
|
|
|
slot="label"
|
|
|
style="
|
|
|
@@ -324,24 +344,28 @@
|
|
|
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"
|
|
|
@@ -351,8 +375,9 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
<el-tooltip
|
|
|
+ v-if="curEdit.type !== 'pareto'"
|
|
|
:content="
|
|
|
- formLabelAlign.LineYdata.length <= 1
|
|
|
+ formLabelAlign.BarYdata.length <= 1
|
|
|
? '该指标不可删除,最少存在一组指标'
|
|
|
: '删除该指标'
|
|
|
"
|
|
|
@@ -360,8 +385,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"
|
|
|
@@ -510,23 +535,22 @@
|
|
|
v-if="
|
|
|
curEdit.type !== 'pie' &&
|
|
|
curEdit.type !== 'radar' &&
|
|
|
- curEdit.type !== 'roseChart'
|
|
|
+ curEdit.type !== 'roseChart' &&
|
|
|
+ curEdit.type !== 'pareto'
|
|
|
"
|
|
|
>
|
|
|
<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">
|
|
|
- -->
|
|
|
- <!--
|
|
|
- v-for="(itemFilter, filterInd) in formLabelAlign.Ydata"
|
|
|
- v-for="(itemFilter, filterInd) in filteredYData"
|
|
|
- -->
|
|
|
<el-collapse
|
|
|
v-if="filteredYData.length > 0 && filteredYData[0].data.length > 0"
|
|
|
>
|
|
|
@@ -620,6 +644,9 @@ import {
|
|
|
handleCpChartLogic,
|
|
|
handleRoseChartChartLogic,
|
|
|
handlePieChartLogic,
|
|
|
+ handlestackedBarChartLogic,
|
|
|
+ handleParetoChartLogic,
|
|
|
+ handleBoxPlotChartLogic,
|
|
|
} from "./chartLogic/index";
|
|
|
import Vue from "vue";
|
|
|
export default {
|
|
|
@@ -723,6 +750,8 @@ export default {
|
|
|
text: "",
|
|
|
Xlable: "",
|
|
|
Ylable: "",
|
|
|
+ YRightLable: "",
|
|
|
+ YLeftLable: "",
|
|
|
},
|
|
|
disabled: true,
|
|
|
selectData: [], //可选择的数据
|
|
|
@@ -738,11 +767,20 @@ export default {
|
|
|
const { BarYdata, LineYdata, ScatterYdata, Ydata } = this.formLabelAlign;
|
|
|
if (type === "pareto") {
|
|
|
console.log([...BarYdata, ...LineYdata], "[...BarYdata, ...LineYdata]");
|
|
|
- return [...BarYdata, ...LineYdata];
|
|
|
+ return [...LineYdata, ...BarYdata];
|
|
|
} else if (type === "Cp") {
|
|
|
return [...LineYdata, ...ScatterYdata];
|
|
|
} else if (
|
|
|
- ["bar", "line", "radar", "scatter", "pie", "roseChart"].includes(type)
|
|
|
+ [
|
|
|
+ "bar",
|
|
|
+ "line",
|
|
|
+ "radar",
|
|
|
+ "scatter",
|
|
|
+ "pie",
|
|
|
+ "roseChart",
|
|
|
+ "stackedBar",
|
|
|
+ "boxPlot",
|
|
|
+ ].includes(type)
|
|
|
) {
|
|
|
return Ydata;
|
|
|
}
|
|
|
@@ -784,6 +822,15 @@ export default {
|
|
|
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: [],
|
|
|
@@ -967,6 +1014,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
|
|
|
@@ -1206,6 +1261,30 @@ export default {
|
|
|
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
|
|
|
+ );
|
|
|
}
|
|
|
//设置仓库
|
|
|
this.setFormFilterAlignData({
|
|
|
@@ -1216,6 +1295,7 @@ export default {
|
|
|
...item,
|
|
|
LineYdata: this.formLabelAlign.LineYdata,
|
|
|
ScatterYdata: this.formLabelAlign.ScatterYdata,
|
|
|
+ BarYdata: this.formLabelAlign.BarYdata,
|
|
|
Ydata: this.formLabelAlign.Ydata, //还是给所有的数据保存起来了,并不是过滤后的数据
|
|
|
formFilterAlignData: this.formFilterAlign,
|
|
|
}); // 更新图表
|