@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,237 @@
1
+ <template>
2
+ <div class="childFormFile">
3
+ <div class="">
4
+ <el-upload class="childFormFile-upload" ref="uploadInput" drag
5
+ :action="column.pathUrl || uploadAction"
6
+ :show-file-list="false"
7
+ :before-upload="beforeUpload" multiple
8
+ :data="uploadData" :on-progress="handleUploadProgress"
9
+ :on-success="fileSuccess">
10
+ <div class="childFormFile-btn">
11
+ <span class="bnUIcon bnUIcon-upload"></span> 选择或拖拽上传文件
12
+ </div>
13
+ </el-upload>
14
+ <!-- 视频附件不支持,其他情况支持 -->
15
+ <el-input v-model="pasteValue"
16
+ ref="fileUploadInput"
17
+ placeholder="复制粘贴上传截图"
18
+ class="childFormFile-input"/>
19
+ <span class="childFormFile-tip">最多可上传{{ uploadFileNumber }}个文件,单个文件不超过{{ showLimit }}M</span>
20
+ </div>
21
+ <el-progress
22
+ style="width: 100%; max-width: 444px"
23
+ :percentage="uploadProgress"
24
+ v-show="uploadProgress > 0"
25
+ class="childFormFile-progress"
26
+ ></el-progress>
27
+ <div v-if="value">
28
+ <BnFileView :file-list="value" :isDel="true" :is-mini="true"></BnFileView>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import {pasteImg} from "../BnSmartFormUtil.js";
35
+ import {fileType} from "./../fileForm/fileFormData.js";
36
+
37
+ export default {
38
+ name: "childFormFile",
39
+ props: {
40
+ column: {
41
+ type: Object,
42
+ default: () => ({}),
43
+ },
44
+ value:{
45
+ type: Array,
46
+ default: () => [],
47
+ },
48
+ },
49
+ data() {
50
+ return {
51
+ fileType: this.column.fileType || fileType,
52
+ pasteValue: "",
53
+ pasteImgList: [], //用来存放粘贴的图片
54
+ // 上传进度
55
+ uploadProgress: 0,
56
+ uploadFileCount: 0, //记录上传次数,限制最多上传5个
57
+ uploadFileNumber: 10, //可上传附件那个数
58
+ showLimit: 15, //单文件最大M数
59
+ uploadAction: "/v2/attachment/upload",
60
+ uploadData: {source: "task"},
61
+ };
62
+ },
63
+ methods: {
64
+ /**
65
+ * 上传成功
66
+ * */
67
+ fileSuccess(res) {
68
+ this.column.error = "";
69
+ this.uploadProgress = 0;
70
+
71
+ if (!res.code) {
72
+ const fileData = {
73
+ title: res.data.fileName,
74
+ id: res.data.id,
75
+ code: res.data.id,
76
+ size: res.data.fileSize,
77
+ type: res.data.suffix,
78
+ url: res.data.url,
79
+ };
80
+
81
+ if (this.value.length < this.uploadFileNumber) {
82
+ this.value.push(fileData);
83
+ this.$emit('onChange', this.column);
84
+ } else {
85
+ this.$message({
86
+ message: `上传文件个数不能超过${this.uploadFileNumber}个`,
87
+ type: 'warning'
88
+ });
89
+ }
90
+ this.uploadFileCount = this.value.length;
91
+ } else {
92
+ this.$message({
93
+ message: res.msg,
94
+ type: 'warning'
95
+ });
96
+ }
97
+ },
98
+ /**
99
+ * 附件上传前
100
+ * */
101
+ beforeUpload(file) {
102
+ if (this.value.length >= this.uploadFileNumber) {
103
+ this.$message({
104
+ message: `上传文件个数不能超过${this.uploadFileNumber}个`,
105
+ type: 'warning'
106
+ });
107
+ return false;
108
+ }
109
+ const maxSize = 50;
110
+ const maxSizeBytes = 1048576 * maxSize;
111
+ if (file.size > maxSizeBytes) {
112
+ this.$message({
113
+ message: `上传文件大小不能超出${maxSize}MB`,
114
+ type: 'warning'
115
+ });
116
+ return false;
117
+ }
118
+ const fileExt = file.name.split(".").pop().toLowerCase();
119
+ if (!this.fileType.includes(fileExt)) {
120
+ this.$message({
121
+ message: "上传的文件格式不支持",
122
+ type: 'warning'
123
+ });
124
+ return false;
125
+ }
126
+ this.uploadFileCount++;
127
+ return true;
128
+ },
129
+ handleUploadProgress(event) {
130
+ this.uploadProgress = Math.round(event.percent);
131
+ },
132
+ //粘贴图片到编辑器,事件处理方法,主要用于事件销毁
133
+ pasteEvent(evt) {
134
+ if (this.value.length >= this.uploadFileNumber) {
135
+ this.$message({
136
+ message: `上传文件个数不能超过${this.uploadFileNumber}个`,
137
+ type: 'warning'
138
+ });
139
+ return false;
140
+ }
141
+ this.column.error = "";
142
+ this.pasteImgList.push(evt);
143
+ pasteImg(evt, this.column.pathUrl || this.uploadAction).then((res) => {
144
+ if (!res.code) {
145
+ const fileData = {
146
+ title: res.data.fileName,
147
+ id: res.data.id,
148
+ code: res.data.id,
149
+ size: res.data.fileSize,
150
+ type: res.data.suffix,
151
+ url: res.data.url,
152
+ };
153
+
154
+ this.value.push(fileData);
155
+ this.$emit('onChange', this.column);
156
+ if (this.value.length >= this.uploadFileNumber) {
157
+ this.pasteImgList = [];
158
+ }
159
+ } else {
160
+ this.$message({
161
+ message: res.msg,
162
+ type: 'warning'
163
+ });
164
+ }
165
+ });
166
+ },
167
+ },
168
+ mounted() {
169
+ if (this.$refs.fileUploadInput && this.$refs.fileUploadInput.$el) {
170
+ this.$refs.fileUploadInput.$el.addEventListener("paste", this.pasteEvent);
171
+ }
172
+ },
173
+ //实例销毁前
174
+ beforeDestroy() {
175
+ if (this.$refs.fileUploadInput && this.$refs.fileUploadInput.$el) {
176
+ this.$refs.fileUploadInput.$el.removeEventListener(
177
+ "paste",
178
+ this.pasteEvent
179
+ );
180
+ }
181
+ },
182
+ };
183
+ </script>
184
+ <style scoped lang="scss">
185
+ .childFormFile {
186
+ &-btn {
187
+ width: 257px;
188
+ height: 20px;
189
+ padding: 5px 16px;
190
+ border: 1px solid rgba(0, 0, 0, 0.15);
191
+ box-sizing: content-box;
192
+ border-radius: 2px;
193
+ color: #666;
194
+ }
195
+
196
+ :deep(.childFormFile-upload) {
197
+ .el-upload {
198
+ display: inline-block;
199
+ }
200
+
201
+ .el-upload-dragger {
202
+ border: none;
203
+ width: auto;
204
+ height: auto;
205
+ border-radius: 0;
206
+ padding: 0;
207
+ }
208
+ }
209
+
210
+ &-list {
211
+ position: relative;
212
+ }
213
+
214
+ :deep(.childFormFile-input) {
215
+ width: 145px;
216
+ display: inline-block;
217
+
218
+ .el-input__wrapper {
219
+ border: 1px dashed rgba(0, 0, 0, 0.15);
220
+ }
221
+ }
222
+
223
+ &-tip {
224
+ margin-left: 8px;
225
+ display: inline-block;
226
+ font-size: 12px;
227
+ line-height: 32px;
228
+ color: rgba(0, 0, 0, 0.25);
229
+ }
230
+
231
+ &-progress {
232
+ width: 100%;
233
+ max-width: 444px;
234
+ margin-top: 8px;
235
+ }
236
+ }
237
+ </style>
@@ -0,0 +1,260 @@
1
+ <!-- 子表单支持 1,2,3,4,5,7,10 这七个组件 -->
2
+ <template>
3
+ <div class="w-default-wrap">
4
+ <vxe-table border size="small" :data="sourceData.value" :max-height="360">
5
+ <vxe-column type="seq" width="50"></vxe-column>
6
+ <template v-for="(column,index) in sourceData.moduleDefinition" :key="index">
7
+ <vxe-column :title="column.name" :params="column.extraInfo || {}" :min-width="240" show-header-overflow="title"
8
+ v-if="isShow(column)">
9
+ <template #header="scope">
10
+ <div class="w-flex-center">
11
+ <!--必填标识-->
12
+ <span v-if="scope.column.params.valueEmptyCheck == 1"
13
+ class="w-color-red w-margin-right4">*</span>
14
+ <span>{{ scope.column.title }}</span>
15
+ </div>
16
+ </template>
17
+ <template #default="scope">
18
+ <div class="w-flex-left">
19
+ <div class="childFormBody-td" v-if="column.behaviorType == 1">
20
+ <el-input type="textarea" resize="none" :rows="1" placeholder="请输入"
21
+ :disabled="disabled || isDisabled(column)"
22
+ @input="onInput($event,scope,column)" @focus="onFocus($event,scope,column)"
23
+ @blur="onBlur($event,scope,column)" :maxlength="200000"
24
+ v-model.trim="scope.row[column.columnCode]"/>
25
+ </div>
26
+ <div class="childFormBody-td" v-if="column.behaviorType == 2">
27
+ <BnInpNum @input="onInput($event,scope,column)" :disabled="disabled || isDisabled(column)"
28
+ @focus="onFocus($event,scope,column)" @blur="onBlur($event,scope,column)"
29
+ :precision="column.extraInfo?.valueType"
30
+ v-model="scope.row[column.columnCode]"
31
+ placeholder="请输入有效数值"></BnInpNum>
32
+ </div>
33
+ <div class="childFormBody-td" v-if="[3,4,5].includes(column.behaviorType)">
34
+ <BnSelect v-model="scope.row[column.columnCode]" clearable filterable
35
+ :multiple="column.behaviorType == 5" :optionProps="{value:'code',label:'title'}"
36
+ :options="column.moduleDefinition" :disabled="disabled || isDisabled(column)"
37
+ :pathUrl="column.pathUrl" :postData="column.postData" :postFunc="postFunc"
38
+ @change="onChange('change',scope,column)"></BnSelect>
39
+ </div>
40
+ <div class="childFormBody-td" v-if="[6,20].includes(column.behaviorType)">
41
+ <BnCascader @change="onChange('change',scope,column)"
42
+ v-model="scope.row[column.columnCode]"
43
+ :postFunc="postFunc" :path-url="column.pathUrl"
44
+ :post-data="column.postData" remote-mode="tree"
45
+ :optionProps="{value:'code',label:'title'}" :label-in-value="false"
46
+ :options="column.moduleDefinition.optionList" hide-check-to-last
47
+ :multiple="column.behaviorType == 20" :disabled="disabled || isDisabled(column)"
48
+ clearable/>
49
+ <!-- <BnRelation @change="onChange('change',scope,column)" :options="column.moduleDefinition.optionList"-->
50
+ <!-- :props="{checkStrictly:true,value:'code',label:'title'}"-->
51
+ <!-- v-model="scope.row[column.columnCode]"-->
52
+ <!-- :multiple="column.behaviorType == 20" filterable-->
53
+ <!-- :disabled="disabled || isDisabled(column)"></BnRelation>-->
54
+ </div>
55
+ <div class="childFormBody-td" v-if="column.behaviorType == 7">
56
+ <el-date-picker @change="onChange('change',scope,column)" :disabled="disabled || isDisabled(column)"
57
+ v-model="scope.row[column.columnCode]" type="datetime"
58
+ format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"/>
59
+ </div>
60
+ <div v-if="column.behaviorType == 10" class="childFormBody-file">
61
+ <el-popover placement="top" title="附件上传" :width="400" trigger="click">
62
+ <child-form-file :column="column" :value="scope.row[column.columnCode]"
63
+ @change="onChange('change',scope,column)"></child-form-file>
64
+ <template #reference>
65
+ <span class="bnUIcon bnUIcon-addFile childFormBody-file-icon"></span>
66
+ </template>
67
+ </el-popover>
68
+ <div class="childFormBody-file-view" v-if="scope.row[column.columnCode]">
69
+ <BnFileView :file-list="scope.row[column.columnCode]" :is-mini="true"
70
+ :isDel="true"
71
+ :no-warp="true" @delFile="onChange('change',scope,column)"></BnFileView>
72
+ </div>
73
+ </div>
74
+ <div class="childFormBody-operate">
75
+ <el-popover placement="bottom" v-if="column.extraInfo?.stockSearchColumnCode" width="480">
76
+ <searchInventory :key="scope.row._X_ROW_KEY" :postFunc="postFunc" :column="column" :row="scope.row"/>
77
+ <template #reference>
78
+ <span class="bnUIcon bnUIcon-inventory w-color-orange w-default-hover w-margin-left4"
79
+ title="点击查库存"/>
80
+ </template>
81
+ </el-popover>
82
+ </div>
83
+ </div>
84
+ </template>
85
+ </vxe-column>
86
+ </template>
87
+ <template #empty>
88
+ <span>暂无数据
89
+ <span class="w-color-blue w-cursor-pointer" v-if="!disabled" @click="addDefault(0)">点击添加</span>
90
+ </span>
91
+ </template>
92
+ <vxe-column fixed="right" width="52" v-if="!disabled">
93
+ <template #header="{ column }">
94
+ <div class="w-flex-center">
95
+ <span class="bnUIcon bnUIcon-clear w-color-red w-font-max w-cursor-pointer" title="点击清空子表单" v-if="sourceData.value.length > 0"
96
+ @click="sourceData.value=[]"></span>
97
+ </div>
98
+ </template>
99
+ <template #default="scope">
100
+ <span class="bnUIcon bnUIcon-add w-color-blue w-cursor-pointer w-font-max w-margin-right5"
101
+ @click="addDefault(scope.rowIndex+1)"></span>
102
+ <span class="bnUIcon bnUIcon-delete w-color-red w-font-max w-cursor-pointer"
103
+ @click="delItem(scope.rowIndex)"></span>
104
+ </template>
105
+ </vxe-column>
106
+ </vxe-table>
107
+ </div>
108
+ </template>
109
+
110
+ <script>
111
+ import {debounce} from "lodash";
112
+ import childFormFile from "./childFormFile.vue";
113
+ import searchInventory from "./searchInventory.vue";
114
+ // 处理默认值映射相关逻辑
115
+ import {initDefaultLinkVal} from "../BnSmartFormUtil.js";
116
+
117
+ export default {
118
+ name: "editLabel",
119
+ components: {childFormFile, searchInventory},
120
+ props: {
121
+ sourceData: {
122
+ type: Object,
123
+ default: function () {
124
+ return {}
125
+ }
126
+ },
127
+ // 默认值映射相关规则
128
+ defaultLink: Object,
129
+ componentList: Array,
130
+ taskId: [String, Number],
131
+ disabled: Boolean,
132
+ postFunc: Function
133
+ },
134
+ methods: {
135
+ /**
136
+ * 根据权限判断是否限制组件
137
+ * */
138
+ isShow(column) {
139
+ let flag = true;
140
+ // 处理新建时可见、编辑时可见
141
+ if (!this.taskId && column.extraInfo.isAddable != 1) {
142
+ flag = false;
143
+ } else if (this.taskId && column.extraInfo.isEditable != 1) {
144
+ flag = false;
145
+ }
146
+ return flag;
147
+ },
148
+ /**
149
+ * 根据权限判断是否禁用组件
150
+ * */
151
+ isDisabled(column) {
152
+ let flag = false;
153
+ // 处理新建时可见、编辑时可见
154
+ if (!this.taskId && column.extraInfo.valueAddable == 1) {
155
+ flag = true;
156
+ } else if (this.taskId && column.extraInfo.valueEditable == 1) {
157
+ flag = true;
158
+ }
159
+ return flag;
160
+ },
161
+ /**
162
+ * 向表格内插入数据
163
+ * */
164
+ addDefault(index) {
165
+ //超出最大条数,提示不能再增加保存了
166
+ if (this.sourceData.value.length >= 30) {
167
+ this.$message.warning("最多支持30条");
168
+ return false;
169
+ }
170
+ //遍历子表单的组件列表,整理value
171
+ let value = {};
172
+ this.sourceData.moduleDefinition.forEach(component => {
173
+ // 子表单的规则的key 是 父组件id。子组件id 拼接的,其他判断和正常组件一样
174
+ if (component.behaviorType == 1 && this.defaultLink?.setColumn[`${this.sourceData.columnCode}.${component.columnCode}`]) {
175
+ value[component.columnCode] = initDefaultLinkVal(this.componentList, this.defaultLink.setColumn[`${this.sourceData.columnCode}.${component.columnCode}`]);
176
+ } else {
177
+ value[component.columnCode] = component.value;
178
+ }
179
+ });
180
+ let data = JSON.parse(JSON.stringify(value))
181
+ if (index) {
182
+ this.sourceData.value.splice(index, 0, data)
183
+ } else {
184
+ this.sourceData.value.push(data);
185
+ }
186
+ // 触发change事件,整行添加
187
+ this.onChange('addRow', {row: data}, null)
188
+ },
189
+ /**
190
+ * 删除数据
191
+ * */
192
+ delItem(index) {
193
+ this.sourceData.value.splice(index, 1);
194
+ this.onChange('delRow', {delIndx: index}, null)
195
+ },
196
+ /**
197
+ * 输入框Change事件
198
+ * @param {String} type 是否是其他事件类型
199
+ * @param {Object} params 扩展参数
200
+ * */
201
+ onChange: debounce(function (type, params, column) {
202
+ this.sourceData.error = '';
203
+ this.sourceData.warning = '';
204
+ // 当值不为空
205
+ this.$emit('onChange', this.sourceData, {type: type, tableScope: params, childColumn: column})
206
+ }, 500),
207
+ /**
208
+ * 输入框输入事件
209
+ * @param {Object} params 扩展参数
210
+ * */
211
+ onInput(e, params, column) {
212
+ this.$emit('input', this.sourceData, {tableScope: params, childColumn: column})
213
+ this.onChange('input', params, column)
214
+ },
215
+ /**
216
+ * 输入框onFocus事件
217
+ * @param {Object} params 表格组件行数据
218
+ * @param {Object} column 子组件
219
+ * */
220
+ onFocus(e, params, column) {
221
+ this.$emit('focus', this.sourceData, {tableScope: params, childColumn: column})
222
+ },
223
+ /**
224
+ * 输入框失去焦点事件
225
+ * @param {Object} params 扩展参数
226
+ * */
227
+ onBlur(e, params, column) {
228
+ this.$emit('blur', this.sourceData, {tableScope: params, childColumn: column})
229
+ },
230
+ },
231
+ }
232
+ </script>
233
+ <style scoped lang="scss">
234
+ .childFormBody {
235
+ &-file {
236
+ order: 1;
237
+ display: flex;
238
+ align-items: center;
239
+
240
+ &-icon {
241
+ font-size: 22px;
242
+ }
243
+
244
+ &-view {
245
+ width: calc(100% - 20px);
246
+ overflow: hidden
247
+ }
248
+ }
249
+
250
+ &-td {
251
+ flex-grow: 1;
252
+
253
+ }
254
+
255
+ &-operate {
256
+ display: flex;
257
+ align-items: center;
258
+ }
259
+ }
260
+ </style>
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <div class="w-default-wrap childrenForm">
3
+ <formItemTop :column="column"/>
4
+ <div class="childrenForm-behavior">
5
+ <div class="w-flex-center w-margin-bottom6">
6
+ <!--多包裹下的子单-->
7
+ <template v-if="dataBack && dataBack.order == column.columnCode">
8
+ <el-popover placement="top-start" :width="400" trigger="hover" :show-arrow="false">
9
+ <div class="BnSmartForm-title-tip">
10
+ <span class="w-color-blue">标准ERP子组件</span>,会将选中包裹的子表合并然后在这里列举
11
+ </div>
12
+ <template #reference>
13
+ <el-button link type="primary" style="padding-left: 0"
14
+ @click="$emit('operate', this.column,'chooseChildOrder')">
15
+ <span class="bnUIcon bnUIcon-split"></span> 请选择
16
+ </el-button>
17
+ </template>
18
+ </el-popover>
19
+ </template>
20
+ <!--子表单关联表,查询数据-->
21
+ <template v-if="column.insideDataSourceInfo?.tableCode">
22
+ <el-popover placement="top-start" :width="440" trigger="hover" :show-arrow="false">
23
+ <div class="BnSmartForm-title-tip">
24
+ <span class="w-color-blue">关联表组件</span>,可以通过筛选条件,筛选外部表数据进行选择回填
25
+ </div>
26
+ <template #reference>
27
+ <el-button link type="primary" style="padding-left: 0"
28
+ @click="$emit('operate', this.column,'chooseAssocTable')">
29
+ <span class="bnUIcon bnUIcon-linkTable"></span>筛选{{ column.name }}
30
+ </el-button>
31
+ </template>
32
+ </el-popover>
33
+ </template>
34
+ <!--ipaas数据关联查询-->
35
+ <template v-if="column.outDataSourceInfo[0]?.platform == 'relation_ipaas'">
36
+ <el-popover placement="top-start" :width="440" trigger="hover" :show-arrow="false">
37
+ <div class="BnSmartForm-title-tip">
38
+ <span class="w-color-blue">关联ipaas查询数据</span>,可以通过班牛ipaas接口筛选外部数据,进行选择回填
39
+ </div>
40
+ <template #reference>
41
+ <el-button link type="primary" style="padding-left: 0"
42
+ @click="$emit('operate', this.column,'chooseIPaasData')">
43
+ <span class="bnUIcon bnUIcon-api"></span>查询{{ column.name }}
44
+ </el-button>
45
+ </template>
46
+ </el-popover>
47
+ </template>
48
+ </div>
49
+ <childrenFormBody :sourceData="column" ref="childrenFormBody" :disabled="disabled" :taskId="taskId"
50
+ :defaultLink="defaultLink" :componentList="componentList" :postFunc="postFunc"
51
+ @input="onInput" @onChange="onChange" @focus="onFocus" @blur="onBlur"></childrenFormBody>
52
+ </div>
53
+ <formItemFooter :column="column"/>
54
+ </div>
55
+ </template>
56
+
57
+ <script>
58
+ //引入子表单组件
59
+ import childrenFormBody from './childrenFormBody.vue'
60
+ import formItemTop from "../formItemTop/formItemTop.vue";
61
+ import formItemFooter from "../formItemFooter/formItemFooter.vue";
62
+ import {debounce} from "lodash";
63
+
64
+ export default {
65
+ name: "childrenForm",
66
+ components: {formItemFooter, formItemTop, childrenFormBody,},
67
+ props: {
68
+ column: {
69
+ type: Object, default() {
70
+ return {}
71
+ }
72
+ },
73
+ dataBack: Object,
74
+ // 默认值映射相关规则
75
+ defaultLink: Object,
76
+ componentList: Array,
77
+ disabled: Boolean,
78
+ taskId: [String, Number],
79
+ postFunc: Function
80
+ },
81
+ methods: {
82
+ /**
83
+ * Change事件
84
+ * params:子表单需要增加更多参数,用来表示是自己那个子组件,发生的什么变化
85
+ * */
86
+ onChange: debounce(function (column, params) {
87
+ this.$emit('onChange', this.column, params)
88
+ }, 500),
89
+ /**
90
+ * 输入框输入事件
91
+ * */
92
+ onInput(e, params) {
93
+ this.$emit('input', this.column, params)
94
+ },
95
+ /**
96
+ * 输入框onFocus事件
97
+ * */
98
+ onFocus(e, params) {
99
+ this.$emit('focus', this.column, params)
100
+ },
101
+ /**
102
+ * 输入框失去焦点事件
103
+ * */
104
+ onBlur(e, params) {
105
+ this.$emit('blur', this.column, params)
106
+ },
107
+ },
108
+ }
109
+ </script>
110
+