
--- client/views/component/SplitterLayout.vue
+++ client/views/component/SplitterLayout.vue
... | ... | @@ -1,11 +1,11 @@ |
1 | 1 |
<template> |
2 | 2 |
<Splitter :class="{ 'content-box': true, active: splitInfo.layout_nm == selectLayout.layout_nm }" :layout="splitInfo.layout_type" @resizeend="updateSizes" @Click.stop="clickLayout(splitInfo)"> |
3 |
- <SplitterPanel class="content-box" v-if="splitInfo.children.length < 1"> |
|
3 |
+ <SplitterPanel class="content-box padding-1" v-if="splitInfo.children.length < 1" :style="$createStyleSheet(splitInfo.styleSheet)"> |
|
4 | 4 |
<ComponentTitle v-if="splitInfo.useSj" :title="splitInfo.layoutSj" /> |
5 | 5 |
<BaseComponent v-else-if="splitInfo.se == 'component'" :component="splitInfo.component" @onChange="onChange" @Click.stop="clickLayout(splitInfo)" /> |
6 | 6 |
</SplitterPanel> |
7 | 7 |
<template v-else> |
8 |
- <SplitterPanel class="content-box" v-for="(item, idx) of splitInfo.children" :key="idx"> |
|
8 |
+ <SplitterPanel class="content-box" v-for="(item, idx) of splitInfo.children" :key="idx" :style="$createStyleSheet(splitInfo.styleSheet)"> |
|
9 | 9 |
<SplitterLayout :splitInfo="item" :selectLayout="selectLayout" @onChange="onChange" /> |
10 | 10 |
</SplitterPanel> |
11 | 11 |
</template> |
--- client/views/component/chart/chartDataTransform.js
+++ client/views/component/chart/chartDataTransform.js
... | ... | @@ -1,136 +1,153 @@ |
1 | 1 |
|
2 | 2 |
const chartDataTransform = { |
3 |
- /** |
|
4 |
- * rowdata를 사용자 선택에 맞게 반환 |
|
5 |
- * @param rowdata : 원본 데이터 |
|
6 |
- * @param x : x축 객체 데이터 |
|
7 |
- * @param yArr : y축 배열 데이터 |
|
8 |
- */ |
|
9 |
- createData: function(rowdata, xAxisList, yAxisList, group){ |
|
10 |
- let resultArr = []; |
|
11 |
- let x; |
|
12 |
- //x축 객체 배열 데이터를 가져와서 columnNm 값을 가져옴 |
|
13 |
- if(xAxisList.length !== 0){ |
|
14 |
- x = xAxisList[0].columnIdx; |
|
3 |
+ selectColumnIndex(dataTable, column) { |
|
4 |
+ for (let i = 0; i < dataTable.columnDatas.length; i++) { |
|
5 |
+ if (column == dataTable.columnDatas[i]) { |
|
6 |
+ return i; |
|
7 |
+ } |
|
8 |
+ } |
|
9 |
+ return null; |
|
10 |
+ }, |
|
11 |
+ /** |
|
12 |
+ * rowdata를 사용자 선택에 맞게 반환 |
|
13 |
+ * @param rowdata : 원본 데이터 |
|
14 |
+ * @param x : x축 객체 데이터 |
|
15 |
+ * @param yArr : y축 배열 데이터 |
|
16 |
+ */ |
|
17 |
+ createData: function (dataTable, xAxisList, yAxisList, group) { |
|
18 |
+ let xAxis = null; |
|
19 |
+ let yAxisArr = []; |
|
20 |
+ let result = []; |
|
21 |
+ |
|
22 |
+ if (dataTable.rowData.length > 0 && xAxisList.length > 0 && yAxisList.length > 0) { |
|
23 |
+ xAxis = this.selectColumnIndex(dataTable, xAxisList[0]); |
|
24 |
+ if (xAxis == null) { |
|
25 |
+ return []; |
|
26 |
+ } |
|
27 |
+ |
|
28 |
+ for (let yAxis of yAxisList) { |
|
29 |
+ let index = this.selectColumnIndex(dataTable, yAxis); |
|
30 |
+ if (index == null) { |
|
31 |
+ return []; |
|
15 | 32 |
} |
16 | 33 |
|
17 |
- //y축 객체 배열 데이터를 가져와서 columnNm 값을 배열로 가져옴 |
|
18 |
- let yArr = yAxisList.map(field => { |
|
19 |
- return { |
|
20 |
- valNm: field.columnNm, |
|
21 |
- valIndex: field.columnIdx |
|
22 |
- } |
|
23 |
- }); |
|
34 |
+ yAxisArr.push( |
|
35 |
+ { |
|
36 |
+ key: yAxis.columnNm, |
|
37 |
+ idx: index, |
|
38 |
+ } |
|
39 |
+ ); |
|
40 |
+ } |
|
24 | 41 |
|
25 |
- if (yArr.length > 0) { |
|
26 |
- // 반복문을 통해 y축의 데이터를 가져와서 datalist에 추가 |
|
27 |
- for(let i = 0; i < rowdata.length; i++) { |
|
28 |
- let data = { |
|
29 |
- categoryData: rowdata[i][x] |
|
30 |
- } |
|
31 |
- // data에 y축의 다중데이터 추가 |
|
32 |
- yArr.forEach(field => { |
|
33 |
- const fieldName = field.valNm; |
|
34 |
- if(!data[fieldName]) { |
|
35 |
- data[fieldName] = 0; |
|
36 |
- } |
|
37 |
- data[fieldName] += Number(rowdata[i][field.valIndex]); |
|
38 |
- }); |
|
39 |
- // group 추가 |
|
40 |
- if(group !== undefined && group !== ""){ |
|
41 |
- data.group = rowdata[i][group];} |
|
42 |
- resultArr.push(data); |
|
43 |
- } |
|
42 |
+ for (let row of dataTable.rowData) { |
|
43 |
+ let data = { |
|
44 |
+ categoryData: row[xAxis], |
|
44 | 45 |
} |
45 |
- return resultArr; |
|
46 | 46 |
|
47 |
- }, |
|
48 |
- /** |
|
49 |
- * 변환된 데이터 그룹화 |
|
50 |
- * @param data : 변환된 데이터 |
|
51 |
- * @param yArr : y축 카테고리 배열 데이터 |
|
52 |
- */ |
|
53 |
- dataGrouping: function(data, yArr){ |
|
54 |
- if (!Array.isArray(data) || !data) { |
|
55 |
- return {}; |
|
47 |
+ for (let yArr of yAxisArr) { |
|
48 |
+ if (!data[yArr.key]) { |
|
49 |
+ data[yArr.key] = 0; |
|
50 |
+ } |
|
51 |
+ data[yArr.key] += Number(row[yArr.idx]); |
|
56 | 52 |
} |
57 |
- return data.reduce((acc, cur) => { |
|
58 |
- if (!acc[cur.categoryData]) { |
|
59 |
- acc[cur.categoryData] = {}; |
|
60 |
- // 각 필드 초기화 |
|
61 |
- yArr.forEach(field => { |
|
62 |
- acc[cur.categoryData][field.valNm] = { values: [], sum: 0, min: Infinity, max: -Infinity, count: 0 }; |
|
63 |
- }); |
|
64 |
- } |
|
65 | 53 |
|
66 |
- // 각 필드별 합계 계산 |
|
67 |
- yArr.forEach(field => { |
|
68 |
- const fieldName = field.valNm; |
|
69 |
- // cur[fieldName]이 배열인지 확인하고, 아니라면 배열로 만듦 |
|
70 |
- let values = Array.isArray(cur[fieldName]) ? cur[fieldName] : [cur[fieldName]]; |
|
71 |
- values.forEach(value => { |
|
72 |
- acc[cur.categoryData][fieldName].values.push(value); |
|
73 |
- acc[cur.categoryData][fieldName].sum += value; |
|
74 |
- acc[cur.categoryData][fieldName].min = Math.min(acc[cur.categoryData][fieldName].min, value); |
|
75 |
- acc[cur.categoryData][fieldName].max = Math.max(acc[cur.categoryData][fieldName].max, value); |
|
76 |
- acc[cur.categoryData][fieldName].count += 1; |
|
77 |
- }); |
|
78 |
- }); |
|
54 |
+ if (group != null && group !== undefined && group !== "") { |
|
55 |
+ data.group = row[group]; |
|
56 |
+ } |
|
79 | 57 |
|
80 |
- return acc; |
|
81 |
- }, {}); |
|
82 |
- }, |
|
58 |
+ result.push(data); |
|
59 |
+ } |
|
60 |
+ } |
|
83 | 61 |
|
84 |
- /** |
|
85 |
- * 데이터 계산 값으로 가공 (min, max, sum, avg) |
|
86 |
- * @param groupData : 그룹화된 데이터 |
|
87 |
- * @param selectedCal : 사용자가 선택한 계산 값 |
|
88 |
- */ |
|
89 |
- calculateSetting: function(groupData, selectedCal) { |
|
90 |
- let result = Object.keys(groupData).map(categoryData => { |
|
91 |
- const result = { categoryData: categoryData }; |
|
92 |
- Object.keys(groupData[categoryData]).forEach(fieldName => { |
|
93 |
- const fieldData = groupData[categoryData][fieldName]; |
|
94 |
- switch (selectedCal) { |
|
95 |
- case "sum": |
|
96 |
- result[fieldName] = fieldData.sum; |
|
97 |
- break; |
|
98 |
- case "avg": |
|
99 |
- result[fieldName] = fieldData.sum / fieldData.count; |
|
100 |
- break; |
|
101 |
- case "min": |
|
102 |
- result[fieldName] = fieldData.min; |
|
103 |
- break; |
|
104 |
- case "max": |
|
105 |
- result[fieldName] = fieldData.max; |
|
106 |
- break; |
|
107 |
- } |
|
108 |
- }); |
|
109 |
- return result; |
|
62 |
+ return result; |
|
63 |
+ }, |
|
64 |
+ |
|
65 |
+ /** |
|
66 |
+ * 변환된 데이터 그룹화 |
|
67 |
+ * @param data : 변환된 데이터 |
|
68 |
+ * @param yArr : y축 카테고리 배열 데이터 |
|
69 |
+ */ |
|
70 |
+ dataGrouping: function (data, yArr) { |
|
71 |
+ if (!Array.isArray(data) || !data) { |
|
72 |
+ return {}; |
|
73 |
+ } |
|
74 |
+ return data.reduce((acc, cur) => { |
|
75 |
+ if (!acc[cur.categoryData]) { |
|
76 |
+ acc[cur.categoryData] = {}; |
|
77 |
+ // 각 필드 초기화 |
|
78 |
+ yArr.forEach(field => { |
|
79 |
+ acc[cur.categoryData][field.valNm] = { values: [], sum: 0, min: Infinity, max: -Infinity, count: 0 }; |
|
110 | 80 |
}); |
111 |
- return result; |
|
112 |
- }, |
|
81 |
+ } |
|
113 | 82 |
|
114 |
- /** |
|
115 |
- * 데이터 필터링 |
|
116 |
- * 선택 된 그룹의 데이터로 가공 |
|
117 |
- */ |
|
118 |
- setFilteringData : function(dataList ,subGroupArr, selectedSubGroup){ |
|
119 |
- // groupSubArr에서 selectedSubGroup의 index를 찾아서 그 columnNm을 찾아옴 |
|
120 |
- const selectedSubGroupNm = subGroupArr.find(column => column.index === Number(selectedSubGroup)).columnNm; |
|
121 |
- return dataList.filter(data => data.group === selectedSubGroupNm); |
|
122 |
- }, |
|
123 |
- /** |
|
124 |
- * 음수 차트 데이터 처리 |
|
125 |
- */ |
|
126 |
- convertValuesToNegative: function(data, fieldNm){ |
|
127 |
- // 데이터 리스트를 순회하며 각 객체의 값을 확인 |
|
128 |
- let test = data.forEach(obj => { |
|
129 |
- obj[fieldNm] = -Math.abs(obj[fieldNm]); |
|
83 |
+ // 각 필드별 합계 계산 |
|
84 |
+ yArr.forEach(field => { |
|
85 |
+ const fieldName = field.valNm; |
|
86 |
+ // cur[fieldName]이 배열인지 확인하고, 아니라면 배열로 만듦 |
|
87 |
+ let values = Array.isArray(cur[fieldName]) ? cur[fieldName] : [cur[fieldName]]; |
|
88 |
+ values.forEach(value => { |
|
89 |
+ acc[cur.categoryData][fieldName].values.push(value); |
|
90 |
+ acc[cur.categoryData][fieldName].sum += value; |
|
91 |
+ acc[cur.categoryData][fieldName].min = Math.min(acc[cur.categoryData][fieldName].min, value); |
|
92 |
+ acc[cur.categoryData][fieldName].max = Math.max(acc[cur.categoryData][fieldName].max, value); |
|
93 |
+ acc[cur.categoryData][fieldName].count += 1; |
|
130 | 94 |
}); |
131 |
- return test; |
|
132 |
- }, |
|
133 |
- |
|
95 |
+ }); |
|
96 |
+ |
|
97 |
+ return acc; |
|
98 |
+ }, {}); |
|
99 |
+ }, |
|
100 |
+ |
|
101 |
+ /** |
|
102 |
+ * 데이터 계산 값으로 가공 (min, max, sum, avg) |
|
103 |
+ * @param groupData : 그룹화된 데이터 |
|
104 |
+ * @param selectedCal : 사용자가 선택한 계산 값 |
|
105 |
+ */ |
|
106 |
+ calculateSetting: function (groupData, selectedCal) { |
|
107 |
+ let result = Object.keys(groupData).map(categoryData => { |
|
108 |
+ const result = { categoryData: categoryData }; |
|
109 |
+ Object.keys(groupData[categoryData]).forEach(fieldName => { |
|
110 |
+ const fieldData = groupData[categoryData][fieldName]; |
|
111 |
+ switch (selectedCal) { |
|
112 |
+ case "sum": |
|
113 |
+ result[fieldName] = fieldData.sum; |
|
114 |
+ break; |
|
115 |
+ case "avg": |
|
116 |
+ result[fieldName] = fieldData.sum / fieldData.count; |
|
117 |
+ break; |
|
118 |
+ case "min": |
|
119 |
+ result[fieldName] = fieldData.min; |
|
120 |
+ break; |
|
121 |
+ case "max": |
|
122 |
+ result[fieldName] = fieldData.max; |
|
123 |
+ break; |
|
124 |
+ } |
|
125 |
+ }); |
|
126 |
+ return result; |
|
127 |
+ }); |
|
128 |
+ return result; |
|
129 |
+ }, |
|
130 |
+ |
|
131 |
+ /** |
|
132 |
+ * 데이터 필터링 |
|
133 |
+ * 선택 된 그룹의 데이터로 가공 |
|
134 |
+ */ |
|
135 |
+ setFilteringData: function (dataList, subGroupArr, selectedSubGroup) { |
|
136 |
+ // groupSubArr에서 selectedSubGroup의 index를 찾아서 그 columnNm을 찾아옴 |
|
137 |
+ const selectedSubGroupNm = subGroupArr.find(column => column.index === Number(selectedSubGroup)).columnNm; |
|
138 |
+ return dataList.filter(data => data.group === selectedSubGroupNm); |
|
139 |
+ }, |
|
140 |
+ /** |
|
141 |
+ * 음수 차트 데이터 처리 |
|
142 |
+ */ |
|
143 |
+ convertValuesToNegative: function (data, fieldNm) { |
|
144 |
+ // 데이터 리스트를 순회하며 각 객체의 값을 확인 |
|
145 |
+ let test = data.forEach(obj => { |
|
146 |
+ obj[fieldNm] = -Math.abs(obj[fieldNm]); |
|
147 |
+ }); |
|
148 |
+ return test; |
|
149 |
+ }, |
|
150 |
+ |
|
134 | 151 |
} |
135 | 152 |
|
136 | 153 |
export default chartDataTransform;(파일 끝에 줄바꿈 문자 없음) |
--- client/views/component/elementComponent/BaseComponent.vue
+++ client/views/component/elementComponent/BaseComponent.vue
... | ... | @@ -32,9 +32,8 @@ |
32 | 32 |
}, |
33 | 33 |
mounted() { |
34 | 34 |
let changeData = this.component.component_itm; |
35 |
- let rowData = changeData.dataTable.rowData; |
|
36 | 35 |
if (this.component.component_itm.data_list == null) { |
37 |
- this.component.component_itm.data_list = chartDataTransform.createData(rowData, changeData.categoryAxis, changeData.valueAxis, "null"); |
|
36 |
+ this.component.component_itm.data_list = chartDataTransform.createData(changeData.dataTable, changeData.categoryAxis, changeData.valueAxis, "null"); |
|
38 | 37 |
} |
39 | 38 |
}, |
40 | 39 |
} |
--- client/views/pages/custom/InsertDataAnalytics.vue
+++ client/views/pages/custom/InsertDataAnalytics.vue
... | ... | @@ -184,7 +184,7 @@ |
184 | 184 |
<div v-for="(column, idx) of this.currentDataTable.columnDatas" :key="idx" :class="{ |
185 | 185 |
item: true, |
186 | 186 |
mb5: idx < currentDataTable.columnDatas.length - 1, |
187 |
- }" draggable="true" @dragstart="startDrag($event, column, idx)"> |
|
187 |
+ }" draggable="true" @dragstart="startDrag(column)"> |
|
188 | 188 |
<p> |
189 | 189 |
<b>{{ column.displyColumnNm }}</b> ({{ column.columnNm }}) : [{{ column.dataTy }}] |
190 | 190 |
</p> |
... | ... | @@ -201,7 +201,7 @@ |
201 | 201 |
<div class="flex30 mb10"> |
202 | 202 |
<div class="editor-box content-box pd10"> |
203 | 203 |
<p class="object-title mb5">항목(Category)</p> |
204 |
- <div class="overflow-y" style="height: calc(100% - 22px)" @drop.prevent="onDrop($event, 'xdata')" @dragenter.prevent @dragover.prevent> |
|
204 |
+ <div class="overflow-y" style="height: calc(100% - 22px)" @drop.prevent="onDrop('xdata')" @dragenter.prevent @dragover.prevent> |
|
205 | 205 |
<template v-if="dataX.length > 0"> |
206 | 206 |
<div v-for="(column, indx) of dataX" :key="indx" :class="{ |
207 | 207 |
'item flex justify-between align-center': true, |
... | ... | @@ -227,7 +227,7 @@ |
227 | 227 |
<option v-for="(item, idx) of calcList" :key="idx" :value="item.key">{{ item.value }}</option> |
228 | 228 |
</select> |
229 | 229 |
</div> |
230 |
- <div class="overflow-y" style="height: calc(100% - 22px)" @drop.prevent="onDrop($event, 'ydata')" @dragenter.prevent @dragover.prevent> |
|
230 |
+ <div class="overflow-y" style="height: calc(100% - 22px)" @drop.prevent="onDrop('ydata')" @dragenter.prevent @dragover.prevent> |
|
231 | 231 |
<template v-if="dataY.length > 0"> |
232 | 232 |
<div v-for="(column, indx) of dataY" :key="indx" :class="{ |
233 | 233 |
'item flex justify-between align-center': true, |
... | ... | @@ -299,7 +299,7 @@ |
299 | 299 |
<span v-else>수정</span> |
300 | 300 |
</button> |
301 | 301 |
<button class="blue-border-btn small-btn" @click="fnInit"> 초기화 </button> |
302 |
- <button class="darkg-btn small-btn" @click="moveBack"> 취소 </button> |
|
302 |
+ <button class="darkg-btn small-btn" @click="fnGotoList">취소</button> |
|
303 | 303 |
</div> |
304 | 304 |
</div> |
305 | 305 |
</div> |
... | ... | @@ -482,23 +482,22 @@ |
482 | 482 |
name: "라인 백그라운드 차트", |
483 | 483 |
}, |
484 | 484 |
], |
485 |
+ calcList: [ |
|
486 |
+ { key: "default", value: "기본" }, |
|
487 |
+ { key: "sum", value: "합계" }, |
|
488 |
+ { key: "avg", value: "평균" }, |
|
489 |
+ { key: "min", value: "최솟값" }, |
|
490 |
+ { key: "max", value: "최댓값" }, |
|
491 |
+ ], |
|
485 | 492 |
|
486 | 493 |
pageId: this.$route.query.page_id, |
487 |
- |
|
488 |
- activeTab: "pageInfo", |
|
489 |
- activeOption: "LAYOUT", |
|
490 | 494 |
|
491 | 495 |
isModalOpen: false, |
492 | 496 |
isTabZoneOpen: false, |
493 | 497 |
isAttributeOpen: false, |
494 | 498 |
|
495 |
- // 최상위 레이아웃 정보 담는 객체 |
|
496 |
- splitInfo: _.cloneDeep(this.$getDefaultJobGroup().customSplitter), |
|
497 |
- splitInfo_dumy: _.cloneDeep(this.$getDefaultJobGroup().customSplitter), |
|
498 |
- |
|
499 |
- dragData: {}, |
|
500 |
- dataX: [], |
|
501 |
- dataY: [], |
|
499 |
+ activeTab: "pageInfo", |
|
500 |
+ activeOption: "LAYOUT", |
|
502 | 501 |
|
503 | 502 |
// 페이지정보 탭 |
504 | 503 |
customTitle: null, // 제목 |
... | ... | @@ -506,17 +505,8 @@ |
506 | 505 |
customComment: null, // 설명 |
507 | 506 |
|
508 | 507 |
activeIndex: null, |
509 |
- createChartData: _.cloneDeep(this.$getDefaultJobGroup().componentData), // x, y축 (객체 형식으로 데이터 수정 필요) |
|
510 | 508 |
|
511 |
- // 레이아웃 및 컴포넌트 |
|
512 |
- // 레이아웃 |
|
513 |
- // 타이틀 |
|
514 |
- layoutSj: Object.assign({}, this.$getDefaultObject().layoutSj), |
|
515 |
- |
|
516 |
- // 컴포넌트 |
|
517 |
- |
|
518 |
- |
|
519 |
- // 잡그룹목록 |
|
509 |
+ splitInfo: _.cloneDeep(this.$getDefaultJobGroup().customSplitter), |
|
520 | 510 |
jobGroupList: [], |
521 | 511 |
|
522 | 512 |
// 현재 작업 객체 |
... | ... | @@ -526,24 +516,19 @@ |
526 | 516 |
currentCalc: "default", |
527 | 517 |
currentDataTable: Object.assign({}, this.$getDefaultObject().dataTable), |
528 | 518 |
|
529 |
- // 컬럼정보 |
|
530 |
- calcList: [ |
|
531 |
- { key: "default", value: "기본" }, |
|
532 |
- { key: "sum", value: "합계" }, |
|
533 |
- { key: "avg", value: "평균" }, |
|
534 |
- { key: "min", value: "최솟값" }, |
|
535 |
- { key: "max", value: "최댓값" }, |
|
536 |
- ], |
|
519 |
+ dragData: {}, |
|
520 |
+ dataX: [], |
|
521 |
+ dataY: [], |
|
537 | 522 |
}; |
538 | 523 |
}, |
539 | 524 |
|
540 | 525 |
created() { |
541 | 526 |
this.activeTab = "pageInfo"; |
542 | 527 |
|
543 |
- if (this.pageId != null && this.pageId != undefined) { |
|
544 |
- this.getCustomData(); // 기존 데이터 가져오기 |
|
545 |
- } else { |
|
528 |
+ if (this.$isEmpty(this.pageId)) { |
|
546 | 529 |
this.init(); |
530 |
+ } else { |
|
531 |
+ this.getCustomData(); // 기존 데이터 가져오기 |
|
547 | 532 |
} |
548 | 533 |
}, |
549 | 534 |
|
... | ... | @@ -552,6 +537,140 @@ |
552 | 537 |
watch: {}, |
553 | 538 |
|
554 | 539 |
methods: { |
540 |
+ // 초기화 |
|
541 |
+ async init() { |
|
542 |
+ // 탭, 옵션 초기화 |
|
543 |
+ this.$activeTab = "pageInfo"; |
|
544 |
+ this.activeOption = "LAYOUT"; |
|
545 |
+ this.activeIndex = null; |
|
546 |
+ |
|
547 |
+ // 페이지 정보 초기화 |
|
548 |
+ this.initPageInfo(); |
|
549 |
+ |
|
550 |
+ // 레이아웃 초기화 |
|
551 |
+ let splitInfo = _.cloneDeep(this.$getDefaultJobGroup().customSplitter); |
|
552 |
+ splitInfo.se = "splitter"; |
|
553 |
+ splitInfo.depth = 0; |
|
554 |
+ splitInfo.layout_nm = "LAY_" + this.generateShortUUID(); |
|
555 |
+ splitInfo.position_idx = 1; |
|
556 |
+ splitInfo.styleSheet.borderStyle = Object.assign({}, this.$getDefaultJobGroup().borderStyle); |
|
557 |
+ splitInfo.styleSheet.background_style = Object.assign({}, this.$getDefaultJobGroup().background_style); |
|
558 |
+ this.splitInfo = splitInfo; |
|
559 |
+ |
|
560 |
+ // 데이터 초기화 |
|
561 |
+ this.jobGroupList = []; |
|
562 |
+ |
|
563 |
+ this.initCurrent(this.splitInfo); // 현재 작업 객체 초기화 |
|
564 |
+ }, |
|
565 |
+ |
|
566 |
+ // 페이지 정보 초기화 |
|
567 |
+ initPageInfo() { |
|
568 |
+ this.customTitle = null; |
|
569 |
+ this.customComment = null; |
|
570 |
+ this.public_at = true; |
|
571 |
+ }, |
|
572 |
+ |
|
573 |
+ // 현재 작업 객체 초기화 |
|
574 |
+ initCurrent(layout) { |
|
575 |
+ this.currentLayout = layout; |
|
576 |
+ |
|
577 |
+ // 레이어에 컴포넌트를 생성한 경우 |
|
578 |
+ let component = layout.component; |
|
579 |
+ if (component != null) { |
|
580 |
+ // 컴포넌트 선택 |
|
581 |
+ this.activeIndex = null; // 초기화 |
|
582 |
+ this.chartComponent.forEach((item, idx) => { |
|
583 |
+ if (item.id === component.component_itm.chart_knd) { |
|
584 |
+ this.activeIndex = idx; |
|
585 |
+ } |
|
586 |
+ }); |
|
587 |
+ |
|
588 |
+ // 컬럼 정보 변경 |
|
589 |
+ this.dataX = component.component_itm.categoryAxis; |
|
590 |
+ this.dataY = component.component_itm.valueAxis; |
|
591 |
+ this.currentCalc = component.component_itm.chart_cal; |
|
592 |
+ |
|
593 |
+ // 현재 잡그룹 변경 |
|
594 |
+ if (component.jobInfo.length > 0) { |
|
595 |
+ this.currentJobGroupIdx = null; |
|
596 |
+ this.currentJobGroup = component.jobInfo[0]; |
|
597 |
+ |
|
598 |
+ // 현재 데이터테이블 변경 |
|
599 |
+ if (this.currentJobGroup.jobItms.length === 0) { |
|
600 |
+ this.currentDataTable = Object.assign({}, this.$getDefaultObject().dataTable); |
|
601 |
+ } else { |
|
602 |
+ const index = this.currentJobGroup.jobItms.length - 1; |
|
603 |
+ this.currentDataTable = this.currentJobGroup.jobItms[index].dataTable; |
|
604 |
+ } |
|
605 |
+ |
|
606 |
+ this.onChangeChartData(); // 차트 데이터 수정 |
|
607 |
+ |
|
608 |
+ return; |
|
609 |
+ } |
|
610 |
+ } |
|
611 |
+ |
|
612 |
+ this.currentJobGroupIdx = null; |
|
613 |
+ this.currentJobGroup = Object.assign({}, this.$getDefaultObject().jobGroup); |
|
614 |
+ this.initColumnInfo(); // 현재 컬럼 정보 초기화 |
|
615 |
+ }, |
|
616 |
+ |
|
617 |
+ // 현재 컬럼 정보 초기화 |
|
618 |
+ initColumnInfo() { |
|
619 |
+ // 현재 데이터테이블 변경 |
|
620 |
+ if (this.currentJobGroup.jobItms.length === 0) { |
|
621 |
+ this.currentDataTable = Object.assign({}, this.$getDefaultObject().dataTable); |
|
622 |
+ } else { |
|
623 |
+ const index = this.currentJobGroup.jobItms.length - 1; |
|
624 |
+ this.currentDataTable = this.currentJobGroup.jobItms[index].dataTable; |
|
625 |
+ } |
|
626 |
+ |
|
627 |
+ // 컬럼 정보 초기화 |
|
628 |
+ this.dragData = {}; |
|
629 |
+ this.dataX = []; |
|
630 |
+ this.dataY = []; |
|
631 |
+ this.currentCalc = "default"; |
|
632 |
+ |
|
633 |
+ // 컴포넌트가 있는 경우 컴포넌트 데이터 초기화 |
|
634 |
+ let component = this.currentLayout.component; |
|
635 |
+ if (component != null) { |
|
636 |
+ component.component_itm.dataTable = this.currentJobGroup; |
|
637 |
+ component.component_itm.data_list = []; |
|
638 |
+ } |
|
639 |
+ |
|
640 |
+ this.onChangeChartData(); // 차트 데이터 수정 |
|
641 |
+ }, |
|
642 |
+ |
|
643 |
+ // 기존 데이터 가져오기 |
|
644 |
+ getCustomData() { |
|
645 |
+ const vm = this; |
|
646 |
+ axios({ |
|
647 |
+ url: "/custom/customPageUpdateSelect", |
|
648 |
+ method: "post", |
|
649 |
+ headers: { "Content-Type": "application/json; charset=UTF-8" }, |
|
650 |
+ data: { page_id: vm.pageId }, |
|
651 |
+ }) |
|
652 |
+ .then((response) => { |
|
653 |
+ // 페이지정보 |
|
654 |
+ let resPageInfo = response.data.resultData.pageInfo; |
|
655 |
+ vm.customTitle = resPageInfo.ttl; |
|
656 |
+ vm.customComment = resPageInfo.cn; |
|
657 |
+ vm.public_at = resPageInfo.public_at; |
|
658 |
+ |
|
659 |
+ // 레이아웃 |
|
660 |
+ let resSplitterInfo = response.data.resultData.splitterInfo; |
|
661 |
+ vm.splitInfo = resSplitterInfo; |
|
662 |
+ vm.currentLayout = vm.splitInfo; |
|
663 |
+ |
|
664 |
+ // 데이터 목록 |
|
665 |
+ let resjobGroupList = response.data.resultData.jobGroupList; |
|
666 |
+ vm.jobGroupList = resjobGroupList; |
|
667 |
+ }) |
|
668 |
+ .catch((error) => { |
|
669 |
+ vm.$showAlert("오류", "데이터 현황관리 차트 연결 오류, 관리자에게 문의하세요."); |
|
670 |
+ vm.fnGotoList(); |
|
671 |
+ }); |
|
672 |
+ }, |
|
673 |
+ |
|
555 | 674 |
// 현재 탭 변경 |
556 | 675 |
fnChangeTab(type, current) { |
557 | 676 |
if (type == "nav") { |
... | ... | @@ -591,7 +710,7 @@ |
591 | 710 |
} |
592 | 711 |
|
593 | 712 |
if (this.currentLayout.children.length > 0) { |
594 |
- this.$showAlert("메세지", "선택된 레이아웃이 비어있지 않습니다.<br>선택된 레이아웃 내부를 비우거나 다른 레이아웃을 선택해 주세요."); |
|
713 |
+ this.$showAlert("메세지", "선택된 레이아웃이 분할되어 있습니다.<br>선택된 레이아웃 내부를 하나로 합치거나 다른 레이아웃을 선택해 주세요."); |
|
595 | 714 |
return true; |
596 | 715 |
} |
597 | 716 |
|
... | ... | @@ -604,12 +723,18 @@ |
604 | 723 |
|
605 | 724 |
// 유효성 검사 |
606 | 725 |
if (this.validationByCreateComponent(id)) { |
607 |
- return |
|
726 |
+ return; |
|
608 | 727 |
}; |
609 | 728 |
|
610 |
- let isCheck = await this.$showConfirm("컴포넌트 추가", name + " 컴포넌트를 추가하시겠습니까?"); |
|
729 |
+ let message; |
|
730 |
+ if (this.currentLayout.component == null) { |
|
731 |
+ message = name + " 컴포넌트를 추가하시겠습니까?"; |
|
732 |
+ } else { |
|
733 |
+ message = "선택된 레이아웃이 비어있지 않습니다.<br>선택한 컴포넌트로 덮어쓰기 하시겠습니까?"; |
|
734 |
+ } |
|
735 |
+ |
|
736 |
+ let isCheck = await this.$showConfirm("메세지", message); |
|
611 | 737 |
if (isCheck) { |
612 |
- let jobGroup = _.cloneDeep(this.$getDefaultJobGroup().jobGroup); |
|
613 | 738 |
let chartData = _.cloneDeep(this.$getDefaultJobGroup().componentData); |
614 | 739 |
chartData.chart_knd = id; |
615 | 740 |
chartData.component_nm = "ChartCmmn"; |
... | ... | @@ -617,13 +742,14 @@ |
617 | 742 |
|
618 | 743 |
let component = _.cloneDeep(this.$getDefaultJobGroup().component); |
619 | 744 |
component.component_itm = chartData; |
745 |
+ |
|
746 |
+ let jobGroup = Object.assign({}, this.$getDefaultJobGroup().jobGroup); |
|
747 |
+ |
|
620 | 748 |
component.jobInfo = []; |
621 | 749 |
component.jobInfo.push(jobGroup); |
622 | 750 |
|
623 | 751 |
this.currentLayout.se = "component"; |
624 | 752 |
this.currentLayout.component = component; |
625 |
- |
|
626 |
- this.getSelectLayoutChart(); // 선택한 레이아웃의 차트 정보 조회 |
|
627 | 753 |
} |
628 | 754 |
}, |
629 | 755 |
|
... | ... | @@ -632,7 +758,6 @@ |
632 | 758 |
console.log("layout: ", layout); |
633 | 759 |
|
634 | 760 |
this.currentLayout = layout; |
635 |
- this.getSelectLayoutChart(); // 선택한 레이아웃의 차트 정보 조회 |
|
636 | 761 |
|
637 | 762 |
this.optionList = [ |
638 | 763 |
{ id: "LAYOUT", name: "레이아웃", useAt: true }, |
... | ... | @@ -640,31 +765,7 @@ |
640 | 765 |
{ id: "COMPONENT", name: "컴포넌트", useAt: !this.$isEmpty(layout.component) }, |
641 | 766 |
]; |
642 | 767 |
|
643 |
- if (this.$isEmpty(layout.component)) { |
|
644 |
- this.dataX = []; |
|
645 |
- this.dataY = []; |
|
646 |
- this.currentCalc = null; |
|
647 |
- } else { |
|
648 |
- this.dataX = layout.component.component_itm.categoryAxis; |
|
649 |
- this.dataY = layout.component.component_itm.valueAxis; |
|
650 |
- this.currentCalc = layout.component.component_itm.chart_cal; |
|
651 |
- } |
|
652 |
- }, |
|
653 |
- |
|
654 |
- // 선택한 레이아웃의 차트 정보 조회 |
|
655 |
- getSelectLayoutChart() { |
|
656 |
- if (this.currentLayout.se == "component") { |
|
657 |
- let chartId = this.currentLayout.component.component_itm.chart_knd; |
|
658 |
- if (this.$isEmpty(chartId)) { |
|
659 |
- this.chartComponent.forEach((item, idx) => { |
|
660 |
- if (item.id === chartId) { |
|
661 |
- this.activeIndex = idx; |
|
662 |
- } |
|
663 |
- }); |
|
664 |
- } else { |
|
665 |
- this.activeIndex = null; |
|
666 |
- } |
|
667 |
- } |
|
768 |
+ this.initCurrent(layout); // 현재 작업 객체 초기화 |
|
668 | 769 |
}, |
669 | 770 |
|
670 | 771 |
findLoop(item) { |
... | ... | @@ -692,7 +793,6 @@ |
692 | 793 |
} |
693 | 794 |
|
694 | 795 |
let copy = _.cloneDeep(this.currentLayout); |
695 |
- copy.se = "splitter"; |
|
696 | 796 |
copy.parents_splitter_id = this.currentLayout.layout_nm; |
697 | 797 |
copy.depth = this.currentLayout.depth + 1; |
698 | 798 |
copy.indx = 0; |
... | ... | @@ -802,22 +902,6 @@ |
802 | 902 |
return fullUUID.replace(/-/g, '').substring(0, 8); |
803 | 903 |
}, |
804 | 904 |
|
805 |
- // 초기화 |
|
806 |
- async init() { |
|
807 |
- this.splitInfo = _.cloneDeep(this.$getDefaultJobGroup().customSplitter); |
|
808 |
- this.splitInfo.se = "splitter"; |
|
809 |
- this.splitInfo.depth = 0; |
|
810 |
- this.splitInfo.layout_nm = "LAY_" + this.generateShortUUID(); |
|
811 |
- this.splitInfo.position_idx = 1; |
|
812 |
- this.splitInfo.styleSheet.borderStyle = Object.assign({}, this.$getDefaultJobGroup().borderStyle); |
|
813 |
- this.splitInfo.styleSheet.background_style = Object.assign({}, this.$getDefaultJobGroup().background_style); |
|
814 |
- |
|
815 |
- this.currentLayout = this.splitInfo; |
|
816 |
- |
|
817 |
- // 데이터 관리 초기화 |
|
818 |
- this.jobGroupList = []; |
|
819 |
- }, |
|
820 |
- |
|
821 | 905 |
// 초기화 버튼 동작 |
822 | 906 |
async fnInit() { |
823 | 907 |
let isCheck = await this.$showConfirm("초기화", "초기화 하시겠습니까? 데이터가 모두 삭제됩니다."); |
... | ... | @@ -829,6 +913,7 @@ |
829 | 913 |
// 컬럼정보 비우기 |
830 | 914 |
fnInitColInfo() { |
831 | 915 |
this.currentJobGroup = Object.assign({}, this.$getDefaultObject().jobGroup); |
916 |
+ this.initColumnInfo(); // 현재 컬럼 정보 초기화 |
|
832 | 917 |
}, |
833 | 918 |
|
834 | 919 |
// 값 계산법 변경 |
... | ... | @@ -836,97 +921,65 @@ |
836 | 921 |
this.currentLayout.component.component_itm.chart_cal = value; |
837 | 922 |
}, |
838 | 923 |
|
839 |
- // 기존 데이터 가져오기 |
|
840 |
- getCustomData() { |
|
841 |
- const vm = this; |
|
842 |
- axios({ |
|
843 |
- url: "/custom/customPageUpdateSelect", |
|
844 |
- method: "post", |
|
845 |
- headers: { "Content-Type": "application/json; charset=UTF-8" }, |
|
846 |
- data: { page_id: vm.pageId }, |
|
847 |
- }) |
|
848 |
- .then(function (response) { |
|
849 |
- let resPageInfo = response.data.resultData.pageInfo; |
|
850 |
- let resjobGroupList = response.data.resultData.jobGroupList; |
|
851 |
- let resSplitterInfo = response.data.resultData.splitterInfo; |
|
852 |
- |
|
853 |
- vm.customTitle = resPageInfo.ttl; |
|
854 |
- vm.customComment = resPageInfo.cn; |
|
855 |
- |
|
856 |
- vm.splitInfo = resSplitterInfo; |
|
857 |
- |
|
858 |
- vm.splitInfo_dumy.layout_nm = "dumy"; |
|
859 |
- vm.splitInfo_dumy.se = "splitter"; |
|
860 |
- vm.splitInfo_dumy.children.push(vm.splitInfo); |
|
861 |
- |
|
862 |
- vm.jobGroupList = resjobGroupList; |
|
863 |
- |
|
864 |
- vm.currentLayout = vm.splitInfo; |
|
865 |
- vm.public_at = resPageInfo.public_at; |
|
866 |
- vm.getSelectLayoutChart(); |
|
867 |
- }) |
|
868 |
- .catch(function (error) { |
|
869 |
- vm.$showAlert( |
|
870 |
- "데이터 현황관리 차트 연결", |
|
871 |
- "데이터 현황관리 차트 연결 오류, 관리자에게 문의하세요." |
|
872 |
- ); |
|
873 |
- vm.moveBack(); |
|
874 |
- }); |
|
875 |
- }, |
|
876 |
- |
|
924 |
+ // 레이아웃 삭제 |
|
877 | 925 |
async deleteSplitterLayout() { |
878 | 926 |
if (!this.currentLayout.layout_nm) { |
879 | 927 |
this.$showAlert("메세지", "삭제할 레이아웃이 없습니다."); |
880 | 928 |
return; |
881 | 929 |
} |
882 |
- if (!this.currentLayout.parents_splitter_id) { |
|
930 |
+ |
|
931 |
+ if (this.currentLayout.layout_nm == this.splitInfo.layout_nm) { |
|
883 | 932 |
this.$showAlert("메세지", "최상위 레이아웃은 삭제할 수 없습니다."); |
884 | 933 |
return; |
885 | 934 |
} |
886 |
- if ( |
|
887 |
- await this.$showConfirm( |
|
888 |
- "레이아웃 삭제", |
|
889 |
- "선택한 레이아웃을 삭제하시겠습니까?" |
|
890 |
- ) |
|
891 |
- ) { |
|
892 |
- let parentLayout = this.findParentLayout( |
|
893 |
- this.splitInfo, |
|
894 |
- this.currentLayout.parents_splitter_id |
|
895 |
- ); |
|
896 |
- //선택한 레이아웃의 형제정보 찾기 |
|
897 |
- let otherIdx = parentLayout.children.findIndex( |
|
898 |
- (item) => item.layout_nm !== this.currentLayout.layout_nm |
|
899 |
- ); |
|
900 |
- let otherSplit = parentLayout.children[otherIdx]; |
|
901 |
- //otherSplit의 component, children 정보 가져오기 |
|
902 |
- let otherComponent = otherSplit.component; |
|
903 |
- let otherChildren = otherSplit.children; |
|
904 |
- let layoutSize1 = otherSplit.layout_size1; |
|
905 |
- let layoutSize2 = otherSplit.layout_size2; |
|
906 |
- let layoutType = otherSplit.layout_type; |
|
907 |
- let se = otherSplit.se; |
|
908 |
- let size = otherSplit.size; |
|
909 |
- let styleSheet = otherSplit.styleSheet; |
|
910 | 935 |
|
911 |
- // 부모 레이아웃에 다른 split의 정보 넣어 주기 |
|
912 |
- parentLayout.component = otherComponent; |
|
913 |
- parentLayout.children = otherChildren; |
|
914 |
- parentLayout.layout_size1 = layoutSize1; |
|
915 |
- parentLayout.layout_size2 = layoutSize2; |
|
916 |
- parentLayout.layout_type = layoutType; |
|
917 |
- parentLayout.se = se; |
|
918 |
- parentLayout.size = size; |
|
919 |
- parentLayout.styleSheet = styleSheet; |
|
936 |
+ let isCheck = await this.$showConfirm( |
|
937 |
+ "레이아웃 삭제", |
|
938 |
+ "선택한 레이아웃을 삭제하시겠습니까?" |
|
939 |
+ ); |
|
940 |
+ if (!isCheck) { |
|
941 |
+ return; |
|
942 |
+ } |
|
920 | 943 |
|
921 |
- // 자식에게서 가져온 자식의 자식 정보의 부모 정보 변경 |
|
922 |
- if (parentLayout.children.length > 0) { |
|
923 |
- parentLayout.children.forEach((item) => { |
|
924 |
- item.parents_splitter_id = parentLayout.layout_nm; |
|
925 |
- }); |
|
926 |
- } |
|
944 |
+ let parentLayout = this.findParentLayout( |
|
945 |
+ this.splitInfo, |
|
946 |
+ this.currentLayout.parents_splitter_id |
|
947 |
+ ); |
|
948 |
+ |
|
949 |
+ //선택한 레이아웃의 형제정보 찾기 |
|
950 |
+ let otherIdx = parentLayout.children.findIndex( |
|
951 |
+ (item) => item.layout_nm !== this.currentLayout.layout_nm |
|
952 |
+ ); |
|
953 |
+ let otherSplit = parentLayout.children[otherIdx]; |
|
954 |
+ //otherSplit의 component, children 정보 가져오기 |
|
955 |
+ let otherComponent = otherSplit.component; |
|
956 |
+ let otherChildren = otherSplit.children; |
|
957 |
+ let layoutSize1 = otherSplit.layout_size1; |
|
958 |
+ let layoutSize2 = otherSplit.layout_size2; |
|
959 |
+ let layoutType = otherSplit.layout_type; |
|
960 |
+ let se = otherSplit.se; |
|
961 |
+ let size = otherSplit.size; |
|
962 |
+ let styleSheet = otherSplit.styleSheet; |
|
963 |
+ |
|
964 |
+ // 부모 레이아웃에 다른 split의 정보 넣어 주기 |
|
965 |
+ parentLayout.component = otherComponent; |
|
966 |
+ parentLayout.children = otherChildren; |
|
967 |
+ parentLayout.layout_size1 = layoutSize1; |
|
968 |
+ parentLayout.layout_size2 = layoutSize2; |
|
969 |
+ parentLayout.layout_type = layoutType; |
|
970 |
+ parentLayout.se = se; |
|
971 |
+ parentLayout.size = size; |
|
972 |
+ parentLayout.styleSheet = styleSheet; |
|
973 |
+ |
|
974 |
+ // 자식에게서 가져온 자식의 자식 정보의 부모 정보 변경 |
|
975 |
+ if (parentLayout.children.length > 0) { |
|
976 |
+ parentLayout.children.forEach((item) => { |
|
977 |
+ item.parents_splitter_id = parentLayout.layout_nm; |
|
978 |
+ }); |
|
927 | 979 |
} |
928 | 980 |
}, |
929 | 981 |
|
982 |
+ // 부모 요소 검색 |
|
930 | 983 |
findParentLayout(splitInfo, selectParentLayoutId) { |
931 | 984 |
// splitInfo가 배열인 경우 각 요소에 대해 재귀적으로 함수를 호출 |
932 | 985 |
if (Array.isArray(splitInfo)) { |
... | ... | @@ -957,7 +1010,7 @@ |
957 | 1010 |
}, |
958 | 1011 |
|
959 | 1012 |
// 취소 (데이터활용관리 목록으로 이동) |
960 |
- async moveBack() { |
|
1013 |
+ async fnGotoList() { |
|
961 | 1014 |
let isCheck = await this.$showConfirm("경고", "취소할 경우 작성된 내용이 삭제됩니다."); |
962 | 1015 |
if (isCheck) { |
963 | 1016 |
this.$router.push({ path: "/customSelectList.page" }); |
... | ... | @@ -965,24 +1018,43 @@ |
965 | 1018 |
}, |
966 | 1019 |
|
967 | 1020 |
// 잡그룹 추가 |
968 |
- fnCreateJobGroup() { |
|
1021 |
+ async fnCreateJobGroup() { |
|
1022 |
+ let component = this.currentLayout.component; |
|
1023 |
+ if (component != null) { |
|
1024 |
+ if (!this.$isEmpty(component.component_itm.data_list)) { |
|
1025 |
+ let isCheck = await this.$showConfirm("경고", "컴포넌트 컬럼 설정 후, 새 데이터를 추가할 경우 기존 정보가 삭제됩니다.<br>새 데이터를 추가하시겠습니까?"); |
|
1026 |
+ if (!isCheck) { |
|
1027 |
+ return; |
|
1028 |
+ } |
|
1029 |
+ } |
|
1030 |
+ } |
|
1031 |
+ |
|
969 | 1032 |
let jobGroup = Object.assign({}, this.$getDefaultObject().jobGroup); |
970 | 1033 |
jobGroup.group_nm = "데이터" + (this.jobGroupList.length + 1); |
971 | 1034 |
this.jobGroupList.push(jobGroup); |
972 |
- this.fnSelectJobGroup(jobGroup); // 잡그룹 선택 (추가한 잡그룹 선택) |
|
1035 |
+ this.currentJobGroup = jobGroup; |
|
1036 |
+ this.initColumnInfo(); // 현재 컬럼 정보 초기화 |
|
973 | 1037 |
}, |
974 | 1038 |
|
975 | 1039 |
// 잡그룹 선택 |
976 |
- fnSelectJobGroup(jobGroup) { |
|
977 |
- this.currentJobGroup = jobGroup; |
|
978 |
- |
|
979 |
- // 잡그룹 내 마지막 데이터테이블 조회 |
|
980 |
- if (!this.currentJobGroup.jobItms || this.currentJobGroup.jobItms.length === 0) { |
|
981 |
- this.currentDataTable = Object.assign({}, this.$getDefaultObject().dataTable); |
|
982 |
- } else { |
|
983 |
- const index = this.currentJobGroup.jobItms.length - 1; |
|
984 |
- this.currentDataTable = this.currentJobGroup.jobItms[index].dataTable; |
|
1040 |
+ async fnSelectJobGroup(jobGroup) { |
|
1041 |
+ let component = this.currentLayout.component; |
|
1042 |
+ if (component != null && jobGroup.jobItms.length > 0) { |
|
1043 |
+ let index = jobGroup.jobItms.length - 1; |
|
1044 |
+ if (component.component_itm.dataTable == jobGroup.jobItms[index].dataTable) { |
|
1045 |
+ return; |
|
1046 |
+ } |
|
985 | 1047 |
} |
1048 |
+ |
|
1049 |
+ if (!this.$isEmpty(component.component_itm.data_list)) { |
|
1050 |
+ let isCheck = await this.$showConfirm("경고", "컴포넌트 컬럼 설정 후, 다른 데이터를 선택할 경우 기존 정보가 삭제됩니다.<br>다른 데이터를 선택하시겠습니까?"); |
|
1051 |
+ if (!isCheck) { |
|
1052 |
+ return; |
|
1053 |
+ } |
|
1054 |
+ } |
|
1055 |
+ |
|
1056 |
+ this.currentJobGroup = jobGroup; |
|
1057 |
+ this.initColumnInfo(); // 현재 컬럼 정보 초기화 |
|
986 | 1058 |
}, |
987 | 1059 |
|
988 | 1060 |
// 잡그룹관리 모달 열기 |
... | ... | @@ -1005,12 +1077,12 @@ |
1005 | 1077 |
}, |
1006 | 1078 |
|
1007 | 1079 |
// 드래그 이벤트 |
1008 |
- startDrag(event, data, idx) { |
|
1080 |
+ startDrag(data) { |
|
1009 | 1081 |
this.dragData = data; |
1010 | 1082 |
}, |
1011 | 1083 |
|
1012 | 1084 |
// 드랍 이벤트 |
1013 |
- async onDrop(event, type) { |
|
1085 |
+ async onDrop(type) { |
|
1014 | 1086 |
// 컴포넌트가 설정되지 않은 경우 경고 후 실행 취소 |
1015 | 1087 |
if (this.$isEmpty(this.currentLayout.component)) { |
1016 | 1088 |
this.$showAlert("경고", "컴포넌트 등록 후 설정할 수 있습니다."); |
... | ... | @@ -1040,23 +1112,33 @@ |
1040 | 1112 |
this.dataY.push(this.dragData); |
1041 | 1113 |
} |
1042 | 1114 |
|
1115 |
+ this.onChangeChartData(); |
|
1116 |
+ }, |
|
1117 |
+ |
|
1118 |
+ // 차트 데이터 수정 |
|
1119 |
+ onChangeChartData() { |
|
1120 |
+ if (this.currentLayout.component == null) { |
|
1121 |
+ return; |
|
1122 |
+ } |
|
1123 |
+ |
|
1043 | 1124 |
if (!this.$isEmpty(this.dataX)) { |
1044 | 1125 |
this.currentLayout.component.component_itm.categoryAxis = this.dataX; |
1045 | 1126 |
} |
1127 |
+ |
|
1046 | 1128 |
if (!this.$isEmpty(this.dataY)) { |
1047 | 1129 |
this.currentLayout.component.component_itm.valueAxis = this.dataY; |
1048 | 1130 |
} |
1049 | 1131 |
|
1050 |
- // 축 데이터를 이용한 차트 데이터 생성 |
|
1051 | 1132 |
if (!this.$isEmpty(this.dataX) && !this.$isEmpty(this.dataY)) { |
1052 | 1133 |
let dataList = chartDataTransform.createData( |
1053 |
- this.currentDataTable.rowData, |
|
1054 |
- this.currentLayout.component.component_itm.categoryAxis, |
|
1055 |
- this.currentLayout.component.component_itm.valueAxis, |
|
1134 |
+ this.currentDataTable, |
|
1135 |
+ this.dataX, |
|
1136 |
+ this.dataY, |
|
1056 | 1137 |
"null" |
1057 | 1138 |
); |
1058 | 1139 |
this.currentLayout.component.component_itm.data_list = dataList; |
1059 | 1140 |
} |
1141 |
+ |
|
1060 | 1142 |
this.currentLayout.component.jobInfo[0] = this.currentJobGroup; |
1061 | 1143 |
}, |
1062 | 1144 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?