agilebuilder-ui 1.1.58-sit5 → 1.1.58-sit6
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/{401-ea226204.js → 401-ee099dad.js} +1 -1
- package/lib/{404-c0ab07f7.js → 404-656a1611.js} +1 -1
- package/lib/{_baseUniq-BXtq6_NW-c6f4f75a.js → _baseUniq-BXtq6_NW-052057b3.js} +2 -2
- package/lib/{arc-Js_tyW10-7c0d9389.js → arc-Js_tyW10-80c1e870.js} +1 -1
- package/lib/architecture-O4VJ6CD3-ZoZ2IAk2-a55a396e.js +11 -0
- package/lib/{architectureDiagram-SUXI7LT5-kyYGGrHN-85825d90.js → architectureDiagram-SUXI7LT5-kyYGGrHN-987bd975.js} +8 -8
- package/lib/{blockDiagram-6J76NXCF-IAr4zDV3-b5d0ea1d.js → blockDiagram-6J76NXCF-IAr4zDV3-17646a2a.js} +7 -7
- package/lib/{c4Diagram-6F6E4RAY-Dv27rXcJ-04a6a12c.js → c4Diagram-6F6E4RAY-Dv27rXcJ-9d36acc3.js} +3 -3
- package/lib/{channel-BBZy6zOT-f02c9a4c.js → channel-BBZy6zOT-7dc6c9e8.js} +1 -1
- package/lib/{chunk-353BL4L5-Dn_Y_Yna-61165aa5.js → chunk-353BL4L5-Dn_Y_Yna-4051ae5e.js} +1 -1
- package/lib/{chunk-67H74DCK-Br5U8bfD-c4e47b0d.js → chunk-67H74DCK-Br5U8bfD-95447665.js} +1 -1
- package/lib/{chunk-AACKK3MU-DH_MKxca-256fce72.js → chunk-AACKK3MU-DH_MKxca-656c4d8a.js} +1 -1
- package/lib/{chunk-BFAMUDN2-DHLCoYMN-22cc8b67.js → chunk-BFAMUDN2-DHLCoYMN-634df933.js} +1 -1
- package/lib/{chunk-E2GYISFI-DQPHyyga-c287edeb.js → chunk-E2GYISFI-DQPHyyga-cff34402.js} +1 -1
- package/lib/{chunk-OW32GOEJ-CQOSE6Bn-85b40fb3.js → chunk-OW32GOEJ-CQOSE6Bn-52201d13.js} +3 -3
- package/lib/{chunk-SKB7J2MH-BlwHRDiW-356fba19.js → chunk-SKB7J2MH-BlwHRDiW-f0ff45b3.js} +1 -1
- package/lib/{chunk-SZ463SBG-DEp8buKJ-4352f1a9.js → chunk-SZ463SBG-DEp8buKJ-6d509490.js} +4 -4
- package/lib/{classDiagram-M3E45YP4-D0ySDe-v-d62a9f9d.js → classDiagram-M3E45YP4-D0ySDe-v-45bdad4e.js} +6 -6
- package/lib/{classDiagram-v2-YAWTLIQI-D0ySDe-v-d62a9f9d.js → classDiagram-v2-YAWTLIQI-D0ySDe-v-45bdad4e.js} +6 -6
- package/lib/{clone-CEJtuQzg-a8543f5d.js → clone-CEJtuQzg-554e246d.js} +1 -1
- package/lib/{dagre-JOIXM2OF-5zx0JY2T-25a90589.js → dagre-JOIXM2OF-5zx0JY2T-95d888be.js} +7 -7
- package/lib/{diagram-5UYTHUR4-C19nyAKc-a3bc4cfd.js → diagram-5UYTHUR4-C19nyAKc-0270cae3.js} +7 -7
- package/lib/{diagram-VMROVX33-DkGwo-hj-374a259a.js → diagram-VMROVX33-DkGwo-hj-85e1adb0.js} +8 -8
- package/lib/{diagram-ZTM2IBQH-CBgHCu9L-56d29b25.js → diagram-ZTM2IBQH-CBgHCu9L-af8c9131.js} +7 -7
- package/lib/{erDiagram-3M52JZNH-cttdAJXW-7396ea7f.js → erDiagram-3M52JZNH-cttdAJXW-1213335f.js} +5 -5
- package/lib/{flowDiagram-KYDEHFYC-9HpsqDdB-8addfe5a.js → flowDiagram-KYDEHFYC-9HpsqDdB-a11787ba.js} +6 -6
- package/lib/{ganttDiagram-EK5VF46D-8QB3ofs6-bcece4aa.js → ganttDiagram-EK5VF46D-8QB3ofs6-6b3f0b52.js} +3 -3
- package/lib/gitGraph-ZV4HHKMB-BSmtVGRu-3f974836.js +11 -0
- package/lib/{gitGraphDiagram-GW3U2K7C-DNzc0Vx_-0ed09191.js → gitGraphDiagram-GW3U2K7C-DNzc0Vx_-18a8fcf7.js} +8 -8
- package/lib/{graph-3zJxsO-i-2a8df7c8.js → graph-3zJxsO-i-5394b336.js} +3 -3
- package/lib/{iframe-page-9cd27dfb.js → iframe-page-25f721c5.js} +1 -1
- package/lib/{index-20147c57.js → index-306f43e3.js} +10 -10
- package/lib/info-63CPKGFF-C8sYWczU-238f0781.js +11 -0
- package/lib/{infoDiagram-LHK5PUON-C-vFFPTf-4f13ee3e.js → infoDiagram-LHK5PUON-C-vFFPTf-d45448b3.js} +6 -6
- package/lib/{journeyDiagram-EWQZEKCU-BJrw4-AG-ffb2c8bc.js → journeyDiagram-EWQZEKCU-BJrw4-AG-cf78d8d2.js} +5 -5
- package/lib/{kanban-definition-ZSS6B67P-BptAnqU--193b87ca.js → kanban-definition-ZSS6B67P-BptAnqU--a832bf31.js} +3 -3
- package/lib/{layout-sGZIJplX-fb85ed3c.js → layout-sGZIJplX-72ca1067.js} +5 -5
- package/lib/{linear-DqgVh5FN-6846d9bb.js → linear-DqgVh5FN-38761045.js} +1 -1
- package/lib/{mermaid-parser.core-CH9ryA1K-43b5a0c4.js → mermaid-parser.core-CH9ryA1K-db327852.js} +12 -12
- package/lib/{mermaid.core-CAqkCmS1-de36f16a.js → mermaid.core-CAqkCmS1-9b94142a.js} +30 -30
- package/lib/{min-BngCxx8g-52e8fadc.js → min-BngCxx8g-487393ff.js} +3 -3
- package/lib/{mindmap-definition-6CBA2TL7-Cp_EeEsh-729c5012.js → mindmap-definition-6CBA2TL7-Cp_EeEsh-02014386.js} +2 -2
- package/lib/packet-HUATNLJX-bfFWFja0-68852f22.js +11 -0
- package/lib/pie-WTHONI2E-QPrWs3SR-440abcf5.js +11 -0
- package/lib/{pieDiagram-NIOCPIFQ-C46Y_4C6-5376fd17.js → pieDiagram-NIOCPIFQ-C46Y_4C6-bc52c2f6.js} +8 -8
- package/lib/{quadrantDiagram-2OG54O6I-Dgf6d6F_-d9211b6a.js → quadrantDiagram-2OG54O6I-Dgf6d6F_-87fb95d1.js} +3 -3
- package/lib/radar-NJJJXTRR-BnUCJhQL-8330072c.js +11 -0
- package/lib/{requirementDiagram-QOLK2EJ7-CSF6N7HA-6a3271b2.js → requirementDiagram-QOLK2EJ7-CSF6N7HA-c1970561.js} +4 -4
- package/lib/{sankeyDiagram-4UZDY2LN-BAHB7dMS-0bab607a.js → sankeyDiagram-4UZDY2LN-BAHB7dMS-d1f40a7b.js} +2 -2
- package/lib/{sequenceDiagram-SKLFT4DO-10gLJ50N-5fcc0610.js → sequenceDiagram-SKLFT4DO-10gLJ50N-a6bd7bd3.js} +4 -4
- package/lib/{stateDiagram-MI5ZYTHO-D6p6nCaj-cb4037d0.js → stateDiagram-MI5ZYTHO-D6p6nCaj-50769c19.js} +9 -9
- package/lib/{stateDiagram-v2-5AN5P6BG-DaN5hC-t-99a35fb7.js → stateDiagram-v2-5AN5P6BG-DaN5hC-t-04a815e2.js} +5 -5
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +2 -2
- package/lib/{tab-content-iframe-index-4bb00c56.js → tab-content-iframe-index-dd6023c7.js} +1 -1
- package/lib/{tab-content-index-593e223b.js → tab-content-index-34a6f736.js} +1 -1
- package/lib/{tache-subprocess-history-c9f9409d.js → tache-subprocess-history-91e45a1c.js} +1 -1
- package/lib/{timeline-definition-MYPXXCX6-gLqnWxDu-6a396147.js → timeline-definition-MYPXXCX6-gLqnWxDu-f09941ad.js} +3 -3
- package/lib/treemap-75Q7IDZK-B2atdfMH-a1f90182.js +11 -0
- package/lib/{xychartDiagram-H2YORKM3-Whqa4ezL-12c091c7.js → xychartDiagram-H2YORKM3-Whqa4ezL-ea641e6f.js} +3 -3
- package/package.json +1 -1
- package/packages/fs-preview/src/fs-preview.vue +12 -4
- package/packages/plugins/export-data-new.js +1 -1
- package/packages/super-grid/src/search-form.vue +744 -806
- package/src/permission.js +2 -2
- package/src/styles/_layout-custom-properties.scss +1 -1
- package/src/styles/theme/dark-blue/checkbox.scss +5 -1
- package/src/styles/theme/dark-blue/index.scss +3 -3
- package/src/styles/theme/dark-blue/sidebar.scss +16 -14
- package/src/styles/theme/dark-blue/table.scss +7 -2
- package/src/styles/theme/forest-green/checkbox.scss +5 -1
- package/src/styles/theme/forest-green/index.scss +3 -3
- package/src/styles/theme/forest-green/sidebar.scss +1 -1
- package/src/styles/theme/forest-green/table.scss +5 -0
- package/src/styles/theme/green/checkbox.scss +5 -1
- package/src/styles/theme/green/index.scss +3 -3
- package/src/styles/theme/green/sidebar.scss +30 -23
- package/src/styles/theme/green/table.scss +7 -2
- package/src/styles/theme/ocean-blue/checkbox.scss +5 -1
- package/src/styles/theme/ocean-blue/index.scss +7 -3
- package/src/styles/theme/ocean-blue/sidebar.scss +1 -1
- package/src/styles/theme/ocean-blue/table.scss +7 -2
- package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +1 -1
- package/src/utils/request.js +2 -2
- package/lib/architecture-O4VJ6CD3-ZoZ2IAk2-9bcb267f.js +0 -11
- package/lib/gitGraph-ZV4HHKMB-BSmtVGRu-434c5315.js +0 -11
- package/lib/info-63CPKGFF-C8sYWczU-6912ccc5.js +0 -11
- package/lib/packet-HUATNLJX-bfFWFja0-73e9f993.js +0 -11
- package/lib/pie-WTHONI2E-QPrWs3SR-29bccd3d.js +0 -11
- package/lib/radar-NJJJXTRR-BnUCJhQL-db833aad.js +0 -11
- package/lib/treemap-75Q7IDZK-B2atdfMH-298d56fb.js +0 -11
|
@@ -1,845 +1,783 @@
|
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
<el-button
|
|
109
|
-
v-if="searchType === 'normal'"
|
|
110
|
-
size="default"
|
|
111
|
-
@click="searchType = 'advanced'"
|
|
112
|
-
>
|
|
113
|
-
{{ $t('imatrixUIPublicModel.switchToAdvancedQuery') }}
|
|
114
|
-
</el-button>
|
|
115
|
-
</span>
|
|
116
|
-
</div>
|
|
117
|
-
</template>
|
|
118
|
-
<search-condition-input
|
|
119
|
-
v-if="isShowSearchCondition"
|
|
120
|
-
@close="saveConditionValue"
|
|
121
|
-
/>
|
|
122
|
-
</div>
|
|
2
|
+
<div class="amb-agilebuilder-search-form-view">
|
|
3
|
+
<el-drawer
|
|
4
|
+
v-if="isMobile"
|
|
5
|
+
v-model="isShowMobileForm"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
:close-on-press-escape="false"
|
|
8
|
+
direction="rtl"
|
|
9
|
+
size="50%"
|
|
10
|
+
@close="closeMobileSearch()"
|
|
11
|
+
>
|
|
12
|
+
<div class="search-condition-mobile">
|
|
13
|
+
<search-condition-list
|
|
14
|
+
v-if="searchConditions.length > 0"
|
|
15
|
+
ref="searchConditionList"
|
|
16
|
+
:search-conditions="searchConditions"
|
|
17
|
+
:search-type="searchType"
|
|
18
|
+
@remove-condition="removeCondition"
|
|
19
|
+
@select-condition="selectCondition"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
<search-form-mobile
|
|
23
|
+
v-if="isMobile && searchType === 'normal'"
|
|
24
|
+
ref="searchFormMobile"
|
|
25
|
+
:code="code"
|
|
26
|
+
:is-sql="isSql"
|
|
27
|
+
:load-complete-query="loadCompleteQuery"
|
|
28
|
+
:query="query"
|
|
29
|
+
:rules="rules"
|
|
30
|
+
:search-form="searchForm"
|
|
31
|
+
:searchable-columns="searchableColumns"
|
|
32
|
+
@submit-form="submitForm('searchForm')"
|
|
33
|
+
@reset-form="resetForm('searchForm')"
|
|
34
|
+
@save-condition="saveCondition()"
|
|
35
|
+
/>
|
|
36
|
+
</el-drawer>
|
|
37
|
+
<template v-else>
|
|
38
|
+
<search-condition-list
|
|
39
|
+
v-if="searchConditions.length > 0"
|
|
40
|
+
ref="searchConditionList"
|
|
41
|
+
:search-conditions="searchConditions"
|
|
42
|
+
:search-type="searchType"
|
|
43
|
+
@remove-condition="removeCondition"
|
|
44
|
+
@select-condition="selectCondition"
|
|
45
|
+
/>
|
|
46
|
+
<search-form-ordinary-search
|
|
47
|
+
v-if="searchType === 'normal'"
|
|
48
|
+
ref="searchFormOrdinarySearch"
|
|
49
|
+
:code="code"
|
|
50
|
+
:field-num="fieldNum"
|
|
51
|
+
:is-sql="isSql"
|
|
52
|
+
:label-width="labelWidth"
|
|
53
|
+
:load-complete-query="loadCompleteQuery"
|
|
54
|
+
:query="query"
|
|
55
|
+
:row-num="rowNum"
|
|
56
|
+
:rules="rules"
|
|
57
|
+
:search-form="searchForm"
|
|
58
|
+
:searchable-columns="searchableColumns"
|
|
59
|
+
:span-num="spanNum"
|
|
60
|
+
@submit-form="submitForm('searchForm')"
|
|
61
|
+
@reset-form="resetForm('searchForm')"
|
|
62
|
+
@save-condition="saveCondition()"
|
|
63
|
+
@open-fold="openFold"
|
|
64
|
+
/>
|
|
65
|
+
<search-form-advanced-query
|
|
66
|
+
v-if="searchType === 'advanced'"
|
|
67
|
+
ref="searchFormAdvancedQuery"
|
|
68
|
+
:code="code"
|
|
69
|
+
:is-sql="isSql"
|
|
70
|
+
:prop-map="propMap"
|
|
71
|
+
:search-form-list="searchFormList"
|
|
72
|
+
:searchable-columns="advancedQueryColumns"
|
|
73
|
+
style="padding-bottom: 10px"
|
|
74
|
+
@resetForm="resetSearchFormList"
|
|
75
|
+
/>
|
|
76
|
+
<div v-if="searchType === 'advanced'" style="padding-top: 10px; padding-bottom: 10px; text-align: center">
|
|
77
|
+
<el-button :loading="loading" size="default" type="primary" @click="submitForm('searchForm')">
|
|
78
|
+
{{ $t('imatrixUIPublicModel.sure') }}
|
|
79
|
+
</el-button>
|
|
80
|
+
<el-button :loading="loading" size="default" @click="resetForm('searchForm')">
|
|
81
|
+
{{ $t('imatrixUIPublicModel.reset') }}
|
|
82
|
+
</el-button>
|
|
83
|
+
<el-button size="default" @click="saveCondition">
|
|
84
|
+
{{ $t('superGrid.saveCondition') }}
|
|
85
|
+
</el-button>
|
|
86
|
+
<span
|
|
87
|
+
v-if="
|
|
88
|
+
advancedQuery !== null &&
|
|
89
|
+
advancedQuery !== undefined &&
|
|
90
|
+
advancedQuery === true &&
|
|
91
|
+
normalQuery !== null &&
|
|
92
|
+
normalQuery !== undefined &&
|
|
93
|
+
normalQuery === true
|
|
94
|
+
"
|
|
95
|
+
style="margin-left: 10px"
|
|
96
|
+
>
|
|
97
|
+
<el-button v-if="searchType === 'advanced'" size="default" @click="searchType = 'normal'">
|
|
98
|
+
{{ $t('imatrixUIPublicModel.switchToNormalQuery') }}
|
|
99
|
+
</el-button>
|
|
100
|
+
<el-button v-if="searchType === 'normal'" size="default" @click="searchType = 'advanced'">
|
|
101
|
+
{{ $t('imatrixUIPublicModel.switchToAdvancedQuery') }}
|
|
102
|
+
</el-button>
|
|
103
|
+
</span>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
<search-condition-input v-if="isShowSearchCondition" @close="saveConditionValue" />
|
|
107
|
+
</div>
|
|
123
108
|
</template>
|
|
124
109
|
|
|
125
110
|
<script>
|
|
126
|
-
import {$on, $off, $once, $emit} from '../../utils/gogocodeTransfer'
|
|
111
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
127
112
|
import searchMethods from './search-methods'
|
|
128
113
|
// import searchFormNumber from './search-form-number.vue'
|
|
129
114
|
import searchFormOrdinarySearch from './search-form-ordinarySearch.vue'
|
|
130
115
|
import searchFormAdvancedQuery from './search-form-advancedQuery.vue'
|
|
131
116
|
import store from './store'
|
|
132
117
|
// import { isOptionFunction, getSearchObject } from './utils'
|
|
133
|
-
import {addDynamicProp, addDynamicPropDateSection} from './utils'
|
|
118
|
+
import { addDynamicProp, addDynamicPropDateSection } from './utils'
|
|
134
119
|
import * as Vue from 'vue'
|
|
135
120
|
import SearchConditionInput from './search-condition-input.vue'
|
|
136
121
|
import SearchConditionList from './search-condition-list.vue'
|
|
137
122
|
import SearchFormMobile from './search-form-mobile.vue'
|
|
138
|
-
import {isMobileBrowser} from '../../../src/utils/common-util'
|
|
123
|
+
import { isMobileBrowser } from '../../../src/utils/common-util'
|
|
139
124
|
|
|
140
125
|
export default {
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
126
|
+
name: 'SearchForm',
|
|
127
|
+
components: {
|
|
128
|
+
// searchFormNumber,
|
|
129
|
+
SearchConditionInput,
|
|
130
|
+
SearchConditionList,
|
|
131
|
+
searchFormOrdinarySearch,
|
|
132
|
+
searchFormAdvancedQuery,
|
|
133
|
+
SearchFormMobile
|
|
134
|
+
},
|
|
135
|
+
provide() {
|
|
136
|
+
return {
|
|
137
|
+
getListToolbarFormData: () => ({
|
|
138
|
+
listToolbarFormData: this.listToolbarFormData
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
props: {
|
|
143
|
+
columns: {
|
|
144
|
+
type: Array,
|
|
145
|
+
default: null
|
|
146
|
+
},
|
|
147
|
+
code: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: null
|
|
150
|
+
},
|
|
151
|
+
url: {
|
|
152
|
+
type: String,
|
|
153
|
+
default: null
|
|
154
|
+
},
|
|
155
|
+
pagination: {
|
|
156
|
+
type: Object,
|
|
157
|
+
default: null
|
|
158
|
+
},
|
|
159
|
+
query: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default: null
|
|
162
|
+
},
|
|
163
|
+
searchParam: {
|
|
164
|
+
type: Object,
|
|
165
|
+
default: null
|
|
166
|
+
},
|
|
167
|
+
initSearchProps: {
|
|
168
|
+
type: Array,
|
|
169
|
+
default: null
|
|
170
|
+
},
|
|
171
|
+
isSql: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
default: false
|
|
174
|
+
},
|
|
175
|
+
searchFormInfo: {
|
|
176
|
+
type: Object,
|
|
177
|
+
default: () => {
|
|
178
|
+
return {}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
loadCompleteQuery: {
|
|
182
|
+
type: Boolean,
|
|
183
|
+
default: false
|
|
184
|
+
},
|
|
185
|
+
listToolbarFormData: {
|
|
186
|
+
type: Object,
|
|
187
|
+
default: null
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
data() {
|
|
191
|
+
const customComponentNames = new Set()
|
|
192
|
+
const gridParams = store.get(this.code)
|
|
193
|
+
const propMap = {}
|
|
194
|
+
let searchForm = {}
|
|
195
|
+
if (this.searchParam !== null) {
|
|
196
|
+
searchForm = JSON.parse(JSON.stringify(this.searchParam))
|
|
197
|
+
}
|
|
198
|
+
const searchColumns = this.getSearchableColumns(null, null, propMap)
|
|
199
|
+
if (this.initSearchProps === undefined || this.initSearchProps === null) {
|
|
200
|
+
this.initSearchProps = []
|
|
201
|
+
}
|
|
202
|
+
searchColumns.forEach((column) => {
|
|
203
|
+
// propMap[column.prop] = column
|
|
204
|
+
if (this.initSearchProps.indexOf(column.prop) < 0) {
|
|
205
|
+
// 表示没有默认初始查询字段
|
|
206
|
+
if (column.prop && column.prop.indexOf('.') > 0) {
|
|
207
|
+
if (column.componentType === 'dateSection') {
|
|
208
|
+
addDynamicPropDateSection(searchForm, column.prop)
|
|
209
|
+
} else {
|
|
210
|
+
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
211
|
+
addDynamicProp(searchForm, column.prop)
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
if (column.componentType === 'dateSection') {
|
|
215
|
+
searchForm[column.prop] = [new Date(), new Date()]
|
|
216
|
+
} else if (column.componentType === 'yearRange') {
|
|
217
|
+
searchForm[column.prop] = ['', '']
|
|
218
|
+
} else {
|
|
219
|
+
// 去掉该代码,是因为如果有该代码,会导致初始为空的文本框input组件无法输入值
|
|
220
|
+
// searchForm[column.prop] = null
|
|
221
|
+
}
|
|
222
|
+
this.setDefaultQueryValue(column, searchForm)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
})
|
|
241
226
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
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
|
-
if (searchFormArr && searchFormArr.length > 0) {
|
|
713
|
-
const searchForm = {}
|
|
714
|
-
const initSearchProps = []
|
|
715
|
-
searchFormArr.forEach((item) => {
|
|
716
|
-
// 获得的是"isDeleted"
|
|
717
|
-
let prop = item.propName
|
|
718
|
-
// 获得的是“deleted”
|
|
719
|
-
const columnProp = item.columnProp
|
|
720
|
-
const dataType = item.dataType
|
|
721
|
-
if (dataType && dataType === 'BOOLEAN' && columnProp) {
|
|
722
|
-
prop = columnProp
|
|
723
|
-
}
|
|
724
|
-
if (initSearchProps.indexOf(prop) === -1) {
|
|
725
|
-
initSearchProps.push(prop)
|
|
726
|
-
}
|
|
727
|
-
const propValue = item.propValue
|
|
728
|
-
if (prop && prop.indexOf('.') > 0) {
|
|
729
|
-
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
730
|
-
addDynamicProp(searchForm, prop, propValue)
|
|
731
|
-
} else {
|
|
732
|
-
let isRangeQueryValue = false
|
|
733
|
-
if (dataType && (dataType === 'DATE' || dataType === 'TIME')) {
|
|
734
|
-
if (item.startValue && item.endValue) {
|
|
735
|
-
isRangeQueryValue = true
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
if (isRangeQueryValue) {
|
|
739
|
-
searchForm[prop] = [
|
|
740
|
-
new Date(item.startValue),
|
|
741
|
-
new Date(item.endValue),
|
|
742
|
-
]
|
|
743
|
-
} else {
|
|
744
|
-
if (searchForm[prop]) {
|
|
745
|
-
if (searchForm[prop] instanceof Array) {
|
|
746
|
-
searchForm[prop].push(propValue)
|
|
747
|
-
} else {
|
|
748
|
-
searchForm[prop] = [searchForm[prop], propValue]
|
|
749
|
-
}
|
|
750
|
-
} else {
|
|
751
|
-
searchForm[prop] = propValue
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
})
|
|
227
|
+
const isMobile = isMobileBrowser()
|
|
228
|
+
let canShowMobileSearch = false
|
|
229
|
+
if (isMobile && searchColumns && searchColumns.length > 0) {
|
|
230
|
+
// 如果是移动端,且有查询字段,则新页面需要显示“查询”按钮
|
|
231
|
+
canShowMobileSearch = true
|
|
232
|
+
}
|
|
233
|
+
const spanNum = this.getSpanNum(searchColumns)
|
|
234
|
+
const fieldNum = this.getFieldNumPerRow(searchColumns)
|
|
235
|
+
const rowNum = Math.ceil(searchColumns.length / fieldNum)
|
|
236
|
+
const advancedQuery = this.query.advancedQuery
|
|
237
|
+
const normalQuery = this.query.normalQuery
|
|
238
|
+
// console.log('searchColumns.length=' + searchColumns.length + ',fieldNum=' + fieldNum + ',rowNum=' + rowNum)
|
|
239
|
+
// // -2是把
|
|
240
|
+
// const dateSpanNum = (spanNum - 2) / 2
|
|
241
|
+
return {
|
|
242
|
+
searchForm,
|
|
243
|
+
rules: {},
|
|
244
|
+
searchParams: [],
|
|
245
|
+
labelWidth:
|
|
246
|
+
gridParams.options.search && gridParams.options.search.labelWidth
|
|
247
|
+
? gridParams.options.search.labelWidth
|
|
248
|
+
: '80px',
|
|
249
|
+
customComponentNames: customComponentNames,
|
|
250
|
+
componentName: '',
|
|
251
|
+
spanNum: spanNum,
|
|
252
|
+
fieldNum: fieldNum, // 每行放的字段个数
|
|
253
|
+
rowNum: rowNum, // 一共有几行
|
|
254
|
+
loading: false, // 是否正在查询,默认时否
|
|
255
|
+
isShowSearchCondition: false,
|
|
256
|
+
searchConditions: [],
|
|
257
|
+
propMap,
|
|
258
|
+
advancedQuery,
|
|
259
|
+
normalQuery,
|
|
260
|
+
searchFormList: [],
|
|
261
|
+
searchType: null,
|
|
262
|
+
isMobile, // 是否是移动端
|
|
263
|
+
isShowMobileForm: true, // 是否显示表单
|
|
264
|
+
canShowMobileSearch
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
computed: {
|
|
268
|
+
searchableColumns() {
|
|
269
|
+
return this.getSearchableColumns()
|
|
270
|
+
},
|
|
271
|
+
advancedQueryColumns() {
|
|
272
|
+
return this.getAdvancedQueryColumns()
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
watch: {
|
|
276
|
+
searchForm: {
|
|
277
|
+
deep: true,
|
|
278
|
+
handler(val) {
|
|
279
|
+
this.searchFormInfo['data'] = val
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
created() {
|
|
284
|
+
this.listSearchConditions()
|
|
285
|
+
if (this.normalQuery) {
|
|
286
|
+
this.searchType = 'normal'
|
|
287
|
+
} else if (this.advancedQuery) {
|
|
288
|
+
this.searchType = 'advanced'
|
|
289
|
+
}
|
|
290
|
+
console.log('this.canShowMobileSearch----', this.canShowMobileSearch)
|
|
291
|
+
if (this.canShowMobileSearch) {
|
|
292
|
+
// 如果是移动端,且有查询字段,则新页面需要显示“查询”按钮
|
|
293
|
+
this.$emit('can-show-mobile-search')
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
methods: {
|
|
297
|
+
...searchMethods,
|
|
298
|
+
// 每行放的字段个数
|
|
299
|
+
getFieldNumPerRow(searchColumns) {
|
|
300
|
+
let myFieldNum
|
|
301
|
+
if (searchColumns && searchColumns.length === 1) {
|
|
302
|
+
myFieldNum = 2
|
|
303
|
+
} else {
|
|
304
|
+
const gridParams = store.get(this.code)
|
|
305
|
+
myFieldNum =
|
|
306
|
+
gridParams.options.search && gridParams.options.search.fieldNum ? gridParams.options.search.fieldNum : 3
|
|
307
|
+
}
|
|
308
|
+
return myFieldNum
|
|
309
|
+
},
|
|
310
|
+
// 根据每行显示的字段个数,确定栅栏个数,默认是4个字段。最多就只能放6个字段
|
|
311
|
+
getSpanNum(searchColumns) {
|
|
312
|
+
const fieldNum = this.getFieldNumPerRow(searchColumns)
|
|
313
|
+
if (fieldNum === 1) {
|
|
314
|
+
return 22
|
|
315
|
+
} else if (fieldNum === 2) {
|
|
316
|
+
return 12
|
|
317
|
+
} else if (fieldNum === 3) {
|
|
318
|
+
return 8
|
|
319
|
+
} else if (fieldNum === 4) {
|
|
320
|
+
return 6
|
|
321
|
+
} else {
|
|
322
|
+
// 6个字段
|
|
323
|
+
return 4
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
setValueToModelProp(prop, value, componentName, index) {
|
|
327
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
328
|
+
const parentOjbect = this.getParentObject(prop)
|
|
329
|
+
// 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
|
|
330
|
+
if (index != null && index !== undefined) {
|
|
331
|
+
// parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
|
|
332
|
+
parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)][index] = value
|
|
333
|
+
} else {
|
|
334
|
+
parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)] = value
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
if (index != null && index !== undefined) {
|
|
338
|
+
this.searchForm[prop][index] = value
|
|
339
|
+
} else {
|
|
340
|
+
this.searchForm[prop] = value
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
getAdvancedQueryColumns(columns, searchColumns, propMap) {
|
|
345
|
+
if (!this.customComponentNames) {
|
|
346
|
+
this.customComponentNames = new Set()
|
|
347
|
+
}
|
|
348
|
+
if (!searchColumns) {
|
|
349
|
+
searchColumns = []
|
|
350
|
+
}
|
|
351
|
+
if (!columns) {
|
|
352
|
+
columns = this.columns
|
|
353
|
+
}
|
|
354
|
+
for (let i = 0; i < columns.length; i++) {
|
|
355
|
+
const column = columns[i]
|
|
356
|
+
if (propMap) {
|
|
357
|
+
propMap[column.prop] = column
|
|
358
|
+
}
|
|
359
|
+
if (column.prop === '$index' || column.prop === '$selection' || column.dynamic) {
|
|
360
|
+
// 序号和复选框列、动态列 不属于该组件的查询字段
|
|
361
|
+
continue
|
|
362
|
+
}
|
|
363
|
+
if (column.groupHeader) {
|
|
364
|
+
// 组合表头中子表头的字段查询
|
|
365
|
+
this.getSearchableColumns(column.children, searchColumns, propMap)
|
|
366
|
+
} else {
|
|
367
|
+
if (column.queryType === 'advanced' && !column.custom && column.prop !== '') {
|
|
368
|
+
// 表示是普通查询,且不是占位符列,是查询字段
|
|
369
|
+
if (typeof column.componentType === 'undefined' || column.componentType === '') {
|
|
370
|
+
column.componentType = 'input'
|
|
371
|
+
}
|
|
372
|
+
if (column.querySetting && column.querySetting !== '') {
|
|
373
|
+
const querySetting = JSON.parse(column.querySetting)
|
|
374
|
+
if (querySetting.width) {
|
|
375
|
+
column.searchControlWidth = 'width:' + querySetting.width + 'px'
|
|
376
|
+
}
|
|
377
|
+
if (querySetting.labelWidth) {
|
|
378
|
+
column.searchLabelWidth = querySetting.labelWidth + 'px'
|
|
379
|
+
}
|
|
380
|
+
if (querySetting.label) {
|
|
381
|
+
column.searchLabel = querySetting.label
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
// 行编辑时自定义编辑组件
|
|
385
|
+
if (column.componentType && column.componentType.indexOf('custom:') >= 0) {
|
|
386
|
+
column.componentName = column.componentType.substring(column.componentType.indexOf(':') + 1)
|
|
387
|
+
this.customComponentNames.add(column.componentName)
|
|
388
|
+
} else {
|
|
389
|
+
column.componentName = ''
|
|
390
|
+
}
|
|
391
|
+
// this.$set(this.propMap, column.prop, column)
|
|
392
|
+
// this.propMap[column.prop] = column
|
|
393
|
+
searchColumns.push(column)
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return searchColumns
|
|
398
|
+
},
|
|
399
|
+
getSearchableColumns(columns, searchColumns, propMap) {
|
|
400
|
+
if (!this.customComponentNames) {
|
|
401
|
+
this.customComponentNames = new Set()
|
|
402
|
+
}
|
|
403
|
+
if (!searchColumns) {
|
|
404
|
+
searchColumns = []
|
|
405
|
+
}
|
|
406
|
+
if (!columns) {
|
|
407
|
+
columns = this.columns
|
|
408
|
+
}
|
|
409
|
+
for (let i = 0; i < columns.length; i++) {
|
|
410
|
+
const column = columns[i]
|
|
411
|
+
if (propMap) {
|
|
412
|
+
propMap[column.prop] = column
|
|
413
|
+
}
|
|
414
|
+
if (column.prop === '$index' || column.prop === '$selection' || column.dynamic) {
|
|
415
|
+
// 序号和复选框列、动态列 不属于该组件的查询字段
|
|
416
|
+
continue
|
|
417
|
+
}
|
|
418
|
+
if (column.groupHeader) {
|
|
419
|
+
// 组合表头中子表头的字段查询
|
|
420
|
+
this.getSearchableColumns(column.children, searchColumns, propMap)
|
|
421
|
+
} else {
|
|
422
|
+
if (column.queryType === 'normal' && !column.custom && column.prop !== '') {
|
|
423
|
+
// 表示是普通查询,且不是占位符列,是查询字段
|
|
424
|
+
if (typeof column.componentType === 'undefined' || column.componentType === '') {
|
|
425
|
+
column.componentType = 'input'
|
|
426
|
+
}
|
|
427
|
+
if (column.querySetting && column.querySetting !== '') {
|
|
428
|
+
const querySetting = JSON.parse(column.querySetting)
|
|
429
|
+
if (querySetting.width) {
|
|
430
|
+
column.searchControlWidth = 'width:' + querySetting.width + 'px'
|
|
431
|
+
}
|
|
432
|
+
if (querySetting.labelWidth) {
|
|
433
|
+
column.searchLabelWidth = querySetting.labelWidth + 'px'
|
|
434
|
+
}
|
|
435
|
+
if (querySetting.label) {
|
|
436
|
+
column.searchLabel = querySetting.label
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// 行编辑时自定义编辑组件
|
|
440
|
+
if (column.componentType && column.componentType.indexOf('custom:') >= 0) {
|
|
441
|
+
column.componentName = column.componentType.substring(column.componentType.indexOf(':') + 1)
|
|
442
|
+
this.customComponentNames.add(column.componentName)
|
|
443
|
+
} else {
|
|
444
|
+
column.componentName = ''
|
|
445
|
+
}
|
|
446
|
+
// this.$set(this.propMap, column.prop, column)
|
|
447
|
+
// this.propMap[column.prop] = column
|
|
448
|
+
searchColumns.push(column)
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return searchColumns
|
|
453
|
+
},
|
|
454
|
+
customComponent(column) {
|
|
455
|
+
const gridParams = store.get(this.code)
|
|
456
|
+
if (column.componentName && column.componentName !== '') {
|
|
457
|
+
this.customComponentNames.add(column.componentName)
|
|
458
|
+
return true
|
|
459
|
+
}
|
|
460
|
+
if (
|
|
461
|
+
(!column.componentName || column.componentName === '') &&
|
|
462
|
+
gridParams.options &&
|
|
463
|
+
gridParams.options.search &&
|
|
464
|
+
gridParams.options.search.customSearchElements
|
|
465
|
+
) {
|
|
466
|
+
// 定义了自定义查询组件
|
|
467
|
+
const propSearchEle = gridParams.options.search.customSearchElements[column.prop]
|
|
468
|
+
// console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
|
|
469
|
+
if (propSearchEle) {
|
|
470
|
+
column.componentName = 'custom-' + column.prop
|
|
471
|
+
const component = propSearchEle.call(this, column)
|
|
472
|
+
// console.log('customComponent-customSearchElements-')
|
|
473
|
+
if (component) {
|
|
474
|
+
this.customComponentNames.add(column.componentName)
|
|
475
|
+
window.$vueApp.component(column.componentName, component)
|
|
476
|
+
return true
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return false
|
|
481
|
+
},
|
|
482
|
+
submitForm() {
|
|
483
|
+
if (this.isMobile) {
|
|
484
|
+
this.$refs.searchFormMobile.validateForm().then((valid) => {
|
|
485
|
+
if (valid) {
|
|
486
|
+
// this.loading = true
|
|
487
|
+
this.searchParams = this.packageSearchParam()
|
|
488
|
+
$emit(this, 'search', this.searchParams)
|
|
489
|
+
} else {
|
|
490
|
+
return false
|
|
491
|
+
}
|
|
492
|
+
})
|
|
493
|
+
} else if (this.searchType === 'normal') {
|
|
494
|
+
this.$refs.searchFormOrdinarySearch.validateForm().then((valid) => {
|
|
495
|
+
if (valid) {
|
|
496
|
+
// this.loading = true
|
|
497
|
+
this.searchParams = this.packageSearchParam()
|
|
498
|
+
$emit(this, 'search', this.searchParams)
|
|
499
|
+
} else {
|
|
500
|
+
return false
|
|
501
|
+
}
|
|
502
|
+
})
|
|
503
|
+
} else if (this.searchType === 'advanced') {
|
|
504
|
+
this.$refs.searchFormAdvancedQuery.validateForm().then((valid) => {
|
|
505
|
+
if (valid) {
|
|
506
|
+
this.loading = true
|
|
507
|
+
this.searchParams = this.packageSearchParam()
|
|
508
|
+
$emit(this, 'search', this.searchParams)
|
|
509
|
+
} else {
|
|
510
|
+
return false
|
|
511
|
+
}
|
|
512
|
+
})
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
resetForm() {
|
|
516
|
+
if (this.$refs.searchConditionList) {
|
|
517
|
+
this.$refs.searchConditionList.editConditionId = null
|
|
518
|
+
}
|
|
519
|
+
if (this.isMobile) {
|
|
520
|
+
this.$refs.searchFormMobile.resetForm()
|
|
521
|
+
} else if (this.searchType === 'normal') {
|
|
522
|
+
this.$refs.searchFormOrdinarySearch.resetForm()
|
|
523
|
+
} else if (this.searchType === 'advanced') {
|
|
524
|
+
this.$refs.searchFormAdvancedQuery.resetForm()
|
|
525
|
+
$emit(this, 'reset')
|
|
526
|
+
}
|
|
527
|
+
// 数值区间组件重置时无法清空值问题
|
|
528
|
+
eventBus.$emit('reset')
|
|
529
|
+
// 子组件重置完成后调用reset方法 同步执行
|
|
530
|
+
// this.$emit('reset')
|
|
531
|
+
},
|
|
532
|
+
setNumberValue(value, r, n) {
|
|
533
|
+
let itemValue = this.getFormItemValue(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop)
|
|
534
|
+
itemValue = value
|
|
535
|
+
this.setValueToModelProp(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop, itemValue)
|
|
536
|
+
},
|
|
537
|
+
listSearchConditions() {
|
|
538
|
+
return new Promise((resolve, reject) => {
|
|
539
|
+
this.listSearchCondition(this.code)
|
|
540
|
+
.then((conditions) => {
|
|
541
|
+
this.searchConditions = conditions
|
|
542
|
+
resolve(conditions)
|
|
543
|
+
})
|
|
544
|
+
.catch((error) => {
|
|
545
|
+
reject(error)
|
|
546
|
+
})
|
|
547
|
+
})
|
|
548
|
+
},
|
|
549
|
+
saveCondition() {
|
|
550
|
+
const searchParams = this.packageSearchParam()
|
|
551
|
+
if (!searchParams || searchParams.length === 0) {
|
|
552
|
+
this.$message({
|
|
553
|
+
type: 'warning',
|
|
554
|
+
message: this.$t('imatrixUIMessage.pleaseInputSearchCondition'),
|
|
555
|
+
showClose: true
|
|
556
|
+
})
|
|
557
|
+
return
|
|
558
|
+
}
|
|
559
|
+
this.isShowSearchCondition = true
|
|
560
|
+
},
|
|
561
|
+
saveConditionValue(conditionName) {
|
|
562
|
+
if (conditionName) {
|
|
563
|
+
let searchParams
|
|
564
|
+
if (
|
|
565
|
+
this.searchType === 'normal' ||
|
|
566
|
+
this.searchType === '' ||
|
|
567
|
+
this.searchType === null ||
|
|
568
|
+
this.searchType === undefined
|
|
569
|
+
) {
|
|
570
|
+
searchParams = this.packageSearchParam()
|
|
571
|
+
} else {
|
|
572
|
+
searchParams = this.searchFormList
|
|
573
|
+
}
|
|
574
|
+
const condition = {
|
|
575
|
+
listCode: this.code,
|
|
576
|
+
queryType:
|
|
577
|
+
this.searchType === 'normal' ||
|
|
578
|
+
this.searchType === '' ||
|
|
579
|
+
this.searchType === null ||
|
|
580
|
+
this.searchType === undefined
|
|
581
|
+
? 'FIXED'
|
|
582
|
+
: 'CUSTOM',
|
|
583
|
+
name: conditionName,
|
|
584
|
+
queryCondition: JSON.stringify(searchParams)
|
|
585
|
+
}
|
|
586
|
+
this.saveSearchCondition(condition).then((condition) => {
|
|
587
|
+
this.$message({
|
|
588
|
+
type: 'success',
|
|
589
|
+
message: this.$t('imatrixUIMessage.saveSuccessfully'),
|
|
590
|
+
showClose: true
|
|
591
|
+
})
|
|
592
|
+
this.isShowSearchCondition = false
|
|
593
|
+
this.listSearchConditions().then(() => {
|
|
594
|
+
if (this.$refs.searchConditionList) {
|
|
595
|
+
// 选中刚刚保存的条件
|
|
596
|
+
this.$refs.searchConditionList.editConditionId = condition.id + ''
|
|
597
|
+
}
|
|
598
|
+
// 查询条件对应的数据
|
|
599
|
+
this.selectCondition(condition.id)
|
|
600
|
+
})
|
|
601
|
+
})
|
|
602
|
+
}
|
|
603
|
+
this.isShowSearchCondition = false
|
|
604
|
+
},
|
|
605
|
+
removeCondition(conditionId) {
|
|
606
|
+
if (conditionId) {
|
|
607
|
+
this.$confirm(this.$t('imatrixUIMessage.whetherToConfirmDeletion'), this.$t('imatrixUIMessage.tips'), {
|
|
608
|
+
confirmButtonText: this.$t('imatrixUIPublicModel.sure'),
|
|
609
|
+
cancelButtonText: this.$t('imatrixUIPublicModel.cancel'),
|
|
610
|
+
type: 'warning'
|
|
611
|
+
}).then(() => {
|
|
612
|
+
this.removeSearchCondition(conditionId).then(() => {
|
|
613
|
+
this.$message({
|
|
614
|
+
type: 'success',
|
|
615
|
+
message: this.$t('superGrid.deleteSuccessful'),
|
|
616
|
+
showClose: true
|
|
617
|
+
})
|
|
618
|
+
this.listSearchConditions()
|
|
619
|
+
})
|
|
620
|
+
})
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
selectCondition(conditionId) {
|
|
624
|
+
if (conditionId) {
|
|
625
|
+
this.getSearchCondition(conditionId).then((searchCondition) => {
|
|
626
|
+
if (searchCondition) {
|
|
627
|
+
const queryCondition = searchCondition.queryCondition
|
|
628
|
+
if (queryCondition) {
|
|
629
|
+
if (
|
|
630
|
+
this.searchType === 'normal' ||
|
|
631
|
+
this.searchType === '' ||
|
|
632
|
+
this.searchType === null ||
|
|
633
|
+
this.searchType === undefined
|
|
634
|
+
) {
|
|
635
|
+
const searchParams = JSON.parse(queryCondition)
|
|
636
|
+
const searchForm = this.packageSearchForm(searchParams)
|
|
637
|
+
if (searchForm) {
|
|
638
|
+
this.searchForm = searchForm
|
|
639
|
+
}
|
|
640
|
+
// 查询数据
|
|
641
|
+
this.loading = true
|
|
642
|
+
$emit(this, 'search', searchParams)
|
|
643
|
+
} else {
|
|
644
|
+
this.searchFormList = JSON.parse(queryCondition)
|
|
645
|
+
// 查询数据
|
|
646
|
+
this.loading = true
|
|
647
|
+
$emit(this, 'search', this.packageSearchParam())
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
})
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
// 封装searchForm
|
|
655
|
+
packageSearchForm(searchFormArr) {
|
|
656
|
+
if (searchFormArr && searchFormArr.length > 0) {
|
|
657
|
+
const searchForm = {}
|
|
658
|
+
const initSearchProps = []
|
|
659
|
+
searchFormArr.forEach((item) => {
|
|
660
|
+
// 获得的是"isDeleted"
|
|
661
|
+
let prop = item.propName
|
|
662
|
+
// 获得的是“deleted”
|
|
663
|
+
const columnProp = item.columnProp
|
|
664
|
+
const dataType = item.dataType
|
|
665
|
+
if (dataType && dataType === 'BOOLEAN' && columnProp) {
|
|
666
|
+
prop = columnProp
|
|
667
|
+
}
|
|
668
|
+
if (initSearchProps.indexOf(prop) === -1) {
|
|
669
|
+
initSearchProps.push(prop)
|
|
670
|
+
}
|
|
671
|
+
const propValue = item.propValue
|
|
672
|
+
if (prop && prop.indexOf('.') > 0) {
|
|
673
|
+
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
674
|
+
addDynamicProp(searchForm, prop, propValue)
|
|
675
|
+
} else {
|
|
676
|
+
let isRangeQueryValue = false
|
|
677
|
+
if (dataType && (dataType === 'DATE' || dataType === 'TIME')) {
|
|
678
|
+
if (item.startValue && item.endValue) {
|
|
679
|
+
isRangeQueryValue = true
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
if (isRangeQueryValue) {
|
|
683
|
+
searchForm[prop] = [new Date(item.startValue), new Date(item.endValue)]
|
|
684
|
+
} else {
|
|
685
|
+
if (searchForm[prop]) {
|
|
686
|
+
if (searchForm[prop] instanceof Array) {
|
|
687
|
+
searchForm[prop].push(propValue)
|
|
688
|
+
} else {
|
|
689
|
+
searchForm[prop] = [searchForm[prop], propValue]
|
|
690
|
+
}
|
|
691
|
+
} else {
|
|
692
|
+
searchForm[prop] = propValue
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
})
|
|
756
697
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
})
|
|
698
|
+
this.searchableColumns.forEach((column) => {
|
|
699
|
+
if (initSearchProps) {
|
|
700
|
+
if (initSearchProps.indexOf(column.prop) < 0) {
|
|
701
|
+
// 表示没有默认初始查询字段
|
|
702
|
+
if (column.prop && column.prop.indexOf('.') > 0) {
|
|
703
|
+
if (column.componentType === 'dateSection') {
|
|
704
|
+
addDynamicPropDateSection(searchForm, column.prop)
|
|
705
|
+
} else {
|
|
706
|
+
// 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
|
|
707
|
+
addDynamicProp(searchForm, column.prop)
|
|
708
|
+
}
|
|
709
|
+
} else {
|
|
710
|
+
if (column.componentType === 'dateSection') {
|
|
711
|
+
searchForm[column.prop] = [new Date(), new Date()]
|
|
712
|
+
} else {
|
|
713
|
+
searchForm[column.prop] = null
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
} else {
|
|
717
|
+
if (column.componentType === 'multiselect' && searchForm[column.prop]) {
|
|
718
|
+
if (!(searchForm[column.prop] instanceof Array)) {
|
|
719
|
+
searchForm[column.prop] = [searchForm[column.prop]]
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
})
|
|
787
725
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
726
|
+
return searchForm
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
resetSearchFormList() {
|
|
730
|
+
this.searchFormList = null
|
|
731
|
+
},
|
|
732
|
+
openFold(isOpen) {
|
|
733
|
+
$emit(this, 'open-fold', isOpen)
|
|
734
|
+
},
|
|
735
|
+
// 查询完毕
|
|
736
|
+
searchComplete() {
|
|
737
|
+
if (this.isMobile && this.$refs.searchFormMobile) {
|
|
738
|
+
this.$refs.searchFormMobile.searchComplete()
|
|
739
|
+
} else if (this.$refs.searchFormOrdinarySearch) {
|
|
740
|
+
this.$refs.searchFormOrdinarySearch.searchComplete()
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
closeMobileSearch() {
|
|
744
|
+
this.isShowMobileForm = false
|
|
745
|
+
$emit(this, 'close-mobile-search')
|
|
746
|
+
},
|
|
747
|
+
showMobileSearch() {
|
|
748
|
+
this.isShowMobileForm = true
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
emits: ['search', 'open-fold', 'reset', 'show-mobile-search', 'close-mobile-search']
|
|
814
752
|
}
|
|
815
753
|
</script>
|
|
816
754
|
|
|
817
755
|
<style scoped>
|
|
818
756
|
.grid-search-form :deep(.el-form-item) {
|
|
819
|
-
|
|
757
|
+
margin-bottom: 0px;
|
|
820
758
|
}
|
|
821
759
|
|
|
822
760
|
.grid-search-form :deep(.search-btn) {
|
|
823
|
-
|
|
824
|
-
|
|
761
|
+
margin-bottom: 5px;
|
|
762
|
+
text-align: center;
|
|
825
763
|
}
|
|
826
764
|
|
|
827
765
|
.grid-search-form :deep(.el-select),
|
|
828
766
|
.grid-search-form :deep(.customComponent) {
|
|
829
|
-
|
|
767
|
+
width: 100%;
|
|
830
768
|
}
|
|
831
769
|
|
|
832
770
|
.amb-agilebuilder-search-form-view:empty {
|
|
833
|
-
|
|
771
|
+
display: none;
|
|
834
772
|
}
|
|
835
773
|
|
|
836
774
|
.search-condition-mobile {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
775
|
+
padding-bottom: 10px;
|
|
776
|
+
position: fixed;
|
|
777
|
+
top: 37px;
|
|
778
|
+
background-color: #ffffff;
|
|
779
|
+
width: 46%;
|
|
780
|
+
height: 40px;
|
|
781
|
+
z-index: 1500;
|
|
844
782
|
}
|
|
845
783
|
</style>
|