cnhis-design-vue 2.1.23 → 2.1.25

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 (127) hide show
  1. package/CHANGELOG.md +2287 -2280
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +164 -164
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +61 -54
  14. package/es/button/style.css +1 -1
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +30 -25
  33. package/es/editor/style.css +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +65 -49
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +93 -87
  39. package/es/form-table/style.css +1 -1
  40. package/es/index/index.js +877 -823
  41. package/es/index/style.css +1 -1
  42. package/es/input/index.js +9 -9
  43. package/es/input-number/index.js +8 -8
  44. package/es/layout/index.js +8 -8
  45. package/es/list/index.js +8 -8
  46. package/es/locale-provider/index.js +8 -8
  47. package/es/map/index.js +9 -9
  48. package/es/mentions/index.js +8 -8
  49. package/es/menu/index.js +8 -8
  50. package/es/message/index.js +8 -8
  51. package/es/multi-chat/index.js +92 -92
  52. package/es/multi-chat-client/index.js +86 -86
  53. package/es/multi-chat-history/index.js +4 -4
  54. package/es/multi-chat-record/index.js +14 -14
  55. package/es/multi-chat-setting/index.js +27 -27
  56. package/es/multi-chat-sip/index.js +1 -1
  57. package/es/notification/index.js +8 -8
  58. package/es/page-header/index.js +8 -8
  59. package/es/pagination/index.js +8 -8
  60. package/es/popconfirm/index.js +8 -8
  61. package/es/popover/index.js +8 -8
  62. package/es/progress/index.js +8 -8
  63. package/es/radio/index.js +9 -9
  64. package/es/rate/index.js +8 -8
  65. package/es/result/index.js +8 -8
  66. package/es/row/index.js +8 -8
  67. package/es/scale-view/index.js +33 -33
  68. package/es/select/index.js +11 -11
  69. package/es/select-label/index.js +11 -11
  70. package/es/select-person/index.js +20 -20
  71. package/es/skeleton/index.js +8 -8
  72. package/es/slider/index.js +8 -8
  73. package/es/space/index.js +8 -8
  74. package/es/spin/index.js +8 -8
  75. package/es/statistic/index.js +8 -8
  76. package/es/steps/index.js +8 -8
  77. package/es/switch/index.js +8 -8
  78. package/es/table-filter/index.js +286 -259
  79. package/es/table-filter/style.css +1 -1
  80. package/es/tabs/index.js +8 -8
  81. package/es/tag/index.js +9 -9
  82. package/es/time-picker/index.js +8 -8
  83. package/es/timeline/index.js +8 -8
  84. package/es/tooltip/index.js +8 -8
  85. package/es/transfer/index.js +8 -8
  86. package/es/tree/index.js +8 -8
  87. package/es/tree-select/index.js +8 -8
  88. package/es/upload/index.js +8 -8
  89. package/es/verification-code/index.js +2 -2
  90. package/lib/cui.common.js +918 -864
  91. package/lib/cui.umd.js +918 -864
  92. package/lib/cui.umd.min.js +29 -29
  93. package/package.json +107 -107
  94. package/packages/big-table/src/BigTable.vue +3044 -3044
  95. package/packages/big-table/src/assets/style/table-base.less +370 -370
  96. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  97. package/packages/big-table/src/utils/batchEditing.js +610 -610
  98. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  99. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  100. package/packages/button/src/ButtonPrint/index.vue +739 -728
  101. package/packages/editor/src/Editor.vue +13 -4
  102. package/packages/fabric-chart/src/components/TimeScaleValue.vue +113 -113
  103. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  104. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1079 -1066
  105. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  106. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  107. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  108. package/packages/form-table/src/FormTable.vue +5 -1
  109. package/packages/multi-chat/chat/chatFooter.vue +1594 -1594
  110. package/packages/multi-chat/chat/chatMain.vue +1466 -1466
  111. package/packages/multi-chat/chat/quickReply.vue +439 -439
  112. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  113. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  114. package/packages/multi-chat/store/actions.js +448 -448
  115. package/packages/multi-chat/store/state.js +112 -112
  116. package/packages/scale-view/formitem/r-choice.vue +714 -714
  117. package/packages/scale-view/scaleView.vue +2010 -2010
  118. package/packages/select-person/select-person.vue +1680 -1680
  119. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2468 -2462
  120. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  121. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  122. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  123. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1825 -1825
  124. package/packages/table-filter/src/const/dataOptions.js +43 -43
  125. package/packages/table-filter/src/mixins/mixins.js +692 -695
  126. package/packages/table-filter/src/quick-search/QuickSearch.vue +2116 -2109
  127. package/src/directive/preventReClick.js +12 -12
@@ -1,2462 +1,2468 @@
1
- <template>
2
- <div class="base-search">
3
- <div class="base-container">
4
- <div class="bease-left" ref="baseLeft" v-resize="onResize">
5
- <!-- 行内编辑对应生成的(保存、取消)按钮 -->
6
- <template v-if="visibleInlineOperateBtn">
7
- <div class="btn-custom-wrap">
8
- <a-button v-preventReClick="preventReTime" :style="{ display: isInlineOperating ? 'inline-block' : 'none' }" @click="inlineEditClick" class="btn-custom-class" style="margin: 8px 8px 8px 0" type="primary">
9
- 保存
10
- </a-button>
11
- <a-button v-preventReClick="preventReTime" :style="{ display: isInlineOperating ? 'inline-block' : 'none' }" @click="inlineEditCancel" class="btn-custom-class" style="margin: 8px 8px 8px 0">
12
- 取消
13
- </a-button>
14
- </div>
15
- </template>
16
- <ul v-if="!visibleInlineOperateBtn && !isRowEditing">
17
- <div ref="btnRow" class="btn-row" v-if="isShowSettingBtn">
18
- <a-button class="btn-setting" v-show="currentTempId != '0' && isShowSetting('hideSettingBtn')" icon="setting" @click="handlerSetting">
19
- 设置
20
- <!-- {{ $t("1.1.5.3") }} -->
21
- </a-button>
22
- <a-dropdown overlayClassName="viewList-dropdown" v-if="showViewList">
23
- <a-button class="viewList-button">
24
- <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
25
- </a-button>
26
- <a-menu slot="overlay">
27
- <a-menu-item v-for="(item, index) in viewList" :value="item.id" :key="index" @click="handlerSelectTemp(item.id)" :class="{ 'menu-active': currentTempId === item.id }">
28
- <span>{{ item.name }}</span>
29
- <!-- <a-icon v-if="currentTempId === item.id" type="check" /> -->
30
- </a-menu-item>
31
- </a-menu>
32
- </a-dropdown>
33
- </div>
34
- <slot name="classification"></slot>
35
- <li v-if="showQuickSearch" ref="quickSearchLi">
36
- <a-button class="search-default" type="default" @click="foldQuickSearch">
37
- <svg-icon icon-class="xitongtubiaoBIxitongshaixuan" style="color: #2d7aff; margin-right: 6px"></svg-icon>
38
- 筛选 {{ qqConObjCount ? `(${qqConObjCount})` : '' }}
39
- </a-button>
40
- </li>
41
- <!-- start--筛选外显--start -->
42
- <template v-for="item in outSearchFieldList">
43
- <outQuickSearch :key="item.id + item.random_key" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
44
- </template>
45
- <!-- end--筛选外显--end -->
46
-
47
- <!-- start--筛选外显 跨表--start -->
48
- <template v-for="relationItem in outRelationQuickSearch">
49
- <template v-for="item in relationItem.fieldList">
50
- <outQuickSearch :key="item.id" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
51
- </template>
52
- </template>
53
- <!-- end--筛选外显 跨表--end -->
54
-
55
- <li v-if="isShowSetting('hideSearch') && !showRelatedTreeBtn" ref="inputSearchLi" class="baseSearch-input-search">
56
- <template v-if="outSearchFieldList && outSearchFieldList.length">
57
- <a-input
58
- :style="{ width: (searchInputWidth || inputSearchW) + 'px', margin: '0 8px 8px 0' }"
59
- allowClear
60
- :placeholder="searchPlaceHolder"
61
- :value="currentValue"
62
- @input="$emit('input', $event.target.value)"
63
- @pressEnter="outFilterChange"
64
- class="input-search-com"
65
- >
66
- <template slot="prefix" v-if="showPlaceholderPrefix">
67
- <a-tooltip
68
- :title="searchPlaceHolder"
69
- overlayClassName="basesearch-placeholder-tooltip"
70
- >
71
- <a-icon type="info-circle" class="search-placeholder-icon" />
72
- </a-tooltip>
73
- </template>
74
- </a-input>
75
- </template>
76
- <a-input-search
77
- v-else
78
- class="my-input-search input-search-com"
79
- :style="{ width: (searchInputWidth || inputSearchW) + 'px' }"
80
- @search="onSearch"
81
- allowClear
82
- :placeholder="searchPlaceHolder"
83
- :value="currentValue"
84
- @input="$emit('input', $event.target.value)"
85
- >
86
- <template slot="prefix" v-if="showPlaceholderPrefix">
87
- <a-tooltip
88
- :title="searchPlaceHolder"
89
- overlayClassName="basesearch-placeholder-tooltip"
90
- >
91
- <a-icon type="info-circle" class="search-placeholder-icon" />
92
- </a-tooltip>
93
- </template>
94
- <a-button slot="enterButton" type="primary">
95
- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon>
96
- </a-button>
97
- </a-input-search>
98
- </li>
99
- <li v-if="outSearchFieldList && outSearchFieldList.length">
100
- <a-button type="primary" @click="outFilterChange" style="margin: 0 8px 8px 0">
101
- <a-icon type="search" style="margin-right: 6px" />
102
- 查询
103
- </a-button>
104
- </li>
105
- <li v-if="showResetFilterBtn">
106
- <a-button @click="handleReset" style="margin: 0 8px 8px 0">
107
- <svg-icon icon-class="xitongtubiaoliebiaocaozuoanniushanchu" style="margin-right: 6px"></svg-icon>
108
- 重置
109
- </a-button>
110
- </li>
111
-
112
- <!-- 平铺列表 tree -->
113
- <template v-if="showRelatedTreeBtn">
114
- <li v-if="showRelatedSearch" :class="[isRelatedSearchFold ? 'related-search-input' : 'related-search-input-expand']">
115
- <a-input-search
116
- ref="relatedSearchInput"
117
- class="my-input-search my-input-search-related"
118
- placeholder="请输入关键字搜索"
119
- @search="onRelatedSearch"
120
- allowClear
121
- :value="currentValue"
122
- @input="$emit('input', $event.target.value)"
123
- >
124
- <a-button slot="enterButton" type="primary">
125
- <a-icon type="search" />
126
- <!-- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon> -->
127
- </a-button>
128
- </a-input-search>
129
- </li>
130
- <template v-if="rowTileBtnListTree && rowTileBtnListTree.length === 1">
131
- <a-button type="primary" style="margin-right: 8px; margin-bottom: 8px" @click="handleAddType(rowTileBtnListTree[0])">
132
- {{ rowTileBtnListTree[0].alias || rowTileBtnListTree[0].name }}
133
- </a-button>
134
- </template>
135
- <a-dropdown v-if="rowTileBtnListTree.length > 1 && !isInlineOperating">
136
- <a-menu slot="overlay">
137
- <template v-for="b in rowTileBtnListTree">
138
- <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="handleAddType(b)">
139
- {{ b.alias || b.name }}
140
- <a-icon v-if="b.icon" :type="btnObj[b.icon]" />
141
- <template v-else>
142
- <svg-icon
143
- v-if="b.iconSetting"
144
- :iconClass="JSON.parse(b.iconSetting).icon"
145
- :style="{
146
- marginRight: '8px'
147
- }"
148
- />
149
- </template>
150
- </a-menu-item>
151
- </template>
152
- </a-menu>
153
- <a-button type="primary" ghost style="margin-left: 8px; margin-bottom: 8px">
154
- <!-- 1.1.8.1.6更多 -->
155
- {{ '更多' }} ...
156
- </a-button>
157
- </a-dropdown>
158
- </template>
159
- <template v-if="!nobutton && !showRelatedTreeBtn">
160
- <template v-if="isButtonFolding">
161
- <li class="allBtn" v-if="allBtn && allBtn.length" ref="allBtnLi">
162
- <a-dropdown v-show="!isInlineOperating">
163
- <a-menu slot="overlay">
164
- <template v-for="(b, j) in allBtn">
165
- <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
166
- {{ b.alias || b.name }}
167
- <getBtnIcon :data="b" :btnObj="btnObj" />
168
- </a-menu-item>
169
- <a-menu-item
170
- :key="b.sid"
171
- v-else-if="showButtonTop == 1 && b.type != 'LINK' && currentTempId == '0'"
172
- class="dropdown-btn"
173
- @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)"
174
- >
175
- {{ b.showStyle === 'only_icon' ? '' : b.alias || b.name }}
176
- <getBtnIcon :data="b" :btnObj="btnObj" />
177
- </a-menu-item>
178
- </template>
179
- </a-menu>
180
- <a-button class="ml12 dropdown-button"
181
- >{{ '更多' }}
182
- <a-icon type="down" />
183
- </a-button>
184
- </a-dropdown>
185
- </li>
186
- </template>
187
- <template v-else>
188
- <!-- start--按钮分组--start -->
189
- <template v-if="isShowGroupBtn">
190
- <template v-for="(key, i) in groupBtnObj">
191
- <li :key="i" v-if="key.list && key.list.length > 1" ref="rowTileBtnItem" :data-key="i" data-source="groupBtn">
192
- <ButtonGroup v-show="!key.isHide" :title="i" :list="key.list" :currentTempId="currentTempId" @showDrawer="showDrawer" @clickGroupBtn="clickGroupBtn"></ButtonGroup>
193
- </li>
194
- </template>
195
- </template>
196
- <!-- end--按钮分组--end -->
197
-
198
- <!-- 平铺按钮列表 -->
199
- <template v-for="(item, j) in rowTileBtnList">
200
- <!-- v-if="item.type == 'ADD'" -->
201
- <li ref="rowTileBtnItem" class="rowTileBtn-item 123" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
202
- <template v-if="item.type == 'ADD' || item.type == 'BATCH'">
203
- <a-button
204
- v-preventReClick="preventReTime"
205
- v-show="visibleBtn(item) && !item.isHide"
206
- @click.prevent.stop="showDrawer(item, j)"
207
- class="btn-custom-class"
208
- style="margin: 0 8px 8px 0"
209
- :style="$utils.getBtnStyle(item)"
210
- :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
211
- :ghost="item.showStyle == 'white_bg'"
212
- >
213
- <getBtnIcon :data="item" :btnObj="btnObj" />
214
- <template v-if="item.showStyle !== 'only_icon'">
215
- {{ item.alias || item.name }}
216
- </template>
217
- </a-button>
218
- <a-upload v-if="item.isImportGuage" method="post" :show-upload-list="false" :action="`${axios.defaults.baseURL}/guage/importGuage`" @change="handleUploadChange">
219
- <!-- 上传配置文件 -->
220
- <a-button
221
- class="btn-custom-class"
222
- style="margin: 0 8px 8px 0"
223
- :style="$utils.getBtnStyle(item)"
224
- :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
225
- :ghost="item.showStyle == 'white_bg'"
226
- >
227
- <a-icon type="upload" />
228
- <template v-if="item.showStyle !== 'only_icon'">
229
- {{ item.alias || item.name }}
230
- </template>
231
- </a-button>
232
- </a-upload>
233
- </template>
234
- <template v-else-if="isShowRowTileBtnItem(item)">
235
- <a-button
236
- v-preventReClick="preventReTime"
237
- v-show="visibleBtn(item) && !item.isHide"
238
- @click.prevent.stop="clickBtn(clickRowData, item, clickRowData.my_index, undefined, j)"
239
- class="btn-custom-class"
240
- style="margin: 0 8px 8px 0"
241
- :style="$utils.getBtnStyle(item)"
242
- :type="item.showStyle == 'none_bg' ? 'link' : 'primary'"
243
- :ghost="item.showStyle == 'white_bg'"
244
- >
245
- <getBtnIcon :data="item" :btnObj="btnObj" />
246
- <template v-if="item.showStyle !== 'only_icon'">
247
- {{ item.alias || item.name }}
248
- </template>
249
- </a-button>
250
- </template>
251
- </li>
252
- </template>
253
- <!-- 打印列表-->
254
- <template v-for="(item, j) in rowPrintBtnList">
255
- <li ref="rowTileBtnItem" class="rowTileBtn-item rowPrintBtn-btn" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
256
- <template v-if="item.isVisible && !item.isHide">
257
- <PrintBtn
258
- :printConfig="printConfig"
259
- :baseUrl="printConfig.printBaseUrl"
260
- :strategy="item.strategy"
261
- :btnText="item.name"
262
- :versionType="item.__printConfig && item.__printConfig.versionType"
263
- :port="item.__printConfig && item.__printConfig.port"
264
- :authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
265
- :templateNumber="item.__printConfig && item.__printConfig.number"
266
- :hisParams="item.__printConfig && item.__printConfig.hisParams"
267
- :params="getPrintBtnParams(item)"
268
- :prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
269
- @success="receivePrintSuccess"
270
- @error="receivePrintError"
271
- ></PrintBtn>
272
- </template>
273
- </li>
274
- </template>
275
- <!-- 折叠按钮列表 -->
276
- <li class="rowFoldBtn" v-if="showRowFoldBtnList(rowFoldBtnList, 'rowFoldBtnList')">
277
- <a-dropdown overlayClassName="baseSearch-fold-dropdown" v-show="!isInlineOperating">
278
- <a-menu slot="overlay">
279
- <template v-for="(b, j) in rowFoldBtnList">
280
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="showLiAdd(b)" @click="showDrawer(b, j)">
281
- {{ b.alias || b.name }}
282
- <getBtnIcon :data="b" :btnObj="btnObj" />
283
- </a-menu-item>
284
- <template v-else-if="showLiFold(b)">
285
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
286
- {{ b.alias || b.name }}
287
- <getBtnIcon :data="b" :btnObj="btnObj" />
288
- </a-menu-item>
289
- </template>
290
- </template>
291
- </a-menu>
292
- <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
293
- >{{ '更多' }}
294
- <a-icon type="down" />
295
- </a-button>
296
- </a-dropdown>
297
- </li>
298
- <!-- 自适应折叠 -->
299
- <template v-if="showRowFoldBtnList(rowFoldHideBtnList)">
300
- <a-dropdown overlayClassName="rowFoldHideBtnList-dropdown" v-show="!isInlineOperating">
301
- <a-menu slot="overlay">
302
- <template v-for="(value, key) in rowFoldHideBtnListObj">
303
- <a-menu-item-group :key="key" v-if="showRowFoldBtnList(value.list)">
304
- <template slot="title"></template>
305
- <template v-for="(b, j) in value.list">
306
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
307
- {{ b.alias || b.name }}
308
- <getBtnIcon :data="b" :btnObj="btnObj" />
309
- </a-menu-item>
310
- <template v-else-if="b.type != 'LINK' && currentTempId == '0'">
311
- <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
312
- {{ b.alias || b.name }}
313
- <getBtnIcon :data="b" :btnObj="btnObj" />
314
- </a-menu-item>
315
- </template>
316
- </template>
317
- </a-menu-item-group>
318
- </template>
319
- </a-menu>
320
- <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
321
- >{{ '更多' }}
322
- <a-icon type="down" />
323
- </a-button>
324
- </a-dropdown>
325
- </template>
326
- </template>
327
- </template>
328
- </ul>
329
- </div>
330
- </div>
331
- <div class="base-tabs" v-if="showBaseTabs">
332
- <div v-for="(item, index) in tabConditionList" :key="index" :class="tabIndex === index ? 'base-tabs-item base-tabs-item-active' : 'base-tabs-item'" @click="tabClick(index)"
333
- >{{ item.name }} {{ countTabCondition == 1 && (item.digital || item.digital === 0) ? '(' + (item.digital || 0) + ')' : '' }}</div
334
- >
335
- </div>
336
- <!-- palceholder 文字宽度计算 -->
337
- <span class="baseSearchPlaceholderSpan" ref="baseSearchPlaceholderSpan">
338
- {{ searchPlaceHolder }}
339
- </span>
340
- </div>
341
- </template>
342
-
343
- <script>
344
- /**
345
- * 完成搜索组合组件 BaseSearch
346
- * 使用方式:在需要的vue页中引入注册为子组件后直接使用
347
- * 提供函数:
348
- * 1、输入关键字搜索触发函数onSearch;
349
- * 2、左侧下拉选中搜索触发函数changeSearch;
350
- * 3、右侧快速弹框保存搜索函数onSave(obj);
351
- * 完整例子:<BaseSearch :onSearch='onSearch' @changeSearch='changeSearch' @onSave='onSave'/>
352
- */
353
- import moment from 'moment';
354
- import 'moment/locale/zh-cn';
355
-
356
- import _ from 'lodash';
357
- import vexutils from '@/utils/vexutils';
358
- import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu } from 'ant-design-vue';
359
- import resize from 'vue-resize-directive';
360
-
361
- import { GROUP_TITLE_KEY } from '../const';
362
-
363
- import PrintBtn from '~/button/src/ButtonPrint/index';
364
- // import stepRule from "@/components/table/mixins/stepRule";
365
-
366
- import outQuickSearch from '../components/out-quick-search/out-quick-search';
367
- import utils from '@/utils/utils-map';
368
- import { durationMixin, $utils, filterApiFn, outQuickSearchFn } from '../mixins/mixins';
369
- import tableSearchCon from '../mixins/tableSearchCon';
370
- import svgIcon from '@/component/svg/index.vue';
371
- import 'text-security/text-security.css';
372
- import create from '@/core/create';
373
- import preventReClick from '@/directive/preventReClick';
374
- /** 获取按钮 icon */
375
- import getBtnIcon from '../components/button-icon/getBtnIcon.js';
376
- import ButtonGroup from '../components/button-group/ButtonGroup.vue';
377
-
378
- const EVALUATEList = [
379
- {
380
- label: '一星',
381
- value: '1',
382
- isSelect: false
383
- },
384
- {
385
- label: '二星',
386
- value: '2',
387
- isSelect: false
388
- },
389
- {
390
- label: '三星',
391
- value: '3',
392
- isSelect: false
393
- },
394
- {
395
- label: '四星',
396
- value: '4',
397
- isSelect: false
398
- },
399
- {
400
- label: '五星',
401
- value: '5',
402
- isSelect: false
403
- }
404
- ];
405
-
406
- const BTNOBJ = {
407
- // 按钮icon 映射
408
- copy: 'copy',
409
- pencil: 'edit',
410
- delete: 'delete',
411
- add: 'plus-circle',
412
- download: 'download',
413
- label: 'tag',
414
- queding: 'check',
415
- del: 'close'
416
- };
417
-
418
- export default create({
419
- name: 'base-search',
420
- mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn],
421
- directives: { resize,preventReClick },
422
- props: {
423
- width: {
424
- default: '400px'
425
- },
426
- searchInputWidth:{ // 设置检索框的宽度
427
- type: Number,
428
- default:0
429
- },
430
- onSearch: Function,
431
- rowBtnList: {
432
- type: Array,
433
- default: () => []
434
- },
435
- paramsData: Object,
436
- // downLoad: Function,
437
- showButtonTop: [String, Number],
438
- showSettings: {
439
- type: Object,
440
- default: () => ({})
441
- },
442
- clickRowData: Object,
443
- value: String,
444
- searchFieldList: {
445
- // 搜索的数据
446
- type: Array,
447
- default: () => []
448
- },
449
- searchFieldLimit: {
450
- // 搜索的数据的限制条件
451
- type: Object,
452
- default: () => ({})
453
- },
454
- viewList: {
455
- type: Array,
456
- default: () => []
457
- },
458
- TypeOfDisplay: {
459
- type: String,
460
- default: ''
461
- },
462
- tableAllCheck: {
463
- type: Boolean
464
- },
465
- classificationIndex: Number,
466
- editTableSource: {
467
- default: ''
468
- },
469
- showRelatedTreeBtn: Boolean,
470
- relatedBaseInfo: Object,
471
- onRelatedSearch: Function,
472
- showResetFilterBtn: {
473
- type: Boolean,
474
- default: false
475
- },
476
- qqConObjCount: {
477
- type: Number,
478
- default: 0
479
- },
480
- conditionType: { type: String },
481
- countCondition: { type: [Number, String] },
482
- countTabCondition: { type: Number },
483
- tabConditionNumObj: {
484
- type: Object,
485
- default: () => {}
486
- },
487
- isRelatedSearchFold: {
488
- type: Boolean,
489
- default: true
490
- },
491
- tableId: { type: String },
492
- conditionMap: {
493
- type: Object,
494
- default: () => {}
495
- },
496
- getFilterData: Function,
497
- oldtableData: Array,
498
- isNestTableClick: Boolean,
499
-
500
- isAdmin: {
501
- type: Boolean,
502
- default: false
503
- },
504
-
505
- /**
506
- * 导入量表配置
507
- */
508
- importGuageConfig: {
509
- type: Object,
510
- default: () => ({
511
- action: ''
512
- })
513
- },
514
-
515
- /**
516
- * 打印配置
517
- */
518
- printConfig: {
519
- type: Object,
520
- default: () => ({
521
- printBaseUrl: '/print/assembly',
522
- postStepRule: () => Promise.resolve({})
523
- })
524
- },
525
-
526
- gettersConfig: {
527
- type: Object,
528
- default: () => ({
529
- getIsTile: '',
530
- selectRowObj: [],
531
- isInlineOperating: false,
532
- printNumberCache: {}
533
- })
534
- },
535
-
536
- /**
537
- * 是否展示行编辑的按钮
538
- */
539
- visibleInlineOperateBtn: {
540
- type: Boolean,
541
- default: false
542
- },
543
-
544
- tabConditionList: {
545
- type: Array,
546
- default: () => []
547
- },
548
-
549
- lastOutSearchFieldList: {
550
- type: Array,
551
- default: () => []
552
- },
553
- lastOutRelationQuickSearch: {
554
- type: Array,
555
- default: () => []
556
- },
557
- relationTableList: {
558
- type: Array,
559
- default: () => []
560
- },
561
- /**
562
- * 筛选外显
563
- */
564
- filterApiConfigOutSearch: {
565
- type: Object,
566
- default: () => ({})
567
- },
568
- useFieldList: Array,
569
- editTableUid: [String, Number],
570
-
571
- preventReTime:{
572
- type: Number,
573
- default: 1000
574
- }
575
- },
576
- components: {
577
- [Button.name]: Button,
578
- [Icon.name]: Icon,
579
- [Dropdown.name]: Dropdown,
580
- [Select.name]: Select,
581
- [Upload.name]: Upload,
582
- [DatePicker.name]: DatePicker,
583
- [DatePicker.RangePicker.name]: DatePicker.RangePicker,
584
- [Input.name]: Input,
585
- [Input.Search.name]: Input.Search,
586
- [Menu.name]: Menu,
587
- [Menu.Item.name]: Menu.Item,
588
- [Menu.ItemGroup.name]: Menu.ItemGroup,
589
- getBtnIcon,
590
- PrintBtn,
591
- outQuickSearch,
592
- ButtonGroup,
593
- svgIcon
594
- },
595
- inject: {
596
- editTableWrapper: {
597
- type: Object,
598
- default: () => {}
599
- }
600
- },
601
- computed: {
602
- isOrgAdmin() {
603
- return this.isAdmin;
604
- },
605
- currentValue() {
606
- return this.value;
607
- },
608
- allBtn() {
609
- const { rowTileBtnList, rowFoldBtnList } = this;
610
- let allBtn = [];
611
- allBtn.push(...rowTileBtnList, ...rowFoldBtnList);
612
- return allBtn;
613
- },
614
- isButtonFolding() {
615
- // 首页配置
616
- const { editTableWrapper } = this;
617
- return editTableWrapper?.options?.isButtonFolding || false;
618
- },
619
- isShowSettingBtn() {
620
- const { $attrs, viewList, noSetting } = this;
621
- if (this.showRelatedTreeBtn) return;
622
- return $attrs.isTree != 1 && viewList.length > 0 && !noSetting;
623
- },
624
- showDownCurSelectData() {
625
- return this.selectRowObj.filter(item => !(GROUP_TITLE_KEY in (item || {})))?.length;
626
- },
627
- showRowFoldBtnList() {
628
- return function(list, key) {
629
- if (key === 'rowFoldBtnList' && !this.isShowSetting('buttonAdaption')) return false;
630
- if (!list || !list.length) return false;
631
-
632
- let hasGroupBtnList = list.filter(item => item.buttonGroup);
633
- if (hasGroupBtnList.length) {
634
- let showGroup = hasGroupBtnList.some(item => item.isShowFoldGroupBtn);
635
- if (showGroup) return true;
636
- }
637
-
638
- // 只有一个按钮 分组按钮 非自适应
639
- if (list.length === 1 && list[0].buttonGroup && list[0].isButtonGroup && !list[0].isShowFoldGroupBtn) return false;
640
-
641
- let visibleList = list.filter(item => item.isVisible && !item.buttonGroup);
642
- if (!visibleList || !visibleList.length) return false;
643
- let hasAdd = visibleList.some(item => item.type === 'ADD');
644
- if (hasAdd) {
645
- return true;
646
- } else {
647
- if (this.currentTempId != 0) return false;
648
- let notLinkArr = visibleList.filter(item => item.type !== 'LINK');
649
- if (!notLinkArr || !notLinkArr.length) return false;
650
- }
651
- return true;
652
- };
653
- },
654
- initPageResize() {
655
- let { showSettings, TypeOfDisplay, classificationIndex } = this;
656
- return {
657
- showSettings,
658
- TypeOfDisplay,
659
- classificationIndex
660
- };
661
- },
662
- isShowRowTileBtnItem() {
663
- return function(item) {
664
- return this.showButtonTop == 1 && item.type != 'LINK' && this.currentTempId == '0';
665
- };
666
- },
667
- showRelatedSearchFold() {
668
- if (
669
- !this.isShowSettingBtn &&
670
- !this.isShowSetting('hideQuickSearch') &&
671
- this.outSearchFieldList.length == 0 &&
672
- this.outRelationQuickSearch.length == 0 &&
673
- !this.showResetFilterBtn &&
674
- !this.$slots.classification
675
- ) {
676
- return false;
677
- } else {
678
- return this.isRelatedSearchFold;
679
- }
680
- },
681
- handlePickerShowTime() {
682
- return function(item) {
683
- if (!item.showTime) return false;
684
- return {
685
- defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
686
- };
687
- };
688
- },
689
- isShowGroupBtn() {
690
- if (!this.groupBtnObj || !Object.keys(this.groupBtnObj).length) return false;
691
- return true;
692
- },
693
- showLi() {
694
- return function(item) {
695
- if (item.buttonGroup) {
696
- return item.isShow == '1' && item.buttonGroup && !item.isButtonGroup;
697
- }
698
- return item.isShow == '1';
699
- };
700
- },
701
- showLiAdd() {
702
- return function(b) {
703
- if (b.buttonGroup) {
704
- return b.type == 'ADD' && b.buttonGroup && !b.isButtonGroup;
705
- }
706
- return b.type == 'ADD';
707
- };
708
- },
709
- showLiFold() {
710
- return function(b) {
711
- if (b.buttonGroup) {
712
- return b.type != 'LINK' && this.currentTempId == '0' && b.buttonGroup && !b.isButtonGroup;
713
- }
714
- return b.type != 'LINK' && this.currentTempId == '0';
715
- };
716
- },
717
-
718
- getIsTile() {
719
- return this?.gettersConfig?.getIsTile || '';
720
- },
721
- selectRowObj() {
722
- return this?.gettersConfig?.selectRowObj || [];
723
- },
724
- isInlineOperating() {
725
- return this?.gettersConfig?.isInlineOperating || false;
726
- },
727
- printNumberCache() {
728
- return this?.gettersConfig?.printNumberCache || false;
729
- },
730
-
731
- // 全部行编辑
732
- isBatchEditing() {
733
- return this?.gettersConfig?.isBatchEditing || false;
734
- },
735
- curBatchBtnData() {
736
- return this?.gettersConfig?.curBatchBtnData || {};
737
- },
738
- isRowEditing() {
739
- return this?.gettersConfig?.isRowEditing || false;
740
- },
741
- // 是否有高级筛选外显
742
- showOutSearch() {
743
- return this.outSearchFieldList?.length || this.outRelationQuickSearch?.length;
744
- },
745
- showViewList(){
746
- if (this.editTableSource === "relatedComponent") {
747
- return this.relatedBaseInfo.showType != "TREE";
748
- }
749
- return !this.optionsValue('hideViewList');
750
- },
751
- optionsValue() {
752
- return function(key) {
753
- return this.$attrs.tableOptions?.[key];
754
- }
755
- },
756
- searchPlaceHolder() {
757
- if (!this.useFieldList?.length || this.showRelatedTreeBtn) return "请输入关键字搜索";
758
- let str = "";
759
- let strList = this.useFieldList
760
- ?.map(item => {
761
- if (item.isSearch != 1) return "";
762
- return item.formTitle || item.alias || item.title;
763
- })
764
- .filter(Boolean);
765
- if(!strList?.length) return ''
766
- str = "输入" + strList.join("/");
767
- return str || "请输入关键字搜索";
768
- },
769
- showRelatedSearch() {
770
- return this.showRelatedTreeBtn && this.isShowSetting('hideSearch')
771
- },
772
- showQuickSearch() {
773
- let showQuick = this.isShowSetting('hideQuickSearch')
774
- // 平铺列表, 左侧不为tree, 而是table
775
- if(this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != "TREE") return showQuick
776
- return showQuick && this.isRelatedSearchFold
777
- },
778
- showBaseTabs() {
779
- return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing
780
- }
781
- },
782
- data() {
783
- return {
784
- modalVisible: false,
785
- currentTempId: '0',
786
- viewCongfigList: [],
787
- isTile: false,
788
- conditionList: [],
789
- displayCategoryList: [],
790
- settingId: '',
791
- searchDefName: '',
792
- rowTileBtnList: [],
793
- rowFoldBtnList: [],
794
- rowPrintBtnList: [],
795
- rowFoldHideBtnList: [], // 按钮自适应折叠list
796
- rowFoldHideBtnListObj: {}, // 按钮自适应折叠分类
797
- batchRelationBtnIds: [], // 批量操作按钮,关联的对应操作按钮id集
798
- relationBtnBatchBtnIds: [], // 有关联对应操作按钮的批量操作按钮id集
799
-
800
- nobutton: false, // 不展示按钮设置 false 展示,true 不展示
801
- noSetting: false, // 不展示按钮设置 false 展示,true 不展示
802
- isChangeWindow: false,
803
- modalWidth: '700px',
804
- modalHeight: '60vh',
805
- label_max_count: 8,
806
- baseLeftWidth: 0,
807
- btnRowWidth: 0,
808
- classificationWidth: 0,
809
- inputSearchWidth: 0,
810
- quickSearchWidth: 0,
811
- downloadDropdownWidth: 0,
812
- diffWidth: 0,
813
- resizeFlag: false,
814
- rowTileBtnListTree: [],
815
- outSearchFieldList: [],
816
- tabIndex: -1,
817
- // tabConditionList: [],
818
-
819
- /* 打印相关 */
820
- printBtnPrevFnWatch: {},
821
- printPrevFinish: false,
822
- printBtnPrevFnWatchTimeoutTimer: null,
823
- printBtn: {},
824
- groupBtnObj: {},
825
- btnObj: BTNOBJ,
826
- printBtnStrategys: [], // 打印按钮组策略list
827
- outRelationQuickSearch: [], // 关联表 筛选外显
828
- inputSearchW: 200,
829
- showPlaceholderPrefix: false
830
- };
831
- },
832
- created() {
833
- if (this.getIsTile !== undefined) {
834
- this.isTile = this.getIsTile;
835
- }
836
- },
837
- destroyed() {},
838
- methods: {
839
- tabClick(index) {
840
- if (this.tabIndex === index) return false;
841
- this.tabIndex = index;
842
- if (index !== -1) this.$emit('tabClick', this.tabConditionList[index]);
843
- },
844
- pageResize(obj) {
845
- if (this.resizeFlag || this.visibleInlineOperateBtn || this.isRowEditing) return;
846
- let baseLeft = this.$refs['baseLeft'];
847
- if (!baseLeft) return;
848
- this.resizeFlag = true;
849
- this.baseLeftWidth = baseLeft.clientWidth;
850
- this.classificationWidth = this.classificationIndex === 2 ? 160 : 0;
851
- this.btnRowWidth = this.$refs['btnRow']?.clientWidth || 0;
852
- this.inputSearchWidth = this.$refs['inputSearchLi']?.clientWidth || 0;
853
- this.quickSearchWidth = this.$refs['quickSearchLi']?.clientWidth || 0;
854
- // this.downloadDropdownWidth = this.$refs["downloadDropdownLi"]?.clientWidth || 0;
855
- let defaultTotal = this.btnRowWidth + this.classificationWidth + this.inputSearchWidth + this.quickSearchWidth;
856
-
857
- let diffWidth = this.baseLeftWidth - defaultTotal;
858
- // 平铺列表占2行
859
- if (this.editTableSource === 'relatedComponent') {
860
- diffWidth += this.baseLeftWidth;
861
- }
862
- this.diffWidth = diffWidth;
863
- if (!obj.type) return;
864
- if (obj.type === 'resize') {
865
- this.handleTileBtnWidth();
866
- }
867
- },
868
- onResize() {
869
- if (this.isButtonFolding || this.isShowSetting('buttonAdaption') || this.relatedIsTree == 1 || this.visibleInlineOperateBtn || this.isRowEditing) return;
870
- utils.debounce(this.pageResize({ type: 'resize' }), 300);
871
- },
872
- async saveListIsTile() {
873
- let url = `/tableList/saveListIsTile`;
874
- let params = {
875
- isTile: this.isTile ? '1' : '0'
876
- };
877
- let res = await this.handleGetConfigApi(params, 'requestSaveListIsTile');
878
- if (res) {
879
- this.$emit('setIsTile', this.isTile);
880
- this.$message.success(this.$t('1.9.23'));
881
- }
882
- },
883
- getTableCondiTionListRequest(first) {
884
- this.getTableCondiTionList(first).then(checked => {
885
- this.reloadList(checked);
886
- });
887
- },
888
- getTableCondiTionList(first, conditionMap = {}) {
889
- let tableId = this.tableId;
890
- if (!tableId) return new Promise(resolve => resolve(false));
891
- let conditionMapTemp = Object.keys(conditionMap).length > 0 ? conditionMap : this.conditionMap;
892
-
893
- return new Promise((resolve, reject) => {
894
- if (Object.keys(conditionMapTemp).length > 0) {
895
- this.conditionList = conditionMapTemp.conditionList || [];
896
- this.displayCategoryList = conditionMapTemp.displayCategoryList || [];
897
- let obj = {
898
- conditionList: this.conditionList,
899
- displayCategoryList: this.displayCategoryList
900
- };
901
- this.$emit('getQuickSearchListObj', obj);
902
- this.settingId = conditionMapTemp.settingId;
903
- const checked = this.conditionList.find(item => item.isDefault) || {
904
- name: '全部数据' || this.$t('1.1.5.1'),
905
- sid: 'all_data'
906
- };
907
- this.searchDefName = checked.name;
908
- // if (this.conditionType === "keyword") {
909
- this.tabConditionList = conditionMapTemp.tabConditionList || []; // 获取页签tab
910
- if (this.tabIndex === -1) {
911
- this.tabIndex = conditionMapTemp.tabConditionList && conditionMapTemp.tabConditionList.findIndex(item => item.isDefault); // 查询默认选中的标签
912
- }
913
- // }
914
- if (this.$attrs.tableOptions?.filterCondition?.displayCategory && first) {
915
- resolve({
916
- name: this.$attrs.tableOptions?.filterCondition?.name,
917
- sid: this.$attrs.tableOptions?.filterCondition?.displayCategory
918
- });
919
- }
920
- resolve(checked);
921
- } else {
922
- resolve({});
923
- }
924
- });
925
-
926
- // }
927
- // });
928
- },
929
- async getTableCondiTionListNew(tableId) {
930
- if (!tableId) return new Promise(resolve => resolve(false));
931
- let params = { tableId };
932
- let url = `/tableList/getTableCondiTionList`;
933
- return this.axios
934
- .get(url, { params })
935
- .then(({ data }) => {
936
- if (data && data.result == 'SUCCESS') {
937
- // 设置分类数据,用于优化组件内的多次请求分类
938
- this.$emit('setConditionMap', data.map);
939
- return data.map;
940
- }
941
- })
942
- .catch(err => {
943
- console.log(err);
944
- });
945
- },
946
- foldQuickSearch() {
947
- this.$emit('foldQuickSearch', true);
948
- },
949
- openModal() {
950
- this.modalVisible = true;
951
- },
952
- closeModal() {
953
- this.resetChangeWindow();
954
- this.modalVisible = false;
955
- },
956
- resetChangeWindow() {
957
- this.modalWidth = '700px';
958
- this.modalHeight = '60vh';
959
- this.isChangeWindow = false;
960
- },
961
- changeModalWindow() {
962
- this.isChangeWindow = !this.isChangeWindow;
963
- let docHeight = document.body.clientHeight;
964
- this.modalWidth = this.modalWidth === '700px' ? `100%` : '700px';
965
- this.modalHeight = this.modalHeight === '60vh' ? `${docHeight - 108}px` : '60vh';
966
-
967
- if (this.modalWidth === '700px') {
968
- this.label_max_count = 8;
969
- } else {
970
- this.$nextTick(() => {
971
- let ele = document.querySelector('.quickSearch_label-container');
972
- ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
973
- });
974
- }
975
- },
976
- openSaveToCalss() {
977
- this.$refs.quicksearch?.openSaveToCalss();
978
- },
979
- onSaveSearch() {
980
- this.$refs.quicksearch?.onSave();
981
- },
982
- onSave(obj, isOutFilter = false, config = {}) {
983
- if (!this.validConObj(obj, this.searchFieldList, this.searchFieldLimit)) return false;
984
- let copy = [];
985
- if (this.outSearchFieldList.length) {
986
- copy = _.cloneDeep(this.outSearchFieldList, true);
987
- }
988
- let copyRelation = [];
989
- if (this.outRelationQuickSearch.length) {
990
- copyRelation = _.cloneDeep(this.outRelationQuickSearch, true);
991
- }
992
- this.$emit('onSave', obj, isOutFilter, copy, copyRelation, config);
993
- this.modalVisible = false;
994
- },
995
- // 外部调用
996
- editTableGetConObj() {
997
- if (!this.showOutSearch) return;
998
- let conObj = this.getConObjParams() || [];
999
- if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return false;
1000
- return conObj;
1001
- },
1002
- clearData() {
1003
- this.$refs.quicksearch?.clearData();
1004
- },
1005
- /**
1006
- * type 1-预览 2-打印
1007
- */
1008
- handlePrint(clickBtn, btn, type, j) {
1009
- btn.printType = type;
1010
- this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1011
- },
1012
- showDrawer(btn, j) {
1013
- let hasSelectRows = this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0;
1014
- let isMultiSelect = hasSelectRows || this.tableAllCheck;
1015
-
1016
- if ((btn.name.includes('批量') && btn.type == 'ADD') || btn.type == 'BATCH') {
1017
- // const { settingObj = {} } = btn || {};
1018
- let settingObj = {};
1019
- let settingList = btn.setting || '{}';
1020
- if (utils.isJSON(settingList)) {
1021
- let btnSetting = JSON.parse(settingList);
1022
- if (Array.isArray(btnSetting)) {
1023
- settingObj = btnSetting[0] || {};
1024
- } else {
1025
- settingObj = btnSetting;
1026
- }
1027
- }
1028
- let trigger_type = settingObj?.trigger_type;
1029
-
1030
- // 全部行编辑
1031
- if (trigger_type == 'EDIT_ROW' || settingObj?.editAllRow == 1) {
1032
- this.handleBtnEvent(btn, j);
1033
- return;
1034
- }
1035
-
1036
- if (trigger_type == 'SCAN' && btn.type == 'ADD') {
1037
- this.handleBtnEvent(btn, j);
1038
- return;
1039
- }
1040
-
1041
- if (isMultiSelect) {
1042
- if (settingObj.isTips && settingObj.isTips == 0) {
1043
- this.handleBtnEvent(btn, j);
1044
- return;
1045
- }
1046
- // 批量操作增加确认
1047
- let params = { ...this.paramsData };
1048
- params.table = {};
1049
- if (settingObj.tipsMsg) {
1050
- if (settingObj.tipsMsg.includes('form.selectRows')) {
1051
- settingObj.tipsMsg = utils.handleMultiTips(settingObj.tipsMsg, [...params.form.selectRows]);
1052
- } else {
1053
- settingObj.tipsMsg = utils.handleSysParams(settingObj.tipsMsg, {
1054
- ...params
1055
- });
1056
- }
1057
- }
1058
- const h = this.$createElement;
1059
- this.$confirm({
1060
- title: h(
1061
- 'div',
1062
- {
1063
- directives: [
1064
- {
1065
- name: 'drag-move',
1066
- value: {
1067
- target: 'ant-modal-confirm-body'
1068
- }
1069
- }
1070
- ],
1071
- domProps: {
1072
- innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1073
- }
1074
- },
1075
- // settingObj.tipsMsg || `是否确认${btn.name}`
1076
- ),
1077
- okText: '确定',
1078
- cancelText: '取消',
1079
- onOk: () => {
1080
- this.handleBtnEvent(btn, j);
1081
- },
1082
- onCancel() {
1083
- console.log('Cancel');
1084
- },
1085
- class: 'test'
1086
- });
1087
- } else {
1088
- if (!btn.canHandleUniline) {
1089
- // 1.9.295
1090
- this.$message.warning(`请勾选需要${btn.name}的数据`);
1091
- return;
1092
- }
1093
- this.clickBtn(
1094
- this.clickRowData,
1095
- // 找到对应的单行操作按钮
1096
- this.getUnilineBtn(btn),
1097
- this.clickRowData.my_index,
1098
- true,
1099
- j
1100
- );
1101
- }
1102
- } else {
1103
- if (btn.type == 'ADD' || btn.type == 'BATCH') {
1104
- this.handleBtnEvent(btn, j);
1105
- return;
1106
- }
1107
- this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, j);
1108
- }
1109
- },
1110
- getUnilineBtn(BatchBtn) {
1111
- let unilineBtnId = this.batchRelationBtnIds[this.relationBtnBatchBtnIds.indexOf(BatchBtn.id)];
1112
- let unilineBtnObj = null;
1113
- this.allBtn.forEach(i => {
1114
- if (i.id == unilineBtnId) {
1115
- unilineBtnObj = i;
1116
- }
1117
- });
1118
- return unilineBtnObj;
1119
- },
1120
- handleBtnEvent(btn, j) {
1121
- let indexList = [];
1122
- this.$emit('clearTeamTitleName');
1123
- if (this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0) {
1124
- indexList = this.paramsData.form.selectRows.map(item => {
1125
- if (btn.type == 'BATCH') {
1126
- delete item.SHOW_BUTTON_IDS;
1127
- delete item.operatorColumn;
1128
- }
1129
- return item.my_index;
1130
- });
1131
- }
1132
- let setData = JSON.parse(btn.setting);
1133
- let settingList = JSON.parse(btn.setting);
1134
- /** 按钮对象需求:add类型的 setting 可能是 Array/Object*/
1135
- if (btn.type === 'ADD' || btn.type == 'BATCH') {
1136
- if (Array.isArray(settingList)) {
1137
- setData = settingList[0] || {};
1138
- } else {
1139
- setData = settingList;
1140
- }
1141
- this.paramsData.table = {};
1142
- }
1143
- if (setData.trigger_type == 'ABOUT_ITEM') {
1144
- this.$message.error('按钮事件配置有误');
1145
- return;
1146
- }
1147
- let params = setData.params || [];
1148
- if (setData.trigger_type == 'QR_CODE') {
1149
- params.forEach(item => {
1150
- item.p_value = item.p_value?.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
1151
- return $1 || _v;
1152
- });
1153
- });
1154
- }
1155
- let paramsData = utils.setParamsValue(params, this.paramsData);
1156
- Object.assign(btn, {
1157
- _index_: j
1158
- })
1159
- let btnData = {
1160
- btnData: Object.assign(setData, {
1161
- paramsData: paramsData,
1162
- btnName: btn.name,
1163
- _params_data: this.paramsData,
1164
- _type_: btn.type
1165
- }),
1166
- indexList: indexList,
1167
- btnConfig: JSON.parse(JSON.stringify(btn)),
1168
- _params_data: this.paramsData,
1169
- _type_: btn.type
1170
- };
1171
- this.$emit('btnEvent', btnData);
1172
- },
1173
-
1174
- // 筛选分类相关的
1175
- async updateTableCondiTion() {
1176
- await this.getTableCondiTionListNew(this.tableId);
1177
- this.getTableCondiTionListRequest();
1178
- },
1179
- async CondiTionListInit() {
1180
- await this.getTableCondiTionListNew(this.tableId);
1181
- this.getTableCondiTionListRequest();
1182
- },
1183
- async saveGetTableCondiTionList(options) {
1184
- await this.getTableCondiTionListNew(this.tableId);
1185
- this.getTableCondiTionList();
1186
- this.$emit('getClassification', options);
1187
- },
1188
- changeSearch(key, item) {
1189
- if (key == 'all') {
1190
- this.searchDefName = '全部数据' || this.$t('1.1.5.1');
1191
- } else {
1192
- this.searchDefName = item.name;
1193
- }
1194
- this.$refs.quicksearch.clearData();
1195
- this.$emit('changeSearch', key, item);
1196
- },
1197
- changeSearchTile(val) {
1198
- this.isTile = val;
1199
- this.saveListIsTile();
1200
- },
1201
- openSetting() {
1202
- this.$refs.search.handleMenuClick('setting');
1203
- },
1204
- reloadList(item) {
1205
- this.$refs.quicksearch?.clearData();
1206
- this.$emit('reloadList', item);
1207
- },
1208
- clickBtn(data, item, index, skip, j) {
1209
- this.$emit('clearTeamTitleName');
1210
- if ((item.name.includes('批量') && item.type == 'ADD' && !skip) || (item.type == 'BATCH' && !skip)) {
1211
- this.showDrawer(item, j);
1212
- return;
1213
- }
1214
- if (Object.keys(data || {}).length === 0 && !this.isPrintBtn(item)) {
1215
- // 请点击要操作的数据1.9.140
1216
- this.$message.info('请点击要操作的数据' || this.$t('1.9.140'));
1217
- return;
1218
- }
1219
- Object.assign(item, {
1220
- _index_: j,
1221
- })
1222
- this.$emit('clickBtn', data, item, index);
1223
- },
1224
- clickGroupBtn(btn, j) {
1225
- this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, undefined, j);
1226
- },
1227
- handlerSetting() {
1228
- this.$emit('handlerSetting');
1229
- },
1230
- // 请求视图列表
1231
- handlerReqAllConfigView() {
1232
- let params = {
1233
- type: 'PC',
1234
- typeTable: 'TABLE_LIST',
1235
- tableId: this.tableId,
1236
- page: 1,
1237
- rows: 20
1238
- };
1239
- this.axios
1240
- .get('/tableListConfigView/getTableListConfigViewAll', {
1241
- params: params
1242
- })
1243
- .then(({ data }) => {
1244
- if (data.rows) {
1245
- let viewCongfigList = data.rows || [];
1246
- if (viewCongfigList.length > 0) {
1247
- // 查找默认值
1248
- let curItem = viewCongfigList.find(v => v.mark == 1);
1249
- this.currentTempId = curItem ? curItem.id : '0';
1250
- this.$emit('handlerChangeView', this.currentTempId);
1251
- } else {
1252
- this.currentTempId = '0';
1253
- this.$emit('handlerChangeView', this.currentTempId);
1254
- }
1255
-
1256
- this.$set(this, 'viewCongfigList', viewCongfigList);
1257
- }
1258
- });
1259
- },
1260
- handlerSelectTemp(e) {
1261
- if (this.currentTempId === e) return;
1262
- this.currentTempId = e;
1263
- const tab = e == 0 ? 'bigTable' : null;
1264
- this.$emit('handlerChangeView', e, tab);
1265
- let f = this.viewList.findIndex(v => v.id == e);
1266
- this.resetCheckStatus();
1267
- this.$nextTick(() => {
1268
- this.formatRowBtnList();
1269
- });
1270
- },
1271
- isShowSetting(v) {
1272
- if (v == 'hideSettingBtn') {
1273
- return this.isOrgAdmin || this.showSettings[v] == 0;
1274
- } else {
1275
- if (this.showRelatedTreeBtn) {
1276
- return this.relatedBaseInfo[v] == 0;
1277
- }
1278
- return this.showSettings[v] == 0;
1279
- }
1280
- },
1281
- setBatchRelationBtnIds(list) {
1282
- let showButtonTop = !!this.showButtonTop;
1283
- if (!showButtonTop) return false;
1284
-
1285
- list.forEach(item => {
1286
- let relationBtnId = JSON.parse(item.setting).relationBtnId;
1287
- if (item.type === 'BATCH' && relationBtnId) {
1288
- this.relationBtnBatchBtnIds.push(item.id);
1289
- this.batchRelationBtnIds.push(relationBtnId);
1290
- }
1291
- });
1292
- },
1293
- setBtnStatus(btn) {
1294
- const btnObj = utils.getRowOperatorIdSetting({}, btn);
1295
- const { settingObj = {} } = btnObj || {};
1296
- let isAllSelect = this.tableAllCheck;
1297
- let isMultiSelect = !!this.paramsData.form.selectIds;
1298
- let isBatchBtn = btn.type === 'BATCH';
1299
- let isAddBtn = btn.type === 'ADD';
1300
- let isSQLSAVEBtn = settingObj.trigger_type === 'SQLSAVE';
1301
- let isLineBtn = btn.type === 'EDIT' || btn.type === 'DELETE';
1302
- let isImportGuage = settingObj.trigger_type === 'GUAGE' && settingObj.guage_type == 'importGuage';
1303
-
1304
- let isEditRow = settingObj.trigger_type === 'EDIT_ROW';
1305
- let editAllRow = settingObj.editAllRow == 1;
1306
-
1307
- // 批量&&行编辑&&全部行编辑 直接展示
1308
- if (isBatchBtn && isEditRow && editAllRow) {
1309
- btn.isVisible = true;
1310
- return;
1311
- }
1312
-
1313
- // 默认情况下 只展示新增&下载
1314
- if (!this.showDownCurSelectData) {
1315
- btn.isVisible = isAddBtn ? true : false;
1316
- if (!isImportGuage) return;
1317
- }
1318
-
1319
- // btn.settingObj.guage_type == "importGuage";
1320
- // 全选状态下,只有入口类型的批量按钮展示(因当前版本仅支持入口类型的全选批量操作
1321
- if (isBatchBtn && isAllSelect) {
1322
- btn.isVisible = isSQLSAVEBtn;
1323
- return;
1324
- }
1325
-
1326
- // 批量操作按钮,如果有绑定对应单行操作按钮,则批量按钮开启单行操作
1327
- let relationBtnId = JSON.parse(btn.setting).relationBtnId;
1328
- if (isBatchBtn && relationBtnId) {
1329
- btn.canHandleUniline = true;
1330
- }
1331
-
1332
- // 批量按钮关联的对应按钮
1333
- if (this.showDownCurSelectData > 1 && isLineBtn) {
1334
- btn.isVisible = false;
1335
- } else {
1336
- if (isBatchBtn && btn.chooseTwoData == 1) {
1337
- btn.isVisible = !this.batchRelationBtnIds.includes(btn.id) && this.showDownCurSelectData > 1;
1338
- } else {
1339
- btn.isVisible = !this.batchRelationBtnIds.includes(btn.id);
1340
- }
1341
- }
1342
-
1343
- // 未绑定了行级按钮的批量按钮,默认隐藏, 勾选展示
1344
- if (isBatchBtn && !relationBtnId && this.showDownCurSelectData > 1) {
1345
- btn.isVisible = isMultiSelect;
1346
- }
1347
- // 量表导入按钮
1348
- if (isImportGuage) {
1349
- btn.isImportGuage = true;
1350
- btn.isVisible = false;
1351
- }
1352
- },
1353
- // 处理分组按钮
1354
- handleButtonGroup(buttonList) {
1355
- let useBttonList = buttonList
1356
- .map(v => {
1357
- v.isButtonGroup = false;
1358
- // 有分组名 非隐藏
1359
- if (!v.buttonGroup || !v.isVisible || v.isShow != 1) return null;
1360
- if (v.type === 'ADD' || v.type == 'BATCH') return v;
1361
- if (this.showButtonTop != 1) return null;
1362
- return v;
1363
- })
1364
- .filter(Boolean);
1365
- if (!useBttonList.length) return;
1366
- let groupRes = vexutils.groupBy(useBttonList, 'buttonGroup');
1367
- if (!groupRes || !Object.keys(groupRes).length) return;
1368
- let resObj = {};
1369
- Object.keys(groupRes).forEach(item => {
1370
- let list = groupRes[item];
1371
- // 超过一个才展示
1372
- if (item && list?.length > 1) {
1373
- resObj[item] = {
1374
- key: item,
1375
- isHide: false,
1376
- list: list,
1377
- clientWidth: 0,
1378
- isVisible: true
1379
- };
1380
- list.forEach(v => (v.isButtonGroup = true));
1381
- }
1382
- });
1383
- this.groupBtnObj = resObj;
1384
- },
1385
- async formatRowBtnList() {
1386
- let rowFoldBtnList = [];
1387
- let rowTileBtnList = [];
1388
- let rowPrintBtnList = [];
1389
- this.rowFoldBtnList = [];
1390
- this.rowTileBtnList = [];
1391
- this.rowPrintBtnList = [];
1392
- this.rowFoldHideBtnList = [];
1393
- this.batchRelationBtnIds = [];
1394
- this.relationBtnBatchBtnIds = [];
1395
- this.groupBtnObj = {};
1396
- let useButton = [];
1397
- // let tempBtnList = this.rowBtnList;
1398
- // // 按钮置顶时 过滤掉行级按钮中 仅图标
1399
- // if (this.showButtonTop == 1) {
1400
- // tempBtnList = tempBtnList.filter(v => {
1401
- // if (["EDIT", "DELETE"].includes(v.type)) {
1402
- // if (v.showStyle != "only_icon") return v;
1403
- // } else {
1404
- // return v;
1405
- // }
1406
- // });
1407
- // }
1408
- if (!this.rowBtnList?.length) return;
1409
- this.setBatchRelationBtnIds(this.rowBtnList);
1410
- let rowBtnList = this.rowBtnList;
1411
-
1412
- // 子列表只留下行级按钮
1413
- // if (this.isNestTableClick) {
1414
- // rowBtnList = this.rowBtnList.filter(item => item.type != 'ADD' && item.type != 'BATCH');
1415
- // }
1416
-
1417
- rowBtnList.forEach(btn => {
1418
- if (!(btn.isShow == '1' && btn.type != 'LINK')) return;
1419
- btn.isHide = false;
1420
- btn.isButtonGroup = false;
1421
- let cloneBtn = _.cloneDeep(btn);
1422
- this.setBtnStatus(cloneBtn);
1423
- // 按钮自适应 即使折叠也平铺显示出来
1424
- if (this.isShowSetting('buttonAdaption')) {
1425
- if (btn.toggle == 'fold') {
1426
- if (btn.type != 'ADD' && btn.type != 'BATCH' && this.showButtonTop == 0) return;
1427
- if (!this.isPrintBtn(btn)) {
1428
- rowFoldBtnList.push(cloneBtn);
1429
- }
1430
- } else {
1431
- rowTileBtnList.push(cloneBtn);
1432
- }
1433
- } else {
1434
- rowTileBtnList.push(cloneBtn);
1435
- }
1436
- useButton.push(cloneBtn);
1437
- });
1438
- if (this.isShowSetting('buttonAdaption')) {
1439
- this.rowFoldBtnList = rowFoldBtnList;
1440
- }
1441
-
1442
- this.rowTileBtnList = rowTileBtnList.filter(i => {
1443
- if (this.isPrintBtn(i)) {
1444
- rowPrintBtnList.push(i);
1445
- } else {
1446
- return i;
1447
- }
1448
- });
1449
-
1450
- let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
1451
- rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList);
1452
- // this.rowPrintBtnList = rowPrintBtnList;
1453
- // 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
1454
- this.rowPrintBtnList = rowPrintBtnList.map(item => {
1455
- const obj = this.printBtnStrategys.find(v => v.id === item.settingObj[0].trigger_id);
1456
- item.strategy = obj?.setting ? JSON.parse(obj.setting).strategy : 'MULTI';
1457
- return item;
1458
- });
1459
-
1460
- this.hideInlineOperationBtn();
1461
-
1462
- // 分组按钮
1463
- this.handleButtonGroup(useButton);
1464
-
1465
- if (this.isShowSetting('buttonAdaption')) return;
1466
- this.$nextTick(() => {
1467
- this.handleTileBtnWidth();
1468
- this.dealOutFilterHideBtn();
1469
- });
1470
- },
1471
- hideInlineOperationBtn() {
1472
- if (this.TypeOfDisplay === 'table') return;
1473
-
1474
- this.rowFoldBtnList = this.rowFoldBtnList.filter(item => {
1475
- return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1476
- });
1477
- this.rowTileBtnList = this.rowTileBtnList.filter(item => {
1478
- return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1479
- });
1480
- },
1481
- isPrintBtn(btn) {
1482
- const copySettingObj = btn.settingObj;
1483
- let settingObj = {};
1484
- if (Array.isArray(copySettingObj)) {
1485
- settingObj = copySettingObj[0];
1486
- } else {
1487
- settingObj = copySettingObj;
1488
- }
1489
- if (!settingObj) return false;
1490
- return settingObj.trigger_type === 'PRINT';
1491
- },
1492
- handleTileBtnWidth() {
1493
- if (this.outSearchFieldList.length > 0) return; // 存在外显按钮的时候 不触发这个函数
1494
- let rowTileBtnRef = this.$refs.rowTileBtnItem;
1495
- if (!rowTileBtnRef || !rowTileBtnRef.length) return;
1496
- let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1497
- let groupBtnObj = JSON.parse(JSON.stringify(this.groupBtnObj));
1498
- let btnTotalWidth = 90;
1499
- let hasHideBtn = false;
1500
- let rowFoldHideBtnWidth = 90;
1501
- let diffWidth = this.diffWidth;
1502
- rowTileBtnRef.forEach((e, index) => {
1503
- let dataKey = e.getAttribute('data-key');
1504
- let dateSource = e.getAttribute('data-source');
1505
- let clientWidth = e.clientWidth;
1506
- let item;
1507
- if (dateSource == 'groupBtn') {
1508
- item = groupBtnObj[dataKey];
1509
- } else {
1510
- item = rowTileBtnList.find(v => v.sid === dataKey);
1511
- }
1512
- if (!item) return;
1513
- if (clientWidth) {
1514
- item.clientWidth = clientWidth;
1515
- }
1516
- if (item.clientWidth) {
1517
- clientWidth = item.clientWidth;
1518
- }
1519
- if (diffWidth <= 0) {
1520
- this.$set(item, 'isHide', true);
1521
- } else if (diffWidth > 0 && item.isVisible) {
1522
- btnTotalWidth += clientWidth;
1523
- if (btnTotalWidth > diffWidth) {
1524
- this.$set(item, 'isHide', true);
1525
- if (!hasHideBtn) {
1526
- hasHideBtn = true;
1527
- diffWidth -= rowFoldHideBtnWidth;
1528
- btnTotalWidth -= rowFoldHideBtnWidth;
1529
- }
1530
- } else {
1531
- this.$set(item, 'isHide', false);
1532
- }
1533
- }
1534
- });
1535
- let hideBtn = rowTileBtnList.filter(item => item.isVisible && item.isHide);
1536
- this.groupBtnObj = groupBtnObj;
1537
- this.rowTileBtnList = rowTileBtnList;
1538
- let rowFoldHideBtnListObj = {
1539
- ADD: { name: '新增按钮', list: [] },
1540
- INLINE: { name: '行级按钮', list: [] },
1541
- BATCH: { name: '批量按钮', list: [] }
1542
- };
1543
-
1544
- hideBtn.forEach(item => {
1545
- item.isShowFoldGroupBtn = false;
1546
- if (item.type === 'ADD') {
1547
- rowFoldHideBtnListObj.ADD.list.push(item);
1548
- } else if (item.type == 'BATCH') {
1549
- rowFoldHideBtnListObj.BATCH.list.push(item);
1550
- } else {
1551
- rowFoldHideBtnListObj.INLINE.list.push(item);
1552
- }
1553
- });
1554
-
1555
- let hideGroupBtnObj = {};
1556
- // 按钮自适应 隐藏的分组 需要在折叠中平铺展示
1557
- for (let key in groupBtnObj) {
1558
- if (groupBtnObj[key].isHide) {
1559
- let list = groupBtnObj[key].list;
1560
- hideGroupBtnObj[key] = {
1561
- name: key,
1562
- list
1563
- };
1564
- list.forEach(item => {
1565
- let matchItem = hideBtn.find(v => v.sid === item.sid);
1566
- if (!matchItem) {
1567
- item.isShowFoldGroupBtn = true;
1568
- hideBtn.push(item);
1569
- } else {
1570
- matchItem.isShowFoldGroupBtn = true;
1571
- }
1572
- });
1573
- }
1574
- }
1575
- if (Object.keys(hideGroupBtnObj).length) {
1576
- Object.assign(rowFoldHideBtnListObj, hideGroupBtnObj);
1577
- }
1578
-
1579
- this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1580
- this.rowFoldHideBtnList = hideBtn;
1581
- this.resizeFlag = false;
1582
- },
1583
- resetCheckStatus() {
1584
- this.$emit('pubResetCheckStatus');
1585
- },
1586
- handleReset() {
1587
- this.$emit('handleReset',{targetType: "outQuickSearchReset" });
1588
- },
1589
- handleUploadChange(info) {
1590
- const { file, fileList } = info;
1591
- if (file.status !== 'uploading') {
1592
- console.log(file, fileList);
1593
- }
1594
- if (file.status === 'done') {
1595
- if (file.response?.result == 'SUCCESS') {
1596
- this.$message.success(`${file.name} 导入成功`);
1597
- this.$emit('importUpdate');
1598
- } else {
1599
- this.$message.error(`${file.name} 导入失败`);
1600
- }
1601
- } else if (file.status === 'error') {
1602
- this.$message.error(`${file.name} 导入失败`);
1603
- }
1604
- },
1605
- handleOtherConfigInit() {
1606
- setTimeout(() => {
1607
- let tableOptions = this.$attrs?.tableOptions || this.tableOptions || {};
1608
- const { nobutton = false, TypeOfDisplay = '', noSetting = false } = tableOptions?.config || {};
1609
- this.nobutton = nobutton || false;
1610
- if (TypeOfDisplay === 'table') {
1611
- this.currentTempId = '0';
1612
- }
1613
- if (noSetting) {
1614
- // this.showSettings["hideSettingBtn"] = 1;
1615
- this.noSetting = true;
1616
- }
1617
- }, 16);
1618
- },
1619
-
1620
- handleTopBtnTracher(btn, j) {
1621
- try {
1622
- // 埋点
1623
- this.$_handleTracherLog('列表按钮', {
1624
- 列表ID: this.tableId || '',
1625
- 列表名称: this.tableName || this.$attrs?.tableName || '',
1626
- 按钮名称: btn.name,
1627
- 按钮ID: btn.id,
1628
- 按钮类型: btn.type,
1629
- 按钮顺序位置: j,
1630
- 显示位置: btn.toggle
1631
- });
1632
- } catch (error) {
1633
- console.log(error);
1634
- }
1635
- },
1636
- handleAddType(btn) {
1637
- const btnObj = utils.getRowOperatorIdSetting({}, btn);
1638
- let setData = JSON.parse(btnObj.setting);
1639
- const { editTableWrapper } = this;
1640
- const tableParams = JSON.parse(JSON.stringify(this.paramsData));
1641
-
1642
- if (editTableWrapper.options && utils.isPlainObject(editTableWrapper.options.extendParams)) {
1643
- // 有额外的参数
1644
- editTableWrapper.options?.extendParams && Object.assign(tableParams.form, editTableWrapper.options.extendParams);
1645
- }
1646
- const paramsData = Object.assign(tableParams, {
1647
- table: btn
1648
- });
1649
- const params = utils.setParamsValue(setData.params, paramsData);
1650
- Object.assign(setData, { params, _params_data: paramsData });
1651
- this.$emit('btnEventTree', setData);
1652
- },
1653
- getRowTileBtnList(btnList) {
1654
- this.rowTileBtnListTree = [];
1655
- this.rowTileBtnListTree = btnList.filter(btn => btn.isShow == '1' && btn.type == 'ADD');
1656
- },
1657
- relatedSearchInputBlur() {
1658
- let searchInput = this.$refs.relatedSearchInput;
1659
- if (!searchInput) return;
1660
- if (!searchInput.$el?.children) return;
1661
- if (!searchInput.$el.children[0]?.children) return;
1662
- if (!searchInput.$el.children[0].children[0]) return;
1663
- if (!searchInput.$el.children[0].children[0]?.children) return;
1664
- let inputDom = searchInput.$el.children[0].children[0].children[0];
1665
- if (!inputDom) return;
1666
- inputDom.blur();
1667
- },
1668
- handleRequestedLabel(v) {
1669
- let params = { type: v, pageSize: 10000 };
1670
- return this.axios.get('/label/list', { params: params });
1671
- },
1672
- initOutSearchFieldList(config = {}) {
1673
- this.outSearchFieldList = [];
1674
- this.outRelationQuickSearch = [];
1675
- let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => (i.random_key = this.getFiledRandom_key(i), i.isShowSearch == 1 && i.filterExplicit == 1));
1676
- this.outSearchFieldList = mySearchFieldList;
1677
- // 跨表
1678
- let outRelationQuickSearch = this.relationTableList.map(item => {
1679
- return {
1680
- fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit == 1) || [],
1681
- tableName: item.tableName,
1682
- primaryField: item.primaryField,
1683
- parameterConversionId: item.parameterConversionId,
1684
- tableId: item.tableId,
1685
- relationField: item.relationField,
1686
- converFun: item.converFun,
1687
- relationOrgId: item.relationOrgId,
1688
- preConObj: item.preConObj,
1689
- preSqlExpression: item.preSqlExpression
1690
- };
1691
- });
1692
- outRelationQuickSearch = outRelationQuickSearch.filter(item => item.fieldList.length);
1693
- this.$set(this, 'outRelationQuickSearch', outRelationQuickSearch);
1694
- this.dealOutFilterHideBtn();
1695
- this.handlerInitSearchItem(this.outSearchFieldList);
1696
- this.outRelationQuickSearch.forEach(item => {
1697
- this.handlerInitSearchItem(item.fieldList);
1698
- });
1699
- if (this.lastOutSearchFieldList.length > 0) {
1700
- this.outSearchFieldList = _.cloneDeep(this.lastOutSearchFieldList);
1701
- }
1702
- if (this.lastOutRelationQuickSearch.length) {
1703
- this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
1704
- }
1705
-
1706
- // 如有配置默认值
1707
- if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1708
- this.$emit('outSearchInit');
1709
- if('reset' != config?.type){
1710
- this.outFilterChange({type:'outSearchInit'});
1711
- }
1712
- }
1713
- },
1714
- dealOutFilterHideBtn() {
1715
- if (!this.isShowSetting('buttonAdaption') && this.outSearchFieldList.length > 0) {
1716
- // 如果设置了按钮自适应 全部按钮放入折叠按钮
1717
- // 需要考虑按钮是否有分组 过滤掉分组
1718
- let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1719
- let hideBtn = rowTileBtnList.filter(item => {
1720
- if (!item.isVisible) return false;
1721
- if (!item.buttonGroup) return true;
1722
- if (this.groupBtnObj && this.groupBtnObj[item.buttonGroup]) return false;
1723
- return true;
1724
- });
1725
- this.rowTileBtnList = rowTileBtnList.map(i => {
1726
- i['isHide'] = true;
1727
- return i;
1728
- });
1729
- let rowFoldHideBtnListObj = {
1730
- ADD: { name: '新增按钮', list: [] },
1731
- INLINE: { name: '行级按钮', list: [] },
1732
- BATCH: { name: '批量按钮', list: [] }
1733
- };
1734
- hideBtn.forEach(item => {
1735
- this.$set(item, 'isHide', true);
1736
- if (item.type === 'ADD') {
1737
- rowFoldHideBtnListObj.ADD.list.push(item);
1738
- } else if (item.type == 'BATCH') {
1739
- rowFoldHideBtnListObj.BATCH.list.push(item);
1740
- } else {
1741
- rowFoldHideBtnListObj.INLINE.list.push(item);
1742
- }
1743
- });
1744
- this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1745
- this.rowFoldHideBtnList = hideBtn;
1746
- }
1747
- },
1748
- outFilterChange(config= {}) {
1749
- let conObj = this.getConObjParams() || [];
1750
- this.onSave(conObj, true, config);
1751
- },
1752
- visibleBtn(btn) {
1753
- if (!btn.isVisible) return false;
1754
- if (this.isInlineOperating) return false;
1755
-
1756
- return true;
1757
- },
1758
- /* 打印相关 */
1759
- toSelectPrintObjs(value) {
1760
- let oldtableData = this.oldtableData;
1761
- let selectData = [];
1762
- if (value && value.length) {
1763
- value.forEach(v => {
1764
- let loopNode;
1765
- this.loop(oldtableData, v.my_index, item => {
1766
- loopNode = item;
1767
- });
1768
- selectData.push({
1769
- ...loopNode
1770
- });
1771
- });
1772
- }
1773
- selectData = selectData.map(item => {
1774
- return utils.paramsToPrintValue(item);
1775
- });
1776
-
1777
- return selectData;
1778
- },
1779
- loop(data, theUniqueKey, callback) {
1780
- data.forEach((item, index, arr) => {
1781
- if (item.theUniqueKey === theUniqueKey) {
1782
- return callback(item, index, arr);
1783
- }
1784
- if (item.children) {
1785
- return this.loop(item.children, theUniqueKey, callback);
1786
- }
1787
- });
1788
- },
1789
- getPrintBtnParams(btn) {
1790
- const paramsData = JSON.parse(JSON.stringify(this.paramsData));
1791
- // const selectRows = this.toSelectPrintObjs(paramsData.form.selectRows);
1792
- const setData = JSON.parse(btn.setting);
1793
- let paramsArray = [];
1794
- paramsData.form.selectRows.forEach(i => {
1795
- const obj = {
1796
- table: i
1797
- };
1798
- // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1799
- paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })));
1800
- });
1801
-
1802
- return paramsArray;
1803
- },
1804
- setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1805
- let cloneList = _.cloneDeep(btnList);
1806
-
1807
- printNumberList.forEach((item, index) => {
1808
- const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
1809
- if (i > -1) {
1810
- cloneList[i].__printConfig = {
1811
- number: item.number,
1812
- authorizationKey: item.authorizationKey,
1813
- port: item.port,
1814
- versionType: item.versionType,
1815
- hisParams: { reportid: item.number }
1816
- };
1817
- }
1818
- // cloneList[index].__printConfig = {
1819
- // number: item.number,
1820
- // authorizationKey: item.authorizationKey,
1821
- // port: item.port,
1822
- // versionType: item.versionType,
1823
- // hisParams: { reportid: item.number }
1824
- // };
1825
- });
1826
-
1827
- return cloneList;
1828
- },
1829
- async getPrintNumber(list) {
1830
- if (!list?.length) return;
1831
-
1832
- let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
1833
-
1834
- let printNumberCacheKeys = Object.keys(this.printNumberCache);
1835
- let haveCache = printNumberCacheKeys.includes(ids);
1836
- if (haveCache) {
1837
- let printNumberList = this.printNumberCache[ids];
1838
- this.printBtnStrategys = printNumberList;
1839
- return Promise.resolve(printNumberList);
1840
- }
1841
-
1842
- let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
1843
-
1844
- const { status, data } = res;
1845
- if (status) {
1846
- let resList = data?.list || [];
1847
- this.printBtnStrategys = resList;
1848
- list = resList.map(item => {
1849
- return {
1850
- number: item.number,
1851
- authorizationKey: data.authorizationKey,
1852
- versionType: data.versionType,
1853
- port: data.port,
1854
- id: item.id,
1855
- ...item
1856
- };
1857
- });
1858
- let len = list?.length || 0;
1859
- if(len > 0){
1860
- this.setPrintNumberCache({
1861
- ids,
1862
- list
1863
- });
1864
- }
1865
-
1866
- return list;
1867
- }
1868
- return list;
1869
- },
1870
- async receivePrintSuccessAboutPrint(res, info) {
1871
- const printBtn = this.printBtn;
1872
- const templateId = info.templateId;
1873
- const formatId = info.formatId;
1874
- const number = printBtn.__printConfig.number;
1875
-
1876
- try {
1877
- const print = { formatId, number };
1878
- // 执行打印后置条件
1879
- const result = await this.printConfig.postStepRule(printBtn.settingObj, {
1880
- result: res,
1881
- print: print
1882
- });
1883
-
1884
- if (result.method !== 'sync') return;
1885
- // 同步刷新列表
1886
- this.editTableWrapper?.$refs?.editTable?.getTableList('', false, true, true);
1887
- } catch (error) {
1888
- console.log('error', error);
1889
- }
1890
- },
1891
- async receivePrintSuccess(res, info) {
1892
- if (info.type === 'print') {
1893
- await this.receivePrintSuccessAboutPrint(res, info);
1894
- }
1895
- setTimeout(() => {
1896
- this.$message.success(res.message);
1897
- }, 3500);
1898
- },
1899
- receivePrintError(res) {
1900
- let errorMsg = res.message;
1901
- res.errinfo && (errorMsg += `:${res.errinfo}`);
1902
- this.$message.error(errorMsg);
1903
- },
1904
- resetAllPrintFnWatch() {
1905
- let keys = Object.keys(this.printBtnPrevFnWatch);
1906
- keys.forEach(key => {
1907
- if (!this.printBtnPrevFnWatch[key]) return false;
1908
- this.printBtnPrevFnWatch[key]();
1909
- this.printBtnPrevFnWatch[key] = null;
1910
- delete this.printBtnPrevFnWatch[key];
1911
- });
1912
- },
1913
- printBtnPrevFnWatchSetTimeout(reject) {
1914
- if (this.printBtnPrevFnWatchTimeoutTimer) {
1915
- clearTimeout(this.printBtnPrevFnWatchTimeoutTimer);
1916
- this.printBtnPrevFnWatchTimeoutTimer = null;
1917
- }
1918
-
1919
- this.printBtnPrevFnWatchTimeoutTimer = setTimeout(() => {
1920
- this.resetAllPrintFnWatch();
1921
- reject();
1922
- }, 10000);
1923
- },
1924
- printBtnPrevFn(clickBtn, btn, type, j) {
1925
- return new Promise((resolve, reject) => {
1926
- /*
1927
- 触发原按钮流程,在EditTable中触发原打印按钮节点时,修改[printPrevFinish]状态
1928
- 触发watch,再执行Promise.resolve()
1929
- */
1930
- this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1931
- const timestamp = Date.now();
1932
-
1933
- this.resetAllPrintFnWatch();
1934
- this.printPrevFinish = false;
1935
-
1936
- this.printBtnPrevFnWatch[timestamp] = this.$watch('printPrevFinish', val => {
1937
- if (!this.printBtnPrevFnWatch[timestamp]) return false;
1938
- this.resetAllPrintFnWatch();
1939
- resolve();
1940
- });
1941
-
1942
- this.printBtnPrevFnWatchSetTimeout(reject);
1943
- });
1944
- },
1945
- inlineEditClick() {
1946
- let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
1947
- let _this = this;
1948
- // 保存是否需要提示
1949
- if (isTips != 1) {
1950
- this.setBatchSaveRowStatus(true);
1951
- return;
1952
- }
1953
- this.$confirm({
1954
- title: tipsMsg || `是否确认${btnName}`,
1955
- okText: '确定',
1956
- cancelText: '取消',
1957
- onOk: () => {
1958
- _this.setBatchSaveRowStatus(true);
1959
- },
1960
- onCancel() {
1961
- }
1962
- });
1963
- },
1964
-
1965
- /**
1966
- * 获取外显检索的默认值设置
1967
- */
1968
- handleGetOutSearchInitValue(){
1969
-
1970
- if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1971
- let conObj = this.getConObjParams() || [];
1972
- return conObj
1973
- }
1974
-
1975
- return []
1976
- },
1977
-
1978
- getFiledRandom_key(el){
1979
- // 初始化
1980
- const showSetting = el?.settingObj?.showSetting || [];
1981
- let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
1982
- if(!showSetting?.length && f){
1983
- return Math.random().toString()
1984
- }
1985
- return '11'
1986
- },
1987
-
1988
-
1989
- inlineEditCancel() {
1990
- this.setBatchCancelRowStatus(true);
1991
- },
1992
-
1993
- setBatchSaveRowStatus(f) {
1994
- this.$emit('setBatchSaveRowStatus', f);
1995
- },
1996
-
1997
- setBatchCancelRowStatus(f) {
1998
- this.$emit('setBatchCancelRowStatus', f);
1999
- },
2000
-
2001
- setPrintNumberCache(obj) {
2002
- this.$emit('setPrintNumberCache', obj);
2003
- }
2004
-
2005
- /* */
2006
- },
2007
- watch: {
2008
- // 平铺列表 watch 触发 导致请求发很多次
2009
- // 注释掉tableId 之后有问题请使用另外的方法解决, 不要再使用watch触发
2010
- // tableId: {
2011
- // immediate: true,
2012
- // deep: true,
2013
- // handler(val) {
2014
- // val && this.getTableCondiTionListRequest(true);
2015
- // }
2016
- // },
2017
- viewList: {
2018
- deep: true,
2019
- immediate: true,
2020
- handler() {
2021
- if (this.viewList.length > 0) {
2022
- let curItem;
2023
- let hasListType = true;
2024
- this.viewList.forEach(v => {
2025
- if (v.mark == 1) {
2026
- curItem = v.id;
2027
- }
2028
- if (v.id == '0') {
2029
- hasListType = false;
2030
- }
2031
- });
2032
- hasListType &&
2033
- this.viewList.push({
2034
- id: '0',
2035
- name: '列表模式' || this.$t('1.1.5.4')
2036
- });
2037
- // 查找默认值
2038
- // let curItem = this.viewList.find(v => v.mark == 1);
2039
- this.currentTempId = curItem || '0';
2040
-
2041
- // 按钮打卡视图列表
2042
- let tableViewId= this.optionsValue('tableViewId')
2043
- let onlyOpenView = this.optionsValue('hideViewList') && tableViewId
2044
- if(onlyOpenView) {
2045
- this.currentTempId = tableViewId
2046
- }
2047
- // this.handlerSelectTemp(this.currentTempId);
2048
- this.$emit('handlerChangeView', this.currentTempId);
2049
- } else {
2050
- this.currentTempId = '0';
2051
- // this.handlerSelectTemp(this.currentTempId);
2052
- this.editTableSource != 'relatedComponent' && this.$emit('handlerChangeView', this.currentTempId);
2053
- }
2054
- }
2055
- },
2056
- getIsTile: {
2057
- immediate: true,
2058
- handler(val) {
2059
- if (val === undefined) return;
2060
- this.isTile = val;
2061
- }
2062
- },
2063
- rowBtnList: {
2064
- immediate: true,
2065
- deep: true,
2066
- handler() {
2067
- this.formatRowBtnList();
2068
- this.handleOtherConfigInit();
2069
- }
2070
- },
2071
- initPageResize: {
2072
- immediate: true,
2073
- deep: true,
2074
- handler(val) {
2075
- if (!val || !Object.keys(val).length) return;
2076
- if (this.isButtonFolding || this.isShowSetting('buttonAdaption')) return;
2077
- let { classificationIndex } = val;
2078
- if (classificationIndex < 0) return;
2079
- this.pageResize({});
2080
- }
2081
- },
2082
- relatedBaseInfo: {
2083
- immediate: true,
2084
- deep: true,
2085
- handler(val) {
2086
- if (!val || !Object.keys(val).length) return;
2087
- let { buttonList } = val;
2088
- if (!buttonList || !buttonList.length) return;
2089
- this.getRowTileBtnList(buttonList);
2090
- }
2091
- },
2092
- searchFieldList: {
2093
- immediate: true,
2094
- deep: true,
2095
- handler(val) {
2096
- if (val && val.length > 0) {
2097
- this.initOutSearchFieldList();
2098
- }
2099
- }
2100
- },
2101
- tabConditionNumObj: {
2102
- immediate: true,
2103
- deep: true,
2104
- handler(val) {
2105
- if (this.conditionType === 'keyword' && val && Object.keys(val).length > 0) {
2106
- this.tabConditionList.length > 0 &&
2107
- this.tabConditionList.forEach(item => {
2108
- if (val[item.sid] !== undefined) this.$set(item, 'digital', val[item.sid]);
2109
- });
2110
- }
2111
- }
2112
- },
2113
- searchPlaceHolder: {
2114
- immediate: true,
2115
- handler(val) {
2116
- if (!val || this.showRelatedTreeBtn) return;
2117
- this.$nextTick(() => {
2118
- this.showPlaceholderPrefix = false;
2119
- let dom = this.$refs.baseSearchPlaceholderSpan;
2120
- if(!dom) return;
2121
- // input 框有padding 32px ...显示需要多预留一些宽度12px
2122
- let w = dom.offsetWidth + 45;
2123
- // 非筛选外显input 有enterButton 预留宽度
2124
- if(!this.showOutSearch) {
2125
- w += 45
2126
- }
2127
- let maxW = 300;
2128
- this.inputSearchW = w > maxW ? maxW : w < 200 ? 200 : w;
2129
- if (w > maxW) {
2130
- this.showPlaceholderPrefix = true;
2131
- }
2132
- this.onResize();
2133
- });
2134
- }
2135
- }
2136
- }
2137
- });
2138
- </script>
2139
-
2140
- <style lang="less" scoped>
2141
- .base-search {
2142
- flex: 1;
2143
- .base-container {
2144
- display: flex;
2145
- justify-content: space-between;
2146
- text-align: left;
2147
- background: #fff;
2148
- }
2149
- .bease-left {
2150
- display: flex;
2151
- justify-content: flex-start;
2152
- align-items: flex-start;
2153
- flex: 1;
2154
- .btn-custom-wrap {
2155
- width: 100%;
2156
- display: flex;
2157
- justify-content: flex-end;
2158
- align-items: flex-start;
2159
- }
2160
- }
2161
- .base-tabs {
2162
- display: flex;
2163
- align-items: center;
2164
- border-bottom: 1px solid #d5d5d5;
2165
- margin-bottom: 8px;
2166
- .base-tabs-item {
2167
- padding: 7px 16px;
2168
- font-size: 14px;
2169
- color: #212121;
2170
- font-weight: 400;
2171
- cursor: pointer;
2172
- border-bottom: 1px solid transparent;
2173
- }
2174
- .base-tabs-item-active {
2175
- color: #2d7aff;
2176
- border-bottom: 1px solid #2d7aff;
2177
- }
2178
- }
2179
- ul {
2180
- display: flex;
2181
- align-items: center;
2182
- flex-wrap: wrap;
2183
- margin-top: 8px;
2184
- li {
2185
- display: inline-block;
2186
- /deep/ .search-default {
2187
- height: 32px;
2188
- line-height: 32px;
2189
- margin-bottom: 8px;
2190
- margin-right: 8px;
2191
- border-color: #d5d5d5;
2192
- color: #212121;
2193
- .ant-btn {
2194
- border-color: #d5d5d5;
2195
- color: #212121;
2196
- }
2197
- }
2198
- /deep/ .out-filter-input {
2199
- width: 200px;
2200
- margin: 0 8px 8px 0;
2201
- .ant-input-wrapper {
2202
- .ant-input-group-addon {
2203
- border: 1px solid #d9d9d9 !important;
2204
- border-left: 0 !important;
2205
- }
2206
- }
2207
- }
2208
- .my-input-search {
2209
- vertical-align: middle;
2210
- position: relative;
2211
- top: -1px;
2212
- margin-bottom: 8px;
2213
- margin-right: 8px;
2214
- height: 32px;
2215
- /deep/ .ant-input {
2216
- margin-top: 1px;
2217
- border-right: 0 !important;
2218
- &:hover {
2219
- & + .ant-input-suffix {
2220
- .ant-input-search-icon {
2221
- color: #579aff;
2222
- }
2223
- }
2224
- }
2225
- }
2226
- /deep/ .ant-input-group-addon {
2227
- padding: 0;
2228
- border: 0 !important;
2229
- vertical-align: bottom;
2230
- .ant-btn {
2231
- border-top-left-radius: 0;
2232
- border-bottom-left-radius: 0;
2233
- }
2234
- }
2235
- .svg-icon {
2236
- margin-right: 0;
2237
- font-size: 16px;
2238
- }
2239
- }
2240
- .mr8 {
2241
- margin-right: 8px;
2242
- margin-bottom: 8px;
2243
- }
2244
- .mr12 {
2245
- margin-right: 12px;
2246
- margin-bottom: 8px;
2247
- }
2248
- .ml12 {
2249
- margin-left: 12px;
2250
- margin-bottom: 8px;
2251
- }
2252
- &.related-search-input {
2253
- /deep/ .my-input-search {
2254
- width: 40px;
2255
- .ant-input-affix-wrapper {
2256
- width: 0px;
2257
- .ant-input {
2258
- width: 0;
2259
- outline: none;
2260
- box-shadow: none;
2261
- &:focus {
2262
- outline: none;
2263
- }
2264
- }
2265
- .ant-input:not(:last-child) {
2266
- padding: 0px;
2267
- border: 0px !important;
2268
- }
2269
- .ant-input-suffix {
2270
- i {
2271
- display: none;
2272
- }
2273
- }
2274
- }
2275
- .ant-input-group-addon {
2276
- .ant-btn {
2277
- border-top-left-radius: 4px;
2278
- border-bottom-left-radius: 4px;
2279
- }
2280
- }
2281
- }
2282
- }
2283
- &.related-search-input-expand {
2284
- transition: width 0.2s;
2285
- /deep/ .my-input-search {
2286
- width: 215px;
2287
- .ant-input-affix-wrapper {
2288
- .ant-input-suffix {
2289
- i {
2290
- display: inline-block;
2291
- }
2292
- }
2293
- }
2294
- }
2295
- }
2296
- }
2297
- .dropdown-button {
2298
- color: #212121;
2299
- border-color: #d5d5d5 !important;
2300
- margin-left: 8px;
2301
- margin-bottom: 8px;
2302
- /deep/ .svg-icon {
2303
- margin-right: 4px;
2304
- }
2305
- &.ant-dropdown-trigger {
2306
- i.anticon.anticon-down {
2307
- color: #969696;
2308
- font-size: 14px;
2309
- }
2310
- }
2311
- }
2312
- .baseSearch-input-search {
2313
- .input-search-com {
2314
- input {
2315
- padding: 4px 8px;
2316
- }
2317
- .search-placeholder-icon {
2318
- color: #b4b4b4;
2319
- }
2320
- }
2321
- }
2322
- }
2323
- /deep/ .num-picker {
2324
- position: relative;
2325
- display: flex;
2326
- &.num-picker-unit {
2327
- padding-right: 20px;
2328
- }
2329
- input {
2330
- text-align: left !important;
2331
- }
2332
- &:hover {
2333
- .clear-number-icon {
2334
- display: block;
2335
- }
2336
- }
2337
- /deep/ .ant-calendar-range-picker-input {
2338
- text-align: left;
2339
- }
2340
- .clear-number-icon {
2341
- position: absolute;
2342
- right: 5px;
2343
- top: 6px;
2344
- display: none;
2345
- cursor: pointer;
2346
- z-index: 1000;
2347
- }
2348
- }
2349
- .btn-row {
2350
- display: inline-flex;
2351
- line-height: 32px;
2352
- height: 32px;
2353
- // padding: 0 10px;
2354
- padding-right: 8px;
2355
- margin-bottom: 8px;
2356
- transform: translateZ(0);
2357
- .mgl-10 {
2358
- margin-left: 10px;
2359
- }
2360
- &.min-width {
2361
- min-width: 212px;
2362
- }
2363
- /deep/ .ant-select-selection__rendered {
2364
- color: #212121;
2365
- font-size: 14px;
2366
- }
2367
- /deep/ .ant-select-arrow {
2368
- i {
2369
- color: #969696;
2370
- font-size: 12px;
2371
- }
2372
- }
2373
- .btn-setting {
2374
- margin-right: 4px;
2375
- }
2376
- .viewList-button {
2377
- display: flex;
2378
- align-items: center;
2379
- justify-content: center;
2380
- padding: 0 12px;
2381
- }
2382
- }
2383
- .search-tile {
2384
- max-width: 100%;
2385
- max-height: 74px;
2386
- overflow-x: auto;
2387
- /deep/ .ant-btn {
2388
- margin-right: 10px;
2389
- margin-bottom: 5px;
2390
- }
2391
- }
2392
-
2393
- .psw-icon {
2394
- cursor: pointer;
2395
- &:active {
2396
- color: #5585f5;
2397
- // #2474ff
2398
- }
2399
- color: #969696;
2400
- }
2401
-
2402
- ::-webkit-input-placeholder {
2403
- /* WebKit browsers */
2404
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2405
- }
2406
-
2407
- ::-moz-placeholder {
2408
- /* Mozilla Firefox 19+ */
2409
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2410
- }
2411
-
2412
- :-ms-input-placeholder {
2413
- /* Internet Explorer 10+ */
2414
- font-family: 'Avenir', Helvetica, Arial, sans-serif;
2415
- }
2416
- .baseSearchPlaceholderSpan {
2417
- visibility: hidden;
2418
- position: absolute;
2419
- z-index: -1;
2420
- }
2421
- }
2422
- </style>
2423
- <style lang="less">
2424
- .rowFoldHideBtnList-dropdown {
2425
- .ant-dropdown-menu {
2426
- overflow-y: auto;
2427
- max-height: 99vh;
2428
- }
2429
- .ant-dropdown-menu-item-group {
2430
- .ant-dropdown-menu-item-group-title {
2431
- display: none;
2432
- }
2433
- border-bottom: 1px solid #d5d5d5;
2434
- &:last-child {
2435
- border-color: transparent;
2436
- }
2437
- }
2438
- }
2439
- .viewList-dropdown {
2440
- min-width: 120px;
2441
- .ant-dropdown-menu-item {
2442
- display: flex;
2443
- justify-content: space-between;
2444
- align-items: center;
2445
- color: #2e2e2e;
2446
- margin: 1px 0;
2447
- &:hover {
2448
- background: #f2f2f2;
2449
- }
2450
- > span {
2451
- display: inline;
2452
- width: 85%;
2453
- text-overflow: ellipsis;
2454
- white-space: nowrap;
2455
- overflow: hidden;
2456
- }
2457
- }
2458
- .ant-dropdown-menu-item.menu-active {
2459
- color: #2d7aff;
2460
- }
2461
- }
2462
- </style>
1
+ <template>
2
+ <div class="base-search">
3
+ <div class="base-container">
4
+ <div class="bease-left" ref="baseLeft" v-resize="onResize">
5
+ <!-- 行内编辑对应生成的(保存、取消)按钮 -->
6
+ <template v-if="visibleInlineOperateBtn">
7
+ <div class="btn-custom-wrap">
8
+ <a-button
9
+ v-preventReClick="preventReTime"
10
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
11
+ @click="inlineEditClick"
12
+ class="btn-custom-class"
13
+ style="margin: 8px 8px 8px 0"
14
+ type="primary"
15
+ >
16
+ 保存
17
+ </a-button>
18
+ <a-button
19
+ v-preventReClick="preventReTime"
20
+ :style="{ display: isInlineOperating ? 'inline-block' : 'none' }"
21
+ @click="inlineEditCancel"
22
+ class="btn-custom-class"
23
+ style="margin: 8px 8px 8px 0"
24
+ >
25
+ 取消
26
+ </a-button>
27
+ </div>
28
+ </template>
29
+ <ul v-if="!visibleInlineOperateBtn && !isRowEditing">
30
+ <div ref="btnRow" class="btn-row" v-if="isShowSettingBtn">
31
+ <a-button class="btn-setting" v-show="currentTempId != '0' && isShowSetting('hideSettingBtn')" icon="setting" @click="handlerSetting">
32
+ 设置
33
+ <!-- {{ $t("1.1.5.3") }} -->
34
+ </a-button>
35
+ <a-dropdown overlayClassName="viewList-dropdown" v-if="showViewList">
36
+ <a-button class="viewList-button">
37
+ <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
38
+ </a-button>
39
+ <a-menu slot="overlay">
40
+ <a-menu-item v-for="(item, index) in viewList" :value="item.id" :key="index" @click="handlerSelectTemp(item.id)" :class="{ 'menu-active': currentTempId === item.id }">
41
+ <span>{{ item.name }}</span>
42
+ <!-- <a-icon v-if="currentTempId === item.id" type="check" /> -->
43
+ </a-menu-item>
44
+ </a-menu>
45
+ </a-dropdown>
46
+ </div>
47
+ <slot name="classification"></slot>
48
+ <li v-if="showQuickSearch" ref="quickSearchLi">
49
+ <a-button class="search-default" type="default" @click="foldQuickSearch">
50
+ <svg-icon icon-class="xitongtubiaoBIxitongshaixuan" style="color: #2d7aff; margin-right: 6px"></svg-icon>
51
+ 筛选 {{ qqConObjCount ? `(${qqConObjCount})` : '' }}
52
+ </a-button>
53
+ </li>
54
+ <!-- start--筛选外显--start -->
55
+ <template v-for="item in outSearchFieldList">
56
+ <outQuickSearch :key="item.id + item.random_key" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
57
+ </template>
58
+ <!-- end--筛选外显--end -->
59
+
60
+ <!-- start--筛选外显 跨表--start -->
61
+ <template v-for="relationItem in outRelationQuickSearch">
62
+ <template v-for="item in relationItem.fieldList">
63
+ <outQuickSearch :key="item.id" :item="item" :filterApiConfig="filterApiConfigOutSearch" @outFilterChange="outFilterChange"></outQuickSearch>
64
+ </template>
65
+ </template>
66
+ <!-- end--筛选外显 跨表--end -->
67
+
68
+ <li v-if="isShowSetting('hideSearch') && !showRelatedTreeBtn" ref="inputSearchLi" class="baseSearch-input-search">
69
+ <template v-if="outSearchFieldList && outSearchFieldList.length">
70
+ <a-input
71
+ :style="{ width: (searchInputWidth || inputSearchW) + 'px', margin: '0 8px 8px 0' }"
72
+ allowClear
73
+ :placeholder="searchPlaceHolder"
74
+ :value="currentValue"
75
+ @input="$emit('input', $event.target.value)"
76
+ @pressEnter="outFilterChange"
77
+ class="input-search-com"
78
+ >
79
+ <template slot="prefix" v-if="showPlaceholderPrefix">
80
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
81
+ <a-icon type="info-circle" class="search-placeholder-icon" />
82
+ </a-tooltip>
83
+ </template>
84
+ </a-input>
85
+ </template>
86
+ <a-input-search
87
+ v-else
88
+ class="my-input-search input-search-com"
89
+ :style="{ width: (searchInputWidth || inputSearchW) + 'px' }"
90
+ @search="onSearch"
91
+ allowClear
92
+ :placeholder="searchPlaceHolder"
93
+ :value="currentValue"
94
+ @input="$emit('input', $event.target.value)"
95
+ >
96
+ <template slot="prefix" v-if="showPlaceholderPrefix">
97
+ <a-tooltip :title="searchPlaceHolder" overlayClassName="basesearch-placeholder-tooltip">
98
+ <a-icon type="info-circle" class="search-placeholder-icon" />
99
+ </a-tooltip>
100
+ </template>
101
+ <a-button slot="enterButton" type="primary">
102
+ <svg-icon icon-class="xitongtubiaosousuo"></svg-icon>
103
+ </a-button>
104
+ </a-input-search>
105
+ </li>
106
+ <li v-if="outSearchFieldList && outSearchFieldList.length">
107
+ <a-button type="primary" @click="outFilterChange" style="margin: 0 8px 8px 0">
108
+ <a-icon type="search" style="margin-right: 6px" />
109
+ 查询
110
+ </a-button>
111
+ </li>
112
+ <li v-if="showResetFilterBtn">
113
+ <a-button @click="handleReset" style="margin: 0 8px 8px 0">
114
+ <svg-icon icon-class="xitongtubiaoliebiaocaozuoanniushanchu" style="margin-right: 6px"></svg-icon>
115
+ 重置
116
+ </a-button>
117
+ </li>
118
+
119
+ <!-- 平铺列表 tree -->
120
+ <template v-if="showRelatedTreeBtn">
121
+ <li v-if="showRelatedSearch" :class="[isRelatedSearchFold ? 'related-search-input' : 'related-search-input-expand']">
122
+ <a-input-search
123
+ ref="relatedSearchInput"
124
+ class="my-input-search my-input-search-related"
125
+ placeholder="请输入关键字搜索"
126
+ @search="onRelatedSearch"
127
+ allowClear
128
+ :value="currentValue"
129
+ @input="$emit('input', $event.target.value)"
130
+ >
131
+ <a-button slot="enterButton" type="primary">
132
+ <a-icon type="search" />
133
+ <!-- <svg-icon icon-class="xitongtubiaosousuo"></svg-icon> -->
134
+ </a-button>
135
+ </a-input-search>
136
+ </li>
137
+ <template v-if="rowTileBtnListTree && rowTileBtnListTree.length === 1">
138
+ <a-button type="primary" style="margin-right: 8px; margin-bottom: 8px" @click="handleAddType(rowTileBtnListTree[0])">
139
+ {{ rowTileBtnListTree[0].alias || rowTileBtnListTree[0].name }}
140
+ </a-button>
141
+ </template>
142
+ <a-dropdown v-if="rowTileBtnListTree.length > 1 && !isInlineOperating">
143
+ <a-menu slot="overlay">
144
+ <template v-for="b in rowTileBtnListTree">
145
+ <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="handleAddType(b)">
146
+ {{ b.alias || b.name }}
147
+ <a-icon v-if="b.icon" :type="btnObj[b.icon]" />
148
+ <template v-else>
149
+ <svg-icon
150
+ v-if="b.iconSetting"
151
+ :iconClass="JSON.parse(b.iconSetting).icon"
152
+ :style="{
153
+ marginRight: '8px'
154
+ }"
155
+ />
156
+ </template>
157
+ </a-menu-item>
158
+ </template>
159
+ </a-menu>
160
+ <a-button type="primary" ghost style="margin-left: 8px; margin-bottom: 8px">
161
+ <!-- 1.1.8.1.6更多 -->
162
+ {{ '更多' }} ...
163
+ </a-button>
164
+ </a-dropdown>
165
+ </template>
166
+ <template v-if="!nobutton && !showRelatedTreeBtn">
167
+ <template v-if="isButtonFolding">
168
+ <li class="allBtn" v-if="allBtn && allBtn.length" ref="allBtnLi">
169
+ <a-dropdown v-show="!isInlineOperating">
170
+ <a-menu slot="overlay">
171
+ <template v-for="(b, j) in allBtn">
172
+ <a-menu-item :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
173
+ {{ b.alias || b.name }}
174
+ <getBtnIcon :data="b" :btnObj="btnObj" />
175
+ </a-menu-item>
176
+ <a-menu-item
177
+ :key="b.sid"
178
+ v-else-if="showButtonTop == 1 && b.type != 'LINK' && currentTempId == '0'"
179
+ class="dropdown-btn"
180
+ @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)"
181
+ >
182
+ {{ b.showStyle === 'only_icon' ? '' : b.alias || b.name }}
183
+ <getBtnIcon :data="b" :btnObj="btnObj" />
184
+ </a-menu-item>
185
+ </template>
186
+ </a-menu>
187
+ <a-button class="ml12 dropdown-button"
188
+ >{{ '更多' }}
189
+ <a-icon type="down" />
190
+ </a-button>
191
+ </a-dropdown>
192
+ </li>
193
+ </template>
194
+ <template v-else>
195
+ <!-- start--按钮分组--start -->
196
+ <template v-if="isShowGroupBtn">
197
+ <template v-for="(key, i) in groupBtnObj">
198
+ <li :key="i" v-if="key.list && key.list.length > 1" ref="rowTileBtnItem" :data-key="i" data-source="groupBtn">
199
+ <ButtonGroup v-show="!key.isHide" :title="i" :list="key.list" :currentTempId="currentTempId" @showDrawer="showDrawer" @clickGroupBtn="clickGroupBtn"></ButtonGroup>
200
+ </li>
201
+ </template>
202
+ </template>
203
+ <!-- end--按钮分组--end -->
204
+
205
+ <!-- 平铺按钮列表 -->
206
+ <template v-for="(item, j) in rowTileBtnList">
207
+ <!-- v-if="item.type == 'ADD'" -->
208
+ <li ref="rowTileBtnItem" class="rowTileBtn-item 123" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
209
+ <template v-if="item.type == 'ADD' || item.type == 'BATCH'">
210
+ <a-button
211
+ v-preventReClick="preventReTime"
212
+ v-show="visibleBtn(item) && !item.isHide"
213
+ @click.prevent.stop="showDrawer(item, j)"
214
+ class="btn-custom-class"
215
+ style="margin: 0 8px 8px 0"
216
+ :style="$utils.getBtnStyle(item)"
217
+ :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
218
+ :ghost="item.showStyle == 'white_bg'"
219
+ >
220
+ <getBtnIcon :data="item" :btnObj="btnObj" />
221
+ <template v-if="item.showStyle !== 'only_icon'">
222
+ {{ item.alias || item.name }}
223
+ </template>
224
+ </a-button>
225
+ <a-upload v-if="item.isImportGuage" method="post" :show-upload-list="false" :action="`${axios.defaults.baseURL}/guage/importGuage`" @change="handleUploadChange">
226
+ <!-- 上传配置文件 -->
227
+ <a-button
228
+ class="btn-custom-class"
229
+ style="margin: 0 8px 8px 0"
230
+ :style="$utils.getBtnStyle(item)"
231
+ :type="item.showStyle == 'none_bg' || item.showStyle === 'only_icon' ? 'link' : 'primary'"
232
+ :ghost="item.showStyle == 'white_bg'"
233
+ >
234
+ <a-icon type="upload" />
235
+ <template v-if="item.showStyle !== 'only_icon'">
236
+ {{ item.alias || item.name }}
237
+ </template>
238
+ </a-button>
239
+ </a-upload>
240
+ </template>
241
+ <template v-else-if="isShowRowTileBtnItem(item)">
242
+ <a-button
243
+ v-preventReClick="preventReTime"
244
+ v-show="visibleBtn(item) && !item.isHide"
245
+ @click.prevent.stop="clickBtn(clickRowData, item, clickRowData.my_index, undefined, j)"
246
+ class="btn-custom-class"
247
+ style="margin: 0 8px 8px 0"
248
+ :style="$utils.getBtnStyle(item)"
249
+ :type="item.showStyle == 'none_bg' ? 'link' : 'primary'"
250
+ :ghost="item.showStyle == 'white_bg'"
251
+ >
252
+ <getBtnIcon :data="item" :btnObj="btnObj" />
253
+ <template v-if="item.showStyle !== 'only_icon'">
254
+ {{ item.alias || item.name }}
255
+ </template>
256
+ </a-button>
257
+ </template>
258
+ </li>
259
+ </template>
260
+ <!-- 打印列表-->
261
+ <template v-for="(item, j) in rowPrintBtnList">
262
+ <li ref="rowTileBtnItem" class="rowTileBtn-item rowPrintBtn-btn" :key="item.sid" v-if="showLi(item)" :data-key="item.sid" data-source="rowTile">
263
+ <template v-if="item.isVisible && !item.isHide">
264
+ <PrintBtn
265
+ v-bind="$attrs"
266
+ :printConfig="printConfig"
267
+ :baseUrl="printConfig.printBaseUrl"
268
+ :strategy="item.strategy"
269
+ :btnText="item.name"
270
+ :versionType="item.__printConfig && item.__printConfig.versionType"
271
+ :port="item.__printConfig && item.__printConfig.port"
272
+ :authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
273
+ :templateNumber="item.__printConfig && item.__printConfig.number"
274
+ :hisParams="item.__printConfig && item.__printConfig.hisParams"
275
+ :params="getPrintBtnParams(item)"
276
+ :prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
277
+ @success="receivePrintSuccess"
278
+ @error="receivePrintError"
279
+ ></PrintBtn>
280
+ </template>
281
+ </li>
282
+ </template>
283
+ <!-- 折叠按钮列表 -->
284
+ <li class="rowFoldBtn" v-if="showRowFoldBtnList(rowFoldBtnList, 'rowFoldBtnList')">
285
+ <a-dropdown overlayClassName="baseSearch-fold-dropdown" v-show="!isInlineOperating">
286
+ <a-menu slot="overlay">
287
+ <template v-for="(b, j) in rowFoldBtnList">
288
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="showLiAdd(b)" @click="showDrawer(b, j)">
289
+ {{ b.alias || b.name }}
290
+ <getBtnIcon :data="b" :btnObj="btnObj" />
291
+ </a-menu-item>
292
+ <template v-else-if="showLiFold(b)">
293
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
294
+ {{ b.alias || b.name }}
295
+ <getBtnIcon :data="b" :btnObj="btnObj" />
296
+ </a-menu-item>
297
+ </template>
298
+ </template>
299
+ </a-menu>
300
+ <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
301
+ >{{ '更多' }}
302
+ <a-icon type="down" />
303
+ </a-button>
304
+ </a-dropdown>
305
+ </li>
306
+ <!-- 自适应折叠 -->
307
+ <template v-if="showRowFoldBtnList(rowFoldHideBtnList)">
308
+ <a-dropdown overlayClassName="rowFoldHideBtnList-dropdown" v-show="!isInlineOperating">
309
+ <a-menu slot="overlay">
310
+ <template v-for="(value, key) in rowFoldHideBtnListObj">
311
+ <a-menu-item-group :key="key" v-if="showRowFoldBtnList(value.list)">
312
+ <template slot="title"></template>
313
+ <template v-for="(b, j) in value.list">
314
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" v-if="b.type == 'ADD'" @click="showDrawer(b, j)">
315
+ {{ b.alias || b.name }}
316
+ <getBtnIcon :data="b" :btnObj="btnObj" />
317
+ </a-menu-item>
318
+ <template v-else-if="b.type != 'LINK' && currentTempId == '0'">
319
+ <a-menu-item v-show="visibleBtn(b)" :key="b.sid" class="dropdown-btn" @click="clickBtn(clickRowData, b, clickRowData.my_index, undefined, j)">
320
+ {{ b.alias || b.name }}
321
+ <getBtnIcon :data="b" :btnObj="btnObj" />
322
+ </a-menu-item>
323
+ </template>
324
+ </template>
325
+ </a-menu-item-group>
326
+ </template>
327
+ </a-menu>
328
+ <a-button class="dropdown-button" style="margin: 0 8px 8px 0"
329
+ >{{ '更多' }}
330
+ <a-icon type="down" />
331
+ </a-button>
332
+ </a-dropdown>
333
+ </template>
334
+ </template>
335
+ </template>
336
+ </ul>
337
+ </div>
338
+ </div>
339
+ <div class="base-tabs" v-if="showBaseTabs">
340
+ <div v-for="(item, index) in tabConditionList" :key="index" :class="tabIndex === index ? 'base-tabs-item base-tabs-item-active' : 'base-tabs-item'" @click="tabClick(index)"
341
+ >{{ item.name }} {{ countTabCondition == 1 && (item.digital || item.digital === 0) ? '(' + (item.digital || 0) + ')' : '' }}</div
342
+ >
343
+ </div>
344
+ <!-- palceholder 文字宽度计算 -->
345
+ <span class="baseSearchPlaceholderSpan" ref="baseSearchPlaceholderSpan">
346
+ {{ searchPlaceHolder }}
347
+ </span>
348
+ </div>
349
+ </template>
350
+
351
+ <script>
352
+ /**
353
+ * 完成搜索组合组件 BaseSearch
354
+ * 使用方式:在需要的vue页中引入注册为子组件后直接使用
355
+ * 提供函数:
356
+ * 1、输入关键字搜索触发函数onSearch;
357
+ * 2、左侧下拉选中搜索触发函数changeSearch;
358
+ * 3、右侧快速弹框保存搜索函数onSave(obj);
359
+ * 完整例子:<BaseSearch :onSearch='onSearch' @changeSearch='changeSearch' @onSave='onSave'/>
360
+ */
361
+ import moment from 'moment';
362
+ import 'moment/locale/zh-cn';
363
+
364
+ import _ from 'lodash';
365
+ import vexutils from '@/utils/vexutils';
366
+ import { Button, Icon, Dropdown, Select, Upload, DatePicker, Input, Menu } from 'ant-design-vue';
367
+ import resize from 'vue-resize-directive';
368
+
369
+ import { GROUP_TITLE_KEY } from '../const';
370
+
371
+ import PrintBtn from '~/button/src/ButtonPrint/index';
372
+ // import stepRule from "@/components/table/mixins/stepRule";
373
+
374
+ import outQuickSearch from '../components/out-quick-search/out-quick-search';
375
+ import utils from '@/utils/utils-map';
376
+ import { durationMixin, $utils, filterApiFn, outQuickSearchFn } from '../mixins/mixins';
377
+ import tableSearchCon from '../mixins/tableSearchCon';
378
+ import svgIcon from '@/component/svg/index.vue';
379
+ import 'text-security/text-security.css';
380
+ import create from '@/core/create';
381
+ import preventReClick from '@/directive/preventReClick';
382
+ /** 获取按钮 icon */
383
+ import getBtnIcon from '../components/button-icon/getBtnIcon.js';
384
+ import ButtonGroup from '../components/button-group/ButtonGroup.vue';
385
+
386
+ const EVALUATEList = [
387
+ {
388
+ label: '一星',
389
+ value: '1',
390
+ isSelect: false
391
+ },
392
+ {
393
+ label: '二星',
394
+ value: '2',
395
+ isSelect: false
396
+ },
397
+ {
398
+ label: '三星',
399
+ value: '3',
400
+ isSelect: false
401
+ },
402
+ {
403
+ label: '四星',
404
+ value: '4',
405
+ isSelect: false
406
+ },
407
+ {
408
+ label: '五星',
409
+ value: '5',
410
+ isSelect: false
411
+ }
412
+ ];
413
+
414
+ const BTNOBJ = {
415
+ // 按钮icon 映射
416
+ copy: 'copy',
417
+ pencil: 'edit',
418
+ delete: 'delete',
419
+ add: 'plus-circle',
420
+ download: 'download',
421
+ label: 'tag',
422
+ queding: 'check',
423
+ del: 'close'
424
+ };
425
+
426
+ export default create({
427
+ name: 'base-search',
428
+ mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn],
429
+ directives: { resize, preventReClick },
430
+ props: {
431
+ width: {
432
+ default: '400px'
433
+ },
434
+ searchInputWidth: {
435
+ // 设置检索框的宽度
436
+ type: Number,
437
+ default: 0
438
+ },
439
+ onSearch: Function,
440
+ rowBtnList: {
441
+ type: Array,
442
+ default: () => []
443
+ },
444
+ paramsData: Object,
445
+ // downLoad: Function,
446
+ showButtonTop: [String, Number],
447
+ showSettings: {
448
+ type: Object,
449
+ default: () => ({})
450
+ },
451
+ clickRowData: Object,
452
+ value: String,
453
+ searchFieldList: {
454
+ // 搜索的数据
455
+ type: Array,
456
+ default: () => []
457
+ },
458
+ searchFieldLimit: {
459
+ // 搜索的数据的限制条件
460
+ type: Object,
461
+ default: () => ({})
462
+ },
463
+ viewList: {
464
+ type: Array,
465
+ default: () => []
466
+ },
467
+ TypeOfDisplay: {
468
+ type: String,
469
+ default: ''
470
+ },
471
+ tableAllCheck: {
472
+ type: Boolean
473
+ },
474
+ classificationIndex: Number,
475
+ editTableSource: {
476
+ default: ''
477
+ },
478
+ showRelatedTreeBtn: Boolean,
479
+ relatedBaseInfo: Object,
480
+ onRelatedSearch: Function,
481
+ showResetFilterBtn: {
482
+ type: Boolean,
483
+ default: false
484
+ },
485
+ qqConObjCount: {
486
+ type: Number,
487
+ default: 0
488
+ },
489
+ conditionType: { type: String },
490
+ countCondition: { type: [Number, String] },
491
+ countTabCondition: { type: Number },
492
+ tabConditionNumObj: {
493
+ type: Object,
494
+ default: () => {}
495
+ },
496
+ isRelatedSearchFold: {
497
+ type: Boolean,
498
+ default: true
499
+ },
500
+ tableId: { type: String },
501
+ conditionMap: {
502
+ type: Object,
503
+ default: () => {}
504
+ },
505
+ getFilterData: Function,
506
+ oldtableData: Array,
507
+ isNestTableClick: Boolean,
508
+
509
+ isAdmin: {
510
+ type: Boolean,
511
+ default: false
512
+ },
513
+
514
+ /**
515
+ * 导入量表配置
516
+ */
517
+ importGuageConfig: {
518
+ type: Object,
519
+ default: () => ({
520
+ action: ''
521
+ })
522
+ },
523
+
524
+ /**
525
+ * 打印配置
526
+ */
527
+ printConfig: {
528
+ type: Object,
529
+ default: () => ({
530
+ printBaseUrl: '/print/assembly',
531
+ postStepRule: () => Promise.resolve({})
532
+ })
533
+ },
534
+
535
+ gettersConfig: {
536
+ type: Object,
537
+ default: () => ({
538
+ getIsTile: '',
539
+ selectRowObj: [],
540
+ isInlineOperating: false,
541
+ printNumberCache: {}
542
+ })
543
+ },
544
+
545
+ /**
546
+ * 是否展示行编辑的按钮
547
+ */
548
+ visibleInlineOperateBtn: {
549
+ type: Boolean,
550
+ default: false
551
+ },
552
+
553
+ tabConditionList: {
554
+ type: Array,
555
+ default: () => []
556
+ },
557
+
558
+ lastOutSearchFieldList: {
559
+ type: Array,
560
+ default: () => []
561
+ },
562
+ lastOutRelationQuickSearch: {
563
+ type: Array,
564
+ default: () => []
565
+ },
566
+ relationTableList: {
567
+ type: Array,
568
+ default: () => []
569
+ },
570
+ /**
571
+ * 筛选外显
572
+ */
573
+ filterApiConfigOutSearch: {
574
+ type: Object,
575
+ default: () => ({})
576
+ },
577
+ useFieldList: Array,
578
+ editTableUid: [String, Number],
579
+
580
+ preventReTime: {
581
+ type: Number,
582
+ default: 1000
583
+ }
584
+ },
585
+ components: {
586
+ [Button.name]: Button,
587
+ [Icon.name]: Icon,
588
+ [Dropdown.name]: Dropdown,
589
+ [Select.name]: Select,
590
+ [Upload.name]: Upload,
591
+ [DatePicker.name]: DatePicker,
592
+ [DatePicker.RangePicker.name]: DatePicker.RangePicker,
593
+ [Input.name]: Input,
594
+ [Input.Search.name]: Input.Search,
595
+ [Menu.name]: Menu,
596
+ [Menu.Item.name]: Menu.Item,
597
+ [Menu.ItemGroup.name]: Menu.ItemGroup,
598
+ getBtnIcon,
599
+ PrintBtn,
600
+ outQuickSearch,
601
+ ButtonGroup,
602
+ svgIcon
603
+ },
604
+ inject: {
605
+ editTableWrapper: {
606
+ type: Object,
607
+ default: () => {}
608
+ }
609
+ },
610
+ computed: {
611
+ isOrgAdmin() {
612
+ return this.isAdmin;
613
+ },
614
+ currentValue() {
615
+ return this.value;
616
+ },
617
+ allBtn() {
618
+ const { rowTileBtnList, rowFoldBtnList } = this;
619
+ let allBtn = [];
620
+ allBtn.push(...rowTileBtnList, ...rowFoldBtnList);
621
+ return allBtn;
622
+ },
623
+ isButtonFolding() {
624
+ // 首页配置
625
+ const { editTableWrapper } = this;
626
+ return editTableWrapper?.options?.isButtonFolding || false;
627
+ },
628
+ isShowSettingBtn() {
629
+ const { $attrs, viewList, noSetting } = this;
630
+ if (this.showRelatedTreeBtn) return;
631
+ return $attrs.isTree != 1 && viewList.length > 0 && !noSetting;
632
+ },
633
+ showDownCurSelectData() {
634
+ return this.selectRowObj.filter(item => !(GROUP_TITLE_KEY in (item || {})))?.length;
635
+ },
636
+ showRowFoldBtnList() {
637
+ return function(list, key) {
638
+ if (key === 'rowFoldBtnList' && !this.isShowSetting('buttonAdaption')) return false;
639
+ if (!list || !list.length) return false;
640
+
641
+ let hasGroupBtnList = list.filter(item => item.buttonGroup);
642
+ if (hasGroupBtnList.length) {
643
+ let showGroup = hasGroupBtnList.some(item => item.isShowFoldGroupBtn);
644
+ if (showGroup) return true;
645
+ }
646
+
647
+ // 只有一个按钮 分组按钮 非自适应
648
+ if (list.length === 1 && list[0].buttonGroup && list[0].isButtonGroup && !list[0].isShowFoldGroupBtn) return false;
649
+
650
+ let visibleList = list.filter(item => item.isVisible && !item.buttonGroup);
651
+ if (!visibleList || !visibleList.length) return false;
652
+ let hasAdd = visibleList.some(item => item.type === 'ADD');
653
+ if (hasAdd) {
654
+ return true;
655
+ } else {
656
+ if (this.currentTempId != 0) return false;
657
+ let notLinkArr = visibleList.filter(item => item.type !== 'LINK');
658
+ if (!notLinkArr || !notLinkArr.length) return false;
659
+ }
660
+ return true;
661
+ };
662
+ },
663
+ initPageResize() {
664
+ let { showSettings, TypeOfDisplay, classificationIndex } = this;
665
+ return {
666
+ showSettings,
667
+ TypeOfDisplay,
668
+ classificationIndex
669
+ };
670
+ },
671
+ isShowRowTileBtnItem() {
672
+ return function(item) {
673
+ return this.showButtonTop == 1 && item.type != 'LINK' && this.currentTempId == '0';
674
+ };
675
+ },
676
+ showRelatedSearchFold() {
677
+ if (
678
+ !this.isShowSettingBtn &&
679
+ !this.isShowSetting('hideQuickSearch') &&
680
+ this.outSearchFieldList.length == 0 &&
681
+ this.outRelationQuickSearch.length == 0 &&
682
+ !this.showResetFilterBtn &&
683
+ !this.$slots.classification
684
+ ) {
685
+ return false;
686
+ } else {
687
+ return this.isRelatedSearchFold;
688
+ }
689
+ },
690
+ handlePickerShowTime() {
691
+ return function(item) {
692
+ if (!item.showTime) return false;
693
+ return {
694
+ defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')]
695
+ };
696
+ };
697
+ },
698
+ isShowGroupBtn() {
699
+ if (!this.groupBtnObj || !Object.keys(this.groupBtnObj).length) return false;
700
+ return true;
701
+ },
702
+ showLi() {
703
+ return function(item) {
704
+ if (item.buttonGroup) {
705
+ return item.isShow == '1' && item.buttonGroup && !item.isButtonGroup;
706
+ }
707
+ return item.isShow == '1';
708
+ };
709
+ },
710
+ showLiAdd() {
711
+ return function(b) {
712
+ if (b.buttonGroup) {
713
+ return b.type == 'ADD' && b.buttonGroup && !b.isButtonGroup;
714
+ }
715
+ return b.type == 'ADD';
716
+ };
717
+ },
718
+ showLiFold() {
719
+ return function(b) {
720
+ if (b.buttonGroup) {
721
+ return b.type != 'LINK' && this.currentTempId == '0' && b.buttonGroup && !b.isButtonGroup;
722
+ }
723
+ return b.type != 'LINK' && this.currentTempId == '0';
724
+ };
725
+ },
726
+
727
+ getIsTile() {
728
+ return this?.gettersConfig?.getIsTile || '';
729
+ },
730
+ selectRowObj() {
731
+ return this?.gettersConfig?.selectRowObj || [];
732
+ },
733
+ isInlineOperating() {
734
+ return this?.gettersConfig?.isInlineOperating || false;
735
+ },
736
+ printNumberCache() {
737
+ return this?.gettersConfig?.printNumberCache || false;
738
+ },
739
+
740
+ // 全部行编辑
741
+ isBatchEditing() {
742
+ return this?.gettersConfig?.isBatchEditing || false;
743
+ },
744
+ curBatchBtnData() {
745
+ return this?.gettersConfig?.curBatchBtnData || {};
746
+ },
747
+ isRowEditing() {
748
+ return this?.gettersConfig?.isRowEditing || false;
749
+ },
750
+ // 是否有高级筛选外显
751
+ showOutSearch() {
752
+ return this.outSearchFieldList?.length || this.outRelationQuickSearch?.length;
753
+ },
754
+ showViewList() {
755
+ if (this.editTableSource === 'relatedComponent') {
756
+ return this.relatedBaseInfo.showType != 'TREE';
757
+ }
758
+ return !this.optionsValue('hideViewList');
759
+ },
760
+ optionsValue() {
761
+ return function(key) {
762
+ return this.$attrs.tableOptions?.[key];
763
+ };
764
+ },
765
+ searchPlaceHolder() {
766
+ if (!this.useFieldList?.length || this.showRelatedTreeBtn) return '请输入关键字搜索';
767
+ let str = '';
768
+ let strList = this.useFieldList
769
+ ?.map(item => {
770
+ if (item.isSearch != 1) return '';
771
+ return item.formTitle || item.alias || item.title;
772
+ })
773
+ .filter(Boolean);
774
+ if (!strList?.length) return '';
775
+ str = '输入' + strList.join('/');
776
+ return str || '请输入关键字搜索';
777
+ },
778
+ showRelatedSearch() {
779
+ return this.showRelatedTreeBtn && this.isShowSetting('hideSearch');
780
+ },
781
+ showQuickSearch() {
782
+ let showQuick = this.isShowSetting('hideQuickSearch');
783
+ // 平铺列表, 左侧不为tree, 而是table
784
+ if (this.editTableSource == 'relatedComponent' && this.relatedBaseInfo?.showType != 'TREE') return showQuick;
785
+ return showQuick && this.isRelatedSearchFold;
786
+ },
787
+ showBaseTabs() {
788
+ return this.conditionType === 'keyword' && this.tabConditionList?.length && !this.visibleInlineOperateBtn && !this.isRowEditing;
789
+ }
790
+ },
791
+ data() {
792
+ return {
793
+ modalVisible: false,
794
+ currentTempId: '0',
795
+ viewCongfigList: [],
796
+ isTile: false,
797
+ conditionList: [],
798
+ displayCategoryList: [],
799
+ settingId: '',
800
+ searchDefName: '',
801
+ rowTileBtnList: [],
802
+ rowFoldBtnList: [],
803
+ rowPrintBtnList: [],
804
+ rowFoldHideBtnList: [], // 按钮自适应折叠list
805
+ rowFoldHideBtnListObj: {}, // 按钮自适应折叠分类
806
+ batchRelationBtnIds: [], // 批量操作按钮,关联的对应操作按钮id集
807
+ relationBtnBatchBtnIds: [], // 有关联对应操作按钮的批量操作按钮id集
808
+
809
+ nobutton: false, // 不展示按钮设置 false 展示,true 不展示
810
+ noSetting: false, // 不展示按钮设置 false 展示,true 不展示
811
+ isChangeWindow: false,
812
+ modalWidth: '700px',
813
+ modalHeight: '60vh',
814
+ label_max_count: 8,
815
+ baseLeftWidth: 0,
816
+ btnRowWidth: 0,
817
+ classificationWidth: 0,
818
+ inputSearchWidth: 0,
819
+ quickSearchWidth: 0,
820
+ downloadDropdownWidth: 0,
821
+ diffWidth: 0,
822
+ resizeFlag: false,
823
+ rowTileBtnListTree: [],
824
+ outSearchFieldList: [],
825
+ tabIndex: -1,
826
+ // tabConditionList: [],
827
+
828
+ /* 打印相关 */
829
+ printBtnPrevFnWatch: {},
830
+ printPrevFinish: false,
831
+ printBtnPrevFnWatchTimeoutTimer: null,
832
+ printBtn: {},
833
+ groupBtnObj: {},
834
+ btnObj: BTNOBJ,
835
+ printBtnStrategys: [], // 打印按钮组策略list
836
+ outRelationQuickSearch: [], // 关联表 筛选外显
837
+ inputSearchW: 200,
838
+ showPlaceholderPrefix: false
839
+ };
840
+ },
841
+ created() {
842
+ if (this.getIsTile !== undefined) {
843
+ this.isTile = this.getIsTile;
844
+ }
845
+ },
846
+ destroyed() {},
847
+ methods: {
848
+ tabClick(index) {
849
+ if (this.tabIndex === index) return false;
850
+ this.tabIndex = index;
851
+ if (index !== -1) this.$emit('tabClick', this.tabConditionList[index]);
852
+ },
853
+ pageResize(obj) {
854
+ if (this.resizeFlag || this.visibleInlineOperateBtn || this.isRowEditing) return;
855
+ let baseLeft = this.$refs['baseLeft'];
856
+ if (!baseLeft) return;
857
+ this.resizeFlag = true;
858
+ this.baseLeftWidth = baseLeft.clientWidth;
859
+ this.classificationWidth = this.classificationIndex === 2 ? 160 : 0;
860
+ this.btnRowWidth = this.$refs['btnRow']?.clientWidth || 0;
861
+ this.inputSearchWidth = this.$refs['inputSearchLi']?.clientWidth || 0;
862
+ this.quickSearchWidth = this.$refs['quickSearchLi']?.clientWidth || 0;
863
+ // this.downloadDropdownWidth = this.$refs["downloadDropdownLi"]?.clientWidth || 0;
864
+ let defaultTotal = this.btnRowWidth + this.classificationWidth + this.inputSearchWidth + this.quickSearchWidth;
865
+
866
+ let diffWidth = this.baseLeftWidth - defaultTotal;
867
+ // 平铺列表占2行
868
+ if (this.editTableSource === 'relatedComponent') {
869
+ diffWidth += this.baseLeftWidth;
870
+ }
871
+ this.diffWidth = diffWidth;
872
+ if (!obj.type) return;
873
+ if (obj.type === 'resize') {
874
+ this.handleTileBtnWidth();
875
+ }
876
+ },
877
+ onResize() {
878
+ if (this.isButtonFolding || this.isShowSetting('buttonAdaption') || this.relatedIsTree == 1 || this.visibleInlineOperateBtn || this.isRowEditing) return;
879
+ utils.debounce(this.pageResize({ type: 'resize' }), 300);
880
+ },
881
+ async saveListIsTile() {
882
+ let url = `/tableList/saveListIsTile`;
883
+ let params = {
884
+ isTile: this.isTile ? '1' : '0'
885
+ };
886
+ let res = await this.handleGetConfigApi(params, 'requestSaveListIsTile');
887
+ if (res) {
888
+ this.$emit('setIsTile', this.isTile);
889
+ this.$message.success(this.$t('1.9.23'));
890
+ }
891
+ },
892
+ getTableCondiTionListRequest(first) {
893
+ this.getTableCondiTionList(first).then(checked => {
894
+ this.reloadList(checked);
895
+ });
896
+ },
897
+ getTableCondiTionList(first, conditionMap = {}) {
898
+ let tableId = this.tableId;
899
+ if (!tableId) return new Promise(resolve => resolve(false));
900
+ let conditionMapTemp = Object.keys(conditionMap).length > 0 ? conditionMap : this.conditionMap;
901
+
902
+ return new Promise((resolve, reject) => {
903
+ if (Object.keys(conditionMapTemp).length > 0) {
904
+ this.conditionList = conditionMapTemp.conditionList || [];
905
+ this.displayCategoryList = conditionMapTemp.displayCategoryList || [];
906
+ let obj = {
907
+ conditionList: this.conditionList,
908
+ displayCategoryList: this.displayCategoryList
909
+ };
910
+ this.$emit('getQuickSearchListObj', obj);
911
+ this.settingId = conditionMapTemp.settingId;
912
+ const checked = this.conditionList.find(item => item.isDefault) || {
913
+ name: '全部数据' || this.$t('1.1.5.1'),
914
+ sid: 'all_data'
915
+ };
916
+ this.searchDefName = checked.name;
917
+ // if (this.conditionType === "keyword") {
918
+ this.tabConditionList = conditionMapTemp.tabConditionList || []; // 获取页签tab
919
+ if (this.tabIndex === -1) {
920
+ this.tabIndex = conditionMapTemp.tabConditionList && conditionMapTemp.tabConditionList.findIndex(item => item.isDefault); // 查询默认选中的标签
921
+ }
922
+ // }
923
+ if (this.$attrs.tableOptions?.filterCondition?.displayCategory && first) {
924
+ resolve({
925
+ name: this.$attrs.tableOptions?.filterCondition?.name,
926
+ sid: this.$attrs.tableOptions?.filterCondition?.displayCategory
927
+ });
928
+ }
929
+ resolve(checked);
930
+ } else {
931
+ resolve({});
932
+ }
933
+ });
934
+
935
+ // }
936
+ // });
937
+ },
938
+ async getTableCondiTionListNew(tableId) {
939
+ if (!tableId) return new Promise(resolve => resolve(false));
940
+ let params = { tableId };
941
+ let url = `/tableList/getTableCondiTionList`;
942
+ return this.axios
943
+ .get(url, { params })
944
+ .then(({ data }) => {
945
+ if (data && data.result == 'SUCCESS') {
946
+ // 设置分类数据,用于优化组件内的多次请求分类
947
+ this.$emit('setConditionMap', data.map);
948
+ return data.map;
949
+ }
950
+ })
951
+ .catch(err => {
952
+ console.log(err);
953
+ });
954
+ },
955
+ foldQuickSearch() {
956
+ this.$emit('foldQuickSearch', true);
957
+ },
958
+ openModal() {
959
+ this.modalVisible = true;
960
+ },
961
+ closeModal() {
962
+ this.resetChangeWindow();
963
+ this.modalVisible = false;
964
+ },
965
+ resetChangeWindow() {
966
+ this.modalWidth = '700px';
967
+ this.modalHeight = '60vh';
968
+ this.isChangeWindow = false;
969
+ },
970
+ changeModalWindow() {
971
+ this.isChangeWindow = !this.isChangeWindow;
972
+ let docHeight = document.body.clientHeight;
973
+ this.modalWidth = this.modalWidth === '700px' ? `100%` : '700px';
974
+ this.modalHeight = this.modalHeight === '60vh' ? `${docHeight - 108}px` : '60vh';
975
+
976
+ if (this.modalWidth === '700px') {
977
+ this.label_max_count = 8;
978
+ } else {
979
+ this.$nextTick(() => {
980
+ let ele = document.querySelector('.quickSearch_label-container');
981
+ ele && (this.label_max_count = parseInt((ele.clientWidth - 20) / 112) * 2);
982
+ });
983
+ }
984
+ },
985
+ openSaveToCalss() {
986
+ this.$refs.quicksearch?.openSaveToCalss();
987
+ },
988
+ onSaveSearch() {
989
+ this.$refs.quicksearch?.onSave();
990
+ },
991
+ onSave(obj, isOutFilter = false, config = {}) {
992
+ if (!this.validConObj(obj, this.searchFieldList, this.searchFieldLimit)) return false;
993
+ let copy = [];
994
+ if (this.outSearchFieldList.length) {
995
+ copy = _.cloneDeep(this.outSearchFieldList, true);
996
+ }
997
+ let copyRelation = [];
998
+ if (this.outRelationQuickSearch.length) {
999
+ copyRelation = _.cloneDeep(this.outRelationQuickSearch, true);
1000
+ }
1001
+ this.$emit('onSave', obj, isOutFilter, copy, copyRelation, config);
1002
+ this.modalVisible = false;
1003
+ },
1004
+ // 外部调用
1005
+ editTableGetConObj() {
1006
+ if (!this.showOutSearch) return;
1007
+ let conObj = this.getConObjParams() || [];
1008
+ if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return false;
1009
+ return conObj;
1010
+ },
1011
+ clearData() {
1012
+ this.$refs.quicksearch?.clearData();
1013
+ },
1014
+ /**
1015
+ * type 1-预览 2-打印
1016
+ */
1017
+ handlePrint(clickBtn, btn, type, j) {
1018
+ btn.printType = type;
1019
+ this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1020
+ },
1021
+ showDrawer(btn, j) {
1022
+ let hasSelectRows = this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0;
1023
+ let isMultiSelect = hasSelectRows || this.tableAllCheck;
1024
+
1025
+ if ((btn.name.includes('批量') && btn.type == 'ADD') || btn.type == 'BATCH') {
1026
+ // const { settingObj = {} } = btn || {};
1027
+ let settingObj = {};
1028
+ let settingList = btn.setting || '{}';
1029
+ if (utils.isJSON(settingList)) {
1030
+ let btnSetting = JSON.parse(settingList);
1031
+ if (Array.isArray(btnSetting)) {
1032
+ settingObj = btnSetting[0] || {};
1033
+ } else {
1034
+ settingObj = btnSetting;
1035
+ }
1036
+ }
1037
+ let trigger_type = settingObj?.trigger_type;
1038
+
1039
+ // 全部行编辑
1040
+ if (trigger_type == 'EDIT_ROW' || settingObj?.editAllRow == 1) {
1041
+ this.handleBtnEvent(btn, j);
1042
+ return;
1043
+ }
1044
+
1045
+ if (trigger_type == 'SCAN' && btn.type == 'ADD') {
1046
+ this.handleBtnEvent(btn, j);
1047
+ return;
1048
+ }
1049
+
1050
+ if (isMultiSelect) {
1051
+ if (settingObj.isTips && settingObj.isTips == 0) {
1052
+ this.handleBtnEvent(btn, j);
1053
+ return;
1054
+ }
1055
+ // 批量操作增加确认
1056
+ let params = { ...this.paramsData };
1057
+ params.table = {};
1058
+ if (settingObj.tipsMsg) {
1059
+ if (settingObj.tipsMsg.includes('form.selectRows')) {
1060
+ settingObj.tipsMsg = utils.handleMultiTips(settingObj.tipsMsg, [...params.form.selectRows]);
1061
+ } else {
1062
+ settingObj.tipsMsg = utils.handleSysParams(settingObj.tipsMsg, {
1063
+ ...params
1064
+ });
1065
+ }
1066
+ }
1067
+ const h = this.$createElement;
1068
+ this.$confirm({
1069
+ title: h(
1070
+ 'div',
1071
+ {
1072
+ directives: [
1073
+ {
1074
+ name: 'drag-move',
1075
+ value: {
1076
+ target: 'ant-modal-confirm-body'
1077
+ }
1078
+ }
1079
+ ],
1080
+ domProps: {
1081
+ innerHTML: settingObj.tipsMsg || `是否确认${btn.name}`
1082
+ }
1083
+ }
1084
+ // settingObj.tipsMsg || `是否确认${btn.name}`
1085
+ ),
1086
+ okText: '确定',
1087
+ cancelText: '取消',
1088
+ onOk: () => {
1089
+ this.handleBtnEvent(btn, j);
1090
+ },
1091
+ onCancel() {
1092
+ console.log('Cancel');
1093
+ },
1094
+ class: 'test'
1095
+ });
1096
+ } else {
1097
+ if (!btn.canHandleUniline) {
1098
+ // 1.9.295
1099
+ this.$message.warning(`请勾选需要${btn.name}的数据`);
1100
+ return;
1101
+ }
1102
+ this.clickBtn(
1103
+ this.clickRowData,
1104
+ // 找到对应的单行操作按钮
1105
+ this.getUnilineBtn(btn),
1106
+ this.clickRowData.my_index,
1107
+ true,
1108
+ j
1109
+ );
1110
+ }
1111
+ } else {
1112
+ if (btn.type == 'ADD' || btn.type == 'BATCH') {
1113
+ this.handleBtnEvent(btn, j);
1114
+ return;
1115
+ }
1116
+ this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, j);
1117
+ }
1118
+ },
1119
+ getUnilineBtn(BatchBtn) {
1120
+ let unilineBtnId = this.batchRelationBtnIds[this.relationBtnBatchBtnIds.indexOf(BatchBtn.id)];
1121
+ let unilineBtnObj = null;
1122
+ this.allBtn.forEach(i => {
1123
+ if (i.id == unilineBtnId) {
1124
+ unilineBtnObj = i;
1125
+ }
1126
+ });
1127
+ return unilineBtnObj;
1128
+ },
1129
+ handleBtnEvent(btn, j) {
1130
+ let indexList = [];
1131
+ this.$emit('clearTeamTitleName');
1132
+ if (this.paramsData.form.selectRows && this.paramsData.form.selectRows.length > 0) {
1133
+ indexList = this.paramsData.form.selectRows.map(item => {
1134
+ if (btn.type == 'BATCH') {
1135
+ delete item.SHOW_BUTTON_IDS;
1136
+ delete item.operatorColumn;
1137
+ }
1138
+ return item.my_index;
1139
+ });
1140
+ }
1141
+ let setData = JSON.parse(btn.setting);
1142
+ let settingList = JSON.parse(btn.setting);
1143
+ /** 按钮对象需求:add类型的 setting 可能是 Array/Object*/
1144
+ if (btn.type === 'ADD' || btn.type == 'BATCH') {
1145
+ if (Array.isArray(settingList)) {
1146
+ setData = settingList[0] || {};
1147
+ } else {
1148
+ setData = settingList;
1149
+ }
1150
+ this.paramsData.table = {};
1151
+ }
1152
+ if (setData.trigger_type == 'ABOUT_ITEM') {
1153
+ this.$message.error('按钮事件配置有误');
1154
+ return;
1155
+ }
1156
+ let params = setData.params || [];
1157
+ if (setData.trigger_type == 'QR_CODE') {
1158
+ params.forEach(item => {
1159
+ item.p_value = item.p_value?.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
1160
+ return $1 || _v;
1161
+ });
1162
+ });
1163
+ }
1164
+ let paramsData = utils.setParamsValue(params, this.paramsData);
1165
+ Object.assign(btn, {
1166
+ _index_: j
1167
+ });
1168
+ let btnData = {
1169
+ btnData: Object.assign(setData, {
1170
+ paramsData: paramsData,
1171
+ btnName: btn.name,
1172
+ _params_data: this.paramsData,
1173
+ _type_: btn.type
1174
+ }),
1175
+ indexList: indexList,
1176
+ btnConfig: JSON.parse(JSON.stringify(btn)),
1177
+ _params_data: this.paramsData,
1178
+ _type_: btn.type
1179
+ };
1180
+ this.$emit('btnEvent', btnData);
1181
+ },
1182
+
1183
+ // 筛选分类相关的
1184
+ async updateTableCondiTion() {
1185
+ await this.getTableCondiTionListNew(this.tableId);
1186
+ this.getTableCondiTionListRequest();
1187
+ },
1188
+ async CondiTionListInit() {
1189
+ await this.getTableCondiTionListNew(this.tableId);
1190
+ this.getTableCondiTionListRequest();
1191
+ },
1192
+ async saveGetTableCondiTionList(options) {
1193
+ await this.getTableCondiTionListNew(this.tableId);
1194
+ this.getTableCondiTionList();
1195
+ this.$emit('getClassification', options);
1196
+ },
1197
+ changeSearch(key, item) {
1198
+ if (key == 'all') {
1199
+ this.searchDefName = '全部数据' || this.$t('1.1.5.1');
1200
+ } else {
1201
+ this.searchDefName = item.name;
1202
+ }
1203
+ this.$refs.quicksearch.clearData();
1204
+ this.$emit('changeSearch', key, item);
1205
+ },
1206
+ changeSearchTile(val) {
1207
+ this.isTile = val;
1208
+ this.saveListIsTile();
1209
+ },
1210
+ openSetting() {
1211
+ this.$refs.search.handleMenuClick('setting');
1212
+ },
1213
+ reloadList(item) {
1214
+ this.$refs.quicksearch?.clearData();
1215
+ this.$emit('reloadList', item);
1216
+ },
1217
+ clickBtn(data, item, index, skip, j) {
1218
+ this.$emit('clearTeamTitleName');
1219
+ if ((item.name.includes('批量') && item.type == 'ADD' && !skip) || (item.type == 'BATCH' && !skip)) {
1220
+ this.showDrawer(item, j);
1221
+ return;
1222
+ }
1223
+ if (Object.keys(data || {}).length === 0 && !this.isPrintBtn(item)) {
1224
+ // 请点击要操作的数据1.9.140
1225
+ this.$message.info('请点击要操作的数据' || this.$t('1.9.140'));
1226
+ return;
1227
+ }
1228
+ Object.assign(item, {
1229
+ _index_: j
1230
+ });
1231
+ this.$emit('clickBtn', data, item, index);
1232
+ },
1233
+ clickGroupBtn(btn, j) {
1234
+ this.clickBtn(this.clickRowData, btn, this.clickRowData.my_index, undefined, j);
1235
+ },
1236
+ handlerSetting() {
1237
+ this.$emit('handlerSetting');
1238
+ },
1239
+ // 请求视图列表
1240
+ handlerReqAllConfigView() {
1241
+ let params = {
1242
+ type: 'PC',
1243
+ typeTable: 'TABLE_LIST',
1244
+ tableId: this.tableId,
1245
+ page: 1,
1246
+ rows: 20
1247
+ };
1248
+ this.axios
1249
+ .get('/tableListConfigView/getTableListConfigViewAll', {
1250
+ params: params
1251
+ })
1252
+ .then(({ data }) => {
1253
+ if (data.rows) {
1254
+ let viewCongfigList = data.rows || [];
1255
+ if (viewCongfigList.length > 0) {
1256
+ // 查找默认值
1257
+ let curItem = viewCongfigList.find(v => v.mark == 1);
1258
+ this.currentTempId = curItem ? curItem.id : '0';
1259
+ this.$emit('handlerChangeView', this.currentTempId);
1260
+ } else {
1261
+ this.currentTempId = '0';
1262
+ this.$emit('handlerChangeView', this.currentTempId);
1263
+ }
1264
+
1265
+ this.$set(this, 'viewCongfigList', viewCongfigList);
1266
+ }
1267
+ });
1268
+ },
1269
+ handlerSelectTemp(e) {
1270
+ if (this.currentTempId === e) return;
1271
+ this.currentTempId = e;
1272
+ const tab = e == 0 ? 'bigTable' : null;
1273
+ this.$emit('handlerChangeView', e, tab);
1274
+ let f = this.viewList.findIndex(v => v.id == e);
1275
+ this.resetCheckStatus();
1276
+ this.$nextTick(() => {
1277
+ this.formatRowBtnList();
1278
+ });
1279
+ },
1280
+ isShowSetting(v) {
1281
+ if (v == 'hideSettingBtn') {
1282
+ return this.isOrgAdmin || this.showSettings[v] == 0;
1283
+ } else {
1284
+ if (this.showRelatedTreeBtn) {
1285
+ return this.relatedBaseInfo[v] == 0;
1286
+ }
1287
+ return this.showSettings[v] == 0;
1288
+ }
1289
+ },
1290
+ setBatchRelationBtnIds(list) {
1291
+ let showButtonTop = !!this.showButtonTop;
1292
+ if (!showButtonTop) return false;
1293
+
1294
+ list.forEach(item => {
1295
+ let relationBtnId = JSON.parse(item.setting).relationBtnId;
1296
+ if (item.type === 'BATCH' && relationBtnId) {
1297
+ this.relationBtnBatchBtnIds.push(item.id);
1298
+ this.batchRelationBtnIds.push(relationBtnId);
1299
+ }
1300
+ });
1301
+ },
1302
+ setBtnStatus(btn) {
1303
+ const btnObj = utils.getRowOperatorIdSetting({}, btn);
1304
+ const { settingObj = {} } = btnObj || {};
1305
+ let isAllSelect = this.tableAllCheck;
1306
+ let isMultiSelect = !!this.paramsData.form.selectIds;
1307
+ let isBatchBtn = btn.type === 'BATCH';
1308
+ let isAddBtn = btn.type === 'ADD';
1309
+ let isSQLSAVEBtn = settingObj.trigger_type === 'SQLSAVE';
1310
+ let isLineBtn = btn.type === 'EDIT' || btn.type === 'DELETE';
1311
+ let isImportGuage = settingObj.trigger_type === 'GUAGE' && settingObj.guage_type == 'importGuage';
1312
+
1313
+ let isEditRow = settingObj.trigger_type === 'EDIT_ROW';
1314
+ let editAllRow = settingObj.editAllRow == 1;
1315
+
1316
+ // 批量&&行编辑&&全部行编辑 直接展示
1317
+ if (isBatchBtn && isEditRow && editAllRow) {
1318
+ btn.isVisible = true;
1319
+ return;
1320
+ }
1321
+
1322
+ // 默认情况下 只展示新增&下载
1323
+ if (!this.showDownCurSelectData) {
1324
+ btn.isVisible = isAddBtn ? true : false;
1325
+ if (!isImportGuage) return;
1326
+ }
1327
+
1328
+ // btn.settingObj.guage_type == "importGuage";
1329
+ // 全选状态下,只有入口类型的批量按钮展示(因当前版本仅支持入口类型的全选批量操作
1330
+ if (isBatchBtn && isAllSelect) {
1331
+ btn.isVisible = isSQLSAVEBtn;
1332
+ return;
1333
+ }
1334
+
1335
+ // 批量操作按钮,如果有绑定对应单行操作按钮,则批量按钮开启单行操作
1336
+ let relationBtnId = JSON.parse(btn.setting).relationBtnId;
1337
+ if (isBatchBtn && relationBtnId) {
1338
+ btn.canHandleUniline = true;
1339
+ }
1340
+
1341
+ // 批量按钮关联的对应按钮
1342
+ if (this.showDownCurSelectData > 1 && isLineBtn) {
1343
+ btn.isVisible = false;
1344
+ } else {
1345
+ if (isBatchBtn && btn.chooseTwoData == 1) {
1346
+ btn.isVisible = !this.batchRelationBtnIds.includes(btn.id) && this.showDownCurSelectData > 1;
1347
+ } else {
1348
+ btn.isVisible = !this.batchRelationBtnIds.includes(btn.id);
1349
+ }
1350
+ }
1351
+
1352
+ // 未绑定了行级按钮的批量按钮,默认隐藏, 勾选展示
1353
+ if (isBatchBtn && !relationBtnId && this.showDownCurSelectData > 1) {
1354
+ btn.isVisible = isMultiSelect;
1355
+ }
1356
+ // 量表导入按钮
1357
+ if (isImportGuage) {
1358
+ btn.isImportGuage = true;
1359
+ btn.isVisible = false;
1360
+ }
1361
+ },
1362
+ // 处理分组按钮
1363
+ handleButtonGroup(buttonList) {
1364
+ let useBttonList = buttonList
1365
+ .map(v => {
1366
+ v.isButtonGroup = false;
1367
+ // 有分组名 非隐藏
1368
+ if (!v.buttonGroup || !v.isVisible || v.isShow != 1) return null;
1369
+ if (v.type === 'ADD' || v.type == 'BATCH') return v;
1370
+ if (this.showButtonTop != 1) return null;
1371
+ return v;
1372
+ })
1373
+ .filter(Boolean);
1374
+ if (!useBttonList.length) return;
1375
+ let groupRes = vexutils.groupBy(useBttonList, 'buttonGroup');
1376
+ if (!groupRes || !Object.keys(groupRes).length) return;
1377
+ let resObj = {};
1378
+ Object.keys(groupRes).forEach(item => {
1379
+ let list = groupRes[item];
1380
+ // 超过一个才展示
1381
+ if (item && list?.length > 1) {
1382
+ resObj[item] = {
1383
+ key: item,
1384
+ isHide: false,
1385
+ list: list,
1386
+ clientWidth: 0,
1387
+ isVisible: true
1388
+ };
1389
+ list.forEach(v => (v.isButtonGroup = true));
1390
+ }
1391
+ });
1392
+ this.groupBtnObj = resObj;
1393
+ },
1394
+ async formatRowBtnList() {
1395
+ let rowFoldBtnList = [];
1396
+ let rowTileBtnList = [];
1397
+ let rowPrintBtnList = [];
1398
+ this.rowFoldBtnList = [];
1399
+ this.rowTileBtnList = [];
1400
+ this.rowPrintBtnList = [];
1401
+ this.rowFoldHideBtnList = [];
1402
+ this.batchRelationBtnIds = [];
1403
+ this.relationBtnBatchBtnIds = [];
1404
+ this.groupBtnObj = {};
1405
+ let useButton = [];
1406
+ // let tempBtnList = this.rowBtnList;
1407
+ // // 按钮置顶时 过滤掉行级按钮中 仅图标
1408
+ // if (this.showButtonTop == 1) {
1409
+ // tempBtnList = tempBtnList.filter(v => {
1410
+ // if (["EDIT", "DELETE"].includes(v.type)) {
1411
+ // if (v.showStyle != "only_icon") return v;
1412
+ // } else {
1413
+ // return v;
1414
+ // }
1415
+ // });
1416
+ // }
1417
+ if (!this.rowBtnList?.length) return;
1418
+ this.setBatchRelationBtnIds(this.rowBtnList);
1419
+ let rowBtnList = this.rowBtnList;
1420
+
1421
+ // 子列表只留下行级按钮
1422
+ // if (this.isNestTableClick) {
1423
+ // rowBtnList = this.rowBtnList.filter(item => item.type != 'ADD' && item.type != 'BATCH');
1424
+ // }
1425
+
1426
+ rowBtnList.forEach(btn => {
1427
+ if (!(btn.isShow == '1' && btn.type != 'LINK')) return;
1428
+ btn.isHide = false;
1429
+ btn.isButtonGroup = false;
1430
+ let cloneBtn = _.cloneDeep(btn);
1431
+ this.setBtnStatus(cloneBtn);
1432
+ // 按钮自适应 即使折叠也平铺显示出来
1433
+ if (this.isShowSetting('buttonAdaption')) {
1434
+ if (btn.toggle == 'fold') {
1435
+ if (btn.type != 'ADD' && btn.type != 'BATCH' && this.showButtonTop == 0) return;
1436
+ if (!this.isPrintBtn(btn)) {
1437
+ rowFoldBtnList.push(cloneBtn);
1438
+ }
1439
+ } else {
1440
+ rowTileBtnList.push(cloneBtn);
1441
+ }
1442
+ } else {
1443
+ rowTileBtnList.push(cloneBtn);
1444
+ }
1445
+ useButton.push(cloneBtn);
1446
+ });
1447
+ if (this.isShowSetting('buttonAdaption')) {
1448
+ this.rowFoldBtnList = rowFoldBtnList;
1449
+ }
1450
+
1451
+ this.rowTileBtnList = rowTileBtnList.filter(i => {
1452
+ if (this.isPrintBtn(i)) {
1453
+ rowPrintBtnList.push(i);
1454
+ } else {
1455
+ return i;
1456
+ }
1457
+ });
1458
+
1459
+ let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
1460
+ rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList);
1461
+ // this.rowPrintBtnList = rowPrintBtnList;
1462
+ // 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
1463
+ this.rowPrintBtnList = rowPrintBtnList.map(item => {
1464
+ const obj = this.printBtnStrategys.find(v => v.id === item.settingObj[0].trigger_id);
1465
+ item.strategy = obj?.setting ? JSON.parse(obj.setting).strategy : 'MULTI';
1466
+ return item;
1467
+ });
1468
+
1469
+ this.hideInlineOperationBtn();
1470
+
1471
+ // 分组按钮
1472
+ this.handleButtonGroup(useButton);
1473
+
1474
+ if (this.isShowSetting('buttonAdaption')) return;
1475
+ this.$nextTick(() => {
1476
+ this.handleTileBtnWidth();
1477
+ this.dealOutFilterHideBtn();
1478
+ });
1479
+ },
1480
+ hideInlineOperationBtn() {
1481
+ if (this.TypeOfDisplay === 'table') return;
1482
+
1483
+ this.rowFoldBtnList = this.rowFoldBtnList.filter(item => {
1484
+ return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1485
+ });
1486
+ this.rowTileBtnList = this.rowTileBtnList.filter(item => {
1487
+ return item.settingObj[0].trigger_type !== 'EDIT_ROW';
1488
+ });
1489
+ },
1490
+ isPrintBtn(btn) {
1491
+ const copySettingObj = btn.settingObj;
1492
+ let settingObj = {};
1493
+ if (Array.isArray(copySettingObj)) {
1494
+ settingObj = copySettingObj[0];
1495
+ } else {
1496
+ settingObj = copySettingObj;
1497
+ }
1498
+ if (!settingObj) return false;
1499
+ return settingObj.trigger_type === 'PRINT';
1500
+ },
1501
+ handleTileBtnWidth() {
1502
+ if (this.outSearchFieldList.length > 0) return; // 存在外显按钮的时候 不触发这个函数
1503
+ let rowTileBtnRef = this.$refs.rowTileBtnItem;
1504
+ if (!rowTileBtnRef || !rowTileBtnRef.length) return;
1505
+ let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1506
+ let groupBtnObj = JSON.parse(JSON.stringify(this.groupBtnObj));
1507
+ let btnTotalWidth = 90;
1508
+ let hasHideBtn = false;
1509
+ let rowFoldHideBtnWidth = 90;
1510
+ let diffWidth = this.diffWidth;
1511
+ rowTileBtnRef.forEach((e, index) => {
1512
+ let dataKey = e.getAttribute('data-key');
1513
+ let dateSource = e.getAttribute('data-source');
1514
+ let clientWidth = e.clientWidth;
1515
+ let item;
1516
+ if (dateSource == 'groupBtn') {
1517
+ item = groupBtnObj[dataKey];
1518
+ } else {
1519
+ item = rowTileBtnList.find(v => v.sid === dataKey);
1520
+ }
1521
+ if (!item) return;
1522
+ if (clientWidth) {
1523
+ item.clientWidth = clientWidth;
1524
+ }
1525
+ if (item.clientWidth) {
1526
+ clientWidth = item.clientWidth;
1527
+ }
1528
+ if (diffWidth <= 0) {
1529
+ this.$set(item, 'isHide', true);
1530
+ } else if (diffWidth > 0 && item.isVisible) {
1531
+ btnTotalWidth += clientWidth;
1532
+ if (btnTotalWidth > diffWidth) {
1533
+ this.$set(item, 'isHide', true);
1534
+ if (!hasHideBtn) {
1535
+ hasHideBtn = true;
1536
+ diffWidth -= rowFoldHideBtnWidth;
1537
+ btnTotalWidth -= rowFoldHideBtnWidth;
1538
+ }
1539
+ } else {
1540
+ this.$set(item, 'isHide', false);
1541
+ }
1542
+ }
1543
+ });
1544
+ let hideBtn = rowTileBtnList.filter(item => item.isVisible && item.isHide);
1545
+ this.groupBtnObj = groupBtnObj;
1546
+ this.rowTileBtnList = rowTileBtnList;
1547
+ let rowFoldHideBtnListObj = {
1548
+ ADD: { name: '新增按钮', list: [] },
1549
+ INLINE: { name: '行级按钮', list: [] },
1550
+ BATCH: { name: '批量按钮', list: [] }
1551
+ };
1552
+
1553
+ hideBtn.forEach(item => {
1554
+ item.isShowFoldGroupBtn = false;
1555
+ if (item.type === 'ADD') {
1556
+ rowFoldHideBtnListObj.ADD.list.push(item);
1557
+ } else if (item.type == 'BATCH') {
1558
+ rowFoldHideBtnListObj.BATCH.list.push(item);
1559
+ } else {
1560
+ rowFoldHideBtnListObj.INLINE.list.push(item);
1561
+ }
1562
+ });
1563
+
1564
+ let hideGroupBtnObj = {};
1565
+ // 按钮自适应 隐藏的分组 需要在折叠中平铺展示
1566
+ for (let key in groupBtnObj) {
1567
+ if (groupBtnObj[key].isHide) {
1568
+ let list = groupBtnObj[key].list;
1569
+ hideGroupBtnObj[key] = {
1570
+ name: key,
1571
+ list
1572
+ };
1573
+ list.forEach(item => {
1574
+ let matchItem = hideBtn.find(v => v.sid === item.sid);
1575
+ if (!matchItem) {
1576
+ item.isShowFoldGroupBtn = true;
1577
+ hideBtn.push(item);
1578
+ } else {
1579
+ matchItem.isShowFoldGroupBtn = true;
1580
+ }
1581
+ });
1582
+ }
1583
+ }
1584
+ if (Object.keys(hideGroupBtnObj).length) {
1585
+ Object.assign(rowFoldHideBtnListObj, hideGroupBtnObj);
1586
+ }
1587
+
1588
+ this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1589
+ this.rowFoldHideBtnList = hideBtn;
1590
+ this.resizeFlag = false;
1591
+ },
1592
+ resetCheckStatus() {
1593
+ this.$emit('pubResetCheckStatus');
1594
+ },
1595
+ handleReset() {
1596
+ this.$emit('handleReset', { targetType: 'outQuickSearchReset' });
1597
+ },
1598
+ handleUploadChange(info) {
1599
+ const { file, fileList } = info;
1600
+ if (file.status !== 'uploading') {
1601
+ console.log(file, fileList);
1602
+ }
1603
+ if (file.status === 'done') {
1604
+ if (file.response?.result == 'SUCCESS') {
1605
+ this.$message.success(`${file.name} 导入成功`);
1606
+ this.$emit('importUpdate');
1607
+ } else {
1608
+ this.$message.error(`${file.name} 导入失败`);
1609
+ }
1610
+ } else if (file.status === 'error') {
1611
+ this.$message.error(`${file.name} 导入失败`);
1612
+ }
1613
+ },
1614
+ handleOtherConfigInit() {
1615
+ setTimeout(() => {
1616
+ let tableOptions = this.$attrs?.tableOptions || this.tableOptions || {};
1617
+ const { nobutton = false, TypeOfDisplay = '', noSetting = false } = tableOptions?.config || {};
1618
+ this.nobutton = nobutton || false;
1619
+ if (TypeOfDisplay === 'table') {
1620
+ this.currentTempId = '0';
1621
+ }
1622
+ if (noSetting) {
1623
+ // this.showSettings["hideSettingBtn"] = 1;
1624
+ this.noSetting = true;
1625
+ }
1626
+ }, 16);
1627
+ },
1628
+
1629
+ handleTopBtnTracher(btn, j) {
1630
+ try {
1631
+ // 埋点
1632
+ this.$_handleTracherLog('列表按钮', {
1633
+ 列表ID: this.tableId || '',
1634
+ 列表名称: this.tableName || this.$attrs?.tableName || '',
1635
+ 按钮名称: btn.name,
1636
+ 按钮ID: btn.id,
1637
+ 按钮类型: btn.type,
1638
+ 按钮顺序位置: j,
1639
+ 显示位置: btn.toggle
1640
+ });
1641
+ } catch (error) {
1642
+ console.log(error);
1643
+ }
1644
+ },
1645
+ handleAddType(btn) {
1646
+ const btnObj = utils.getRowOperatorIdSetting({}, btn);
1647
+ let setData = JSON.parse(btnObj.setting);
1648
+ const { editTableWrapper } = this;
1649
+ const tableParams = JSON.parse(JSON.stringify(this.paramsData));
1650
+
1651
+ if (editTableWrapper.options && utils.isPlainObject(editTableWrapper.options.extendParams)) {
1652
+ // 有额外的参数
1653
+ editTableWrapper.options?.extendParams && Object.assign(tableParams.form, editTableWrapper.options.extendParams);
1654
+ }
1655
+ const paramsData = Object.assign(tableParams, {
1656
+ table: btn
1657
+ });
1658
+ const params = utils.setParamsValue(setData.params, paramsData);
1659
+ Object.assign(setData, { params, _params_data: paramsData });
1660
+ this.$emit('btnEventTree', setData);
1661
+ },
1662
+ getRowTileBtnList(btnList) {
1663
+ this.rowTileBtnListTree = [];
1664
+ this.rowTileBtnListTree = btnList.filter(btn => btn.isShow == '1' && btn.type == 'ADD');
1665
+ },
1666
+ relatedSearchInputBlur() {
1667
+ let searchInput = this.$refs.relatedSearchInput;
1668
+ if (!searchInput) return;
1669
+ if (!searchInput.$el?.children) return;
1670
+ if (!searchInput.$el.children[0]?.children) return;
1671
+ if (!searchInput.$el.children[0].children[0]) return;
1672
+ if (!searchInput.$el.children[0].children[0]?.children) return;
1673
+ let inputDom = searchInput.$el.children[0].children[0].children[0];
1674
+ if (!inputDom) return;
1675
+ inputDom.blur();
1676
+ },
1677
+ handleRequestedLabel(v) {
1678
+ let params = { type: v, pageSize: 10000 };
1679
+ return this.axios.get('/label/list', { params: params });
1680
+ },
1681
+ initOutSearchFieldList(config = {}) {
1682
+ this.outSearchFieldList = [];
1683
+ this.outRelationQuickSearch = [];
1684
+ let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => ((i.random_key = this.getFiledRandom_key(i)), i.isShowSearch == 1 && i.filterExplicit == 1));
1685
+ this.outSearchFieldList = mySearchFieldList;
1686
+ // 跨表
1687
+ let outRelationQuickSearch = this.relationTableList.map(item => {
1688
+ return {
1689
+ fieldList: item.fieldList.fieldList.filter(item => item.isShowSearch == 1 && item.filterExplicit == 1) || [],
1690
+ tableName: item.tableName,
1691
+ primaryField: item.primaryField,
1692
+ parameterConversionId: item.parameterConversionId,
1693
+ tableId: item.tableId,
1694
+ relationField: item.relationField,
1695
+ converFun: item.converFun,
1696
+ relationOrgId: item.relationOrgId,
1697
+ preConObj: item.preConObj,
1698
+ preSqlExpression: item.preSqlExpression
1699
+ };
1700
+ });
1701
+ outRelationQuickSearch = outRelationQuickSearch.filter(item => item.fieldList.length);
1702
+ this.$set(this, 'outRelationQuickSearch', outRelationQuickSearch);
1703
+ this.dealOutFilterHideBtn();
1704
+ this.handlerInitSearchItem(this.outSearchFieldList);
1705
+ this.outRelationQuickSearch.forEach(item => {
1706
+ this.handlerInitSearchItem(item.fieldList);
1707
+ });
1708
+ if (this.lastOutSearchFieldList.length > 0) {
1709
+ this.outSearchFieldList = _.cloneDeep(this.lastOutSearchFieldList);
1710
+ }
1711
+ if (this.lastOutRelationQuickSearch.length) {
1712
+ this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
1713
+ }
1714
+
1715
+ // 如有配置默认值
1716
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1717
+ this.$emit('outSearchInit');
1718
+ if ('reset' != config?.type) {
1719
+ this.outFilterChange({ type: 'outSearchInit' });
1720
+ }
1721
+ }
1722
+ },
1723
+ dealOutFilterHideBtn() {
1724
+ if (!this.isShowSetting('buttonAdaption') && this.outSearchFieldList.length > 0) {
1725
+ // 如果设置了按钮自适应 全部按钮放入折叠按钮
1726
+ // 需要考虑按钮是否有分组 过滤掉分组
1727
+ let rowTileBtnList = JSON.parse(JSON.stringify(this.rowTileBtnList));
1728
+ let hideBtn = rowTileBtnList.filter(item => {
1729
+ if (!item.isVisible) return false;
1730
+ if (!item.buttonGroup) return true;
1731
+ if (this.groupBtnObj && this.groupBtnObj[item.buttonGroup]) return false;
1732
+ return true;
1733
+ });
1734
+ this.rowTileBtnList = rowTileBtnList.map(i => {
1735
+ i['isHide'] = true;
1736
+ return i;
1737
+ });
1738
+ let rowFoldHideBtnListObj = {
1739
+ ADD: { name: '新增按钮', list: [] },
1740
+ INLINE: { name: '行级按钮', list: [] },
1741
+ BATCH: { name: '批量按钮', list: [] }
1742
+ };
1743
+ hideBtn.forEach(item => {
1744
+ this.$set(item, 'isHide', true);
1745
+ if (item.type === 'ADD') {
1746
+ rowFoldHideBtnListObj.ADD.list.push(item);
1747
+ } else if (item.type == 'BATCH') {
1748
+ rowFoldHideBtnListObj.BATCH.list.push(item);
1749
+ } else {
1750
+ rowFoldHideBtnListObj.INLINE.list.push(item);
1751
+ }
1752
+ });
1753
+ this.rowFoldHideBtnListObj = rowFoldHideBtnListObj;
1754
+ this.rowFoldHideBtnList = hideBtn;
1755
+ }
1756
+ },
1757
+ outFilterChange(config = {}) {
1758
+ let conObj = this.getConObjParams() || [];
1759
+ this.onSave(conObj, true, config);
1760
+ },
1761
+ visibleBtn(btn) {
1762
+ if (!btn.isVisible) return false;
1763
+ if (this.isInlineOperating) return false;
1764
+
1765
+ return true;
1766
+ },
1767
+ /* 打印相关 */
1768
+ toSelectPrintObjs(value) {
1769
+ let oldtableData = this.oldtableData;
1770
+ let selectData = [];
1771
+ if (value && value.length) {
1772
+ value.forEach(v => {
1773
+ let loopNode;
1774
+ this.loop(oldtableData, v.my_index, item => {
1775
+ loopNode = item;
1776
+ });
1777
+ selectData.push({
1778
+ ...loopNode
1779
+ });
1780
+ });
1781
+ }
1782
+ selectData = selectData.map(item => {
1783
+ return utils.paramsToPrintValue(item);
1784
+ });
1785
+
1786
+ return selectData;
1787
+ },
1788
+ loop(data, theUniqueKey, callback) {
1789
+ data.forEach((item, index, arr) => {
1790
+ if (item.theUniqueKey === theUniqueKey) {
1791
+ return callback(item, index, arr);
1792
+ }
1793
+ if (item.children) {
1794
+ return this.loop(item.children, theUniqueKey, callback);
1795
+ }
1796
+ });
1797
+ },
1798
+ getPrintBtnParams(btn) {
1799
+ const paramsData = JSON.parse(JSON.stringify(this.paramsData));
1800
+ // const selectRows = this.toSelectPrintObjs(paramsData.form.selectRows);
1801
+ const setData = JSON.parse(btn.setting);
1802
+ let paramsArray = [];
1803
+ paramsData.form.selectRows.forEach(i => {
1804
+ const obj = {
1805
+ table: i
1806
+ };
1807
+ // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1808
+ paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })));
1809
+ });
1810
+
1811
+ return paramsArray;
1812
+ },
1813
+ setPrintNumberToBtnList(printNumberList = [], btnList = []) {
1814
+ let cloneList = _.cloneDeep(btnList);
1815
+
1816
+ printNumberList.forEach((item, index) => {
1817
+ const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
1818
+ if (i > -1) {
1819
+ cloneList[i].__printConfig = {
1820
+ number: item.number,
1821
+ authorizationKey: item.authorizationKey,
1822
+ port: item.port,
1823
+ versionType: item.versionType,
1824
+ hisParams: { reportid: item.number }
1825
+ };
1826
+ }
1827
+ // cloneList[index].__printConfig = {
1828
+ // number: item.number,
1829
+ // authorizationKey: item.authorizationKey,
1830
+ // port: item.port,
1831
+ // versionType: item.versionType,
1832
+ // hisParams: { reportid: item.number }
1833
+ // };
1834
+ });
1835
+
1836
+ return cloneList;
1837
+ },
1838
+ async getPrintNumber(list) {
1839
+ if (!list?.length) return;
1840
+
1841
+ let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
1842
+
1843
+ let printNumberCacheKeys = Object.keys(this.printNumberCache);
1844
+ let haveCache = printNumberCacheKeys.includes(ids);
1845
+ if (haveCache) {
1846
+ let printNumberList = this.printNumberCache[ids];
1847
+ this.printBtnStrategys = printNumberList;
1848
+ return Promise.resolve(printNumberList);
1849
+ }
1850
+
1851
+ let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
1852
+
1853
+ const { status, data } = res;
1854
+ if (status) {
1855
+ let resList = data?.list || [];
1856
+ this.printBtnStrategys = resList;
1857
+ list = resList.map(item => {
1858
+ return {
1859
+ number: item.number,
1860
+ authorizationKey: data.authorizationKey,
1861
+ versionType: data.versionType,
1862
+ port: data.port,
1863
+ id: item.id,
1864
+ ...item
1865
+ };
1866
+ });
1867
+ let len = list?.length || 0;
1868
+ if (len > 0) {
1869
+ this.setPrintNumberCache({
1870
+ ids,
1871
+ list
1872
+ });
1873
+ }
1874
+
1875
+ return list;
1876
+ }
1877
+ return list;
1878
+ },
1879
+ async receivePrintSuccessAboutPrint(res, info) {
1880
+ const printBtn = this.printBtn;
1881
+ const templateId = info.templateId;
1882
+ const formatId = info.formatId;
1883
+ const number = printBtn.__printConfig.number;
1884
+
1885
+ try {
1886
+ const print = { formatId, number };
1887
+ // 执行打印后置条件
1888
+ const result = await this.printConfig.postStepRule(printBtn.settingObj, {
1889
+ result: res,
1890
+ print: print
1891
+ });
1892
+
1893
+ if (result.method !== 'sync') return;
1894
+ // 同步刷新列表
1895
+ this.editTableWrapper?.$refs?.editTable?.getTableList('', false, true, true);
1896
+ } catch (error) {
1897
+ console.log('error', error);
1898
+ }
1899
+ },
1900
+ async receivePrintSuccess(res, info) {
1901
+ if (info.type === 'print') {
1902
+ await this.receivePrintSuccessAboutPrint(res, info);
1903
+ }
1904
+ setTimeout(() => {
1905
+ this.$message.success(res.message);
1906
+ }, 3500);
1907
+ },
1908
+ receivePrintError(res) {
1909
+ let errorMsg = res.message;
1910
+ res.errinfo && (errorMsg += `:${res.errinfo}`);
1911
+ this.$message.error(errorMsg);
1912
+ },
1913
+ resetAllPrintFnWatch() {
1914
+ let keys = Object.keys(this.printBtnPrevFnWatch);
1915
+ keys.forEach(key => {
1916
+ if (!this.printBtnPrevFnWatch[key]) return false;
1917
+ this.printBtnPrevFnWatch[key]();
1918
+ this.printBtnPrevFnWatch[key] = null;
1919
+ delete this.printBtnPrevFnWatch[key];
1920
+ });
1921
+ },
1922
+ printBtnPrevFnWatchSetTimeout(reject) {
1923
+ if (this.printBtnPrevFnWatchTimeoutTimer) {
1924
+ clearTimeout(this.printBtnPrevFnWatchTimeoutTimer);
1925
+ this.printBtnPrevFnWatchTimeoutTimer = null;
1926
+ }
1927
+
1928
+ this.printBtnPrevFnWatchTimeoutTimer = setTimeout(() => {
1929
+ this.resetAllPrintFnWatch();
1930
+ reject();
1931
+ }, 10000);
1932
+ },
1933
+ printBtnPrevFn(clickBtn, btn, type, j) {
1934
+ return new Promise((resolve, reject) => {
1935
+ /*
1936
+ 触发原按钮流程,在EditTable中触发原打印按钮节点时,修改[printPrevFinish]状态
1937
+ 触发watch,再执行Promise.resolve()
1938
+ */
1939
+ this.clickBtn(clickBtn, btn, clickBtn.my_index, true, j);
1940
+ const timestamp = Date.now();
1941
+
1942
+ this.resetAllPrintFnWatch();
1943
+ this.printPrevFinish = false;
1944
+
1945
+ this.printBtnPrevFnWatch[timestamp] = this.$watch('printPrevFinish', val => {
1946
+ if (!this.printBtnPrevFnWatch[timestamp]) return false;
1947
+ this.resetAllPrintFnWatch();
1948
+ resolve();
1949
+ });
1950
+
1951
+ this.printBtnPrevFnWatchSetTimeout(reject);
1952
+ });
1953
+ },
1954
+ inlineEditClick() {
1955
+ let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
1956
+ let _this = this;
1957
+ // 保存是否需要提示
1958
+ if (isTips != 1) {
1959
+ this.setBatchSaveRowStatus(true);
1960
+ return;
1961
+ }
1962
+ this.$confirm({
1963
+ title: tipsMsg || `是否确认${btnName}`,
1964
+ okText: '确定',
1965
+ cancelText: '取消',
1966
+ onOk: () => {
1967
+ _this.setBatchSaveRowStatus(true);
1968
+ },
1969
+ onCancel() {}
1970
+ });
1971
+ },
1972
+
1973
+ /**
1974
+ * 获取外显检索的默认值设置
1975
+ */
1976
+ handleGetOutSearchInitValue() {
1977
+ if (this.outSearchFieldList.some(v => !!v.explicitDefaultVal)) {
1978
+ let conObj = this.getConObjParams() || [];
1979
+ return conObj;
1980
+ }
1981
+
1982
+ return [];
1983
+ },
1984
+
1985
+ getFiledRandom_key(el) {
1986
+ // 初始化
1987
+ const showSetting = el?.settingObj?.showSetting || [];
1988
+ let f = !this.$utils.isEmpty(el?.settingObj?.wordbook);
1989
+ if (!showSetting?.length && f) {
1990
+ return Math.random().toString();
1991
+ }
1992
+ return '11';
1993
+ },
1994
+
1995
+ inlineEditCancel() {
1996
+ this.setBatchCancelRowStatus(true);
1997
+ },
1998
+
1999
+ setBatchSaveRowStatus(f) {
2000
+ this.$emit('setBatchSaveRowStatus', f);
2001
+ },
2002
+
2003
+ setBatchCancelRowStatus(f) {
2004
+ this.$emit('setBatchCancelRowStatus', f);
2005
+ },
2006
+
2007
+ setPrintNumberCache(obj) {
2008
+ this.$emit('setPrintNumberCache', obj);
2009
+ }
2010
+
2011
+ /* */
2012
+ },
2013
+ watch: {
2014
+ // 平铺列表 watch 触发 导致请求发很多次
2015
+ // 注释掉tableId 之后有问题请使用另外的方法解决, 不要再使用watch触发
2016
+ // tableId: {
2017
+ // immediate: true,
2018
+ // deep: true,
2019
+ // handler(val) {
2020
+ // val && this.getTableCondiTionListRequest(true);
2021
+ // }
2022
+ // },
2023
+ viewList: {
2024
+ deep: true,
2025
+ immediate: true,
2026
+ handler() {
2027
+ if (this.viewList.length > 0) {
2028
+ let curItem;
2029
+ let hasListType = true;
2030
+ this.viewList.forEach(v => {
2031
+ if (v.mark == 1) {
2032
+ curItem = v.id;
2033
+ }
2034
+ if (v.id == '0') {
2035
+ hasListType = false;
2036
+ }
2037
+ });
2038
+ hasListType &&
2039
+ this.viewList.push({
2040
+ id: '0',
2041
+ name: '列表模式' || this.$t('1.1.5.4')
2042
+ });
2043
+ // 查找默认值
2044
+ // let curItem = this.viewList.find(v => v.mark == 1);
2045
+ this.currentTempId = curItem || '0';
2046
+
2047
+ // 按钮打卡视图列表
2048
+ let tableViewId = this.optionsValue('tableViewId');
2049
+ let onlyOpenView = this.optionsValue('hideViewList') && tableViewId;
2050
+ if (onlyOpenView) {
2051
+ this.currentTempId = tableViewId;
2052
+ }
2053
+ // this.handlerSelectTemp(this.currentTempId);
2054
+ this.$emit('handlerChangeView', this.currentTempId);
2055
+ } else {
2056
+ this.currentTempId = '0';
2057
+ // this.handlerSelectTemp(this.currentTempId);
2058
+ this.editTableSource != 'relatedComponent' && this.$emit('handlerChangeView', this.currentTempId);
2059
+ }
2060
+ }
2061
+ },
2062
+ getIsTile: {
2063
+ immediate: true,
2064
+ handler(val) {
2065
+ if (val === undefined) return;
2066
+ this.isTile = val;
2067
+ }
2068
+ },
2069
+ rowBtnList: {
2070
+ immediate: true,
2071
+ deep: true,
2072
+ handler() {
2073
+ this.formatRowBtnList();
2074
+ this.handleOtherConfigInit();
2075
+ }
2076
+ },
2077
+ initPageResize: {
2078
+ immediate: true,
2079
+ deep: true,
2080
+ handler(val) {
2081
+ if (!val || !Object.keys(val).length) return;
2082
+ if (this.isButtonFolding || this.isShowSetting('buttonAdaption')) return;
2083
+ let { classificationIndex } = val;
2084
+ if (classificationIndex < 0) return;
2085
+ this.pageResize({});
2086
+ }
2087
+ },
2088
+ relatedBaseInfo: {
2089
+ immediate: true,
2090
+ deep: true,
2091
+ handler(val) {
2092
+ if (!val || !Object.keys(val).length) return;
2093
+ let { buttonList } = val;
2094
+ if (!buttonList || !buttonList.length) return;
2095
+ this.getRowTileBtnList(buttonList);
2096
+ }
2097
+ },
2098
+ searchFieldList: {
2099
+ immediate: true,
2100
+ deep: true,
2101
+ handler(val) {
2102
+ if (val && val.length > 0) {
2103
+ this.initOutSearchFieldList();
2104
+ }
2105
+ }
2106
+ },
2107
+ tabConditionNumObj: {
2108
+ immediate: true,
2109
+ deep: true,
2110
+ handler(val) {
2111
+ if (this.conditionType === 'keyword' && val && Object.keys(val).length > 0) {
2112
+ this.tabConditionList.length > 0 &&
2113
+ this.tabConditionList.forEach(item => {
2114
+ if (val[item.sid] !== undefined) this.$set(item, 'digital', val[item.sid]);
2115
+ });
2116
+ }
2117
+ }
2118
+ },
2119
+ searchPlaceHolder: {
2120
+ immediate: true,
2121
+ handler(val) {
2122
+ if (!val || this.showRelatedTreeBtn) return;
2123
+ this.$nextTick(() => {
2124
+ this.showPlaceholderPrefix = false;
2125
+ let dom = this.$refs.baseSearchPlaceholderSpan;
2126
+ if (!dom) return;
2127
+ // input 框有padding 32px ...显示需要多预留一些宽度12px
2128
+ let w = dom.offsetWidth + 45;
2129
+ // 非筛选外显input 有enterButton 预留宽度
2130
+ if (!this.showOutSearch) {
2131
+ w += 45;
2132
+ }
2133
+ let maxW = 300;
2134
+ this.inputSearchW = w > maxW ? maxW : w < 200 ? 200 : w;
2135
+ if (w > maxW) {
2136
+ this.showPlaceholderPrefix = true;
2137
+ }
2138
+ this.onResize();
2139
+ });
2140
+ }
2141
+ }
2142
+ }
2143
+ });
2144
+ </script>
2145
+
2146
+ <style lang="less" scoped>
2147
+ .base-search {
2148
+ flex: 1;
2149
+ .base-container {
2150
+ display: flex;
2151
+ justify-content: space-between;
2152
+ text-align: left;
2153
+ background: #fff;
2154
+ }
2155
+ .bease-left {
2156
+ display: flex;
2157
+ justify-content: flex-start;
2158
+ align-items: flex-start;
2159
+ flex: 1;
2160
+ .btn-custom-wrap {
2161
+ width: 100%;
2162
+ display: flex;
2163
+ justify-content: flex-end;
2164
+ align-items: flex-start;
2165
+ }
2166
+ }
2167
+ .base-tabs {
2168
+ display: flex;
2169
+ align-items: center;
2170
+ border-bottom: 1px solid #d5d5d5;
2171
+ margin-bottom: 8px;
2172
+ .base-tabs-item {
2173
+ padding: 7px 16px;
2174
+ font-size: 14px;
2175
+ color: #212121;
2176
+ font-weight: 400;
2177
+ cursor: pointer;
2178
+ border-bottom: 1px solid transparent;
2179
+ }
2180
+ .base-tabs-item-active {
2181
+ color: #2d7aff;
2182
+ border-bottom: 1px solid #2d7aff;
2183
+ }
2184
+ }
2185
+ ul {
2186
+ display: flex;
2187
+ align-items: center;
2188
+ flex-wrap: wrap;
2189
+ margin-top: 8px;
2190
+ li {
2191
+ display: inline-block;
2192
+ /deep/ .search-default {
2193
+ height: 32px;
2194
+ line-height: 32px;
2195
+ margin-bottom: 8px;
2196
+ margin-right: 8px;
2197
+ border-color: #d5d5d5;
2198
+ color: #212121;
2199
+ .ant-btn {
2200
+ border-color: #d5d5d5;
2201
+ color: #212121;
2202
+ }
2203
+ }
2204
+ /deep/ .out-filter-input {
2205
+ width: 200px;
2206
+ margin: 0 8px 8px 0;
2207
+ .ant-input-wrapper {
2208
+ .ant-input-group-addon {
2209
+ border: 1px solid #d9d9d9 !important;
2210
+ border-left: 0 !important;
2211
+ }
2212
+ }
2213
+ }
2214
+ .my-input-search {
2215
+ vertical-align: middle;
2216
+ position: relative;
2217
+ top: -1px;
2218
+ margin-bottom: 8px;
2219
+ margin-right: 8px;
2220
+ height: 32px;
2221
+ /deep/ .ant-input {
2222
+ margin-top: 1px;
2223
+ border-right: 0 !important;
2224
+ &:hover {
2225
+ & + .ant-input-suffix {
2226
+ .ant-input-search-icon {
2227
+ color: #579aff;
2228
+ }
2229
+ }
2230
+ }
2231
+ }
2232
+ /deep/ .ant-input-group-addon {
2233
+ padding: 0;
2234
+ border: 0 !important;
2235
+ vertical-align: bottom;
2236
+ .ant-btn {
2237
+ border-top-left-radius: 0;
2238
+ border-bottom-left-radius: 0;
2239
+ }
2240
+ }
2241
+ .svg-icon {
2242
+ margin-right: 0;
2243
+ font-size: 16px;
2244
+ }
2245
+ }
2246
+ .mr8 {
2247
+ margin-right: 8px;
2248
+ margin-bottom: 8px;
2249
+ }
2250
+ .mr12 {
2251
+ margin-right: 12px;
2252
+ margin-bottom: 8px;
2253
+ }
2254
+ .ml12 {
2255
+ margin-left: 12px;
2256
+ margin-bottom: 8px;
2257
+ }
2258
+ &.related-search-input {
2259
+ /deep/ .my-input-search {
2260
+ width: 40px;
2261
+ .ant-input-affix-wrapper {
2262
+ width: 0px;
2263
+ .ant-input {
2264
+ width: 0;
2265
+ outline: none;
2266
+ box-shadow: none;
2267
+ &:focus {
2268
+ outline: none;
2269
+ }
2270
+ }
2271
+ .ant-input:not(:last-child) {
2272
+ padding: 0px;
2273
+ border: 0px !important;
2274
+ }
2275
+ .ant-input-suffix {
2276
+ i {
2277
+ display: none;
2278
+ }
2279
+ }
2280
+ }
2281
+ .ant-input-group-addon {
2282
+ .ant-btn {
2283
+ border-top-left-radius: 4px;
2284
+ border-bottom-left-radius: 4px;
2285
+ }
2286
+ }
2287
+ }
2288
+ }
2289
+ &.related-search-input-expand {
2290
+ transition: width 0.2s;
2291
+ /deep/ .my-input-search {
2292
+ width: 215px;
2293
+ .ant-input-affix-wrapper {
2294
+ .ant-input-suffix {
2295
+ i {
2296
+ display: inline-block;
2297
+ }
2298
+ }
2299
+ }
2300
+ }
2301
+ }
2302
+ }
2303
+ .dropdown-button {
2304
+ color: #212121;
2305
+ border-color: #d5d5d5 !important;
2306
+ margin-left: 8px;
2307
+ margin-bottom: 8px;
2308
+ /deep/ .svg-icon {
2309
+ margin-right: 4px;
2310
+ }
2311
+ &.ant-dropdown-trigger {
2312
+ i.anticon.anticon-down {
2313
+ color: #969696;
2314
+ font-size: 14px;
2315
+ }
2316
+ }
2317
+ }
2318
+ .baseSearch-input-search {
2319
+ .input-search-com {
2320
+ input {
2321
+ padding: 4px 8px;
2322
+ }
2323
+ .search-placeholder-icon {
2324
+ color: #b4b4b4;
2325
+ }
2326
+ }
2327
+ }
2328
+ }
2329
+ /deep/ .num-picker {
2330
+ position: relative;
2331
+ display: flex;
2332
+ &.num-picker-unit {
2333
+ padding-right: 20px;
2334
+ }
2335
+ input {
2336
+ text-align: left !important;
2337
+ }
2338
+ &:hover {
2339
+ .clear-number-icon {
2340
+ display: block;
2341
+ }
2342
+ }
2343
+ /deep/ .ant-calendar-range-picker-input {
2344
+ text-align: left;
2345
+ }
2346
+ .clear-number-icon {
2347
+ position: absolute;
2348
+ right: 5px;
2349
+ top: 6px;
2350
+ display: none;
2351
+ cursor: pointer;
2352
+ z-index: 1000;
2353
+ }
2354
+ }
2355
+ .btn-row {
2356
+ display: inline-flex;
2357
+ line-height: 32px;
2358
+ height: 32px;
2359
+ // padding: 0 10px;
2360
+ padding-right: 8px;
2361
+ margin-bottom: 8px;
2362
+ transform: translateZ(0);
2363
+ .mgl-10 {
2364
+ margin-left: 10px;
2365
+ }
2366
+ &.min-width {
2367
+ min-width: 212px;
2368
+ }
2369
+ /deep/ .ant-select-selection__rendered {
2370
+ color: #212121;
2371
+ font-size: 14px;
2372
+ }
2373
+ /deep/ .ant-select-arrow {
2374
+ i {
2375
+ color: #969696;
2376
+ font-size: 12px;
2377
+ }
2378
+ }
2379
+ .btn-setting {
2380
+ margin-right: 4px;
2381
+ }
2382
+ .viewList-button {
2383
+ display: flex;
2384
+ align-items: center;
2385
+ justify-content: center;
2386
+ padding: 0 12px;
2387
+ }
2388
+ }
2389
+ .search-tile {
2390
+ max-width: 100%;
2391
+ max-height: 74px;
2392
+ overflow-x: auto;
2393
+ /deep/ .ant-btn {
2394
+ margin-right: 10px;
2395
+ margin-bottom: 5px;
2396
+ }
2397
+ }
2398
+
2399
+ .psw-icon {
2400
+ cursor: pointer;
2401
+ &:active {
2402
+ color: #5585f5;
2403
+ // #2474ff
2404
+ }
2405
+ color: #969696;
2406
+ }
2407
+
2408
+ ::-webkit-input-placeholder {
2409
+ /* WebKit browsers */
2410
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2411
+ }
2412
+
2413
+ ::-moz-placeholder {
2414
+ /* Mozilla Firefox 19+ */
2415
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2416
+ }
2417
+
2418
+ :-ms-input-placeholder {
2419
+ /* Internet Explorer 10+ */
2420
+ font-family: 'Avenir', Helvetica, Arial, sans-serif;
2421
+ }
2422
+ .baseSearchPlaceholderSpan {
2423
+ visibility: hidden;
2424
+ position: absolute;
2425
+ z-index: -1;
2426
+ }
2427
+ }
2428
+ </style>
2429
+ <style lang="less">
2430
+ .rowFoldHideBtnList-dropdown {
2431
+ .ant-dropdown-menu {
2432
+ overflow-y: auto;
2433
+ max-height: 99vh;
2434
+ }
2435
+ .ant-dropdown-menu-item-group {
2436
+ .ant-dropdown-menu-item-group-title {
2437
+ display: none;
2438
+ }
2439
+ border-bottom: 1px solid #d5d5d5;
2440
+ &:last-child {
2441
+ border-color: transparent;
2442
+ }
2443
+ }
2444
+ }
2445
+ .viewList-dropdown {
2446
+ min-width: 120px;
2447
+ .ant-dropdown-menu-item {
2448
+ display: flex;
2449
+ justify-content: space-between;
2450
+ align-items: center;
2451
+ color: #2e2e2e;
2452
+ margin: 1px 0;
2453
+ &:hover {
2454
+ background: #f2f2f2;
2455
+ }
2456
+ > span {
2457
+ display: inline;
2458
+ width: 85%;
2459
+ text-overflow: ellipsis;
2460
+ white-space: nowrap;
2461
+ overflow: hidden;
2462
+ }
2463
+ }
2464
+ .ant-dropdown-menu-item.menu-active {
2465
+ color: #2d7aff;
2466
+ }
2467
+ }
2468
+ </style>