agilebuilder-ui 1.0.621 → 1.0.962

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.
Files changed (120) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.js +115880 -110424
  3. package/lib/super-ui.umd.cjs +103 -95
  4. package/package.json +6 -3
  5. package/packages/department-tree/src/department-tree.vue +27 -10
  6. package/packages/department-tree-inline/src/department-tree-service.js +20 -41
  7. package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
  8. package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
  9. package/packages/department-user-tree/src/department-user-tree.vue +17 -2
  10. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
  11. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
  12. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
  13. package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
  14. package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
  15. package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
  16. package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
  17. package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
  18. package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
  19. package/packages/department-user-tree-inline/src/search-result.vue +34 -36
  20. package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
  21. package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
  22. package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
  23. package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
  24. package/packages/dynamic-source-select/src/events.js +11 -16
  25. package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
  26. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
  27. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
  28. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
  29. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
  30. package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
  31. package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
  32. package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
  33. package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
  34. package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
  35. package/packages/index.js +11 -2
  36. package/packages/organization-input/src/organization-input.vue +493 -539
  37. package/packages/plugins/export-data-new.js +34 -1
  38. package/packages/rich-editor/index.vue +29 -0
  39. package/packages/row-form/index.js +7 -0
  40. package/packages/row-form/index.vue +211 -0
  41. package/packages/scan-code-input/src/scan-code-input.vue +136 -104
  42. package/packages/scan-code-input-browser/index.js +6 -0
  43. package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
  44. package/packages/secret-info/index.vue +2 -2
  45. package/packages/super-grid/src/apis.js +158 -10
  46. package/packages/super-grid/src/components/grid-icon.vue +7 -14
  47. package/packages/super-grid/src/components/hyperlinks.vue +24 -8
  48. package/packages/super-grid/src/custom-formatter.js +312 -380
  49. package/packages/super-grid/src/dynamic-input.vue +346 -43
  50. package/packages/super-grid/src/formValidatorUtil.js +79 -15
  51. package/packages/super-grid/src/group-column.vue +5 -0
  52. package/packages/super-grid/src/normal-column-content.vue +1056 -0
  53. package/packages/super-grid/src/normal-column.vue +57 -740
  54. package/packages/super-grid/src/row-detail.vue +50 -0
  55. package/packages/super-grid/src/row-operation.vue +19 -10
  56. package/packages/super-grid/src/scan-util.ts +243 -0
  57. package/packages/super-grid/src/search-button.vue +18 -14
  58. package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
  59. package/packages/super-grid/src/search-form-item.vue +10 -3
  60. package/packages/super-grid/src/search-form-mobile.vue +250 -0
  61. package/packages/super-grid/src/search-form.vue +159 -82
  62. package/packages/super-grid/src/super-grid-service.js +51 -6
  63. package/packages/super-grid/src/super-grid.vue +657 -761
  64. package/packages/super-grid/src/utils.js +126 -170
  65. package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
  66. package/packages/workflow-button/src/workflow-button.vue +6 -1
  67. package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
  68. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
  69. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
  70. package/packages/workgroup-tree-mobile/index.js +6 -0
  71. package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
  72. package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
  73. package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
  74. package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
  75. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
  76. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
  77. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
  78. package/packages/workgroup-user-tree-mobile/index.js +6 -0
  79. package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
  80. package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
  81. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
  82. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
  83. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
  84. package/src/api/sso-service.js +44 -15
  85. package/src/directives/permission/permission.js +4 -3
  86. package/src/i18n/langs/cn.js +19 -3
  87. package/src/i18n/langs/en.js +18 -2
  88. package/src/permission.js +114 -122
  89. package/src/store/modules/user.js +32 -33
  90. package/src/styles/index.scss +1 -0
  91. package/src/styles/table.scss +12 -0
  92. package/src/styles/theme/dark-blue/button.scss +2 -2
  93. package/src/styles/theme/dark-blue/index.scss +1 -1
  94. package/src/styles/theme/dark-blue/sidebar.scss +10 -0
  95. package/src/styles/theme/dark-blue/table.scss +8 -52
  96. package/src/styles/theme/green/button.scss +2 -2
  97. package/src/styles/theme/green/green.scss +1 -1
  98. package/src/styles/theme/green/index.scss +1 -1
  99. package/src/styles/theme/green/sidebar.scss +20 -0
  100. package/src/styles/theme/green/table.scss +7 -51
  101. package/src/styles/theme/ocean-blue/button.scss +2 -2
  102. package/src/styles/theme/ocean-blue/index.scss +1 -1
  103. package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
  104. package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
  105. package/src/styles/theme/ocean-blue/table.scss +7 -52
  106. package/src/utils/auth.js +23 -3
  107. package/src/utils/calculator/calculator-factory.js +4 -4
  108. package/src/utils/calculator/calculator-util.js +14 -0
  109. package/src/utils/common-util.js +270 -124
  110. package/src/utils/i18n-util.js +145 -0
  111. package/src/utils/jump-page-utils.js +245 -314
  112. package/src/utils/permission.js +7 -1
  113. package/src/utils/permissionAuth.js +155 -37
  114. package/src/utils/request.js +10 -11
  115. package/src/utils/util.js +154 -205
  116. package/src/views/layout/EmptyLayout.vue +1 -1
  117. package/src/views/layout/components/Menubar/Item.vue +27 -4
  118. package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
  119. package/src/views/layout/components/Menubar/index.vue +14 -2
  120. package/src/views/layout/tab-content-index.vue +1 -1
@@ -10,6 +10,7 @@
10
10
  :entity="row"
11
11
  :grid-data="gridData"
12
12
  :page-grid-data="pageGridData"
13
+ :additional-settings="controlConfig"
13
14
  :parent="parentFormData"
14
15
  :prop="column.prop"
15
16
  :row="row"
@@ -17,6 +18,9 @@
17
18
  :select-options="options"
18
19
  :value="innerValue"
19
20
  :additional-param-map="additionalParamMap"
21
+ :listCode="listCode"
22
+ :component-id="componentId"
23
+ :page-context="pageContext"
20
24
  @change="cellEvent('change', $event)"
21
25
  @input="cellEvent('input', $event)"
22
26
  />
@@ -141,8 +145,8 @@
141
145
  ref="item"
142
146
  v-model="innerValue"
143
147
  :disabled="disabled"
144
- :maxlength="controlConfig.maxlength ? controlConfig.maxlength : ''"
145
- :minlength="controlConfig.minlength ? controlConfig.minlength : ''"
148
+ :maxlength="controlConfig && controlConfig.maxlength ? controlConfig.maxlength : ''"
149
+ :minlength="controlConfig && controlConfig.minlength ? controlConfig.minlength : ''"
146
150
  :placeholder="$t('imatrixUIMessage.pleaseEnterContent')"
147
151
  :title="innerValue"
148
152
  clearable
@@ -151,15 +155,19 @@
151
155
  @clear="cellEvent('clear', $event)"
152
156
  @focus="cellEvent('focus', $event)"
153
157
  @input="cellEvent('input', $event, true)"
154
- />
158
+ >
159
+ <template v-if="isShowScanIcon" #append>
160
+ <SuperIcon iconValue="fa-barcode" @click="scanClick()"></SuperIcon>
161
+ </template>
162
+ </el-input>
155
163
 
156
164
  <el-input
157
165
  v-else-if="type === 'textarea'"
158
166
  ref="item"
159
167
  v-model="innerValue"
160
168
  :disabled="disabled"
161
- :maxlength="controlConfig.maxlength ? controlConfig.maxlength : ''"
162
- :minlength="controlConfig.minlength ? controlConfig.minlength : ''"
169
+ :maxlength="controlConfig && controlConfig.maxlength ? controlConfig.maxlength : ''"
170
+ :minlength="controlConfig && controlConfig.minlength ? controlConfig.minlength : ''"
163
171
  :placeholder="$t('imatrixUIMessage.pleaseEnterContent')"
164
172
  :rows="1"
165
173
  :title="innerValue"
@@ -173,6 +181,7 @@
173
181
  />
174
182
  <fs-upload-list
175
183
  v-else-if="type === 'annex'"
184
+ ref="fileUploadRef"
176
185
  :custom-view-url="true"
177
186
  :disabled="disabled"
178
187
  :file-info="fileInfo"
@@ -181,6 +190,9 @@
181
190
  :is-sql="isSql"
182
191
  :row="row"
183
192
  :value="innerValue"
193
+ :page-context="pageContext"
194
+ :list-code="listCode"
195
+ :componentId="componentId"
184
196
  @delete="deleteFile"
185
197
  @delete-success="deleteSuccess"
186
198
  @upload-success="uploadOnSuccess"
@@ -283,6 +295,7 @@
283
295
  dynamicDataSourceCode: dynamicDataSourceCode,
284
296
  valueSetOptions: valueSetOptions,
285
297
  isSql: isSql,
298
+ backendUrl: baseURL,
286
299
  additionalParameter: additionalParamMap ? JSON.stringify(additionalParamMap) : null
287
300
  }"
288
301
  :parent="parentFormData"
@@ -405,6 +418,7 @@
405
418
  @close="showSingleImgFlag = false"
406
419
  @delete="deleteFile"
407
420
  />
421
+ <scan-code-input-browser v-if="isShowBrowserScan" @close="closeBrowserScan" />
408
422
  </div>
409
423
  </template>
410
424
  <script>
@@ -416,7 +430,8 @@ import {
416
430
  isDisableEdit,
417
431
  isDynamicDataSourceSource,
418
432
  isEditOptionFunction,
419
- otherFilesToStandard
433
+ otherFilesToStandard,
434
+ getControlConfig
420
435
  } from './utils'
421
436
  import dynamicSourceSelect from '../../dynamic-source-select/src/dynamic-source-select.vue'
422
437
  import { getEntityFieldValue, setEntityFieldValue } from '../../../src/utils/util'
@@ -425,7 +440,8 @@ import apis from './apis'
425
440
  import ViewImageDialog from './view-image-dialog'
426
441
  import { $emit } from '../../utils/gogocodeTransfer'
427
442
  import eventBus from './eventBus'
428
-
443
+ import { isMobileBrowser } from '../../../src/utils/common-util'
444
+ import { analysisScanValue, setScanAnalysisValue } from './scan-util.ts'
429
445
  export default {
430
446
  name: 'DynamicInput',
431
447
  components: {
@@ -449,6 +465,7 @@ export default {
449
465
  type: Object,
450
466
  default: null
451
467
  },
468
+ // 下拉选选项集合
452
469
  options: {
453
470
  type: Array,
454
471
  default: null
@@ -482,6 +499,11 @@ export default {
482
499
  disabled: {
483
500
  type: Boolean,
484
501
  default: false
502
+ },
503
+ // 列表配置信息
504
+ gridOptions: {
505
+ type: Object,
506
+ default: null
485
507
  }
486
508
  },
487
509
  data() {
@@ -530,6 +552,31 @@ export default {
530
552
  controlConfig = JSON.parse(this.column.controlConfig)
531
553
  }
532
554
  const additionalParamMap = getAdditionalParamMap(gridParams)
555
+ const pageContext = gridParams.options.pageContext
556
+ const isMobile = isMobileBrowser()
557
+
558
+ const componentId = this.listCode + '_' + this.column.prop
559
+ let scanEnable = false
560
+ if (controlConfig.scanEnable) {
561
+ scanEnable = true
562
+ }
563
+ let userAgent
564
+ const userAgentOrg = navigator.userAgent
565
+ if (userAgentOrg.indexOf(' uni-app ') > 0) {
566
+ // 表示uni-app中访问的
567
+ userAgent = 'app'
568
+ } else {
569
+ // 表示手机浏览器访问的
570
+ userAgent = 'browser'
571
+ }
572
+ console.log('superGrid----window.location.protocol---', window.location.protocol)
573
+ const isShowScanIcon = isMobile && window.location.protocol === 'https:' ? true : false
574
+ const isApk = isMobile && userAgent && userAgent === 'app' ? true : false
575
+
576
+ let baseURL = gridParams.options.backendUrl
577
+ if (!baseURL) {
578
+ baseURL = window.$vueApp.config.globalProperties.baseURL
579
+ }
533
580
  return {
534
581
  deptManTree: false, // 是否是部门人员树
535
582
  isMultiTree: false, // 是否是多选树
@@ -566,7 +613,7 @@ export default {
566
613
  gridData: isSubTableShowPage ? subTableData : gridData,
567
614
  pageGridData: isSubTableShowPage ? gridData : null,
568
615
  additionalParamMap,
569
- controlConfig,
616
+ controlConfig: getControlConfig(this.column),
570
617
  // 设置日期选择器选择范围
571
618
  pickerOptions: {
572
619
  disabledDate: (time) => {
@@ -582,7 +629,16 @@ export default {
582
629
  }
583
630
  },
584
631
  stateForbiddenTime: null,
585
- endForbiddenTime: null
632
+ endForbiddenTime: null,
633
+ pageContext,
634
+ isMobile,
635
+ componentId,
636
+ scanEnable,
637
+ userAgent,
638
+ isApk,
639
+ isShowBrowserScan: false,
640
+ isShowScanIcon,
641
+ baseURL
586
642
  }
587
643
  },
588
644
  computed: {},
@@ -657,18 +713,20 @@ export default {
657
713
  this.setInputNumberConfig()
658
714
  }
659
715
  // 如果是多选文件类型,需要解析(需要设置临时字段,判断文件还是图片,图片需要预览)
660
- if (this.column.valueSetOptions && this.column.componentType !== 'inputNumber') {
661
- const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
662
- if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
663
- this.valueSetOptions = valueSetOptionsObj.valueSetOptions
664
- }
665
- if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
666
- this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
667
- }
668
- } else if (this.column.componentType === 'switch' && this.column.valueSetOptions) {
669
- const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
670
- if (valueSetOptionsObj) {
671
- this.valueSetOptions = valueSetOptionsObj
716
+ if (this.column.valueSetOptions) {
717
+ if (this.column.componentType === 'switch') {
718
+ const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
719
+ if (valueSetOptionsObj) {
720
+ this.valueSetOptions = valueSetOptionsObj
721
+ }
722
+ } else if (this.column.componentType !== 'inputNumber') {
723
+ const valueSetOptionsObj = JSON.parse(this.column.valueSetOptions)
724
+ if (valueSetOptionsObj && valueSetOptionsObj.valueSetOptions) {
725
+ this.valueSetOptions = valueSetOptionsObj.valueSetOptions
726
+ }
727
+ if (valueSetOptionsObj.dynamicDataSourceCode && valueSetOptionsObj.dynamicDataSourceCode !== '') {
728
+ this.dynamicDataSourceCode = valueSetOptionsObj.dynamicDataSourceCode
729
+ }
672
730
  }
673
731
  }
674
732
  if (this.column.orgTreeSet) {
@@ -685,6 +743,29 @@ export default {
685
743
  }
686
744
  }
687
745
  this.getDateAllowTime()
746
+ if (!this.gridOptions.customRules) {
747
+ this.gridOptions.customRules = {}
748
+ }
749
+ this.$watch(
750
+ 'gridOptions.customRules.' + this.column.prop,
751
+ (newVal, oldVal) => {
752
+ this.packageCustomRules(newVal)
753
+ },
754
+ {
755
+ immediate: true,
756
+ deep: true
757
+ }
758
+ )
759
+ this.$watch(
760
+ 'gridOptions.customRules._all_fields',
761
+ (newVal, oldVal) => {
762
+ this.packageCustomRules(newVal)
763
+ },
764
+ {
765
+ immediate: true,
766
+ deep: true
767
+ }
768
+ )
688
769
  },
689
770
  mounted() {
690
771
  // 去掉该监听,否则导致焦点总是跳到第一个编辑框
@@ -694,6 +775,47 @@ export default {
694
775
  // immediate: true,
695
776
  // deep: true
696
777
  // })
778
+ const that = this
779
+ // 选择文件结束
780
+ eventBus.$on(this.componentId + '-pickFileDone', (data) => {
781
+ console.log(
782
+ 'superPage666611---pickFileDone--data.componentId=',
783
+ data.componentId,
784
+ 'data.listCode=',
785
+ data.listCode,
786
+ 'data=',
787
+ data
788
+ )
789
+ if (that.$refs.fileUploadRef) {
790
+ that.$refs.fileUploadRef.pickFileDone(data)
791
+ }
792
+ })
793
+ // 上传文件结束
794
+ eventBus.$on(this.componentId + '-uploadFileDone', (data) => {
795
+ if (that.$refs.fileUploadRef) {
796
+ that.$refs.fileUploadRef.uploadFileDone(data)
797
+ }
798
+ })
799
+ // 扫描结束
800
+ eventBus.$on(this.componentId + '-scanDone', (data) => {
801
+ console.log(
802
+ 'superPage666611---scanDone--data.componentId=',
803
+ data.componentId,
804
+ 'data.listCode=',
805
+ data.listCode,
806
+ 'data=',
807
+ data
808
+ )
809
+ that.innerValue = data.result
810
+ that.blurEvent()
811
+ })
812
+ },
813
+ destroyed() {
814
+ eventBus.$off(this.componentId + '-pickFileDone')
815
+ // 上传文件结束
816
+ eventBus.$off(this.componentId + '-uploadFileDone')
817
+ // 扫描结束
818
+ eventBus.$off(this.componentId + '-scanDone')
697
819
  },
698
820
  methods: {
699
821
  /**
@@ -938,6 +1060,8 @@ export default {
938
1060
  }
939
1061
  // 必须这样调用input事件 ,否则组件无法输入值
940
1062
  $emit(this, 'update:value', this.innerValue) // 现在的用法
1063
+ // 扫描组件时监控值变化
1064
+ this.watchScanValueChange(this.innerValue)
941
1065
  },
942
1066
  // 是否是输入框
943
1067
  isInputControl() {
@@ -995,7 +1119,7 @@ export default {
995
1119
  param.parent = this.parentFormData
996
1120
  param.rowIndex = this.rowIndex
997
1121
  param.additionalParamMap = gridParams.additionalParamMap
998
- if(gridParams.options.pageContext){
1122
+ if (gridParams.options.pageContext) {
999
1123
  param.pageContext = gridParams.options.pageContext
1000
1124
  param.configure = gridParams.options.configureObj
1001
1125
  const eventFunc = gridParams.options['eventCallBack'][funName]
@@ -1038,18 +1162,38 @@ export default {
1038
1162
  },
1039
1163
  // 上传成功
1040
1164
  uploadOnSuccess(response) {
1165
+ console.log('superGrid---uploadOnSuccess----response=', response)
1041
1166
  if (response) {
1042
- const responseFile = { name: response.showName, serverPath: response.serverPath }
1043
- if (this.column.fileSet && this.column.fileSet !== '') {
1044
- const fileSetObj = JSON.parse(this.column.fileSet)
1045
- if (fileSetObj) {
1046
- // 判断单选还是多选
1047
- if (this.fileMultiple) {
1048
- this.multiStorage(fileSetObj, responseFile)
1049
- } else {
1050
- this.radioStorageFile(fileSetObj, responseFile)
1167
+ if (this.isMobile) {
1168
+ // 移动端时事件
1169
+ if (this.column.fileSet && this.column.fileSet !== '') {
1170
+ const fileSetObj = JSON.parse(this.column.fileSet)
1171
+ if (fileSetObj) {
1172
+ // 判断单选还是多选
1173
+ if (this.fileMultiple) {
1174
+ this.multiStorageMobile(fileSetObj, response)
1175
+ } else {
1176
+ const fileObj = response[0]
1177
+ const responseFile = { name: fileObj.showName, serverPath: fileObj.serverPath }
1178
+ this.radioStorageFile(fileSetObj, responseFile)
1179
+ }
1180
+ this.fileList = getFileList(this.row, this.column, this.isSql)
1181
+ }
1182
+ }
1183
+ } else {
1184
+ // PC端
1185
+ const responseFile = { name: response.showName, serverPath: response.serverPath }
1186
+ if (this.column.fileSet && this.column.fileSet !== '') {
1187
+ const fileSetObj = JSON.parse(this.column.fileSet)
1188
+ if (fileSetObj) {
1189
+ // 判断单选还是多选
1190
+ if (this.fileMultiple) {
1191
+ this.multiStorage(fileSetObj, responseFile)
1192
+ } else {
1193
+ this.radioStorageFile(fileSetObj, responseFile)
1194
+ }
1195
+ this.fileList = getFileList(this.row, this.column, this.isSql)
1051
1196
  }
1052
- this.fileList = getFileList(this.row, this.column, this.isSql)
1053
1197
  }
1054
1198
  }
1055
1199
  }
@@ -1175,6 +1319,98 @@ export default {
1175
1319
  }
1176
1320
  this.packageFileNameWithFileList()
1177
1321
  },
1322
+ // 多选上传完成后存储 移动端时
1323
+ multiStorageMobile(fileSetObj, responseFiles) {
1324
+ console.log('superGrid---multiStorageMobile----responseFiles=', responseFiles, 'fileSetObj=', fileSetObj)
1325
+ const keyValueParam = analysisFileSetObj(fileSetObj, this.isSql)
1326
+ // 存储
1327
+ // 判断主表拼接还是子表保存
1328
+ if (fileSetObj.childAnnexDataTableCode) {
1329
+ // 存储子表
1330
+ // const lowerStr = fileSetObj.childAnnexDataTableCode.toLowerCase()
1331
+ let fileArr = this.row[this.column.prop]
1332
+ if (!fileArr) {
1333
+ fileArr = []
1334
+ }
1335
+ responseFiles.forEach((responseFile) => {
1336
+ const fileObj = this.responseFileToFileObj(fileSetObj, responseFile)
1337
+ fileArr.push(fileObj)
1338
+ })
1339
+ this.fileList = otherFilesToStandard(fileSetObj, keyValueParam, fileArr, null)
1340
+ this.setCellValue(this.column.prop, fileArr, 'input')
1341
+ } else {
1342
+ let showNameStr = ''
1343
+ let pathNameStr = ''
1344
+ // 存储主表
1345
+ if (fileSetObj.showNameData) {
1346
+ if (this.isSql) {
1347
+ if (fileSetObj.showNameData.dbName) {
1348
+ if (this.row) {
1349
+ let showName = ''
1350
+ responseFiles.forEach((responseFile) => {
1351
+ showName = showName + responseFile.name + ','
1352
+ })
1353
+ if (showName.indexOf(',') >= 0) {
1354
+ showName = showName.substring(0, showName.lastIndexOf(','))
1355
+ }
1356
+ this.setCellValue(fileSetObj.showNameData.dbName, showName, 'input')
1357
+ showNameStr = this.row[fileSetObj.showNameData.dbName]
1358
+ }
1359
+ }
1360
+ } else {
1361
+ if (fileSetObj.showNameData.name) {
1362
+ if (this.row) {
1363
+ let showName = ''
1364
+ responseFiles.forEach((responseFile) => {
1365
+ showName = showName + responseFile.name + ','
1366
+ })
1367
+ if (showName.indexOf(',') >= 0) {
1368
+ showName = showName.substring(0, showName.lastIndexOf(','))
1369
+ }
1370
+ this.setCellValue(fileSetObj.showNameData.name, showName, 'input')
1371
+ showNameStr = this.row[fileSetObj.showNameData.name]
1372
+ }
1373
+ }
1374
+ }
1375
+ }
1376
+ if (fileSetObj.serverNameData) {
1377
+ if (this.isSql) {
1378
+ if (fileSetObj.serverNameData.dbName) {
1379
+ if (this.row) {
1380
+ let serverName = ''
1381
+ responseFiles.forEach((responseFile) => {
1382
+ serverName = serverName + responseFile.serverPath + ','
1383
+ })
1384
+ if (serverName.indexOf(',') >= 0) {
1385
+ serverName = serverName.substring(0, serverName.lastIndexOf(','))
1386
+ }
1387
+ this.setCellValue(fileSetObj.serverNameData.dbName, serverName, 'input')
1388
+ pathNameStr = this.row[fileSetObj.serverNameData.dbName]
1389
+ }
1390
+ }
1391
+ } else {
1392
+ if (fileSetObj.serverNameData.name) {
1393
+ if (this.row) {
1394
+ let serverName = ''
1395
+ responseFiles.forEach((responseFile) => {
1396
+ serverName = serverName + responseFile.serverPath + ','
1397
+ })
1398
+ if (serverName.indexOf(',') >= 0) {
1399
+ serverName = serverName.substring(0, serverName.lastIndexOf(','))
1400
+ }
1401
+ this.setCellValue(fileSetObj.serverNameData.name, serverName, 'input')
1402
+ pathNameStr = this.row[fileSetObj.serverNameData.name]
1403
+ }
1404
+ }
1405
+ }
1406
+ }
1407
+ this.fileList = otherFilesToStandard(fileSetObj, keyValueParam, null, {
1408
+ showName: showNameStr,
1409
+ serverPath: pathNameStr
1410
+ })
1411
+ }
1412
+ this.packageFileNameWithFileList()
1413
+ },
1178
1414
  responseFileToFileObj(fileSetObj, responseFile) {
1179
1415
  const fileObj = {}
1180
1416
  if (fileSetObj.showNameData) {
@@ -1320,7 +1556,16 @@ export default {
1320
1556
  if (prop && prop === this.column.prop) {
1321
1557
  // 必须手动调用一下input事件,否则不会更新组件的值
1322
1558
  // console.log('organizationInputEvent2---prop=', prop, 'value=', value)
1323
- this.callCustomEventWithParam('input', { value, row: this.row, column: this.column, prop })
1559
+ if (this.column && this.column.events) {
1560
+ Object.keys(this.column.events).forEach((eventType) => {
1561
+ this.callCustomEventWithParam(eventType, {
1562
+ value,
1563
+ row: this.row,
1564
+ column: this.column,
1565
+ prop
1566
+ })
1567
+ })
1568
+ }
1324
1569
  }
1325
1570
  },
1326
1571
  // 组织结构树文本框值清空事件
@@ -1379,7 +1624,7 @@ export default {
1379
1624
  // console.log('multiselectChange1---arr=', arr)
1380
1625
  this.extendParams = selectedItem
1381
1626
  let isSaveAll = false
1382
- if (arr && arr.length > 0) {
1627
+ if (arr && arr.length > 0 && this.type === 'multiselect' && !this.isDynamicDataSourceSource()) {
1383
1628
  const saveAll = 'saveAll'
1384
1629
  if (arr.indexOf(saveAll) !== -1) {
1385
1630
  const length = arr.length
@@ -1400,15 +1645,21 @@ export default {
1400
1645
  isSaveAll = true
1401
1646
  }
1402
1647
  }
1403
- // console.log('multiselectChange2---this.innerValue=', this.innerValue)
1404
- if (this.innerValue && typeof this.innerValue !== 'number' && this.innerValue.indexOf('saveAll') !== -1) {
1405
- this.innerValue.splice(this.innerValue.indexOf('saveAll'), 1)
1406
- }
1407
- // console.log('multiselectChange3---this.innerValue=', this.innerValue)
1408
- if (isSaveAll) {
1409
- this.cellEvent('input', this.innerValue)
1648
+ if (this.type === 'multiselect') {
1649
+ // console.log('multiselectChange2---this.innerValue=', this.innerValue)
1650
+ if (this.innerValue && typeof this.innerValue !== 'number' && this.innerValue.indexOf('saveAll') !== -1) {
1651
+ this.innerValue.splice(this.innerValue.indexOf('saveAll'), 1)
1652
+ }
1653
+ // console.log('multiselectChange3---this.innerValue=', this.innerValue)
1654
+ const val = this.innerValue && this.innerValue.length > 0 ? this.innerValue.join(',') : null
1655
+ if (isSaveAll) {
1656
+ this.cellEvent('input', val)
1657
+ }
1658
+ this.cellEvent('change', val)
1659
+ this.setCellValue(this.column.prop, val, 'change')
1660
+ } else {
1661
+ this.cellEvent('change', arr)
1410
1662
  }
1411
- this.cellEvent('change', arr)
1412
1663
  },
1413
1664
  getDefaultValue(val) {
1414
1665
  // 表示当前字段的是空的,但是有默认值时,给当前字段设置值
@@ -1522,9 +1773,17 @@ export default {
1522
1773
  isInvalidValue(value) {
1523
1774
  return value === undefined || value === null || value === ''
1524
1775
  },
1776
+ refreshList() {
1777
+ this.$emit('refresh-list')
1778
+ },
1525
1779
  getSwitchConfig(switchProp) {
1526
1780
  if (this.valueSetOptions && this.valueSetOptions[switchProp]) {
1527
- return this.valueSetOptions[switchProp]
1781
+ const value = this.valueSetOptions[switchProp]
1782
+ if ('true' === value || 'false' === value) {
1783
+ return 'true' === value
1784
+ } else {
1785
+ return this.valueSetOptions[switchProp]
1786
+ }
1528
1787
  } else {
1529
1788
  if (switchProp === 'activeValue') {
1530
1789
  if (this.dataSourceType === 'mysql') {
@@ -1544,6 +1803,50 @@ export default {
1544
1803
  return '#13ce66'
1545
1804
  }
1546
1805
  }
1806
+ },
1807
+ scanClick() {
1808
+ console.log('scanClick----userAgent=', this.userAgent)
1809
+ if (this.isApk) {
1810
+ // 表示是APK中
1811
+ const message = {
1812
+ type: 'scan',
1813
+ componentId: this.componentId,
1814
+ systemCode: this.pageContext.systemCode,
1815
+ listCode: this.listCode
1816
+ }
1817
+ window.parent.postMessage(JSON.stringify(message), '*')
1818
+ } else {
1819
+ // 表示是移动端浏览器中
1820
+ this.isShowBrowserScan = true
1821
+ }
1822
+ },
1823
+ /**
1824
+ * 扫描组件时,监听扫描值变化
1825
+ */
1826
+ watchScanValueChange(newValue) {
1827
+ if (this.scanEnable && this.type === 'input') {
1828
+ const valueSet = analysisScanValue(newValue, this.column._scanRuleSets)
1829
+ if (valueSet) {
1830
+ setScanAnalysisValue(this.row, valueSet.scanSet, valueSet.params)
1831
+ }
1832
+ }
1833
+ },
1834
+ closeBrowserScan(value) {
1835
+ this.isShowBrowserScan = false
1836
+ this.innerValue = value
1837
+ this.blurEvent()
1838
+ },
1839
+ packageCustomRules(columnRule) {
1840
+ console.log('packageCustomRules---columnRule=', columnRule)
1841
+ if (!columnRule) {
1842
+ return
1843
+ }
1844
+ if (columnRule.disabled !== undefined) {
1845
+ this.$emit('change-disabled', columnRule.disabled)
1846
+ }
1847
+ if (columnRule.required !== undefined) {
1848
+ this.$emit('change-required', columnRule.required)
1849
+ }
1547
1850
  }
1548
1851
  }
1549
1852
  }