forked from github/dataease
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
8d61299f3e
@ -123,7 +123,7 @@ public class ChartViewService {
|
||||
} else if (table.getMode() == 1) {// 抽取
|
||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(table.getInfo(), DataTableInfoDTO.class);
|
||||
String tableName = dataTableInfoDTO.getTable() + "-" + table.getDataSourceId();// todo hBase table name maybe change
|
||||
data = sparkCalc.getData(tableName, xAxis, yAxis, view.getId().split("-")[0]);
|
||||
data = sparkCalc.getData(tableName, xAxis, yAxis, "tmp_" + view.getId().split("-")[0]);
|
||||
}
|
||||
|
||||
// 图表组件可再扩展
|
||||
@ -136,7 +136,6 @@ public class ChartViewService {
|
||||
}
|
||||
for (String[] d : data) {
|
||||
StringBuilder a = new StringBuilder();
|
||||
BigDecimal b = new BigDecimal("0");
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
if (i == xAxis.size() - 1) {
|
||||
a.append(d[i]);
|
||||
@ -147,7 +146,7 @@ public class ChartViewService {
|
||||
x.add(a.toString());
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
int j = i - xAxis.size();
|
||||
series.get(j).getData().add(new BigDecimal(d[i]));
|
||||
series.get(j).getData().add(new BigDecimal(StringUtils.isEmpty(d[i]) ? "0" : d[i]));
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
93
frontend/src/components/DragItem/index.vue
Normal file
93
frontend/src/components/DragItem/index.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-dropdown trigger="click" size="mini" @command="clickItem">
|
||||
<span class="el-dropdown-link">
|
||||
<el-tag size="small" class="item-axis">
|
||||
{{ item.name }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-tag>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-delete" divided :command="beforeClickItem('remove')">
|
||||
<span>{{ $t('chart.delete') }}</span>
|
||||
</el-dropdown-item>
|
||||
<slot />
|
||||
</el-dropdown-menu>
|
||||
</span>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DragItem',
|
||||
props: {
|
||||
item: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clickItem(param) {
|
||||
if (!param) {
|
||||
return
|
||||
}
|
||||
switch (param.type) {
|
||||
case 'rename':
|
||||
this.showRename()
|
||||
break
|
||||
case 'remove':
|
||||
this.removeItem()
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
beforeClickItem(type) {
|
||||
return {
|
||||
type: type
|
||||
}
|
||||
},
|
||||
showRename() {
|
||||
this.item.index = this.index
|
||||
this.item.renameType = 'dimension'
|
||||
this.$emit('onNameEdit', this.item)
|
||||
},
|
||||
removeItem() {
|
||||
this.item.index = this.index
|
||||
this.$emit('closeItem', this.item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item-axis {
|
||||
padding: 1px 6px;
|
||||
margin: 0 3px 2px 3px;
|
||||
text-align: left;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
display: inline-block;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.item-axis:hover {
|
||||
background-color: #fdfdfd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
@ -9,7 +9,7 @@
|
||||
<!--<i v-if="asideHidden" class="el-icon-arrow-right"/>-->
|
||||
<!--</div>-->
|
||||
<slot />
|
||||
<de-horizontal-drag-bar />
|
||||
<de-horizontal-drag-bar v-if="showDragBar" />
|
||||
</el-aside>
|
||||
</template>
|
||||
|
||||
@ -26,6 +26,10 @@ export default {
|
||||
enableAsideHidden: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
showDragBar: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -42,6 +42,12 @@ class TimeYearServiceImpl extends WidgetService {
|
||||
beforeToDraw() {
|
||||
|
||||
}
|
||||
|
||||
filterFieldMethod(fields) {
|
||||
return fields.filter(field => {
|
||||
return field['deType'] === 1
|
||||
})
|
||||
}
|
||||
}
|
||||
const timeYearServiceImpl = new TimeYearServiceImpl({ name: 'timeYearWidget' })
|
||||
export default timeYearServiceImpl
|
||||
|
1
frontend/src/icons/svg/custom.svg
Normal file
1
frontend/src/icons/svg/custom.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617776817333" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7138" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M467.8 656.2c-5.2-5.2-12.2-8.2-19.8-8.2-7.4 0-14.6 2.8-19.8 8.2-5.2 5.2-8.2 12.2-8.2 19.8 0 7.4 2.8 14.6 8.2 19.8l0.2 0.2 82.2 80.2H332c-40.8 0-67.2-15-83.2-47-16.8-34-18.8-83-18.8-117V341.6c30-5.6 57.4-21 78-43.8 23.2-25.8 36-59 36-93.8 0-77.2-62.8-140-140-140s-140 62.8-140 140c0 34 12.4 66.6 34.6 92.2 19.8 22.6 46.2 38.2 75.4 44.6V612c0 29.4 0 84.2 18.8 130.6 23.8 58.6 72 89.4 139.2 89.4h179.4L432 912.4c-10.8 10.8-10.8 28.6 0 39.6l0.2 0.2c5.4 5 12.4 7.8 19.6 7.8 7.6 0 14.6-2.8 19.8-8.2l115.2-114.8c8.4-8.4 13-19.6 13-31.4 0-11.8-4.6-22.6-13-31l-119-118.4zM204 288c-46.4 0-84-37.6-84-84s37.6-84 84-84 84 37.6 84 84-37.6 84-84 84z m646 395.2V412c0-29.4 0-84.2-18.8-130.6-23.8-58.4-72-89.4-139.2-89.4h-179.4L592 111.6c10.8-10.8 10.8-28.6 0-39.6l-0.2-0.2c-5.4-5-12.4-7.8-19.6-7.8-7.6 0-14.6 2.8-19.8 8.2l-115.2 114.8c-8.4 8.4-13 19.6-13 31.4 0 11.8 4.6 22.6 13 31l119.2 118.8c5.2 5.2 12.2 8.2 19.8 8.2 7.4 0 14.6-2.8 19.8-8.2 5.2-5.2 8.2-12.2 8.2-19.8 0-7.4-2.8-14.6-8.2-19.8l-0.2-0.2-82.4-80.4H692c40.8 0 67.2 15 83.2 47 16.8 34 18.8 83 18.8 117v270.4c-30 5.6-57.4 21-78 43.8-23.2 25.8-36 59-36 93.8 0 77.2 62.8 140 140 140s140-62.8 140-140c0-34-12.4-66.6-34.6-92.2-19.8-22.6-46.4-38.2-75.4-44.6zM820 904c-46.4 0-84-37.6-84-84s37.6-84 84-84 84 37.6 84 84-37.6 84-84 84z" p-id="7139"></path></svg>
|
After Width: | Height: | Size: 1.6 KiB |
1
frontend/src/icons/svg/db.svg
Normal file
1
frontend/src/icons/svg/db.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617776907542" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9028" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M925.0304 82.3808c-25.4464-16.6912-61.0816-31.488-105.9328-43.9296-89.1904-24.7808-207.36-38.4-332.6976-38.4s-243.5072 13.6704-332.6976 38.4c-44.9024 12.4416-80.5376 27.2384-105.9328 43.9296C16.0768 103.2192 0 127.1296 0 153.6v614.4c0 26.4704 16.0768 50.432 47.7696 71.2192 25.4464 16.6912 61.0816 31.488 105.9328 43.9296 89.1904 24.7808 207.36 38.4 332.6976 38.4s243.5072-13.6704 332.6976-38.4512c44.9024-12.4416 80.5376-27.2384 105.9328-43.9296 31.6928-20.7872 47.7696-44.7488 47.7696-71.2192v-614.4c0-26.4704-16.0768-50.432-47.7696-71.2192zM167.424 87.7568C252.3136 64.2048 365.568 51.2 486.4 51.2s234.1376 13.0048 318.976 36.5568C897.28 113.3056 921.6 141.9776 921.6 153.6s-24.2688 40.2944-116.224 65.8432C720.4864 242.9952 607.232 256 486.4 256s-234.1376-13.0048-318.976-36.5568C75.52 193.8944 51.2 165.2224 51.2 153.6s24.2688-40.2944 116.224-65.8432z m637.952 746.0864c-84.8896 23.552-198.144 36.5568-318.976 36.5568s-234.1376-13.0048-318.976-36.5568C75.52 808.2944 51.2 779.6224 51.2 768v-131.3792c25.1904 15.8208 59.5968 29.8496 102.5024 41.7792 89.1904 24.7808 207.36 38.4 332.6976 38.4s243.5072-13.6704 332.6976-38.4512c42.9056-11.9296 77.3632-25.9584 102.5024-41.7792v131.3792c0 11.6224-24.2688 40.2944-116.224 65.8432z m0-204.8c-84.8896 23.552-198.144 36.5568-318.976 36.5568s-234.1376-13.0048-318.976-36.5568C75.52 603.4944 51.2 574.8224 51.2 563.2V431.8208c25.1904 15.8208 59.5968 29.8496 102.5024 41.7792 89.1904 24.7808 207.36 38.4 332.6976 38.4s243.5072-13.6704 332.6976-38.4c42.9056-11.9296 77.3632-25.9584 102.5024-41.7792V563.2c0 11.6224-24.2688 40.2944-116.224 65.8432z m0-204.8C720.4864 447.7952 607.232 460.8 486.4 460.8s-234.1376-13.0048-318.976-36.5568C75.52 398.6944 51.2 370.0224 51.2 358.4V227.0208c25.1904 15.8208 59.5968 29.8496 102.5024 41.7792C242.8928 293.5808 361.0624 307.2 486.4 307.2s243.5072-13.6704 332.6976-38.4c42.9056-11.9296 77.3632-25.9584 102.5024-41.7792V358.4c0 11.6224-24.2688 40.2944-116.224 65.8432z" p-id="9029"></path></svg>
|
After Width: | Height: | Size: 2.3 KiB |
1
frontend/src/icons/svg/excel.svg
Normal file
1
frontend/src/icons/svg/excel.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617776873772" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8142" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M931.84 655.36c12.288 0 20.48-8.192 20.48-20.48V296.96l-163.84-167.936h-456.704c-45.056 0-81.92 36.864-81.92 81.92v67.584h-137.216c-22.528 0-40.96 18.432-40.96 40.96v405.504c0 22.528 18.432 40.96 40.96 40.96h137.216v53.248c0 45.056 36.864 81.92 81.92 81.92h538.624c45.056 0 81.92-36.864 81.92-81.92v-61.44c0-12.288-8.192-20.48-20.48-20.48s-20.48 8.192-20.48 20.48v61.44c0 22.528-18.432 40.96-40.96 40.96h-538.624c-22.528 0-40.96-18.432-40.96-40.96v-53.248h225.28c22.528 0 40.96-18.432 40.96-40.96v-405.504c0-22.528-18.432-40.96-40.96-40.96h-225.28v-67.584c0-22.528 18.432-40.96 40.96-40.96h415.744v106.496c0 32.768 26.624 61.44 61.44 61.44h102.4v296.96c0 12.288 8.192 20.48 20.48 20.48z m-618.496-165.888l45.056-65.536h61.44l-71.68 102.4 86.016 118.784h-63.488l-55.296-77.824-55.296 77.824h-63.488l86.016-118.784-73.728-102.4h63.488l40.96 65.536z m495.616-192.512c-12.288 0-20.48-8.192-20.48-20.48v-90.112l106.496 110.592h-86.016z" p-id="8143"></path><path d="M768 614.4h-102.4c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h102.4c12.288 0 20.48-8.192 20.48-20.48s-8.192-20.48-20.48-20.48zM768 512h-102.4c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h102.4c12.288 0 20.48-8.192 20.48-20.48s-8.192-20.48-20.48-20.48zM768 409.6h-102.4c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h102.4c12.288 0 20.48-8.192 20.48-20.48s-8.192-20.48-20.48-20.48z" p-id="8144"></path></svg>
|
After Width: | Height: | Size: 1.7 KiB |
1
frontend/src/icons/svg/pie-rose.svg
Normal file
1
frontend/src/icons/svg/pie-rose.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617857636853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="859" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M172.860952 769.462857c55.832381 66.072381 132.291048 92.769524 208.725334 88.064l4.412952-251.562667c-10.288762-4.705524-24.990476-4.705524-35.279238-15.725714L172.860952 769.487238z m239.616-404.041143l-5.90019-169.813333c-55.832381 0-97.01181 15.725714-142.57981 59.733333l76.434286 136.801524c24.990476-15.725714 45.592381-26.721524 72.045714-26.721524z m122.002286 125.781334h357.229714c0-273.554286-199.92381-490.544762-449.828571-490.544762v371.053714c47.030857 4.705524 92.598857 59.733333 92.598857 119.466667z m-5.875809 22.016c-4.412952 26.721524-24.990476 55.02781-45.592381 77.043809l361.642666 386.755048C951.978667 862.232381 1024 698.733714 1024 517.924571H528.579048v-4.705523z m-111.713524 97.475047h-4.412953V997.424762c111.713524-4.705524 219.014095-55.02781 301.348572-125.781333L463.920762 604.40381c-16.164571 6.290286-30.866286 6.290286-47.055238 6.290285z m-224.914286-92.769524c0 55.02781 20.577524 92.769524 51.44381 130.486858l91.136-77.04381c-14.701714-15.701333-24.990476-33.01181-30.866286-59.733333l-111.713524 6.290285z m113.176381-33.011809c0-33.01181 14.701714-55.02781 30.866286-77.04381L172.860952 186.197333C90.526476 245.930667 39.082667 338.70019 24.380952 447.146667l280.771048 37.741714c0 6.290286 0 0 0 0z" p-id="860"></path></svg>
|
After Width: | Height: | Size: 1.6 KiB |
1
frontend/src/icons/svg/sql.svg
Normal file
1
frontend/src/icons/svg/sql.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1617776943065" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10538" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M923.136 576.512V312.32c0-20.992-13.312-44.032-32.768-55.808l-346.624-199.168c-18.944-11.776-46.592-11.776-65.536 0l-347.136 199.68c-18.944 11.776-32.256 34.816-32.256 55.808v264.192h-20.48V829.44H235.52l242.688 140.288 0.512 0.512c9.216 4.608 20.48 7.168 31.744 7.168 11.776 0 23.04-2.56 31.744-7.168l241.664-140.288h159.232v-252.416h-19.968z m-408.064-465.408h3.584L841.728 296.96 517.12 476.672l-324.608-179.2 322.56-186.368zM167.936 356.352l317.44 174.592v45.568h-317.44v-220.16z m215.552 423.936c-14.848 16.384-34.816 22.016-50.176 22.016-21.504 0-38.4-5.12-50.688-14.336-17.92-13.824-22.528-35.84-24.064-55.808l-1.024-11.776H296.96l1.536 9.216c2.048 14.336 5.12 21.504 10.24 25.088l0.512 0.512c7.168 5.632 15.872 8.192 24.576 7.68 11.776 0 19.968-2.048 25.088-6.144l1.024-0.512c4.096-2.56 6.656-7.68 6.144-13.312-0.512-7.168-4.608-13.824-10.752-16.896l-1.024-0.512c-1.536-1.024-8.192-3.072-13.824-5.12-5.12-1.536-11.264-3.584-17.92-6.144-14.336-4.608-25.6-9.728-32.256-12.8-2.048-1.024-3.584-1.536-4.608-2.048l-1.024-0.512c-15.872-8.192-25.088-25.6-24.064-44.032-0.512-17.408 7.68-33.28 20.992-43.008 13.824-9.728 30.208-14.848 47.104-14.336 21.504 0 36.864 5.632 49.664 17.408 12.8 11.776 20.992 29.696 21.504 48.128l0.512 10.752h-38.4l-1.536-8.704c-2.048-11.264-4.608-18.432-9.216-22.016a36.352 36.352 0 0 0-22.528-7.68H327.68c-7.68 0-15.36 1.536-22.528 4.608-3.584 2.56-6.144 7.168-5.632 11.776v1.024c0 4.608 2.56 8.192 5.632 9.728l1.536 0.512c8.704 4.096 17.408 7.168 26.624 9.216h0.512c14.848 4.096 29.184 9.728 43.008 16.896 15.872 8.704 26.112 27.136 25.6 46.592 0 17.92-7.168 30.72-18.944 44.544z m102.4 116.224l-111.616-67.584h111.616v67.584z m62.464 0v-67.584h116.736l-116.736 67.584z m54.272-111.104l3.584 6.656-26.112 29.184-7.168-13.312c-2.56-4.096-5.12-8.192-8.192-12.288-1.536-2.048-3.072-4.096-4.608-6.656-12.288 6.656-25.6 10.24-39.424 10.24h-3.584c-15.36 0.512-30.72-4.608-43.52-14.336-6.656-4.608-12.8-10.24-18.432-15.872l-0.512-0.512c-14.848-18.432-22.528-43.52-22.528-72.704 0-31.744 7.168-54.784 23.04-72.704 5.12-6.656 11.776-12.288 19.456-16.896 13.312-7.168 27.136-11.776 40.96-13.824h5.12c28.16 0 49.664 10.24 64 30.72 14.848 18.432 22.528 43.52 22.528 72.192 0.512 24.064-6.656 48.128-19.456 68.096 5.632 6.656 10.24 14.336 14.848 22.016z m37.888 3.584v-193.536h39.936v154.624l93.696 5.12v33.792h-133.632z m225.792-212.48h-317.44v-45.568l317.44-174.592v220.16z" p-id="10539"></path><path d="M518.144 632.32h-3.072c-11.264 1.536-22.016 6.656-30.208 15.36l-1.024 1.024c-8.704 13.824-13.312 30.208-12.8 47.104v1.024c-0.512 16.384 3.584 33.28 12.8 46.592l2.048 2.56c7.168 9.216 17.408 14.848 28.16 14.336h4.096c6.144 0 12.288-1.024 18.432-3.584-5.632-8.192-11.776-16.384-18.432-24.064l-6.144-7.168 26.112-28.672 7.68 10.24c4.096 5.12 7.68 9.728 11.776 14.336 2.048 2.56 4.096 4.608 5.632 7.168 3.072-8.704 4.608-18.944 4.608-31.232 0.512-16.896-3.584-33.28-12.8-47.104-9.728-11.776-23.04-17.92-36.864-17.92z" p-id="10540"></path></svg>
|
After Width: | Height: | Size: 3.3 KiB |
@ -693,7 +693,11 @@ export default {
|
||||
filter_null: '为空',
|
||||
filter_not_null: '不为空',
|
||||
filter_include: '包含',
|
||||
filter_not_include: '不包含'
|
||||
filter_not_include: '不包含',
|
||||
rose_type: '玫瑰图模式',
|
||||
radius_mode: '半径',
|
||||
area_mode: '面积',
|
||||
rose_radius: '圆角'
|
||||
},
|
||||
dataset: {
|
||||
datalist: '数据集',
|
||||
@ -770,7 +774,10 @@ export default {
|
||||
current_update_time: '当前更新时间',
|
||||
param: '参数',
|
||||
edit_sql: '编辑SQL',
|
||||
showRow: '显示行'
|
||||
showRow: '显示行',
|
||||
add_excel_table: '添加Excel数据集',
|
||||
add_custom_table: '添加自助数据集',
|
||||
upload_file: '上传文件'
|
||||
},
|
||||
datasource: {
|
||||
create: '新建数据连接',
|
||||
|
@ -88,7 +88,7 @@ div:focus {
|
||||
.de-filter-dialog {
|
||||
min-width: 500px !important;
|
||||
width: 50% !important;
|
||||
|
||||
|
||||
.el-dialog__header{
|
||||
background-color: #f4f4f5;
|
||||
padding: 10px 20px !important;
|
||||
@ -144,3 +144,30 @@ div:focus {
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.de-filter-data-table {
|
||||
.el-table__body-wrapper >table>{
|
||||
tbody {
|
||||
.el-table__row {
|
||||
:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
td {
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.de-filter-data-table::before {
|
||||
height: 0px !important;
|
||||
}
|
||||
|
||||
.custom-component-class {
|
||||
width: 100%;
|
||||
div {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ export const DEFAULT_SIZE = {
|
||||
lineArea: false,
|
||||
pieInnerRadius: 0,
|
||||
pieOuterRadius: 60,
|
||||
pieRoseType: 'radius',
|
||||
pieRoseRadius: 5,
|
||||
funnelWidth: 80,
|
||||
radarShape: 'polygon'
|
||||
}
|
||||
|
@ -50,3 +50,18 @@ export function basePieOption(chart_option, chart) {
|
||||
return chart_option
|
||||
}
|
||||
|
||||
export function rosePieOption(chart_option, chart) {
|
||||
basePieOption(chart_option, chart)
|
||||
let customAttr = {}
|
||||
if (chart.customAttr) {
|
||||
customAttr = JSON.parse(chart.customAttr)
|
||||
if (customAttr.size) {
|
||||
chart_option.series[0].roseType = customAttr.size.pieRoseType
|
||||
chart_option.series[0].itemStyle = {
|
||||
borderRadius: customAttr.size.pieRoseRadius
|
||||
}
|
||||
}
|
||||
}
|
||||
return chart_option
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
import { BASE_BAR, BASE_LINE, HORIZONTAL_BAR, BASE_PIE, BASE_FUNNEL, BASE_RADAR } from '../chart/chart'
|
||||
import { baseBarOption, stackBarOption, horizontalBarOption, horizontalStackBarOption } from '../chart/bar/bar'
|
||||
import { baseLineOption, stackLineOption } from '../chart/line/line'
|
||||
import { basePieOption } from '../chart/pie/pie'
|
||||
import { basePieOption, rosePieOption } from '../chart/pie/pie'
|
||||
import { baseFunnelOption } from '../chart/funnel/funnel'
|
||||
import { baseRadarOption } from '../chart/radar/radar'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
@ -73,6 +73,8 @@ export default {
|
||||
chart_option = stackLineOption(JSON.parse(JSON.stringify(BASE_LINE)), chart)
|
||||
} else if (chart.type === 'pie') {
|
||||
chart_option = basePieOption(JSON.parse(JSON.stringify(BASE_PIE)), chart)
|
||||
} else if (chart.type === 'pie-rose') {
|
||||
chart_option = rosePieOption(JSON.parse(JSON.stringify(BASE_PIE)), chart)
|
||||
} else if (chart.type === 'funnel') {
|
||||
chart_option = baseFunnelOption(JSON.parse(JSON.stringify(BASE_FUNNEL)), chart)
|
||||
} else if (chart.type === 'radar') {
|
||||
|
@ -57,6 +57,18 @@
|
||||
<el-form-item :label="$t('chart.pie_outer_radius')" class="form-item form-item-slider">
|
||||
<el-slider v-model="sizeForm.pieOuterRadius" show-input :show-input-controls="false" input-size="mini" :min="0" :max="100" @change="changeBarSizeCase" />
|
||||
</el-form-item>
|
||||
|
||||
<span v-if="chart.type && chart.type.includes('pie-rose')">
|
||||
<el-form-item :label="$t('chart.rose_type')" class="form-item">
|
||||
<el-radio-group v-model="sizeForm.pieRoseType" size="mini" @change="changeBarSizeCase">
|
||||
<el-radio-button label="radius">{{ $t('chart.radius_mode') }}</el-radio-button>
|
||||
<el-radio-button label="area">{{ $t('chart.area_mode') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('chart.rose_radius')" class="form-item form-item-slider">
|
||||
<el-slider v-model="sizeForm.pieRoseRadius" show-input :show-input-controls="false" input-size="mini" :min="0" :max="100" @change="changeBarSizeCase" />
|
||||
</el-form-item>
|
||||
</span>
|
||||
</el-form>
|
||||
|
||||
<el-form v-if="chart.type && chart.type.includes('funnel')" ref="sizeFormPie" :model="sizeForm" label-width="80px" size="mini">
|
||||
|
@ -90,8 +90,15 @@
|
||||
<div style="width: 100%;display: flex;display: -webkit-flex;justify-content: space-between;flex-direction: row;flex-wrap: wrap;">
|
||||
<el-radio value="line-stack" label="line-stack"><svg-icon icon-class="line-stack" class="chart-icon" /></el-radio>
|
||||
<el-radio value="pie" label="pie"><svg-icon icon-class="pie" class="chart-icon" /></el-radio>
|
||||
<el-radio value="pie-rose" label="pie-rose"><svg-icon icon-class="pie-rose" class="chart-icon" /></el-radio>
|
||||
<el-radio value="funnel" label="funnel"><svg-icon icon-class="funnel" class="chart-icon" /></el-radio>
|
||||
<el-radio value="radar" label="radar"><svg-icon icon-class="radar" class="chart-icon" /></el-radio>
|
||||
</div>
|
||||
<div>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
<el-radio value="" label="" disabled class="disabled-none-cursor"><svg-icon icon-class="" class="chart-icon" /></el-radio>
|
||||
</div>
|
||||
</el-radio-group>
|
||||
@ -321,7 +328,7 @@ export default {
|
||||
const view = JSON.parse(JSON.stringify(this.view))
|
||||
view.id = this.view.id
|
||||
view.sceneId = this.view.sceneId
|
||||
view.name = this.table.name
|
||||
view.name = this.view.name ? this.view.name : this.table.name
|
||||
view.tableId = this.view.tableId
|
||||
// view.xaxis.forEach(function(ele) {
|
||||
// if (!ele.summary || ele.summary === '') {
|
||||
|
144
frontend/src/views/dataset/add/AddCustom.vue
Normal file
144
frontend/src/views/dataset/add/AddCustom.vue
Normal file
@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-row style="height: 26px;">
|
||||
<span style="line-height: 26px;">
|
||||
{{ $t('dataset.add_custom_table') }}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button size="mini" @click="cancel">
|
||||
{{ $t('dataset.cancel') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" :disabled="checkTableList.length < 1" @click="save">
|
||||
{{ $t('dataset.confirm') }}
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row>
|
||||
<el-col>
|
||||
123
|
||||
</el-col>
|
||||
<el-col>
|
||||
456
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post } from '@/api/dataset/dataset'
|
||||
|
||||
export default {
|
||||
name: 'AddCustom',
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
searchTable: '',
|
||||
options: [],
|
||||
dataSource: '',
|
||||
tables: [],
|
||||
checkTableList: [],
|
||||
mode: '0',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// dataSource(val) {
|
||||
// if (val) {
|
||||
// post('/datasource/getTables', { id: val }).then(response => {
|
||||
// this.tables = response.data
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// searchTable(val) {
|
||||
// if (val && val !== '') {
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.includes(val) })))
|
||||
// } else {
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
// }
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// this.initDataSource()
|
||||
},
|
||||
activated() {
|
||||
// this.initDataSource()
|
||||
},
|
||||
methods: {
|
||||
// initDataSource() {
|
||||
// listDatasource().then(response => {
|
||||
// this.options = response.data
|
||||
// })
|
||||
// },
|
||||
|
||||
save() {
|
||||
// console.log(this.checkTableList);
|
||||
// console.log(this.scene);
|
||||
const sceneId = this.param.id
|
||||
const dataSourceId = this.dataSource
|
||||
const tables = []
|
||||
// const mode = this.mode
|
||||
this.checkTableList.forEach(function(name) {
|
||||
tables.push({
|
||||
name: name,
|
||||
sceneId: sceneId,
|
||||
dataSourceId: dataSourceId,
|
||||
type: 'excel',
|
||||
mode: 1
|
||||
})
|
||||
})
|
||||
post('/dataset/table/batchAdd', tables).then(response => {
|
||||
this.$store.dispatch('dataset/setSceneData', new Date().getTime())
|
||||
this.cancel()
|
||||
})
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.dataReset()
|
||||
// this.$router.push('/dataset/home')
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
},
|
||||
|
||||
dataReset() {
|
||||
this.searchTable = ''
|
||||
this.options = []
|
||||
this.dataSource = ''
|
||||
this.tables = []
|
||||
this.checkTableList = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
span{
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
195
frontend/src/views/dataset/add/AddExcel.vue
Normal file
195
frontend/src/views/dataset/add/AddExcel.vue
Normal file
@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-row style="height: 26px;">
|
||||
<span style="line-height: 26px;">
|
||||
{{ $t('dataset.add_excel_table') }}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button size="mini" @click="cancel">
|
||||
{{ $t('dataset.cancel') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="save">
|
||||
{{ $t('dataset.confirm') }}
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-row>
|
||||
<el-row>
|
||||
<el-col style="width: 500px;">
|
||||
<el-form :model="form" :inline="true" size="mini" class="row-style">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.name" :placeholder="$t('commons.name')" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload
|
||||
action="https://jsonplaceholder.typicode.com/posts/"
|
||||
:multiple="false"
|
||||
:show-file-list="false"
|
||||
accept=".xls,.xlsx,.csv"
|
||||
>
|
||||
<el-button size="mini" type="primary">{{ $t('dataset.upload_file') }}</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-card class="box-card dataPreview" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('dataset.data_preview') }}</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<ux-grid
|
||||
ref="plxTable"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
:height="height"
|
||||
:checkbox-config="{highlight: true}"
|
||||
:width-resize="true"
|
||||
>
|
||||
<ux-table-column
|
||||
v-for="field in fields"
|
||||
:key="field.fieldName"
|
||||
min-width="200px"
|
||||
:field="field.fieldName"
|
||||
:title="field.remarks"
|
||||
:resizable="true"
|
||||
/>
|
||||
</ux-grid>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post } from '@/api/dataset/dataset'
|
||||
|
||||
export default {
|
||||
name: 'AddExcel',
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name: ''
|
||||
},
|
||||
fields: [],
|
||||
mode: '1',
|
||||
height: 600
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// dataSource(val) {
|
||||
// if (val) {
|
||||
// post('/datasource/getTables', { id: val }).then(response => {
|
||||
// this.tables = response.data
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// searchTable(val) {
|
||||
// if (val && val !== '') {
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.includes(val) })))
|
||||
// } else {
|
||||
// this.tableData = JSON.parse(JSON.stringify(this.tables))
|
||||
// }
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
// this.initDataSource()
|
||||
},
|
||||
activated() {
|
||||
// this.initDataSource()
|
||||
},
|
||||
methods: {
|
||||
// initDataSource() {
|
||||
// listDatasource().then(response => {
|
||||
// this.options = response.data
|
||||
// })
|
||||
// },
|
||||
|
||||
save() {
|
||||
// console.log(this.checkTableList);
|
||||
// console.log(this.scene);
|
||||
const sceneId = this.param.id
|
||||
const dataSourceId = this.dataSource
|
||||
const tables = []
|
||||
const mode = this.mode
|
||||
this.checkTableList.forEach(function(name) {
|
||||
tables.push({
|
||||
name: name,
|
||||
sceneId: sceneId,
|
||||
dataSourceId: dataSourceId,
|
||||
type: 'excel',
|
||||
mode: parseInt(mode)
|
||||
})
|
||||
})
|
||||
post('/dataset/table/batchAdd', tables).then(response => {
|
||||
this.$store.dispatch('dataset/setSceneData', new Date().getTime())
|
||||
this.cancel()
|
||||
})
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.dataReset()
|
||||
// this.$router.push('/dataset/home')
|
||||
this.$emit('switchComponent', { name: '' })
|
||||
},
|
||||
|
||||
dataReset() {
|
||||
this.searchTable = ''
|
||||
this.options = []
|
||||
this.dataSource = ''
|
||||
this.tables = []
|
||||
this.checkTableList = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
span{
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.row-style>>>.el-form-item__label{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.dataPreview>>>.el-card__header{
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.dataPreview>>>.el-card__body{
|
||||
padding:10px;
|
||||
}
|
||||
</style>
|
@ -83,7 +83,7 @@
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node-list">
|
||||
<span>
|
||||
<span>
|
||||
({{ data.type }})
|
||||
<svg-icon :icon-class="data.type" class="icon" />
|
||||
</span>
|
||||
<span>
|
||||
<span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span>
|
||||
|
@ -132,15 +132,19 @@
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeClickAddData('db')">
|
||||
<svg-icon icon-class="db" class="icon" />
|
||||
{{ $t('dataset.db_data') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeClickAddData('sql')">
|
||||
<svg-icon icon-class="sql" class="icon" />
|
||||
{{ $t('dataset.sql_data') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeClickAddData('excel')">
|
||||
<svg-icon icon-class="excel" class="icon" />
|
||||
{{ $t('dataset.excel_data') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeClickAddData('custom')">
|
||||
<svg-icon icon-class="custom" class="icon" />
|
||||
{{ $t('dataset.custom_data') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -176,7 +180,7 @@
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node-list">
|
||||
<span>
|
||||
<span>
|
||||
({{ data.type }})
|
||||
<svg-icon :icon-class="data.type" class="icon" />
|
||||
</span>
|
||||
<span>
|
||||
<span v-if="data.mode === 0" style="margin-left: 6px"><i class="el-icon-s-operation" /></span>
|
||||
@ -532,10 +536,10 @@ export default {
|
||||
this.addData('AddSQL')
|
||||
break
|
||||
case 'excel':
|
||||
this.$message(param.type)
|
||||
this.addData('AddExcel')
|
||||
break
|
||||
case 'custom':
|
||||
this.$message(param.type)
|
||||
this.addData('AddCustom')
|
||||
break
|
||||
}
|
||||
},
|
||||
@ -578,6 +582,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.icon{
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0
|
||||
}
|
||||
|
@ -22,10 +22,12 @@ import DataHome from './data/DataHome'
|
||||
import ViewTable from './data/ViewTable'
|
||||
import AddDB from './add/AddDB'
|
||||
import AddSQL from './add/AddSQL'
|
||||
import AddExcel from './add/AddExcel'
|
||||
import AddCustom from './add/AddCustom'
|
||||
|
||||
export default {
|
||||
name: 'DataSet',
|
||||
components: { DeMainContainer, DeContainer, DeAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL },
|
||||
components: { DeMainContainer, DeContainer, DeAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL, AddExcel, AddCustom },
|
||||
data() {
|
||||
return {
|
||||
component: DataHome,
|
||||
@ -46,6 +48,12 @@ export default {
|
||||
case 'AddSQL':
|
||||
this.component = AddSQL
|
||||
break
|
||||
case 'AddExcel':
|
||||
this.component = AddExcel
|
||||
break
|
||||
case 'AddCustom':
|
||||
this.component = AddCustom
|
||||
break
|
||||
default:
|
||||
this.component = DataHome
|
||||
break
|
||||
|
@ -69,11 +69,31 @@
|
||||
</de-container>
|
||||
|
||||
<el-dialog
|
||||
v-if="filterVisible"
|
||||
title="过滤组件"
|
||||
:visible.sync="filterVisible"
|
||||
custom-class="de-filter-dialog"
|
||||
>
|
||||
<filter-dialog />
|
||||
<filter-dialog v-if="filterVisible" :widget-id="currentWidgetId">
|
||||
<de-drawing-widget
|
||||
v-if="filterVisible && currentComponent"
|
||||
:id="'component' + currentComponent.id"
|
||||
style="width: 100% !important;"
|
||||
class="component"
|
||||
:element="currentComponent"
|
||||
:item="currentComponent"
|
||||
/>
|
||||
</filter-dialog>
|
||||
<!-- <div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="editPasswordVisible = false">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="editUserPassword('editPasswordForm')">确认</el-button>
|
||||
</div> -->
|
||||
<div style="text-align: end !important;margin: 0 15px !important;">
|
||||
<span slot="footer">
|
||||
<el-button @click="cancelFilter">取 消</el-button>
|
||||
<el-button type="primary" @click="sureFilter">确 定</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</el-container>
|
||||
@ -123,7 +143,10 @@ export default {
|
||||
showIndex: -1,
|
||||
activeName: 'attr',
|
||||
reSelectAnimateIndex: undefined,
|
||||
filterVisible: false
|
||||
filterVisible: false,
|
||||
currentWidgetId: null,
|
||||
currentWidget: null,
|
||||
currentComponent: null
|
||||
}
|
||||
},
|
||||
|
||||
@ -224,11 +247,12 @@ export default {
|
||||
// 画布
|
||||
restore() {
|
||||
// 用保存的数据恢复画布
|
||||
if (localStorage.getItem('canvasData')) {
|
||||
this.$store.commit('setComponentData', this.resetID(JSON.parse(localStorage.getItem('canvasData'))))
|
||||
let canvasData = null
|
||||
if ((canvasData = localStorage.getItem('canvasData')) !== null && canvasData !== 'null') {
|
||||
this.$store.commit('setComponentData', this.resetID(JSON.parse(canvasData)))
|
||||
}
|
||||
|
||||
if (localStorage.getItem('canvasStyle')) {
|
||||
if (canvasData && canvasData !== 'null') {
|
||||
this.$store.commit('setCanvasStyle', JSON.parse(localStorage.getItem('canvasStyle')))
|
||||
}
|
||||
},
|
||||
@ -260,13 +284,17 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const wd = ApplicationContext.getService(componentInfo.id)
|
||||
if (wd.filterDialog) {
|
||||
this.currentWidget = ApplicationContext.getService(componentInfo.id)
|
||||
if (this.currentWidget.filterDialog) {
|
||||
this.show = false
|
||||
this.openFilterDiolog()
|
||||
this.currentComponent = deepCopy(this.currentWidget)
|
||||
this.currentComponent.style.top = e.offsetY
|
||||
this.currentComponent.style.left = e.offsetX
|
||||
this.currentComponent.id = newComponentId
|
||||
this.openFilterDiolog(componentInfo.id)
|
||||
return
|
||||
}
|
||||
component = deepCopy(wd)
|
||||
component = deepCopy(this.currentWidget)
|
||||
}
|
||||
|
||||
component.style.top = e.offsetY
|
||||
@ -277,7 +305,6 @@ export default {
|
||||
},
|
||||
|
||||
handleDragOver(e) {
|
||||
console.log('handleDragOver123')
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
@ -300,10 +327,22 @@ export default {
|
||||
this.$store.commit('hideContextMenu')
|
||||
}
|
||||
},
|
||||
openFilterDiolog() {
|
||||
openFilterDiolog(widgetId) {
|
||||
this.currentWidgetId = widgetId
|
||||
this.filterVisible = true
|
||||
},
|
||||
cancelFilter() {
|
||||
this.filterVisible = false
|
||||
this.currentWidgetId = null
|
||||
this.currentWidget = null
|
||||
this.currentComponent = null
|
||||
},
|
||||
sureFilter() {
|
||||
const component = deepCopy(this.currentComponent)
|
||||
this.$store.commit('addComponent', { component })
|
||||
this.$store.commit('recordSnapshot')
|
||||
this.cancelFilter()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -371,7 +410,6 @@ export default {
|
||||
.leftPanel {
|
||||
transform: translate(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,14 +1,77 @@
|
||||
<template>
|
||||
|
||||
<de-container class="de-dialog-container">
|
||||
<de-aside-container class="ms-aside-container">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane :lazy="true" class="de-tab" label="按表选择" name="dataset">按表选择</el-tab-pane>
|
||||
<de-aside-container :show-drag-bar="false" class="ms-aside-container">
|
||||
<el-tabs v-model="activeName" class="filter-dialog-tabs">
|
||||
<el-tab-pane :lazy="true" class="de-tab" label="按表选择" name="dataset">
|
||||
<div class="component-header filter-common">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item v-for="bread in dataSetBreads" :key="bread.label">
|
||||
<a v-if="bread.link" :class="{'link-text' : bread.link}" @click="backToLink(bread)"> {{ bread.label }}</a>
|
||||
<span v-else>{{ bread.label }}</span>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="component-search filter-common">
|
||||
<el-input
|
||||
placeholder="请输入内容"
|
||||
prefix-icon="el-icon-search"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- <div class="component-result-content filter-common" @dragstart="handleDragStart" @dragend="handleDragEnd"> -->
|
||||
<div class="component-result-content filter-common">
|
||||
<el-tree
|
||||
v-if="showDomType === 'tree'"
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
:render-content="renderNode"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
|
||||
<el-table
|
||||
v-else-if="showDomType === 'db'"
|
||||
class="de-filter-data-table"
|
||||
:data="sceneDatas"
|
||||
:show-header="false"
|
||||
size="mini"
|
||||
:highlight-current-row="true"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="name" label="名称">
|
||||
<template v-if="showDomType === 'db'" :id="scope.row.id" slot-scope="scope">
|
||||
<div class="filter-db-row" @click="showFieldDatas(scope.row)">
|
||||
<i class="el-icon-s-data" />
|
||||
<span> {{ scope.row.name }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div v-else-if="showDomType === 'field'">
|
||||
<draggable
|
||||
v-model="fieldDatas"
|
||||
:options="{group:{name: 'dimension',pull:'clone'},sort: true}"
|
||||
animation="300"
|
||||
:move="onMove"
|
||||
class="drag-list"
|
||||
@end="end1"
|
||||
@start="start1"
|
||||
>
|
||||
<transition-group>
|
||||
<div v-for="item in fieldDatas" :key="item.id" class="filter-db-row">
|
||||
<i class="el-icon-s-data" />
|
||||
<span> {{ item.name }}</span>
|
||||
</div>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :lazy="true" class="de-tab" label="按组件选择" name="assembly">按组件选择</el-tab-pane>
|
||||
</el-tabs>
|
||||
</de-aside-container>
|
||||
|
||||
<!--画布区域-->
|
||||
<de-main-container class="ms-main-container">
|
||||
<div>
|
||||
<el-row>
|
||||
@ -19,7 +82,22 @@
|
||||
<div class="field-content-text">字段</div>
|
||||
</div>
|
||||
|
||||
<div class="field-content-right">请拖入左侧字段</div>
|
||||
<div class="field-content-right">
|
||||
<el-row style="display:flex;height: 32px;">
|
||||
<draggable
|
||||
v-model="selectField"
|
||||
group="dimension"
|
||||
animation="300"
|
||||
:move="onMove"
|
||||
style="width:100%;height: 100%;margin:0 10px;border-radius: 4px;overflow-x: auto;display: flex;align-items: center;background-color: white;"
|
||||
@end="end2"
|
||||
>
|
||||
<transition-group class="draggable-group">
|
||||
<drag-item v-for="(item,index) in selectField" :key="item.id" :item="item" :index="index" @closeItem="closeItem" />
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -42,7 +120,17 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="filter-content" />
|
||||
<div class="filter-content">
|
||||
<el-card class="box-card">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<span> {{ widget.label }}</span>
|
||||
</div>
|
||||
<div class="custom-component-class">
|
||||
<slot />
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -54,24 +142,165 @@
|
||||
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
||||
import DeContainer from '@/components/dataease/DeContainer'
|
||||
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
||||
import draggable from 'vuedraggable'
|
||||
import DragItem from '@/components/DragItem'
|
||||
import { ApplicationContext } from '@/utils/ApplicationContext'
|
||||
import { groupTree, loadTable, fieldList } from '@/api/dataset/dataset'
|
||||
export default {
|
||||
name: 'FilterDialog',
|
||||
components: {
|
||||
DeMainContainer,
|
||||
DeContainer,
|
||||
DeAsideContainer
|
||||
DeAsideContainer,
|
||||
draggable,
|
||||
DragItem
|
||||
},
|
||||
props: {
|
||||
widgetId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'dataset'
|
||||
activeName: 'dataset',
|
||||
showDomType: 'tree',
|
||||
dataSetBreads: [
|
||||
{ label: '数据列表', link: false, type: 'root' }
|
||||
],
|
||||
data: [],
|
||||
sceneDatas: [],
|
||||
fieldDatas: [],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
selectField: [],
|
||||
widget: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.widget = ApplicationContext.getService(this.widgetId)
|
||||
this.loadDataSetTree()
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleNodeClick(data) {
|
||||
if (data.type === 'scene') {
|
||||
this.showSceneTable(data)
|
||||
}
|
||||
},
|
||||
loadDataSetTree() {
|
||||
groupTree({}).then(res => {
|
||||
let datas = res.data
|
||||
if (this.widget && this.widget.filterFieldMethod) {
|
||||
datas = this.widget.filterFieldMethod(datas)
|
||||
}
|
||||
this.data = datas
|
||||
})
|
||||
},
|
||||
renderNode(h, { node, data, store }) {
|
||||
return (
|
||||
<div class='custom-tree-node' >
|
||||
|
||||
{ data.type === 'scene' ? (
|
||||
<el-button icon='el-icon-folder' type='text' size='mini' />
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<span class='label-span' >{node.label}</span>
|
||||
</div>
|
||||
)
|
||||
},
|
||||
showSceneTable(node) {
|
||||
this.showDomType = 'db'
|
||||
this.setTailLink(node)
|
||||
this.addTail(node)
|
||||
this.loadTable(node.id)
|
||||
},
|
||||
setTailLink(node) {
|
||||
const tail = this.dataSetBreads[this.dataSetBreads.length - 1]
|
||||
tail.type = node.type
|
||||
tail.link = true
|
||||
},
|
||||
addTail(node) {
|
||||
const tail = { link: false, label: node.label || node.name, type: node.type }
|
||||
this.dataSetBreads.push(tail)
|
||||
},
|
||||
|
||||
removeTail() {
|
||||
this.dataSetBreads = this.dataSetBreads.slice(0, this.dataSetBreads.length - 1)
|
||||
this.dataSetBreads[this.dataSetBreads.length - 1]['link'] = false
|
||||
},
|
||||
backToLink(bread) {
|
||||
if (bread.type === 'db') {
|
||||
this.showDomType = 'db'
|
||||
} else {
|
||||
this.showDomType = 'tree'
|
||||
}
|
||||
|
||||
this.removeTail()
|
||||
},
|
||||
loadTable(sceneId) {
|
||||
loadTable({ sceneId: sceneId, sort: 'type asc,create_time desc,name asc' }).then(res => {
|
||||
this.sceneDatas = res.data
|
||||
})
|
||||
},
|
||||
|
||||
loadField(tableId) {
|
||||
fieldList(tableId).then(res => {
|
||||
this.fieldDatas = res.data
|
||||
})
|
||||
},
|
||||
showFieldDatas(row) {
|
||||
this.showDomType = 'field'
|
||||
this.setTailLink(row)
|
||||
this.addTail(row)
|
||||
this.loadField(row.id)
|
||||
},
|
||||
test(row) {},
|
||||
onMove(e, originalEvent) {
|
||||
this.moveId = e.draggedContext.element.id
|
||||
return true
|
||||
},
|
||||
start1() {
|
||||
|
||||
},
|
||||
end1(e) {
|
||||
this.refuseMove(e)
|
||||
this.removeCheckedKey(e)
|
||||
this.save()
|
||||
},
|
||||
save() {
|
||||
|
||||
},
|
||||
end2(e) {
|
||||
this.refuseMove(e)
|
||||
},
|
||||
refuseMove(e) {
|
||||
const that = this
|
||||
const xItems = this.fieldDatas.filter(function(m) {
|
||||
return m.id === that.moveId
|
||||
})
|
||||
|
||||
if (xItems && xItems.length > 1) {
|
||||
this.fieldDatas.splice(e.newDraggableIndex, 1)
|
||||
}
|
||||
},
|
||||
removeCheckedKey(e) {
|
||||
const that = this
|
||||
const xItems = this.selectField.filter(function(m) {
|
||||
return m.id === that.moveId
|
||||
})
|
||||
|
||||
if (xItems && xItems.length > 1) {
|
||||
this.selectField.splice(e.newDraggableIndex, 1)
|
||||
}
|
||||
},
|
||||
closeItem(tag) {
|
||||
const index = tag.index
|
||||
this.selectField.splice(index, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -86,9 +315,10 @@ export default {
|
||||
min-width: 230px !important;
|
||||
max-width: 260px !important;
|
||||
height: 100%;
|
||||
min-height: 400px;
|
||||
min-height: 390px;
|
||||
padding: 5px;
|
||||
border: none;
|
||||
padding-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.ms-main-container {
|
||||
@ -137,7 +367,7 @@ export default {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 0px;
|
||||
padding: 0 0 0 10px;
|
||||
padding: 0 0 0 0;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
@ -161,9 +391,46 @@ export default {
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
height: calc(50vh - 150px);
|
||||
height: calc(50vh - 130px);
|
||||
top: 160px;
|
||||
background: #99a9bf;
|
||||
|
||||
}
|
||||
|
||||
.filter-dialog-tabs {
|
||||
border: 1px solid #E6E6E6;
|
||||
}
|
||||
|
||||
.filter-common {
|
||||
margin: 10px 10px;
|
||||
|
||||
}
|
||||
|
||||
.component-header {
|
||||
margin: 20px 10px !important;
|
||||
}
|
||||
|
||||
.link-text {
|
||||
font-weight: 450 !important;
|
||||
color: #409EFF;
|
||||
}
|
||||
.filter-db-row {
|
||||
:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
i {
|
||||
color: #409EFF;
|
||||
}
|
||||
// background-color: #3685f2;
|
||||
// color: #fff;
|
||||
}
|
||||
.draggable-group {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: calc(100% - 6px);
|
||||
}
|
||||
.box-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -2,25 +2,6 @@
|
||||
|
||||
<div class="filter-container" @dragstart="handleDragStart">
|
||||
|
||||
<!-- <el-card class="filter-card-class">
|
||||
<div slot="header">
|
||||
<span>卡片名称</span>
|
||||
</div>
|
||||
<div style="position: relative;margin-left: 5px;" @dragstart="handleDragStart">
|
||||
<div
|
||||
v-for="(item, index) in componentList"
|
||||
:key="index"
|
||||
:data-id="item.id"
|
||||
draggable
|
||||
:data-index="index"
|
||||
>
|
||||
<span class="iconfont" :class="'icon-' + item.icon" />
|
||||
<span>{{ item.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card> -->
|
||||
|
||||
<div v-for="(item, key) in widgetSubjects" :key="key" class="widget-subject">
|
||||
<div class="filter-header">
|
||||
<div class="filter-header-text"> {{ key }} </div>
|
||||
|
Loading…
Reference in New Issue
Block a user