vue2-client 1.8.127 → 1.8.129

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": "vue2-client",
3
- "version": "1.8.127",
3
+ "version": "1.8.129",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -49,6 +49,10 @@ export default {
49
49
  activatedSlotName: {
50
50
  type: String,
51
51
  default: undefined
52
+ },
53
+ localConfig: {
54
+ type: Object,
55
+ default: undefined
52
56
  }
53
57
  },
54
58
  components: {
@@ -391,6 +395,7 @@ export default {
391
395
  // 挨个获取插槽
392
396
  waitForDownloadSlotName.forEach(configName => {
393
397
  getConfigByName(configName, undefined, res => {
398
+ console.warn('res', res)
394
399
  this.configFromWeb[configName] = res
395
400
  count++
396
401
  })
@@ -419,13 +424,9 @@ export default {
419
424
  console.error('插槽配置有误!')
420
425
  outerLock.status = false
421
426
  }
422
- }
423
- },
424
- beforeMount () {
425
- // 获取主配置
426
- getConfigByName(this.configName, undefined, res => {
427
- this.config = res
428
-
427
+ },
428
+ // 获取配置之后的初始化
429
+ configInit () {
429
430
  const lock = { status: true }
430
431
 
431
432
  this.getConfigAndJoin(this.config, lock)
@@ -443,18 +444,18 @@ export default {
443
444
  })
444
445
  }
445
446
  }, 100)
446
-
447
- // setTimeout(() => {
448
- // console.log('拼接完成', this.config)
449
- // this.originalConfig = Object.assign({}, this.config)
450
- // // 扫描配置文件中有没有rowSpan,进行格式化调整
451
- // this.formatConfigRow(this.config)
452
- // this.activeConfig = this.config
453
- // this.$nextTick(() => {
454
- // this.scanFinish = true
455
- // })
456
- // }, 1000)
457
- })
447
+ }
448
+ },
449
+ beforeMount () {
450
+ if (this.localConfig) {
451
+ this.config = this.localConfig
452
+ this.configInit()
453
+ } else {
454
+ getConfigByName(this.configName, undefined, res => {
455
+ this.config = res
456
+ this.configInit()
457
+ })
458
+ }
458
459
  }
459
460
  }
460
461
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <XReport :config-name="'test_tableConfig'" :activated-slot-name="'test_tableConfig_slot'"/>
4
- <!-- <XReport :config-name="'test_tableConfig'"/>-->
3
+ <!-- <XReport :config-name="'test_tableConfig'" :activated-slot-name="'test_tableConfig_slot'"/>-->
4
+ <XReport :config-name="'test_tableConfig'" :local-config="test_config"/>
5
5
  </div>
6
6
  </template>
7
7
 
@@ -12,6 +12,233 @@ export default {
12
12
  name: 'Example',
13
13
  components: {
14
14
  XReport
15
+ },
16
+ data () {
17
+ return {
18
+ test_config: {
19
+ slotsDefine: {},
20
+ subTitle: [
21
+ {
22
+ dataIndex: 'subTitleDate',
23
+ format: '{}年{}月{}日',
24
+ type: 'inputs'
25
+ },
26
+ {
27
+ dataIndex: 'subTitleCompany',
28
+ format: '(级别:{})',
29
+ type: 'inputs'
30
+ },
31
+ {
32
+ dataIndex: 'subTitleNumber',
33
+ format: '编号:{}',
34
+ type: 'inputs'
35
+ }
36
+ ],
37
+ slotsDeclare: [
38
+ 'test_tableConfig_slot'
39
+ ],
40
+ data: {
41
+ subTitleNumber: [
42
+ '12580'
43
+ ],
44
+ unitName: 'xxx单位',
45
+ startDateArr3: [],
46
+ startDateArr2: [
47
+ '14',
48
+ '06'
49
+ ],
50
+ subTitleDate: [
51
+ '2024',
52
+ '2',
53
+ '28'
54
+ ],
55
+ remark: '',
56
+ endDateArr2: [
57
+ '15',
58
+ '38'
59
+ ],
60
+ endDateArr: [
61
+ '2',
62
+ '28'
63
+ ],
64
+ subTitleCompany: [
65
+ 'xxx分公司'
66
+ ],
67
+ startDateArr: [
68
+ '2',
69
+ '28'
70
+ ],
71
+ actionPerson: '张三',
72
+ taskName: '',
73
+ addressName: 'xxxx地点',
74
+ guardian: ''
75
+ },
76
+ columns: [
77
+ [
78
+ {
79
+ rowSpan: 0,
80
+ showRowSpan: 0,
81
+ colSpan: 2,
82
+ show: true,
83
+ text: '操作任务',
84
+ type: 'column'
85
+ },
86
+ {
87
+ rowSpan: 0,
88
+ colSpan: 10,
89
+ style: {
90
+ color: 'blue',
91
+ fontSize: '1.5em'
92
+ },
93
+ type: 'value',
94
+ value: '立管置换及顶层用户通气点火工艺流程'
95
+ }
96
+ ],
97
+ [
98
+ {
99
+ rowSpan: 0,
100
+ showRowSpan: 0,
101
+ colSpan: 2,
102
+ show: true,
103
+ text: '操作单位',
104
+ type: 'column'
105
+ },
106
+ {
107
+ rowSpan: 0,
108
+ colSpan: 4,
109
+ dataIndex: 'unitName',
110
+ noBoarder: false,
111
+ type: 'input'
112
+ },
113
+ {
114
+ rowSpan: 0,
115
+ showRowSpan: 0,
116
+ colSpan: 2,
117
+ show: true,
118
+ text: '操作地点',
119
+ type: 'column'
120
+ },
121
+ {
122
+ rowSpan: 0,
123
+ colSpan: 4,
124
+ dataIndex: 'addressName',
125
+ noBoarder: false,
126
+ type: 'input'
127
+ }
128
+ ],
129
+ [
130
+ {
131
+ rowSpan: 2,
132
+ colSpan: 2,
133
+ text: '开 始',
134
+ type: 'column'
135
+ },
136
+ {
137
+ rowSpan: 1,
138
+ colSpan: 4,
139
+ dataIndex: 'startDateArr',
140
+ format: '{}月{}日',
141
+ type: 'inputs'
142
+ },
143
+ {
144
+ rowSpan: 1,
145
+ colSpan: 4,
146
+ dataIndex: 'startDateArr2',
147
+ format: '{}时{}分',
148
+ type: 'inputs'
149
+ },
150
+ {
151
+ rowSpan: 2,
152
+ colSpan: 2,
153
+ text: '完 毕',
154
+ type: 'column'
155
+ },
156
+ {
157
+ rowSpan: 1,
158
+ colSpan: 4,
159
+ dataIndex: 'endDateArr',
160
+ format: '{}月{}日',
161
+ type: 'inputs'
162
+ },
163
+ {
164
+ rowSpan: 1,
165
+ colSpan: 4,
166
+ dataIndex: 'endDateArr2',
167
+ format: '{}时{}分',
168
+ type: 'inputs'
169
+ }
170
+ ],
171
+ [
172
+ {
173
+ rowSpan: 0,
174
+ slotConfig: 'test_tableConfig_slot',
175
+ type: 'slot'
176
+ }
177
+ ],
178
+ [
179
+ {
180
+ rowSpan: 0,
181
+ showRowSpan: 0,
182
+ colSpan: 2,
183
+ show: true,
184
+ text: '备注',
185
+ type: 'column'
186
+ },
187
+ {
188
+ rowSpan: 0,
189
+ colSpan: 10,
190
+ dataIndex: 'remark',
191
+ noBoarder: false,
192
+ type: 'input'
193
+ }
194
+ ],
195
+ [
196
+ {
197
+ rowSpan: 2,
198
+ showRowSpan: 2,
199
+ colSpan: 2,
200
+ show: true,
201
+ text: '操作人',
202
+ type: 'column'
203
+ },
204
+ {
205
+ rowSpan: 2,
206
+ showRowSpan: 2,
207
+ colSpan: 4,
208
+ dataIndex: 'actionPerson',
209
+ show: true,
210
+ noBoarder: false,
211
+ style: {
212
+ fontSize: '1.5em'
213
+ },
214
+ type: 'input'
215
+ },
216
+ {
217
+ rowSpan: 2,
218
+ showRowSpan: 2,
219
+ colSpan: 2,
220
+ show: true,
221
+ text: '监护人',
222
+ type: 'column'
223
+ },
224
+ {
225
+ rowSpan: 2,
226
+ showRowSpan: 2,
227
+ colSpan: 4,
228
+ dataIndex: 'guardian',
229
+ show: true,
230
+ noBoarder: false,
231
+ type: 'input'
232
+ }
233
+ ]
234
+ ],
235
+ width: 'auto',
236
+ style: {
237
+ fontWeight: 'bolder'
238
+ },
239
+ title: '陕西城市燃气产业发展有限公司<br/>操作卡'
240
+ }
241
+ }
15
242
  }
16
243
  }
17
244
  </script>
@@ -135,12 +135,12 @@ export const indexedDB = {
135
135
  if (!result && url) {
136
136
  post(url, params).then((res) => {
137
137
  if (processFun) { res = processFun(res) }
138
- if (import.meta.env.NODE_ENV === 'production' || key !== 'webMobileConfig') { self.add(key, res) }
138
+ if (process.env.NODE_ENV === 'production' || key !== 'webMobileConfig') { self.add(key, res) }
139
139
  callback(res)
140
140
  // 解锁这个键
141
141
  resolve()
142
142
  }).catch(() => {
143
- if (import.meta.env.NODE_ENV === 'production' || key !== 'webMobileConfig') { self.add(key, null) }
143
+ if (process.env.NODE_ENV === 'production' || key !== 'webMobileConfig') { self.add(key, null) }
144
144
  callback(null)
145
145
  // 解锁这个键
146
146
  resolve()