Commit 5b952cfb by jml0128

fix

1 parent 187155ec
......@@ -205,7 +205,10 @@ export const createBarMultiple = (
label: {
show: true,
color: '#fff',
fontSize: 12
fontSize: 12,
formatter(params) {
return params['data'] || '';
}
},
data: item
};
......@@ -274,7 +277,10 @@ export const createBarMultipleTransverse = (
label: {
show: true,
color: '#fff',
fontSize: 12
fontSize: 12,
formatter(params) {
return params['data'] || '';
}
},
data: item
};
......
......@@ -18,7 +18,7 @@ const grid = {
containLabel: true,
left: 0,
right: 10,
top: 10,
top: 20,
bottom: 0
};
......
......@@ -3,7 +3,7 @@
* @Author: jml
* @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-04 12:16:45
* @LastEditTime: 2021-07-07 16:09:37
-->
<template>
<div style="position:relative;" class="bi-chart-block">
......@@ -44,7 +44,7 @@
<BiChart :showGuide="showGuide" v-else v-bind="chart"></BiChart>
</template>
<BiChartLegend
v-if="legend.show"
v-if="legend.show && chart.type != 11"
v-bind="{ ...legend, colors: chart.colors }"
></BiChartLegend>
<BiChartDesc
......@@ -61,6 +61,7 @@
<BiChartDesc
v-if="analysisDesc.show"
v-bind="analysisDesc"
@change-text="changeZnText"
@change-status="changeStatus('analysisDesc', '智能分析')"
></BiChartDesc>
<slot name="bottom"></slot>
......@@ -150,6 +151,11 @@ export default {
this.chartConfig['desc']['customText'] = text;
console.log(`${this.title.name}-用户自定义描述`, text);
},
changeZnText(text) {
// 修改智能分析附加文字的内容
this.chartConfig['analysisDesc']['customText'] = text;
console.log(`${this.title.name}-只能分析用户自定义描述`, text);
},
toggleAxis() {
// 交换X轴与Y轴
const { data, axis } = this.chart;
......
......@@ -15,11 +15,11 @@
<div class="bi-chart-choice-mixin-toggle-axis_text">
<div>
<span>X轴:</span>
<span>{{ dealAxis[0] }}</span>
<span>{{ dealFactorNameAxis[0] }}</span>
</div>
<div style="margin-top:10px;">
<span>Y轴:</span>
<span>{{ dealAxis[1] }}</span>
<span>{{ dealFactorNameAxis[1] }}</span>
</div>
</div>
<el-button icon="el-icon-sort" v-if="!isPrint" @click="toggle">
......@@ -49,6 +49,9 @@ export default {
}
},
computed: {
dealFactorNameAxis() {
return this.axis.map(item => item.factorName);
},
dealAxis() {
return this.axis.map(item => item.name);
}
......
......@@ -45,6 +45,7 @@
import mixin from '../mixin/index';
import { Button } from 'element-ui';
import BiBlank from './blank.vue';
import { keepLastIndex } from '../chart-type/common';
export default {
name: 'bi-chart-desc',
mixins: [mixin],
......@@ -90,6 +91,8 @@ export default {
this.$refs['input'].focus();
},
input(event) {
const range = window.getSelection(); //创建range
const focusOffset = range.focusOffset;
try {
const { innerText } = event.target;
if (
......@@ -97,20 +100,28 @@ export default {
this.localText.length === this.maxLength
) {
event.target.innerText = this.localText;
this.keepLastIndex(event.target);
this.$nextTick(() => {
keepLastIndex(event.target, focusOffset - 1);
});
return;
}
const text = `${innerText}`.slice(0, this.maxLength);
this.localText = text;
this.$emit('change-text', this.localText);
this.$nextTick(() => {
keepLastIndex(event.target, focusOffset);
});
} catch (error) {
console.log(error);
}
}
},
mounted() {
this.$refs['input'] &&
this.$refs['input'].addEventListener('paste', function(e) {
const inputDom = this.$refs['input'];
if (inputDom) {
inputDom.innerHTML = inputDom.innerText;
inputDom.addEventListener('paste', function(e) {
e.stopPropagation();
e.preventDefault();
var text = '',
......@@ -126,6 +137,7 @@ export default {
document.execCommand('paste', false, text);
}
});
}
},
watch: {
customText: {
......
......@@ -4,6 +4,7 @@
-->
<template>
<div class="bi-chart-title">
<div class="bi-chart-title-darg"></div>
<div class="bi-chart-title_hr" v-if="!hideHr"></div>
<div
class="bi-chart-title_name"
......@@ -193,6 +194,14 @@ export default {
font-size: 0;
padding-top: 20px;
padding-bottom: 20px;
&-darg {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
}
&_hr {
width: 5px;
height: 26px;
......@@ -207,6 +216,10 @@ export default {
color: #2a3558;
line-height: 1.3;
max-width: 72%;
display: inline-block;
position: relative;
z-index: 2;
min-width: 200px;
&.mobile {
font-size: 0.26rem;
}
......@@ -231,6 +244,7 @@ export default {
right: 16px;
top: 50%;
margin-top: -21px;
z-index: 3;
&_item {
& + .bi-chart-title_btn_group_item {
margin-left: 8px;
......
......@@ -218,6 +218,9 @@ export default {
this.content[index]['name'].length === maxLength
) {
event.target.innerText = this.content[index]['name'];
this.$nextTick(() => {
keepLastIndex(event.target, focusOffset - 1);
});
return;
}
const text = `${innerText}`.slice(0, maxLength);
......@@ -277,6 +280,7 @@ export default {
this.$nextTick(() => {
Array.isArray(this.$refs['input']) &&
this.$refs['input'].forEach(item => {
item.innerHTML = item.innerText;
item.addEventListener('paste', function(e) {
e.stopPropagation();
e.preventDefault();
......
......@@ -48,14 +48,27 @@ export default {
return {};
},
methods: {},
mounted() {
this.$emit('page', heightToPage(this.$refs['bi-mission'].offsetHeight));
mounted() {},
watch: {
data: {
handler() {
this.$nextTick(() => {
this.$emit(
'page',
heightToPage(this.$refs['bi-mission'].offsetHeight)
);
});
},
deep: true,
immediate: true
}
}
};
</script>
<style lang="scss" scoped>
.bi-mission {
page-break-before: always;
page-break-after: always;
padding-bottom: 50px;
&_group {
padding: 0 30px;
......
......@@ -78,6 +78,7 @@ $bluecolor: #1989fa;
& > div {
display: inline-block;
width: 450px;
vertical-align: top;
&:nth-child(3) {
width: 200px;
}
......
......@@ -8,7 +8,7 @@
<vue-draggable
class="bi-single-choice_group"
:class="{ wrap: pageWrap }"
handle=".bi-chart-title_name"
handle=".bi-chart-title-darg"
v-model="copySingleChoice"
:disabled="disabled"
chosen-class="chosen"
......@@ -114,17 +114,17 @@ export default {
},
...(this.$refs['bi-single-choice_item'] || []).map(item => {
let height = 0;
item.pervPage = item.$children.reduce(
(pre, { $el: { offsetHeight } }) => {
item.pervPage = item.$children.reduce((pre, { $el }) => {
const { offsetHeight } = $el;
if ($el.className != 'bi-blank' && !this.Bi.isPrint) {
height += offsetHeight;
}
if (height >= 1697) {
pre += 1;
height = offsetHeight;
}
return pre;
},
0
);
}, 0);
return item;
})
];
......@@ -135,8 +135,8 @@ export default {
page: this.pageWrap ? 0 : 1
};
const catalogueInfoArr = [];
domArr.forEach(
({ $el: { offsetHeight }, title, pervPage = 0 }, index) => {
domArr.forEach(({ $el, title, pervPage = 0 }, index) => {
const offsetHeight = $el.offsetHeight - (this.Bi.isPrint ? 0 : 56);
pageSizeInfo.height += offsetHeight;
if (this.pageWrap) {
if (index == 1) {
......@@ -157,9 +157,8 @@ export default {
name: (title || {}).name,
page: pageSizeInfo.page
});
}
);
});
console.log(111, pageSizeInfo.page, catalogueInfoArr);
this.$emit('page', {
pageSize: pageSizeInfo.page,
info: catalogueInfoArr
......
......@@ -90,10 +90,12 @@ export const chartConfig = () => {
chartType,
isGroup,
hideBtn,
resultIsShow,
resultSystem,
resultUser,
znTableIsShow,
znResultSystem,
znResultUser,
znResultIsShow,
......@@ -164,6 +166,7 @@ export const chartConfig = () => {
data: legends || (isGroup ? y : x)
},
desc: {
hideBtn: hideBtn,
show: !hideDesc,
setShow: !!resultIsShow,
text: resultSystem,
......@@ -171,7 +174,7 @@ export const chartConfig = () => {
},
analysis: {
show: isGroup,
setShow: true,
setShow: !!znTableIsShow,
data: {
title: [
{ factorName: xFactor, name: xAxisName, axis: x },
......
......@@ -122,6 +122,7 @@ export default {
},
computed: {
catalogueArr() {
const hasSingleChoice = this.showSingleChoice.length > 0;
const { page1 = 0, page2 = 0, page3Info = [] } = this;
return [
{
......@@ -142,17 +143,18 @@ export default {
// },
{
name: '执行任务人员画像',
page: page1 + 1
page: 2
},
{
name: '项目参与人完成任务区间分布',
page: page1 + 1
page: 2
}
]
},
{
name: '项目相关调研模块',
child: [
child: hasSingleChoice
? [
{
name: '单因素分析',
page: page1 + 2
......@@ -166,6 +168,16 @@ export default {
};
})
]
: [
...page3Info
.filter(item => item.name)
.map(item => {
return {
...item,
page: page1 + 1 + page2 + item.page
};
})
]
}
];
},
......@@ -343,13 +355,17 @@ export default {
}),
ChartConfigFn.createConfig([], {
...group4,
resultSystem: `${group1.resultSystem}${group2.resultSystem}`,
resultIsShow: 1,
hideBtn: true,
resultSystem: `${group2.analyseDescribe}${group4.resultSystem}`,
hideLegend: true,
hideChart: true,
hideTitle: true
}),
ChartConfigFn.createConfig(dealAxis(group3.fixedCountInfos), {
...group3,
resultIsShow: 1,
hideBtn: true,
chartType: group3.chartType || 2,
legends: dealLegends(group3.fixedCountInfos),
blockTitle: '项目参与人完成任务区间分布',
......@@ -387,7 +403,7 @@ export default {
isGroup: true,
dontContenteditable: true,
toggleAxisContenteditable: true,
blockTitle: `${item.xFactor}因素与${item.yFactor}因素相关性分析`,
blockTitle: `${item.xFactor}${item.yFactor}相关性分析`,
chartType:
item.chartType || randomType([1, 2, 3, 4, 5, 6, 9, 10, 11])
});
......
......@@ -142,17 +142,17 @@ export default {
{
name: '项目执行任务模块',
child: [
{
name: '任务量分析',
page: page1 + 1
},
// {
// name: '任务量分析',
// page: 2
// },
{
name: '执行任务人员画像',
page: page1 + 1
page: 2
},
{
name: '项目参与人完成任务区间分布',
page: page1 + 1
page: 2
}
]
},
......@@ -313,6 +313,7 @@ export default {
legendName: '总参与项目执行人数${num}人',
hideDesc: true,
hideDelete: true,
dontContenteditable: true,
width: 520,
height: 350,
disableTypes: [3, 4],
......@@ -326,16 +327,19 @@ export default {
legendName: '总参与项目执行人数${num}人',
hideDesc: true,
hideDelete: true,
dontContenteditable: true,
width: 520,
height: 350,
disableTypes: [3, 4]
}),
ChartConfigFn.createConfig([], {
...group1,
resultIsShow: 1,
hideBtn: true,
hideLegend: true,
hideChart: true,
hideTitle: true
})
// ChartConfigFn.createConfig([], {
// ...infoArr[1],
// hideLegend: true,
// hideChart: true,
// hideTitle: true
// }),
// ChartConfigFn.createConfig(dealAxis(group3.fixedCountInfos), {
// ...group3,
// chartType: group3.chartType || 2,
......@@ -438,6 +442,11 @@ export default {
saveInfo() {
const { biInfoId, styleConfigureId } = this.biInfo;
const { content } = this.$refs['cover'];
let _missionData = chartConfigToSetInfo(this.missionData, biInfoId);
_missionData[0] = Object.assign({}, _missionData[0], _missionData[2]);
_missionData = _missionData.slice(0, 2);
return this.Bi.saveInfo({
biInfoId: biInfoId,
commandType: 2,
......@@ -452,10 +461,7 @@ export default {
title: content[0].name || '', //封面标题
titlePosition: JSON.stringify(content[0].pos) //标题位置
},
styleConfigureFixedDetailList: chartConfigToSetInfo(
this.missionData,
biInfoId
),
styleConfigureFixedDetailList: _missionData,
hgtgDetailList: chartConfigToSetInfo(
[...this.singleChoice, ...this.singleChoiceMixin],
biInfoId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!