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.
Files changed (120) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.js +115880 -110424
  3. package/lib/super-ui.umd.cjs +103 -95
  4. package/package.json +6 -3
  5. package/packages/department-tree/src/department-tree.vue +27 -10
  6. package/packages/department-tree-inline/src/department-tree-service.js +20 -41
  7. package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
  8. package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
  9. package/packages/department-user-tree/src/department-user-tree.vue +17 -2
  10. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
  11. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
  12. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
  13. package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
  14. package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
  15. package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
  16. package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
  17. package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
  18. package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
  19. package/packages/department-user-tree-inline/src/search-result.vue +34 -36
  20. package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
  21. package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
  22. package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
  23. package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
  24. package/packages/dynamic-source-select/src/events.js +11 -16
  25. package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
  26. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
  27. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
  28. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
  29. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
  30. package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
  31. package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
  32. package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
  33. package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
  34. package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
  35. package/packages/index.js +11 -2
  36. package/packages/organization-input/src/organization-input.vue +493 -539
  37. package/packages/plugins/export-data-new.js +34 -1
  38. package/packages/rich-editor/index.vue +29 -0
  39. package/packages/row-form/index.js +7 -0
  40. package/packages/row-form/index.vue +211 -0
  41. package/packages/scan-code-input/src/scan-code-input.vue +136 -104
  42. package/packages/scan-code-input-browser/index.js +6 -0
  43. package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
  44. package/packages/secret-info/index.vue +2 -2
  45. package/packages/super-grid/src/apis.js +158 -10
  46. package/packages/super-grid/src/components/grid-icon.vue +7 -14
  47. package/packages/super-grid/src/components/hyperlinks.vue +24 -8
  48. package/packages/super-grid/src/custom-formatter.js +312 -380
  49. package/packages/super-grid/src/dynamic-input.vue +346 -43
  50. package/packages/super-grid/src/formValidatorUtil.js +79 -15
  51. package/packages/super-grid/src/group-column.vue +5 -0
  52. package/packages/super-grid/src/normal-column-content.vue +1056 -0
  53. package/packages/super-grid/src/normal-column.vue +57 -740
  54. package/packages/super-grid/src/row-detail.vue +50 -0
  55. package/packages/super-grid/src/row-operation.vue +19 -10
  56. package/packages/super-grid/src/scan-util.ts +243 -0
  57. package/packages/super-grid/src/search-button.vue +18 -14
  58. package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
  59. package/packages/super-grid/src/search-form-item.vue +10 -3
  60. package/packages/super-grid/src/search-form-mobile.vue +250 -0
  61. package/packages/super-grid/src/search-form.vue +159 -82
  62. package/packages/super-grid/src/super-grid-service.js +51 -6
  63. package/packages/super-grid/src/super-grid.vue +657 -761
  64. package/packages/super-grid/src/utils.js +126 -170
  65. package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
  66. package/packages/workflow-button/src/workflow-button.vue +6 -1
  67. package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
  68. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
  69. package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
  70. package/packages/workgroup-tree-mobile/index.js +6 -0
  71. package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
  72. package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
  73. package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
  74. package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
  75. package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
  76. package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
  77. package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
  78. package/packages/workgroup-user-tree-mobile/index.js +6 -0
  79. package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
  80. package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
  81. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
  82. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
  83. package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
  84. package/src/api/sso-service.js +44 -15
  85. package/src/directives/permission/permission.js +4 -3
  86. package/src/i18n/langs/cn.js +19 -3
  87. package/src/i18n/langs/en.js +18 -2
  88. package/src/permission.js +114 -122
  89. package/src/store/modules/user.js +32 -33
  90. package/src/styles/index.scss +1 -0
  91. package/src/styles/table.scss +12 -0
  92. package/src/styles/theme/dark-blue/button.scss +2 -2
  93. package/src/styles/theme/dark-blue/index.scss +1 -1
  94. package/src/styles/theme/dark-blue/sidebar.scss +10 -0
  95. package/src/styles/theme/dark-blue/table.scss +8 -52
  96. package/src/styles/theme/green/button.scss +2 -2
  97. package/src/styles/theme/green/green.scss +1 -1
  98. package/src/styles/theme/green/index.scss +1 -1
  99. package/src/styles/theme/green/sidebar.scss +20 -0
  100. package/src/styles/theme/green/table.scss +7 -51
  101. package/src/styles/theme/ocean-blue/button.scss +2 -2
  102. package/src/styles/theme/ocean-blue/index.scss +1 -1
  103. package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
  104. package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
  105. package/src/styles/theme/ocean-blue/table.scss +7 -52
  106. package/src/utils/auth.js +23 -3
  107. package/src/utils/calculator/calculator-factory.js +4 -4
  108. package/src/utils/calculator/calculator-util.js +14 -0
  109. package/src/utils/common-util.js +270 -124
  110. package/src/utils/i18n-util.js +145 -0
  111. package/src/utils/jump-page-utils.js +245 -314
  112. package/src/utils/permission.js +7 -1
  113. package/src/utils/permissionAuth.js +155 -37
  114. package/src/utils/request.js +10 -11
  115. package/src/utils/util.js +154 -205
  116. package/src/views/layout/EmptyLayout.vue +1 -1
  117. package/src/views/layout/components/Menubar/Item.vue +27 -4
  118. package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
  119. package/src/views/layout/components/Menubar/index.vue +14 -2
  120. package/src/views/layout/tab-content-index.vue +1 -1
@@ -0,0 +1,250 @@
1
+ <template>
2
+ <div>
3
+ <el-form
4
+ v-if="searchableColumns.length > 0"
5
+ ref="searchForm"
6
+ :model="searchForm"
7
+ :rules="rules"
8
+ class="grid-search-form-mobile"
9
+ label-position="top"
10
+ size="default"
11
+ >
12
+ <!--初始进入台账页面时 或 展开时显示按钮--->
13
+ <div style="padding-bottom: 40px;padding-top: 35px;">
14
+ <search-form-item
15
+ v-for="(column, index) in searchableColumns"
16
+ :key="index"
17
+ :search-form="searchForm"
18
+ :column="column"
19
+ :code="code"
20
+ :is-sql="isSql"
21
+ :table-name="tableName"
22
+ :is-join-table="isJoinTable"
23
+ />
24
+ </div>
25
+ <div class="search-btn-mobile">
26
+ <search-button
27
+ ref="searchBtnOpen"
28
+ @submit-form="$emit('submit-form')"
29
+ @reset-form="$emit('reset-form')"
30
+ @save-condition="$emit('save-condition')"
31
+ />
32
+ </div>
33
+ </el-form>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import {$on, $off, $once, $emit} from '../../utils/gogocodeTransfer'
39
+ import searchMethods from './search-methods'
40
+ import store from './store'
41
+ import {addDynamicProp, addDynamicPropDateSection} from './utils'
42
+ import eventBus from '../../../src/utils/eventBus'
43
+ import SearchFormItem from './search-form-item.vue'
44
+ import SearchButton from './search-button.vue'
45
+
46
+ export default {
47
+ name: 'SearchFormMobile',
48
+ components: {
49
+ SearchFormItem,
50
+ SearchButton
51
+ },
52
+ props: {
53
+ searchableColumns: {
54
+ type: Array,
55
+ default: null,
56
+ },
57
+ searchForm: {
58
+ type: Object,
59
+ default: null,
60
+ },
61
+ rules: {
62
+ type: Object,
63
+ default: null,
64
+ },
65
+ labelWidth: {
66
+ type: String,
67
+ default: null,
68
+ },
69
+ query: {
70
+ type: Object,
71
+ default: null,
72
+ },
73
+ code: {
74
+ type: String,
75
+ default: null,
76
+ },
77
+ isSql: {
78
+ type: Boolean,
79
+ default: false,
80
+ },
81
+ loadCompleteQuery: {
82
+ type: Boolean,
83
+ default: false,
84
+ },
85
+ },
86
+ data() {
87
+ const gridParams = store.get(this.code)
88
+ let tableName
89
+ if (gridParams && gridParams.basicInfo && gridParams.basicInfo.tableName) {
90
+ tableName = gridParams.basicInfo.tableName
91
+ }
92
+ let isHasJoinTable
93
+ if (
94
+ gridParams &&
95
+ gridParams.basicInfo &&
96
+ gridParams.basicInfo.hasJoinTable
97
+ ) {
98
+ isHasJoinTable = gridParams.basicInfo.hasJoinTable
99
+ }
100
+ const customComponentNames = new Set()
101
+ return {
102
+ customComponentNames: customComponentNames,
103
+ dateOne: null,
104
+ dataTwo: null,
105
+ tableName,
106
+ isJoinTable: isHasJoinTable, // 是否是关联表
107
+ isOpen: false,
108
+ }
109
+ },
110
+ computed: {},
111
+ watch: {},
112
+ created() {
113
+ },
114
+ methods: {
115
+ ...searchMethods,
116
+ validateForm() {
117
+ return new Promise((resolve, reject) => {
118
+ this.$refs.searchForm.validate((valid) => {
119
+ resolve(valid)
120
+ })
121
+ })
122
+ },
123
+ resetForm() {
124
+ $emit(eventBus, 'remoteMethod')
125
+ // console.log('customComponentNames=', this.customComponentNames)
126
+ if (this.customComponentNames && this.customComponentNames.length > 0) {
127
+ for (const componentName of this.customComponentNames) {
128
+ // 遍历
129
+ this.$refs[componentName][0].resetField()
130
+ }
131
+ }
132
+ this.$refs.searchForm.resetFields()
133
+ // 当是保持页数默认赋值的查询字段resetFields()不会被清空,需要下面的方法遍历设未null
134
+ this.searchableColumns.forEach((column) => {
135
+ // 表示没有默认初始查询字段
136
+ if (column.prop && column.prop.indexOf('.') > 0) {
137
+ if (column.componentType === 'dateSection') {
138
+ addDynamicPropDateSection(this.searchForm, column.prop)
139
+ } else {
140
+ // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
141
+ addDynamicProp(this.searchForm, column.prop)
142
+ }
143
+ } else {
144
+ if (column.componentType === 'dateSection') {
145
+ this.searchForm[column.prop] = [new Date(), new Date()]
146
+ } else if (column.componentType === 'yearRange') {
147
+ this.searchForm[column.prop][0] = ''
148
+ this.searchForm[column.prop][1] = ''
149
+ } else if (
150
+ column.componentType === 'inputNumber' &&
151
+ this.searchForm[column.prop]
152
+ ) {
153
+ this.searchForm[column.prop][0] = 0
154
+ this.searchForm[column.prop][1] = 0
155
+ } else {
156
+ this.searchForm[column.prop] = null
157
+ }
158
+ this.setDefaultQueryValue(column, this.searchForm)
159
+ }
160
+ })
161
+ // 取消当前选中的条件列表的信息
162
+ // this.$refs.searchConditionList.editConditionId = null
163
+ // this.$emit('reset')
164
+ // 重置条件后查询列表
165
+ $emit(this, 'submit-form')
166
+ },
167
+ openFold(isOpen) {
168
+ this.isOpen = isOpen
169
+ $emit(this, 'open-fold', isOpen)
170
+ },
171
+ // 查询完毕
172
+ searchComplete() {
173
+ if (this.$refs.searchBtnOpen) {
174
+ if (Array.isArray(this.$refs.searchBtnOpen)) {
175
+ if (this.$refs.searchBtnOpen.length > 0) {
176
+ this.$refs.searchBtnOpen[0].searchComplete()
177
+ }
178
+ } else {
179
+ this.$refs.searchBtnOpen.searchComplete()
180
+ }
181
+ }
182
+ }
183
+ },
184
+ emits: [
185
+ 'submit-form',
186
+ 'reset-form',
187
+ 'save-condition',
188
+ 'remoteMethod',
189
+ ],
190
+ }
191
+ </script>
192
+
193
+ <style lang="scss" scoped>
194
+ .grid-search-form-mobile {
195
+ overflow: auto;
196
+ }
197
+
198
+ .grid-search-form-mobile {
199
+ :deep(.el-form-item) {
200
+ margin-bottom: 5px;
201
+ }
202
+ }
203
+
204
+ .grid-search-form-mobile {
205
+ :deep(.el-form-item__label) {
206
+ overflow: hidden;
207
+ text-overflow: ellipsis;
208
+ white-space: nowrap;
209
+ word-break: keep-all;
210
+ }
211
+ }
212
+
213
+ .grid-search-form-mobile {
214
+ :deep(.search-btn) {
215
+ margin-bottom: 5px;
216
+ text-align: center;
217
+ }
218
+ }
219
+
220
+ .grid-search-form-mobile {
221
+ :deep(.el-select) {
222
+ width: 100%;
223
+ }
224
+
225
+ :deep(.customComponent) {
226
+ width: 100%;
227
+ }
228
+ }
229
+
230
+ .grid-search-form-mobile {
231
+ :deep(.el-row) {
232
+ padding-right: 24px;
233
+ }
234
+ }
235
+
236
+ .grid-search-form-mobile {
237
+ :deep(.el-col) {
238
+ padding-left: 10px;
239
+ padding-bottom: 16px;
240
+ }
241
+ }
242
+ .search-btn-mobile {
243
+ padding-top: 10px;
244
+ position: fixed;
245
+ bottom: 0;
246
+ background-color: #ffffff;
247
+ width: 50%;
248
+ height: 40px;
249
+ }
250
+ </style>
@@ -1,96 +1,124 @@
1
1
  <template>
2
2
  <div>
3
- <search-condition-list
4
- v-if="searchConditions.length > 0"
5
- ref="searchConditionList"
6
- :search-conditions="searchConditions"
7
- :search-type="searchType"
8
- @remove-condition="removeCondition"
9
- @select-condition="selectCondition"
10
- />
11
- <search-form-ordinary-search
12
- v-if="searchType === 'normal'"
13
- ref="searchFormOrdinarySearch"
3
+ <el-drawer v-if="isMobile" v-model="isShowMobileForm" :close-on-click-modal="false" :close-on-press-escape="false" direction="rtl" size="50%" @close="closeMobileSearch()">
4
+ <div class="search-condition-mobile">
5
+ <search-condition-list
6
+ v-if="searchConditions.length > 0"
7
+ ref="searchConditionList"
8
+ :search-conditions="searchConditions"
9
+ :search-type="searchType"
10
+ @remove-condition="removeCondition"
11
+ @select-condition="selectCondition"
12
+ />
13
+ </div>
14
+ <search-form-mobile
15
+ v-if="isMobile && searchType === 'normal'"
16
+ ref="searchFormMobile"
14
17
  :code="code"
15
- :field-num="fieldNum"
16
18
  :is-sql="isSql"
17
- :label-width="labelWidth"
18
19
  :load-complete-query="loadCompleteQuery"
19
20
  :query="query"
20
- :row-num="rowNum"
21
21
  :rules="rules"
22
22
  :search-form="searchForm"
23
23
  :searchable-columns="searchableColumns"
24
- :span-num="spanNum"
25
24
  @submit-form="submitForm('searchForm')"
26
25
  @reset-form="resetForm('searchForm')"
27
26
  @save-condition="saveCondition()"
28
- @open-fold="openFold"
29
- />
30
- <search-form-advanced-query
31
- v-if="searchType === 'advanced'"
32
- ref="searchFormAdvancedQuery"
33
- :code="code"
34
- :is-sql="isSql"
35
- :prop-map="propMap"
36
- :search-form-list="searchFormList"
37
- :searchable-columns="advancedQueryColumns"
38
- style="padding-bottom: 10px"
39
- @resetForm="resetSearchFormList"
40
- />
41
- <div
42
- v-if="searchType === 'advanced'"
43
- style="padding-top: 10px; padding-bottom: 10px; text-align: center"
44
- >
45
- <el-button
46
- :loading="loading"
47
- size="default"
48
- type="primary"
49
- @click="submitForm('searchForm')"
50
- >
51
- {{ $t('imatrixUIPublicModel.sure') }}
52
- </el-button>
53
- <el-button
54
- :loading="loading"
55
- size="default"
56
- @click="resetForm('searchForm')"
27
+ />
28
+ </el-drawer>
29
+ <div v-else>
30
+ <search-condition-list
31
+ v-if="searchConditions.length > 0"
32
+ ref="searchConditionList"
33
+ :search-conditions="searchConditions"
34
+ :search-type="searchType"
35
+ @remove-condition="removeCondition"
36
+ @select-condition="selectCondition"
37
+ />
38
+ <search-form-ordinary-search
39
+ v-if="searchType === 'normal'"
40
+ ref="searchFormOrdinarySearch"
41
+ :code="code"
42
+ :field-num="fieldNum"
43
+ :is-sql="isSql"
44
+ :label-width="labelWidth"
45
+ :load-complete-query="loadCompleteQuery"
46
+ :query="query"
47
+ :row-num="rowNum"
48
+ :rules="rules"
49
+ :search-form="searchForm"
50
+ :searchable-columns="searchableColumns"
51
+ :span-num="spanNum"
52
+ @submit-form="submitForm('searchForm')"
53
+ @reset-form="resetForm('searchForm')"
54
+ @save-condition="saveCondition()"
55
+ @open-fold="openFold"
56
+ />
57
+ <search-form-advanced-query
58
+ v-if="searchType === 'advanced'"
59
+ ref="searchFormAdvancedQuery"
60
+ :code="code"
61
+ :is-sql="isSql"
62
+ :prop-map="propMap"
63
+ :search-form-list="searchFormList"
64
+ :searchable-columns="advancedQueryColumns"
65
+ style="padding-bottom: 10px"
66
+ @resetForm="resetSearchFormList"
67
+ />
68
+ <div
69
+ v-if="searchType === 'advanced'"
70
+ style="padding-top: 10px; padding-bottom: 10px; text-align: center"
57
71
  >
58
- {{ $t('imatrixUIPublicModel.reset') }}
59
- </el-button>
60
- <el-button size="default" @click="saveCondition">
61
- {{ $t('superGrid.saveCondition') }}
62
- </el-button>
63
- <span
72
+ <el-button
73
+ :loading="loading"
74
+ size="default"
75
+ type="primary"
76
+ @click="submitForm('searchForm')"
77
+ >
78
+ {{ $t('imatrixUIPublicModel.sure') }}
79
+ </el-button>
80
+ <el-button
81
+ :loading="loading"
82
+ size="default"
83
+ @click="resetForm('searchForm')"
84
+ >
85
+ {{ $t('imatrixUIPublicModel.reset') }}
86
+ </el-button>
87
+ <el-button size="default" @click="saveCondition">
88
+ {{ $t('superGrid.saveCondition') }}
89
+ </el-button>
90
+ <span
64
91
  v-if="
65
- advancedQuery !== null &&
66
- advancedQuery !== undefined &&
67
- advancedQuery === true &&
68
- normalQuery !== null &&
69
- normalQuery !== undefined &&
70
- normalQuery === true
71
- "
72
- style="margin-left: 10px"
73
- >
74
- <el-button
75
- v-if="searchType === 'advanced'"
76
- size="default"
77
- @click="searchType = 'normal'"
78
- >
79
- {{ $t('imatrixUIPublicModel.switchToNormalQuery') }}
80
- </el-button>
81
- <el-button
82
- v-if="searchType === 'normal'"
83
- size="default"
84
- @click="searchType = 'advanced'"
85
- >
86
- {{ $t('imatrixUIPublicModel.switchToAdvancedQuery') }}
87
- </el-button>
88
- </span>
92
+ advancedQuery !== null &&
93
+ advancedQuery !== undefined &&
94
+ advancedQuery === true &&
95
+ normalQuery !== null &&
96
+ normalQuery !== undefined &&
97
+ normalQuery === true
98
+ "
99
+ style="margin-left: 10px"
100
+ >
101
+ <el-button
102
+ v-if="searchType === 'advanced'"
103
+ size="default"
104
+ @click="searchType = 'normal'"
105
+ >
106
+ {{ $t('imatrixUIPublicModel.switchToNormalQuery') }}
107
+ </el-button>
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>
89
117
  </div>
90
- <search-condition-input
118
+ <search-condition-input
91
119
  v-if="isShowSearchCondition"
92
120
  @close="saveConditionValue"
93
- />
121
+ />
94
122
  </div>
95
123
  </template>
96
124
 
@@ -106,6 +134,8 @@ import {addDynamicProp, addDynamicPropDateSection} from './utils'
106
134
  import * as Vue from 'vue'
107
135
  import SearchConditionInput from './search-condition-input.vue'
108
136
  import SearchConditionList from './search-condition-list.vue'
137
+ import SearchFormMobile from './search-form-mobile.vue'
138
+ import {isMobileBrowser} from '../../../src/utils/common-util'
109
139
 
110
140
  export default {
111
141
  name: 'SearchForm',
@@ -114,7 +144,8 @@ export default {
114
144
  SearchConditionInput,
115
145
  SearchConditionList,
116
146
  searchFormOrdinarySearch,
117
- searchFormAdvancedQuery
147
+ searchFormAdvancedQuery,
148
+ SearchFormMobile
118
149
  },
119
150
  provide() {
120
151
  return {
@@ -207,6 +238,13 @@ export default {
207
238
  }
208
239
  }
209
240
  })
241
+
242
+ const isMobile = isMobileBrowser()
243
+ let canShowMobileSearch = false
244
+ if(isMobile && searchColumns && searchColumns.length > 0){
245
+ // 如果是移动端,且有查询字段,则新页面需要显示“查询”按钮
246
+ canShowMobileSearch = true
247
+ }
210
248
  const spanNum = this.getSpanNum(searchColumns)
211
249
  const fieldNum = this.getFieldNumPerRow(searchColumns)
212
250
  const rowNum = Math.ceil(searchColumns.length / fieldNum)
@@ -215,7 +253,6 @@ export default {
215
253
  // console.log('searchColumns.length=' + searchColumns.length + ',fieldNum=' + fieldNum + ',rowNum=' + rowNum)
216
254
  // // -2是把
217
255
  // const dateSpanNum = (spanNum - 2) / 2
218
-
219
256
  return {
220
257
  searchForm,
221
258
  rules: {},
@@ -237,6 +274,9 @@ export default {
237
274
  normalQuery,
238
275
  searchFormList: [],
239
276
  searchType: null,
277
+ isMobile, // 是否是移动端
278
+ isShowMobileForm: true, // 是否显示表单
279
+ canShowMobileSearch
240
280
  }
241
281
  },
242
282
  computed: {
@@ -262,6 +302,11 @@ export default {
262
302
  } else if (this.advancedQuery) {
263
303
  this.searchType = 'advanced'
264
304
  }
305
+ console.log('this.canShowMobileSearch----', this.canShowMobileSearch)
306
+ if(this.canShowMobileSearch){
307
+ // 如果是移动端,且有查询字段,则新页面需要显示“查询”按钮
308
+ this.$emit('can-show-mobile-search')
309
+ }
265
310
  },
266
311
  methods: {
267
312
  ...searchMethods,
@@ -482,7 +527,17 @@ export default {
482
527
  return false
483
528
  },
484
529
  submitForm() {
485
- if (this.searchType === 'normal') {
530
+ if(this.isMobile){
531
+ this.$refs.searchFormMobile.validateForm().then((valid) => {
532
+ if (valid) {
533
+ // this.loading = true
534
+ this.searchParams = this.packageSearchParam()
535
+ $emit(this, 'search', this.searchParams)
536
+ } else {
537
+ return false
538
+ }
539
+ })
540
+ }else if (this.searchType === 'normal') {
486
541
  this.$refs.searchFormOrdinarySearch.validateForm().then((valid) => {
487
542
  if (valid) {
488
543
  // this.loading = true
@@ -508,7 +563,9 @@ export default {
508
563
  if (this.$refs.searchConditionList) {
509
564
  this.$refs.searchConditionList.editConditionId = null
510
565
  }
511
- if (this.searchType === 'normal') {
566
+ if(this.isMobile){
567
+ this.$refs.searchFormMobile.resetForm()
568
+ } else if (this.searchType === 'normal') {
512
569
  this.$refs.searchFormOrdinarySearch.resetForm()
513
570
  } else if (this.searchType === 'advanced') {
514
571
  this.$refs.searchFormAdvancedQuery.resetForm()
@@ -739,12 +796,21 @@ export default {
739
796
  },
740
797
  // 查询完毕
741
798
  searchComplete() {
742
- if (this.$refs.searchFormOrdinarySearch) {
799
+ if(this.isMobile && this.$refs.searchFormMobile){
800
+ this.$refs.searchFormMobile.searchComplete()
801
+ }else if (this.$refs.searchFormOrdinarySearch) {
743
802
  this.$refs.searchFormOrdinarySearch.searchComplete()
744
803
  }
745
804
  },
805
+ closeMobileSearch() {
806
+ this.isShowMobileForm = false
807
+ $emit(this, 'close-mobile-search')
808
+ },
809
+ showMobileSearch(){
810
+ this.isShowMobileForm = true
811
+ }
746
812
  },
747
- emits: ['search', 'open-fold', 'reset'],
813
+ emits: ['search', 'open-fold', 'reset', 'show-mobile-search', 'close-mobile-search'],
748
814
  }
749
815
  </script>
750
816
 
@@ -766,4 +832,15 @@ export default {
766
832
  .grid-search-form :deep(.customComponent) {
767
833
  width: 100%;
768
834
  }
835
+
836
+
837
+ .search-condition-mobile {
838
+ padding-bottom: 10px;
839
+ position: fixed;
840
+ top: 37px;
841
+ background-color: #ffffff;
842
+ width: 46%;
843
+ height: 40px;
844
+ z-index: 1500;
845
+ }
769
846
  </style>