cnhis-design-vue 2.1.24 → 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 (126) hide show
  1. package/CHANGELOG.md +2287 -2287
  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 +31 -31
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +30 -25
  32. package/es/editor/style.css +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +65 -49
  35. package/es/form/index.js +8 -8
  36. package/es/form-model/index.js +8 -8
  37. package/es/form-table/index.js +93 -87
  38. package/es/form-table/style.css +1 -1
  39. package/es/index/index.js +803 -764
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +92 -92
  51. package/es/multi-chat-client/index.js +86 -86
  52. package/es/multi-chat-history/index.js +4 -4
  53. package/es/multi-chat-record/index.js +14 -14
  54. package/es/multi-chat-setting/index.js +27 -27
  55. package/es/multi-chat-sip/index.js +1 -1
  56. package/es/notification/index.js +8 -8
  57. package/es/page-header/index.js +8 -8
  58. package/es/pagination/index.js +8 -8
  59. package/es/popconfirm/index.js +8 -8
  60. package/es/popover/index.js +8 -8
  61. package/es/progress/index.js +8 -8
  62. package/es/radio/index.js +9 -9
  63. package/es/rate/index.js +8 -8
  64. package/es/result/index.js +8 -8
  65. package/es/row/index.js +8 -8
  66. package/es/scale-view/index.js +33 -33
  67. package/es/select/index.js +11 -11
  68. package/es/select-label/index.js +11 -11
  69. package/es/select-person/index.js +20 -20
  70. package/es/skeleton/index.js +8 -8
  71. package/es/slider/index.js +8 -8
  72. package/es/space/index.js +8 -8
  73. package/es/spin/index.js +8 -8
  74. package/es/statistic/index.js +8 -8
  75. package/es/steps/index.js +8 -8
  76. package/es/switch/index.js +8 -8
  77. package/es/table-filter/index.js +212 -200
  78. package/es/table-filter/style.css +1 -1
  79. package/es/tabs/index.js +8 -8
  80. package/es/tag/index.js +9 -9
  81. package/es/time-picker/index.js +8 -8
  82. package/es/timeline/index.js +8 -8
  83. package/es/tooltip/index.js +8 -8
  84. package/es/transfer/index.js +8 -8
  85. package/es/tree/index.js +8 -8
  86. package/es/tree-select/index.js +8 -8
  87. package/es/upload/index.js +8 -8
  88. package/es/verification-code/index.js +2 -2
  89. package/lib/cui.common.js +806 -767
  90. package/lib/cui.umd.js +806 -767
  91. package/lib/cui.umd.min.js +21 -21
  92. package/package.json +107 -107
  93. package/packages/big-table/src/BigTable.vue +3044 -3044
  94. package/packages/big-table/src/assets/style/table-base.less +370 -370
  95. package/packages/big-table/src/components/AutoLayoutButton.vue +270 -270
  96. package/packages/big-table/src/utils/batchEditing.js +610 -610
  97. package/packages/big-table/src/utils/bigTableProps.js +95 -95
  98. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +181 -181
  99. package/packages/button/src/ButtonPrint/index.vue +739 -739
  100. package/packages/editor/src/Editor.vue +13 -4
  101. package/packages/fabric-chart/src/components/TimeScaleValue.vue +113 -113
  102. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  103. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +1079 -1066
  104. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +135 -135
  105. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +558 -558
  106. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +172 -172
  107. package/packages/form-table/src/FormTable.vue +5 -1
  108. package/packages/multi-chat/chat/chatFooter.vue +1594 -1594
  109. package/packages/multi-chat/chat/chatMain.vue +1466 -1466
  110. package/packages/multi-chat/chat/quickReply.vue +439 -439
  111. package/packages/multi-chat/chat/scrollList.vue +1232 -1232
  112. package/packages/multi-chat/setting/baseInfo/index.vue +1316 -1316
  113. package/packages/multi-chat/store/actions.js +448 -448
  114. package/packages/multi-chat/store/state.js +112 -112
  115. package/packages/scale-view/formitem/r-choice.vue +714 -714
  116. package/packages/scale-view/scaleView.vue +2010 -2010
  117. package/packages/select-person/select-person.vue +1680 -1680
  118. package/packages/table-filter/src/base-search-com/BaseSearch.vue +2468 -2468
  119. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +336 -336
  120. package/packages/table-filter/src/components/multi-select/multi-select.vue +219 -219
  121. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +340 -340
  122. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +1825 -1825
  123. package/packages/table-filter/src/const/dataOptions.js +43 -43
  124. package/packages/table-filter/src/mixins/mixins.js +692 -695
  125. package/packages/table-filter/src/quick-search/QuickSearch.vue +2116 -2109
  126. package/src/directive/preventReClick.js +12 -12
@@ -1,2468 +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
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>
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>