agilebuilder-ui 1.0.621 → 1.0.962
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -1,211 +1,170 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<Plus/>
|
|
41
|
-
</el-icon>
|
|
42
|
-
<span style="margin-top: 7px">
|
|
43
|
-
{{ $t('superNineGrid.add') }}</span
|
|
44
|
-
>
|
|
45
|
-
</div>
|
|
46
|
-
</el-card>
|
|
47
|
-
</el-col>
|
|
48
|
-
<el-col
|
|
49
|
-
v-for="(params, index) in gridData"
|
|
50
|
-
:key="params.id"
|
|
51
|
-
:offset="1.5"
|
|
52
|
-
:span="colSpan"
|
|
53
|
-
>
|
|
54
|
-
<el-card
|
|
55
|
-
:body-style="{ padding: '0px' }"
|
|
56
|
-
:style="{
|
|
57
|
-
border:
|
|
58
|
-
selectionIds.indexOf(params.id) > -1
|
|
59
|
-
? '1px solid #005EBA'
|
|
60
|
-
: '',
|
|
61
|
-
position: 'relative'
|
|
2
|
+
<div>
|
|
3
|
+
<search-form
|
|
4
|
+
v-if="hasLoadedColumns"
|
|
5
|
+
v-show="showSearch"
|
|
6
|
+
ref="sf"
|
|
7
|
+
:code="code"
|
|
8
|
+
:columns="columns"
|
|
9
|
+
:grid-id="gridId"
|
|
10
|
+
:init-search-props="initSearchProps"
|
|
11
|
+
:pagination="pagination"
|
|
12
|
+
:query="query"
|
|
13
|
+
:search-param="searchFormContent"
|
|
14
|
+
:url="url"
|
|
15
|
+
@reset="resetSearch"
|
|
16
|
+
@search="search"
|
|
17
|
+
/>
|
|
18
|
+
<div class="nine-grid-area">
|
|
19
|
+
<div :id="gridId" :style="'height:' + height + 'px;overflow-y: auto;overflow-x: hidden;'">
|
|
20
|
+
<el-row :gutter="24">
|
|
21
|
+
<el-col v-if="isHasCreate" id="_addCardId_" v-permission="createPermission" :span="colSpan">
|
|
22
|
+
<el-card
|
|
23
|
+
:body-style="{ padding: '0px' }"
|
|
24
|
+
style="border-radius: 4px; background: #ffffff; border: 1px solid #e5e8ef"
|
|
25
|
+
>
|
|
26
|
+
<div class="add-screen" @click="add">
|
|
27
|
+
<el-icon>
|
|
28
|
+
<Plus />
|
|
29
|
+
</el-icon>
|
|
30
|
+
<span style="margin-top: 7px"> {{ $t('superNineGrid.add') }}</span>
|
|
31
|
+
</div>
|
|
32
|
+
</el-card>
|
|
33
|
+
</el-col>
|
|
34
|
+
<el-col v-for="(params, index) in gridData" :key="params.id" :offset="1.5" :span="colSpan">
|
|
35
|
+
<el-card
|
|
36
|
+
:body-style="{ padding: '0px' }"
|
|
37
|
+
:style="{
|
|
38
|
+
border: selectionIds.indexOf(params.id) > -1 ? '1px solid #005EBA' : '',
|
|
39
|
+
position: 'relative'
|
|
62
40
|
}"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<!-- <!–<div v-if="seen && index === current" class="popContainer">–>-->
|
|
74
|
-
<!-- <div class="popContainer">-->
|
|
75
|
-
<!-- <div class="else-button" style="background: rgba(0,0,0,0.5); min-height: 20%;">-->
|
|
76
|
-
<!-- <!–<div class="else-button">–>-->
|
|
77
|
-
<!-- <slot :name="slotBefore" :params="params"/>-->
|
|
41
|
+
shadow="hover"
|
|
42
|
+
>
|
|
43
|
+
<div style="height: 160px" @click="clickContent(params)" @mouseenter="enter(index)" @mouseleave="leave()">
|
|
44
|
+
<!--<div @click="clickContent(params)">-->
|
|
45
|
+
<!--<transition name="fade">-->
|
|
46
|
+
<!-- <!–<div v-if="seen && index === current" class="popContainer">–>-->
|
|
47
|
+
<!-- <div class="popContainer">-->
|
|
48
|
+
<!-- <div class="else-button" style="background: rgba(0,0,0,0.5); min-height: 20%;">-->
|
|
49
|
+
<!-- <!–<div class="else-button">–>-->
|
|
50
|
+
<!-- <slot :name="slotBefore" :params="params"/>-->
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
</el-button>
|
|
196
|
-
<el-button
|
|
197
|
-
v-else
|
|
198
|
-
size="default"
|
|
199
|
-
type="primary"
|
|
200
|
-
@click.stop="changeState(params)"
|
|
201
|
-
>
|
|
202
|
-
{{ $t('imatrixUIPublicModel.startUsing') }}
|
|
203
|
-
</el-button>
|
|
204
|
-
</template>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
<!-- <el-divider />
|
|
52
|
+
<!-- <template v-for="button in operations">-->
|
|
53
|
+
<!-- <template v-if="isShowButton(params, button)">-->
|
|
54
|
+
<!-- <el-tooltip v-if="button.icon" :key="button.name" v-permission="button.permission?button.permission:'true'" :content="button.name" class="item" effect="dark" placement="top">-->
|
|
55
|
+
<!-- <!–<em :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)"/>–>-->
|
|
56
|
+
<!-- <em :class="button.icon +' icons'" @click.stop="buttonClick(button.event, params)"/>-->
|
|
57
|
+
<!-- </el-tooltip>-->
|
|
58
|
+
<!-- <!–<em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em>–>-->
|
|
59
|
+
<!-- <em v-else :key="button.name" v-permission="button.permission?button.permission:'true'" :class="button.name +' icons'" @click.stop="buttonClick(button.event, params)">{{ button.name }} </em>-->
|
|
60
|
+
<!-- </template>-->
|
|
61
|
+
<!-- </template>-->
|
|
62
|
+
<!-- </div>-->
|
|
63
|
+
<!-- </div>-->
|
|
64
|
+
<!--</transition>-->
|
|
65
|
+
<!-- <img v-if="props && props.imageUrl && objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" :src="defaultShowImageAction+objectPropValue(params, propCloumns.imageUrl, props.imageUrl)" alt="加载失败" class="image"> -->
|
|
66
|
+
<!-- <img v-if="true || (props && props.imageUrl)" :src="defaultShowImageAction+'fa7ae05e-0f0e-4cc0-b24a-69aea4408233'" alt="加载失败" class="image"> -->
|
|
67
|
+
<!-- <div v-else class="image" style="padding: 20px; text-align: center;"> -->
|
|
68
|
+
<div class="image" style="padding: 15px; box-sizing: border-box">
|
|
69
|
+
<div>
|
|
70
|
+
<el-tooltip
|
|
71
|
+
:content="
|
|
72
|
+
props && props.content
|
|
73
|
+
? getPropValue('content', params) + '(' + params.code + ')'
|
|
74
|
+
: props && props.title
|
|
75
|
+
? getPropValue('title', params) + '(' + params.code + ')'
|
|
76
|
+
: ''
|
|
77
|
+
"
|
|
78
|
+
effect="dark"
|
|
79
|
+
placement="top-start"
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
v-if="props && props.content"
|
|
83
|
+
:style="'display: inline-block;width:' + titleWidth"
|
|
84
|
+
class="ellipsis cell--span"
|
|
85
|
+
>
|
|
86
|
+
{{ getPropValue('content', params) + '(' + params.code + ')' }}
|
|
87
|
+
</div>
|
|
88
|
+
<div
|
|
89
|
+
v-else-if="props && props.title"
|
|
90
|
+
:style="'display: inline-block;width:' + titleWidth"
|
|
91
|
+
class="ellipsis cell--span"
|
|
92
|
+
>
|
|
93
|
+
{{ getPropValue('title', params) + '(' + params.code + ')' }}
|
|
94
|
+
</div>
|
|
95
|
+
</el-tooltip>
|
|
96
|
+
<div
|
|
97
|
+
v-if="showEnableButton(params)"
|
|
98
|
+
style="
|
|
99
|
+
margin-left: 2px;
|
|
100
|
+
color: #00b42a;
|
|
101
|
+
background-color: #e8ffea;
|
|
102
|
+
width: 68px;
|
|
103
|
+
text-align: center;
|
|
104
|
+
display: inline-block;
|
|
105
|
+
"
|
|
106
|
+
>
|
|
107
|
+
<el-icon>
|
|
108
|
+
<SuccessFilled />
|
|
109
|
+
</el-icon>
|
|
110
|
+
<span :title="getPropValue('subTitle', params)" style="margin-left: 4px">{{
|
|
111
|
+
getPropValue('subTitle', params)
|
|
112
|
+
}}</span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="button-style">
|
|
116
|
+
<div style="padding: 10px; box-sizing: border-box; width: 50px">
|
|
117
|
+
{{ $t('imatrixUIPublicModel.edit') }}
|
|
118
|
+
</div>
|
|
119
|
+
<div style="padding-left: 15px">
|
|
120
|
+
<template v-for="button in operations">
|
|
121
|
+
<template v-if="isShowButton(params, button)">
|
|
122
|
+
<el-tooltip
|
|
123
|
+
:key="button.name"
|
|
124
|
+
v-if="button.icon"
|
|
125
|
+
v-permission="button.permission ? button.permission : 'true'"
|
|
126
|
+
:content="button.name"
|
|
127
|
+
class="item"
|
|
128
|
+
effect="dark"
|
|
129
|
+
placement="top"
|
|
130
|
+
style="background-color: red"
|
|
131
|
+
>
|
|
132
|
+
<el-icon :class="button.icon + ' icons'" @click.stop="buttonClick(button.event, params)">
|
|
133
|
+
<component :is="button.icon" />
|
|
134
|
+
</el-icon>
|
|
135
|
+
</el-tooltip>
|
|
136
|
+
<em
|
|
137
|
+
v-else
|
|
138
|
+
:key="button.name"
|
|
139
|
+
v-permission="button.permission ? button.permission : 'true'"
|
|
140
|
+
:class="button.name + ' icons'"
|
|
141
|
+
@click.stop="buttonClick(button.event, params)"
|
|
142
|
+
>{{ button.name }}
|
|
143
|
+
</em>
|
|
144
|
+
</template>
|
|
145
|
+
</template>
|
|
146
|
+
<slot :name="slotBefore" :params="params" />
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
<div v-if="isShowBottom" style="position: absolute; right: 5%; bottom: 9%">
|
|
150
|
+
<slot :name="slotState" :params="params" />
|
|
151
|
+
<template v-if="isShowEnableState">
|
|
152
|
+
<el-button
|
|
153
|
+
v-if="showEnableButton(params)"
|
|
154
|
+
class="button--default"
|
|
155
|
+
size="default"
|
|
156
|
+
@click.stop="changeState(params)"
|
|
157
|
+
>
|
|
158
|
+
{{ $t('imatrixUIPublicModel.forbidden') }}
|
|
159
|
+
</el-button>
|
|
160
|
+
<el-button v-else size="default" type="primary" @click.stop="changeState(params)">
|
|
161
|
+
{{ $t('imatrixUIPublicModel.startUsing') }}
|
|
162
|
+
</el-button>
|
|
163
|
+
</template>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
<!-- <el-divider />
|
|
209
168
|
<div style="padding: 10px 10px 10px 10px;">
|
|
210
169
|
<div class="bottom clearfix">
|
|
211
170
|
<time class="name">
|
|
@@ -235,986 +194,918 @@
|
|
|
235
194
|
<span :title="getPropValue('subTitle', params)" style="width: 100%">{{ getPropValue('subTitle', params) }}</span>
|
|
236
195
|
</time>
|
|
237
196
|
</div> -->
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
197
|
+
<!--</div>-->
|
|
198
|
+
</el-card>
|
|
199
|
+
</el-col>
|
|
200
|
+
</el-row>
|
|
201
|
+
</div>
|
|
202
|
+
<el-pagination
|
|
203
|
+
v-if="pagination"
|
|
204
|
+
v-model:current-page="currentPage"
|
|
205
|
+
v-model:page-size="pagination.pageSize"
|
|
206
|
+
:layout="pagination.layout"
|
|
207
|
+
:page-sizes="pagination.pageSizes"
|
|
208
|
+
:total="
|
|
209
|
+
pagination.total !== undefined && pagination.total !== '' && pagination.total !== null ? pagination.total : 0
|
|
210
|
+
"
|
|
211
|
+
@size-change="handleSizeChange"
|
|
212
|
+
@current-change="handleCurrentChange"
|
|
213
|
+
/>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
255
216
|
</template>
|
|
256
217
|
|
|
257
218
|
<script>
|
|
258
|
-
import {$emit} from '../../utils/gogocodeTransfer'
|
|
219
|
+
import { $emit } from '../../utils/gogocodeTransfer'
|
|
259
220
|
import customFormatter from './custom-formatter'
|
|
260
221
|
import SearchForm from './search-form.vue'
|
|
261
|
-
import {addDynamicProp, getGridParams, getTableHeight, isHasOptionFunction} from './utils'
|
|
222
|
+
import { addDynamicProp, getGridParams, getTableHeight, isHasOptionFunction } from './utils'
|
|
262
223
|
import store from './store'
|
|
263
224
|
import superGridService from './super-grid-service'
|
|
264
225
|
import apis from './apis'
|
|
265
226
|
import Sortable from 'sortablejs'
|
|
266
227
|
|
|
267
228
|
export default {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
immediate: true,
|
|
388
|
-
deep: true,
|
|
389
|
-
}
|
|
390
|
-
)
|
|
229
|
+
name: 'SuperNineGrid',
|
|
230
|
+
components: {
|
|
231
|
+
SearchForm
|
|
232
|
+
},
|
|
233
|
+
props: {
|
|
234
|
+
code: {
|
|
235
|
+
type: String,
|
|
236
|
+
default: ''
|
|
237
|
+
},
|
|
238
|
+
url: {
|
|
239
|
+
type: String,
|
|
240
|
+
default: ''
|
|
241
|
+
},
|
|
242
|
+
options: {
|
|
243
|
+
type: Object,
|
|
244
|
+
default: function () {
|
|
245
|
+
return {}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
publishVersion: {
|
|
249
|
+
type: Number,
|
|
250
|
+
default: 0
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
data() {
|
|
254
|
+
let mergeFields = []
|
|
255
|
+
if (this.options && this.options.mergeFields && this.options.mergeFields !== '') {
|
|
256
|
+
mergeFields = this.options.mergeFields.split(',')
|
|
257
|
+
}
|
|
258
|
+
const defaultShowImageAction =
|
|
259
|
+
window.$vueApp.config.globalProperties.baseAPI + '/component/super-form/show-image?serverPath='
|
|
260
|
+
const gridId = this.options && this.options.id ? this.options.id : '_nineGrid'
|
|
261
|
+
const storeId = this.code + '~' + gridId
|
|
262
|
+
const isShowRadio = this.options && this.options.showRadio !== undefined ? this.options.showRadio : false
|
|
263
|
+
const titleWidth =
|
|
264
|
+
this.options && this.options.style && this.options.style.titleWidth !== undefined
|
|
265
|
+
? this.options.style.titleWidth
|
|
266
|
+
: '60%'
|
|
267
|
+
return {
|
|
268
|
+
isLoading: false,
|
|
269
|
+
currentPage: 1,
|
|
270
|
+
showColumnConfig: false,
|
|
271
|
+
basicInfo: {
|
|
272
|
+
summary: 'no'
|
|
273
|
+
},
|
|
274
|
+
columns: [],
|
|
275
|
+
pagination: null,
|
|
276
|
+
query: null,
|
|
277
|
+
lineEdit: null,
|
|
278
|
+
gridData: [],
|
|
279
|
+
sortInfo: null,
|
|
280
|
+
pageSize: null,
|
|
281
|
+
showSearch: false,
|
|
282
|
+
height: null,
|
|
283
|
+
isSql: false, // 是否是sql查询
|
|
284
|
+
hasLoadData: false,
|
|
285
|
+
mergeFields,
|
|
286
|
+
hasLoadedColumns: false, // 是否已经加载了列配置
|
|
287
|
+
seen: false,
|
|
288
|
+
current: null,
|
|
289
|
+
isHasCreate: true, // 是否需要新建按钮
|
|
290
|
+
screenBaseUrl: null,
|
|
291
|
+
props: null, // 属性配置
|
|
292
|
+
operations: [], // 指向格子时出现的操作按钮集合
|
|
293
|
+
propCloumns: null, // 属性字段配置详细信息
|
|
294
|
+
multiple: false, // 是否需要多选
|
|
295
|
+
createPermission: 'true', // 新建权限编码,默认是有权限的
|
|
296
|
+
urlToSaveOrder: null, // 拖动格子后台保存接口路径
|
|
297
|
+
selections: [], // 选中的记录集合
|
|
298
|
+
selectionIds: [], // 选中的记录id集合
|
|
299
|
+
selectionModels: {}, // 选中的记录对象
|
|
300
|
+
searchFormContent: null,
|
|
301
|
+
initSearchProps: [], // 初始查询的字段属性名集合
|
|
302
|
+
defaultShowImageAction, // 显示图片的路径
|
|
303
|
+
gridId,
|
|
304
|
+
storeId,
|
|
305
|
+
currentId: null, // 当前点击的记录id
|
|
306
|
+
isShowRadio, // 单选时是否显示单选按钮
|
|
307
|
+
titleStyle: null, // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
|
|
308
|
+
isShowEnableState: false,
|
|
309
|
+
colSpan: 6,
|
|
310
|
+
slotBefore: 'before',
|
|
311
|
+
titleWidth,
|
|
312
|
+
slotState: 'bottom',
|
|
313
|
+
isShowBottom: true
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
computed: {},
|
|
317
|
+
provide() {
|
|
318
|
+
return {}
|
|
319
|
+
},
|
|
320
|
+
created() {
|
|
321
|
+
store.set(this.code + '~' + this.gridId, getGridParams())
|
|
322
|
+
store.set('_nine_list_code', this.code + '~' + this.gridId)
|
|
323
|
+
this.initSetting()
|
|
324
|
+
this.initialize()
|
|
325
|
+
// this.showDemo()
|
|
326
|
+
console.log('%c描述-232041', 'color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px', this.operations)
|
|
327
|
+
},
|
|
328
|
+
mounted() {
|
|
329
|
+
this.$watch(
|
|
330
|
+
'showSearch',
|
|
331
|
+
function (newVal, oldVal) {
|
|
332
|
+
this.$nextTick(() => {
|
|
333
|
+
let tableHeight = getTableHeight(newVal, this.$refs.sf)
|
|
334
|
+
const newHeight = this.resizeHeight()
|
|
335
|
+
if (newHeight) {
|
|
336
|
+
tableHeight = newHeight
|
|
337
|
+
}
|
|
338
|
+
this.height = tableHeight
|
|
339
|
+
})
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
immediate: true,
|
|
343
|
+
deep: true
|
|
344
|
+
}
|
|
345
|
+
)
|
|
391
346
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
if (gridParams.options.extraParam) {
|
|
625
|
-
for (const paramName in gridParams.options.extraParam) {
|
|
626
|
-
param[paramName] = gridParams.options.extraParam[paramName]
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
// 导出需要这两个参数
|
|
631
|
-
gridParams.searchParam = searchParam
|
|
632
|
-
gridParams.url = this.url
|
|
633
|
-
const requestUrl = this.url
|
|
634
|
-
// 缓存查询条件及当前页数
|
|
635
|
-
window.sessionStorage.setItem(
|
|
636
|
-
'searchParam-' + this.storeId,
|
|
637
|
-
JSON.stringify(param)
|
|
638
|
-
)
|
|
639
|
-
this.$http
|
|
640
|
-
.post(requestUrl, param)
|
|
641
|
-
.then((data) => {
|
|
642
|
-
// 对数据做序列化,比如:处理xss攻击
|
|
643
|
-
if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
|
|
644
|
-
const gridData = gridParams.options.gridDataLoaded.call(this, {
|
|
645
|
-
gridData: data.data,
|
|
646
|
-
columns: gridParams.columns,
|
|
647
|
-
})
|
|
648
|
-
if (gridData) {
|
|
649
|
-
this.gridData = gridData
|
|
650
|
-
} else {
|
|
651
|
-
this.gridData = data.data
|
|
652
|
-
}
|
|
653
|
-
} else {
|
|
654
|
-
this.gridData = data.data
|
|
655
|
-
}
|
|
656
|
-
if (!this.gridData) {
|
|
657
|
-
this.gridData = []
|
|
658
|
-
}
|
|
347
|
+
this.$watch(
|
|
348
|
+
'hasLoadData',
|
|
349
|
+
function (newVal, oldVal) {
|
|
350
|
+
if (newVal === true) {
|
|
351
|
+
this.$nextTick(() => {
|
|
352
|
+
// this.rowDrop()
|
|
353
|
+
const gridParams = store.get(this.storeId)
|
|
354
|
+
if (isHasOptionFunction('gridComplete', this.storeId)) {
|
|
355
|
+
gridParams.options.gridComplete.call(this, {
|
|
356
|
+
gridData: this.gridData,
|
|
357
|
+
columns: gridParams.columns,
|
|
358
|
+
superGrid: this.$refs.superGrid
|
|
359
|
+
})
|
|
360
|
+
}
|
|
361
|
+
const newHeight = this.resizeHeight()
|
|
362
|
+
if (newHeight) {
|
|
363
|
+
this.height = newHeight
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
immediate: true,
|
|
370
|
+
deep: true
|
|
371
|
+
}
|
|
372
|
+
)
|
|
373
|
+
},
|
|
374
|
+
methods: {
|
|
375
|
+
...superGridService,
|
|
376
|
+
...apis,
|
|
377
|
+
...customFormatter,
|
|
378
|
+
getTitleStyle(entity) {
|
|
379
|
+
// 九宫格的标题自定义样式
|
|
380
|
+
if (this.options && this.options.titleStyle) {
|
|
381
|
+
return this.options.titleStyle.call(this, entity)
|
|
382
|
+
}
|
|
383
|
+
return { width: '100%' }
|
|
384
|
+
},
|
|
385
|
+
// 获得属性值
|
|
386
|
+
getPropValue(type, entity) {
|
|
387
|
+
let value = ''
|
|
388
|
+
const gridParams = store.get(this.storeId)
|
|
389
|
+
if (type === 'content') {
|
|
390
|
+
let content = ''
|
|
391
|
+
if (isHasOptionFunction('setContent', this.storeId)) {
|
|
392
|
+
content = gridParams.options.getContent.call(this, entity)
|
|
393
|
+
}
|
|
394
|
+
if (content === undefined || content === '') {
|
|
395
|
+
if (this.props && this.props.content) {
|
|
396
|
+
content = this.objectPropValue(entity, this.propCloumns.content, this.props.content)
|
|
397
|
+
} else if (this.props && this.props.title) {
|
|
398
|
+
content = this.objectPropValue(entity, this.propCloumns.title, this.props.title)
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
value = content
|
|
402
|
+
} else if (type === 'title') {
|
|
403
|
+
let content = ''
|
|
404
|
+
if (isHasOptionFunction('setTitle', this.storeId)) {
|
|
405
|
+
content = gridParams.options.setTitle.call(this, entity)
|
|
406
|
+
}
|
|
407
|
+
if (content === undefined || content === '') {
|
|
408
|
+
if (this.props && this.props.title) {
|
|
409
|
+
content = this.objectPropValue(entity, this.propCloumns.title, this.props.title)
|
|
410
|
+
} else if (this.props && this.props.content) {
|
|
411
|
+
content = this.objectPropValue(entity, this.propCloumns.content, this.props.content)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
value = content
|
|
415
|
+
} else if (type === 'subTitle') {
|
|
416
|
+
let content = ''
|
|
417
|
+
if (isHasOptionFunction('setSubTitle', this.storeId)) {
|
|
418
|
+
content = gridParams.options.setSubTitle.call(this, entity)
|
|
419
|
+
}
|
|
420
|
+
if (content === undefined || content === '') {
|
|
421
|
+
if (this.props && this.props.subTitle) {
|
|
422
|
+
content = this.objectPropValue(entity, this.propCloumns.subTitle, this.props.subTitle)
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
value = content
|
|
426
|
+
}
|
|
427
|
+
if (value === undefined) {
|
|
428
|
+
value = ''
|
|
429
|
+
}
|
|
430
|
+
return value
|
|
431
|
+
},
|
|
432
|
+
resizeHeight() {
|
|
433
|
+
const gridParams = store.get(this.storeId)
|
|
434
|
+
if (isHasOptionFunction('resizeHeight', this.storeId)) {
|
|
435
|
+
let searchHeight = 0
|
|
436
|
+
if (this.showSearch === true) {
|
|
437
|
+
if (this.$refs.sf) {
|
|
438
|
+
// 获得查询区高度
|
|
439
|
+
searchHeight = this.$refs.sf.$el.offsetHeight
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return gridParams.options.resizeHeight.call(this, {
|
|
443
|
+
code: this.code,
|
|
444
|
+
height: this.height,
|
|
445
|
+
searchHeight: searchHeight
|
|
446
|
+
})
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
enter(index) {
|
|
450
|
+
this.seen = true
|
|
451
|
+
this.current = index
|
|
452
|
+
},
|
|
453
|
+
leave() {
|
|
454
|
+
this.seen = false
|
|
455
|
+
this.current = null
|
|
456
|
+
},
|
|
457
|
+
initSetting() {
|
|
458
|
+
const gridParams = store.get(this.storeId)
|
|
459
|
+
if (typeof this.options !== 'undefined') {
|
|
460
|
+
Object.assign(gridParams.options, this.options)
|
|
461
|
+
} else {
|
|
462
|
+
gridParams.options = {}
|
|
463
|
+
}
|
|
464
|
+
if (this.options && typeof this.options.isHasCreate !== 'undefined') {
|
|
465
|
+
this.isHasCreate = this.options.isHasCreate
|
|
466
|
+
}
|
|
467
|
+
if (this.options && typeof this.options.props !== 'undefined') {
|
|
468
|
+
this.props = this.options.props
|
|
469
|
+
}
|
|
470
|
+
if (this.options && typeof this.options.operations !== 'undefined') {
|
|
471
|
+
this.operations = this.options.operations
|
|
472
|
+
}
|
|
473
|
+
if (this.options && typeof this.options.createPermission !== 'undefined') {
|
|
474
|
+
this.createPermission = this.options.createPermission
|
|
475
|
+
}
|
|
476
|
+
if (this.options && typeof this.options.multiple !== 'undefined') {
|
|
477
|
+
this.multiple = this.options.multiple
|
|
478
|
+
}
|
|
479
|
+
if (this.options && typeof this.options.isShowEnableState !== 'undefined') {
|
|
480
|
+
this.isShowEnableState = this.options.isShowEnableState
|
|
481
|
+
}
|
|
482
|
+
if (this.options && typeof this.options.colSpan !== 'undefined') {
|
|
483
|
+
this.colSpan = this.options.colSpan
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
// 获得各属性对应的字段配置
|
|
487
|
+
getPropColumns() {
|
|
488
|
+
if (this.columns && this.columns.length > 0) {
|
|
489
|
+
// imageUrl:{column}, content: {column}, title: {}, subTitle:{}
|
|
490
|
+
this.propCloumns = {}
|
|
491
|
+
this.columns.forEach((column) => {
|
|
492
|
+
if (this.props.imageUrl && this.props.imageUrl === column.prop) {
|
|
493
|
+
this.propCloumns.imageUrl = column
|
|
494
|
+
}
|
|
495
|
+
if (this.props.content && this.props.content === column.prop) {
|
|
496
|
+
this.propCloumns.content = column
|
|
497
|
+
}
|
|
498
|
+
if (this.props.title && this.props.title === column.prop) {
|
|
499
|
+
this.propCloumns.title = column
|
|
500
|
+
}
|
|
501
|
+
if (this.props.subTitle && this.props.subTitle === column.prop) {
|
|
502
|
+
this.propCloumns.subTitle = column
|
|
503
|
+
}
|
|
504
|
+
})
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
fetchData(searchParam, isSearch) {
|
|
508
|
+
return new Promise((resolve, reject) => {
|
|
509
|
+
// 刷新页面数据时,把选中集合清空
|
|
510
|
+
this.clearSelections()
|
|
511
|
+
// 获得各属性对应的字段配置
|
|
512
|
+
this.getPropColumns()
|
|
513
|
+
this.isLoading = true
|
|
514
|
+
this.hasLoadData = false
|
|
515
|
+
if (isSearch === undefined || isSearch === false) {
|
|
516
|
+
// 如果不是查询时才需要从缓存中获得结果
|
|
517
|
+
// 如果是刷新当前列表,则需要获得缓存中的window.sessionStorage
|
|
518
|
+
const isRefreshList = window.sessionStorage.getItem('refreshList-' + this.storeId)
|
|
519
|
+
// console.log('fetchData--isRefreshList--', isRefreshList)
|
|
520
|
+
if (isRefreshList !== undefined && isRefreshList === 'true') {
|
|
521
|
+
const searchParamJson = window.sessionStorage.getItem('searchParam-' + this.storeId)
|
|
522
|
+
// console.log('fetchData--searchParamJson--', searchParamJson)
|
|
523
|
+
// console.log('fetchData--pagination--', this.pagination)
|
|
524
|
+
if (searchParamJson !== undefined && searchParamJson !== null && searchParamJson !== '') {
|
|
525
|
+
searchParam = JSON.parse(searchParamJson)
|
|
526
|
+
const pagination = searchParam.pagination
|
|
527
|
+
if (pagination) {
|
|
528
|
+
this.currentPage = pagination.currentPage
|
|
529
|
+
this.pagination.pageSize = pagination.pageSize
|
|
530
|
+
this.pagination.showTotal = pagination.showTotal
|
|
531
|
+
}
|
|
532
|
+
this.getInitSearchForm(searchParam.searchForm)
|
|
533
|
+
// this.searchFormContent = searchParam.searchForm
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
window.sessionStorage.removeItem('refreshList-' + this.storeId)
|
|
538
|
+
if (searchParam === undefined) {
|
|
539
|
+
searchParam = this.getSearchParam()
|
|
540
|
+
}
|
|
541
|
+
const gridParams = store.get(this.storeId)
|
|
542
|
+
let param = searchParam
|
|
543
|
+
if (gridParams.options.extraParam) {
|
|
544
|
+
param = {
|
|
545
|
+
searchParam: searchParam
|
|
546
|
+
}
|
|
547
|
+
if (gridParams.options.extraParam) {
|
|
548
|
+
for (const paramName in gridParams.options.extraParam) {
|
|
549
|
+
param[paramName] = gridParams.options.extraParam[paramName]
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
// 导出需要这两个参数
|
|
554
|
+
gridParams.searchParam = searchParam
|
|
555
|
+
gridParams.url = this.url
|
|
556
|
+
const requestUrl = this.url
|
|
557
|
+
// 缓存查询条件及当前页数
|
|
558
|
+
window.sessionStorage.setItem('searchParam-' + this.storeId, JSON.stringify(param))
|
|
559
|
+
this.$http
|
|
560
|
+
.post(requestUrl, param)
|
|
561
|
+
.then((data) => {
|
|
562
|
+
// 对数据做序列化,比如:处理xss攻击
|
|
563
|
+
if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
|
|
564
|
+
const gridData = gridParams.options.gridDataLoaded.call(this, {
|
|
565
|
+
gridData: data.data,
|
|
566
|
+
columns: gridParams.columns
|
|
567
|
+
})
|
|
568
|
+
if (gridData) {
|
|
569
|
+
this.gridData = gridData
|
|
570
|
+
} else {
|
|
571
|
+
this.gridData = data.data
|
|
572
|
+
}
|
|
573
|
+
} else {
|
|
574
|
+
this.gridData = data.data
|
|
575
|
+
}
|
|
576
|
+
if (!this.gridData) {
|
|
577
|
+
this.gridData = []
|
|
578
|
+
}
|
|
659
579
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
580
|
+
if (this.pagination !== null) {
|
|
581
|
+
this.pagination.total = data.total
|
|
582
|
+
}
|
|
663
583
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
JSON.parse(JSON.stringify(this.gridData))
|
|
668
|
-
)
|
|
584
|
+
gridParams.gridData = this.gridData
|
|
585
|
+
// 完成深拷贝,复制一份对象,行编辑时使用
|
|
586
|
+
gridParams.orgGridData = [].concat(JSON.parse(JSON.stringify(this.gridData)))
|
|
669
587
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
588
|
+
gridParams.pagination = this.pagination
|
|
589
|
+
gridParams.loaded = true
|
|
590
|
+
this.hasLoadData = true
|
|
591
|
+
resolve()
|
|
592
|
+
})
|
|
593
|
+
.catch((error) => {
|
|
594
|
+
if (isHasOptionFunction('loadError', this.storeId)) {
|
|
595
|
+
gridParams.options.loadError.call(this, this.code, error)
|
|
596
|
+
}
|
|
597
|
+
reject(error)
|
|
598
|
+
})
|
|
599
|
+
})
|
|
600
|
+
},
|
|
601
|
+
getLength(paramsData) {
|
|
602
|
+
if (paramsData && paramsData.length > 5) {
|
|
603
|
+
return '(' + paramsData.substring(0, 5) + '...' + ')'
|
|
604
|
+
} else if (paramsData) {
|
|
605
|
+
return '(' + paramsData + ')'
|
|
606
|
+
} else {
|
|
607
|
+
return ''
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
// 获得初始查询条件对象
|
|
611
|
+
getInitSearchForm(searchFormArr) {
|
|
612
|
+
const gridParams = store.get(this.storeId)
|
|
613
|
+
if (searchFormArr && searchFormArr.length > 0) {
|
|
614
|
+
this.searchFormContent = {}
|
|
615
|
+
searchFormArr.forEach((item) => {
|
|
616
|
+
// 获得的是"isDeleted"
|
|
617
|
+
let prop = item.propName
|
|
618
|
+
// 获得的是“deleted”
|
|
619
|
+
const columnProp = item.columnProp
|
|
620
|
+
const dataType = item.dataType
|
|
621
|
+
if (dataType && dataType === 'BOOLEAN') {
|
|
622
|
+
prop = columnProp
|
|
623
|
+
}
|
|
624
|
+
this.initSearchProps.push(prop)
|
|
625
|
+
const propValue = item.propValue
|
|
626
|
+
if (prop.indexOf('.') > 0) {
|
|
627
|
+
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
628
|
+
addDynamicProp(this.searchFormContent, prop, propValue)
|
|
629
|
+
} else {
|
|
630
|
+
this.searchFormContent[prop] = propValue
|
|
631
|
+
}
|
|
632
|
+
})
|
|
633
|
+
gridParams.searchForm = searchFormArr
|
|
634
|
+
// 调用查询api方法,该方法中调用了@showSearch方法,用于控制“查询”按钮改名为“取消查询”
|
|
635
|
+
this.showSearchForm()
|
|
636
|
+
} else {
|
|
637
|
+
gridParams.searchForm = null
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
showDemo() {
|
|
641
|
+
this.isLoading = true
|
|
642
|
+
this.$http
|
|
643
|
+
.get(this.url)
|
|
644
|
+
.then((data) => {
|
|
645
|
+
Object.assign(this, data)
|
|
646
|
+
const gridParams = store.get(this.storeId)
|
|
729
647
|
|
|
730
|
-
|
|
648
|
+
gridParams.listCode = this.code
|
|
731
649
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
650
|
+
gridParams.columns = this.columns
|
|
651
|
+
if (gridParams.columns && this.options.dynamicColumns) {
|
|
652
|
+
for (var i = 0; i < this.options.dynamicColumns.length; i++) {
|
|
653
|
+
this.options.dynamicColumns[i].dynamic = true
|
|
654
|
+
gridParams.columns.push(this.options.dynamicColumns[i])
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
gridParams.lineEdit = this.lineEdit
|
|
658
|
+
gridParams.basicInfo = this.basicInfo
|
|
659
|
+
gridParams.pagination = this.pagination
|
|
660
|
+
gridParams.query = this.query
|
|
743
661
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
} else {
|
|
757
|
-
this.gridData = data.gridData
|
|
758
|
-
}
|
|
662
|
+
this.gridData = data.gridData
|
|
663
|
+
// 对数据做序列化,比如:处理xss攻击
|
|
664
|
+
if (isHasOptionFunction('gridDataLoaded', this.storeId)) {
|
|
665
|
+
const gridData = gridParams.options.gridDataLoaded.call(this, data.gridData)
|
|
666
|
+
if (gridData) {
|
|
667
|
+
this.gridData = gridData
|
|
668
|
+
} else {
|
|
669
|
+
this.gridData = data.gridData
|
|
670
|
+
}
|
|
671
|
+
} else {
|
|
672
|
+
this.gridData = data.gridData
|
|
673
|
+
}
|
|
759
674
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
)
|
|
771
|
-
gridParams.pagination = this.pagination
|
|
675
|
+
if (this.pagination != null) {
|
|
676
|
+
this.pagination.total = data.total
|
|
677
|
+
}
|
|
678
|
+
if (!this.gridData) {
|
|
679
|
+
this.gridData = []
|
|
680
|
+
}
|
|
681
|
+
gridParams.gridData = this.gridData
|
|
682
|
+
// 完成深拷贝,复制一份对象,行编辑时使用
|
|
683
|
+
gridParams.orgGridData = [].concat(JSON.parse(JSON.stringify(this.gridData)))
|
|
684
|
+
gridParams.pagination = this.pagination
|
|
772
685
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
gridParams.searchForm = searchForm
|
|
794
|
-
} else {
|
|
795
|
-
gridParams.searchForm = null
|
|
796
|
-
}
|
|
686
|
+
if (isHasOptionFunction('gridComplete', this.storeId)) {
|
|
687
|
+
gridParams.options.gridComplete.call(this, this.gridData, gridParams.columns)
|
|
688
|
+
}
|
|
689
|
+
})
|
|
690
|
+
.catch((error) => {
|
|
691
|
+
if (isHasOptionFunction('loadError', this.storeId)) {
|
|
692
|
+
const gridParams = store.get(this.storeId)
|
|
693
|
+
gridParams.options.loadError.call(this, this.code, error)
|
|
694
|
+
}
|
|
695
|
+
})
|
|
696
|
+
},
|
|
697
|
+
search(searchForm) {
|
|
698
|
+
const vm = this
|
|
699
|
+
return new Promise((resolve, reject) => {
|
|
700
|
+
const gridParams = store.get(vm.storeId)
|
|
701
|
+
if (typeof searchForm !== 'undefined' && searchForm !== null) {
|
|
702
|
+
gridParams.searchForm = searchForm
|
|
703
|
+
} else {
|
|
704
|
+
gridParams.searchForm = null
|
|
705
|
+
}
|
|
797
706
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
const gridParams = store.get(this.storeId)
|
|
1059
|
-
if (isHasOptionFunction('changeState', this.storeId)) {
|
|
1060
|
-
return gridParams.options.changeState.call(this, entity)
|
|
1061
|
-
}
|
|
1062
|
-
return false
|
|
1063
|
-
},
|
|
1064
|
-
},
|
|
1065
|
-
emits: [
|
|
1066
|
-
'sort-change',
|
|
1067
|
-
,
|
|
1068
|
-
'click',
|
|
1069
|
-
'afterDrag',
|
|
1070
|
-
'unselect',
|
|
1071
|
-
'select',
|
|
1072
|
-
'cancel-search',
|
|
1073
|
-
'add',
|
|
1074
|
-
,
|
|
1075
|
-
],
|
|
707
|
+
vm.fetchData(vm.getSearchParam(), true)
|
|
708
|
+
.then((data) => {
|
|
709
|
+
if (
|
|
710
|
+
gridParams.options !== undefined &&
|
|
711
|
+
gridParams.options.isHiddenSearchForm !== undefined &&
|
|
712
|
+
gridParams.options.isHiddenSearchForm === true
|
|
713
|
+
) {
|
|
714
|
+
// 查询时,是否隐藏查询区域,默认是不隐藏查询区域
|
|
715
|
+
vm.showSearch = false
|
|
716
|
+
$emit(vm, 'cancel-search')
|
|
717
|
+
}
|
|
718
|
+
if (vm.$refs.sf) {
|
|
719
|
+
vm.$refs.sf.loading = false
|
|
720
|
+
}
|
|
721
|
+
resolve(data)
|
|
722
|
+
})
|
|
723
|
+
.catch((error) => {
|
|
724
|
+
if (vm.$refs.sf) {
|
|
725
|
+
vm.$refs.sf.loading = false
|
|
726
|
+
}
|
|
727
|
+
reject(error)
|
|
728
|
+
})
|
|
729
|
+
})
|
|
730
|
+
},
|
|
731
|
+
getSearchParam() {
|
|
732
|
+
const searchParam = {
|
|
733
|
+
code: this.code
|
|
734
|
+
}
|
|
735
|
+
const gridParams = store.get(this.storeId)
|
|
736
|
+
if (this.pagination !== null) {
|
|
737
|
+
const pagination = {
|
|
738
|
+
currentPage: this.currentPage,
|
|
739
|
+
pageSize: this.pagination.pageSize,
|
|
740
|
+
showTotal: this.pagination.showTotal
|
|
741
|
+
}
|
|
742
|
+
if (this.pageSize !== null) {
|
|
743
|
+
// 表示更改了每页显示的数据条数
|
|
744
|
+
pagination.pageSize = this.pageSize
|
|
745
|
+
}
|
|
746
|
+
searchParam.pagination = pagination
|
|
747
|
+
}
|
|
748
|
+
// 排序信息
|
|
749
|
+
if (this.sortInfo !== null) {
|
|
750
|
+
// 表示更改了排序信息
|
|
751
|
+
searchParam.sorts = this.sortInfo
|
|
752
|
+
}
|
|
753
|
+
if (this.mergeFields && this.mergeFields.length > 0) {
|
|
754
|
+
if (!searchParam.sorts) {
|
|
755
|
+
searchParam.sorts = []
|
|
756
|
+
}
|
|
757
|
+
const mergeFieldsArr = []
|
|
758
|
+
for (const mergeField of this.mergeFields) {
|
|
759
|
+
let flag = true
|
|
760
|
+
for (const so of searchParam.sorts) {
|
|
761
|
+
if (so.prop === mergeField) {
|
|
762
|
+
flag = false
|
|
763
|
+
break
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
if (flag) {
|
|
767
|
+
mergeFieldsArr.push({
|
|
768
|
+
prop: mergeField,
|
|
769
|
+
order: 'ascending'
|
|
770
|
+
})
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
mergeFieldsArr.push(...searchParam.sorts)
|
|
774
|
+
searchParam.sorts = mergeFieldsArr
|
|
775
|
+
}
|
|
776
|
+
// 是否有初始过滤条件
|
|
777
|
+
if (gridParams.options && typeof gridParams.options.initSearchForm !== 'undefined') {
|
|
778
|
+
searchParam.initSearchForm = gridParams.options.initSearchForm
|
|
779
|
+
}
|
|
780
|
+
if (typeof gridParams.searchForm !== 'undefined') {
|
|
781
|
+
searchParam.searchForm = gridParams.searchForm
|
|
782
|
+
} else {
|
|
783
|
+
searchParam.searchForm = []
|
|
784
|
+
}
|
|
785
|
+
return searchParam
|
|
786
|
+
},
|
|
787
|
+
handleSizeChange(val) {
|
|
788
|
+
this.pageSize = val
|
|
789
|
+
this.fetchData(this.getSearchParam())
|
|
790
|
+
},
|
|
791
|
+
handleCurrentChange(val) {
|
|
792
|
+
this.fetchData(this.getSearchParam())
|
|
793
|
+
},
|
|
794
|
+
handleSortChange({ column, prop, order }) {
|
|
795
|
+
if (prop !== null) {
|
|
796
|
+
// 当点击第3次时,prop会是空,表示清空排序字段,还原原顺序
|
|
797
|
+
this.sortInfo = [
|
|
798
|
+
{
|
|
799
|
+
prop: prop,
|
|
800
|
+
order: order
|
|
801
|
+
}
|
|
802
|
+
]
|
|
803
|
+
} else {
|
|
804
|
+
this.sortInfo = null
|
|
805
|
+
}
|
|
806
|
+
this.fetchData(this.getSearchParam())
|
|
807
|
+
$emit(this, 'sort-change', { column, prop, order })
|
|
808
|
+
},
|
|
809
|
+
resetSearch() {
|
|
810
|
+
this.search(null, false)
|
|
811
|
+
},
|
|
812
|
+
// 新建事件
|
|
813
|
+
add() {
|
|
814
|
+
$emit(this, 'add')
|
|
815
|
+
},
|
|
816
|
+
// 操作按钮的点击事件
|
|
817
|
+
buttonClick(event, data) {
|
|
818
|
+
if (event) {
|
|
819
|
+
if (typeof event === 'function') {
|
|
820
|
+
event.call(this, data)
|
|
821
|
+
} else {
|
|
822
|
+
$emit(this, event, data)
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
// 点击内容区域的事件
|
|
827
|
+
clickContent(data) {
|
|
828
|
+
this.changeSelect(data)
|
|
829
|
+
$emit(this, 'click', data)
|
|
830
|
+
},
|
|
831
|
+
// 格子拖拽
|
|
832
|
+
rowDrop() {
|
|
833
|
+
if (this.urlToSaveOrder) {
|
|
834
|
+
let urlToSaveOrder = this.urlToSaveOrder
|
|
835
|
+
if (urlToSaveOrder.indexOf('http:') < 0 || urlToSaveOrder.indexOf('https:') < 0) {
|
|
836
|
+
// 表示是相对路径,需要拼接全路径
|
|
837
|
+
let baseURL = window.$vueApp.config.globalProperties.baseURL
|
|
838
|
+
if (baseURL.lastIndexOf('/') === baseURL.length - 1) {
|
|
839
|
+
// 表示以斜线结尾
|
|
840
|
+
// 去掉斜线
|
|
841
|
+
baseURL = baseURL.substring(0, baseURL.length - 1)
|
|
842
|
+
}
|
|
843
|
+
if (urlToSaveOrder.indexOf('/') > 0) {
|
|
844
|
+
// 表示不是以斜线开头,需要开头加“/”
|
|
845
|
+
urlToSaveOrder = '/' + urlToSaveOrder
|
|
846
|
+
}
|
|
847
|
+
urlToSaveOrder = baseURL + urlToSaveOrder
|
|
848
|
+
}
|
|
849
|
+
const tbody = document.querySelector('#' + this.gridId + ' .el-row')
|
|
850
|
+
if (tbody != null) {
|
|
851
|
+
const vm = this
|
|
852
|
+
Sortable.create(tbody, {
|
|
853
|
+
draggable: '.col-content',
|
|
854
|
+
onEnd({ newIndex, oldIndex }) {
|
|
855
|
+
const addCardId = document.querySelector('#' + vm.gridId + ' #_addCardId_')
|
|
856
|
+
if (addCardId != null) {
|
|
857
|
+
// 表示存在新建区域,则序号需要减1
|
|
858
|
+
if (oldIndex > 0) {
|
|
859
|
+
oldIndex = oldIndex - 1
|
|
860
|
+
}
|
|
861
|
+
if (newIndex > 0) {
|
|
862
|
+
newIndex = newIndex - 1
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
const params = {
|
|
866
|
+
oldIndex: oldIndex,
|
|
867
|
+
newIndex: newIndex,
|
|
868
|
+
gridData: vm.gridData
|
|
869
|
+
}
|
|
870
|
+
vm.$http.post(urlToSaveOrder, params).then((data) => {
|
|
871
|
+
const currRow = vm.gridData.splice(oldIndex, 1)[0]
|
|
872
|
+
vm.gridData.splice(newIndex, 0, currRow)
|
|
873
|
+
vm.refresh().then(() => {
|
|
874
|
+
$emit(vm, 'afterDrag', params)
|
|
875
|
+
})
|
|
876
|
+
})
|
|
877
|
+
}
|
|
878
|
+
})
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
// 多选按钮的change事件
|
|
883
|
+
changeChecked(label, index) {
|
|
884
|
+
const entity = this.gridData[index]
|
|
885
|
+
if ((label + '').indexOf('false-') >= 0) {
|
|
886
|
+
// 表示取消勾选记录
|
|
887
|
+
this.unselect(entity)
|
|
888
|
+
} else {
|
|
889
|
+
// 表示勾选记录
|
|
890
|
+
this.select(entity)
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
unselect(entity) {
|
|
894
|
+
const id = entity.id
|
|
895
|
+
const index = this.selectionIds.indexOf(id)
|
|
896
|
+
if (index > -1) {
|
|
897
|
+
this.selections.splice(index, 1)
|
|
898
|
+
this.selectionIds.splice(index, 1)
|
|
899
|
+
}
|
|
900
|
+
$emit(this, 'unselect', entity, this.selections)
|
|
901
|
+
this.selectionModels['select' + id] = 'false-' + id
|
|
902
|
+
// console.log('unselect---this.selections=', this.selections)
|
|
903
|
+
},
|
|
904
|
+
select(entity) {
|
|
905
|
+
const id = entity.id
|
|
906
|
+
if (this.selectionIds.indexOf(id) < 0) {
|
|
907
|
+
this.selectionIds[this.selectionIds.length] = id
|
|
908
|
+
this.selections[this.selections.length] = entity
|
|
909
|
+
}
|
|
910
|
+
$emit(this, 'select', entity, this.selections)
|
|
911
|
+
this.selectionModels['select' + id] = id
|
|
912
|
+
// console.log('select---this.selections=', this.selections)
|
|
913
|
+
},
|
|
914
|
+
// 单选按钮的change事件
|
|
915
|
+
changeSelectWhenRadio(label, index) {
|
|
916
|
+
const entity = this.gridData[index]
|
|
917
|
+
this.selectionIds = []
|
|
918
|
+
this.selections = []
|
|
919
|
+
this.selectionModels = {}
|
|
920
|
+
this.select(entity)
|
|
921
|
+
},
|
|
922
|
+
changeSelect(data) {
|
|
923
|
+
const id = data.id
|
|
924
|
+
if (this.multiple === true) {
|
|
925
|
+
// 多选时
|
|
926
|
+
if (this.selectionIds && this.selectionIds.indexOf(id) >= 0) {
|
|
927
|
+
// 表示需要取消选中
|
|
928
|
+
this.unselect(data)
|
|
929
|
+
} else {
|
|
930
|
+
// 表示需要选中
|
|
931
|
+
this.select(data)
|
|
932
|
+
}
|
|
933
|
+
} else {
|
|
934
|
+
// 单选时
|
|
935
|
+
this.currentId = id
|
|
936
|
+
this.selectionIds = []
|
|
937
|
+
this.selections = []
|
|
938
|
+
this.selectionModels = {}
|
|
939
|
+
this.select(data)
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
isShowButton(entity, button) {
|
|
943
|
+
const val = this.isShowButtonFun(entity, button)
|
|
944
|
+
if (val === undefined) {
|
|
945
|
+
return true
|
|
946
|
+
}
|
|
947
|
+
return val
|
|
948
|
+
},
|
|
949
|
+
// 是否显示启用禁用按钮
|
|
950
|
+
showEnableButton(entity) {
|
|
951
|
+
const gridParams = store.get(this.storeId)
|
|
952
|
+
if (isHasOptionFunction('showEnableButton', this.storeId)) {
|
|
953
|
+
return gridParams.options.showEnableButton.call(this, entity)
|
|
954
|
+
}
|
|
955
|
+
return false
|
|
956
|
+
},
|
|
957
|
+
// 启用禁用按钮显示状态
|
|
958
|
+
changeState(entity) {
|
|
959
|
+
const gridParams = store.get(this.storeId)
|
|
960
|
+
if (isHasOptionFunction('changeState', this.storeId)) {
|
|
961
|
+
return gridParams.options.changeState.call(this, entity)
|
|
962
|
+
}
|
|
963
|
+
return false
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
emits: ['sort-change', , 'click', 'afterDrag', 'unselect', 'select', 'cancel-search', 'add', ,]
|
|
1076
967
|
}
|
|
1077
968
|
</script>
|
|
1078
969
|
|
|
1079
970
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
1080
971
|
.nine-grid-area {
|
|
1081
|
-
|
|
972
|
+
padding: 10px;
|
|
1082
973
|
|
|
1083
|
-
|
|
1084
|
-
|
|
974
|
+
.el-row {
|
|
975
|
+
margin-bottom: 20px;
|
|
1085
976
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
977
|
+
&:last-child {
|
|
978
|
+
margin-bottom: 0;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
1090
981
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
982
|
+
.el-col-5 {
|
|
983
|
+
width: 20%;
|
|
984
|
+
max-width: 20%;
|
|
985
|
+
padding-left: 12px;
|
|
986
|
+
padding-right: 12px;
|
|
987
|
+
}
|
|
1097
988
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
989
|
+
.el-col {
|
|
990
|
+
border-radius: 4px;
|
|
991
|
+
margin-bottom: 10px;
|
|
992
|
+
}
|
|
1102
993
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
994
|
+
.name {
|
|
995
|
+
font-size: 12px;
|
|
996
|
+
color: #555;
|
|
997
|
+
float: left;
|
|
998
|
+
width: 80%;
|
|
999
|
+
text-align: left;
|
|
1000
|
+
}
|
|
1110
1001
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1002
|
+
.bottom {
|
|
1003
|
+
// margin-top: 13px;
|
|
1004
|
+
line-height: 13px;
|
|
1005
|
+
// background: aquamarine;
|
|
1006
|
+
}
|
|
1116
1007
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1008
|
+
.state {
|
|
1009
|
+
font-size: 12px;
|
|
1010
|
+
margin-top: 1.5px;
|
|
1011
|
+
float: right;
|
|
1012
|
+
line-height: 1;
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: right;
|
|
1015
|
+
color: #999;
|
|
1016
|
+
width: 20%;
|
|
1017
|
+
text-align: right;
|
|
1018
|
+
}
|
|
1128
1019
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1020
|
+
.image {
|
|
1021
|
+
width: 100%;
|
|
1022
|
+
display: block;
|
|
1023
|
+
height: 200px;
|
|
1024
|
+
}
|
|
1134
1025
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1026
|
+
.clearfix:before,
|
|
1027
|
+
.clearfix:after {
|
|
1028
|
+
display: table;
|
|
1029
|
+
content: '';
|
|
1030
|
+
}
|
|
1140
1031
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1032
|
+
.clearfix:after {
|
|
1033
|
+
clear: both;
|
|
1034
|
+
}
|
|
1144
1035
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1036
|
+
.input-with-select {
|
|
1037
|
+
// background-color: #fff;
|
|
1038
|
+
width: 200px;
|
|
1039
|
+
float: right;
|
|
1040
|
+
}
|
|
1150
1041
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1042
|
+
.popContainer {
|
|
1043
|
+
position: absolute;
|
|
1044
|
+
width: 23.15%;
|
|
1045
|
+
display: block;
|
|
1046
|
+
height: 200px;
|
|
1047
|
+
//background: rgba(0, 0, 0, 0.5);
|
|
1048
|
+
text-align: right;
|
|
1049
|
+
}
|
|
1159
1050
|
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1051
|
+
.fade-enter-active,
|
|
1052
|
+
.fade-leave-active {
|
|
1053
|
+
transition: opacity 0.5s;
|
|
1054
|
+
}
|
|
1164
1055
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1056
|
+
.fade-enter,
|
|
1057
|
+
.fade-leave-to {
|
|
1058
|
+
opacity: 0;
|
|
1059
|
+
}
|
|
1169
1060
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1061
|
+
.icons {
|
|
1062
|
+
color: #adb5bd;
|
|
1063
|
+
margin: 10px 10px 0px 0px;
|
|
1064
|
+
cursor: pointer;
|
|
1065
|
+
}
|
|
1175
1066
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1067
|
+
.release-status {
|
|
1068
|
+
display: block;
|
|
1069
|
+
width: 8px;
|
|
1070
|
+
height: 8px;
|
|
1071
|
+
margin-right: 8px;
|
|
1072
|
+
border-radius: 100%;
|
|
1073
|
+
}
|
|
1183
1074
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1075
|
+
.add-screen {
|
|
1076
|
+
display: flex;
|
|
1077
|
+
flex-direction: column;
|
|
1078
|
+
justify-content: center;
|
|
1079
|
+
align-items: center;
|
|
1080
|
+
cursor: pointer;
|
|
1081
|
+
height: 160px;
|
|
1082
|
+
// background-color: #fff;
|
|
1083
|
+
// border: 1px solid #7693f5;
|
|
1084
|
+
// box-shadow: 0 2px 8px 0 rgba(104,130,218,.4);
|
|
1085
|
+
color: #666666;
|
|
1086
|
+
font-family: Source Han Sans CN;
|
|
1087
|
+
font-weight: 400;
|
|
1088
|
+
font-size: 14px;
|
|
1089
|
+
line-height: 14px;
|
|
1090
|
+
letter-spacing: 0px;
|
|
1091
|
+
text-align: left;
|
|
1092
|
+
}
|
|
1202
1093
|
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1094
|
+
.el-divider--horizontal {
|
|
1095
|
+
margin: 5px 0;
|
|
1096
|
+
}
|
|
1206
1097
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1098
|
+
.button-style {
|
|
1099
|
+
margin-top: 28px;
|
|
1100
|
+
color: #606266;
|
|
1101
|
+
font-family: Source Han Sans CN;
|
|
1102
|
+
font-weight: 400;
|
|
1103
|
+
font-size: 14px;
|
|
1104
|
+
//line-height: 14px;
|
|
1105
|
+
//letter-spacing: 0px;
|
|
1106
|
+
//text-align: left;
|
|
1107
|
+
display: grid;
|
|
1108
|
+
grid-template-columns: 20% 80%;
|
|
1109
|
+
}
|
|
1219
1110
|
}
|
|
1220
1111
|
</style>
|