@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,210 @@
1
+ <template>
2
+ <div class="w-default-wrap">
3
+ <!-- 默认值输入框,支持手动输入和组件关联 -->
4
+ <el-input
5
+ v-model="columnInfo.defaultInfo"
6
+ placeholder="点击右侧可选择组件关联"
7
+ ref="defaultContentString"
8
+ @change="handleDefaultValueChange"
9
+ >
10
+ <template #append>
11
+ <!-- 组件关联下拉选择器 -->
12
+ <BnDrop :options="columnList.filter(i=>i.id !== columnInfo.id && ![10, 11, 12, 13, 17,18].includes(i.behaviorType))"
13
+ :optionProps="{value:'columnCode',label:'name'}"
14
+ :placement="'bottom-end'"
15
+ @checkItem="handleColumnSelect"
16
+ noValue
17
+ >
18
+ <div>
19
+ <el-tooltip
20
+ class="box-item"
21
+ effect="dark" :show-after="600"
22
+ content="关联组件将会把组件的值,映射到当前组件的默认值中"
23
+ placement="top"
24
+ >
25
+ <span class="bnUIcon bnUIcon-linkFiled w-color-purple w-cursor-pointer"></span>
26
+ </el-tooltip>
27
+ </div>
28
+ </BnDrop>
29
+ </template>
30
+ </el-input>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ export default {
36
+ name: "defaultSet",
37
+ props: {
38
+ // 最终选中的value
39
+ modelValue: {
40
+ type: Object,
41
+ default() {
42
+ return {}
43
+ }
44
+ },
45
+ // 组件列表
46
+ columnList: {
47
+ type: Array,
48
+ default() {
49
+ return []
50
+ }
51
+ },
52
+ // 是否禁用
53
+ disabled: Boolean,
54
+ postFunc: Function,
55
+ extendPost: Object,
56
+ },
57
+
58
+ computed: {
59
+ columnInfo: {
60
+ get() {
61
+ return this.modelValue;
62
+ },
63
+ set(val) {
64
+ this.$emit("update:modelValue", val);
65
+ },
66
+ },
67
+ },
68
+
69
+ methods: {
70
+ /**
71
+ * 在光标位置插入文本
72
+ * @param {HTMLElement} dom - 目标输入框DOM元素
73
+ * @param {string} value - 要插入的文本
74
+ * @returns {string} 插入后的完整文本
75
+ */
76
+ insertTextAtCursor(dom, value) {
77
+ // IE浏览器支持
78
+ if (document.selection) {
79
+ dom.focus();
80
+ const selectRange = document.selection.createRange();
81
+ selectRange.text = value;
82
+ dom.focus();
83
+ }
84
+ // 现代浏览器支持
85
+ else if (dom.selectionStart || dom.selectionStart === 0) {
86
+ const startPos = dom.selectionStart;
87
+ const endPos = dom.selectionEnd;
88
+ const scrollTop = dom.scrollTop;
89
+
90
+ // 在光标位置插入文本
91
+ dom.value = dom.value.substring(0, startPos) + value + dom.value.substring(endPos);
92
+
93
+ // 设置光标位置到插入文本之后
94
+ dom.focus();
95
+ dom.selectionStart = startPos + value.length;
96
+ dom.selectionEnd = startPos + value.length;
97
+ dom.scrollTop = scrollTop;
98
+ }
99
+ // 其他情况直接追加到末尾
100
+ else {
101
+ dom.value += value;
102
+ dom.focus();
103
+ }
104
+
105
+ return dom.value;
106
+ },
107
+
108
+ /**
109
+ * 将默认值中的组件名称转换为对应的code和id
110
+ * 格式:$组件名$ -> $组件code$ 或 $组件id$
111
+ */
112
+ updateDefaultInfoWithCodeAndId() {
113
+ let defaultInfoWithCode = this.columnInfo.defaultInfo;
114
+ let defaultInfoWithId = this.columnInfo.defaultInfo;
115
+
116
+ // 遍历所有组件列表,进行字符串替换
117
+ this.columnList.forEach(col => {
118
+ const placeholder = `$${col.name}$`;
119
+ const codePlaceholder = `$${col.columnCode}$`;
120
+ const idPlaceholder = `$${col.id}$`;
121
+
122
+ // 全局替换组件名为code和id
123
+ defaultInfoWithCode = defaultInfoWithCode.split(placeholder).join(codePlaceholder);
124
+ defaultInfoWithId = defaultInfoWithId.split(placeholder).join(idPlaceholder);
125
+ });
126
+
127
+ // 更新到组件配置中
128
+ this.columnInfo.extraInfo.defaultInfoWithCode = defaultInfoWithCode;
129
+ this.columnInfo.extraInfo.defaultInfoWithId = defaultInfoWithId;
130
+ },
131
+
132
+ /**
133
+ * 处理选择关联组件事件
134
+ * @param {Object} column - 被选中的组件对象
135
+ */
136
+ handleColumnSelect(column) {
137
+ // 限制最多关联10个组件
138
+ if (this.columnInfo.extraInfo.defaultInfoRuleCols?.length >= 10) {
139
+ this.$message.warning('最多可设置10个组件', 2.5);
140
+ return;
141
+ }
142
+
143
+ // 在光标位置插入组件占位符:$组件名$
144
+ const inputEl = this.$refs.defaultContentString?.input;
145
+ const placeholder = `$${column.name}$`;
146
+ const newValue = this.insertTextAtCursor(inputEl, placeholder);
147
+
148
+ // 更新默认值
149
+ this.columnInfo.defaultInfo = newValue;
150
+
151
+ // 转换为code和id格式
152
+ this.updateDefaultInfoWithCodeAndId();
153
+
154
+ // 检查是否已存在相同组件,避免重复添加
155
+ const isDuplicate = this.columnInfo.extraInfo.defaultInfoRuleCols?.some(
156
+ col => col.id === column.id && col.name === column.name
157
+ );
158
+
159
+ // 添加到已选组件列表
160
+ if (!isDuplicate) {
161
+ this.columnInfo.extraInfo.defaultInfoRuleCols = this.columnInfo.extraInfo.defaultInfoRuleCols || [];
162
+ this.columnInfo.extraInfo.defaultInfoRuleCols.push({
163
+ name: column.name,
164
+ columnCode: column.columnCode,
165
+ behaviorType: column.behaviorType
166
+ });
167
+ }
168
+ },
169
+
170
+ /**
171
+ * 处理默认值输入框内容变化
172
+ * @param {string} val - 当前输入框的值
173
+ */
174
+ handleDefaultValueChange(val) {
175
+ // 如果清空了输入框,则清空所有关联组件信息
176
+ if (!val) {
177
+ this.columnInfo.extraInfo.defaultInfoRuleCols = [];
178
+ this.columnInfo.extraInfo.defaultInfoWithCode = '';
179
+ this.columnInfo.extraInfo.defaultInfoWithId = '';
180
+ return;
181
+ }
182
+
183
+ // 过滤掉已被删除的组件占位符
184
+ // 如果默认值中不再包含某个组件的占位符,则从已选列表中移除
185
+ this.columnInfo.extraInfo.defaultInfoRuleCols =
186
+ this.columnInfo.extraInfo.defaultInfoRuleCols?.filter(col => {
187
+ const placeholder = `$${col.name}$`;
188
+ return val.includes(placeholder);
189
+ }) || [];
190
+
191
+ // 如果还有关联组件,更新code和id格式
192
+ if (this.columnInfo.extraInfo.defaultInfoRuleCols?.length) {
193
+ this.updateDefaultInfoWithCodeAndId();
194
+ } else {
195
+ // 没有关联组件时清空
196
+ this.columnInfo.extraInfo.defaultInfoWithCode = '';
197
+ this.columnInfo.extraInfo.defaultInfoWithId = '';
198
+ }
199
+ },
200
+ },
201
+ }
202
+ </script>
203
+
204
+
205
+ <style scoped lang="scss">
206
+ .defaultSet {
207
+ position: relative;
208
+ width: 100%;
209
+ }
210
+ </style>
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <el-dialog
3
+ v-model="visible"
4
+ title="编辑函数" top="5vh" :close-on-click-modal="false"
5
+ width="900" :destroy-on-close="true" append-to-body
6
+ >
7
+ <BnFunExpr v-if="visible" :id="columnInfo.extraInfo.exprId"
8
+ :column-list="columnList" ref="bnFunExpr" :post-func="postFunc"></BnFunExpr>
9
+ <template #footer>
10
+ <div class="dialog-footer">
11
+ <div>
12
+ <el-link type="primary" href="https://banniu.yuque.com/staff-dmhmqa/zn9sih/mgcoi8ogkyvew7gt?singleDoc# "
13
+ target="_blank">使用手册
14
+ </el-link>
15
+ </div>
16
+ <div>
17
+ <el-button @click="visible = false">取消</el-button>
18
+ <el-button type="primary" :loading="loading" @click="submitForm">确认</el-button>
19
+ </div>
20
+ </div>
21
+ </template>
22
+ </el-dialog>
23
+ </template>
24
+
25
+ <script>
26
+
27
+ export default {
28
+ name: "funcExprDialog",
29
+ props: {
30
+ //最终选中的value
31
+ modelValue: {
32
+ type: Object,
33
+ default() {
34
+ return {}
35
+ }
36
+ },
37
+ componentList: Array,
38
+ tableCode: String,
39
+ postFunc: Function,
40
+ extendPost: Object,
41
+ },
42
+ computed: {
43
+ columnInfo: {
44
+ get() {
45
+ return this.modelValue;
46
+ },
47
+ set(val) {
48
+ this.$emit("update:modelValue", val);
49
+ },
50
+ },
51
+ columnList() {
52
+ let children = [];
53
+ this.componentList.forEach((item) => {
54
+ let data = {"id": item.id, "behaviorType": item.behaviorType, "name": item.name};
55
+ if (item.behaviorType === 13) {
56
+ const moduleDefinition = item.moduleDefinition.map((mod) => {
57
+ return {
58
+ "id": mod.id,
59
+ "behaviorType": mod.behaviorType,
60
+ "name": `${item.name}-${mod.name}`,
61
+ parentId: item.id,
62
+ parentName: item.name
63
+ };
64
+ })
65
+ children.push(...moduleDefinition);
66
+ } else {
67
+ children.push(data);
68
+ }
69
+ });
70
+ return [
71
+ {
72
+ "name": "工作表组件",
73
+ children
74
+ }
75
+ ]
76
+ }
77
+ },
78
+ data() {
79
+ return {
80
+ visible: false,
81
+ loading: false,
82
+ }
83
+ },
84
+ methods: {
85
+ open() {
86
+ this.loading = false;
87
+ this.visible = true;
88
+ },
89
+ submitForm() {
90
+ this.loading = true;
91
+ const params = this.$refs.bnFunExpr.saveRule();
92
+ // 清空操作
93
+ if(!params.exprDisplay){
94
+ this.columnInfo.extraInfo.exprId = '';
95
+ this.columnInfo.extraInfo.exprExec = '';
96
+ this.$emit("saveOver",'')
97
+ this.visible = false;
98
+ return;
99
+ }
100
+ this.postFunc('/expr/create',
101
+ {...params, ...this.extendPost}).then(res => {
102
+ this.loading = false;
103
+ if (!res.code) {
104
+ this.$emit("saveOver",params.exprDisplay)
105
+ this.columnInfo.extraInfo.exprId = res.data.id;
106
+ this.columnInfo.extraInfo.exprExec = res.data.exprExec;
107
+ if(this.columnInfo.id == 6 || this.columnInfo.columnCode == 'task_title'){
108
+ this.columnInfo.extraInfo.isAutoTitle = '1'
109
+ this.columnInfo.extraInfo.autoTitleRule = ''
110
+ }
111
+ this.visible = false;
112
+ }
113
+ })
114
+ },
115
+ }
116
+ }
117
+ </script>
118
+
119
+
120
+ <style scoped lang="scss">
121
+ .dialog-footer {
122
+ display: flex;
123
+ justify-content: space-between;
124
+ position: relative;
125
+ }
126
+ </style>
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <div class="packageFilter" v-loading="!lazyLoad">
3
+ <!-- 顶部操作栏 -->
4
+ <div class="packageFilter-top w-flex-center">
5
+ <div class="packageFilter-top-title">数据过滤</div>
6
+ <div class="w-margin-left8">
7
+ <span class="w-font12 w-color-orange">(选择包裹时,不会展示符合下方条件的ERP单据)</span>
8
+ </div>
9
+ </div>
10
+ <!-- 选项列表 -->
11
+ <div class="packageFilter-list" ref="optionList" v-if="lazyLoad">
12
+ <div class="packageFilter-list-item" v-for="element in filterColumns"
13
+ :class="[componentWidth>400?'two':'one']">
14
+ <div class="w-font14 w-color-black6 w-text-over w-margin-bottom4" :title="element.name">{{ element.name }}</div>
15
+ <div class="w-flex-center">
16
+ <BnSelect v-model="dataFilterByPackage[element.columnCode]" clearable filterable
17
+ :labelInValue="false" @change="changeDataFilter"
18
+ :optionProps="{value:'code',label:'title'}"
19
+ :multiple="true"
20
+ :options="element.moduleDefinition"
21
+ :pathUrl="element.pathUrl"
22
+ :post-data="element.postData"
23
+ :postFunc="postFunc"
24
+ ></BnSelect>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <div v-else class="w-empty">
29
+ 数据加载中...
30
+ </div>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import {cloneDeep, isEmpty} from "lodash";
36
+
37
+ export default {
38
+ name: "packageFilter",
39
+ computed: {
40
+ filterColumns() {
41
+ return this.columnList.filter(item => this.columnData.extraInfo.filterColumn.includes(item.columnCode))
42
+ }
43
+ },
44
+ props: {
45
+ columnData: {
46
+ type: Object,
47
+ default: () => ({}),
48
+ },
49
+ postFunc: Function, // API请求函数
50
+ extendPost: Object, // 额外的请求参数
51
+ columnList: {
52
+ type: Array,
53
+ default: () => []
54
+ },
55
+ disabled: Boolean,
56
+ },
57
+ data() {
58
+ return {
59
+ dataFilterByPackage: {},
60
+ lazyLoad:false,//因为下拉菜单多的时候可能会影响加载速度,这里做个延迟加载
61
+ componentWidth: 0, // 组件宽度
62
+ };
63
+ },
64
+ mounted() {
65
+ this.dataFilterByPackage = this.columnData.extraInfo?.dataFilterByPackage ? JSON.parse(this.columnData.extraInfo?.dataFilterByPackage) : {}
66
+ // 计算组件宽度
67
+ this.calculateWidth();
68
+ if(this.filterColumns.length>4){
69
+ setTimeout(()=>{
70
+ this.lazyLoad = true;
71
+ },200)
72
+ }else{
73
+ this.lazyLoad = true;
74
+ }
75
+ },
76
+ methods: {
77
+ isEmpty,
78
+ /**
79
+ * 计算组件宽度
80
+ */
81
+ calculateWidth() {
82
+ this.$nextTick(() => {
83
+ const el = this.$el;
84
+ if (el) {
85
+ this.componentWidth = el.offsetWidth;
86
+ }
87
+ });
88
+ },
89
+ /**
90
+ * 滚动到列表底部
91
+ */
92
+ changeDataFilter() {
93
+ this.columnData.extraInfo.dataFilterByPackage = JSON.stringify(this.dataFilterByPackage)
94
+ },
95
+ },
96
+ };
97
+ </script>
98
+ <style scoped lang="scss">
99
+ .packageFilter {
100
+ // 顶部操作栏
101
+ &-top {
102
+ height: 32px;
103
+ font-size: 14px;
104
+
105
+ &-title {
106
+ font-weight: 500;
107
+ }
108
+ }
109
+
110
+ // 选项列表
111
+ &-list {
112
+ display: flex;
113
+ flex-wrap: wrap;
114
+ gap: 10px;
115
+ margin-top: 10px;
116
+ max-height: 300px;
117
+ overflow-y: auto;
118
+
119
+ &-item {
120
+ position: relative;
121
+ cursor: pointer;
122
+ background: #ebeef5;
123
+ border-radius: 6px;
124
+ padding: 10px;
125
+
126
+ &.two {
127
+ width: calc(50% - 5px);
128
+ }
129
+
130
+ &.one {
131
+ width: 100%;
132
+ }
133
+
134
+ &:hover {
135
+ background: #E4E7ED;
136
+ box-shadow: 0px 0px 6px rgba(0, 0, 0, .12);;
137
+ }
138
+ }
139
+ }
140
+ }
141
+ </style>
@@ -0,0 +1,156 @@
1
+ <template>
2
+ <div class="paraExplainSet">
3
+ <el-input type="textarea" resize="none" :rows="3"
4
+ v-model="columnData.extraInfo.paraExplain" placeholder="填写说明" clearable
5
+ :disabled="disabled" :maxlength="800" show-word-limit></el-input>
6
+ <div class="w-flex-left w-flex-wrap w-flex-gap8 w-margin-top10">
7
+ <el-upload class="paraExplainSet-upload" ref="uploadInput"
8
+ :action="uploadUrl" :show-file-list="false" :disabled="disabled"
9
+ :before-upload="beforeUpload" multiple :on-success="fileSuccess">
10
+ <div class="paraExplainSet-upload-btn w-flex-center w-flex-lrCenter">
11
+ <span class="bnUIcon bnUIcon-upImg w-font24 w-color-blue"></span>
12
+ </div>
13
+ </el-upload>
14
+ <div v-for="(url,index) in columnData.extraInfo.operationPictures" :key="index" class="paraExplainSet-image-wrapper">
15
+ <el-image preview-teleported style="width: 40px; height: 40px" :src="url"
16
+ :preview-src-list="columnData.extraInfo.operationPictures"
17
+ show-progress
18
+ :initial-index="index"
19
+ fit="cover"
20
+ />
21
+ <div v-if="!disabled" class="paraExplainSet-image-delete" @click="deleteImage(index)">
22
+ <span class="bnUIcon bnUIcon-clear w-color-white"></span>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import { getApiBaseUrl } from "../../../../utils/config.js";
31
+
32
+ export default {
33
+ name: "paraExplainSet",
34
+ props: {
35
+ columnData: {
36
+ type: Object,
37
+ default: () => ({}),
38
+ },
39
+ disabled: Boolean,
40
+ postFunc: Function, // API请求函数
41
+ extendPost: Object, // 额外的请求参数
42
+ },
43
+ data() {
44
+ return {
45
+ fileType:['png', 'jpg', 'jpeg', 'gif']
46
+ };
47
+ },
48
+ mounted() {
49
+ if(!this.columnData.extraInfo.operationPictures){
50
+ this.columnData.extraInfo.operationPictures = []
51
+ }
52
+ },
53
+ computed: {
54
+ uploadUrl() {
55
+ return `${getApiBaseUrl()}/v2/attachment/upload/remarkOperation`
56
+ },
57
+ },
58
+ methods: {
59
+ /**
60
+ * 上传成功
61
+ * */
62
+ fileSuccess(res) {
63
+ if (!res.code) {
64
+ if (this.columnData.extraInfo.operationPictures?.length < 15) {
65
+ this.columnData.extraInfo.operationPictures?.length
66
+ this.columnData.extraInfo.operationPictures.push(res.data.url);
67
+ } else {
68
+ this.$message.warning('上传文件个数不能超过15个')
69
+ }
70
+ } else {
71
+ this.$message.warning(res.msg);
72
+ }
73
+ },
74
+ /**
75
+ * 附件上传前
76
+ * */
77
+ beforeUpload(file) {
78
+ if (this.columnData.extraInfo.operationPictures?.length >= 15) {
79
+ this.$message.warning('上传文件个数不能超过15个')
80
+ return false;
81
+ }
82
+ const maxSize = 50;
83
+ const maxSizeBytes = 1048576 * maxSize;
84
+ if (file.size > maxSizeBytes) {
85
+ this.$message.warning(`上传文件大小不能超出${maxSize}MB`);
86
+ return false;
87
+ }
88
+ const fileExt = file.name.split(".").pop().toLowerCase();
89
+ if (!this.fileType.includes(fileExt)) {
90
+ this.$message.warning('仅支持上传图片');
91
+ return false;
92
+ }
93
+ return true;
94
+ },
95
+ /**
96
+ * 删除图片
97
+ * */
98
+ deleteImage(index) {
99
+ this.columnData.extraInfo.operationPictures.splice(index, 1);
100
+ },
101
+ },
102
+ };
103
+ </script>
104
+ <style scoped lang="scss">
105
+ .paraExplainSet {
106
+ width: 100%;
107
+ &-upload{
108
+ width: 40px;
109
+ height: 40px;
110
+ &-btn{
111
+ width: 40px;
112
+ height: 40px;
113
+ border: 1px solid rgba(0, 0, 0, .12);
114
+ box-shadow: 0px 0px 12px rgba(0, 0, 0, .12);
115
+ }
116
+ }
117
+
118
+ &-image-wrapper {
119
+ position: relative;
120
+ width: 40px;
121
+ height: 40px;
122
+
123
+ &:hover {
124
+ .paraExplainSet-image-delete {
125
+ opacity: 1;
126
+ }
127
+ }
128
+ }
129
+
130
+ &-image-delete {
131
+ position: absolute;
132
+ top: -6px;
133
+ right: -6px;
134
+ width: 18px;
135
+ height: 18px;
136
+ border-radius: 50%;
137
+ background-color: rgba(0, 0, 0, 0.6);
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ cursor: pointer;
142
+ opacity: 0;
143
+ transition: opacity 0.2s;
144
+ z-index: 10;
145
+
146
+ &:hover {
147
+ background-color: rgba(0, 0, 0, 0.8);
148
+ }
149
+
150
+ .el-icon-close {
151
+ color: #fff;
152
+ font-size: 12px;
153
+ }
154
+ }
155
+ }
156
+ </style>