cnhis-design-vue 2.1.21 → 2.1.22

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