@bytenew/bn-bus-ui 1.1.462 → 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-CmzOXI5w.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-jkTJEMKT.js +0 -391
  130. package/dist/chooseIPaasData.css +0 -1
  131. package/dist/defaultSet-CiYuSOzT.js +0 -297
  132. package/dist/defaultSet.css +0 -1
  133. package/dist/fileFormData-D_Q1vylE.js +0 -53
  134. package/dist/formItemFooter-BpnVUUgV.js +0 -108
  135. package/dist/formItemFooter.css +0 -1
  136. package/dist/funcExprDialog-BMc-n5FL.js +0 -139
  137. package/dist/funcExprDialog.css +0 -1
  138. package/dist/index-8GQJARcF.js +0 -44
  139. package/dist/index-8apT0r8m.js +0 -66
  140. package/dist/index-BOFu3qAH.js +0 -183
  141. package/dist/index-BSKXuSid.js +0 -89
  142. package/dist/index-BhYvDd_Q.js +0 -45
  143. package/dist/index-BhqkeVFc.js +0 -45
  144. package/dist/index-CK7_Ou7F.js +0 -89
  145. package/dist/index-Cfb8D3Fg.js +0 -58
  146. package/dist/index-D1fGD0mX.js +0 -51
  147. package/dist/index-DE_eQGbT.js +0 -746
  148. package/dist/index-DfgiBqzS.js +0 -221
  149. package/dist/index-Dobi0ms9.js +0 -66
  150. package/dist/index-DuyQNxe0.js +0 -118
  151. package/dist/index-DxpJkrN7.js +0 -64
  152. package/dist/index-FGHeG46m.js +0 -109
  153. package/dist/index-P2M7CUTe.js +0 -178
  154. package/dist/index-xCz2zysE.js +0 -135
  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--7IU60oV.js +0 -23103
  163. package/dist/install.css +0 -1
  164. package/dist/setOption-DehYZpZr.js +0 -329
  165. package/dist/setOption.css +0 -1
  166. package/dist/setRelationOption-BL-AFUoF.js +0 -5217
  167. package/dist/setRelationOption.css +0 -1
package/install.js ADDED
@@ -0,0 +1,134 @@
1
+ // install.js
2
+ import BnAddress from "./packages/BnAddress/index.vue";
3
+ import BnMenus from "./packages/BnMenus/BnMenus.vue";
4
+ import BnSelect from "./packages/BnSelect/BnSelect.vue";
5
+ import BnVirtPopover from "./packages/BnVirtPopover/index.vue";
6
+ import BnAdvancedFilter from "./packages/BnAdvancedFilter/index.vue";
7
+ import BnFilterView from "./packages/BnAdvancedFilter/BnFilterView.vue";
8
+ import BnDatePicker from "./packages/BnDatePicker/BnDatePicker.vue";
9
+ import BnCheck from "./packages/BnCheck/BnCheck.vue";
10
+ import BnOrderCard from "./packages/BnOrderCard/BnOrderCard.vue";
11
+ import BnDrop from "./packages/BnDrop/BnDrop.vue";
12
+ import BnFileView from "./packages/BnFileView/BnFileView.vue";
13
+ import BnInpNum from "./packages/BnInpNum/BnInpNum.vue";
14
+ import BnRadio from "./packages/BnRadio/BnRadio.vue";
15
+ import BnRelation from "./packages/BnRelation/BnRelation.vue";
16
+ import BnCondition from "./packages/BnCondition/index.vue";
17
+ import BnSmartForm from "./packages/BnSmartForm/index.vue";
18
+ import BnBatchForm from "./packages/BnSmartForm/BnBatchForm.vue";
19
+ import BnBatchFormDialog from "./packages/BnSmartForm/BnBatchFormDialog.vue";
20
+ import BnFunExpr from "./packages/BnFunExpr/BnFunExpr.vue";
21
+ import BnColumnConfig from "./packages/BnColumnConfig/index.vue";
22
+ import BnColumnConfigDialog from "./packages/BnColumnConfig/columnConfigDialog.vue";
23
+ import BnFilterOption from "./packages/BnFilterOption/BnFilterOption.vue";
24
+ import BnImportOrder from "./packages/BnImportOrder/BnImportOrder.vue";
25
+ import BnImportTemplate from "./packages/BnImportTemplate/BnImportTemplate.vue";
26
+ import BnExportOrder from "./packages/BnExportOrder/BnExportOrder.vue";
27
+ import BnOrderShare from "./packages/BnOrderShare/index.vue";
28
+ import BnOrderDetail from "./packages/BnOrderDetail/BnOrderDetail.vue";
29
+ import BnEmptyTip from "./packages/BnEmptyTip/BnEmptyTip.vue";
30
+ import BnCascader from "./packages/BnCascader/BnCascader.vue";
31
+ import BnCascaderPanel from "./packages/BnCascader/BnCascaderPanel.vue";
32
+ import BnWebLog from "./packages/BnWebLog/BnWebLog.vue";
33
+ import BnWorkSettingDrop from "./packages/BnWorkSettingDrop/index.vue";
34
+ // 使用异步导入以避免和其他组件中的动态导入冲突
35
+ import { defineAsyncComponent } from 'vue';
36
+ const BnStringForm = defineAsyncComponent(() => import("./packages/BnSmartForm/stringForm/index.vue"));
37
+ const BnNumberForm = defineAsyncComponent(() => import("./packages/BnSmartForm/numberForm/index.vue"));
38
+ const BnSelectForm = defineAsyncComponent(() => import("./packages/BnSmartForm/selectForm/index.vue"));
39
+ const BnRadioForm = defineAsyncComponent(() => import("./packages/BnSmartForm/radioForm/index.vue"));
40
+ const BnCheckboxForm = defineAsyncComponent(() => import("./packages/BnSmartForm/checkboxForm/index.vue"));
41
+ const BnDateForm = defineAsyncComponent(() => import("./packages/BnSmartForm/dateForm/index.vue"));
42
+ const BnDateDualForm = defineAsyncComponent(() => import("./packages/BnSmartForm/dateDualForm/index.vue"));
43
+ const BnFileForm = defineAsyncComponent(() => import("./packages/BnSmartForm/fileForm/index.vue"));
44
+ const BnChildrenForm = defineAsyncComponent(() => import("./packages/BnSmartForm/childrenForm/index.vue"));
45
+ const BnChooseIPaasData = defineAsyncComponent(() => import("./packages/BnSmartForm/chooseIPaasData/chooseIPaasData.vue"));
46
+ const BnAddressForm = defineAsyncComponent(() => import("./packages/BnSmartForm/addressForm/index.vue"));
47
+ const BnReceiveForm = defineAsyncComponent(() => import("./packages/BnSmartForm/receiveForm/index.vue"));
48
+ const BnRelationForm = defineAsyncComponent(() => import("./packages/BnSmartForm/relationForm/index.vue"));
49
+
50
+ const BnBusUi = {
51
+ install: (app) => {
52
+ app.component("BnAddress", BnAddress)
53
+ app.component("BnMenus", BnMenus)
54
+ app.component("BnSelect", BnSelect)
55
+ app.component("BnVirtPopover", BnVirtPopover)
56
+ app.component("BnAdvancedFilter", BnAdvancedFilter)
57
+ app.component("BnFilterView", BnFilterView)
58
+ app.component("BnDatePicker", BnDatePicker)
59
+ app.component("BnCheck", BnCheck)
60
+ app.component("BnOrderCard", BnOrderCard)
61
+ app.component("BnDrop", BnDrop)
62
+ app.component("BnFileView", BnFileView)
63
+ app.component("BnInpNum", BnInpNum)
64
+ app.component("BnRadio", BnRadio)
65
+ app.component("BnRelation", BnRelation)
66
+ app.component("BnCondition", BnCondition)
67
+ app.component("BnSmartForm", BnSmartForm)
68
+ app.component("BnBatchForm", BnBatchForm)
69
+ app.component("BnBatchFormDialog", BnBatchFormDialog)
70
+ app.component("BnStringForm", BnStringForm)
71
+ app.component("BnNumberForm", BnNumberForm)
72
+ app.component("BnSelectForm", BnSelectForm)
73
+ app.component("BnRadioForm", BnRadioForm)
74
+ app.component("BnCheckboxForm", BnCheckboxForm)
75
+ app.component("BnDateForm", BnDateForm)
76
+ app.component("BnDateDualForm", BnDateDualForm)
77
+ app.component("BnFileForm", BnFileForm)
78
+ app.component("BnChildrenForm", BnChildrenForm)
79
+ app.component("BnChooseIPaasData", BnChooseIPaasData)
80
+ app.component("BnAddressForm", BnAddressForm)
81
+ app.component("BnReceiveForm", BnReceiveForm)
82
+ app.component("BnRelationForm", BnRelationForm)
83
+ app.component("BnFunExpr", BnFunExpr)
84
+ app.component("BnColumnConfig", BnColumnConfig)
85
+ app.component("BnColumnConfigDialog", BnColumnConfigDialog)
86
+ app.component("BnFilterOption", BnFilterOption)
87
+ app.component("BnImportOrder", BnImportOrder)
88
+ app.component("BnImportTemplate", BnImportTemplate)
89
+ app.component("BnExportOrder", BnExportOrder)
90
+ app.component("BnOrderShare", BnOrderShare)
91
+ app.component("BnOrderDetail", BnOrderDetail)
92
+ app.component("BnEmptyTip", BnEmptyTip)
93
+ app.component("BnWebLog", BnWebLog)
94
+ app.component("BnCascader", BnCascader)
95
+ app.component("BnCascaderPanel", BnCascaderPanel)
96
+ app.component("BnWorkSettingDrop", BnWorkSettingDrop)
97
+ }
98
+ }
99
+
100
+ // 支持通过 CDN 方式引入时自动注册
101
+ if (typeof window !== 'undefined' && window.Vue) {
102
+ window.Vue.use(BnBusUi);
103
+ }
104
+
105
+ // 导出插件对象
106
+ export default BnBusUi;
107
+
108
+ // 单独导出组件,支持按需引入
109
+ export { BnCondition, BnAddress, BnMenus, BnSelect, BnVirtPopover, BnAdvancedFilter, BnFilterView, BnFunExpr,
110
+ BnDatePicker, BnCheck, BnOrderCard, BnDrop, BnFileView, BnInpNum, BnRadio, BnRelation, BnSmartForm, BnBatchForm, BnBatchFormDialog,
111
+ BnStringForm, BnNumberForm, BnSelectForm, BnRadioForm, BnCheckboxForm, BnDateForm, BnDateDualForm,
112
+ BnFileForm, BnChildrenForm,BnChooseIPaasData, BnAddressForm, BnReceiveForm, BnRelationForm, BnColumnConfig,
113
+ BnColumnConfigDialog, BnFilterOption,BnWebLog,BnImportOrder,BnImportTemplate,BnExportOrder,BnOrderShare,BnOrderDetail,BnEmptyTip,BnCascader,BnCascaderPanel,BnWorkSettingDrop};
114
+ export {
115
+ idsToTexts,
116
+ insertText,
117
+ tidyRuleComponents,
118
+ searchValueToJson,
119
+ getSearchComponents,
120
+ getWatchComponents,
121
+ tidyComponents,
122
+ tidyShowSubDataFile,
123
+ tidyJumpSearchData,
124
+ recordApiLog,
125
+ mainAppRouterPush,
126
+ addressParse,
127
+ } from "./utils/index.js";
128
+
129
+ // 导出全局配置方法
130
+ export {
131
+ setGlobalConfig,
132
+ getGlobalConfig,
133
+ getApiBaseUrl
134
+ } from "./utils/config.js";
package/package.json CHANGED
@@ -1,12 +1,26 @@
1
1
  {
2
2
  "name": "@bytenew/bn-bus-ui",
3
- "version": "1.1.462",
3
+ "version": "1.1.463",
4
4
  "description": "班牛业务组件库,集合版",
5
5
  "private": false,
6
- "main": "dist/bn-bus-ui.umd.js",
6
+ "main": "install.js",
7
+ "module": "install.js",
7
8
  "type": "module",
9
+ "sideEffects": [
10
+ "*.scss",
11
+ "*.css",
12
+ "**/*.vue"
13
+ ],
14
+ "exports": {
15
+ ".": "./install.js",
16
+ "./common.scss": "./common.scss",
17
+ "./packages/*": "./packages/*",
18
+ "./utils/*": "./utils/*"
19
+ },
8
20
  "files": [
9
- "dist",
21
+ "install.js",
22
+ "packages",
23
+ "utils",
10
24
  "common.scss"
11
25
  ],
12
26
  "publishConfig": {
@@ -18,7 +32,9 @@
18
32
  "bus_dev": "vite",
19
33
  "bus_build": "vite build",
20
34
  "preview": "vite preview",
21
- "pub": "npm run bus_build && npm publish --access public"
35
+ "sync-utils": "node scripts/sync-utils.js",
36
+ "prepublishOnly": "npm run sync-utils",
37
+ "pub": "npm publish --access public"
22
38
  },
23
39
 
24
40
  "peerDependencies": {
@@ -0,0 +1,141 @@
1
+ <!--地址选择器-->
2
+ <template>
3
+ <div class="bnAddress" :class="wrapShow?'w-flex-wrap':''">
4
+ <div :class="wrapShow?'bnAddress-item':''" v-for="(item,index) in levelNum">
5
+ <el-select v-model="value[index]" :placeholder="headerTitle[item]" filterable
6
+ @change="changeValue(index)" @visible-change="openSelect($event,index)"
7
+ :value-key="valueKey" :disabled="disabled" clearable>
8
+ <el-option v-show="false" v-for="(item,index) in value" :key="index" :label="item.title"
9
+ :value="item"></el-option>
10
+ <el-option v-for="item in optionList" :key="item[valueKey]" :label="item.title" :value="item"></el-option>
11
+ <div class="w-empty" v-show="loading">加载中...</div>
12
+ <div class="w-empty" v-show="!loading && optionList.length == 0">无数据</div>
13
+ </el-select>
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ export default {
20
+ name: "BnAddress",
21
+ props: {
22
+ modelValue: Array,
23
+ disabled: {
24
+ type: Boolean,
25
+ default: false
26
+ },
27
+ valueKey: {
28
+ type: String,
29
+ default: 'id'
30
+ },
31
+ levelNum: {
32
+ type: Number,
33
+ default: 4
34
+ },
35
+ // 支持外部查询的方法,使用者传进来
36
+ postFunc: Function,
37
+ // 搜索的请求参数
38
+ postData: {
39
+ type: Object,
40
+ default() {
41
+ return {}
42
+ }
43
+ },
44
+ // 通过外部传入的链接进行参数请求
45
+ pathUrl: {
46
+ type: String,
47
+ default: ''
48
+ },
49
+ // 整行展示
50
+ wrapShow: Boolean
51
+ },
52
+ computed: {
53
+ value: {
54
+ get() {
55
+ return this.modelValue;
56
+ },
57
+ set(val) {
58
+ this.$emit("update:modelValue", val);
59
+ }
60
+ }
61
+ },
62
+ data() {
63
+ return {
64
+ loading: false,//动态加载loading
65
+ optionList: [],
66
+ defaultValueMap: [],
67
+ areaList: ['province', 'city', 'area', 'street'],
68
+ headerTitle: {
69
+ 1: '选择省',
70
+ 2: '选择市',
71
+ 3: '选择区',
72
+ 4: '选择街道'
73
+ },
74
+ }
75
+ },
76
+ methods: {
77
+ // 打开下拉
78
+ openSelect(v, index) {
79
+ if (v) {
80
+ this.loading = true;
81
+ this.optionList = [];
82
+ if (index == 0 || (this.value[index - 1] && this.value[index - 1][this.valueKey])) {
83
+ this.getAddressList(index)
84
+ }
85
+ }
86
+ },
87
+ // 查询地址
88
+ getAddressList(index) {
89
+ if (!this.postFunc) {
90
+ console.log("地址组件:没有传入远程调用的方法postFunc")
91
+ this.loading = false;
92
+ return false;
93
+ }
94
+ this.loading = true;
95
+ let post = undefined
96
+ if (index !== 0) {
97
+ post = {
98
+ id: this.modelValue[index - 1][this.valueKey],
99
+ key: this.areaList[index - 1]
100
+ }
101
+ }
102
+ this.postFunc(this.pathUrl, post).then(res => {
103
+ this.loading = false;
104
+ if (!res.code) {
105
+ this.optionList = res.data.map(item => {
106
+ return {id: item.id, [this.valueKey]: item.id, title: item.name || item.title, type: item.type}
107
+ });
108
+ }
109
+ })
110
+ },
111
+ // 数据变化
112
+ changeValue(index) {
113
+ if (this.value[index]) {
114
+ if (this.value[index + 1]) {
115
+ this.value.splice(index + 1, this.value.length - index)
116
+ }
117
+ } else {
118
+ this.value.splice(index, this.value.length + 1 - index)
119
+ }
120
+ this.$emit("change")
121
+ },
122
+ },
123
+ };
124
+ </script>
125
+
126
+ <style scoped lang="scss">
127
+ .bnAddress {
128
+ position: relative;
129
+ width: 100%;
130
+ display: flex;
131
+ gap: 8px;
132
+
133
+ >div {
134
+ flex-grow: 1;
135
+ }
136
+ &-item {
137
+ min-width: 100%;
138
+ }
139
+
140
+ }
141
+ </style>
@@ -0,0 +1,75 @@
1
+ <!--地址组件-->
2
+ <template>
3
+ <div class="w-default-wrap">
4
+ <div class="w-margin-bottom10 w-flex-center">
5
+ <el-popover placement="top-start" :width="400" trigger="hover" :show-arrow="false">
6
+ <div class="w-font13 w-margin-bottom5">
7
+ <div>地址自动识别用于辅助回填繁琐的地址信息,但任何自动化识别都会存在一定错误率。
8
+ 为了你的愉快使用,请尽量使用格式规范的完整地址信息进行识别,比如包含完整的
9
+ <span class="w-color-orange">省市区级别标识</span> ,
10
+ <span class="w-color-orange">姓名和手机号尽量放在地址前面</span>
11
+ ,不要穿插其中。
12
+ </div>
13
+ <div><span class="w-color-red">文案不规范、信息有缺都有可能造成识别率下降,拆分地址出错。</span>
14
+ <span>遇见这种情况请您手动调整文案并重试</span></div>
15
+ </div>
16
+ <template #reference>
17
+ <span class="bnUIcon bnUIcon-searchAuto w-color-orange w-font22 w-margin-right10"></span>
18
+ </template>
19
+ </el-popover>
20
+ <el-input v-model="address" placeholder="输入地址后自动识别" clearable @change="autoAds"
21
+ @blur="autoAds"></el-input>
22
+ </div>
23
+ </div>
24
+ </template>
25
+ <script>
26
+ import {debounce} from "lodash";
27
+
28
+ export default {
29
+ name: "BnAddressParse",
30
+ props: {
31
+ postFunc: Function
32
+ },
33
+ data() {
34
+ return {
35
+ address: "",
36
+ record: ""
37
+ }
38
+ },
39
+ methods: {
40
+ /**
41
+ * 自动识别方法(使用防抖)
42
+ */
43
+ autoAds: debounce(function () {
44
+ if (!this.address || this.address == this.record) {
45
+ return;
46
+ }
47
+ this.postFunc('/address/parse', {address: this.address}).then(res => {
48
+ if (!res.code && res.data) {
49
+ let addressVal = [];
50
+ let list = ['province', 'city', 'area', 'street'];
51
+ list.forEach((item, index) => {
52
+ if (res.data[item]) {
53
+ addressVal.push({
54
+ id: res.data[`${item}Id`],
55
+ code: res.data[`${item}Id`],
56
+ title: res.data[item],
57
+ parentId: !index ? 1 : addressVal[index - 1].id,
58
+ type: index + 2//这个是后端定义的字段,不知道为啥是从2开始的
59
+ })
60
+ }
61
+ })
62
+ let adsData = {
63
+ name: res.data.name || '',
64
+ phone: res.data.phone || '',
65
+ detail: res.data.detail || '',
66
+ address: addressVal
67
+ }
68
+ this.record = this.address;
69
+ this.$emit('parse', adsData)
70
+ }
71
+ })
72
+ }, 60)
73
+ }
74
+ }
75
+ </script>
@@ -0,0 +1,145 @@
1
+ <!--收起筛选条件预览-->
2
+ <script>
3
+ import { searchTypeMap } from './util.js'
4
+
5
+ export default {
6
+ name: "BnFilterView",
7
+ props: {
8
+ conditions: {
9
+ type: Array,
10
+ default: () => []
11
+ },
12
+ // 禁止点击删除按钮的组件code
13
+ notDelCodes:{
14
+ type: Array,
15
+ default: () => []
16
+ },
17
+ },
18
+
19
+ methods: {
20
+ // 删除筛选条件
21
+ handleClose(index) {
22
+ this.conditions.splice(index, 1);
23
+ this.$emit("change")
24
+ },
25
+
26
+ // 重置:清空所有筛选条件的value
27
+ resetConditions() {
28
+ this.conditions.forEach(item => {
29
+ if (Array.isArray(item.value)) {
30
+ item.value = []
31
+ } else if (item.value && typeof item.value === 'object') {
32
+ Object.keys(item.value).forEach(key => { item.value[key] = '' })
33
+ } else {
34
+ item.value = ''
35
+ }
36
+ })
37
+ this.$emit('reset', this.conditions)
38
+ },
39
+
40
+ // 获取条件操作符文案
41
+ getSearchTypeLabel(item) {
42
+ return searchTypeMap[item.searchType] || ''
43
+ },
44
+
45
+ // 格式化筛选条件的值用于展示
46
+ formatValue(item) {
47
+ if (Array.isArray(item.value)) {
48
+ return item.value.map(v => v.title || v.name || v).join('、')
49
+ } else if (item.value && typeof item.value === 'object') {
50
+ return `${item.value.start || ''} ~ ${item.value.end || ''}`
51
+ }
52
+ return item.value || ''
53
+ },
54
+
55
+ // 格式化完整展示文案:字段名+操作符+值
56
+ formatDisplay(item) {
57
+ const label = this.getSearchTypeLabel(item)
58
+ const value = this.formatValue(item)
59
+ if (label && value) return `${item.name}: ${label}-${value}`
60
+ if (label) return `${item.name}: ${label}`
61
+ if (value) return `${item.name}: ${value}`
62
+ return item.name
63
+ }
64
+ }
65
+ }
66
+ </script>
67
+
68
+ <template>
69
+ <div class="search-view">
70
+ <span class="search-view-label">筛选条件:</span>
71
+ <div class="search-view-tags">
72
+ <template v-for="(item, index) in conditions" :key="index">
73
+ <div class="search-tag">
74
+ <span class="search-tag-text">{{ formatDisplay(item) }}</span>
75
+ <span v-if="!notDelCodes.includes(item.columnCode)" class="search-tag-close" @click="handleClose(index)">×</span>
76
+ </div>
77
+ </template>
78
+ </div>
79
+ <span class="search-view-link" @click="resetConditions">重置</span>
80
+ <span class="search-view-link search-view-open" @click="$emit('openSearch')">展开</span>
81
+ </div>
82
+ </template>
83
+
84
+ <style scoped lang="scss">
85
+ .search-view {
86
+ display: flex;
87
+ align-items: flex-start;
88
+ width: 100%;
89
+ min-height: 32px;
90
+ &-label {
91
+ font-size: 14px;
92
+ color: #333;
93
+ white-space: nowrap;
94
+ margin-right: 8px;
95
+ flex-shrink: 0;
96
+ line-height: 24px;
97
+ }
98
+ &-tags {
99
+ display: flex;
100
+ flex-wrap: wrap;
101
+ align-items: center;
102
+ gap: 8px;
103
+ flex: 1;
104
+ }
105
+ &-link {
106
+ font-size: 14px;
107
+ color: #409eff;
108
+ cursor: pointer;
109
+ white-space: nowrap;
110
+ margin-left: 12px;
111
+ flex-shrink: 0;
112
+ align-self: flex-end;
113
+ &:hover {
114
+ opacity: 0.8;
115
+ }
116
+ }
117
+ &-open {
118
+ margin-left: 12px;
119
+ }
120
+ .search-tag {
121
+ display: inline-flex;
122
+ align-items: center;
123
+ height: 24px;
124
+ padding: 0 8px;
125
+ background: #f4f4f5;
126
+ border: 1px solid #e9e9eb;
127
+ border-radius: 4px;
128
+ font-size: 12px;
129
+ color: #606266;
130
+ line-height: 1;
131
+ &-text {
132
+ white-space: nowrap;
133
+ }
134
+ &-close {
135
+ margin-left: 6px;
136
+ cursor: pointer;
137
+ font-size: 14px;
138
+ color: #909399;
139
+ &:hover {
140
+ color: #333;
141
+ }
142
+ }
143
+ }
144
+ }
145
+ </style>