gxd-uni-library-editx 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gxd-uni-library-editx",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "description": "聚福宝基础插件专用库",
6
6
  "main": "index.js",
@@ -274,7 +274,7 @@
274
274
  observer: null,
275
275
 
276
276
  //底部是否插槽模式
277
- isFooterSolt: false,
277
+ isFooterSolt: true,
278
278
 
279
279
  }
280
280
  },
@@ -326,6 +326,8 @@
326
326
  this.uiErrorLogs = this.errorLogs;
327
327
  this.uiLogs = this.logs;
328
328
  this.isLogs = this.$settings.isLogs;
329
+
330
+ this.isFooterSolt = this.$settings['isFooterUseSlot'] || true;
329
331
 
330
332
  //判断是否是打包环境
331
333
  if (process.env.VUE_APP_CUSTOM_ENV) {
@@ -53,6 +53,7 @@
53
53
  import {
54
54
  getParentsStyle,
55
55
  } from '@/utils/xd.base';
56
+ import {mapState} from 'vuex';
56
57
 
57
58
  export default {
58
59
  name: "XdUnit",
@@ -118,6 +119,9 @@
118
119
  }
119
120
 
120
121
  },
122
+ computed: {
123
+ ...mapState(['webUnitIcon'])
124
+ },
121
125
  data() {
122
126
  return {
123
127
  uiColor: '#c00', //金额显示颜色
@@ -160,8 +164,8 @@
160
164
 
161
165
  //项目配置中获取
162
166
  let projectIcon;
163
- if (getApp().globalData.$xd && getApp().globalData.$xd.project['unit_icon']) {
164
- brandIncon = getApp().globalData.$xd.project['unit_icon'];
167
+ if (this.webUnitIcon) {
168
+ projectIcon = this.webUnitIcon;
165
169
  }
166
170
 
167
171
 
package/src/install.js CHANGED
@@ -102,9 +102,10 @@ const install = (Vue, options = {}) => {
102
102
  Vue.mixin({
103
103
  data() {
104
104
  return {
105
- $mainColor: '',
106
- $btnColor: '',
107
- $subBtnColor: '',
105
+ /**editx去掉逻辑**/
106
+ // $mainColor: '',
107
+ // $btnColor: '',
108
+ // $subBtnColor: '',
108
109
  $pxNum: null, //px to rpx (1px * $pxNum)rpx
109
110
  $rpxNum: null, //rpx to px (1rpx * $rpxNum)px
110
111
  $portrait: null,
@@ -137,15 +138,16 @@ const install = (Vue, options = {}) => {
137
138
  this.$isIpadCC = 1;
138
139
  // #endif
139
140
 
140
- if (this.webSetting) {
141
- this.$mainColor = this.webSetting['mainColor'] || options['mainColor'];
142
- this.$btnColor = this.webSetting['btnColor'] || options['btnColor'];
143
- this.$subBtnColor = this.webSetting['subBtnColor'] || options['subBtnColor'];
144
- } else {
145
- this.$mainColor = options['mainColor'] ? options['mainColor'] : '';
146
- this.$btnColor = options['btnColor'] ? options['btnColor'] : '';
147
- this.$subBtnColor = options['subBtnColor'] ? options['subBtnColor'] : '';
148
- }
141
+ /**editx去掉逻辑**/
142
+ // if (this.webSetting) {
143
+ // this.$mainColor = this.webSetting['mainColor'] || options['mainColor'];
144
+ // this.$btnColor = this.webSetting['btnColor'] || options['btnColor'];
145
+ // this.$subBtnColor = this.webSetting['subBtnColor'] || options['subBtnColor'];
146
+ // } else {
147
+ // this.$mainColor = options['mainColor'] ? options['mainColor'] : '';
148
+ // this.$btnColor = options['btnColor'] ? options['btnColor'] : '';
149
+ // this.$subBtnColor = options['subBtnColor'] ? options['subBtnColor'] : '';
150
+ // }
149
151
 
150
152
  //横竖屏
151
153
  this.$portrait = 1.4;
@@ -155,9 +157,10 @@ const install = (Vue, options = {}) => {
155
157
  watch: {
156
158
  webSetting(value) {
157
159
  if (value !== null) {
158
- if (value['mainColor']) this.$mainColor = value['mainColor'];
159
- if (value['btnColor']) this.$btnColor = value['btnColor'];
160
- if (value['subBtnColor']) this.$subBtnColor = value['subBtnColor'];
160
+ /**editx去掉逻辑**/
161
+ // if (value['mainColor']) this.$mainColor = value['mainColor'];
162
+ // if (value['btnColor']) this.$btnColor = value['btnColor'];
163
+ // if (value['subBtnColor']) this.$subBtnColor = value['subBtnColor'];
161
164
  this.$webSetting = value;
162
165
  }
163
166
  }
@@ -340,6 +340,7 @@ export function parseContainers (containers) {
340
340
  containers = [containers];
341
341
  }
342
342
  const handle = (str) => {
343
+ if(str === '') return {};
343
344
  if(baseCheckVarType(str) === 'object') return str;
344
345
  try {
345
346
  return JSON.parse(str)
@@ -75,7 +75,15 @@ class xdFrame {
75
75
  * @param fnName {String} 方法名字
76
76
  */
77
77
  getParentApi(fnName) {
78
- return this.getParent()['$boardApi'][fnName];
78
+ if (window.parent['$boardApi']) {
79
+ return this.getParent()['$boardApi'][fnName];
80
+ } else {
81
+ return () => {
82
+ return new Promise((resolve) => {
83
+ resolve([]);
84
+ })
85
+ }
86
+ }
79
87
  }
80
88
 
81
89
  /**
@@ -83,7 +91,11 @@ class xdFrame {
83
91
  * @param attr {String} 属性名字
84
92
  */
85
93
  getParentData(attr) {
86
- return this.getParent()['$boardData'][attr];
94
+ console.log('getParentData',)
95
+ if (window.parent['$boardData']) {
96
+ return this.getParent()['$boardData'][attr];
97
+ } else return [];
98
+
87
99
  }
88
100
  }
89
101
 
@@ -269,7 +269,7 @@ class Logs {
269
269
  * @description vue全局报错
270
270
  */
271
271
  vueErrorHandler(){
272
- Vue.config.errorHandler = (error, vm) => {
272
+ let handle = (error, vm)=>{
273
273
  let messageStr = this.checkMessage(error);
274
274
  if (messageStr !== false) {
275
275
  this.push(
@@ -278,7 +278,13 @@ class Logs {
278
278
  'global'
279
279
  )
280
280
  }
281
+ }
282
+
283
+ Vue.config.errorHandler = handle;
284
+
281
285
 
286
+ Vue.config.errorCaptured = (error, vm) => {
287
+ console.error(error)
282
288
  };
283
289
  }
284
290