Browse Source

feat:修改组件引入方式

liu.shiyi 1 year ago
parent
commit
8f303cd135

+ 2 - 2
data-room-ui/packages/BasicComponents/CurrentTime/index.vue

@@ -31,7 +31,7 @@
 import moment from 'moment'
 import paramsMixins from 'data-room-ui/js/mixins/paramsMixins'
 import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
-import _ from 'lodash'
+import cloneDeep from "lodash/cloneDeep";
 import {mapMutations, mapState} from 'vuex'
 export default {
   name: 'CurrentTime',
@@ -73,7 +73,7 @@ export default {
       this.getCurrentTime(config.dateFormat)
       config = { ...this.config, ...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)

+ 2 - 2
data-room-ui/packages/BasicComponents/TimeCountDown/index.vue

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

+ 1 - 3
data-room-ui/packages/PlotRender/index.vue

@@ -12,7 +12,6 @@
 </template>
 <script>
 import 'insert-css'
-// import _ from 'lodash'
 import cloneDeep from 'lodash/cloneDeep'
 import linkageMixins from 'data-room-ui/js/mixins/linkageMixins'
 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 plotList, { getCustomPlots } from '../G2Plots/plotList'
 import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
-import _ from 'lodash'
 
 export default {
   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)
       if (config.code === this.activeCode) {
         this.changeActiveItemConfig(config)

+ 2 - 3
data-room-ui/packages/js/mixins/refreshComponent.js

@@ -1,7 +1,6 @@
 import { mapMutations, mapState } from 'vuex'
 import { settingToTheme } from 'data-room-ui/js/utils/themeFormatting'
-import _ from 'lodash'
-
+import cloneDeep from "lodash/cloneDeep";
 const refreshComponentMixin = {
   data () {
     return {
@@ -38,7 +37,7 @@ const refreshComponentMixin = {
     changeStyle (config) {
       config = { ...this.config, ...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)

+ 1 - 1
data-room-ui/packages/js/utils/themeFormatting.js

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