super-pages 0.0.3-up → 0.0.4-up
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/README.md +7 -7
- package/index.html +13 -13
- package/lib/super-pages.css +1 -1
- package/lib/super-pages.js +2488 -2559
- package/lib/super-pages.umd.cjs +14 -14
- package/package.json +3 -6
- package/packages/index.js +30 -30
- package/packages/super-page/index.js +9 -9
- package/packages/super-page/src/button-group.vue +294 -294
- package/packages/super-page/src/chart-page.vue +215 -215
- package/packages/super-page/src/chart-query-page.vue +163 -163
- package/packages/super-page/src/export-form-report-dialog.vue +145 -145
- package/packages/super-page/src/form-head.vue +74 -74
- package/packages/super-page/src/form-page.vue +107 -107
- package/packages/super-page/src/group-tag.vue +21 -21
- package/packages/super-page/src/list-page.vue +1454 -1454
- package/packages/super-page/src/list-toolbar-dynamic-source.vue +89 -89
- package/packages/super-page/src/list-toolbar-page.vue +377 -377
- package/packages/super-page/src/my-button-base.vue +438 -438
- package/packages/super-page/src/my-button.vue +196 -196
- package/packages/super-page/src/page-custom-component.vue +56 -56
- package/packages/super-page/src/remove-signer-dialog.vue +103 -103
- package/packages/super-page/src/sub-tab-page.vue +79 -79
- package/packages/super-page/src/super-page-component.vue +86 -86
- package/packages/super-page/src/super-page.vue +162 -162
- package/packages/super-page/src/tab-page.vue +154 -154
- package/packages/super-page/src/task-informition-dialog.vue +82 -82
- package/packages/super-page/src/util/ListButtonEvent.js +896 -896
- package/packages/super-page/src/util/api.js +37 -37
- package/packages/super-page/src/util/callEvents.js +62 -62
- package/packages/super-page/src/util/chartButtonEvent.js +60 -60
- package/packages/super-page/src/util/common-util.js +102 -102
- package/packages/super-page/src/util/commonButtonEvent.js +70 -70
- package/packages/super-page/src/util/eventBus.js +2 -2
- package/packages/super-page/src/util/formButtonEvent.js +509 -509
- package/packages/super-page/src/util/store.js +3 -3
- package/packages/super-page/src/util/super-page.js +29 -29
- package/packages/super-page/src/util/workflowButtonEvent.js +1729 -1729
- package/packages/super-page/src/widget-col-page.vue +339 -339
- package/packages/super-page/src/widget-page.vue +703 -703
- package/packages/super-page/src/widget-sub-tab-pane-page.vue +115 -115
- package/packages/super-page/src/widget-tab-pane-page.vue +135 -135
- package/packages/super-page/src/workflow-button-group.vue +561 -561
- package/packages/super-page-dialog/index.js +9 -9
- package/packages/super-page-dialog/src/super-page-dialog.vue +200 -200
- package/packages/utils/gogocodeTransfer.js +59 -59
- package/src/i18n/langs/cn.js +65 -65
- package/src/i18n/langs/en.js +68 -68
- package/src/utils/common-util.js +9 -9
- package/vite.config.js +36 -36
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<super-page-component
|
|
4
|
-
:code="code"
|
|
5
|
-
:data-id="dataId"
|
|
6
|
-
:task-id="taskId"
|
|
7
|
-
:page-setting="pageSetting"
|
|
8
|
-
:preview="preview"
|
|
9
|
-
:class="code"
|
|
10
|
-
:is-dsc="isDsc"
|
|
11
|
-
@update-value="updateValues"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
18
|
-
import SuperPageComponent from './super-page-component'
|
|
19
|
-
import store from './util/store'
|
|
20
|
-
import { getPageParam } from './util/common-util' // getStoreInfo,
|
|
21
|
-
export default {
|
|
22
|
-
name: 'SuperPage',
|
|
23
|
-
components: {
|
|
24
|
-
SuperPageComponent,
|
|
25
|
-
},
|
|
26
|
-
props: {
|
|
27
|
-
// 页面编码
|
|
28
|
-
code: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: null,
|
|
31
|
-
},
|
|
32
|
-
// 表单页面修改记录时记录id
|
|
33
|
-
dataId: {
|
|
34
|
-
type: Number,
|
|
35
|
-
default: null,
|
|
36
|
-
},
|
|
37
|
-
// 流程表单页面办理任务时任务id
|
|
38
|
-
taskId: {
|
|
39
|
-
type: Number,
|
|
40
|
-
default: null,
|
|
41
|
-
},
|
|
42
|
-
// 页面布局信息
|
|
43
|
-
pageSetting: {
|
|
44
|
-
type: Object,
|
|
45
|
-
default: null,
|
|
46
|
-
},
|
|
47
|
-
// 是否是预览,预览时页面各元素不受权限控制,且按钮等元素不可以操作,只能看页面样子
|
|
48
|
-
preview: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false,
|
|
51
|
-
},
|
|
52
|
-
// 是否是dsc系统中调用该组件。影响列表组件和表单组件数据显示
|
|
53
|
-
isDsc: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false,
|
|
56
|
-
},
|
|
57
|
-
// 是否是开发模式
|
|
58
|
-
devMode: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
// 页面跳转方式:newTab或refresh
|
|
63
|
-
jumpMode: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: null,
|
|
66
|
-
},
|
|
67
|
-
// 打开页面的按钮编码,例如:查看详情按钮viewDetail
|
|
68
|
-
buttonCode: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: null,
|
|
71
|
-
},
|
|
72
|
-
pathQuery: {
|
|
73
|
-
type: Object,
|
|
74
|
-
default: null,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
data() {
|
|
78
|
-
return {
|
|
79
|
-
isShowDialog: false, // 是否弹框显示页面
|
|
80
|
-
pageComponent: null, // 弹框时源列表组件或表单组件
|
|
81
|
-
pageType: null, // 弹框时源页面类型:表单、列表
|
|
82
|
-
jumpPageCode: null,
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
created() {
|
|
86
|
-
store.set(
|
|
87
|
-
this.code,
|
|
88
|
-
getPageParam(this.devMode, this.jumpMode, this.buttonCode, this.pathQuery)
|
|
89
|
-
)
|
|
90
|
-
const pageSettingStoreInfo = store.get(this.code)
|
|
91
|
-
if (this.pathQuery) {
|
|
92
|
-
// 在页面的路由参数中获得sessionStorage动态参数存储的key
|
|
93
|
-
const paramStoreId = this.pathQuery.paramStoreId
|
|
94
|
-
if (paramStoreId) {
|
|
95
|
-
const additionalParamMapJson = sessionStorage.getItem(paramStoreId)
|
|
96
|
-
sessionStorage.removeItem(paramStoreId)
|
|
97
|
-
if (additionalParamMapJson) {
|
|
98
|
-
// 缓存页面动态参数
|
|
99
|
-
const additionalParamMap = JSON.parse(additionalParamMapJson)
|
|
100
|
-
pageSettingStoreInfo.additionalParamMap = additionalParamMap
|
|
101
|
-
store.set(this.code, pageSettingStoreInfo)
|
|
102
|
-
console.log('已获取到附加参数', additionalParamMap)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (this.pathQuery.ids) {
|
|
106
|
-
if (pageSettingStoreInfo) {
|
|
107
|
-
const idsStr = this.pathQuery.ids
|
|
108
|
-
if (idsStr) {
|
|
109
|
-
if (pageSettingStoreInfo) {
|
|
110
|
-
pageSettingStoreInfo._pathQuery = {
|
|
111
|
-
_idsStr: idsStr,
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
store.set(this.pageCode, pageSettingStoreInfo)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
methods: {
|
|
121
|
-
// 调用关闭弹框回调方法
|
|
122
|
-
callCloseDialog(closeDialogEvent, pageValue, soureForm, formData) {
|
|
123
|
-
if (closeDialogEvent) {
|
|
124
|
-
const params = {
|
|
125
|
-
pageValue,
|
|
126
|
-
formData,
|
|
127
|
-
soureComponent: this.pageComponent,
|
|
128
|
-
}
|
|
129
|
-
closeDialogEvent.call(this, params)
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
getPageComponent(pageComponent, pageType) {
|
|
133
|
-
this.pageComponent = pageComponent
|
|
134
|
-
this.pageType = pageType
|
|
135
|
-
},
|
|
136
|
-
updateValues(sourceModel, sourceTableName, targetRowIndex) {
|
|
137
|
-
console.log(
|
|
138
|
-
'update-value444-super-page-',
|
|
139
|
-
sourceModel,
|
|
140
|
-
sourceTableName,
|
|
141
|
-
targetRowIndex
|
|
142
|
-
)
|
|
143
|
-
$emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
emits: ['update-value'],
|
|
147
|
-
}
|
|
148
|
-
</script>
|
|
149
|
-
|
|
150
|
-
<style>
|
|
151
|
-
.el-date-editor.el-input,
|
|
152
|
-
.el-date-editor.el-input__input,
|
|
153
|
-
.el-date-editor.el-input__inner {
|
|
154
|
-
width: 100%;
|
|
155
|
-
}
|
|
156
|
-
.el-date-editor--daterange.el-input,
|
|
157
|
-
.el-date-editor--daterange.el-input__inner,
|
|
158
|
-
.el-date-editor--timerange.el-input,
|
|
159
|
-
.el-date-editor--timerange.el-input__inner {
|
|
160
|
-
width: 100%;
|
|
161
|
-
}
|
|
162
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<super-page-component
|
|
4
|
+
:code="code"
|
|
5
|
+
:data-id="dataId"
|
|
6
|
+
:task-id="taskId"
|
|
7
|
+
:page-setting="pageSetting"
|
|
8
|
+
:preview="preview"
|
|
9
|
+
:class="code"
|
|
10
|
+
:is-dsc="isDsc"
|
|
11
|
+
@update-value="updateValues"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
18
|
+
import SuperPageComponent from './super-page-component'
|
|
19
|
+
import store from './util/store'
|
|
20
|
+
import { getPageParam } from './util/common-util' // getStoreInfo,
|
|
21
|
+
export default {
|
|
22
|
+
name: 'SuperPage',
|
|
23
|
+
components: {
|
|
24
|
+
SuperPageComponent,
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
// 页面编码
|
|
28
|
+
code: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
32
|
+
// 表单页面修改记录时记录id
|
|
33
|
+
dataId: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: null,
|
|
36
|
+
},
|
|
37
|
+
// 流程表单页面办理任务时任务id
|
|
38
|
+
taskId: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: null,
|
|
41
|
+
},
|
|
42
|
+
// 页面布局信息
|
|
43
|
+
pageSetting: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: null,
|
|
46
|
+
},
|
|
47
|
+
// 是否是预览,预览时页面各元素不受权限控制,且按钮等元素不可以操作,只能看页面样子
|
|
48
|
+
preview: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
// 是否是dsc系统中调用该组件。影响列表组件和表单组件数据显示
|
|
53
|
+
isDsc: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
// 是否是开发模式
|
|
58
|
+
devMode: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
// 页面跳转方式:newTab或refresh
|
|
63
|
+
jumpMode: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: null,
|
|
66
|
+
},
|
|
67
|
+
// 打开页面的按钮编码,例如:查看详情按钮viewDetail
|
|
68
|
+
buttonCode: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
pathQuery: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: null,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
isShowDialog: false, // 是否弹框显示页面
|
|
80
|
+
pageComponent: null, // 弹框时源列表组件或表单组件
|
|
81
|
+
pageType: null, // 弹框时源页面类型:表单、列表
|
|
82
|
+
jumpPageCode: null,
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
created() {
|
|
86
|
+
store.set(
|
|
87
|
+
this.code,
|
|
88
|
+
getPageParam(this.devMode, this.jumpMode, this.buttonCode, this.pathQuery)
|
|
89
|
+
)
|
|
90
|
+
const pageSettingStoreInfo = store.get(this.code)
|
|
91
|
+
if (this.pathQuery) {
|
|
92
|
+
// 在页面的路由参数中获得sessionStorage动态参数存储的key
|
|
93
|
+
const paramStoreId = this.pathQuery.paramStoreId
|
|
94
|
+
if (paramStoreId) {
|
|
95
|
+
const additionalParamMapJson = sessionStorage.getItem(paramStoreId)
|
|
96
|
+
sessionStorage.removeItem(paramStoreId)
|
|
97
|
+
if (additionalParamMapJson) {
|
|
98
|
+
// 缓存页面动态参数
|
|
99
|
+
const additionalParamMap = JSON.parse(additionalParamMapJson)
|
|
100
|
+
pageSettingStoreInfo.additionalParamMap = additionalParamMap
|
|
101
|
+
store.set(this.code, pageSettingStoreInfo)
|
|
102
|
+
console.log('已获取到附加参数', additionalParamMap)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (this.pathQuery.ids) {
|
|
106
|
+
if (pageSettingStoreInfo) {
|
|
107
|
+
const idsStr = this.pathQuery.ids
|
|
108
|
+
if (idsStr) {
|
|
109
|
+
if (pageSettingStoreInfo) {
|
|
110
|
+
pageSettingStoreInfo._pathQuery = {
|
|
111
|
+
_idsStr: idsStr,
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
store.set(this.pageCode, pageSettingStoreInfo)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
methods: {
|
|
121
|
+
// 调用关闭弹框回调方法
|
|
122
|
+
callCloseDialog(closeDialogEvent, pageValue, soureForm, formData) {
|
|
123
|
+
if (closeDialogEvent) {
|
|
124
|
+
const params = {
|
|
125
|
+
pageValue,
|
|
126
|
+
formData,
|
|
127
|
+
soureComponent: this.pageComponent,
|
|
128
|
+
}
|
|
129
|
+
closeDialogEvent.call(this, params)
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
getPageComponent(pageComponent, pageType) {
|
|
133
|
+
this.pageComponent = pageComponent
|
|
134
|
+
this.pageType = pageType
|
|
135
|
+
},
|
|
136
|
+
updateValues(sourceModel, sourceTableName, targetRowIndex) {
|
|
137
|
+
console.log(
|
|
138
|
+
'update-value444-super-page-',
|
|
139
|
+
sourceModel,
|
|
140
|
+
sourceTableName,
|
|
141
|
+
targetRowIndex
|
|
142
|
+
)
|
|
143
|
+
$emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
emits: ['update-value'],
|
|
147
|
+
}
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style>
|
|
151
|
+
.el-date-editor.el-input,
|
|
152
|
+
.el-date-editor.el-input__input,
|
|
153
|
+
.el-date-editor.el-input__inner {
|
|
154
|
+
width: 100%;
|
|
155
|
+
}
|
|
156
|
+
.el-date-editor--daterange.el-input,
|
|
157
|
+
.el-date-editor--daterange.el-input__inner,
|
|
158
|
+
.el-date-editor--timerange.el-input,
|
|
159
|
+
.el-date-editor--timerange.el-input__inner {
|
|
160
|
+
width: 100%;
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-tabs
|
|
4
|
-
v-model="activeName"
|
|
5
|
-
:type="isTabChartView ? '' : 'border-card'"
|
|
6
|
-
@tab-click="handleClick($event, colSetting.baseSetting.clickEvent)"
|
|
7
|
-
>
|
|
8
|
-
<el-tab-pane
|
|
9
|
-
v-for="tab in colSetting.options.tabContent"
|
|
10
|
-
:key="tab.code"
|
|
11
|
-
:label="tab.label"
|
|
12
|
-
:name="tab.code"
|
|
13
|
-
>
|
|
14
|
-
<widget-tab-pane-page
|
|
15
|
-
:page-code="pageCode"
|
|
16
|
-
:data-id="dataId"
|
|
17
|
-
:one-tab-content="tab.list ? tab.list : []"
|
|
18
|
-
:workflow-id="workflowId"
|
|
19
|
-
:tab-code="tab.code"
|
|
20
|
-
:task-id="taskId"
|
|
21
|
-
:chart-query-setting="chartQuerySetting"
|
|
22
|
-
@update-value="updateValues"
|
|
23
|
-
@export="exportReport"
|
|
24
|
-
/>
|
|
25
|
-
</el-tab-pane>
|
|
26
|
-
</el-tabs>
|
|
27
|
-
</div>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
32
|
-
import WidgetTabPanePage from './widget-tab-pane-page'
|
|
33
|
-
import util from './util/util'
|
|
34
|
-
import eventBus from './util/eventBus'
|
|
35
|
-
import { getStoreInfo, setStoreInfo } from './util/common-util'
|
|
36
|
-
import callEvents from './util/callEvents'
|
|
37
|
-
export default {
|
|
38
|
-
name: 'TabPage',
|
|
39
|
-
components: {
|
|
40
|
-
WidgetTabPanePage,
|
|
41
|
-
},
|
|
42
|
-
props: {
|
|
43
|
-
// 页面编码
|
|
44
|
-
pageCode: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: null,
|
|
47
|
-
},
|
|
48
|
-
// 表单页面修改记录id
|
|
49
|
-
dataId: {
|
|
50
|
-
type: Number,
|
|
51
|
-
default: null,
|
|
52
|
-
},
|
|
53
|
-
// 流程表单页面办理任务时任务id
|
|
54
|
-
taskId: {
|
|
55
|
-
type: Number,
|
|
56
|
-
default: null,
|
|
57
|
-
},
|
|
58
|
-
colSetting: {
|
|
59
|
-
type: Object,
|
|
60
|
-
default: null,
|
|
61
|
-
},
|
|
62
|
-
// 图表查询组件配置col
|
|
63
|
-
chartQuerySetting: {
|
|
64
|
-
type: Object,
|
|
65
|
-
default: null,
|
|
66
|
-
},
|
|
67
|
-
// 是否是图表页签
|
|
68
|
-
isTabChartView: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
data() {
|
|
74
|
-
let activeName = ''
|
|
75
|
-
const tabContent = this.colSetting.options.tabContent
|
|
76
|
-
if (tabContent && tabContent.length > 0) {
|
|
77
|
-
activeName = tabContent[0].code
|
|
78
|
-
}
|
|
79
|
-
setStoreInfo(this.pageCode, '_activeTab', activeName)
|
|
80
|
-
return {
|
|
81
|
-
pageEvents: [],
|
|
82
|
-
activeName,
|
|
83
|
-
workflowId: null, // 流程实例id,第1个子页签是流转历史时需要该参数
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
created() {
|
|
87
|
-
// 封装表单事件
|
|
88
|
-
const allFormEvents = {}
|
|
89
|
-
let formEvents = []
|
|
90
|
-
const pageEvents = getStoreInfo(this.pageCode, '_pageEvents')
|
|
91
|
-
if (pageEvents) {
|
|
92
|
-
formEvents = pageEvents.formEvents
|
|
93
|
-
if (formEvents) {
|
|
94
|
-
Object.keys(formEvents).forEach((key) => {
|
|
95
|
-
const formViewCodeKey = key.substring(0, key.indexOf('__'))
|
|
96
|
-
if (this.pageCode === formViewCodeKey) {
|
|
97
|
-
// 表示是当前表单的事件,封装到事件对象中
|
|
98
|
-
const event = key.substring(key.indexOf('__') + '__'.length)
|
|
99
|
-
allFormEvents[event] = formEvents[key]
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
const customEvents = pageEvents.customEvents
|
|
104
|
-
if (customEvents) {
|
|
105
|
-
allFormEvents.customEvents = customEvents
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
this.pageEvents = allFormEvents
|
|
109
|
-
},
|
|
110
|
-
mounted() {},
|
|
111
|
-
methods: {
|
|
112
|
-
...callEvents,
|
|
113
|
-
handleClick($event, eventName) {
|
|
114
|
-
// 当前选中的页签编码
|
|
115
|
-
setStoreInfo(this.pageCode, '_activeTab', this.activeName)
|
|
116
|
-
// acitveTabName
|
|
117
|
-
if (eventName) {
|
|
118
|
-
this.callFormItemEvent(this.pageEvents, eventName, null, {
|
|
119
|
-
acitveTabName: this.activeName,
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
// 先清空实例id,为了更新显示流转历史
|
|
123
|
-
this.workflowId = util.getWorkflowId(this.pageCode)
|
|
124
|
-
$emit(eventBus, 'refreshHistory')
|
|
125
|
-
// 点击页签时,刷新页签区域内容
|
|
126
|
-
this.refreshTabContent()
|
|
127
|
-
// console.log('tab-handleClick-', tab, event)
|
|
128
|
-
},
|
|
129
|
-
updateValues(sourceModel, sourceTableName, targetRowIndex) {
|
|
130
|
-
$emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
|
|
131
|
-
},
|
|
132
|
-
// 点击页签时,刷新页签区域内容
|
|
133
|
-
refreshTabContent() {
|
|
134
|
-
if (
|
|
135
|
-
this.colSetting.baseSetting.isRefreshContent === undefined ||
|
|
136
|
-
this.colSetting.baseSetting.isRefreshContent
|
|
137
|
-
) {
|
|
138
|
-
// 如果配置的点击页签时刷新页面
|
|
139
|
-
this.refreshTab(this.activeName)
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
// 刷新页签内容:列表数据或表单数据
|
|
143
|
-
refreshTab(tabCode) {
|
|
144
|
-
$emit(eventBus, this.pageCode + '-refresh-tab', tabCode)
|
|
145
|
-
},
|
|
146
|
-
// chartQuery组件,导出报告
|
|
147
|
-
exportReport(beanName) {
|
|
148
|
-
// 向父页面传递
|
|
149
|
-
$emit(this, 'export', beanName)
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
emits: ['update-value', , 'export', 'refreshHistory'],
|
|
153
|
-
}
|
|
154
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tabs
|
|
4
|
+
v-model="activeName"
|
|
5
|
+
:type="isTabChartView ? '' : 'border-card'"
|
|
6
|
+
@tab-click="handleClick($event, colSetting.baseSetting.clickEvent)"
|
|
7
|
+
>
|
|
8
|
+
<el-tab-pane
|
|
9
|
+
v-for="tab in colSetting.options.tabContent"
|
|
10
|
+
:key="tab.code"
|
|
11
|
+
:label="tab.label"
|
|
12
|
+
:name="tab.code"
|
|
13
|
+
>
|
|
14
|
+
<widget-tab-pane-page
|
|
15
|
+
:page-code="pageCode"
|
|
16
|
+
:data-id="dataId"
|
|
17
|
+
:one-tab-content="tab.list ? tab.list : []"
|
|
18
|
+
:workflow-id="workflowId"
|
|
19
|
+
:tab-code="tab.code"
|
|
20
|
+
:task-id="taskId"
|
|
21
|
+
:chart-query-setting="chartQuerySetting"
|
|
22
|
+
@update-value="updateValues"
|
|
23
|
+
@export="exportReport"
|
|
24
|
+
/>
|
|
25
|
+
</el-tab-pane>
|
|
26
|
+
</el-tabs>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
32
|
+
import WidgetTabPanePage from './widget-tab-pane-page'
|
|
33
|
+
import util from './util/util'
|
|
34
|
+
import eventBus from './util/eventBus'
|
|
35
|
+
import { getStoreInfo, setStoreInfo } from './util/common-util'
|
|
36
|
+
import callEvents from './util/callEvents'
|
|
37
|
+
export default {
|
|
38
|
+
name: 'TabPage',
|
|
39
|
+
components: {
|
|
40
|
+
WidgetTabPanePage,
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
// 页面编码
|
|
44
|
+
pageCode: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: null,
|
|
47
|
+
},
|
|
48
|
+
// 表单页面修改记录id
|
|
49
|
+
dataId: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: null,
|
|
52
|
+
},
|
|
53
|
+
// 流程表单页面办理任务时任务id
|
|
54
|
+
taskId: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: null,
|
|
57
|
+
},
|
|
58
|
+
colSetting: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default: null,
|
|
61
|
+
},
|
|
62
|
+
// 图表查询组件配置col
|
|
63
|
+
chartQuerySetting: {
|
|
64
|
+
type: Object,
|
|
65
|
+
default: null,
|
|
66
|
+
},
|
|
67
|
+
// 是否是图表页签
|
|
68
|
+
isTabChartView: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
data() {
|
|
74
|
+
let activeName = ''
|
|
75
|
+
const tabContent = this.colSetting.options.tabContent
|
|
76
|
+
if (tabContent && tabContent.length > 0) {
|
|
77
|
+
activeName = tabContent[0].code
|
|
78
|
+
}
|
|
79
|
+
setStoreInfo(this.pageCode, '_activeTab', activeName)
|
|
80
|
+
return {
|
|
81
|
+
pageEvents: [],
|
|
82
|
+
activeName,
|
|
83
|
+
workflowId: null, // 流程实例id,第1个子页签是流转历史时需要该参数
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
created() {
|
|
87
|
+
// 封装表单事件
|
|
88
|
+
const allFormEvents = {}
|
|
89
|
+
let formEvents = []
|
|
90
|
+
const pageEvents = getStoreInfo(this.pageCode, '_pageEvents')
|
|
91
|
+
if (pageEvents) {
|
|
92
|
+
formEvents = pageEvents.formEvents
|
|
93
|
+
if (formEvents) {
|
|
94
|
+
Object.keys(formEvents).forEach((key) => {
|
|
95
|
+
const formViewCodeKey = key.substring(0, key.indexOf('__'))
|
|
96
|
+
if (this.pageCode === formViewCodeKey) {
|
|
97
|
+
// 表示是当前表单的事件,封装到事件对象中
|
|
98
|
+
const event = key.substring(key.indexOf('__') + '__'.length)
|
|
99
|
+
allFormEvents[event] = formEvents[key]
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
const customEvents = pageEvents.customEvents
|
|
104
|
+
if (customEvents) {
|
|
105
|
+
allFormEvents.customEvents = customEvents
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.pageEvents = allFormEvents
|
|
109
|
+
},
|
|
110
|
+
mounted() {},
|
|
111
|
+
methods: {
|
|
112
|
+
...callEvents,
|
|
113
|
+
handleClick($event, eventName) {
|
|
114
|
+
// 当前选中的页签编码
|
|
115
|
+
setStoreInfo(this.pageCode, '_activeTab', this.activeName)
|
|
116
|
+
// acitveTabName
|
|
117
|
+
if (eventName) {
|
|
118
|
+
this.callFormItemEvent(this.pageEvents, eventName, null, {
|
|
119
|
+
acitveTabName: this.activeName,
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
// 先清空实例id,为了更新显示流转历史
|
|
123
|
+
this.workflowId = util.getWorkflowId(this.pageCode)
|
|
124
|
+
$emit(eventBus, 'refreshHistory')
|
|
125
|
+
// 点击页签时,刷新页签区域内容
|
|
126
|
+
this.refreshTabContent()
|
|
127
|
+
// console.log('tab-handleClick-', tab, event)
|
|
128
|
+
},
|
|
129
|
+
updateValues(sourceModel, sourceTableName, targetRowIndex) {
|
|
130
|
+
$emit(this, 'update-value', sourceModel, sourceTableName, targetRowIndex)
|
|
131
|
+
},
|
|
132
|
+
// 点击页签时,刷新页签区域内容
|
|
133
|
+
refreshTabContent() {
|
|
134
|
+
if (
|
|
135
|
+
this.colSetting.baseSetting.isRefreshContent === undefined ||
|
|
136
|
+
this.colSetting.baseSetting.isRefreshContent
|
|
137
|
+
) {
|
|
138
|
+
// 如果配置的点击页签时刷新页面
|
|
139
|
+
this.refreshTab(this.activeName)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// 刷新页签内容:列表数据或表单数据
|
|
143
|
+
refreshTab(tabCode) {
|
|
144
|
+
$emit(eventBus, this.pageCode + '-refresh-tab', tabCode)
|
|
145
|
+
},
|
|
146
|
+
// chartQuery组件,导出报告
|
|
147
|
+
exportReport(beanName) {
|
|
148
|
+
// 向父页面传递
|
|
149
|
+
$emit(this, 'export', beanName)
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
emits: ['update-value', , 'export', 'refreshHistory'],
|
|
153
|
+
}
|
|
154
|
+
</script>
|