Merge remote-tracking branch 'origin/master'

main
liu.shiyi 2 years ago
commit 978d32020c

@ -3397,6 +3397,27 @@
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.2.tgz",
"integrity": "sha512-ndeSe/8KQc/nlA7TJ+OBhv2qalmj1s+uBs7yHDRFaAXscFTApBzY9F1jES3bautmgWjDlDct0fw8rPuySDLwxw==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
@ -3468,6 +3489,26 @@
"tapable": "^2.0.0"
}
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@ -3685,47 +3726,6 @@
"lodash": "^4.17.4"
}
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.10.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
"integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
},
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"loader-utils": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz",
"integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^1.0.1"
}
}
}
},
"@vue/vue2-jest": {
"version": "27.0.0",
"resolved": "https://registry.npmjs.org/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",

@ -1,6 +1,6 @@
{
"name": "@gcpaas/data-room-ui",
"version": "1.0.1-2023082201-Alpha",
"version": "1.0.1-2023082902-Alpha",
"description": "自定义大屏",
"author": "gcpaas",
"license": "MIT",

@ -87,8 +87,8 @@ import Speech from 'speak-tts'
import { EventBus } from 'data-room-ui/js/utils/eventBus'
import commonMixins from 'data-room-ui/js/mixins/commonMixins'
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import {settingToTheme} from "data-room-ui/js/utils/themeFormatting";
import _ from "lodash";
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import cloneDeep from 'lodash/cloneDeep'
export default {
props: {
//
@ -238,7 +238,7 @@ export default {
config = { ...this.config, ...config }
this.voiceBroadcast(config)
//
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme)
config.theme = settingToTheme(cloneDeep(config), this.customTheme)
this.changeChartConfig(config)
if (config.code === this.activeCode) {
this.changeActiveItemConfig(config)

@ -3,6 +3,9 @@
style="width: 100%;height: 100%"
class="bs-design-wrap "
>
<!-- <span style="color: aliceblue;font-size: 40px;">
{{ columnData }}
</span> -->
<!-- :border="this.config.customize.border" -->
<el-table
:id="config.code"
@ -18,17 +21,18 @@
@row-click="rowClick"
>
<el-table-column
v-for="(col, index) in config.option.columnData"
v-for="(col,index) in columnData"
:key="index"
show-overflow-tooltip
:label="col.remark"
:prop="col.alias"
:label="getLabel(col)"
align="center"
/>
</el-table>
</div>
</template>
<script>
import { EventBus } from 'data-room-ui/js/utils/eventBus'
import commonMixins from 'data-room-ui/js/mixins/commonMixins'
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import linkageMixins from 'data-room-ui/js/mixins/linkageMixins'
@ -49,13 +53,16 @@ export default {
},
data () {
return {
updateKey: '',
updateKey: 0,
headerCellStyleObj: {
backgroundColor: 'transparent'
},
cellStyleObj: {
backgroundColor: 'transparent'
}
},
columnData: {},
//
isInit: true
}
},
computed: {
@ -89,12 +96,32 @@ export default {
return style
}
},
watch: {
activeItemConfig (val) {
console.dir(val)
}
},
created () { },
mounted () {
this.chartInit()
// this.config.option?.columnData key list key
EventBus.$on('dragSelectChange', (val) => {
if (val.length > 0) {
const sortedColumnData = {}
const columnData = cloneDeep(this.config.option?.columnData)
val.forEach((item, index) => {
sortedColumnData[item] = columnData[item]
})
this.columnData = sortedColumnData
this.updateKey = new Date().getTime()
}
})
},
beforeDestroy () {
EventBus.$off('dragSelectChange')
},
methods: {
//
cellStyle ({ row, column, rowIndex, columnIndex }) {
const bodyBackgroundColor = {
dark: '#141414',
@ -117,7 +144,7 @@ export default {
}
return style
},
//
rowStyle ({ row, rowIndex }) {
if (rowIndex % 2) {
return {
@ -197,18 +224,25 @@ export default {
config.option.tableData = data?.data
const filteredData = {}
const columnData = data?.columnData || {}
const dimensionFieldList = config.dataSource.dimensionFieldList || []
if (config.dataSource.dimensionFieldList && config.dataSource.dimensionFieldList.length > 0) {
Object?.keys(columnData).forEach(key => {
// config.dataSource.dimensionFieldList 使
const sortedColumnData = {}
dimensionFieldList.forEach((item, index) => {
sortedColumnData[item] = columnData[item]
})
Object?.keys(sortedColumnData).forEach(key => {
if (
config.dataSource.dimensionFieldList.includes(columnData[key].alias)
config.dataSource.dimensionFieldList.includes(sortedColumnData[key]?.alias)
) {
filteredData[key] = columnData[key]
filteredData[key] = sortedColumnData[key]
}
})
config.option.columnData = filteredData
} else {
config.option.columnData = columnData
}
this.columnData = cloneDeep(config.option.columnData)
this.updateKey = new Date().getTime()
return config
},
@ -255,6 +289,9 @@ export default {
} else {
this.cellStyleObj = {}
}
},
getLabel (data) {
return data.remark || data.originalColumn
}
}
}

@ -85,9 +85,11 @@
v-model="config.dataSource.dimensionFieldList"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
:multiple="config.option.displayOption.dimensionField.multiple"
@change="dimensionFieldListChange"
@valuePositionChange="valuePositionChange"
>
<el-option
v-for="(field, index) in dataSourceDataList"
@ -111,6 +113,7 @@
v-model="config.dataSource.dimensionField"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -141,6 +144,7 @@
v-model="config.dataSource.metricField"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -176,6 +180,7 @@
class="bs-el-select select"
popper-class="bs-el-select"
:value="setting.value"
filterable
clearable
:multiple="setting.multiple"
:placeholder="`请选择${setting.label}`"
@ -273,6 +278,7 @@
v-model="scope.row.align"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
placeholder="请选择对齐方式"
>
@ -314,6 +320,7 @@
v-model="config.customize.value"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -341,6 +348,7 @@
v-model="config.customize.name"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -368,6 +376,7 @@
v-model="config.customize.xaxis"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -395,6 +404,7 @@
v-model="config.customize.yaxis"
class="bs-el-select"
popper-class="bs-el-select"
filterable
clearable
>
<el-option
@ -805,6 +815,15 @@ export default {
this.config.customize.columnConfig = cloneDeep(this.headerList)
this.$store.commit('bigScreen/changeActiveItemConfig', this.config)
},
valuePositionChange (value) {
const sortedColumnData = {}
const columnData = cloneDeep(this.config.option?.columnData)
value.forEach((item, index) => {
sortedColumnData[item] = columnData[item]
})
this.config.option.columnData = sortedColumnData
this.$store.commit('bigScreen/changeActiveItemConfig', this.config)
},
changeCustomProps (value, setting) {
this.config.setting = this.config.setting.map(item => {
if (item.field === setting.field) {

@ -17,6 +17,7 @@
</template>
<script>
import { EventBus } from 'data-room-ui/js/utils/eventBus'
import Sortable from 'sortablejs'
export default {
@ -45,6 +46,24 @@ export default {
}
}
},
watch: {
// emit
selectVal: {
handler (newVal, oldVal) {
if (Array.isArray(newVal) && Array.isArray(oldVal)) {
if ((newVal.length === oldVal.length) && (JSON.stringify(oldVal) !== JSON.stringify(newVal))) {
// config
this.$emit('valuePositionChange', newVal)
//
EventBus.$emit('dragSelectChange', newVal)
}
}
}
}
},
created () {
EventBus.$emit('dragSelectChange', this.selectVal)
},
mounted () {
this.setSort()
},

@ -34,7 +34,9 @@
:is-conflict-check="false"
:snap="true"
:snap-tolerance="2"
:style="{ zIndex: chart.z || 0 }"
:style="{
zIndex: chart.z || 0,
}"
:grid="[1,1]"
@activated="activated(...arguments, chart)"
@dragging="onDrag(...arguments, chart)"

@ -45,7 +45,7 @@ module.exports = {
outputDir: 'dataRoomUi',
assetsDir: 'static',
lintOnSave: false,
productionSourceMap: true,
productionSourceMap: false,
runtimeCompiler: true,
devServer: {
hot: true,

Loading…
Cancel
Save