web-component-gallery 2.2.2 → 2.2.4

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 (38) hide show
  1. package/dist/index.umd.js +1 -1
  2. package/dist/js.umd.js +1 -1
  3. package/extensions/BuildTheme.js +18 -2
  4. package/lib/amap-comp/style/AmapSearch.less +0 -3
  5. package/lib/amap-draw/style/index.less +1 -3
  6. package/lib/date-time/style/index.less +1 -3
  7. package/lib/descriptions-list/style/index.less +1 -3
  8. package/lib/directory/style/index.less +1 -3
  9. package/lib/form-comp/style/ACascaderMultiple.less +1 -3
  10. package/lib/form-comp/style/ADayTimePicker.less +1 -2
  11. package/lib/form-comp/style/ARangePicker.less +1 -2
  12. package/lib/form-comp/style/ASelectCustom.less +1 -3
  13. package/lib/form-comp/style/ASliderVerify.less +1 -3
  14. package/lib/form-comp/style/ATagsInput.less +1 -3
  15. package/lib/form-comp/style/index.less +1 -1
  16. package/lib/modal/style/index.less +1 -3
  17. package/lib/no-data/style/index.less +1 -3
  18. package/lib/svg-icon/style/index.less +1 -3
  19. package/lib/table/style/index.less +1 -3
  20. package/lib/tree/style/index.less +1 -3
  21. package/lib/weather/style/index.less +1 -0
  22. package/package.json +1 -2
  23. package/utils/Filter.js +2 -2
  24. package/utils/Storage.js +2 -0
  25. package/utils/Utils.js +89 -3
  26. package/font/DS-DIGI-1.ttf +0 -0
  27. package/font/DS-DIGIB-2.ttf +0 -0
  28. package/font/DS-DIGII-3.ttf +0 -0
  29. package/font/DS-DIGIT-4.ttf +0 -0
  30. package/font/Orbitron-Black.ttf +0 -0
  31. package/font/Orbitron-Bold.ttf +0 -0
  32. package/font/Orbitron-Medium.ttf +0 -0
  33. package/font/Orbitron-Regular.ttf +0 -0
  34. package/font/PANGMENZHENGDAOBIAOTITI-1.TTF +0 -0
  35. package/font/PingFang SC.ttf +0 -0
  36. package/font/YouSheBiaoTiHei.ttf +0 -0
  37. package/font/font.css +0 -48
  38. package/font//345/255/227/351/255/20235/345/217/267-/347/273/217/345/205/270/351/233/205/351/273/221.ttf +0 -0
@@ -3,7 +3,6 @@ const fs = require("fs")
3
3
  const path = require("path")
4
4
  // 指向宿主项目路径 ../../为node_modules路径
5
5
  const hostPath = path.join(__dirname, '../../')
6
- const { generateTheme } = require('antd-theme-generator')
7
6
  const { cssFileName, parseCSSVariables, parseLessVariables, parseExtendVariables, fetchAndParseLessFile } = require('./UpdateTheme')
8
7
 
9
8
  // 提取颜色变量
@@ -210,7 +209,24 @@ function createGeneratorTheme(theme) {
210
209
  })
211
210
  }
212
211
 
212
+ // 生成传输信息文件
213
+ async function createTransferFile() {
214
+ // 默认请求源地址
215
+ const origin = process.env.VUE_APP_STATIC_URL || 'http://qxfnkj.com'
216
+
217
+ const fileName = 'transferData.js'
218
+
219
+ const response = await fetch(`${origin}/base-subject/iframe/${fileName}`)
220
+ if (!response.ok) throw new Error(`${fileName}文件请求失败!`)
221
+
222
+ const responseText = await response.text()
223
+
224
+ // 写入传输文件
225
+ const outPut = path.join(hostPath, `../src/utils/${fileName}`)
226
+ fs.writeFileSync(outPut, responseText)
227
+ }
228
+
213
229
  module.exports = {
214
230
  customFunctions,
215
- createGeneratorTheme
231
+ createTransferFile
216
232
  }
@@ -1,6 +1,3 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
4
1
  .AmapDraw__Search {
5
2
  display: flex;
6
3
  align-items: center;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
- // 按需引入对应模块样式
1
+ // 按需引入对应模块样式
4
2
  @import '../../amap-comp/style/AmapSearch.less';
5
3
 
6
4
  .AmapDraw {
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .dateTime {
5
3
  font-size: @font-size-lg;
6
4
  .flex-layout(@flexGap: 0 @padding-xs);
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .Descriptions {
5
3
  .ant-descriptions-bordered {
6
4
  .ant-descriptions-item-label {
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
- // 按需引入对应模块样式
1
+ // 按需引入对应模块样式
4
2
  @import '../../svg-icon/style/index.less';
5
3
 
6
4
  .DirectoryTreeMenu {
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .gb-ant-select-multiple-cascader {
5
3
  .ant-select-dropdown-menu-item {
6
4
  display: none;
@@ -1,5 +1,4 @@
1
- @import '../../style/mixins.less';
2
-
1
+
3
2
  .ADayTimePicker {
4
3
  width: 100%;
5
4
  align-items: center;
@@ -1,5 +1,4 @@
1
- @import '../../style/mixins.less';
2
-
1
+
3
2
  .ADatePicker {
4
3
  width: 100%;
5
4
  align-items: center;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  // 添加flex属性解决css中div莫名高度
5
3
  .ASelectCustom {
6
4
  width: 100%;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .slider-wrapper {
5
3
  position: relative;
6
4
  overflow: hidden;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .TAntdTags {
5
3
  cursor: pointer;
6
4
  .layout(100%, auto);
@@ -5,4 +5,4 @@
5
5
  @import './ATagsInput.less';
6
6
  @import './ADayTimePicker.less';
7
7
  @import './AUpload.less';
8
- @import './ADragVerify.less';
8
+ @import './ASliderVerify.less';
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .AntModal {
5
3
  &__small {
6
4
  .ant-modal {
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .no-data-container {
5
3
  padding: @padding-lg;
6
4
  box-sizing: border-box;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .svg-icon {
5
3
  vertical-align: -0.15em;
6
4
  fill: currentColor;
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .WebComponentTable {
5
3
  .layout();
6
4
  .flex-layout(column, @padding-md 0);
@@ -1,6 +1,4 @@
1
- @import '~ant-design-vue/lib/style/themes/default.less';
2
- @import '../../style/mixins.less';
3
-
1
+
4
2
  .publicTreeCheck {
5
3
  display: flex;
6
4
  .square( 100% );
@@ -1,3 +1,4 @@
1
+ // 天气控件可能因接口导致需加载样式
1
2
  @import '~ant-design-vue/lib/style/themes/default.less';
2
3
  @import '../../style/mixins.less';
3
4
 
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "description": "基础vue、antdvue、less实现的私有组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [
7
7
  "dist",
8
8
  "extensions",
9
- "font",
10
9
  "lib",
11
10
  "utils"
12
11
  ],
package/utils/Filter.js CHANGED
@@ -230,7 +230,7 @@ export function findNthOccurrence(str, charToFind, n) {
230
230
  }
231
231
 
232
232
  return index === -1 ? -1 : index;
233
- }
233
+ }
234
234
 
235
235
  /**
236
236
  * object转化为formData
@@ -246,4 +246,4 @@ export function setFormData(object) {
246
246
 
247
247
  return formData
248
248
 
249
- }
249
+ }
package/utils/Storage.js CHANGED
@@ -67,6 +67,8 @@ const cookies = {
67
67
  }
68
68
  }
69
69
 
70
+ export const storageObj = process.env.NODE_ENV === 'development' ? cookies : local
71
+
70
72
  export default {
71
73
  local,
72
74
  cookies
package/utils/Utils.js CHANGED
@@ -81,7 +81,7 @@ export function handleEnvURL(url, processType = 'url') {
81
81
 
82
82
  // 环境变量解构
83
83
  const { origin } = window.location
84
- const { VUE_APP_ROUTE_PORT, VUE_APP_API_BASE_URL } = process.env
84
+ const { VUE_APP_ROUTE_PORT, VUE_APP_API_URL } = process.env
85
85
 
86
86
  // URL处理策略
87
87
  const urlStrategies = {
@@ -95,7 +95,7 @@ export function handleEnvURL(url, processType = 'url') {
95
95
  image: {
96
96
  dev: () =>
97
97
  imagePattern.test(url)
98
- ? constructUrl(VUE_APP_API_BASE_URL, url)
98
+ ? constructUrl(VUE_APP_API_URL, url)
99
99
  : url,
100
100
  prod: () =>
101
101
  imagePattern.test(url)
@@ -103,7 +103,7 @@ export function handleEnvURL(url, processType = 'url') {
103
103
  : url
104
104
  },
105
105
  file: {
106
- dev: () => constructUrl(VUE_APP_API_BASE_URL, url),
106
+ dev: () => constructUrl(VUE_APP_API_URL, url),
107
107
  prod: () => constructUrl(origin, url)
108
108
  }
109
109
  }
@@ -116,4 +116,90 @@ export function handleEnvURL(url, processType = 'url') {
116
116
  const strategy = urlStrategies[processType]
117
117
 
118
118
  return isDev ? strategy.dev() : strategy.prod()
119
+ }
120
+
121
+ /**
122
+ * 根据属性路径更新数组对象中的数据,支持条件匹配
123
+ * @param {Array} arr - 目标数组
124
+ * @param {string} key - 点分隔的属性路径(如"model: input.a.b")
125
+ * @param {*} data - 要设置的数据
126
+ * @returns {Array} 更新后的数组
127
+ */
128
+ export function setOptionsData(arr, key, data) {
129
+ if (!key || !Array.isArray(arr)) return arr
130
+
131
+ // 解析条件匹配格式
132
+ const hasCondition = key.includes(':')
133
+ let conditionModel = null
134
+ let conditionValue = null
135
+ let actualPath = key
136
+
137
+ if (hasCondition) {
138
+ const [prefix, path] = key.split(':').map(s => s.trim())
139
+ conditionModel = prefix
140
+ conditionValue = path.split('.')[0]
141
+ actualPath = path.replace(`${conditionValue}.`, '')
142
+ }
143
+
144
+ // 分割属性路径
145
+ const pathParts = actualPath.split('.')
146
+
147
+ // 更新数组中的每个对象
148
+ return arr.map(item => {
149
+ // 检查条件匹配
150
+ if (hasCondition && conditionModel) {
151
+ if (item[conditionModel] !== conditionValue) {
152
+ return item
153
+ }
154
+ }
155
+
156
+ // 获取当前对象
157
+ let current = item
158
+
159
+ // 遍历路径(除最后一部分)
160
+ for (let i = 0; i < pathParts.length - 1; i++) {
161
+ if (!current[pathParts[i]]) current[pathParts[i]] = {}
162
+ current = current[pathParts[i]]
163
+ }
164
+
165
+ // 设置最终属性值
166
+ const lastPart = pathParts[pathParts.length - 1]
167
+ // 是对象则进行属性合并
168
+ const isObj = data instanceof Object && !Array.isArray(data)
169
+
170
+ pathParts.length > 1 ?
171
+ current[lastPart] = isObj ? { ...current[lastPart], ...data } : data :
172
+ current[pathParts[0]] = isObj ? { ...current[pathParts[0]], ...data } : data
173
+
174
+ return item
175
+ })
176
+ }
177
+
178
+ /**
179
+ * 异步获取搜索数据并更新配置
180
+ * @param {Object} searchSetting - 需要更新的搜索配置对象
181
+ * @returns {Promise<Object>} 返回包含所有API调用结果的对象
182
+ */
183
+ export const fetchSearchData = async (searchSetting, apiMap) => {
184
+ try {
185
+ // 并行调用所有API
186
+ const results = await Promise.allSettled(Object.values(apiMap))
187
+
188
+ let innerSetting = []
189
+
190
+ Object.keys(apiMap).forEach((key, index) => {
191
+ const result = results[index]
192
+ if (result.status === 'fulfilled' && result.value) {
193
+ innerSetting = setOptionsData(searchSetting, key, result.value)
194
+ } else {
195
+ console.error(`API调用失败: ${key}`, result.reason)
196
+ }
197
+ })
198
+
199
+ // 返回更新后的配置数据
200
+ return innerSetting
201
+ } catch (error) {
202
+ console.error('apiMap配置格式不对导致API并发失败', error)
203
+ throw error
204
+ }
119
205
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/font/font.css DELETED
@@ -1,48 +0,0 @@
1
- @font-face {
2
- font-family: 'PingFang SC';
3
- src: url('PingFang SC.ttf');
4
- }
5
- @font-face {
6
- font-family: 'YouSheBiaoTiHei';
7
- src: url('YouSheBiaoTiHei.ttf');
8
- }
9
- @font-face {
10
- font-family: 'Orbitron-Black';
11
- src: url('Orbitron-Black.ttf');
12
- }
13
- @font-face {
14
- font-family: 'Orbitron-Bold';
15
- src: url('Orbitron-Bold.ttf');
16
- }
17
- @font-face {
18
- font-family: 'Orbitron-Medium';
19
- src: url('Orbitron-Medium.ttf');
20
- }
21
- @font-face {
22
- font-family: 'Orbitron-Regular';
23
- src: url('Orbitron-Regular.ttf');
24
- }
25
- @font-face {
26
- font-family: 'PangMenZhengDao';
27
- src: url('PANGMENZHENGDAOBIAOTITI-1.TTF');
28
- }
29
- @font-face {
30
- font-family: '字魂35号-经典雅黑';
31
- src: url('字魂35号-经典雅黑.ttf');
32
- }
33
- @font-face {
34
- font-family: 'Digital Numbers';
35
- src: url('DS-DIGI-1.ttf');
36
- }
37
- @font-face {
38
- font-family: 'DS-DIGIB-2';
39
- src: url('DS-DIGIB-2.ttf');
40
- }
41
- @font-face {
42
- font-family: 'DS-DIGII-3';
43
- src: url('DS-DIGII-3.ttf');
44
- }
45
- @font-face {
46
- font-family: 'DS-DIGIT-4';
47
- src: url('DS-DIGIT-4.ttf');
48
- }