feat:修改组件引入方式

main
liu.shiyi 2 years ago
parent ce98bddb4c
commit 8f303cd135

@ -31,7 +31,7 @@
import moment from 'moment' import moment from 'moment'
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins' import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash' import cloneDeep from "lodash/cloneDeep";
import {mapMutations, mapState} from 'vuex' import {mapMutations, mapState} from 'vuex'
export default { export default {
name: 'CurrentTime', name: 'CurrentTime',
@ -73,7 +73,7 @@ export default {
this.getCurrentTime(config.dateFormat) this.getCurrentTime(config.dateFormat)
config = { ...this.config, ...config } config = { ...this.config, ...config }
// //
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme) config.theme = settingToTheme(cloneDeep(config), this.customTheme)
this.changeChartConfig(config) this.changeChartConfig(config)
if (config.code === this.activeCode) { if (config.code === this.activeCode) {
this.changeActiveItemConfig(config) this.changeActiveItemConfig(config)

@ -34,7 +34,7 @@
<script> <script>
import paramsMixins from 'data-room-ui/js/mixins/paramsMixins' import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash' import cloneDeep from "lodash/cloneDeep";
import {mapMutations, mapState} from "vuex"; import {mapMutations, mapState} from "vuex";
export default { export default {
name: 'TimeCountDown', name: 'TimeCountDown',
@ -111,7 +111,7 @@ export default {
this.getTime() this.getTime()
config = { ...this.config, ...config } config = { ...this.config, ...config }
// //
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme) config.theme = settingToTheme(cloneDeep(config), this.customTheme)
this.changeChartConfig(config) this.changeChartConfig(config)
if (this.config.code === this.activeCode) { if (this.config.code === this.activeCode) {
this.changeActiveItemConfig(config) this.changeActiveItemConfig(config)

@ -12,7 +12,6 @@
</template> </template>
<script> <script>
import 'insert-css' import 'insert-css'
// import _ from 'lodash'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
import linkageMixins from 'data-room-ui/js/mixins/linkageMixins' import linkageMixins from 'data-room-ui/js/mixins/linkageMixins'
import commonMixins from 'data-room-ui/js/mixins/commonMixins' import commonMixins from 'data-room-ui/js/mixins/commonMixins'
@ -20,7 +19,6 @@ import { mapState, mapMutations } from 'vuex'
import * as g2Plot from '@antv/g2plot' import * as g2Plot from '@antv/g2plot'
import plotList, { getCustomPlots } from '../G2Plots/plotList' import plotList, { getCustomPlots } from '../G2Plots/plotList'
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash'
export default { export default {
name: 'PlotCustomComponent', name: 'PlotCustomComponent',
@ -192,7 +190,7 @@ export default {
} }
} }
// //
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme) config.theme = settingToTheme(cloneDeep(config), this.customTheme)
this.changeChartConfig(config) this.changeChartConfig(config)
if (config.code === this.activeCode) { if (config.code === this.activeCode) {
this.changeActiveItemConfig(config) this.changeActiveItemConfig(config)

@ -1,7 +1,6 @@
import { mapMutations, mapState } from 'vuex' import { mapMutations, mapState } from 'vuex'
import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting' import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
import _ from 'lodash' import cloneDeep from "lodash/cloneDeep";
const refreshComponentMixin = { const refreshComponentMixin = {
data () { data () {
return { return {
@ -38,7 +37,7 @@ const refreshComponentMixin = {
changeStyle (config) { changeStyle (config) {
config = { ...this.config, ...config } config = { ...this.config, ...config }
// 样式改变时更新主题配置 // 样式改变时更新主题配置
config.theme = settingToTheme(_.cloneDeep(config), this.customTheme) config.theme = settingToTheme(cloneDeep(config), this.customTheme)
this.changeChartConfig(config) this.changeChartConfig(config)
if (config.code === this.activeCode) { if (config.code === this.activeCode) {
this.changeActiveItemConfig(config) this.changeActiveItemConfig(config)

@ -1,4 +1,4 @@
import _ from 'lodash'
/** /**
* @Description: 主题设置格式化 * @Description: 主题设置格式化

Loading…
Cancel
Save