Commit 0d805885 by jml0128

联调可配置场景接口

1 parent e02d81d6
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
"vue-awesome-swiper": "^4.1.1", "vue-awesome-swiper": "^4.1.1",
"vue-echarts": "^6.0.0-rc.5", "vue-echarts": "^6.0.0-rc.5",
"vue-photo-preview": "^1.1.3", "vue-photo-preview": "^1.1.3",
"vuedraggable": "^2.24.3" "vuedraggable": "^2.24.3",
"xrk-tools": "^1.0.11"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
......
...@@ -6,9 +6,9 @@ import { dealString, dealFormatter, getInterval } from '../common'; ...@@ -6,9 +6,9 @@ import { dealString, dealFormatter, getInterval } from '../common';
const grid = { const grid = {
containLabel: true, containLabel: true,
left: 10, left: 10,
right: 10, right: 15,
bottom: 10, bottom: 10,
top: 10 top: 15
}; };
export const createBar = (Vue, chartData, axisData, yAxisUnit, colors = []) => { export const createBar = (Vue, chartData, axisData, yAxisUnit, colors = []) => {
const _axisData = dealString(axisData); const _axisData = dealString(axisData);
......
...@@ -77,7 +77,6 @@ export default { ...@@ -77,7 +77,6 @@ export default {
init() { init() {
if (!this.myChart) { if (!this.myChart) {
if (this.type === 13) { if (this.type === 13) {
console.log(china);
registerMap('china', china); registerMap('china', china);
// registerMap('chinaMapOutline', chinaMapOutline); // registerMap('chinaMapOutline', chinaMapOutline);
} }
......
...@@ -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-06-20 00:46:51 * @LastEditTime: 2021-06-30 22:36:55
--> -->
<template> <template>
<div style="position:relative;" class="bi-chart-block"> <div style="position:relative;" class="bi-chart-block">
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
...title, ...title,
colors: chart.colors, colors: chart.colors,
chartType: chart.type, chartType: chart.type,
extendTypes: chart.extendTypes,
disableTypes: chart.disableTypes disableTypes: chart.disableTypes
}" }"
@change-colors="changeChartColors" @change-colors="changeChartColors"
...@@ -139,7 +140,9 @@ export default { ...@@ -139,7 +140,9 @@ export default {
toggleAxis() { toggleAxis() {
// 交换X轴与Y轴 // 交换X轴与Y轴
const { data, axis } = this.chart; const { data, axis } = this.chart;
console.log(axis);
this.chartConfig.chart['axis'] = axis.reverse(); this.chartConfig.chart['axis'] = axis.reverse();
this.chartConfig.legend['data'] = axis[1].names;
this.chartConfig.chart['data'] = data[0].reduce((pre, cur, index) => { this.chartConfig.chart['data'] = data[0].reduce((pre, cur, index) => {
pre.push( pre.push(
data.reduce((cPre, cCur) => { data.reduce((cPre, cCur) => {
......
...@@ -50,47 +50,27 @@ export default { ...@@ -50,47 +50,27 @@ export default {
BiBlank BiBlank
}, },
data() { data() {
return { return {};
test: {
title: [
{
name: '患者年龄',
axis: ['小于18岁', '18-40岁', '18-40岁']
},
{
name: '患者发病状态',
axis: ['新发疾病', '旧病复发', '旧病复发2', '旧病复发3']
}
],
arr: [
['50%', '100%', '100%', '60%'],
['50%', '0%', '100%', '20%'],
['50%', '10%', '100%', '10%'],
['50%', '20%', '100%', '10%'],
[4, 1, 2, 5]
],
res: {
x: '0.923',
p: '0.342'
}
}
};
}, },
props: { props: {
hideBtn: Boolean, hideBtn: Boolean,
setShow: Boolean, setShow: Boolean,
title: String title: String,
data: {
type: Object,
default: () => ({})
}
}, },
computed: { computed: {
xLength() { xLength() {
return this.test.title[0].axis.length; return this.data.title[0].axis.length;
}, },
tableConfig() { tableConfig() {
const { const {
title, title,
arr, arr,
res: { x, p } res: { x, p }
} = this.test; } = this.data;
const _arr = arr.slice(0, -1); const _arr = arr.slice(0, -1);
const c = [ const c = [
['', '', title[0].name, '', '', '', ''], ['', '', title[0].name, '', '', '', ''],
......
...@@ -3,24 +3,33 @@ ...@@ -3,24 +3,33 @@
* @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-06-19 23:56:39 * @LastEditTime: 2021-06-30 19:34:58
--> -->
<template> <template>
<div class="bi-sex-icon"> <div>
<div class="bi-sex-icon_item"> <BiBlank height="40" :usePrint="true"></BiBlank>
<img src="http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/boy.svg" alt="" /> <div class="bi-sex-icon">
<p>{{ axis[0].name }} {{ data[0][0] }}</p> <div class="bi-sex-icon_item">
</div> <img src="http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/boy.svg" alt="" />
<div class="bi-sex-icon_item"> <p>{{ axis[0].name }} {{ data[0][0] }}</p>
<img src="http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/girl.svg" alt="" /> </div>
<p>{{ axis[1].name }} {{ data[0][1] }}</p> <div class="bi-sex-icon_item">
<img
src="http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/girl.svg"
alt=""
/>
<p>{{ axis[1].name }} {{ data[0][1] }}</p>
</div>
</div> </div>
<BiBlank height="40" :usePrint="true"></BiBlank>
</div> </div>
</template> </template>
<script> <script>
import BiBlank from './blank.vue';
export default { export default {
name: 'bi-sex-icon', name: 'bi-sex-icon',
components: { BiBlank },
props: { props: {
data: { data: {
type: Array, type: Array,
......
...@@ -97,6 +97,12 @@ export default { ...@@ -97,6 +97,12 @@ export default {
Swiper, Swiper,
SwiperSlide SwiperSlide
}, },
props: {
coverContent: {
default: () => [],
type: Array
}
},
data() { data() {
return { return {
swiperOptions: { swiperOptions: {
...@@ -220,58 +226,74 @@ export default { ...@@ -220,58 +226,74 @@ export default {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
} },
}, dealCoverContent(arr) {
mounted() { const baseContent = [
this.$refs['input'].forEach(item => { {
item.addEventListener('paste', function(e) { className: 'bi-cover_title',
e.stopPropagation(); pos: {
e.preventDefault(); top: this.isMobile ? this.dealPos(3.67) : 550,
var text = '', left: this.isMobile ? this.dealPos(1.93) : 237
event = e.originalEvent || e; },
if (event.clipboardData && event.clipboardData.getData) { maxLength: 20
text = event.clipboardData.getData('text/plain'); },
} else if (window.clipboardData && window.clipboardData.getData) { {
text = window.clipboardData.getData('Text'); className: 'bi-cover_date',
} pos: {
if (document.queryCommandSupported('insertText')) { top: this.isMobile ? this.dealPos(7.15) : 820,
document.execCommand('insertText', false, text); left: this.isMobile ? this.dealPos(1.92) : 237
} else { },
document.execCommand('paste', false, text); maxLength: 16
},
{
className: 'bi-cover_company',
pos: {
top: this.isMobile ? this.dealPos(10.79) : 1540,
left: this.isMobile ? this.dealPos(1.92) : 237
},
maxLength: 26
} }
];
this.content = baseContent.map((item, index) => {
const { name, pos } = arr[index];
name && (item.name = name);
pos && (item.pos = pos);
return item;
}); });
}); }
}, },
created() { watch: {
this.content = [ coverContent: {
{ handler(newV) {
name: '奇正藏药医学沙龙推广项目数据报告', if (Array.isArray(newV) && newV.length > 0) {
className: 'bi-cover_title', this.dealCoverContent(newV);
pos: { this.$nextTick(() => {
top: this.isMobile ? this.dealPos(3.67) : 550, this.$refs['input'].forEach(item => {
left: this.isMobile ? this.dealPos(1.93) : 237 item.addEventListener('paste', function(e) {
}, e.stopPropagation();
maxLength: 20 e.preventDefault();
}, var text = '',
{ event = e.originalEvent || e;
name: '2021/04/28期', if (event.clipboardData && event.clipboardData.getData) {
className: 'bi-cover_date', text = event.clipboardData.getData('text/plain');
pos: { } else if (
top: this.isMobile ? this.dealPos(7.15) : 820, window.clipboardData &&
left: this.isMobile ? this.dealPos(1.92) : 237 window.clipboardData.getData
}, ) {
maxLength: 16 text = window.clipboardData.getData('Text');
}
if (document.queryCommandSupported('insertText')) {
document.execCommand('insertText', false, text);
} else {
document.execCommand('paste', false, text);
}
});
});
});
}
}, },
{ immediate: true
name: '西藏奇正藏药营销有限公司', }
className: 'bi-cover_company',
pos: {
top: this.isMobile ? this.dealPos(10.79) : 1540,
left: this.isMobile ? this.dealPos(1.92) : 237
},
maxLength: 26
}
];
} }
}; };
</script> </script>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: jml * @Author: jml
* @Date: 2021-02-26 15:38:10 * @Date: 2021-02-26 15:38:10
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-23 14:06:00 * @LastEditTime: 2021-06-30 16:53:40
--> -->
<template> <template>
<div class="xrk-components-bi bi" :class="{ 'bi-print': print }"> <div class="xrk-components-bi bi" :class="{ 'bi-print': print }">
...@@ -36,7 +36,23 @@ export default { ...@@ -36,7 +36,23 @@ export default {
props: { props: {
mobile: [Number, String, Boolean], mobile: [Number, String, Boolean],
print: [Number, String, Boolean], print: [Number, String, Boolean],
projectType: [Number, String] projectType: [Number, String],
getBaseInfo: {
type: Function,
default: () => {}
},
getFixedInfo: {
type: Function,
default: () => {}
},
getTopicInfo: {
type: Function,
default: () => {}
},
getGroupInfo: {
type: Function,
default: () => {}
}
}, },
components: { components: {
BiConfigurable, BiConfigurable,
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
const pageInfo = args[0]; const pageInfo = args[0];
if (typeof pageInfo === 'object') { if (typeof pageInfo === 'object') {
const { pageSize, info } = pageInfo; const { pageSize, info } = pageInfo;
console.log(pageSize, info); // console.log(pageSize, info);
pageKey && (this[pageKey] = pageSize); pageKey && (this[pageKey] = pageSize);
pageInfoKey && (this[pageInfoKey] = info); pageInfoKey && (this[pageInfoKey] = info);
} else { } else {
......
...@@ -29,7 +29,171 @@ export const chartConfig = () => { ...@@ -29,7 +29,171 @@ export const chartConfig = () => {
} }
return info; return info;
}; };
const dealAxis = (arr, isGroup) => {
if (isGroup) {
console.log(JSON.stringify(arr));
const info = {
x: [],
y: [],
data: []
};
const a = arr.reduce((pre, cur) => {
if (cur.y) {
if (!pre[cur.y]) {
pre[cur.y] = [cur];
} else {
pre[cur.y].push(cur);
}
}
return pre;
}, {});
for (let y in a) {
const s = a[y].sort((itema, itemb) => {
if (itema.x < itemb.x) {
return -1;
}
});
info.y.push(y);
info.data.push(s.map(item => item.value));
info.x = s.map(item => item.x);
}
return info;
}
return {
x: arr.map(item => item.x),
y: [],
data: [arr.map(item => item.value)]
};
};
return { return {
createConfig: (arr, options = {}) => {
const {
blockTitle,
hideTitle,
hideChart,
hideDesc,
hideLegend,
hideDelete,
width = 1140,
height = 450,
colourGroup,
extendTypes = [],
disableTypes = [],
isDelete,
showSort,
xAxisName,
yAxisName,
legendName = '',
legends,
chartType,
isGroup,
resultIsShow,
resultSystem,
resultUser,
znResultSystem,
znResultUser,
znResultIsShow,
resultX2,
resultP
} = options;
const title = blockTitle;
const { x, y, data } = dealAxis(arr, isGroup);
const analysisData = data.map(item => {
return item.concat(
item.reduce((pre, cur) => {
return pre + cur;
}, 0)
);
});
return {
isDelete: isDelete || 0,
sort: showSort || 0,
chart: {
show: !hideChart,
type: chartType,
colors:
(typeof colourGroup === 'string' && colourGroup.split(',')) ||
colors[0],
data: data,
axis: [
{ name: xAxisName, names: x },
{ name: yAxisName, names: y }
],
width: width,
height: height,
extendTypes,
disableTypes
},
title: {
show: !hideTitle,
name: title,
hideColor: false,
hideDelete: hideDelete,
hideTypes: false
},
legend: {
show: !hideLegend,
title:
legendName &&
legendName.replace(
'${num}',
data[0].reduce((pre, cur) => {
pre += cur;
return pre;
}, 0)
),
data: legends || (isGroup ? y : x)
},
desc: {
show: !hideDesc,
setShow: !!resultIsShow,
text: resultSystem,
customText: resultUser || ''
},
analysis: {
show: isGroup,
setShow: true,
data: {
title: [
{
name: xAxisName,
axis: x
},
{
name: yAxisName,
axis: y
}
],
arr: [
...analysisData,
analysisData.reduce((pre, cur) => {
cur.forEach((item, index) => {
pre[index] = (pre[index] || 0) + item;
});
return pre;
}, [])
],
res: {
x: resultX2,
p: resultP
}
},
title: '卡方分析结果'
},
analysisDesc: {
show: isGroup,
setShow: !!znResultIsShow,
title: '智能分析',
text: znResultSystem,
customText: znResultUser,
resText: '总结可知:不同年龄患者的发病状态无显著性差异。'
}
};
},
create: (xLength, yLength, type = 1, options = {}) => { create: (xLength, yLength, type = 1, options = {}) => {
index += 1; index += 1;
const { const {
...@@ -40,7 +204,9 @@ export const chartConfig = () => { ...@@ -40,7 +204,9 @@ export const chartConfig = () => {
hideLegend, hideLegend,
hideDelete, hideDelete,
width = 1140, width = 1140,
height = 450 height = 450,
extendTypes = [],
disableTypes = []
} = options; } = options;
const title = blockTitle || `${index}题目题目`; const title = blockTitle || `${index}题目题目`;
const { x, y, data } = createData(xLength, yLength); const { x, y, data } = createData(xLength, yLength);
...@@ -57,8 +223,9 @@ export const chartConfig = () => { ...@@ -57,8 +223,9 @@ export const chartConfig = () => {
{ name: `原始y轴-${index}`, names: y } { name: `原始y轴-${index}`, names: y }
], ],
width: width, width: width,
height: height height: height,
// disableTypes: [3, 4] extendTypes,
disableTypes
}, },
title: { title: {
show: !hideTitle, show: !hideTitle,
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
--> -->
<template> <template>
<div class="bi-configurable"> <div class="bi-configurable">
<BiCover></BiCover> <BiCover :coverContent="coverContent"></BiCover>
<BiCatalogue class="bi-block" :catalogueArr="catalogueArr"></BiCatalogue> <BiCatalogue class="bi-block" :catalogueArr="catalogueArr"></BiCatalogue>
<BiOverview <BiOverview
class="bi-block" class="bi-block"
name="项目总览" name="项目总览"
title="关于双醋瑞因胶囊产品在云南省的零售药店巡店项目2020-03月度统计报表" :title="projectName"
:data="baseInfo" :data="baseInfo"
:textWrap="true" :textWrap="true"
></BiOverview> ></BiOverview>
...@@ -56,15 +56,43 @@ import BiSingleChoice from '../components/singleChoice.vue'; ...@@ -56,15 +56,43 @@ import BiSingleChoice from '../components/singleChoice.vue';
import BiCoverEnd from '../components/cover-end.vue'; import BiCoverEnd from '../components/cover-end.vue';
import BiOperate from '../components/operate.vue'; import BiOperate from '../components/operate.vue';
import mixin from '../mixin/index'; import mixin, { printWidth } from '../mixin/index';
/** /**
* dealSingleChoice、sort、setPage * dealSingleChoice、sort、setPage
*/ */
import project from '../mixin/project'; import project from '../mixin/project';
import { chartConfig } from '../mock/index'; import { chartConfig } from '../mock/index';
import { date, base } from 'xrk-tools';
const ChartConfigFn = chartConfig(); const ChartConfigFn = chartConfig();
const dealAxis = arr => {
return arr.map(item => ({
x: item.genderType || item.xTopicName || '-',
y: item.yTopicName,
value: item.num || item.countNum || 0
}));
};
const dealLegends = arr => {
const total = arr.reduce((pre, cur) => {
return pre + (cur.num || cur.countNum || 0);
}, 0);
return arr.reduce((pre, cur) => {
pre.push(
`${cur.genderType || cur.xTopicName}${cur.num ||
cur.countNum ||
0}人,占比${base.numberFormat(
(cur.num || cur.countNum || 0) / total,
0.01
)}%`
);
return pre;
}, []);
};
const randomType = arr => {
return arr[Math.ceil(Math.random() * arr.length)] || arr[0];
};
export default { export default {
name: 'bi-configurable', name: 'bi-configurable',
mixins: [mixin, project], mixins: [mixin, project],
...@@ -86,6 +114,7 @@ export default { ...@@ -86,6 +114,7 @@ export default {
singleChoice: [], singleChoice: [],
singleChoiceMixin: [], singleChoiceMixin: [],
missionData: [], missionData: [],
coverContent: [],
questionInfo: [ questionInfo: [
{ {
name: '总参与题目', name: '总参与题目',
...@@ -99,68 +128,9 @@ export default { ...@@ -99,68 +128,9 @@ export default {
unit: '人' unit: '人'
} }
], ],
baseInfo: [ projectName: '',
[ baseInfo: [],
{ textData: []
name: '项目名称',
value: '在山西地区的零售药店巡店项目'
},
{
name: '服务商',
value: '北京医洋科技有限公司'
},
{
name: '任务月度',
value: '2020-03'
}
],
[
{
name: '任务量',
value: '222'
},
{
name: '项目执行人数',
value: '2131人'
},
{
name: '数据收集',
value: '415条'
}
],
[
{
name: '参与调研人数',
value: '213123'
},
{
name: '报表生成时间',
value: '2020-10-2'
}
]
],
textData: [
[
{
name: '总参与题目:',
value: '20题'
},
{
name: '当前选取报告输出题目:',
value: '20题'
}
],
[
{
name: '总参与数(人或者机构):',
value: '1000'
},
{
name: '分析维度:',
value: '主体分析+交叉分析'
}
]
]
}; };
}, },
computed: { computed: {
...@@ -226,44 +196,199 @@ export default { ...@@ -226,44 +196,199 @@ export default {
} }
}, },
methods: { methods: {
setData() { dealPos(dis) {
this.singleChoice = [ return dis * (this.isPrint ? printWidth : this.baseFontSize);
ChartConfigFn.create(60, 0, 1), },
ChartConfigFn.create(60, 0, 2), setData() {},
ChartConfigFn.create(20, 0, 5), dealBaseInfo(info) {
ChartConfigFn.create(25, 0, 6), const {
ChartConfigFn.create(15, 0, 11) title,
titlePosition,
aspEnterpriseNameWrite,
aspNamePosition,
styleConfigureSettlementTime,
styleConfigureSettlementTimePosition,
projectName = '-',
aspEnterpriseName,
settlementTime,
taskSum,
executePeopleNumber,
dataCollectNumber,
examinePeopleNumber,
createDt,
totalTopicNum,
chooseTopicNum,
isContrainGroupAnalyse,
isContrainSingleAnalyse
} = info;
this.projectName = `${projectName}统计报表`;
this.coverContent = [
{
name: title,
pos: titlePosition
},
{
name: styleConfigureSettlementTime,
pos: styleConfigureSettlementTimePosition
},
{
name: aspEnterpriseNameWrite,
pos: aspNamePosition
}
]; ];
this.singleChoiceMixin = [ this.baseInfo = [
ChartConfigFn.create(4, 4, 1), [
ChartConfigFn.create(6, 6, 2), {
ChartConfigFn.create(8, 8, 3), name: '项目名称',
ChartConfigFn.create(10, 10, 4) value: projectName
},
{
name: '服务商',
value: aspEnterpriseName
},
{
name: '提交时间',
value: settlementTime
}
],
[
{
name: '任务量',
value: taskSum
},
{
name: '项目执行人数',
value: `${executePeopleNumber}人`
},
{
name: '数据收集',
value: `${dataCollectNumber}条`
}
],
[
{
name: '参与调研人数',
value: `${examinePeopleNumber}人`
},
{
name: '报表生成时间',
value: date.dateFormat(createDt, 'Y-M-D')
}
]
]; ];
this.textData = [
[
{
name: '总参与题目:',
value: `${totalTopicNum}题`
},
{
name: '当前选取报告输出题目:',
value: `${chooseTopicNum}题`
}
],
[
{
name: '总参与数(人或者机构):',
value: executePeopleNumber
},
{
name: '分析维度:',
value: [
{ show: isContrainSingleAnalyse, name: '主体分析' },
{ show: isContrainGroupAnalyse, name: '交叉分析' }
]
.filter(item => item.show == 1)
.map(item => item.name)
.join('+')
}
]
];
},
dealFixedInfo(infoArr) {
this.missionData = [ this.missionData = [
ChartConfigFn.create(4, 0, 12, { ChartConfigFn.createConfig(dealAxis(infoArr[0].fixedCountInfos), {
...infoArr[0],
chartType: infoArr[0].chartType || 12,
legends: dealLegends(infoArr[0].fixedCountInfos),
blockTitle: '参与任务执行的性别分布',
legendName: '总参与项目执行人数${num}人',
hideDesc: true, hideDesc: true,
hideDelete: true, hideDelete: true,
width: 520, width: 520,
height: 350 height: 350,
disableTypes: [3, 4],
extendTypes: [12]
}), }),
ChartConfigFn.create(4, 0, 1, { ChartConfigFn.createConfig(dealAxis(infoArr[1].fixedCountInfos), {
...infoArr[1],
chartType: infoArr[1].chartType || 1,
legends: dealLegends(infoArr[1].fixedCountInfos),
blockTitle: '执行任务的年龄段',
legendName: '总参与项目执行人数${num}人',
hideDesc: true, hideDesc: true,
hideDelete: true, hideDelete: true,
width: 520, width: 520,
height: 350 height: 350,
disableTypes: [3, 4]
}), }),
ChartConfigFn.create(4, 0, 1, { ChartConfigFn.createConfig([], {
...infoArr[1],
hideLegend: true, hideLegend: true,
hideChart: true, hideChart: true,
hideTitle: true hideTitle: true
}), }),
ChartConfigFn.create(4, 0, 1, { hideDelete: true, height: 400 }) ChartConfigFn.createConfig(dealAxis(infoArr[2].fixedCountInfos), {
...infoArr[2],
chartType: infoArr[1].chartType || 2,
legends: dealLegends(infoArr[2].fixedCountInfos),
blockTitle: '项目参与人完成任务区间分布',
legendName: '总参与项目执行人数${num}人',
hideDelete: true,
height: 400,
disableTypes: [3, 4]
})
]; ];
},
dealChoice(arr) {
this.singleChoice = arr.map(item => {
return ChartConfigFn.createConfig(dealAxis(item.topicCountInfos), {
...item,
blockTitle: item.topicTitle,
chartType: item.chartType || randomType([1, 2, 5, 6, 9, 10, 11]),
disableTypes: [3, 4]
});
});
},
dealChoiceMixin(arr) {
this.singleChoiceMixin = arr.map(item => {
return ChartConfigFn.createConfig(dealAxis(item.topicCountInfos), {
...item,
xAxisName: item.title,
yAxisName: item.secondTitle,
isGroup: true,
blockTitle: `${item.title}${item.secondTitle}`,
chartType: item.chartType || randomType([1, 2, 3, 4, 5, 6, 9, 10, 11])
});
});
} }
}, },
created() { created() {
this.setData(); this.setData();
Promise.all([
this.Bi.getBaseInfo(),
this.Bi.getFixedInfo(),
this.Bi.getTopicInfo(),
this.Bi.getGroupInfo()
]).then(([baseInfo, fixedInfo, topicInfo, topicMixinInfo]) => {
this.dealBaseInfo(baseInfo.data.data[0] || {});
this.dealFixedInfo(fixedInfo.data.data || []);
this.dealChoice(topicInfo.data.data || []);
this.dealChoiceMixin(topicMixinInfo.data.data || []);
});
window.status = 'completed'; window.status = 'completed';
} }
}; };
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
var path = require('path'); var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
var entry = var entry =
process.env.NODE_ENV === 'development' process.env.NODE_ENV !== 'development'
? './src/main.js' ? './src/main.js'
: './src/lib/index.js'; : './src/lib/index.js';
module.exports = { module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!