Commit 5b952cfb by jml0128

fix

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