@bytenew/bn-bus-ui 1.1.461 → 1.1.463

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 (167) hide show
  1. package/install.js +134 -0
  2. package/package.json +20 -4
  3. package/packages/BnAddress/index.vue +141 -0
  4. package/packages/BnAddressParse/index.vue +75 -0
  5. package/packages/BnAdvancedFilter/BnFilterView.vue +145 -0
  6. package/packages/BnAdvancedFilter/index.vue +345 -0
  7. package/packages/BnAdvancedFilter/util.js +171 -0
  8. package/packages/BnCascader/BnCascader.vue +543 -0
  9. package/packages/BnCascader/BnCascaderPanel.vue +1331 -0
  10. package/packages/BnCascader/cascaderDisplay.js +102 -0
  11. package/packages/BnCheck/BnCheck.vue +253 -0
  12. package/packages/BnColumnConfig/columnConfigDialog.vue +134 -0
  13. package/packages/BnColumnConfig/component/childrenFormSetting/assocTable.vue +143 -0
  14. package/packages/BnColumnConfig/component/childrenFormSetting/assocTableSearch.vue +314 -0
  15. package/packages/BnColumnConfig/component/childrenFormSetting/index.vue +243 -0
  16. package/packages/BnColumnConfig/component/defaultSet/defaultSet.vue +114 -0
  17. package/packages/BnColumnConfig/component/defaultSet/stringDefault.vue +210 -0
  18. package/packages/BnColumnConfig/component/funcExprDialog/funcExprDialog.vue +126 -0
  19. package/packages/BnColumnConfig/component/packageFilter/index.vue +141 -0
  20. package/packages/BnColumnConfig/component/paraExplainSet/index.vue +156 -0
  21. package/packages/BnColumnConfig/component/setOption/setOption.vue +321 -0
  22. package/packages/BnColumnConfig/component/setRelationOption/ConditionList.vue +277 -0
  23. package/packages/BnColumnConfig/component/setRelationOption/LevelHeader.vue +144 -0
  24. package/packages/BnColumnConfig/component/setRelationOption/setRelationOption.vue +642 -0
  25. package/packages/BnColumnConfig/data.js +129 -0
  26. package/packages/BnColumnConfig/index.scss +23 -0
  27. package/packages/BnColumnConfig/index.vue +309 -0
  28. package/packages/BnCondVal/BnCondVal.vue +112 -0
  29. package/packages/BnCondVal/itemVal/dateRegVal.vue +39 -0
  30. package/packages/BnCondVal/itemVal/dateVal.vue +39 -0
  31. package/packages/BnCondVal/itemVal/numRegVal.vue +67 -0
  32. package/packages/BnCondVal/itemVal/numVal.vue +44 -0
  33. package/packages/BnCondVal/itemVal/relationVal.vue +73 -0
  34. package/packages/BnCondVal/itemVal/selectColumnVal.vue +58 -0
  35. package/packages/BnCondVal/itemVal/selectVal.vue +59 -0
  36. package/packages/BnCondVal/itemVal/stringVal.vue +156 -0
  37. package/packages/BnCondition/index.vue +551 -0
  38. package/packages/BnCondition/util.js +232 -0
  39. package/packages/BnDatePicker/BnDatePicker.vue +194 -0
  40. package/packages/BnDrop/BnDrop.vue +917 -0
  41. package/packages/BnEmptyTip/BnEmptyTip.vue +107 -0
  42. package/packages/BnExportOrder/BnExportOrder.vue +241 -0
  43. package/packages/BnExportOrder/validatorCode.vue +94 -0
  44. package/packages/BnFileView/BnFileView.vue +271 -0
  45. package/packages/BnFileView/FileDetail.vue +125 -0
  46. package/packages/BnFileView/videoPreview.vue +70 -0
  47. package/packages/BnFilterOption/BnFilterOption.vue +160 -0
  48. package/packages/BnFunExpr/BnFunExpr.vue +608 -0
  49. package/packages/BnImportOrder/BnImportOrder.vue +323 -0
  50. package/packages/BnImportTemplate/BnImportTemplate.vue +866 -0
  51. package/packages/BnImportTemplate/assets/merge_tip_img.png +0 -0
  52. package/packages/BnImportTemplate/assets/sheet_tip.png +0 -0
  53. package/packages/BnImportTemplate/assets/xls.png +0 -0
  54. package/packages/BnImportTemplate/components/ImportTemplateTrigger.vue +198 -0
  55. package/packages/BnImportTemplate/components/TemplateEditDialog.vue +340 -0
  56. package/packages/BnImportTemplate/components/TemplateFieldsConfig.vue +401 -0
  57. package/packages/BnImportTemplate/components/TemplateListDialog.vue +297 -0
  58. package/packages/BnInpNum/BnInpNum.vue +165 -0
  59. package/packages/BnMenus/BnMenus.vue +502 -0
  60. package/packages/BnMenus/MenuItem.vue +321 -0
  61. package/packages/BnOrderCard/BnOrderCard.vue +389 -0
  62. package/packages/BnOrderCard/orderRemark.vue +178 -0
  63. package/packages/BnOrderCard/util.js +94 -0
  64. package/packages/BnOrderDetail/BnOrderDetail.vue +338 -0
  65. package/packages/BnOrderDetail/filterLogByUser.vue +108 -0
  66. package/packages/BnOrderDetail/orderLogs.vue +53 -0
  67. package/packages/BnOrderDetail/showSubForm/index.vue +41 -0
  68. package/packages/BnOrderDetail/showSubForm/showChildTable.vue +61 -0
  69. package/packages/BnOrderDetail/showSubForm/showTimeLine.vue +131 -0
  70. package/packages/BnOrderDetail/showSubForm/tableCellCopy.vue +84 -0
  71. package/packages/BnOrderShare/index.vue +378 -0
  72. package/packages/BnOrderShare/shareUrlInp.vue +54 -0
  73. package/packages/BnRadio/BnRadio.vue +181 -0
  74. package/packages/BnRelation/BnRelation.vue +120 -0
  75. package/packages/BnSelect/BnSelect.vue +485 -0
  76. package/packages/BnSmartForm/BnBatchForm.vue +334 -0
  77. package/packages/BnSmartForm/BnBatchFormDialog.vue +423 -0
  78. package/packages/BnSmartForm/BnSmartElf/elfLog/index.vue +57 -0
  79. package/packages/BnSmartForm/BnSmartElf/index.vue +95 -0
  80. package/packages/BnSmartForm/BnSmartFormPsychic.js +629 -0
  81. package/packages/BnSmartForm/BnSmartFormUtil.js +524 -0
  82. package/packages/BnSmartForm/addressForm/index.vue +73 -0
  83. package/packages/BnSmartForm/checkboxForm/index.vue +99 -0
  84. package/packages/BnSmartForm/childrenForm/childFormFile.vue +237 -0
  85. package/packages/BnSmartForm/childrenForm/childrenFormBody.vue +260 -0
  86. package/packages/BnSmartForm/childrenForm/index.vue +110 -0
  87. package/packages/BnSmartForm/childrenForm/searchInventory.vue +115 -0
  88. package/packages/BnSmartForm/chooseAssocTable/chooseAssocTable.vue +451 -0
  89. package/packages/BnSmartForm/chooseAssocTable/chooseChildGood.vue +229 -0
  90. package/packages/BnSmartForm/chooseAssocTable/tableCellCopy.vue +84 -0
  91. package/packages/BnSmartForm/chooseChildOrder/chooseChildOrder.vue +158 -0
  92. package/packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue +307 -0
  93. package/packages/BnSmartForm/chooseIPaasData/tableCellCopy.vue +84 -0
  94. package/packages/BnSmartForm/choosePackage/choosePackage.vue +361 -0
  95. package/packages/BnSmartForm/dateDualForm/index.vue +37 -0
  96. package/packages/BnSmartForm/dateForm/index.vue +38 -0
  97. package/packages/BnSmartForm/fileForm/fileFormData.js +50 -0
  98. package/packages/BnSmartForm/fileForm/index.vue +240 -0
  99. package/packages/BnSmartForm/formItemFooter/formItemFooter.vue +38 -0
  100. package/packages/BnSmartForm/formItemTop/formItemTop.vue +42 -0
  101. package/packages/BnSmartForm/index.vue +1201 -0
  102. package/packages/BnSmartForm/numberForm/index.vue +63 -0
  103. package/packages/BnSmartForm/radioForm/index.vue +72 -0
  104. package/packages/BnSmartForm/receiveForm/index.vue +112 -0
  105. package/packages/BnSmartForm/relationForm/index.vue +82 -0
  106. package/packages/BnSmartForm/scoreForm/index.vue +39 -0
  107. package/packages/BnSmartForm/selectForm/index.vue +55 -0
  108. package/packages/BnSmartForm/showValForm/index.vue +42 -0
  109. package/packages/BnSmartForm/showValForm/showValFormTable.vue +104 -0
  110. package/packages/BnSmartForm/smartFormsCommon.scss +43 -0
  111. package/packages/BnSmartForm/stringForm/index.vue +170 -0
  112. package/packages/BnVirtPopover/index.vue +319 -0
  113. package/packages/BnWebLog/BnWebLog.vue +140 -0
  114. package/packages/BnWorkSettingDrop/advancedOptions.js +112 -0
  115. package/packages/BnWorkSettingDrop/benBenAIUtil.js +89 -0
  116. package/packages/BnWorkSettingDrop/index.vue +292 -0
  117. package/packages/font/iconfont.css +243 -0
  118. package/packages/font/iconfont.ttf +0 -0
  119. package/packages/font/iconfont.woff +0 -0
  120. package/packages/font/iconfont.woff2 +0 -0
  121. package/utils/addressParse-old.js +645 -0
  122. package/utils/addressParse.js +735 -0
  123. package/utils/config.js +68 -0
  124. package/utils/index.js +1171 -0
  125. package/dist/assocTableSearch-C14i_zJO.js +0 -349
  126. package/dist/assocTableSearch.css +0 -1
  127. package/dist/bn-bus-ui.es.js +0 -65
  128. package/dist/bn-bus-ui.umd.js +0 -49
  129. package/dist/chooseIPaasData-Cl_5qkFA.js +0 -391
  130. package/dist/chooseIPaasData.css +0 -1
  131. package/dist/defaultSet-I4xpf8a4.js +0 -297
  132. package/dist/defaultSet.css +0 -1
  133. package/dist/fileFormData-D_Q1vylE.js +0 -53
  134. package/dist/formItemFooter-CTA7rDtV.js +0 -108
  135. package/dist/formItemFooter.css +0 -1
  136. package/dist/funcExprDialog-Cm5BiRM3.js +0 -139
  137. package/dist/funcExprDialog.css +0 -1
  138. package/dist/index-B6b4uj8v.js +0 -51
  139. package/dist/index-BWdkDTbz.js +0 -109
  140. package/dist/index-BdZ1zOap.js +0 -89
  141. package/dist/index-BdzNjjMC.js +0 -64
  142. package/dist/index-BfpZqab2.js +0 -66
  143. package/dist/index-BmkiB4hr.js +0 -66
  144. package/dist/index-Br1sqCoo.js +0 -58
  145. package/dist/index-C9qrl-yc.js +0 -183
  146. package/dist/index-CXFJXCn5.js +0 -746
  147. package/dist/index-DF114jZq.js +0 -135
  148. package/dist/index-DFPfZ_Il.js +0 -178
  149. package/dist/index-DSEtu7TN.js +0 -44
  150. package/dist/index-Did0UUWV.js +0 -221
  151. package/dist/index-DrPj-tmI.js +0 -45
  152. package/dist/index-DzDf9s2W.js +0 -89
  153. package/dist/index-LnjudNEI.js +0 -118
  154. package/dist/index-ObCfCmDT.js +0 -45
  155. package/dist/index.css +0 -1
  156. package/dist/index2.css +0 -1
  157. package/dist/index3.css +0 -1
  158. package/dist/index4.css +0 -1
  159. package/dist/index5.css +0 -1
  160. package/dist/index6.css +0 -1
  161. package/dist/index7.css +0 -1
  162. package/dist/install-C-scqkds.js +0 -23103
  163. package/dist/install.css +0 -1
  164. package/dist/setOption-CSnWzOny.js +0 -329
  165. package/dist/setOption.css +0 -1
  166. package/dist/setRelationOption-CJcHdfaa.js +0 -5217
  167. package/dist/setRelationOption.css +0 -1
@@ -0,0 +1,307 @@
1
+ <template>
2
+ <el-dialog v-model="show" :title="`请选择${columnData.name}`" top="18px" width="70%" destroy-on-close
3
+ style="margin-bottom: 0">
4
+ <tableCellCopy ref="childTableCopy"></tableCellCopy>
5
+ <div class="chooseIPaasData">
6
+ <div class="chooseIPaasData-search w-margin-bottom10">
7
+ <template v-for="(item,index) in searchPost.conditions" :key="index">
8
+ <div class="chooseIPaasData-search-item">
9
+ <BnAdvancedFilter v-model="searchPost.conditions[index]" :columnList="searchColumns" @valueChange="search()"
10
+ :allowSearchType="false" allowDel @del="searchPost.conditions.splice(index,1)"
11
+ :postFunc="postFunc" :pathUrl="item.pathUrl" :postData="item.postData"/>
12
+ </div>
13
+ </template>
14
+ </div>
15
+ <div class="w-flex-between w-margin-bottom10">
16
+ <div class="w-flex-center">
17
+ <BnDrop v-model="searchPost.conditions" :options="conditions" multiple
18
+ :optionProps="{value:'columnCode',label:'name'}">
19
+ <el-button type="primary" link> + 添加筛选条件</el-button>
20
+ </BnDrop>
21
+ </div>
22
+ <div class="w-flex-center">
23
+ <el-button type="primary" @click="search">筛选</el-button>
24
+ </div>
25
+ </div>
26
+ <vxe-table ref="assocTable" border size="small" :data="orderList" class="chooseIPaasData-out"
27
+ v-loading="loading" :tooltip-config="{}"
28
+ :row-config="{keyField: 'id',isCurrent: true, isHover: true}"
29
+ :max-height="tableMaxHeight" min-height="50"
30
+ :expand-config="{expandAll: true}"
31
+ :column-config="{resizable: true}"
32
+ :checkbox-config="{ checkRowKeys: selectData}"
33
+ :scroll-x="{ enabled: true, gt: 8 }"
34
+ :scroll-y="{ enabled: true, gt: 15 }"
35
+ @checkbox-change="checkChange"
36
+ @cell-mouseenter="onMouseEvent"
37
+ @cell-mouseleave="onMouseEvent"
38
+ @checkbox-all="checkAllTask">
39
+ <vxe-column type="checkbox" width="32" fixed="left"></vxe-column>
40
+ <vxe-column :visible="column.extraInfo.isAddable == 1" :title="column.name" :field="column.columnCode"
41
+ min-width="160"
42
+ v-for="(column,index) in columnData.moduleDefinition" :key="index"
43
+ show-header-overflow="title" show-overflow="title" show-footer-overflow>
44
+ <template #default="scope">
45
+ <span>{{ getTitle(column, scope.row[column.columnCode]) }}</span>
46
+ </template>
47
+ </vxe-column>
48
+ <template #empty>
49
+ <span>暂无数据</span>
50
+ </template>
51
+ </vxe-table>
52
+ </div>
53
+ <template #footer>
54
+ <div class="w-flex-right w-flex-center">
55
+ <span class="w-font13 w-color-gray w-margin-right8">已选择({{ selectData.length }}/{{
56
+ orderList.length
57
+ }})条</span>
58
+ <el-pagination class="w-margin-right8"
59
+ background
60
+ v-model:current-page="searchPost.pageNum"
61
+ v-model:page-size="searchPost.pageSize"
62
+ layout="prev, pager, next" @current-change="search"
63
+ :total="searchPost.total">
64
+ </el-pagination>
65
+ <el-button @click="show = false">取消</el-button>
66
+ <el-popover placement="top-start" :width="298" trigger="hover">
67
+ <div class="BnSmartForm-title-tip">在原有的子表单值的基础上追加选中的数据</div>
68
+ <template #reference>
69
+ <el-button type="primary" @click="sure('add')" :disabled="selectData.length == 0">确认追加</el-button>
70
+ </template>
71
+ </el-popover>
72
+ <el-popover placement="top-start" :width="290" trigger="hover">
73
+ <div class="BnSmartForm-title-tip">用选中的数据直接覆盖子表单的原有的值</div>
74
+ <template #reference>
75
+ <el-button type="primary" @click="sure('cover')" :disabled="selectData.length == 0">确认覆盖</el-button>
76
+ </template>
77
+ </el-popover>
78
+ </div>
79
+ </template>
80
+ </el-dialog>
81
+ </template>
82
+ <script>
83
+ import {cloneDeep} from "lodash";
84
+ import {getSearchComponents, searchValueToJson} from "../../../utils/index.js";
85
+ import tableCellCopy from "./tableCellCopy.vue";
86
+ import {getColumnValText} from "../BnSmartFormUtil.js";
87
+
88
+ export default {
89
+ name: 'chooseIPaasData',
90
+ components: {tableCellCopy},
91
+ props: {
92
+ // 接口请求外部转发
93
+ postFunc: Function,
94
+ // 扩展参数
95
+ extendPost: Object,
96
+ },
97
+ data() {
98
+ return {
99
+ show: false,
100
+ loading: false,
101
+ // 子表单信息
102
+ columnData: {},
103
+ // 支持筛选的组件
104
+ searchColumns: [],
105
+ // 对筛选组件进行处理,尽量少的传一些字段
106
+ conditions: [],
107
+ // 最大高度
108
+ tableMaxHeight: 400,
109
+ // 选中数据
110
+ selectData: [],
111
+ // 高级筛选
112
+ searchPost: {
113
+ pageSize: 20,
114
+ pageNum: 1,
115
+ total: 0,
116
+ conditions: [],
117
+ taskContent:''
118
+ },
119
+ // 表格数据
120
+ orderList: [],
121
+ // 快捷筛选项
122
+ searchList: []
123
+ }
124
+ },
125
+ methods: {
126
+ /**
127
+ * 打开选择弹框,处理数据回显
128
+ * */
129
+ open(column,contents) {
130
+ this.columnData = cloneDeep(column);
131
+ this.orderList = []
132
+ this.searchPost.pageNum = 1;
133
+ this.searchPost.taskContent = JSON.stringify(contents);
134
+ this.searchColumns = []
135
+ try {
136
+ // 整理筛选条件
137
+ let conditions = []
138
+ column.moduleDefinition.forEach(i => {
139
+ let outData = i.outDataSourceInfo[0] || {}
140
+ let extend = outData.extend ? JSON.parse(outData.extend) : {}
141
+ if (outData.platform == 'relation_ipaas' && extend.io == 'in') {
142
+ conditions.push(i)
143
+ }
144
+ })
145
+ this.searchColumns = getSearchComponents(conditions, this.extendPost.appId, this.extendPost.projectId)
146
+ // 简化筛选的字段
147
+ this.conditions = this.searchColumns.map(i => {
148
+ return {
149
+ id: i.id,
150
+ name: i.name,
151
+ behaviorType: i.behaviorType,
152
+ columnCode: i.columnCode,
153
+ searchType: i.searchType,
154
+ value: i.value
155
+ }
156
+ })
157
+ } catch (e) {
158
+ console.log('格式化关联表筛选组件' + e)
159
+ }
160
+ this.tableMaxHeight = window.innerHeight - 360;
161
+ this.postFunc(`/v2/client/cache/get/${this.extendPost.projectId}_${this.columnData.id}_${this.extendPost.userId || ''}_assocTable`, {}, 'get').then(res => {
162
+ if (!res.code && res.data) {
163
+ const c = JSON.parse(res.data)
164
+ if (c.conditions) {
165
+ this.searchPost.conditions = c.conditions;
166
+ } else if (this.searchColumns.length > 0) {
167
+ this.searchPost.conditions = [cloneDeep(this.searchColumns[0])]
168
+ }
169
+ }
170
+ this.search();
171
+ })
172
+ this.show = true;
173
+ },
174
+ /**
175
+ * 选中任务
176
+ * */
177
+ checkChange({checked, row}) {
178
+ this.$refs.assocTable.setCheckboxRow(row, checked);
179
+ if (checked) {
180
+ if (!this.selectData.includes(row.id)) {
181
+ this.selectData.push(row.id);
182
+ }
183
+ } else {
184
+ if (this.selectData.includes(row.id)) {
185
+ this.selectData.splice(this.selectData.indexOf(row.id), 1);
186
+ }
187
+ }
188
+ },
189
+ /**
190
+ * 全选任务
191
+ * */
192
+ checkAllTask({records}) {
193
+ if (records.length != 0) {
194
+ records.map((task) => {
195
+ if (!this.selectData.includes(task.id)) {
196
+ this.selectData.push(task.id);
197
+ }
198
+ });
199
+ } else {
200
+ this.selectData = []
201
+ }
202
+ },
203
+ /**
204
+ * 筛选数据
205
+ * */
206
+ search(postData) {
207
+ this.searchPost = {...this.searchPost, ...postData}
208
+ this.postFunc('/v2/client/cache/save', {
209
+ key: `${this.extendPost.projectId}_${this.columnData.id}_${this.extendPost.userId || ''}_assocTable`,
210
+ value: this.searchPost
211
+ })
212
+ let post = {
213
+ ...this.searchPost,
214
+ conditions: JSON.stringify(this.searchPost.conditions),
215
+ originId:this.extendPost.projectId,
216
+ subFormId:this.columnData.id
217
+ }
218
+ this.selectData = []
219
+ this.$refs.assocTable?.clearCheckboxRow()
220
+ this.loading = true;
221
+ this.postFunc('/biztable/content/queryChildTask', post).then(res => {
222
+ this.loading = false;
223
+ if (!res.code) {
224
+ this.orderList = res.data.results
225
+ this.searchPost.total = parseInt(res.data.total);
226
+ this.searchPost.pageNum = res.data.pageNum;
227
+ } else {
228
+ this.orderList = [];
229
+ this.searchPost.total = 0;
230
+ this.searchPost.pageNum = 1;
231
+ }
232
+ })
233
+ },
234
+ /**
235
+ * 鼠标移入移出单元格,展示隐藏复制按钮
236
+ * @param {Event} e 事件对象
237
+ */
238
+ onMouseEvent(scope) {
239
+ // 当鼠标悬浮到单元格时,再加复制按钮
240
+ let e = scope.$event;
241
+ // 鼠标离开
242
+ if (e.type === "mouseleave") {
243
+ this.$refs.childTableCopy?.onHide()
244
+ } else {
245
+ let data = {
246
+ column: {columnCode: this.headerColumns[scope.columnIndex - 2]?.columnCode},
247
+ row: scope.row
248
+ }
249
+ // 有值再显示
250
+ if (data.row[data.column.columnCode]) {
251
+ this.$refs.childTableCopy?.onShow(scope.cell, data)
252
+ }
253
+ }
254
+ },
255
+ /**
256
+ * 转义title
257
+ * */
258
+ getTitle(column, value) {
259
+ let text = getColumnValText(column, true, value);
260
+ return text;
261
+ },
262
+ /**
263
+ * 确认
264
+ * */
265
+ sure(type) {
266
+ let orders = this.orderList.reduce((acc, i) => {
267
+ if (this.selectData.includes(i.id)) {
268
+ acc.push(i);
269
+ }
270
+ return acc
271
+ }, []);
272
+ setTimeout(() => {
273
+ this.$emit('setChildrenForm', orders, type, this.columnData.columnCode)
274
+ }, 200)
275
+ this.show = false;
276
+ },
277
+ }
278
+ }
279
+ </script>
280
+
281
+ <style scoped lang="scss">
282
+ .chooseIPaasData {
283
+ height: 100%;
284
+ overflow: hidden;
285
+
286
+ &-search {
287
+ display: flex;
288
+ flex-wrap: wrap;
289
+ max-height: 142px;
290
+ overflow-y: auto;
291
+ gap: 10px 18px;
292
+
293
+ &-item {
294
+ width: calc(33.33% - 18px);
295
+ flex-grow: 0;
296
+ }
297
+ }
298
+
299
+ &-out {
300
+ :deep(.vxe-table--header) {
301
+ .vxe-header--row {
302
+ background-color: #ecf5ff;
303
+ }
304
+ }
305
+ }
306
+ }
307
+ </style>
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div class="worksheetCopy" :style="style" v-show="visiable || isMouseIn" @mouseover="onMouseEvent"
3
+ @mouseleave="onMouseEvent" @click.stop="copyText">复制
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "WorksheetCopy",
10
+ data() {
11
+ return {
12
+ isMouseIn: false,
13
+ visiable: false,
14
+ params: {},
15
+ style: {},
16
+ };
17
+ },
18
+ methods: {
19
+ /**
20
+ * 鼠标移入移出
21
+ * @param {Event} e 事件对象
22
+ */
23
+ onMouseEvent(e) {
24
+ this.isMouseIn = e.type === "mouseleave" ? false : true;
25
+ },
26
+ /**
27
+ * 初始化
28
+ * @param {Object} params {column:组件信息,row:行数据}
29
+ */
30
+ onShow(target, params) {
31
+ try {
32
+ const {right, top} = target.getBoundingClientRect();
33
+ this.style = {
34
+ left: `${right - 34}px`,
35
+ top: `${top}px`,
36
+ };
37
+ this.params = params;
38
+ this.visiable = true;
39
+ }catch (e){
40
+ console.log('显示复制按钮失败')
41
+ }
42
+ },
43
+ onHide() {
44
+ this.visiable = false;
45
+ },
46
+ /**
47
+ * 复制文本
48
+ */
49
+ copyText() {
50
+ const {column, row} = this.params;
51
+ let copyValue = row[column.columnCode] || "";
52
+ if(copyValue) {
53
+ const textarea = document.createElement('textarea');
54
+ textarea.value = copyValue;
55
+ document.body.appendChild(textarea);
56
+ textarea.select();
57
+ document.execCommand('copy');
58
+ document.body.removeChild(textarea);
59
+ this.$message.success('复制成功');
60
+ } else {
61
+ this.$message.warning('无内容可复制');
62
+ }
63
+ },
64
+ },
65
+ };
66
+ </script>
67
+ <style lang='scss' scoped>
68
+ .worksheetCopy {
69
+ position: fixed;
70
+ width: 34px;
71
+ height: 22px;
72
+ line-height: 22px;
73
+ text-align: center;
74
+ background-color: rgba(51, 51, 51, 0.3);
75
+ color: #fff;
76
+ font-size: 12px;
77
+ z-index: 999999;
78
+
79
+ &:hover {
80
+ background-color: #65acff;
81
+ cursor: pointer;
82
+ }
83
+ }
84
+ </style>