super-pages 0.7.60 → 0.7.61

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": "super-pages",
3
- "version": "0.7.60",
3
+ "version": "0.7.61",
4
4
  "description": "页面组件",
5
5
  "main": "lib/super-pages.umd.min.js",
6
6
  "keyword": "super-pages",
@@ -4,73 +4,75 @@
4
4
  v-if="myButtonGroups"
5
5
  :class="getFormButtonPosition()"
6
6
  >
7
- <template v-for="(button, buttonIndex) in myButtonGroups">
8
- <el-dropdown
9
- v-if="button.isGroup"
10
- :key="buttonIndex"
11
- style="margin-right:10px"
12
- split-button
13
- :size="
14
- button.buttons && button.buttons.length > 0
15
- ? button.buttons[0].size
16
- : 'small'
17
- "
18
- @command="handleCommand"
19
- >
20
- {{ button.label }}
21
- <template v-slot:dropdown>
22
- <el-dropdown-menu>
23
- <span
24
- v-for="(buttonChild, index) in button.buttons"
25
- :key="buttonChild.code + index"
26
- >
27
- <el-dropdown-item
28
- v-permission="
29
- permissionPrefix && permissionPrefix !== ''
30
- ? permissionPrefix + buttonChild.code
31
- : ''
32
- "
33
- :command="buttonChild.code"
34
- :disabled="preventReclick"
7
+ <span style="white-space:nowrap">
8
+ <template v-for="(button, buttonIndex) in myButtonGroups">
9
+ <el-dropdown
10
+ v-if="button.isGroup"
11
+ :key="buttonIndex"
12
+ style="margin-right:10px"
13
+ split-button
14
+ :size="
15
+ button.buttons && button.buttons.length > 0
16
+ ? button.buttons[0].size
17
+ : 'small'
18
+ "
19
+ @command="handleCommand"
20
+ >
21
+ {{ button.label }}
22
+ <template v-slot:dropdown>
23
+ <el-dropdown-menu>
24
+ <span
25
+ v-for="(buttonChild, index) in button.buttons"
26
+ :key="buttonChild.code + index"
35
27
  >
36
- {{
37
- buttonChild.label
38
- ? buttonChild.label
39
- : buttonChild.code === 'search'
40
- ? $t('superPageMessage.searchButtonLabel')
28
+ <el-dropdown-item
29
+ v-permission="
30
+ permissionPrefix && permissionPrefix !== ''
31
+ ? permissionPrefix + buttonChild.code
41
32
  : ''
42
- }}
43
- </el-dropdown-item>
44
- </span>
45
- </el-dropdown-menu>
46
- </template>
47
- </el-dropdown>
48
- <!--图表页面按钮区不显示统计和重置;列表页面时不显示查询按钮;-->
49
- <my-button
50
- v-else-if="!position || (position==='list' && button.code !=='search') || (position==='chart' && button.code !=='reset' && button.code !== 'statistics') || (position !=='chart' && position !=='list')"
51
- :key="buttonIndex"
52
- :search-form-info="searchFormInfo"
53
- :button="button"
54
- :permission-prefix="permissionPrefix"
55
- :workflow-button-component="workflowButtonComponent"
56
- :position="position"
57
- :is-task-input="isTaskInput"
58
- :table-name="tableName"
59
- :page-code="pageCode"
60
- :button-groups="button.code === 'workflowButton' ? buttonGroups : []"
61
- :get-form-data="getFormData"
62
- :selections="selections"
63
- :form-data-fun="formDataFun"
64
- :get-system-ref="getSystemRef"
65
- :form-button-position="formButtonPosition"
66
- :disabled="disabled"
67
- @refresh="refreshEmit"
68
- @click="commonButtonClick"
69
- @workflowClick="workflowButtonClick"
70
- @prohibi-edit="fnProhibitToEdit"
71
- @refreshFrom="refreshFrom"
72
- />
73
- </template>
33
+ "
34
+ :command="buttonChild.code"
35
+ :disabled="preventReclick"
36
+ >
37
+ {{
38
+ buttonChild.label
39
+ ? buttonChild.label
40
+ : buttonChild.code === 'search'
41
+ ? $t('superPageMessage.searchButtonLabel')
42
+ : ''
43
+ }}
44
+ </el-dropdown-item>
45
+ </span>
46
+ </el-dropdown-menu>
47
+ </template>
48
+ </el-dropdown>
49
+ <!--图表页面按钮区不显示统计和重置;列表页面时不显示查询按钮;-->
50
+ <my-button
51
+ v-else-if="!position || (position==='list' && button.code !=='search') || (position==='chart' && button.code !=='reset' && button.code !== 'statistics') || (position !=='chart' && position !=='list')"
52
+ :key="buttonIndex"
53
+ :search-form-info="searchFormInfo"
54
+ :button="button"
55
+ :permission-prefix="permissionPrefix"
56
+ :workflow-button-component="workflowButtonComponent"
57
+ :position="position"
58
+ :is-task-input="isTaskInput"
59
+ :table-name="tableName"
60
+ :page-code="pageCode"
61
+ :button-groups="button.code === 'workflowButton' ? buttonGroups : []"
62
+ :get-form-data="getFormData"
63
+ :selections="selections"
64
+ :form-data-fun="formDataFun"
65
+ :get-system-ref="getSystemRef"
66
+ :form-button-position="formButtonPosition"
67
+ :disabled="disabled"
68
+ @refresh="refreshEmit"
69
+ @click="commonButtonClick"
70
+ @workflowClick="workflowButtonClick"
71
+ @prohibi-edit="fnProhibitToEdit"
72
+ @refreshFrom="refreshFrom"
73
+ />
74
+ </template>
75
+ </span>
74
76
  <list-toolbar-page
75
77
  v-if="listToolbarList"
76
78
  :list-toolbar-list="listToolbarList"
@@ -15,7 +15,7 @@
15
15
  :code="chartViewCode"
16
16
  :is-initial-query="isInitialQuery"
17
17
  :is-custom="isNeedCustomStyle"
18
- :additional-param-map="additionalParamMap"
18
+ :options="chartOptions"
19
19
  :query="query"
20
20
  :is-tab-chart-view="isTabChartView"
21
21
  />
@@ -72,7 +72,16 @@ export default {
72
72
  }
73
73
  },
74
74
  data () {
75
- const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
75
+ let additionalParamMap = getStoreInfo(this.pageCode, '_pathQuery')
76
+ console.log('图表页面---pathQuery=', additionalParamMap)
77
+ if (!additionalParamMap) {
78
+ additionalParamMap = {}
79
+ }
80
+ const additionalParamMapNew = getStoreInfo(this.pageCode, 'additionalParamMap')
81
+ console.log('图表页面---additionalParamMapNew=', additionalParamMapNew)
82
+ if (additionalParamMapNew) {
83
+ Object.assign(additionalParamMap, additionalParamMapNew)
84
+ }
76
85
  let isPreview = getStoreInfo(this.pageCode, '_pagePreview')
77
86
  if (isPreview === undefined) {
78
87
  // 开发模式 或 预览时按钮不受控制
@@ -96,9 +105,19 @@ export default {
96
105
  additionalParamMap,
97
106
  permissionPrefix,
98
107
  beanName,
99
- componentCode
108
+ componentCode,
109
+ chartOptions: {
110
+ additionalParamMap
111
+ }
100
112
  }
101
113
  },
114
+ created () {
115
+ const that = this
116
+ // 关闭弹框事件回调使用
117
+ eventBus.$on(this.pageCode + '_close-dialog-get-entity', () => {
118
+ eventBus.$emit(that.pageCode + '_close-super-dialog')
119
+ })
120
+ },
102
121
  mounted () {
103
122
  this.addRef()
104
123
  this.getChartQueryCodeByChart(this.chartViewCode).then(queryCode => {
@@ -139,6 +158,7 @@ export default {
139
158
  beforeDestroy () {
140
159
  eventBus.$off(this.chartQueryCode + '-clickChartSearchButton')
141
160
  eventBus.$off(this.chartQueryCode + '-clickChartResetButton')
161
+ eventBus.$off(this.pageCode + '_close-dialog-get-entity')
142
162
  },
143
163
  methods: {
144
164
  ...Util,
@@ -63,10 +63,18 @@ export default {
63
63
  }
64
64
  },
65
65
  created () {
66
- const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
67
- if (additionalParamMap) {
68
- this.additionalParamMap = additionalParamMap
66
+ let additionalParamMap = getStoreInfo(this.pageCode, '_pathQuery')
67
+ console.log('图表页面---pathQuery=', additionalParamMap)
68
+ if (!additionalParamMap) {
69
+ additionalParamMap = {}
69
70
  }
71
+ const additionalParamMapNew = getStoreInfo(this.pageCode, 'additionalParamMap')
72
+ console.log('图表页面---additionalParamMapNew=', additionalParamMapNew)
73
+ if (additionalParamMapNew) {
74
+ Object.assign(additionalParamMap, additionalParamMapNew)
75
+ }
76
+ this.additionalParamMap = additionalParamMap
77
+ this.options.additionalParamMap = additionalParamMap
70
78
  },
71
79
  mounted () {
72
80
  const that = this
@@ -103,7 +103,7 @@ import callEvents from './util/callEvents'
103
103
  import apis from './util/api'
104
104
  import { getStoreInfo, setStoreInfo } from './util/common-util'
105
105
  import eventBus from './util/eventBus'
106
- import { getSystemBackendUrl } from 'imatrix-ui/src/utils/common-util'
106
+ import { getSystemBackendUrl, isPromise } from 'imatrix-ui/src/utils/common-util'
107
107
  export default {
108
108
  name: 'CommonFormPage',
109
109
  components: {
@@ -352,46 +352,57 @@ export default {
352
352
  // 返回值为false,不继续执行按钮操作
353
353
  return
354
354
  }
355
- // 是否可执行
356
- this.canExecute(
357
- button.executableData,
358
- model,
359
- this.isSqlQuery,
360
- this.tableName,
361
- this.additionalParamMap
362
- ).then(result => {
363
- if (result.canExecute === true) {
364
- // 表示可执行条件返回结果为true
365
- const entities = result.entities
366
- if (entities && entities.length > 0) {
367
- model = entities[0]
355
+ if (isPromise(beforeClickResult)) {
356
+ beforeClickResult.then((result) => {
357
+ if (result) {
358
+ this.clickCommonFormButtonSuccess(button, model)
368
359
  }
369
- let jsContent = false
370
- if (button && typeof button.jsContent !== 'undefined') {
371
- jsContent = button.jsContent
372
- }
373
- const needDeleteFileUuidS = this.getNeedDeleteFileUuidS()
374
- this.clickFormButton(
375
- button,
376
- this.system,
377
- this.formViewCode,
378
- this.formViewVersion,
379
- this.tableName,
380
- model,
381
- this.entityName,
382
- jsContent,
383
- this.formNoRuleCode,
384
- this.ids,
385
- this.isBatchProcessing,
386
- needDeleteFileUuidS,
387
- this.additionalParamMap,
388
- this.beanName
389
- )
390
- }
391
- })
360
+ })
361
+ } else {
362
+ this.clickCommonFormButtonSuccess(button, model)
363
+ }
392
364
  })
393
365
  }
394
366
  },
367
+ clickCommonFormButtonSuccess (button, model) {
368
+ // 是否可执行
369
+ this.canExecute(
370
+ button.executableData,
371
+ model,
372
+ this.isSqlQuery,
373
+ this.tableName,
374
+ this.additionalParamMap
375
+ ).then(result => {
376
+ if (result.canExecute === true) {
377
+ // 表示可执行条件返回结果为true
378
+ const entities = result.entities
379
+ if (entities && entities.length > 0) {
380
+ model = entities[0]
381
+ }
382
+ let jsContent = false
383
+ if (button && typeof button.jsContent !== 'undefined') {
384
+ jsContent = button.jsContent
385
+ }
386
+ const needDeleteFileUuidS = this.getNeedDeleteFileUuidS()
387
+ this.clickFormButton(
388
+ button,
389
+ this.system,
390
+ this.formViewCode,
391
+ this.formViewVersion,
392
+ this.tableName,
393
+ model,
394
+ this.entityName,
395
+ jsContent,
396
+ this.formNoRuleCode,
397
+ this.ids,
398
+ this.isBatchProcessing,
399
+ needDeleteFileUuidS,
400
+ this.additionalParamMap,
401
+ this.beanName
402
+ )
403
+ }
404
+ })
405
+ },
395
406
  // 获取需要删除的附件
396
407
  getNeedDeleteFileUuidS () {
397
408
  if (this.$refs.superForm) {
@@ -138,7 +138,9 @@ export default {
138
138
  resizeHeight: this.resizeListHeight,
139
139
  pageCode: this.pageCode,
140
140
  pageHeight: pageHeight, // 页面的高度
141
- additionalParamMap: pathQuery // 将路由参数传给列表组件
141
+ additionalParamMap: pathQuery, // 将路由参数传给列表组件
142
+ showOverflowTooltip: !!(this.colSetting.options.isBreakLine === undefined || this.colSetting.options.isBreakLine === false), // 内容是否换行显示
143
+ isEnableEnterEvent: this.colSetting.options.isEnableEnterEvent // 是否启用回车事件
142
144
  }
143
145
  if (system) {
144
146
  // 系统编码传给列表数据后台请求
@@ -374,8 +376,13 @@ export default {
374
376
  })
375
377
  const additionalParamMap = getStoreInfo(this.pageCode, 'additionalParamMap')
376
378
  if (additionalParamMap) {
377
- this.additionalParamMap = additionalParamMap
378
- this.$set(this.options, 'additionalParamMap', this.additionalParamMap)
379
+ if (!this.options.additionalParamMap) {
380
+ this.$set(this.options, 'additionalParamMap', {})
381
+ }
382
+ Object.assign(this.options.additionalParamMap, additionalParamMap)
383
+ }
384
+ if (this.options.additionalParamMap) {
385
+ this.additionalParamMap = this.options.additionalParamMap
379
386
  }
380
387
  const that = this
381
388
  eventBus.$on(that.pageCode + '-close-component-page-dialog', (jumpInfo, popEntity, popPageCode) => {
@@ -468,7 +475,7 @@ export default {
468
475
  // console.log('doImport=', button)
469
476
  that.doImportFinally(that.system, button.restfulApiPath, that.tableName, that.entityName,
470
477
  that.myJsContent, button, that.listViewImportDuplicate, fileObj,
471
- that.judgeHeavyList, that.formNoRuleCode, that.importRuleCode, that.listCode, that.beanName)
478
+ that.judgeHeavyList, that.formNoRuleCode, that.importRuleCode, that.listCode, that.beanName, that.pageCode)
472
479
  } else {
473
480
  this.$message({
474
481
  showClose: true,
@@ -491,52 +498,62 @@ export default {
491
498
  // 返回值为false,不继续执行按钮操作
492
499
  return
493
500
  }
494
-
495
- let entities = []
496
- if (that.selections && that.selections !== null) {
497
- entities = [].concat(that.selections)
498
- }
499
- if (button.code && button.code === 'search') {
500
- // 表示点击的查询按钮
501
- this.clickSearchButton(button)
502
- return
503
- } else if (button.code && button.code === 'import') {
504
- this.button = button
505
- this.clickImport()
506
- return
507
- } else if (button.code && button.code === 'lineEditCreate') {
508
- this.createRow(button)
509
- return
510
- }
511
- // 不是行编辑的事件响应
512
- let dataIds = []
513
- dataIds = that.getSelectionIds()
514
- that.canExecuteWithMore(button.executableData, entities, that.isSqlQuery, this.tableName, this.additionalParamMap).then((result) => {
515
- if (result.canExecute === true) {
516
- // 表示可执行该操作
517
- if (button.code !== 'lineEditDelete' && result.entities) {
518
- entities = result.entities
519
- }
520
- let jsContent = false
521
- if (button && typeof (button.jsContent) !== 'undefined') {
522
- jsContent = button.jsContent
523
- }
524
- that.myJsContent = jsContent
525
- that.buttonRestfulApiPath = button.restfulApiPath
526
- if (button.autoSetValueData) {
527
- that.autoSetValueData = button.autoSetValueData
528
- }
529
- if (button.dataConversionRule) {
530
- that.dataConversionRule = button.dataConversionRule
501
+ if (isPromise(beforeClickResult)) {
502
+ beforeClickResult.then((result) => {
503
+ if (result) {
504
+ that.clickListButtonSuccess(button, that)
531
505
  }
532
- const UUID = that.getUUID()
533
- that.clickButton(button, that.system, that.listCode, dataIds,
534
- that.tableName, that.entityName, jsContent, entities,
535
- that.deleteLogicSetting, that.formNoRuleCode, that.importRuleCode, that.beanName, that.isWorkflowEntity, UUID)
536
- this.getExport(UUID)
537
- }
538
- })
506
+ })
507
+ } else {
508
+ that.clickListButtonSuccess(button, that)
509
+ }
510
+ }
511
+ },
512
+ clickListButtonSuccess (button, that) {
513
+ let entities = []
514
+ if (that.selections && that.selections !== null) {
515
+ entities = [].concat(that.selections)
516
+ }
517
+ if (button.code && button.code === 'search') {
518
+ // 表示点击的查询按钮
519
+ this.clickSearchButton(button)
520
+ return
521
+ } else if (button.code && button.code === 'import') {
522
+ this.button = button
523
+ this.clickImport()
524
+ return
525
+ } else if (button.code && button.code === 'lineEditCreate') {
526
+ this.createRow(button)
527
+ return
539
528
  }
529
+ // 不是行编辑的事件响应
530
+ let dataIds = []
531
+ dataIds = that.getSelectionIds()
532
+ that.canExecuteWithMore(button.executableData, entities, that.isSqlQuery, this.tableName, this.additionalParamMap).then((result) => {
533
+ if (result.canExecute === true) {
534
+ // 表示可执行该操作
535
+ if (button.code !== 'lineEditDelete' && result.entities) {
536
+ entities = result.entities
537
+ }
538
+ let jsContent = false
539
+ if (button && typeof (button.jsContent) !== 'undefined') {
540
+ jsContent = button.jsContent
541
+ }
542
+ that.myJsContent = jsContent
543
+ that.buttonRestfulApiPath = button.restfulApiPath
544
+ if (button.autoSetValueData) {
545
+ that.autoSetValueData = button.autoSetValueData
546
+ }
547
+ if (button.dataConversionRule) {
548
+ that.dataConversionRule = button.dataConversionRule
549
+ }
550
+ const UUID = that.getUUID()
551
+ that.clickButton(button, that.system, that.listCode, dataIds,
552
+ that.tableName, that.entityName, jsContent, entities,
553
+ that.deleteLogicSetting, that.formNoRuleCode, that.importRuleCode, that.beanName, that.isWorkflowEntity, UUID)
554
+ this.getExport(UUID)
555
+ }
556
+ })
540
557
  },
541
558
  /**
542
559
  * 获取一个UUID
@@ -3,8 +3,9 @@
3
3
  <span
4
4
  v-for="(toolbar) in listToolbarList"
5
5
  :key="toolbar.label"
6
+ style="display: inline-block;"
6
7
  >
7
- {{ toolbar.label }}
8
+ <span v-if="toolbar.controlType !== 'scan'">{{ toolbar.label }}</span>
8
9
  <el-select
9
10
  v-if="toolbar.controlType === 'select'"
10
11
  v-model="modelObj[toolbar.propDbName]"
@@ -81,6 +82,13 @@
81
82
  :placeholder="toolbar.nullLabel"
82
83
  @change="searchGridData(toolbar.controlType)"
83
84
  />
85
+ <el-input
86
+ v-if="toolbar.controlType === 'scan'"
87
+ v-model="modelObj[toolbar.propDbName]"
88
+ :size="toolbar.size?toolbar.size:small"
89
+ :placeholder="toolbar.nullLabel?toolbar.nullLabel:toolbar.label"
90
+ @blur="searchGridData(toolbar.controlType)"
91
+ />
84
92
  </span>
85
93
  </span>
86
94
  </template>
@@ -92,9 +92,10 @@ export default {
92
92
  sessionStorage.removeItem(paramStoreId)
93
93
  if (additionalParamMapJson) {
94
94
  // 缓存页面动态参数
95
- pageSettingStoreInfo.additionalParamMap = JSON.parse(additionalParamMapJson)
95
+ const additionalParamMap = JSON.parse(additionalParamMapJson)
96
+ pageSettingStoreInfo.additionalParamMap = additionalParamMap
96
97
  store.set(this.code, pageSettingStoreInfo)
97
- console.log('已获取到附加参数', JSON.parse(additionalParamMapJson))
98
+ console.log('已获取到附加参数', additionalParamMap)
98
99
  }
99
100
  }
100
101
  }