imatrix-ui 2.9.15-dw-tmp2 → 2.9.16-boe1
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/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +2 -2
- package/src/api/sso-service.js +19 -1
- package/src/assets/nonemessage.png +0 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +18 -6
- package/src/i18n/langs/en.js +20 -7
- package/src/permission.js +2 -2
- package/src/plugins.js +3 -3
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/store/modules/user.js +32 -2
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +74 -4
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +6 -30
- package/src/styles/theme/blue/font-style.scss +37 -0
- package/src/styles/theme/blue/index.scss +2 -18
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +3 -13
- package/src/styles/theme/dark-blue/card.scss +4 -6
- package/src/styles/theme/dark-blue/form.scss +7 -4
- package/src/styles/theme/dark-blue/index.scss +30 -5
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/radio.scss +13 -0
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/tab.scss +4 -1
- package/src/styles/theme/dark-blue/table.scss +1 -1
- package/src/styles/theme/dark-blue/tree.scss +35 -10
- package/src/styles/theme/gray/card-style.scss +13 -1
- package/src/styles/theme/gray/font-style.scss +38 -0
- package/src/styles/theme/gray/index.scss +13 -25
- package/src/styles/theme/gray/scrollbar-style.scss +32 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +47 -1
- package/src/utils/common-util.js +22 -81
- package/src/utils/jump-page-utils.js +3 -6
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +6 -3
- package/src/utils/util.js +13 -11
- package/src/utils/workflow-util.js +3 -0
- package/src/views/dsc-component/Sidebar/Item.vue +7 -5
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
- package/src/views/dsc-component/Sidebar/index.vue +12 -20
- package/src/views/dsc-component/tabs/tab-content.vue +8 -9
- package/src/views/layout/EmptyLayout.vue +4 -1
- package/src/views/layout/NewLayout.vue +6 -65
- package/src/views/layout/components/AppMain.vue +2 -1
- package/src/views/layout/components/Menubar/Item.vue +23 -7
- package/src/views/layout/components/Menubar/Link.vue +11 -2
- package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
- package/src/views/layout/components/Menubar/index.vue +51 -16
- package/src/views/layout/components/tabs/tab-content.vue +162 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +85 -0
- package/src/views/login/index.vue +1 -1
- package/packages/breadcrumb/index.js +0 -6
- package/packages/breadcrumb/src/breadcrumb.vue +0 -71
- package/packages/department-tree/index.js +0 -6
- package/packages/department-tree/src/department-tree.vue +0 -108
- package/packages/department-tree-inline/index.js +0 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -408
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -290
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -273
- package/packages/department-tree-inline/src/search-result.vue +0 -176
- package/packages/department-user-tree/index.js +0 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
- package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
- package/packages/department-user-tree/src/department-user-tree.vue +0 -101
- package/packages/department-user-tree-inline/index.js +0 -6
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -636
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -271
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -248
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -142
- package/packages/department-user-tree-inline/src/search-result.vue +0 -197
- package/packages/directives/prevent-reclick.js +0 -19
- package/packages/dynamic-source-select/index.js +0 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
- package/packages/dynamic-source-select/src/events.js +0 -55
- package/packages/fs-preview/index.js +0 -6
- package/packages/fs-preview/src/fs-preview.vue +0 -226
- package/packages/fs-upload/index.js +0 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
- package/packages/fs-upload/src/fs-upload-single.vue +0 -312
- package/packages/fs-upload/src/fs-upload.vue +0 -189
- package/packages/fs-upload/src/see-big-picture.vue +0 -55
- package/packages/fs-upload-list/index.js +0 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
- package/packages/hamburger/index.js +0 -6
- package/packages/hamburger/src/hamburger.vue +0 -38
- package/packages/index.js +0 -121
- package/packages/multipart-upload/index.js +0 -6
- package/packages/multipart-upload/src/index.vue +0 -73
- package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
- package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
- package/packages/organization-input/index.js +0 -6
- package/packages/organization-input/src/organization-input.vue +0 -542
- package/packages/plugins/export-data-new.js +0 -466
- package/packages/plugins/export-data.js +0 -361
- package/packages/plugins/index.js +0 -15
- package/packages/plugins/public-method.js +0 -43
- package/packages/remove-department/index.js +0 -6
- package/packages/remove-department/src/remove-department.vue +0 -172
- package/packages/remove-department/src/remove-dept-service.js +0 -20
- package/packages/remove-user/index.js +0 -6
- package/packages/remove-user/src/remove-user-service.js +0 -20
- package/packages/remove-user/src/remove-user.vue +0 -195
- package/packages/remove-workgroup/index.js +0 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
- package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
- package/packages/rich-editor/index.js +0 -7
- package/packages/rich-editor/index.vue +0 -278
- package/packages/rich-editor/langs/zh-Hans.js +0 -1
- package/packages/rich-editor/viewer.vue +0 -103
- package/packages/scan-code-input/index.js +0 -6
- package/packages/scan-code-input/src/events.js +0 -33
- package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
- package/packages/scan-code-input/src/scan-code-input.vue +0 -116
- package/packages/secret-info/index.js +0 -7
- package/packages/secret-info/index.vue +0 -90
- package/packages/super-grid/index.js +0 -7
- package/packages/super-grid/src/apis.js +0 -820
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -278
- package/packages/super-grid/src/dynamic-input.vue +0 -1279
- package/packages/super-grid/src/eventBus.js +0 -2
- package/packages/super-grid/src/events.js +0 -55
- package/packages/super-grid/src/formValidatorUtil.js +0 -226
- package/packages/super-grid/src/formatter.js +0 -181
- package/packages/super-grid/src/group-column.vue +0 -100
- package/packages/super-grid/src/header-context-menu.vue +0 -87
- package/packages/super-grid/src/index-column.vue +0 -51
- package/packages/super-grid/src/normal-column.vue +0 -771
- package/packages/super-grid/src/public-methods.js +0 -31
- package/packages/super-grid/src/row-operation.vue +0 -161
- package/packages/super-grid/src/search-button.vue +0 -66
- package/packages/super-grid/src/search-condition-input.vue +0 -61
- package/packages/super-grid/src/search-condition-list.vue +0 -59
- package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -404
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -170
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -196
- package/packages/super-grid/src/search-form.vue +0 -642
- package/packages/super-grid/src/search-methods.js +0 -448
- package/packages/super-grid/src/selection-column.vue +0 -43
- package/packages/super-grid/src/store.js +0 -3
- package/packages/super-grid/src/super-grid-service.js +0 -593
- package/packages/super-grid/src/super-grid.vue +0 -2882
- package/packages/super-grid/src/utils.js +0 -762
- package/packages/super-grid/src/view-image-dialog.vue +0 -130
- package/packages/super-nine-grid/index.js +0 -7
- package/packages/super-nine-grid/src/apis.js +0 -103
- package/packages/super-nine-grid/src/custom-formatter.js +0 -66
- package/packages/super-nine-grid/src/formatter.js +0 -132
- package/packages/super-nine-grid/src/search-form-number.vue +0 -38
- package/packages/super-nine-grid/src/search-form.vue +0 -430
- package/packages/super-nine-grid/src/search-methods.js +0 -134
- package/packages/super-nine-grid/src/store.js +0 -3
- package/packages/super-nine-grid/src/super-grid-service.js +0 -91
- package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
- package/packages/super-nine-grid/src/utils.js +0 -261
- package/packages/svg-icon/index.js +0 -6
- package/packages/svg-icon/src/svg-icon.vue +0 -43
- package/packages/utils/memory-cache-utils.js +0 -90
- package/packages/utils/utils.js +0 -152
- package/packages/utils/value-set.js +0 -86
- package/packages/valid-code/index.js +0 -7
- package/packages/valid-code/src/valid-code.vue +0 -95
- package/packages/workflow-button/index.js +0 -6
- package/packages/workflow-button/src/workflow-button.vue +0 -325
- package/packages/workflow-history-list/index.js +0 -6
- package/packages/workflow-history-list/src/api.js +0 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
- package/packages/workgroup-tree/index.js +0 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
- package/packages/workgroup-tree-inline/index.js +0 -6
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
- package/packages/workgroup-user-tree/index.js +0 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
- package/packages/workgroup-user-tree-inline/index.js +0 -6
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
- package/packages/year-range-picker/index.js +0 -6
- package/packages/year-range-picker/src/year-range-picker.vue +0 -51
- package/src/index.js +0 -93
- package/src/styles/theme/gray/form-style.scss +0 -41
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-form v-if="searchableColumns.length > 0" ref="searchForm" :model="searchForm" :rules="rules" :label-width="labelWidth" :label-position="query.queryLabelPosition" class="grid-search-form" size="mini">
|
|
3
|
-
<table>
|
|
4
|
-
<tr v-for="r of rowNum" :key="r">
|
|
5
|
-
<td v-for="n of getColumnNumPerRow(r,searchableColumns.length)" :key="n">
|
|
6
|
-
<el-form-item :prop="searchableColumns[fieldNum*(r-1)+(n-1)].prop" :label-width="searchableColumns[fieldNum*(r-1)+(n-1)].searchLabelWidth?searchableColumns[fieldNum*(r-1)+(n-1)].searchLabelWidth:'80px'" :style="{paddingLeft:'10px',minWidth:'200px'}">
|
|
7
|
-
<template slot="label">
|
|
8
|
-
<span v-if="searchableColumns[fieldNum*(r-1)+(n-1)].searchLabel && searchableColumns[fieldNum*(r-1)+(n-1)].searchLabel !== ''" v-html="searchableColumns[fieldNum*(r-1)+(n-1)].searchLabel.replace(/\\n/g, '</br>')" />
|
|
9
|
-
<span v-else v-html="searchableColumns[fieldNum*(r-1)+(n-1)].label.replace(/\\n/g, '</br>')" />
|
|
10
|
-
</template>
|
|
11
|
-
<el-date-picker
|
|
12
|
-
v-if="searchableColumns[fieldNum*(r-1)+(n-1)].dataType === 'DATE' || searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='date' "
|
|
13
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
14
|
-
type="daterange"
|
|
15
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
16
|
-
:range-separator="$t('imatrixUIPublicModel.to')"
|
|
17
|
-
unlink-panels
|
|
18
|
-
:start-placeholder="$t('imatrixUIMessage.startDate')"
|
|
19
|
-
:end-placeholder="$t('imatrixUIMessage.endDate')"
|
|
20
|
-
value-format="yyyy-MM-dd"
|
|
21
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
22
|
-
/>
|
|
23
|
-
|
|
24
|
-
<el-date-picker
|
|
25
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='dateTimePicker'"
|
|
26
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
27
|
-
type="datetimerange"
|
|
28
|
-
:range-separator="$t('imatrixUIPublicModel.to')"
|
|
29
|
-
unlink-panels
|
|
30
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
31
|
-
:start-placeholder="$t('imatrixUIMessage.startDate')"
|
|
32
|
-
:end-placeholder="$t('imatrixUIMessage.endDate')"
|
|
33
|
-
value-format="yyyy-MM-dd HH:mm:ss"
|
|
34
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<el-date-picker
|
|
38
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].dataType === 'TIME' && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='timepicker'"
|
|
39
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
40
|
-
type="datetimerange"
|
|
41
|
-
:range-separator="$t('imatrixUIPublicModel.to')"
|
|
42
|
-
unlink-panels
|
|
43
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
44
|
-
:start-placeholder="$t('imatrixUIMessage.startDate')"
|
|
45
|
-
:end-placeholder="$t('imatrixUIMessage.endDate')"
|
|
46
|
-
value-format="HH:mm:ss"
|
|
47
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
48
|
-
/>
|
|
49
|
-
|
|
50
|
-
<el-time-picker
|
|
51
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='timepicker' && searchableColumns[fieldNum*(r-1)+(n-1)].dataType !== 'TIME' && searchableColumns[fieldNum*(r-1)+(n-1)].dataType !== 'DATE' "
|
|
52
|
-
type="fixed-time"
|
|
53
|
-
:placeholder="$t('imatrixUIMessage.selectTime')"
|
|
54
|
-
style="width: 100%;"
|
|
55
|
-
value-format="HH:mm:ss"
|
|
56
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
57
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
58
|
-
/>
|
|
59
|
-
<el-select
|
|
60
|
-
v-else-if="(searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='select') || searchableColumns[fieldNum*(r-1)+(n-1)].dataType === 'BOOLEAN'"
|
|
61
|
-
clearable
|
|
62
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
63
|
-
:placeholder="$t('imatrixUIMessage.pleaseSelect')"
|
|
64
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
65
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
66
|
-
>
|
|
67
|
-
<el-option
|
|
68
|
-
v-for="item in searchableColumns[fieldNum*(r-1)+(n-1)].valueSet"
|
|
69
|
-
:key="item.value"
|
|
70
|
-
:label="item.label"
|
|
71
|
-
:value="item.value"
|
|
72
|
-
/>
|
|
73
|
-
</el-select>
|
|
74
|
-
<el-select
|
|
75
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='multiselect'"
|
|
76
|
-
clearable
|
|
77
|
-
multiple
|
|
78
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
79
|
-
collapse-tags
|
|
80
|
-
:placeholder="$t('imatrixUIMessage.pleaseSelect')"
|
|
81
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
82
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
83
|
-
>
|
|
84
|
-
<el-option
|
|
85
|
-
v-for="item in searchableColumns[fieldNum*(r-1)+(n-1)].valueSet"
|
|
86
|
-
:key="item.value"
|
|
87
|
-
:label="item.label"
|
|
88
|
-
:value="item.value"
|
|
89
|
-
/>
|
|
90
|
-
</el-select>
|
|
91
|
-
<!--
|
|
92
|
-
<el-input-number
|
|
93
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='inputNumber'"
|
|
94
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
95
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
96
|
-
/> -->
|
|
97
|
-
|
|
98
|
-
<search-form-number
|
|
99
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='inputNumber'"
|
|
100
|
-
:r="r"
|
|
101
|
-
:n="n"
|
|
102
|
-
@setValue="setNumberValue"
|
|
103
|
-
/>
|
|
104
|
-
|
|
105
|
-
<el-switch
|
|
106
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='switch'"
|
|
107
|
-
active-color="#13ce66"
|
|
108
|
-
inactive-color="#ff4949"
|
|
109
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
110
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
111
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
112
|
-
/>
|
|
113
|
-
<el-slider
|
|
114
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='slider'"
|
|
115
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
116
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
117
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
118
|
-
/>
|
|
119
|
-
|
|
120
|
-
<el-rate
|
|
121
|
-
v-else-if="searchableColumns[fieldNum*(r-1)+(n-1)].componentType && searchableColumns[fieldNum*(r-1)+(n-1)].componentType==='rate'"
|
|
122
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
123
|
-
:style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth"
|
|
124
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
125
|
-
/>
|
|
126
|
-
<span v-else-if="customComponent(searchableColumns[fieldNum*(r-1)+(n-1)]) === true">
|
|
127
|
-
<component
|
|
128
|
-
:is="searchableColumns[fieldNum*(r-1)+(n-1)].componentName"
|
|
129
|
-
:ref="searchableColumns[fieldNum*(r-1)+(n-1)].componentName"
|
|
130
|
-
class="customComponent"
|
|
131
|
-
:prop="searchableColumns[fieldNum*(r-1)+(n-1)].prop"
|
|
132
|
-
:value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)"
|
|
133
|
-
@input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)"
|
|
134
|
-
/>
|
|
135
|
-
</span>
|
|
136
|
-
<el-input v-else :value="getFormItemValue(searchableColumns[fieldNum*(r-1)+(n-1)].prop)" :style="searchableColumns[fieldNum*(r-1)+(n-1)].searchControlWidth" @keyup.enter.native="submitForm('searchForm')" @input="setValueToModelProp(searchableColumns[fieldNum*(r-1)+(n-1)].prop,$event)" />
|
|
137
|
-
</el-form-item>
|
|
138
|
-
</td>
|
|
139
|
-
</tr>
|
|
140
|
-
</table>
|
|
141
|
-
|
|
142
|
-
<el-form-item class="search-btn">
|
|
143
|
-
<el-button :loading="loading" type="primary" size="mini" @click="submitForm('searchForm')">
|
|
144
|
-
{{ $t('imatrixUIPublicModel.sure') }}
|
|
145
|
-
</el-button>
|
|
146
|
-
<el-button :loading="loading" size="mini" @click="resetForm('searchForm')">
|
|
147
|
-
{{ $t('imatrixUIPublicModel.reset') }}
|
|
148
|
-
</el-button>
|
|
149
|
-
</el-form-item>
|
|
150
|
-
</el-form>
|
|
151
|
-
</template>
|
|
152
|
-
<style scoped>
|
|
153
|
-
.grid-search-form{
|
|
154
|
-
overflow: auto;
|
|
155
|
-
}
|
|
156
|
-
.grid-search-form >>> .el-form-item{
|
|
157
|
-
margin-bottom: 0px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.grid-search-form >>> .search-btn{
|
|
161
|
-
margin-bottom: 5px;
|
|
162
|
-
text-align: center;
|
|
163
|
-
}
|
|
164
|
-
.grid-search-form >>> .el-select,.grid-search-form >>> .customComponent{
|
|
165
|
-
width: 100%;
|
|
166
|
-
}
|
|
167
|
-
</style>
|
|
168
|
-
<script>
|
|
169
|
-
import searchMethods from './search-methods'
|
|
170
|
-
import searchFormNumber from './search-form-number'
|
|
171
|
-
import store from './store'
|
|
172
|
-
// import { isOptionFunction, getSearchObject } from './utils'
|
|
173
|
-
import { addDynamicProp } from './utils'
|
|
174
|
-
import Vue from 'vue'
|
|
175
|
-
export default {
|
|
176
|
-
name: 'SearchForm',
|
|
177
|
-
components: {
|
|
178
|
-
searchFormNumber
|
|
179
|
-
},
|
|
180
|
-
props: {
|
|
181
|
-
columns: {
|
|
182
|
-
type: Array,
|
|
183
|
-
default: null
|
|
184
|
-
},
|
|
185
|
-
code: {
|
|
186
|
-
type: String,
|
|
187
|
-
default: null
|
|
188
|
-
},
|
|
189
|
-
url: {
|
|
190
|
-
type: String,
|
|
191
|
-
default: null
|
|
192
|
-
},
|
|
193
|
-
pagination: {
|
|
194
|
-
type: Object,
|
|
195
|
-
default: null
|
|
196
|
-
},
|
|
197
|
-
query: {
|
|
198
|
-
type: Object,
|
|
199
|
-
default: null
|
|
200
|
-
},
|
|
201
|
-
searchParam: {
|
|
202
|
-
type: Object,
|
|
203
|
-
default: null
|
|
204
|
-
},
|
|
205
|
-
initSearchProps: {
|
|
206
|
-
type: Array,
|
|
207
|
-
default: null
|
|
208
|
-
},
|
|
209
|
-
// 九宫格组件的id
|
|
210
|
-
gridId: {
|
|
211
|
-
type: String,
|
|
212
|
-
default: '_nineGrid'
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
data() {
|
|
217
|
-
const storeId = this.code + '~' + this.gridId
|
|
218
|
-
const customComponentNames = new Set()
|
|
219
|
-
const gridParams = store.get(storeId)
|
|
220
|
-
let searchForm = {}
|
|
221
|
-
if (this.searchParam !== null) {
|
|
222
|
-
searchForm = JSON.parse(JSON.stringify(this.searchParam))
|
|
223
|
-
// searchForm = this.searchParam
|
|
224
|
-
}
|
|
225
|
-
console.log('searchForm=', searchForm)
|
|
226
|
-
const searchColumns = this.getSearchableColumns()
|
|
227
|
-
if (this.initSearchProps === undefined || this.initSearchProps === null) {
|
|
228
|
-
this.initSearchProps = []
|
|
229
|
-
}
|
|
230
|
-
searchColumns.forEach(column => {
|
|
231
|
-
if (this.initSearchProps.indexOf(column.prop) < 0) {
|
|
232
|
-
// 表示没有默认初始查询字段
|
|
233
|
-
if (column.prop.indexOf('.') > 0) {
|
|
234
|
-
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
235
|
-
addDynamicProp(searchForm, column.prop)
|
|
236
|
-
} else {
|
|
237
|
-
searchForm[column.prop] = null
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
const spanNum = this.getSpanNum(storeId)
|
|
243
|
-
const fieldNum = this.getFieldNumPerRow(storeId)
|
|
244
|
-
const rowNum = Math.ceil(searchColumns.length / fieldNum)
|
|
245
|
-
// console.log('searchColumns.length=' + searchColumns.length + ',fieldNum=' + fieldNum + ',rowNum=' + rowNum)
|
|
246
|
-
// // -2是把
|
|
247
|
-
// const dateSpanNum = (spanNum - 2) / 2
|
|
248
|
-
|
|
249
|
-
return {
|
|
250
|
-
searchForm,
|
|
251
|
-
rules: {
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
searchParams: [],
|
|
255
|
-
labelWidth: gridParams.options.search && gridParams.options.search.labelWidth ? gridParams.options.search.labelWidth : '80px',
|
|
256
|
-
customComponentNames: customComponentNames,
|
|
257
|
-
componentName: '',
|
|
258
|
-
spanNum: spanNum,
|
|
259
|
-
fieldNum: fieldNum, // 每行放的字段个数
|
|
260
|
-
rowNum: rowNum, // 一共有几行
|
|
261
|
-
loading: false, // 是否正在查询,默认时否
|
|
262
|
-
storeId // 缓存的列表id
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
computed: {
|
|
266
|
-
searchableColumns() {
|
|
267
|
-
return this.getSearchableColumns()
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
methods: {
|
|
271
|
-
...searchMethods,
|
|
272
|
-
// 获得每行排放的字段个数
|
|
273
|
-
getColumnNumPerRow(rowIndex, searchColumnsLength) {
|
|
274
|
-
let columnNumPerRow = this.fieldNum
|
|
275
|
-
if (this.fieldNum * rowIndex > searchColumnsLength) {
|
|
276
|
-
// 表示字段无法填满最后一行
|
|
277
|
-
columnNumPerRow = searchColumnsLength - (this.fieldNum * (rowIndex - 1))
|
|
278
|
-
}
|
|
279
|
-
return columnNumPerRow
|
|
280
|
-
},
|
|
281
|
-
// 每行放的字段个数
|
|
282
|
-
getFieldNumPerRow(storeId) {
|
|
283
|
-
const gridParams = store.get(storeId)
|
|
284
|
-
return gridParams.options.search && gridParams.options.search.fieldNum ? gridParams.options.search.fieldNum : 4
|
|
285
|
-
},
|
|
286
|
-
// 根据每行显示的字段个数,确定栅栏个数,默认是4个字段。最多就只能放6个字段
|
|
287
|
-
getSpanNum(storeId) {
|
|
288
|
-
const fieldNum = this.getFieldNumPerRow(storeId)
|
|
289
|
-
if (fieldNum === 1) {
|
|
290
|
-
return 14
|
|
291
|
-
} else if (fieldNum === 2) {
|
|
292
|
-
return 10
|
|
293
|
-
} else if (fieldNum === 3) {
|
|
294
|
-
return 8
|
|
295
|
-
} else if (fieldNum === 4) {
|
|
296
|
-
return 6
|
|
297
|
-
} else {
|
|
298
|
-
// 6个字段
|
|
299
|
-
return 4
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
setValueToModelProp(prop, value) {
|
|
303
|
-
if (prop.indexOf('.') > 0) {
|
|
304
|
-
const parentOjbect = this.getParentObject(prop)
|
|
305
|
-
// 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
|
|
306
|
-
parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)] = value
|
|
307
|
-
} else {
|
|
308
|
-
this.searchForm[prop] = value
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
getSearchableColumns(columns, searchColumns) {
|
|
312
|
-
if (!this.customComponentNames) {
|
|
313
|
-
this.customComponentNames = new Set()
|
|
314
|
-
}
|
|
315
|
-
if (!searchColumns) {
|
|
316
|
-
searchColumns = []
|
|
317
|
-
}
|
|
318
|
-
if (!columns) {
|
|
319
|
-
columns = this.columns
|
|
320
|
-
}
|
|
321
|
-
for (let i = 0; i < columns.length; i++) {
|
|
322
|
-
const column = columns[i]
|
|
323
|
-
if (column.prop === '$index' || column.prop === '$selection' || column.dynamic) {
|
|
324
|
-
// 序号和复选框列、动态列 不属于该组件的查询字段
|
|
325
|
-
continue
|
|
326
|
-
}
|
|
327
|
-
if (column.groupHeader) {
|
|
328
|
-
// 组合表头中子表头的字段查询
|
|
329
|
-
this.getSearchableColumns(column.children, searchColumns)
|
|
330
|
-
} else {
|
|
331
|
-
if (column.queryType === 'normal' && !column.custom && column.prop !== '') {
|
|
332
|
-
// 表示是普通查询,且不是占位符列,是查询字段
|
|
333
|
-
if (typeof (column.componentType) === 'undefined' || column.componentType === '') {
|
|
334
|
-
column.componentType = 'input'
|
|
335
|
-
}
|
|
336
|
-
if (column.querySetting && column.querySetting !== '') {
|
|
337
|
-
const querySetting = JSON.parse(column.querySetting)
|
|
338
|
-
if (querySetting.width) {
|
|
339
|
-
column.searchControlWidth = 'width:' + querySetting.width + 'px'
|
|
340
|
-
}
|
|
341
|
-
if (querySetting.labelWidth) {
|
|
342
|
-
column.searchLabelWidth = querySetting.labelWidth + 'px'
|
|
343
|
-
}
|
|
344
|
-
if (querySetting.label) {
|
|
345
|
-
column.searchLabel = querySetting.label
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
// 行编辑时自定义编辑组件
|
|
349
|
-
if (column.componentType.indexOf('custom:') >= 0) {
|
|
350
|
-
column.componentName = column.componentType.substring(column.componentType.indexOf(':') + 1)
|
|
351
|
-
this.customComponentNames.add(column.componentName)
|
|
352
|
-
} else {
|
|
353
|
-
column.componentName = ''
|
|
354
|
-
}
|
|
355
|
-
searchColumns.push(column)
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
return searchColumns
|
|
360
|
-
},
|
|
361
|
-
customComponent(column) {
|
|
362
|
-
const gridParams = store.get(this.storeId)
|
|
363
|
-
if (column.componentName && column.componentName !== '') {
|
|
364
|
-
this.customComponentNames.add(column.componentName)
|
|
365
|
-
return true
|
|
366
|
-
}
|
|
367
|
-
if ((!column.componentName || column.componentName === '') &&
|
|
368
|
-
gridParams.options &&
|
|
369
|
-
gridParams.options.search &&
|
|
370
|
-
gridParams.options.search.customSearchElements) {
|
|
371
|
-
// 定义了自定义查询组件
|
|
372
|
-
const propSearchEle = gridParams.options.search.customSearchElements[column.prop]
|
|
373
|
-
// console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
|
|
374
|
-
if (propSearchEle) {
|
|
375
|
-
column.componentName = 'custom-' + column.prop
|
|
376
|
-
const component = propSearchEle.call(this, column)
|
|
377
|
-
// console.log('customComponent-customSearchElements-')
|
|
378
|
-
if (component) {
|
|
379
|
-
this.customComponentNames.add(column.componentName)
|
|
380
|
-
Vue.component(column.componentName, component)
|
|
381
|
-
return true
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
return false
|
|
386
|
-
},
|
|
387
|
-
submitForm(formName) {
|
|
388
|
-
this.$refs[formName].validate((valid) => {
|
|
389
|
-
if (valid) {
|
|
390
|
-
// const searchDemo = [
|
|
391
|
-
// { leftBracket: '', propName: 'name', enumName: '', operator: 'contain', propValue: '系统', rightBracket: '', joinSign: 'and', dataType: 'TEXT' },
|
|
392
|
-
// { leftBracket: '', propName: 'createdTime', enumName: '', operator: 'eq', startValue: '2019-01-29', endValue: '2019-01-30', propValue: '2019-01-30', rightBracket: '', joinSign: 'and', dataType: 'DATE' },
|
|
393
|
-
// { leftBracket: '', propName: 'enabledState', enumName: 'tech.imatrix.enumeration.MenuState', operator: 'eq', propValue: 'ENABLE', rightBracket: '', joinSign: 'and', dataType: 'ENUM' }
|
|
394
|
-
// ]
|
|
395
|
-
this.loading = true
|
|
396
|
-
this.searchParams = this.packageSearchParam()
|
|
397
|
-
this.$emit('search', this.searchParams, true)
|
|
398
|
-
} else {
|
|
399
|
-
// console.log('error submit!!')
|
|
400
|
-
return false
|
|
401
|
-
}
|
|
402
|
-
})
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
resetForm(formName) {
|
|
406
|
-
// console.log('customComponentNames=', this.customComponentNames)
|
|
407
|
-
for (const componentName of this.customComponentNames) { // 遍历
|
|
408
|
-
this.$refs[componentName][0].resetField()
|
|
409
|
-
}
|
|
410
|
-
// this.$refs[formName].resetFields()
|
|
411
|
-
|
|
412
|
-
this.searchableColumns.forEach(column => {
|
|
413
|
-
// 表示没有默认初始查询字段
|
|
414
|
-
if (column.prop.indexOf('.') > 0) {
|
|
415
|
-
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
416
|
-
addDynamicProp(this.searchForm, column.prop)
|
|
417
|
-
} else {
|
|
418
|
-
this.searchForm[column.prop] = null
|
|
419
|
-
}
|
|
420
|
-
})
|
|
421
|
-
this.$emit('reset')
|
|
422
|
-
},
|
|
423
|
-
setNumberValue(value, r, n) {
|
|
424
|
-
let itemValue = this.getFormItemValue(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop)
|
|
425
|
-
itemValue = value
|
|
426
|
-
this.setValueToModelProp(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop, itemValue)
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
</script>
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
const searchMethods = {
|
|
2
|
-
packageSearchParam() {
|
|
3
|
-
const searchParams = []
|
|
4
|
-
this.searchableColumns.forEach(column => {
|
|
5
|
-
const param = { leftBracket: '', rightBracket: '', joinSign: 'and' }
|
|
6
|
-
// 布尔型字段时prop中去掉了is字符,查询时返回带有is的属性字段,
|
|
7
|
-
// 否则会导致查询布尔型报500错误
|
|
8
|
-
let orgProp = column.orgProp
|
|
9
|
-
// sql查询时,会把点“.”改为两个下划线"__"
|
|
10
|
-
const replaceDot = '__'
|
|
11
|
-
if (orgProp.indexOf(replaceDot) > 0) {
|
|
12
|
-
// 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
|
|
13
|
-
orgProp = orgProp.replace(replaceDot, '.')
|
|
14
|
-
}
|
|
15
|
-
param.columnProp = column.prop
|
|
16
|
-
param.propName = orgProp
|
|
17
|
-
param.enumName = column.enumName
|
|
18
|
-
param.operator = this.getOperator(column)
|
|
19
|
-
param.dataType = column.dataType
|
|
20
|
-
if (column.dataType === 'DATE' || column.dataType === 'TIME') {
|
|
21
|
-
// 日期 或 时间类型
|
|
22
|
-
const values = this.getFormItemValue(column.prop)
|
|
23
|
-
// console.log('values==', values, column.prop)
|
|
24
|
-
if (values !== null && values.length === 2 && values[0] !== null && values[1] !== null) {
|
|
25
|
-
param.startValue = values[0]
|
|
26
|
-
param.endValue = values[1]
|
|
27
|
-
searchParams.push(param)
|
|
28
|
-
}
|
|
29
|
-
} else if (column.dataType === 'INTEGER' || column.dataType === 'LONG') {
|
|
30
|
-
// 日期 或 时间类型
|
|
31
|
-
const values1 = this.getFormItemValue(column.prop)
|
|
32
|
-
if (values1) {
|
|
33
|
-
if (!Array.isArray(values1) || values1.length < 2 || values1[0] === null && values1[1] === null) {
|
|
34
|
-
// 填写了一个有效值
|
|
35
|
-
if (!Array.isArray(values1)) {
|
|
36
|
-
param.propValue = values1
|
|
37
|
-
searchParams.push(param)
|
|
38
|
-
} else if (values1.length < 2) {
|
|
39
|
-
param.propValue = values1[0]
|
|
40
|
-
searchParams.push(param)
|
|
41
|
-
} else if (values1[0] === null) {
|
|
42
|
-
param.propValue = values1[1]
|
|
43
|
-
searchParams.push(param)
|
|
44
|
-
} else if (values1[1] === null) {
|
|
45
|
-
param.propValue = values1[0]
|
|
46
|
-
searchParams.push(param)
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
// 填写了两个有效值
|
|
50
|
-
param.startValue = values1[0]
|
|
51
|
-
param.endValue = values1[1]
|
|
52
|
-
searchParams.push(param)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} else {
|
|
56
|
-
if (column.componentType === 'multiselect') {
|
|
57
|
-
// 表示是多选下拉框选择器选择的值
|
|
58
|
-
const values = this.getFormItemValue(column.prop)
|
|
59
|
-
// console.log('values==', values, column.prop)
|
|
60
|
-
this.packageValueWithArray(values, searchParams, param)
|
|
61
|
-
} else {
|
|
62
|
-
const propValue = this.getFormItemValue(column.prop)
|
|
63
|
-
this.packageValueWithArray(propValue, searchParams, param)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
return searchParams
|
|
68
|
-
},
|
|
69
|
-
getOperator(column) {
|
|
70
|
-
if ((column.dataType === 'TEXT' || column.dataType === 'CLOB') && column.fuzzy) {
|
|
71
|
-
// 是否是文本类型的字段,且启用了模糊查询,则表示操作符为contains模糊查询
|
|
72
|
-
return 'CONTAIN'
|
|
73
|
-
} else {
|
|
74
|
-
// 否则就是等于
|
|
75
|
-
return 'EQ'
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
getFormItemValue(prop) {
|
|
79
|
-
if (prop.indexOf('.') > 0) {
|
|
80
|
-
const parentOjbect = this.getParentObject(prop)
|
|
81
|
-
return parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)]
|
|
82
|
-
} else {
|
|
83
|
-
return this.searchForm[prop]
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
getParentObject(prop) {
|
|
87
|
-
const nestedProp = prop.split('.')
|
|
88
|
-
// 属性只有一个时父对象就是searchForm
|
|
89
|
-
if (nestedProp.length === 1) {
|
|
90
|
-
return this.searchForm
|
|
91
|
-
} else {
|
|
92
|
-
let parentObject
|
|
93
|
-
// 属性超过2个时先找到最后一层属性的父对象
|
|
94
|
-
for (let i = 0; i < nestedProp.length - 1; i++) {
|
|
95
|
-
parentObject = this.searchForm[nestedProp[i]]
|
|
96
|
-
}
|
|
97
|
-
return parentObject
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
// 处理多选下拉框时获得的值
|
|
101
|
-
// 处理非多选下拉框的值
|
|
102
|
-
packageValueWithArray(value, searchParams, param) {
|
|
103
|
-
if (value && Array.isArray(value)) {
|
|
104
|
-
const selectValues = value
|
|
105
|
-
// if (!Array.isArray(values)) {
|
|
106
|
-
// selectValues = values.split(',')
|
|
107
|
-
// }
|
|
108
|
-
let num = 0
|
|
109
|
-
selectValues.forEach(val => {
|
|
110
|
-
const selectParam = Object.assign({}, param)
|
|
111
|
-
selectParam.joinSign = 'or'// 将条件连接符修改为or,否则无法查询到值
|
|
112
|
-
if (num === 0) {
|
|
113
|
-
selectParam.leftBracket = '1' // 左边有1个括号
|
|
114
|
-
}
|
|
115
|
-
if (num === selectValues.length - 1) {
|
|
116
|
-
// 说明是最后一个条件
|
|
117
|
-
selectParam.rightBracket = '1'// 右边有1个括号
|
|
118
|
-
selectParam.joinSign = 'and' // 最后一个条件的连接符需要修改为and
|
|
119
|
-
}
|
|
120
|
-
selectParam.propValue = val
|
|
121
|
-
selectParam.operator = 'EQ'
|
|
122
|
-
if (val) {
|
|
123
|
-
searchParams.push(selectParam)
|
|
124
|
-
}
|
|
125
|
-
num++
|
|
126
|
-
})
|
|
127
|
-
} else if (typeof (value) !== 'undefined' && value !== '' && value !== null && !Array.isArray(value)) {
|
|
128
|
-
// 不是数组
|
|
129
|
-
param.propValue = value
|
|
130
|
-
searchParams.push(param)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
export default searchMethods
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
import store from './store'
|
|
4
|
-
import { packageEnumAndBeanColumnValueSets } from '../../utils/value-set'
|
|
5
|
-
import { isHasOptionFunction } from './utils'
|
|
6
|
-
const superGridService = {
|
|
7
|
-
initialize() {
|
|
8
|
-
const url = Vue.prototype.baseAPI + '/component/super-grids/' + this.code
|
|
9
|
-
const param = {}
|
|
10
|
-
const isSqlSetting = this.options.isSql
|
|
11
|
-
if (this.options && typeof (isSqlSetting) !== 'undefined') {
|
|
12
|
-
this.isSql = isSqlSetting
|
|
13
|
-
param.isSql = isSqlSetting + ''
|
|
14
|
-
}
|
|
15
|
-
this.isLoading = true
|
|
16
|
-
// 初始化组件时先获取元信息再获取数据,以后翻页、排序、查询不再去获取元数据了
|
|
17
|
-
this.$http.post(url, param).then(data => {
|
|
18
|
-
// console.log('自定义显示数量1:' + data)
|
|
19
|
-
// console.log('initialize--grid--data.columns.length=', data.columns.length)
|
|
20
|
-
if (this.options.pageSizes && data.pagination) {
|
|
21
|
-
// 组件的options属性配置中配置“可选行数”,已该配置为准
|
|
22
|
-
let pageSizeArr = null
|
|
23
|
-
const pageSizeStrs = this.options.pageSizes.split(',')
|
|
24
|
-
if (pageSizeStrs && pageSizeStrs.length > 0) {
|
|
25
|
-
pageSizeArr = []
|
|
26
|
-
for (var i = 0; i < pageSizeStrs.length; i++) {
|
|
27
|
-
pageSizeArr.push(pageSizeStrs[i] * 1)
|
|
28
|
-
}
|
|
29
|
-
data.pagination.pageSize = pageSizeArr[0]
|
|
30
|
-
}
|
|
31
|
-
data.pagination.layout = 'total, sizes, prev, pager, next, jumper'
|
|
32
|
-
data.pagination.pageSizes = pageSizeArr
|
|
33
|
-
// console.log('自定义显示数量2:' + pageSizeArr)
|
|
34
|
-
// console.log('自定义显示数量3:' + data)
|
|
35
|
-
}
|
|
36
|
-
if (typeof (this.options.initSortInfo) !== 'undefined') {
|
|
37
|
-
// 组件的options属性配置中配置“排序信息”,以该配置为准
|
|
38
|
-
if (Array.isArray(this.options.initSortInfo)) {
|
|
39
|
-
data.sortInfo = this.options.initSortInfo
|
|
40
|
-
} else {
|
|
41
|
-
data.sortInfo = []
|
|
42
|
-
data.sortInfo.push(this.options.initSortInfo)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
Object.assign(this, data)
|
|
46
|
-
const gridParams = store.get(this.code + '~' + this.gridId)
|
|
47
|
-
|
|
48
|
-
// store.listCode = this.code
|
|
49
|
-
// 需要多个组件共享的数据放到store中,避免组件定义一堆props来接收这些共享数据
|
|
50
|
-
packageEnumAndBeanColumnValueSets(this.columns, this.code).then(() => {
|
|
51
|
-
gridParams.isSql = this.isSql
|
|
52
|
-
gridParams.columns = this.columns
|
|
53
|
-
gridParams.lineEdit = this.lineEdit
|
|
54
|
-
gridParams.basicInfo = this.basicInfo
|
|
55
|
-
gridParams.pagination = this.pagination
|
|
56
|
-
gridParams.query = this.query
|
|
57
|
-
this.hasLoadedColumns = true
|
|
58
|
-
let canFetchData = true
|
|
59
|
-
if (isHasOptionFunction('loadBeforeSend', this.storeId)) {
|
|
60
|
-
canFetchData = gridParams.options.loadBeforeSend.call(this, { columns: this.columns, gridParams })
|
|
61
|
-
}
|
|
62
|
-
if (canFetchData === undefined || canFetchData === true) {
|
|
63
|
-
if (typeof (this.options.initSearch) === 'undefined' || this.options.initSearch !== false) {
|
|
64
|
-
// 获得行拖动顺序接口路径
|
|
65
|
-
this.urlToSaveOrder = this.lineEdit && this.lineEdit.urlToSaveOrder ? this.lineEdit.urlToSaveOrder : null
|
|
66
|
-
// 表示初始化时查询记录
|
|
67
|
-
this.fetchData().then(() => {
|
|
68
|
-
this.initSelectData()
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
},
|
|
75
|
-
// 单选时默认勾选指定的记录
|
|
76
|
-
initSelectData() {
|
|
77
|
-
if (this.options && this.options.currentIds) {
|
|
78
|
-
// 表示指定了选择的记录
|
|
79
|
-
for (let i = 0; i < this.gridData.length; i++) {
|
|
80
|
-
const record = this.gridData[i]
|
|
81
|
-
if ((record.id || record.ID) && this.options.currentIds.indexOf(record.id ? record.id : record.ID) >= 0) {
|
|
82
|
-
this.changeSelect(record)
|
|
83
|
-
if (this.multiple === false) {
|
|
84
|
-
break
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
export default superGridService
|