vue2-client 1.8.254 → 1.8.256

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.254",
3
+ "version": "1.8.256",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -17,7 +17,6 @@
17
17
  "@antv/data-set": "^0.11.8",
18
18
  "@antv/g2plot": "^2.4.31",
19
19
  "@vue/babel-preset-jsx": "^1.4.0",
20
- "amis": "^3.4.3",
21
20
  "animate.css": "^4.1.1",
22
21
  "ant-design-vue": "^1.7.8",
23
22
  "axios": "^0.27.2",
@@ -41,7 +40,6 @@
41
40
  "lodash.debounce": "^4",
42
41
  "mockjs": "^1.1.0",
43
42
  "nprogress": "^0.2.0",
44
- "qs": "^6.11.2",
45
43
  "regenerator-runtime": "^0.14.0",
46
44
  "videojs-contrib-hls": "^5.15.0",
47
45
  "viser-vue": "^2.4.8",
@@ -69,7 +67,6 @@
69
67
  "babel-jest": "^26.6.3",
70
68
  "babel-plugin-transform-remove-console": "^6.9.4",
71
69
  "compression-webpack-plugin": "^10.0.0",
72
- "copy-webpack-plugin": "^11.0.0",
73
70
  "css-minimizer-webpack-plugin": "^5.0.1",
74
71
  "deepmerge": "^4.3.1",
75
72
  "eslint": "^8.51.0",
@@ -86,8 +86,8 @@ import { formatDate } from '@vue2-client/utils/util'
86
86
  import { mapState } from 'vuex'
87
87
  import { addOrModify, getConfigByName, runLogic } from '@vue2-client/services/api/common'
88
88
  import lowcodeComponentMixin from '@vue2-client/utils/lowcode/lowcodeComponentMixin'
89
- import dayjs from 'dayjs'
90
89
  import { _IDre15, _IDRe18, REG_EMAIL, REG_LANDLINE, REG_PHONE } from '@vue2-client/utils/reg'
90
+ import moment from 'moment/moment'
91
91
 
92
92
  export default {
93
93
  name: 'XAddNativeForm',
@@ -289,13 +289,13 @@ export default {
289
289
  let start
290
290
  switch (defaultValue) {
291
291
  case 'curYear':
292
- start = dayjs().startOf('year').format(format)
292
+ start = moment().startOf('year').format(format)
293
293
  break
294
294
  case 'curMonth':
295
- start = dayjs().startOf('month').format(format)
295
+ start = moment().startOf('month').format(format)
296
296
  break
297
297
  case 'curDay':
298
- start = dayjs().startOf('day').format(format)
298
+ start = moment().startOf('day').format(format)
299
299
  break
300
300
  default:
301
301
  return defaultValue
@@ -71,8 +71,8 @@
71
71
  </template>
72
72
  <script>
73
73
  import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
74
- import dayjs from 'dayjs'
75
74
  import { mapState } from 'vuex'
75
+ import moment from 'moment'
76
76
 
77
77
  export default {
78
78
  name: 'XForm',
@@ -163,16 +163,16 @@ export default {
163
163
 
164
164
  switch (defaultValue) {
165
165
  case 'curYear':
166
- start = dayjs().startOf('year').format(format)
167
- end = dayjs().endOf('year').format(format)
166
+ start = moment().startOf('year').format(format)
167
+ end = moment().endOf('year').format(format)
168
168
  break
169
169
  case 'curMonth':
170
- start = dayjs().startOf('month').format(format)
171
- end = dayjs().endOf('month').format(format)
170
+ start = moment().startOf('month').format(format)
171
+ end = moment().endOf('month').format(format)
172
172
  break
173
173
  case 'curDay':
174
- start = dayjs().startOf('day').format(format)
175
- end = dayjs().endOf('day').format(format)
174
+ start = moment().startOf('day').format(format)
175
+ end = moment().endOf('day').format(format)
176
176
  break
177
177
  default:
178
178
  return defaultValue
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <!-- 输入框 -->
3
3
  <x-form-col
4
- v-if="attr.type === 'input'"
4
+ v-if="attr.type === 'input' && show"
5
5
  :flex="attr.flex">
6
6
  <a-form-model-item
7
7
  :ref="attr.model"
@@ -49,7 +49,7 @@
49
49
  </x-form-col>
50
50
  <!-- 下拉框 -->
51
51
  <x-form-col
52
- v-else-if="attr.type === 'select' || (attr.type === 'rate' && mode==='查询')"
52
+ v-else-if="(attr.type === 'select' || (attr.type === 'rate' && mode==='查询')) && show"
53
53
  :flex="attr.flex">
54
54
  <a-form-model-item
55
55
  :ref="attr.model"
@@ -143,7 +143,7 @@
143
143
  </x-form-col>
144
144
  <!-- 多选框 -->
145
145
  <x-form-col
146
- v-else-if="attr.type === 'checkbox'"
146
+ v-else-if="attr.type === 'checkbox' && show"
147
147
  :flex="attr.flex">
148
148
  <a-form-model-item
149
149
  :ref="attr.model"
@@ -210,7 +210,7 @@
210
210
  </x-form-col>
211
211
  <!-- 单选框 -->
212
212
  <x-form-col
213
- v-else-if="attr.type === 'radio'"
213
+ v-else-if="attr.type === 'radio' && show"
214
214
  :flex="attr.flex">
215
215
  <a-form-model-item
216
216
  :ref="attr.model"
@@ -241,7 +241,7 @@
241
241
  </x-form-col>
242
242
  <!-- 日期范围选择器 -->
243
243
  <x-form-col
244
- v-else-if="attr.type === 'rangePicker'"
244
+ v-else-if="attr.type === 'rangePicker' && show"
245
245
  :flex="attr.flex">
246
246
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
247
247
  <a-date-picker
@@ -263,7 +263,7 @@
263
263
  </x-form-col>
264
264
  <!-- 月份选择器 -->
265
265
  <x-form-col
266
- v-else-if="attr.type === 'monthPicker'"
266
+ v-else-if="attr.type === 'monthPicker' && show"
267
267
  :flex="attr.flex">
268
268
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
269
269
  <a-month-picker
@@ -277,7 +277,7 @@
277
277
  </x-form-col>
278
278
  <!-- 年份选择器 -->
279
279
  <x-form-col
280
- v-else-if="attr.type === 'yearPicker'"
280
+ v-else-if="attr.type === 'yearPicker' && show"
281
281
  :flex="attr.flex">
282
282
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
283
283
  <a-date-picker
@@ -295,7 +295,7 @@
295
295
  </x-form-col>
296
296
  <!-- 单日选择器 -->
297
297
  <x-form-col
298
- v-else-if="attr.type === 'datePicker'"
298
+ v-else-if="attr.type === 'datePicker' && show"
299
299
  :flex="attr.flex">
300
300
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
301
301
  <a-range-picker
@@ -317,7 +317,7 @@
317
317
  </x-form-col>
318
318
  <!-- 文本域 -->
319
319
  <a-col
320
- v-else-if="attr.type === 'textarea'"
320
+ v-else-if="attr.type === 'textarea' && show"
321
321
  :xs="24"
322
322
  :sm="24"
323
323
  :md="24"
@@ -340,7 +340,7 @@
340
340
  </a-col>
341
341
  <!-- 文件上传 -->
342
342
  <a-col
343
- v-else-if="attr.type === 'file' || attr.type === 'image'"
343
+ v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
344
344
  :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"
345
345
  :xs="24"
346
346
  :sm="24"
@@ -365,7 +365,7 @@
365
365
  </a-col>
366
366
  <!-- 省市区选择框 -->
367
367
  <x-form-col
368
- v-else-if="attr.type === 'citySelect'"
368
+ v-else-if="attr.type === 'citySelect' && show"
369
369
  :flex="attr.flex">
370
370
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
371
371
  <citySelect
@@ -378,7 +378,7 @@
378
378
  </x-form-col>
379
379
  <!-- 地点搜索框 -->
380
380
  <x-form-col
381
- v-else-if="attr.type === 'addressSearch'"
381
+ v-else-if="attr.type === 'addressSearch' && show"
382
382
  :flex="attr.flex">
383
383
  <a-form-model-item
384
384
  :ref="attr.model"
@@ -402,7 +402,7 @@
402
402
  </x-form-col>
403
403
  <!-- 人员选择框 -->
404
404
  <x-form-col
405
- v-else-if="attr.type === 'personSetting'"
405
+ v-else-if="attr.type === 'personSetting' && show"
406
406
  :flex="attr.flex">
407
407
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
408
408
  <PersonSetting v-model="form[attr.model]"></PersonSetting>
@@ -410,7 +410,7 @@
410
410
  </x-form-col>
411
411
  <!-- 树形选择框 -->
412
412
  <x-form-col
413
- v-else-if="attr.type === 'treeSelect'"
413
+ v-else-if="attr.type === 'treeSelect' && show"
414
414
  :flex="attr.flex">
415
415
  <x-tree-select
416
416
  v-model="form[attr.model]"
@@ -420,7 +420,7 @@
420
420
  </x-form-col>
421
421
  <!-- 评分框 -->
422
422
  <x-form-col
423
- v-else-if="attr.type === 'rate'"
423
+ v-else-if="attr.type === 'rate' && show"
424
424
  :flex="attr.flex">
425
425
  <a-form-model-item
426
426
  :ref="attr.model"
@@ -440,6 +440,7 @@ import PersonSetting from '@vue2-client/base-client/components/common/PersonSett
440
440
  import AddressSearchCombobox from '@vue2-client/base-client/components/common/AddressSearchCombobox'
441
441
  import Upload from '@vue2-client/base-client/components/common/Upload'
442
442
  import moment from 'moment'
443
+ import util from '.././../../../utils/util'
443
444
  import XTreeSelect from '@vue2-client/base-client/components/common/XForm/XTreeSelect'
444
445
  import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
445
446
  import { searchToOption } from '@vue2-client/services/v3Api'
@@ -469,6 +470,8 @@ export default {
469
470
  searchResult: '',
470
471
  yearShowOne: false,
471
472
  optionForFunc: [],
473
+ // 控制当前表单项是否展示
474
+ show: true,
472
475
  labelAndWrapperCol: [{
473
476
  labelCol: undefined,
474
477
  wrapperCol: undefined
@@ -566,18 +569,23 @@ export default {
566
569
  setForm: {
567
570
  type: Function,
568
571
  default: (val) => {
569
- console.log(val)
570
- }
572
+ console.log(val)
573
+ }
571
574
  },
572
575
  },
573
576
  created () {
574
577
  this.init()
575
- if (this.attr.keyName && (this.attr.keyName.toString().indexOf('async ') !== -1 || this.attr.keyName.toString().indexOf('function') !== -1)) {
578
+ if (this.attr.keyName && (this.attr?.keyName?.toString().indexOf('async ') !== -1 || this.attr?.keyName?.toString()?.indexOf('function') !== -1)) {
576
579
  this.debouncedUpdateOptions = debounce(this.updateOptions, 200)
577
580
  }
578
581
  if (this.attr.dataChangeFunc) {
579
582
  this.debouncedDataChangeFunc = debounce(this.dataChangeFunc, 200)
580
583
  }
584
+ if (this.attr.showFormItemFunc) {
585
+ this.debouncedShowFormItemFunc = debounce(this.showFormItemFunc, 100)
586
+ // 执行一次
587
+ debounce(this.showFormItemFunc, 100)()
588
+ }
581
589
  },
582
590
  computed: {
583
591
  ...mapState('account', { currUser: 'user' })
@@ -599,6 +607,10 @@ export default {
599
607
  if (this.attr.dataChangeFunc) {
600
608
  this.debouncedDataChangeFunc()
601
609
  }
610
+ // 如果有自定义是否展示表单项函数
611
+ if (this.attr.showFormItemFunc) {
612
+ this.debouncedShowFormItemFunc()
613
+ }
602
614
  // 地址搜索框赋值
603
615
  if (this.attr.type === 'addressSearch') {
604
616
  this.$refs.addressSearchCombobox.addressInput = this.form[this.attr.model]
@@ -615,7 +627,14 @@ export default {
615
627
  },
616
628
  async dataChangeFunc () {
617
629
  if (this.attr.dataChangeFunc) {
618
- await executeStrFunction(this.attr.dataChangeFunc, [this.form, this.setForm, this.attr])
630
+ await executeStrFunction(this.attr.dataChangeFunc, [this.form, this.setForm, this.attr, util])
631
+ }
632
+ },
633
+ async showFormItemFunc () {
634
+ if (this.attr.showFormItemFunc) {
635
+ this.show = executeStrFunction(this.attr.showFormItemFunc, [this.form, this.setForm, this.attr, util])
636
+ } else {
637
+ this.show = true
619
638
  }
620
639
  },
621
640
  init () {
package/src/utils/util.js CHANGED
@@ -1,4 +1,14 @@
1
1
  import enquireJs from 'enquire.js'
2
+ import moment from 'moment/moment'
3
+
4
+ export default {
5
+ _moment
6
+ }
7
+
8
+ // 导出 mount 处理时间函数
9
+ function _moment (...args) {
10
+ return moment(...args)
11
+ }
2
12
 
3
13
  const timeList = [
4
14
  {
package/vue.config.js CHANGED
@@ -5,7 +5,7 @@ const { getThemeColors, modifyVars } = require('./src/utils/themeUtil')
5
5
  const { resolveCss } = require('./src/utils/theme-color-replacer-extend')
6
6
  const CompressionWebpackPlugin = require('compression-webpack-plugin')
7
7
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
8
- const CopyPlugin = require('copy-webpack-plugin')
8
+ // const CopyPlugin = require('copy-webpack-plugin')
9
9
 
10
10
  const productionGzipExtensions = ['js', 'css']
11
11
  const isProd = process.env.NODE_ENV === 'production'
@@ -123,9 +123,9 @@ module.exports = {
123
123
  }))
124
124
 
125
125
  config.plugins.push(
126
- new CopyPlugin({
127
- patterns: [{ from: 'node_modules/amis/sdk', to: 'amis/sdk' }],
128
- })
126
+ // new CopyPlugin({
127
+ // patterns: [{ from: 'node_modules/amis/sdk', to: 'amis/sdk' }],
128
+ // })
129
129
  )
130
130
 
131
131
  // 生产环境下将资源压缩成gzip格式