Commit 3386169d by jml0128

fix

1 parent 24b7d192
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: jml * @Author: jml
* @Date: 2021-03-24 10:22:27 * @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-03 15:44:17 * @LastEditTime: 2021-07-04 12:16:45
--> -->
<template> <template>
<div style="position:relative;" class="bi-chart-block"> <div style="position:relative;" class="bi-chart-block">
...@@ -27,7 +27,10 @@ ...@@ -27,7 +27,10 @@
<BiChartChoiceMinxinToggleAxis <BiChartChoiceMinxinToggleAxis
v-if="(chart.axis || []).every(item => item.names.length > 0)" v-if="(chart.axis || []).every(item => item.names.length > 0)"
:axis="chart.axis" :axis="chart.axis"
:customGroupTitle="title.customGroupTitle"
:contenteditable="title.toggleAxisContenteditable"
@toggle-axis="toggleAxis" @toggle-axis="toggleAxis"
@change-title="changeGroupTitle"
></BiChartChoiceMinxinToggleAxis> ></BiChartChoiceMinxinToggleAxis>
<template v-if="chart.show"> <template v-if="chart.show">
<BiTable <BiTable
...@@ -115,8 +118,11 @@ export default { ...@@ -115,8 +118,11 @@ export default {
} }
}, },
methods: { methods: {
changeGroupTitle(title) {
this.chartConfig.title['customGroupTitle'] = title;
console.log(`${this.title.name}-图表-副标题`, title);
},
changeTitle(title) { changeTitle(title) {
console.log(title);
this.chartConfig.title['name'] = title; this.chartConfig.title['name'] = title;
console.log(`${this.title.name}-图表-标题`, title); console.log(`${this.title.name}-图表-标题`, title);
}, },
......
...@@ -73,12 +73,12 @@ export default { ...@@ -73,12 +73,12 @@ export default {
} = this.data; } = this.data;
const _arr = arr.slice(0, -1); const _arr = arr.slice(0, -1);
const c = [ const c = [
['', '', title[0].name, '', '', '', ''], ['', '', title[0].factorName, '', '', '', ''],
['题目', '名称', ...title[0].axis, '总计', 'X²', 'p'], ['题目', '名称', ...title[0].axis, '总计', 'X²', 'p'],
..._arr.map((item, index) => { ..._arr.map((item, index) => {
if (index === 0) { if (index === 0) {
return [ return [
title[1].name, title[1].factorName,
title[1].axis[index], title[1].axis[index],
..._arr[index], ..._arr[index],
'', '',
......
...@@ -5,8 +5,16 @@ ...@@ -5,8 +5,16 @@
<template> <template>
<div class="bi-chart-choice-mixin-toggle-axis"> <div class="bi-chart-choice-mixin-toggle-axis">
<BiBlank height="25" :usePrint="true"></BiBlank> <BiBlank height="25" :usePrint="true"></BiBlank>
<div class="bi-chart-choice-mixin-toggle-axis_sub_title"> <div
{{ dealAxis.join('与') }} class="bi-chart-choice-mixin-toggle-axis_sub_title"
:contenteditable="contenteditable"
@input="
event => {
$emit('change-title', event.target.innerText);
}
"
>
{{ customGroupTitle || dealAxis.join('与') }}
</div> </div>
<div class="bi-chart-choice-mixin-toggle-axis_text"> <div class="bi-chart-choice-mixin-toggle-axis_text">
<div> <div>
...@@ -36,6 +44,8 @@ export default { ...@@ -36,6 +44,8 @@ export default {
BiBlank BiBlank
}, },
props: { props: {
customGroupTitle: String,
contenteditable: Boolean,
axis: { axis: {
type: Array, type: Array,
default: () => [] default: () => []
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<div class="bi-chart-title_hr" v-if="!hideHr"></div> <div class="bi-chart-title_hr" v-if="!hideHr"></div>
<div <div
class="bi-chart-title_name" class="bi-chart-title_name"
contenteditable :contenteditable="contenteditable"
@input=" @input="
event => { event => {
$emit('change-title', event.target.innerText); $emit('change-title', event.target.innerText);
...@@ -118,6 +118,7 @@ export default { ...@@ -118,6 +118,7 @@ export default {
BiTypesChart BiTypesChart
}, },
props: { props: {
contenteditable: Boolean,
showGuide: Boolean, showGuide: Boolean,
hideHr: Boolean, hideHr: Boolean,
name: String, name: String,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: jml * @Author: jml
* @Date: 2021-03-24 10:22:27 * @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-03 16:44:26 * @LastEditTime: 2021-07-04 13:13:05
--> -->
<template> <template>
<div class="bi-table"> <div class="bi-table">
...@@ -20,10 +20,14 @@ ...@@ -20,10 +20,14 @@
> >
<template v-for="(cItem, cIndex) in item"> <template v-for="(cItem, cIndex) in item">
<td v-if="Array.isArray(cItem)" id="lineTd" :key="cIndex"> <td v-if="Array.isArray(cItem)" id="lineTd" :key="cIndex">
<span style="float:left;margin-top:20px;padding-left:5px;"> <span
style="float:left;margin-top:20px;padding-left:5px;width:150px;"
>
{{ cItem[0] }} {{ cItem[0] }}
</span> </span>
<span style="float:right;margin-top:-15px;padding-right:5px;"> <span
style="float:right;margin-top:-15px;padding-right:5px;width:150px;"
>
{{ cItem[1] }} {{ cItem[1] }}
</span> </span>
</td> </td>
...@@ -81,12 +85,12 @@ export default { ...@@ -81,12 +85,12 @@ export default {
}, },
computed: { computed: {
isSingle() { isSingle() {
return this.data.length == 1; return this.axis[1].names.length === 0;
}, },
dealData() { dealData() {
const { data, isSingle, title, axis } = this; const { data, isSingle, title, axis } = this;
return [ return [
[isSingle ? title : [axis[0].name, axis[1].name], ...axis[0].names], [isSingle ? title : [axis[1].name, axis[0].name], ...axis[0].names],
...data.map((item, index) => { ...data.map((item, index) => {
return [isSingle ? '数量' : axis[1].names[index], ...item]; return [isSingle ? '数量' : axis[1].names[index], ...item];
}) })
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<p>服务公司声明</p> <p>服务公司声明</p>
<div> <div>
<p> <p>
本公司以勤勉的职=职业态度,独立、客观地出具本报告。本报告所采用的数据和信息均来自项目采集,本公司不保证该等信息的准确性或完整性。分析逻辑基于团队的职业理解,清晰 本公司以勤勉的职业态度,独立、客观地出具本报告。本报告所采用的数据和信息均来自项目采集,本公司不保证该等信息的准确性或完整性。分析逻辑基于团队的职业理解,清晰
准确地反映了本公司的观点,结论不受任何第三方的授意或影响,特此声明。 准确地反映了本公司的观点,结论不受任何第三方的授意或影响,特此声明。
</p> </p>
</div> </div>
......
...@@ -99,7 +99,14 @@ export const chartConfig = () => { ...@@ -99,7 +99,14 @@ export const chartConfig = () => {
znResultIsShow, znResultIsShow,
summary, summary,
resultX2, resultX2,
resultP resultP,
customGroupTitle,
dontContenteditable,
toggleAxisContenteditable,
xFactor,
yFactor
} = options; } = options;
const title = blockTitle; const title = blockTitle;
const { x, y, data } = dealAxis(arr, isGroup); const { x, y, data } = dealAxis(arr, isGroup);
...@@ -121,8 +128,8 @@ export const chartConfig = () => { ...@@ -121,8 +128,8 @@ export const chartConfig = () => {
colors[0], colors[0],
data: data, data: data,
axis: [ axis: [
{ name: xAxisName, names: x }, { factorName: xFactor, name: xAxisName, names: x },
{ name: yAxisName, names: y } { factorName: yFactor, name: yAxisName, names: y }
], ],
width: width, width: width,
height: height, height: height,
...@@ -134,7 +141,10 @@ export const chartConfig = () => { ...@@ -134,7 +141,10 @@ export const chartConfig = () => {
name: title, name: title,
hideColor: hideColor, hideColor: hideColor,
hideDelete: hideDelete, hideDelete: hideDelete,
hideChangeChart: hideTypes hideChangeChart: hideTypes,
contenteditable: !dontContenteditable,
toggleAxisContenteditable: toggleAxisContenteditable,
customGroupTitle: customGroupTitle
}, },
legend: { legend: {
show: !hideLegend, show: !hideLegend,
...@@ -160,14 +170,8 @@ export const chartConfig = () => { ...@@ -160,14 +170,8 @@ export const chartConfig = () => {
setShow: true, setShow: true,
data: { data: {
title: [ title: [
{ { factorName: xFactor, name: xAxisName, axis: x },
name: xAxisName, { factorName: yFactor, name: yAxisName, axis: y }
axis: x
},
{
name: yAxisName,
axis: y
}
], ],
arr: [ arr: [
...analysisData, ...analysisData,
......
...@@ -375,6 +375,8 @@ export default { ...@@ -375,6 +375,8 @@ export default {
xAxisName: item.title, xAxisName: item.title,
yAxisName: item.secondTitle, yAxisName: item.secondTitle,
isGroup: true, isGroup: true,
dontContenteditable: true,
toggleAxisContenteditable: true,
blockTitle: `${item.xFactor}因素与${item.yFactor}因素相关性分析`, blockTitle: `${item.xFactor}因素与${item.yFactor}因素相关性分析`,
chartType: chartType:
item.chartType || randomType([1, 2, 3, 4, 5, 6, 9, 10, 11]) item.chartType || randomType([1, 2, 3, 4, 5, 6, 9, 10, 11])
...@@ -410,10 +412,7 @@ export default { ...@@ -410,10 +412,7 @@ export default {
}); });
}, },
exportBi() { exportBi() {
this.Bi.exportBi({ window.open(this.Bi.exportBi(), '_blank');
commandType: 1,
type: 1
});
} }
}, },
created() { created() {
......
...@@ -452,10 +452,7 @@ export default { ...@@ -452,10 +452,7 @@ export default {
}); });
}, },
exportBi() { exportBi() {
this.Bi.exportBi({ window.open(this.Bi.exportBi(), '_blank');
commandType: 1,
type: 1
});
} }
}, },
created() { created() {
......
...@@ -45,6 +45,7 @@ export const chartConfigToSetInfo = (chartConfigs, biInfoId) => { ...@@ -45,6 +45,7 @@ export const chartConfigToSetInfo = (chartConfigs, biInfoId) => {
type: type, type: type,
chartType: +chart.type, chartType: +chart.type,
customTitle: item.title.name, customTitle: item.title.name,
customGroupTitle: item.title.customGroupTitle,
colourGroup: Array.isArray(chart.colors) colourGroup: Array.isArray(chart.colors)
? chart.colors.join(',') ? chart.colors.join(',')
: chart.colors, : chart.colors,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!