super-page-runtime 1.0.16 → 1.0.17
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 +5 -1
- package/.eslintrc.cjs +0 -26
- package/.prettierrc.json +0 -8
- package/App.vue +0 -9
- package/components/index.ts +0 -17
- package/components/runtime/index.ts +0 -2
- package/components/runtime/utils/assemblys-config.js +0 -294
- package/components/runtime/views/assemblys/button/button/button-runtime.vue +0 -49
- package/components/runtime/views/assemblys/button/button-group/buttongroup-runtime.vue +0 -26
- package/components/runtime/views/assemblys/button/dropdown/dropdown-runtime.vue +0 -93
- package/components/runtime/views/assemblys/chart/column-line/column-line-runtime.vue +0 -59
- package/components/runtime/views/assemblys/chart/common/common-attr-assistant.vue +0 -32
- package/components/runtime/views/assemblys/chart/common/common-attr-base.vue +0 -60
- package/components/runtime/views/assemblys/chart/common/common-attr-drill.vue +0 -39
- package/components/runtime/views/assemblys/chart/common/common-attr-groupby.vue +0 -104
- package/components/runtime/views/assemblys/chart/common/common-attr-serieslist.vue +0 -145
- package/components/runtime/views/assemblys/chart/common/common-attr-sortby.vue +0 -119
- package/components/runtime/views/assemblys/chart/common/common-style-custom.vue +0 -28
- package/components/runtime/views/assemblys/chart/common/common-style-datazoom.vue +0 -45
- package/components/runtime/views/assemblys/chart/common/common-style-font-subtitle.vue +0 -78
- package/components/runtime/views/assemblys/chart/common/common-style-font-title.vue +0 -56
- package/components/runtime/views/assemblys/chart/common/common-style-grid.vue +0 -70
- package/components/runtime/views/assemblys/chart/common/common-style-legend.vue +0 -70
- package/components/runtime/views/assemblys/chart/common/common-style-tooltip.vue +0 -140
- package/components/runtime/views/assemblys/chart/common/common-style-xaxis.vue +0 -58
- package/components/runtime/views/assemblys/chart/common/common-style-yaxis.vue +0 -125
- package/components/runtime/views/assemblys/chart/common-series/common-attr-dataset.vue +0 -67
- package/components/runtime/views/assemblys/chart/common-series/common-attr-dynamic.vue +0 -57
- package/components/runtime/views/assemblys/chart/common-series/common-attr-testdatas.vue +0 -23
- package/components/runtime/views/assemblys/chart/common-series/common-style-label.vue +0 -209
- package/components/runtime/views/assemblys/chart/gauge/gauge-runtime.vue +0 -46
- package/components/runtime/views/assemblys/chart/pie/pie-runtime.vue +0 -56
- package/components/runtime/views/assemblys/chart/radar/radar-runtime.vue +0 -55
- package/components/runtime/views/assemblys/chart/scatter/scatter-runtime.vue +0 -57
- package/components/runtime/views/assemblys/common/common-attr-cursor.vue +0 -23
- package/components/runtime/views/assemblys/common/common-attr-size.vue +0 -54
- package/components/runtime/views/assemblys/common/common-select-table.vue +0 -287
- package/components/runtime/views/assemblys/common/common-style-background.vue +0 -46
- package/components/runtime/views/assemblys/common/common-style-border.vue +0 -37
- package/components/runtime/views/assemblys/common/common-style-custom.vue +0 -35
- package/components/runtime/views/assemblys/common/common-style-font-head.vue +0 -53
- package/components/runtime/views/assemblys/common/common-style-font.vue +0 -53
- package/components/runtime/views/assemblys/common/common-style-margin.vue +0 -34
- package/components/runtime/views/assemblys/common/common-style-padding.vue +0 -34
- package/components/runtime/views/assemblys/common/common-style-position.vue +0 -39
- package/components/runtime/views/assemblys/common/common-style-shadow.vue +0 -37
- package/components/runtime/views/assemblys/common/export-form-report-dialog.vue +0 -108
- package/components/runtime/views/assemblys/common/remove-signer-dialog.vue +0 -99
- package/components/runtime/views/assemblys/common/task-informition-dialog.vue +0 -69
- package/components/runtime/views/assemblys/common-attr-events.vue +0 -46
- package/components/runtime/views/assemblys/container/card/card-runtime.vue +0 -59
- package/components/runtime/views/assemblys/container/collapse/collapse-runtime.vue +0 -59
- package/components/runtime/views/assemblys/container/container/container-runtime.vue +0 -41
- package/components/runtime/views/assemblys/container/flex/flex-runtime.vue +0 -35
- package/components/runtime/views/assemblys/container/form/form-runtime.vue +0 -37
- package/components/runtime/views/assemblys/container/iframe/iframe-runtime.vue +0 -32
- package/components/runtime/views/assemblys/container/tabs/tabs-runtime.vue +0 -54
- package/components/runtime/views/assemblys/container/tools/tools-runtime.vue +0 -99
- package/components/runtime/views/assemblys/data/bar-code/barcode-attr-base.vue +0 -117
- package/components/runtime/views/assemblys/data/bar-code/barcode-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/data/bar-code/barcode-attr-style.vue +0 -25
- package/components/runtime/views/assemblys/data/bar-code/barcode-attr.vue +0 -28
- package/components/runtime/views/assemblys/data/bar-code/barcode-design.vue +0 -103
- package/components/runtime/views/assemblys/data/component/attr-header.vue +0 -69
- package/components/runtime/views/assemblys/data/component/attr-style.vue +0 -64
- package/components/runtime/views/assemblys/data/component/column-config.vue +0 -171
- package/components/runtime/views/assemblys/data/component/combinedHeader.vue +0 -96
- package/components/runtime/views/assemblys/data/component/composite-header.vue +0 -257
- package/components/runtime/views/assemblys/data/component/configuration-value.vue +0 -206
- package/components/runtime/views/assemblys/data/component/data-origin-tree.vue +0 -117
- package/components/runtime/views/assemblys/data/component/data-origin.vue +0 -260
- package/components/runtime/views/assemblys/data/component/formatting.vue +0 -200
- package/components/runtime/views/assemblys/data/component/in-parameter.vue +0 -56
- package/components/runtime/views/assemblys/data/component/querySetting.vue +0 -52
- package/components/runtime/views/assemblys/data/component/return-set-table.vue +0 -91
- package/components/runtime/views/assemblys/data/component/row-backgroud-color.vue +0 -58
- package/components/runtime/views/assemblys/data/component/select-data-table.vue +0 -86
- package/components/runtime/views/assemblys/data/table/main-table-runtime.vue +0 -858
- package/components/runtime/views/assemblys/data/table/sub-table-runtime.vue +0 -625
- package/components/runtime/views/assemblys/data/table/table-runtime.vue +0 -93
- package/components/runtime/views/assemblys/data/tree/tree-attr-base.vue +0 -137
- package/components/runtime/views/assemblys/data/tree/tree-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/data/tree/tree-attr-style.vue +0 -55
- package/components/runtime/views/assemblys/data/tree/tree-attr.vue +0 -28
- package/components/runtime/views/assemblys/data/tree/tree-design.vue +0 -125
- package/components/runtime/views/assemblys/error-attr.vue +0 -15
- package/components/runtime/views/assemblys/error-render.vue +0 -17
- package/components/runtime/views/assemblys/form/cascader/cascader-design.vue +0 -288
- package/components/runtime/views/assemblys/form/checkbox/checkbox-runtime.vue +0 -198
- package/components/runtime/views/assemblys/form/colors/colors-design.vue +0 -16
- package/components/runtime/views/assemblys/form/common/analytic-rule.vue +0 -148
- package/components/runtime/views/assemblys/form/common/attr-event.vue +0 -82
- package/components/runtime/views/assemblys/form/common/attr-header.vue +0 -54
- package/components/runtime/views/assemblys/form/common/attr-style.vue +0 -44
- package/components/runtime/views/assemblys/form/common/bar-code-rule.vue +0 -104
- package/components/runtime/views/assemblys/form/common/condition.vue +0 -147
- package/components/runtime/views/assemblys/form/common/data-origin.vue +0 -81
- package/components/runtime/views/assemblys/form/common/data-orign-in-parameter.vue +0 -64
- package/components/runtime/views/assemblys/form/common/dataorigin-input-table.vue +0 -106
- package/components/runtime/views/assemblys/form/common/default-value-setting.vue +0 -362
- package/components/runtime/views/assemblys/form/common/dimension-input.vue +0 -68
- package/components/runtime/views/assemblys/form/common/dynamic-data-source-setting.vue +0 -115
- package/components/runtime/views/assemblys/form/common/formatting-label.vue +0 -81
- package/components/runtime/views/assemblys/form/common/grid-num-select.vue +0 -43
- package/components/runtime/views/assemblys/form/common/icon-set-dialog.vue +0 -144
- package/components/runtime/views/assemblys/form/common/linkage.vue +0 -21
- package/components/runtime/views/assemblys/form/common/overall-height.vue +0 -20
- package/components/runtime/views/assemblys/form/common/overall-width.vue +0 -48
- package/components/runtime/views/assemblys/form/common/pre-suffix.vue +0 -33
- package/components/runtime/views/assemblys/form/common/rich-text.vue +0 -100
- package/components/runtime/views/assemblys/form/common/row-ul-li.vue +0 -55
- package/components/runtime/views/assemblys/form/common/setoption-table.vue +0 -86
- package/components/runtime/views/assemblys/form/common/size-input.vue +0 -65
- package/components/runtime/views/assemblys/form/common/suffixmodule.vue +0 -82
- package/components/runtime/views/assemblys/form/common/title.vue +0 -20
- package/components/runtime/views/assemblys/form/common/uploading.vue +0 -34
- package/components/runtime/views/assemblys/form/common/verification.vue +0 -79
- package/components/runtime/views/assemblys/form/common/voluntarily.vue +0 -27
- package/components/runtime/views/assemblys/form/custom/custom-attr-base.vue +0 -81
- package/components/runtime/views/assemblys/form/custom/custom-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/form/custom/custom-attr-style.vue +0 -14
- package/components/runtime/views/assemblys/form/custom/custom-attr.vue +0 -28
- package/components/runtime/views/assemblys/form/custom/custom-design.vue +0 -57
- package/components/runtime/views/assemblys/form/date-picker/datepicker-runtime.vue +0 -80
- package/components/runtime/views/assemblys/form/datetime/datetime-design.vue +0 -19
- package/components/runtime/views/assemblys/form/dept-tree/depttree-runtime.vue +0 -60
- package/components/runtime/views/assemblys/form/divider/divider-runtime.vue +0 -44
- package/components/runtime/views/assemblys/form/file-picture/picture-design.vue +0 -80
- package/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue +0 -79
- package/components/runtime/views/assemblys/form/image-thumbnail/imagethumbnail-attr-base.vue +0 -142
- package/components/runtime/views/assemblys/form/image-thumbnail/imagethumbnail-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/form/image-thumbnail/imagethumbnail-attr-style.vue +0 -14
- package/components/runtime/views/assemblys/form/image-thumbnail/imagethumbnail-attr.vue +0 -28
- package/components/runtime/views/assemblys/form/image-thumbnail/imagethumbnail-design.vue +0 -104
- package/components/runtime/views/assemblys/form/image-upload/imageupload-attr-base.vue +0 -75
- package/components/runtime/views/assemblys/form/image-upload/imageupload-attr-event.vue +0 -13
- package/components/runtime/views/assemblys/form/image-upload/imageupload-attr-style.vue +0 -14
- package/components/runtime/views/assemblys/form/image-upload/imageupload-attr.vue +0 -28
- package/components/runtime/views/assemblys/form/image-upload/imageupload-design.vue +0 -76
- package/components/runtime/views/assemblys/form/input-number/input-number-runtime.vue +0 -62
- package/components/runtime/views/assemblys/form/input-show/input-show-attr-base.vue +0 -68
- package/components/runtime/views/assemblys/form/input-show/input-show-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/form/input-show/input-show-attr-style.vue +0 -70
- package/components/runtime/views/assemblys/form/input-show/input-show-attr.vue +0 -28
- package/components/runtime/views/assemblys/form/input-show/input-show-design.vue +0 -155
- package/components/runtime/views/assemblys/form/input-text/inputtext-runtime.vue +0 -142
- package/components/runtime/views/assemblys/form/label/label-runtime.vue +0 -143
- package/components/runtime/views/assemblys/form/link/link-runtime.vue +0 -70
- package/components/runtime/views/assemblys/form/placeholder/placeholder-runtime.vue +0 -24
- package/components/runtime/views/assemblys/form/radio/radio-runtime.vue +0 -203
- package/components/runtime/views/assemblys/form/rate/rate-design.vue +0 -16
- package/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue +0 -169
- package/components/runtime/views/assemblys/form/select/select-runtime.vue +0 -247
- package/components/runtime/views/assemblys/form/slider/slider-design.vue +0 -16
- package/components/runtime/views/assemblys/form/switch/switch-runtime.vue +0 -63
- package/components/runtime/views/assemblys/form/tag/tag-runtime.vue +0 -65
- package/components/runtime/views/assemblys/form/text/text-design.vue +0 -19
- package/components/runtime/views/assemblys/form/textarea/textarea-runtime.vue +0 -63
- package/components/runtime/views/assemblys/form/transfer/transfer-design.vue +0 -32
- package/components/runtime/views/assemblys/object-render.vue +0 -176
- package/components/runtime/views/assemblys/page/page-attr-base-20240429-1.vue +0 -179
- package/components/runtime/views/assemblys/page/page-attr-base.vue +0 -259
- package/components/runtime/views/assemblys/page/page-attr-events.vue +0 -50
- package/components/runtime/views/assemblys/page/page-attr-style.vue +0 -25
- package/components/runtime/views/assemblys/page/page-attr.vue +0 -84
- package/components/runtime/views/assemblys/page/variable-dialog.vue +0 -242
- package/components/runtime/views/assemblys/workflow/component/combination.vue +0 -206
- package/components/runtime/views/assemblys/workflow/component/condition-dialog.vue +0 -99
- package/components/runtime/views/assemblys/workflow/component/event-dialog.vue +0 -278
- package/components/runtime/views/assemblys/workflow/component/journal-set-dialog.vue +0 -174
- package/components/runtime/views/assemblys/workflow/component/logical-setup-dialog.vue +0 -155
- package/components/runtime/views/assemblys/workflow/component/rule-dialog.vue +0 -47
- package/components/runtime/views/assemblys/workflow/component/set-dialog.vue +0 -130
- package/components/runtime/views/assemblys/workflow/component/task-trigger-dialog.vue +0 -96
- package/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-attr-base.vue +0 -43
- package/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-attr-style.vue +0 -27
- package/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-attr.vue +0 -28
- package/components/runtime/views/assemblys/workflow/picture-flow/pictureflow-design.vue +0 -17
- package/components/runtime/views/assemblys/workflow/text-history/texthistory-attr-base.vue +0 -60
- package/components/runtime/views/assemblys/workflow/text-history/texthistory-attr-event.vue +0 -14
- package/components/runtime/views/assemblys/workflow/text-history/texthistory-attr-style.vue +0 -27
- package/components/runtime/views/assemblys/workflow/text-history/texthistory-attr.vue +0 -28
- package/components/runtime/views/assemblys/workflow/text-history/texthistory-design.vue +0 -17
- package/components/runtime/views/assemblys/workflow/workflow-button/workflowbutton-runtime.vue +0 -64
- package/components/runtime/views/render/page-view.vue +0 -80
- package/components/runtime/views/super-page copy.vue +0 -61
- package/components/runtime/views/super-page.vue +0 -667
- package/components/super-page-dialog/index.ts +0 -2
- package/components/super-page-dialog/super-page-dialog.vue +0 -267
- package/components/wf-editor/index.ts +0 -2
- package/components/wf-editor/wf-editor.vue +0 -15
- package/cypress/e2e/example.cy.ts +0 -8
- package/cypress/e2e/tsconfig.json +0 -10
- package/cypress/fixtures/example.json +0 -5
- package/cypress/support/commands.ts +0 -39
- package/cypress/support/e2e.ts +0 -20
- package/cypress.config.ts +0 -8
- package/env.d.ts +0 -1
- package/index.html +0 -13
- package/main.ts +0 -11
- package/package-ws.json +0 -70
- package/public/favicon.ico +0 -0
- package/tsconfig copy.json +0 -17
- package/tsconfig.app copy.json +0 -14
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -17
- package/tsconfig.node copy.json +0 -19
- package/tsconfig.node.json +0 -19
- package/tsconfig.vitest copy.json +0 -11
- package/tsconfig.vitest.json +0 -11
- package/vite.config copy.ts +0 -109
- package/vite.config.ts +0 -86
- package/vitest.config.ts +0 -14
|
@@ -1,858 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!--//TODO:暂不支持弹框方式查询 @setSearchType="closeSearch" -->
|
|
4
|
-
<super-grid
|
|
5
|
-
ref="gridRef"
|
|
6
|
-
:url="urlToListData"
|
|
7
|
-
:options="listOptions"
|
|
8
|
-
:code="superGridSetting ? null : listCode"
|
|
9
|
-
:settings="superGridSetting"
|
|
10
|
-
:search-form-info="searchFormInfo"
|
|
11
|
-
:list-toolbar-form-data="listToolbarFormData"
|
|
12
|
-
@select="select"
|
|
13
|
-
@select-all="selectAll"
|
|
14
|
-
@selection-change="selectionChange"
|
|
15
|
-
@cell-click="cellClickEvent"
|
|
16
|
-
@cell-dblclick="cellDblClickEvent"
|
|
17
|
-
@row-click="rowClickEvent"
|
|
18
|
-
@row-dblclick="rowDblClickEvent"
|
|
19
|
-
@header-click="headerClickEvent"
|
|
20
|
-
@refresh="clearSelections"
|
|
21
|
-
@new-open-grid-dialog="popupToPage"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import { SuperIcon } from 'agilebuilder-ui'
|
|
27
|
-
import { computed, onMounted, watch, ref, onUnmounted } from 'vue'
|
|
28
|
-
import type {
|
|
29
|
-
Component,
|
|
30
|
-
PageContext
|
|
31
|
-
} from '../../../../../../src/utils/interfaces/page-design-types'
|
|
32
|
-
import {
|
|
33
|
-
doAfterClickEvent,
|
|
34
|
-
canExecuteButton,
|
|
35
|
-
doBeforeClickEvent,
|
|
36
|
-
getEventFuncByType,
|
|
37
|
-
getHandleEvent,
|
|
38
|
-
gridSelectRecord,
|
|
39
|
-
setTableEvents,
|
|
40
|
-
gridSelectAllRecords,
|
|
41
|
-
gridSelectionChange,
|
|
42
|
-
cellClick,
|
|
43
|
-
cellDblClick,
|
|
44
|
-
rowClick,
|
|
45
|
-
rowDblClick,
|
|
46
|
-
headerClick
|
|
47
|
-
} from '../../../../../../src/utils/events/event-util'
|
|
48
|
-
import { getRealRestApiPath, getListCode } from '../../../../../../src/utils/common-util'
|
|
49
|
-
import {
|
|
50
|
-
getSaveFormRequest,
|
|
51
|
-
standardEvents
|
|
52
|
-
} from '../../../../../../src/utils/events/standard-event'
|
|
53
|
-
import { isPromise } from 'agilebuilder-ui/src/utils/common-util'
|
|
54
|
-
import { getDataTypeMap, popupToPage } from '../../../../../../src/utils/table-utils'
|
|
55
|
-
// import eventBus from '../../../../../../src/utils/eventBus'
|
|
56
|
-
interface MyProps {
|
|
57
|
-
pageContext: PageContext
|
|
58
|
-
configure: Component
|
|
59
|
-
}
|
|
60
|
-
const props = defineProps<MyProps>()
|
|
61
|
-
const pageContext = props.pageContext
|
|
62
|
-
const configure = props.configure
|
|
63
|
-
|
|
64
|
-
//获取默认的样式及配置
|
|
65
|
-
const runtimeInfo = props.configure.runtime ? props.configure.runtime : {}
|
|
66
|
-
|
|
67
|
-
const runtimeStyle = runtimeInfo.style
|
|
68
|
-
const runtimeClass = runtimeInfo.class
|
|
69
|
-
|
|
70
|
-
const system = pageContext.entity.system
|
|
71
|
-
// TODO: table的数据表名是这样获得吗??
|
|
72
|
-
const tableName = pageContext.tableName
|
|
73
|
-
const baseURL = window['$vueApp'].config.globalProperties.baseURL
|
|
74
|
-
const operationButtonObj = ref(null)
|
|
75
|
-
const eventName = ref(null)
|
|
76
|
-
const listOptions = ref({})
|
|
77
|
-
listOptions.value = getOptions()
|
|
78
|
-
|
|
79
|
-
// 获得列表的Ref对象
|
|
80
|
-
const gridRef = ref(null)
|
|
81
|
-
|
|
82
|
-
const urlToListData = getUrlToListData(system)
|
|
83
|
-
const listCode = getListCode(pageContext.code, pageContext.version, configure.uuid)
|
|
84
|
-
|
|
85
|
-
const myPageCode = pageContext.code
|
|
86
|
-
// TODO: 列表“-close-component-page-dialog”事件处理,事件名多了“_listCode"信息
|
|
87
|
-
const eventPageInfo = myPageCode + '_' + listCode
|
|
88
|
-
const selections = ref([])
|
|
89
|
-
const listToolbarFormData = pageContext.entity.page
|
|
90
|
-
const searchFormInfo = ref({ data: [] })
|
|
91
|
-
const superGridItems = pageContext.superGridItems
|
|
92
|
-
const superGridSetting = superGridItems ? superGridItems[configure.uuid] : null
|
|
93
|
-
console.log('superGridSetting1111===', superGridItems, superGridSetting)
|
|
94
|
-
|
|
95
|
-
onMounted(() => {
|
|
96
|
-
window.addEventListener('message', recieveMessage)
|
|
97
|
-
// TODO: 列表“-close-component-page-dialog”事件处理,事件名多了“_listCode"信息 myPageCode + '_' + myPageVersion + '_' + listCode
|
|
98
|
-
window['$eventBus'].$on(
|
|
99
|
-
eventPageInfo + '-close-component-page-dialog',
|
|
100
|
-
function ({ jumpInfo, popEntity, popPageCode }) {
|
|
101
|
-
gridRef.value.closePageDialog({
|
|
102
|
-
entity: popEntity,
|
|
103
|
-
pageCode: popPageCode,
|
|
104
|
-
jumpInfo: jumpInfo
|
|
105
|
-
})
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
// TODO: 刷新指定页签的表格数据(原list-page页面中的事件)
|
|
109
|
-
// window['$eventBus'].$on(that.pageCode + '-refresh-tab', function({ tabCode, entity }) {
|
|
110
|
-
// if (
|
|
111
|
-
// that.$refs.grid &&
|
|
112
|
-
// tabCode !== undefined &&
|
|
113
|
-
// tabCode === that.tabCode
|
|
114
|
-
// ) {
|
|
115
|
-
// that.$refs.grid.refresh()
|
|
116
|
-
// }
|
|
117
|
-
// })
|
|
118
|
-
// 关闭弹框事件回调使用
|
|
119
|
-
// TODO: 列表“_close-dialog-get-entity”事件处理,事件名多了“_listCode"信息 myPageCode + '_' + myPageVersion + '_' + listCode
|
|
120
|
-
window['$eventBus'].$on(eventPageInfo + '_close-dialog-get-entity', () => {
|
|
121
|
-
window['$eventBus'].$emit(eventPageInfo + '_close-super-dialog')
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
// 监听查询条件更新
|
|
125
|
-
watch(
|
|
126
|
-
() => props.pageContext.searchFormData,
|
|
127
|
-
(searchFormData) => {
|
|
128
|
-
searchFormInfo.value.data = searchFormData
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
// 监听工具栏快捷查询组件
|
|
132
|
-
watch(
|
|
133
|
-
() => props.pageContext.entity.data,
|
|
134
|
-
(searchFormData) => {
|
|
135
|
-
searchGridData(props.pageContext.entity.data)
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
// 监听工具栏快捷查询组件
|
|
139
|
-
watch(
|
|
140
|
-
() => props.pageContext.entity.page,
|
|
141
|
-
(searchFormData) => {
|
|
142
|
-
searchGridData(props.pageContext.entity.page)
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
onUnmounted(() => {
|
|
147
|
-
window['$eventBus'].$off(eventPageInfo + '-close-component-page-dialog')
|
|
148
|
-
window['$eventBus'].$off(eventPageInfo + '_close-dialog-get-entity')
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
function getUrlToListData(system) {
|
|
152
|
-
let urlToListData
|
|
153
|
-
if (!pageContext.isTest) {
|
|
154
|
-
urlToListData = baseURL + '/dsc/commons/list'
|
|
155
|
-
if (urlToListData) {
|
|
156
|
-
urlToListData = getRealRestApiPath(urlToListData, system)
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return urlToListData
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function getOptions() {
|
|
163
|
-
const system = pageContext.entity.system
|
|
164
|
-
const permissionPrefix = system.code + '.' + pageContext.code
|
|
165
|
-
let initSearchForm =
|
|
166
|
-
configure.props && configure.props.dataOrigin
|
|
167
|
-
? configure.props.dataOrigin.sqlFilterCondition
|
|
168
|
-
: null
|
|
169
|
-
if (typeof initSearchForm === 'undefined' || initSearchForm === null) {
|
|
170
|
-
initSearchForm = []
|
|
171
|
-
}
|
|
172
|
-
const options = {
|
|
173
|
-
isSql: true,
|
|
174
|
-
extraParam: {
|
|
175
|
-
beanName: pageContext.beanName,
|
|
176
|
-
functionCode: permissionPrefix + '.list',
|
|
177
|
-
tableName: tableName,
|
|
178
|
-
systemCode: system.code // 系统编码传给列表数据后台请求
|
|
179
|
-
},
|
|
180
|
-
initSearchForm,
|
|
181
|
-
lineEditOptions: {
|
|
182
|
-
aftersaveIsCreateRow: false,
|
|
183
|
-
autoSave: false,
|
|
184
|
-
enter: enterSave,
|
|
185
|
-
esc: escRestorRow
|
|
186
|
-
},
|
|
187
|
-
indexContinuous:
|
|
188
|
-
configure.props && configure.props.otherSettings
|
|
189
|
-
? configure.props.otherSettings.serialNumberContinuous
|
|
190
|
-
: false,
|
|
191
|
-
initSearch:
|
|
192
|
-
configure.props && configure.props.base.initializationQuery
|
|
193
|
-
? configure.props.base.initializationQuery
|
|
194
|
-
: true, // 初始化时是否查询,默认是查询
|
|
195
|
-
resizeHeight: resizeListHeight,
|
|
196
|
-
pageCode: pageContext.code,
|
|
197
|
-
pageVersion: pageContext.version,
|
|
198
|
-
// pageHeight: pageHeight, // 页面的高度 //TODO: pageHeight如何获得,页面高度,计算列表高度应该会用
|
|
199
|
-
additionalParamMap: pageContext.entity.request, // 将路由参数传给列表组件
|
|
200
|
-
showOverflowTooltip: !!(
|
|
201
|
-
configure.props &&
|
|
202
|
-
configure.props.otherSettings &&
|
|
203
|
-
(configure.props.otherSettings.isBreakLine === undefined ||
|
|
204
|
-
configure.props.otherSettings.isBreakLine === false)
|
|
205
|
-
), // 单元格内容是否换行显示
|
|
206
|
-
isEnableEnterEvent:
|
|
207
|
-
configure.props &&
|
|
208
|
-
configure.props.otherSettings &&
|
|
209
|
-
configure.props.otherSettings.isEnableEnterEvent, // 是否启用回车事件
|
|
210
|
-
// 当前系统,表示是当前的自定义系统信息
|
|
211
|
-
system,
|
|
212
|
-
isWithDataPermission:
|
|
213
|
-
configure.props &&
|
|
214
|
-
configure.props.otherSettings &&
|
|
215
|
-
configure.props.otherSettings.isWithDataPermission
|
|
216
|
-
? configure.props.otherSettings.isWithDataPermission
|
|
217
|
-
: false,
|
|
218
|
-
pageDevMode: false,
|
|
219
|
-
isWorkflowEntity: pageContext.workflowCode ? true : false,
|
|
220
|
-
tableClass: runtimeClass,
|
|
221
|
-
tableStyle: runtimeStyle,
|
|
222
|
-
pageContext,
|
|
223
|
-
configureObj: configure
|
|
224
|
-
}
|
|
225
|
-
// 设置排序字段信息
|
|
226
|
-
setSortInfo(options)
|
|
227
|
-
// 获得字段集合
|
|
228
|
-
myGetDataTypeMap(options)
|
|
229
|
-
// 设置树形配置
|
|
230
|
-
setTreeSetting(options)
|
|
231
|
-
// 设置表格事件
|
|
232
|
-
setGridEvents(options)
|
|
233
|
-
// TODO: 是否需要区分预览
|
|
234
|
-
// const isPreview = getStoreInfo(this.pageCode, '_pagePreview')
|
|
235
|
-
// if (isPreview !== undefined && isPreview === true) {
|
|
236
|
-
// // 预览时,不请求数据,只查看列表结构
|
|
237
|
-
// options.loadBeforeSend = function () {
|
|
238
|
-
// return false
|
|
239
|
-
// }
|
|
240
|
-
return options
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// 设置排序字段信息
|
|
244
|
-
function setSortInfo(options) {
|
|
245
|
-
if (configure.props && configure.props.dataOrigin && configure.props.dataOrigin.sortFields) {
|
|
246
|
-
options.initSortInfo = []
|
|
247
|
-
this.colSetting.options.sortFields.forEach((item) => {
|
|
248
|
-
const sortInfo = {
|
|
249
|
-
order: item.sortOrder
|
|
250
|
-
}
|
|
251
|
-
sortInfo['prop'] = item.propDbName
|
|
252
|
-
options.initSortInfo.push(sortInfo)
|
|
253
|
-
})
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// 获得字段集合
|
|
258
|
-
function myGetDataTypeMap(options) {
|
|
259
|
-
if (!system || !tableName) {
|
|
260
|
-
return
|
|
261
|
-
}
|
|
262
|
-
getDataTypeMap(system, tableName).then((result) => {
|
|
263
|
-
pageContext['dataTypeMaps'][tableName] = result['dataTypeMap']
|
|
264
|
-
// 设置列表操作列按钮
|
|
265
|
-
setOperationButtons(options)
|
|
266
|
-
})
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// 设置列表组件需要的操作列按钮配置信息
|
|
270
|
-
function setOperationButtons(options) {
|
|
271
|
-
const showOperation =
|
|
272
|
-
configure.props && configure.props.base ? configure.props.base.showOperation : false
|
|
273
|
-
const operationButtons = configure.btnList
|
|
274
|
-
if (showOperation && operationButtons) {
|
|
275
|
-
// 是否受权限控制
|
|
276
|
-
let noPermission = false
|
|
277
|
-
const operationButtons = []
|
|
278
|
-
operationButtons.forEach((buttonConfigure) => {
|
|
279
|
-
const myButtonSet = {}
|
|
280
|
-
const myButtonProps = Object.assign({}, buttonConfigure.props.base)
|
|
281
|
-
// element plus不支持该属性了
|
|
282
|
-
// myButtonProps.type = 'text'
|
|
283
|
-
myButtonProps.elementType = 'el-button'
|
|
284
|
-
if (
|
|
285
|
-
!noPermission &&
|
|
286
|
-
(buttonConfigure.isPermission === undefined || buttonConfigure.isPermission + '' === 'true')
|
|
287
|
-
) {
|
|
288
|
-
// 表示受权限控制
|
|
289
|
-
if (buttonConfigure.functionCode) {
|
|
290
|
-
myButtonProps.permission = buttonConfigure.functionCode
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
myButtonSet['props'] = myButtonProps
|
|
295
|
-
myButtonSet['onClick'] = getOperationButtonClickEvent(buttonConfigure)
|
|
296
|
-
operationButtons.push(myButtonSet)
|
|
297
|
-
})
|
|
298
|
-
if (!options.operations) {
|
|
299
|
-
options.operations = {}
|
|
300
|
-
}
|
|
301
|
-
options.operations.operation = operationButtons
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// 设置树形配置
|
|
306
|
-
function setTreeSetting(options) {
|
|
307
|
-
const dataOrigin = configure.props ? configure.props.dataOrigin : {}
|
|
308
|
-
if (dataOrigin.treeTable) {
|
|
309
|
-
let parentPropDbName
|
|
310
|
-
// 格式为:name~~dbCloumnName,name表示实体字段名,dbCloumnName表示数据库字段名
|
|
311
|
-
const parentPropInfo = dataOrigin.rowKey
|
|
312
|
-
if (parentPropInfo && parentPropInfo.indexOf('~~') > 0) {
|
|
313
|
-
parentPropDbName = parentPropInfo.substring(parentPropInfo.indexOf('~~') + 2)
|
|
314
|
-
} else {
|
|
315
|
-
parentPropDbName = parentPropInfo
|
|
316
|
-
}
|
|
317
|
-
// 数据库字段名
|
|
318
|
-
options.parentProp = parentPropDbName
|
|
319
|
-
if (options.parentProp) {
|
|
320
|
-
// 表示配置了父级字段名,则表示是树状结构数据
|
|
321
|
-
const isLazy = dataOrigin.lazy
|
|
322
|
-
const defaultExpandAll = dataOrigin.defaultExpandAll
|
|
323
|
-
if (isLazy === undefined || isLazy === null) {
|
|
324
|
-
options.lazy = true
|
|
325
|
-
} else {
|
|
326
|
-
options.lazy = isLazy
|
|
327
|
-
}
|
|
328
|
-
if (defaultExpandAll === undefined || defaultExpandAll === null) {
|
|
329
|
-
options.defaultExpandAll = false
|
|
330
|
-
} else {
|
|
331
|
-
options.defaultExpandAll = defaultExpandAll
|
|
332
|
-
}
|
|
333
|
-
const listViewTreeTableSetting = {
|
|
334
|
-
parentProp: parentPropDbName,
|
|
335
|
-
lazy: options.lazy,
|
|
336
|
-
defaultExpandAll: options.defaultExpandAll
|
|
337
|
-
}
|
|
338
|
-
// 树表格配置传给后台
|
|
339
|
-
options.extraParam.listViewTreeSetting = JSON.stringify(listViewTreeTableSetting)
|
|
340
|
-
options.subRowUrl = baseURL + '/dsc/commons/list-subs'
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// 设置表格事件
|
|
346
|
-
function setGridEvents(options) {
|
|
347
|
-
const tableEvents = configure.events
|
|
348
|
-
setTableEvents(options, tableEvents, pageContext, configure)
|
|
349
|
-
const customEvents = pageContext.customEvents
|
|
350
|
-
if (customEvents) {
|
|
351
|
-
// 将页面中配置的自定义事件集合传给列表组件super-grid,供列表行编辑控件使用
|
|
352
|
-
options.eventCallBack = customEvents
|
|
353
|
-
const rowStyleEvent = getEventFuncByType(pageContext, tableEvents, 'rowStyle')
|
|
354
|
-
if (rowStyleEvent) {
|
|
355
|
-
options.rowStyleRender = rowStyleEvent
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// 回车保存事件
|
|
361
|
-
function enterSave(rowIndex, column, row, orgRow) {
|
|
362
|
-
saveRow(null, null, row, column, rowIndex)
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// 行编辑保存
|
|
366
|
-
function saveRow(originalValue, formatValue, row, column, rowIndex) {
|
|
367
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
368
|
-
listOptions.value['lineEditOptions']['beforeSave'] = beforeSaveRow
|
|
369
|
-
pageContext.editData = row
|
|
370
|
-
canExecuteButton({ pageContext, configureObj: buttonConfigure })
|
|
371
|
-
.then((result) => {
|
|
372
|
-
if (result['canExecute'] === true) {
|
|
373
|
-
// 设置保存的自定义实现
|
|
374
|
-
listOptions.value['lineEditOptions']['saveRow'] = saveLineEditRow
|
|
375
|
-
gridRef.value.saveRow(rowIndex, listCode).then(() => {
|
|
376
|
-
const otherParams = {
|
|
377
|
-
originalValue,
|
|
378
|
-
formatValue,
|
|
379
|
-
row,
|
|
380
|
-
column,
|
|
381
|
-
rowIndex
|
|
382
|
-
}
|
|
383
|
-
// 调用afterClick回调方法
|
|
384
|
-
doAfterClickEvent(pageContext, buttonConfigure, otherParams)
|
|
385
|
-
})
|
|
386
|
-
}
|
|
387
|
-
})
|
|
388
|
-
.finally(() => {
|
|
389
|
-
pageContext.editData = null
|
|
390
|
-
})
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
// 获得操作列按钮点击事件
|
|
394
|
-
function getOperationButtonClickEvent(buttonConfigure) {
|
|
395
|
-
let onClick
|
|
396
|
-
eventName.value = buttonConfigure.eventName
|
|
397
|
-
operationButtonObj.value[eventName.value] = buttonConfigure
|
|
398
|
-
if (eventName.value === 'lineEditSave') {
|
|
399
|
-
// 行编辑保存
|
|
400
|
-
onClick = saveRow
|
|
401
|
-
} else if (eventName.value === 'restoreEdit') {
|
|
402
|
-
onClick = restoreRow
|
|
403
|
-
} else if (eventName.value === 'lineEditUpdate') {
|
|
404
|
-
// 行编辑修改按钮
|
|
405
|
-
onClick = editRow
|
|
406
|
-
} else if (eventName.value === 'lineEditDelete') {
|
|
407
|
-
// 行编辑删除按钮
|
|
408
|
-
onClick = deleteRow
|
|
409
|
-
} else {
|
|
410
|
-
onClick = customButtonClick
|
|
411
|
-
// TODO 自定义行编辑按钮事件处理
|
|
412
|
-
}
|
|
413
|
-
if (!onClick) {
|
|
414
|
-
onClick = function () {}
|
|
415
|
-
}
|
|
416
|
-
return onClick
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function beforeSaveRow(
|
|
420
|
-
row,
|
|
421
|
-
columns,
|
|
422
|
-
dataTypeMap,
|
|
423
|
-
dynamicColumnInfo,
|
|
424
|
-
additionalParamMap,
|
|
425
|
-
mainDefaultValueColumns
|
|
426
|
-
) {
|
|
427
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
428
|
-
const otherParams = {
|
|
429
|
-
dynamicColumnInfo,
|
|
430
|
-
mainDefaultValueColumns,
|
|
431
|
-
dataTypeMap,
|
|
432
|
-
row,
|
|
433
|
-
columns
|
|
434
|
-
}
|
|
435
|
-
return doBeforeClickEvent(pageContext, buttonConfigure, otherParams)
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// 重写行编辑时保存的实现
|
|
439
|
-
function saveLineEditRow(
|
|
440
|
-
row,
|
|
441
|
-
columns,
|
|
442
|
-
dataTypeMap,
|
|
443
|
-
dynamicColumnInfo,
|
|
444
|
-
additionalParamMap,
|
|
445
|
-
mainDefaultValueColumns
|
|
446
|
-
) {
|
|
447
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
448
|
-
return new Promise((resolve, reject) => {
|
|
449
|
-
getSaveFormRequest(
|
|
450
|
-
pageContext,
|
|
451
|
-
buttonConfigure,
|
|
452
|
-
'/dsc/commons',
|
|
453
|
-
false,
|
|
454
|
-
mainDefaultValueColumns,
|
|
455
|
-
dynamicColumnInfo
|
|
456
|
-
)
|
|
457
|
-
.then((commonEntity) => {
|
|
458
|
-
if (commonEntity) {
|
|
459
|
-
resolve(commonEntity.entity)
|
|
460
|
-
} else {
|
|
461
|
-
resolve({})
|
|
462
|
-
}
|
|
463
|
-
})
|
|
464
|
-
.catch((error) => {
|
|
465
|
-
reject(error)
|
|
466
|
-
})
|
|
467
|
-
})
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// esc取消行编辑
|
|
471
|
-
function escRestorRow(rowIndex, column, row, orgRow) {
|
|
472
|
-
restoreRow(null, null, row, column, rowIndex)
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
// 行编辑取消编辑
|
|
476
|
-
function restoreRow(originalValue, formatValue, row, column, rowIndex) {
|
|
477
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
478
|
-
const otherParams = {
|
|
479
|
-
originalValue,
|
|
480
|
-
formatValue,
|
|
481
|
-
row,
|
|
482
|
-
column,
|
|
483
|
-
rowIndex
|
|
484
|
-
}
|
|
485
|
-
const beforeClickResult = doBeforeClickEvent(pageContext, buttonConfigure, otherParams)
|
|
486
|
-
if (!beforeClickResult) {
|
|
487
|
-
// 返回值为false,不继续执行按钮操作
|
|
488
|
-
return
|
|
489
|
-
}
|
|
490
|
-
if (isPromise(beforeClickResult)) {
|
|
491
|
-
// 表示是promise函数
|
|
492
|
-
beforeClickResult.then((result) => {
|
|
493
|
-
if (result) {
|
|
494
|
-
gridRef.value.restoreRow(rowIndex, listCode)
|
|
495
|
-
}
|
|
496
|
-
})
|
|
497
|
-
} else {
|
|
498
|
-
gridRef.value.restoreRow(rowIndex, listCode)
|
|
499
|
-
}
|
|
500
|
-
const afterOtherParams = {
|
|
501
|
-
originalValue,
|
|
502
|
-
formatValue,
|
|
503
|
-
row,
|
|
504
|
-
column,
|
|
505
|
-
rowIndex
|
|
506
|
-
}
|
|
507
|
-
// 调用afterClick回调方法
|
|
508
|
-
doAfterClickEvent(pageContext, configure, afterOtherParams)
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
// 行编辑的修改
|
|
512
|
-
function editRow(originalValue, formatValue, row, column, rowIndex) {
|
|
513
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
514
|
-
const otherParams = {
|
|
515
|
-
originalValue,
|
|
516
|
-
formatValue,
|
|
517
|
-
row,
|
|
518
|
-
column,
|
|
519
|
-
rowIndex
|
|
520
|
-
}
|
|
521
|
-
const beforeClickResult = doBeforeClickEvent(pageContext, buttonConfigure, otherParams)
|
|
522
|
-
if (!beforeClickResult) {
|
|
523
|
-
// 返回值为false,不继续执行按钮操作
|
|
524
|
-
return
|
|
525
|
-
}
|
|
526
|
-
if (isPromise(beforeClickResult)) {
|
|
527
|
-
// 表示是promise函数
|
|
528
|
-
beforeClickResult.then((result) => {
|
|
529
|
-
if (result) {
|
|
530
|
-
editRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure)
|
|
531
|
-
}
|
|
532
|
-
})
|
|
533
|
-
} else {
|
|
534
|
-
editRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure)
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function editRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure) {
|
|
539
|
-
pageContext.editData = row
|
|
540
|
-
canExecuteButton({ pageContext, configureObj: buttonConfigure })
|
|
541
|
-
.then((result) => {
|
|
542
|
-
if (result['canExecute'] === true) {
|
|
543
|
-
// TODO: 行编辑修改按钮跳转页面解析
|
|
544
|
-
// if (buttonConfigure.jumpPage) {
|
|
545
|
-
// let dataId
|
|
546
|
-
// if (row && row.id) {
|
|
547
|
-
// dataId = row.id
|
|
548
|
-
// } else if (row && row.ID) {
|
|
549
|
-
// dataId = row.ID
|
|
550
|
-
// }
|
|
551
|
-
// if (!dataId) {
|
|
552
|
-
// this.$message({
|
|
553
|
-
// showClose: true,
|
|
554
|
-
// type: 'warning',
|
|
555
|
-
// message: this.$t('superPageMessage.pleaseSaveRow')
|
|
556
|
-
// })
|
|
557
|
-
// return
|
|
558
|
-
// }
|
|
559
|
-
// this.update(button.jumpPage, this.system, dataId, button)
|
|
560
|
-
// } else {
|
|
561
|
-
gridRef.value.editRow(rowIndex, listCode)
|
|
562
|
-
// 调用afterClick回调方法
|
|
563
|
-
const afterOtherParams = {
|
|
564
|
-
originalValue,
|
|
565
|
-
formatValue,
|
|
566
|
-
row,
|
|
567
|
-
column,
|
|
568
|
-
rowIndex
|
|
569
|
-
}
|
|
570
|
-
doAfterClickEvent(pageContext, configure, afterOtherParams)
|
|
571
|
-
// }
|
|
572
|
-
}
|
|
573
|
-
})
|
|
574
|
-
.finally(() => {
|
|
575
|
-
pageContext.editData = null
|
|
576
|
-
})
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// 行编辑的删除
|
|
580
|
-
function deleteRow(originalValue, formatValue, row, column, rowIndex) {
|
|
581
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
582
|
-
const otherParams = {
|
|
583
|
-
originalValue,
|
|
584
|
-
formatValue,
|
|
585
|
-
row,
|
|
586
|
-
column,
|
|
587
|
-
rowIndex
|
|
588
|
-
}
|
|
589
|
-
const beforeClickResult = doBeforeClickEvent(pageContext, buttonConfigure, otherParams)
|
|
590
|
-
if (!beforeClickResult) {
|
|
591
|
-
// 返回值为false,不继续执行按钮操作
|
|
592
|
-
return
|
|
593
|
-
}
|
|
594
|
-
if (isPromise(beforeClickResult)) {
|
|
595
|
-
// 表示是promise函数
|
|
596
|
-
beforeClickResult.then((result) => {
|
|
597
|
-
if (result) {
|
|
598
|
-
deleteRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure)
|
|
599
|
-
}
|
|
600
|
-
})
|
|
601
|
-
} else {
|
|
602
|
-
deleteRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure)
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
function deleteRowReal(originalValue, formatValue, row, column, rowIndex, buttonConfigure) {
|
|
607
|
-
if (row.id || row.ID) {
|
|
608
|
-
pageContext.editData = row
|
|
609
|
-
canExecuteButton({ pageContext, configureObj: buttonConfigure })
|
|
610
|
-
.then((result) => {
|
|
611
|
-
if (result['canExecute'] === true) {
|
|
612
|
-
const ids = []
|
|
613
|
-
if (row.id) {
|
|
614
|
-
ids.push(row.id)
|
|
615
|
-
} else {
|
|
616
|
-
ids.push(row.ID)
|
|
617
|
-
}
|
|
618
|
-
standardEvents.delete({
|
|
619
|
-
pageContext,
|
|
620
|
-
configureObj: buttonConfigure,
|
|
621
|
-
ids,
|
|
622
|
-
tableUuid: listCode
|
|
623
|
-
})
|
|
624
|
-
// }
|
|
625
|
-
}
|
|
626
|
-
})
|
|
627
|
-
.finally(() => {
|
|
628
|
-
pageContext.editData = null
|
|
629
|
-
})
|
|
630
|
-
} else {
|
|
631
|
-
restoreRow(originalValue, formatValue, row, column, rowIndex)
|
|
632
|
-
const afterOtherParams = {
|
|
633
|
-
originalValue,
|
|
634
|
-
formatValue,
|
|
635
|
-
row,
|
|
636
|
-
column,
|
|
637
|
-
rowIndex
|
|
638
|
-
}
|
|
639
|
-
// 调用afterClick回调方法
|
|
640
|
-
doAfterClickEvent(pageContext, configure, afterOtherParams)
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
//TODO: 接受工具栏参数,刷新列表,需要测试是否这样实现??
|
|
645
|
-
function searchGridData(data) {
|
|
646
|
-
if (!pageContext['dataTypeMaps'] || !pageContext['dataTypeMaps'][tableName]) {
|
|
647
|
-
return
|
|
648
|
-
}
|
|
649
|
-
const dataTypeObj = pageContext['dataTypeMaps'][tableName]
|
|
650
|
-
let toolbarFieldParam = []
|
|
651
|
-
if (data) {
|
|
652
|
-
for (var key in data) {
|
|
653
|
-
const value = data[key]
|
|
654
|
-
if (value !== null && value !== undefined && value !== '') {
|
|
655
|
-
// 需要解析data为FieldParam,
|
|
656
|
-
// 如果是多选,需要用or拼接,其他不为空不为“”的值,用and连接
|
|
657
|
-
if (value instanceof Array) {
|
|
658
|
-
// 需要解析为两个
|
|
659
|
-
if (value.length > 0) {
|
|
660
|
-
const multipleFieldParam = []
|
|
661
|
-
for (var i = 0; i < value.length; i++) {
|
|
662
|
-
const fieldParam = {}
|
|
663
|
-
if (i === 0) {
|
|
664
|
-
fieldParam['leftBracket'] = '(('
|
|
665
|
-
} else {
|
|
666
|
-
fieldParam['leftBracket'] = '('
|
|
667
|
-
}
|
|
668
|
-
fieldParam['propName'] = key
|
|
669
|
-
fieldParam['propDbName'] = key
|
|
670
|
-
fieldParam['dataType'] = dataTypeObj[key] ? dataTypeObj[key] : 'TEXT'
|
|
671
|
-
fieldParam['operator'] = 'EQ'
|
|
672
|
-
fieldParam['propValue'] = value[i]
|
|
673
|
-
if (i === value.length - 1) {
|
|
674
|
-
fieldParam['rightBracket'] = '))'
|
|
675
|
-
fieldParam['joinSign'] = 'and'
|
|
676
|
-
} else {
|
|
677
|
-
fieldParam['rightBracket'] = ')'
|
|
678
|
-
fieldParam['joinSign'] = 'or'
|
|
679
|
-
}
|
|
680
|
-
multipleFieldParam.push(fieldParam)
|
|
681
|
-
}
|
|
682
|
-
toolbarFieldParam = toolbarFieldParam.concat(multipleFieldParam)
|
|
683
|
-
}
|
|
684
|
-
} else {
|
|
685
|
-
// 解析为单个-判断是普通值还是时间选择
|
|
686
|
-
const fieldParam = {}
|
|
687
|
-
fieldParam['leftBracket'] = '('
|
|
688
|
-
fieldParam['propName'] = key
|
|
689
|
-
fieldParam['propDbName'] = key
|
|
690
|
-
fieldParam['dataType'] = dataTypeObj[key] ? dataTypeObj[key] : 'TEXT'
|
|
691
|
-
fieldParam['operator'] = 'EQ'
|
|
692
|
-
fieldParam['propValue'] = value
|
|
693
|
-
fieldParam['rightBracket'] = ')'
|
|
694
|
-
fieldParam['joinSign'] = 'and'
|
|
695
|
-
toolbarFieldParam.push(fieldParam)
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
gridRef.value.toolbarRefresh(null, null, toolbarFieldParam)
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
function resizeListHeight(params) {
|
|
704
|
-
// TODO: 重新计算列表高度
|
|
705
|
-
// const pageHeight = getStoreInfo(this.pageCode, '_pageHeight')
|
|
706
|
-
// if (pageHeight === undefined || pageHeight === null || pageHeight === '') {
|
|
707
|
-
// return params.height - 20
|
|
708
|
-
// }
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
function customButtonClick(originalValue, formatValue, row, column, rowIndex, button) {
|
|
712
|
-
const otherParams = {
|
|
713
|
-
originalValue,
|
|
714
|
-
formatValue,
|
|
715
|
-
row,
|
|
716
|
-
column,
|
|
717
|
-
rowIndex,
|
|
718
|
-
button
|
|
719
|
-
}
|
|
720
|
-
const buttonConfigure = operationButtonObj.value[eventName.value]
|
|
721
|
-
getHandleEvent(null, pageContext, buttonConfigure, 'click', otherParams)
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
// 关闭浏览器页签时刷新列表
|
|
725
|
-
function recieveMessage(event) {
|
|
726
|
-
if (event.data === 'close_open_win') {
|
|
727
|
-
gridRef.value.refresh()
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
// 选择记录时
|
|
732
|
-
function select(selection, row) {
|
|
733
|
-
selections.value = selection
|
|
734
|
-
const params = {
|
|
735
|
-
selection,
|
|
736
|
-
row
|
|
737
|
-
}
|
|
738
|
-
gridSelectRecord(pageContext, configure, params)
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
function selectAll(selection) {
|
|
742
|
-
selections.value = selection
|
|
743
|
-
const params = {
|
|
744
|
-
selection
|
|
745
|
-
}
|
|
746
|
-
gridSelectAllRecords(pageContext, configure, params)
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
function selectionChange(newSelection) {
|
|
750
|
-
const params = {
|
|
751
|
-
newSelection
|
|
752
|
-
}
|
|
753
|
-
gridSelectionChange(pageContext, configure, params)
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
function cellClickEvent(row: any, column: any, cell: HTMLTableCellElement, event: Event) {
|
|
757
|
-
const params = {
|
|
758
|
-
row,
|
|
759
|
-
column,
|
|
760
|
-
cell,
|
|
761
|
-
event
|
|
762
|
-
}
|
|
763
|
-
cellClick(pageContext, configure, params)
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
function cellDblClickEvent(row: any, column: any, cell: HTMLTableCellElement, event: Event) {
|
|
767
|
-
const params = {
|
|
768
|
-
row,
|
|
769
|
-
column,
|
|
770
|
-
cell,
|
|
771
|
-
event
|
|
772
|
-
}
|
|
773
|
-
cellDblClick(pageContext, configure, params)
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
function rowClickEvent(row: any, column: any, event: Event) {
|
|
777
|
-
const params = {
|
|
778
|
-
row,
|
|
779
|
-
column,
|
|
780
|
-
event
|
|
781
|
-
}
|
|
782
|
-
rowClick(pageContext, configure, params)
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
function rowDblClickEvent(row: any, column: any, event: Event) {
|
|
786
|
-
const params = {
|
|
787
|
-
row,
|
|
788
|
-
column,
|
|
789
|
-
event
|
|
790
|
-
}
|
|
791
|
-
rowDblClick(pageContext, configure, params)
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
function headerClickEvent(column: any, event: Event) {
|
|
795
|
-
const params = {
|
|
796
|
-
column,
|
|
797
|
-
event
|
|
798
|
-
}
|
|
799
|
-
headerClick(pageContext, configure, params)
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// api:子表保存时验证子表记录必填
|
|
803
|
-
function validatorSunTableListData() {
|
|
804
|
-
return gridRef.value.validatorSunTableListData()
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// api:列表组件内容刷新后的回调事件
|
|
808
|
-
function clearSelections() {
|
|
809
|
-
selections.value = []
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
// api:刷新列表数据
|
|
813
|
-
function refresh() {
|
|
814
|
-
return gridRef.value.refresh()
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
// api:行编辑新建记录
|
|
818
|
-
function createRow() {
|
|
819
|
-
return gridRef.value.createRow(listCode)
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
// api:获得选中记录集合
|
|
823
|
-
function getSelections() {
|
|
824
|
-
return selections.value
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
// api:获得选中记录id集合
|
|
828
|
-
function getSelectionIds() {
|
|
829
|
-
const dataIds = []
|
|
830
|
-
if (selections.value !== null) {
|
|
831
|
-
selections.value.forEach((item) => {
|
|
832
|
-
dataIds.push(item.id ? item.id : item.ID ? item.ID : null)
|
|
833
|
-
})
|
|
834
|
-
}
|
|
835
|
-
return dataIds
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
// api:获得表格配置
|
|
839
|
-
function getTableConfigure() {
|
|
840
|
-
return configure
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
// api: 是否是执行了删除操作
|
|
844
|
-
function isDeleteChange(value) {
|
|
845
|
-
gridRef.value.isDeleteChange(value)
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
defineExpose({
|
|
849
|
-
refresh,
|
|
850
|
-
createRow,
|
|
851
|
-
clearSelections,
|
|
852
|
-
getSelections,
|
|
853
|
-
getSelectionIds,
|
|
854
|
-
getTableConfigure,
|
|
855
|
-
isDeleteChange,
|
|
856
|
-
validatorSunTableListData
|
|
857
|
-
})
|
|
858
|
-
</script>
|