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.
- package/dist/index.umd.js +1 -1
- package/dist/js.umd.js +1 -1
- package/extensions/BuildTheme.js +18 -2
- package/lib/amap-comp/style/AmapSearch.less +0 -3
- package/lib/amap-draw/style/index.less +1 -3
- package/lib/date-time/style/index.less +1 -3
- package/lib/descriptions-list/style/index.less +1 -3
- package/lib/directory/style/index.less +1 -3
- package/lib/form-comp/style/ACascaderMultiple.less +1 -3
- package/lib/form-comp/style/ADayTimePicker.less +1 -2
- package/lib/form-comp/style/ARangePicker.less +1 -2
- package/lib/form-comp/style/ASelectCustom.less +1 -3
- package/lib/form-comp/style/ASliderVerify.less +1 -3
- package/lib/form-comp/style/ATagsInput.less +1 -3
- package/lib/form-comp/style/index.less +1 -1
- package/lib/modal/style/index.less +1 -3
- package/lib/no-data/style/index.less +1 -3
- package/lib/svg-icon/style/index.less +1 -3
- package/lib/table/style/index.less +1 -3
- package/lib/tree/style/index.less +1 -3
- package/lib/weather/style/index.less +1 -0
- package/package.json +1 -2
- package/utils/Filter.js +2 -2
- package/utils/Storage.js +2 -0
- package/utils/Utils.js +89 -3
- package/font/DS-DIGI-1.ttf +0 -0
- package/font/DS-DIGIB-2.ttf +0 -0
- package/font/DS-DIGII-3.ttf +0 -0
- package/font/DS-DIGIT-4.ttf +0 -0
- package/font/Orbitron-Black.ttf +0 -0
- package/font/Orbitron-Bold.ttf +0 -0
- package/font/Orbitron-Medium.ttf +0 -0
- package/font/Orbitron-Regular.ttf +0 -0
- package/font/PANGMENZHENGDAOBIAOTITI-1.TTF +0 -0
- package/font/PingFang SC.ttf +0 -0
- package/font/YouSheBiaoTiHei.ttf +0 -0
- package/font/font.css +0 -48
- 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
package/extensions/BuildTheme.js
CHANGED
|
@@ -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
|
-
|
|
231
|
+
createTransferFile
|
|
216
232
|
}
|
package/package.json
CHANGED
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
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,
|
|
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(
|
|
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(
|
|
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
|
}
|
package/font/DS-DIGI-1.ttf
DELETED
|
Binary file
|
package/font/DS-DIGIB-2.ttf
DELETED
|
Binary file
|
package/font/DS-DIGII-3.ttf
DELETED
|
Binary file
|
package/font/DS-DIGIT-4.ttf
DELETED
|
Binary file
|
package/font/Orbitron-Black.ttf
DELETED
|
Binary file
|
package/font/Orbitron-Bold.ttf
DELETED
|
Binary file
|
package/font/Orbitron-Medium.ttf
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/font/PingFang SC.ttf
DELETED
|
Binary file
|
package/font/YouSheBiaoTiHei.ttf
DELETED
|
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
|
-
}
|