Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
regional-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 70ccc780
authored
Aug 13, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: restore mini-program script compatibility
1 parent
47fc03fc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
3 deletions
project.config.json
project.private.config.json
tabWorkOrder/pages/createOrder/services/lowPriceCatalogFilter.helpers.js
tabWorkOrder/pages/createOrder/tests/lowPriceCatalogFilter.helpers.test.mjs
tests/work-order-migration/upload-config.test.mjs
project.config.json
View file @
70ccc78
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
"useCompilerPlugins"
:
[
"useCompilerPlugins"
:
[
"sass"
"sass"
],
],
"ignoreDevUnusedFiles"
:
fals
e
,
"ignoreDevUnusedFiles"
:
tru
e
,
"ignoreUploadUnusedFiles"
:
true
,
"ignoreUploadUnusedFiles"
:
true
,
"compileWorklet"
:
false
,
"compileWorklet"
:
false
,
"uglifyFileName"
:
false
,
"uglifyFileName"
:
false
,
...
...
project.private.config.json
View file @
70ccc78
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
"useLanDebug"
:
false
,
"useLanDebug"
:
false
,
"showES6CompileOption"
:
false
,
"showES6CompileOption"
:
false
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"ignoreDevUnusedFiles"
:
fals
e
,
"ignoreDevUnusedFiles"
:
tru
e
,
"bigPackageSizeSupport"
:
true
"bigPackageSizeSupport"
:
true
}
}
}
}
tabWorkOrder/pages/createOrder/services/lowPriceCatalogFilter.helpers.js
View file @
70ccc78
...
@@ -29,7 +29,7 @@ function filterSpecificationList(specificationList, specificationKeys) {
...
@@ -29,7 +29,7 @@ function filterSpecificationList(specificationList, specificationKeys) {
const
allowedValuesByIndex
=
specificationKeys
.
reduce
(
const
allowedValuesByIndex
=
specificationKeys
.
reduce
(
(
allowedValues
,
specificationKey
)
=>
{
(
allowedValues
,
specificationKey
)
=>
{
specificationKey
.
split
(
';~;'
).
forEach
((
value
,
index
)
=>
{
specificationKey
.
split
(
';~;'
).
forEach
((
value
,
index
)
=>
{
allowedValues
[
index
]
??
=
new
Set
()
if
(
!
allowedValues
[
index
])
allowedValues
[
index
]
=
new
Set
()
allowedValues
[
index
].
add
(
value
)
allowedValues
[
index
].
add
(
value
)
})
})
return
allowedValues
return
allowedValues
...
...
tabWorkOrder/pages/createOrder/tests/lowPriceCatalogFilter.helpers.test.mjs
View file @
70ccc78
import assert from 'node:assert/strict'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { describe, it } from 'node:test'
import { describe, it } from 'node:test'
import { filterLowPriceSelectOrderCatalog } from '../services/lowPriceCatalogFilter.helpers.js'
import { filterLowPriceSelectOrderCatalog } from '../services/lowPriceCatalogFilter.helpers.js'
const helperSource = readFileSync(
new URL('../services/lowPriceCatalogFilter.helpers.js', import.meta.url),
'utf8',
)
function single(testId, validMinSellPrice) {
function single(testId, validMinSellPrice) {
return {
return {
testId,
testId,
...
@@ -27,6 +33,10 @@ function packageItem(testId, goodsList) {
...
@@ -27,6 +33,10 @@ function packageItem(testId, goodsList) {
}
}
describe('filterLowPriceSelectOrderCatalog', () => {
describe('filterLowPriceSelectOrderCatalog', () => {
it('avoids logical assignment syntax unsupported by the mini-program loader', () => {
assert.doesNotMatch(helperSource, /\?\?=/)
})
it('keeps only single goods with minimum-price validation enabled', () => {
it('keeps only single goods with minimum-price validation enabled', () => {
const enabled = single('enabled', 'Y')
const enabled = single('enabled', 'Y')
const disabled = single('disabled', 'N')
const disabled = single('disabled', 'N')
...
...
tests/work-order-migration/upload-config.test.mjs
View file @
70ccc78
...
@@ -39,6 +39,21 @@ describe('小程序上传边界', () => {
...
@@ -39,6 +39,21 @@ describe('小程序上传边界', () => {
}
}
})
})
it('开发编译只加载小程序依赖图中的文件', async () => {
const [projectConfig, privateConfig] = await Promise.all([
readFile(path.join(projectRoot, 'project.config.json'), 'utf8').then(
JSON.parse
),
readFile(
path.join(projectRoot, 'project.private.config.json'),
'utf8',
).then(JSON.parse)
])
assert.equal(projectConfig.setting?.ignoreDevUnusedFiles, true)
assert.equal(privateConfig.setting?.ignoreDevUnusedFiles, true)
})
it('上传会过滤未使用文件、源映射和重复 npm 产物', async () => {
it('上传会过滤未使用文件、源映射和重复 npm 产物', async () => {
const config = JSON.parse(
const config = JSON.parse(
await readFile(path.join(projectRoot, 'project.config.json'), 'utf8')
await readFile(path.join(projectRoot, 'project.config.json'), 'utf8')
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment