Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 0b53f038
authored
Apr 23, 2026
by
Lin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 新增手机号导入功能,优化短课程配置组件,提升用户体验和代码可读性
1 parent
565fafeb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
28 deletions
src/api/serviceCentre.js
src/views/serviceCentre/shortCourse/components/shortLightAlloction.vue
src/views/serviceCentre/shortCourse/lightChange.vue
src/api/serviceCentre.js
View file @
0b53f03
...
@@ -358,3 +358,10 @@ export function updateLightChangeConfig(data) {
...
@@ -358,3 +358,10 @@ export function updateLightChangeConfig(data) {
data
.
method
=
`
${
path
}
servicecenter.short.course.config.submit`
;
data
.
method
=
`
${
path
}
servicecenter.short.course.config.submit`
;
return
request
(
data
,
RequestMethods
.
POST
);
return
request
(
data
,
RequestMethods
.
POST
);
}
}
// 轻改-短课程配置-手机号导入
export
function
importLightChangePhone
(
data
)
{
data
.
method
=
`
${
path
}
servicecenter.short.course.phone.import`
;
// 文件参数不参与签名拼接(参考 importProfit)
return
request
(
data
,
RequestMethods
.
POST
,
[
"file"
]);
}
\ No newline at end of file
\ No newline at end of file
src/views/serviceCentre/shortCourse/components/shortLightAlloction.vue
View file @
0b53f03
...
@@ -154,10 +154,8 @@
...
@@ -154,10 +154,8 @@
</template>
</template>
<
script
>
<
script
>
import
{
getLightChangeConfig
,
updateLightChangeConfig
}
from
"@api/serviceCentre"
;
import
{
getLightChangeConfig
,
importLightChangePhone
,
updateLightChangeConfig
}
from
"@api/serviceCentre"
;
import
GlOssApi
from
"glsk-oss-jssdk"
;
import
{
effectiveTypeOpt
,
punishTypeOpt
}
from
"@/common/constants.js"
;
import
{
effectiveTypeOpt
,
punishTypeOpt
}
from
"@/common/constants.js"
;
import
{
baseConfig
}
from
"@/main"
;
export
default
{
export
default
{
props
:
{
props
:
{
...
@@ -232,11 +230,6 @@ export default {
...
@@ -232,11 +230,6 @@ export default {
created
()
{
created
()
{
this
.
getSopConfigData
();
this
.
getSopConfigData
();
},
},
mounted
()
{
this
.
GlOssApi
=
new
GlOssApi
({
baseConfig
,
});
},
methods
:
{
methods
:
{
validateNumber
(
field
,
min
,
max
)
{
validateNumber
(
field
,
min
,
max
)
{
let
value
=
this
.
configData
[
field
];
let
value
=
this
.
configData
[
field
];
...
@@ -289,16 +282,13 @@ export default {
...
@@ -289,16 +282,13 @@ export default {
this
.
$refs
.
formRef
.
validate
((
valid
,
invalidFields
)
=>
{
this
.
$refs
.
formRef
.
validate
((
valid
,
invalidFields
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
const
params
=
{
const
params
=
{
storePenetrationWeekly
:
this
.
configData
.
storePenetrationWeekly
,
storePenetrationMonthly
:
this
.
configData
.
storePenetrationMonthly
,
inspectionScore
:
this
.
configData
.
inspectionScore
,
studyDay
:
this
.
configData
.
studyDay
,
punishType
:
this
.
configData
.
punishType
,
punishType
:
this
.
configData
.
punishType
,
finishTime
:
this
.
configData
.
finishTime
,
finishTime
:
this
.
configData
.
finishTime
,
effectiveType
:
this
.
configData
.
effectiveType
,
effectiveType
:
this
.
configData
.
effectiveType
,
openFlag
:
this
.
configData
.
openFlag
===
"Y"
?
1
:
0
,
openFlag
:
this
.
configData
.
openFlag
===
"Y"
?
1
:
0
,
phoneWhitelistFileUrl
:
this
.
configData
.
phoneWhitelistFileUrl
,
staffList
:
[]
,
};
};
console
.
log
(
params
,
"params"
);
updateLightChangeConfig
(
params
)
updateLightChangeConfig
(
params
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
,
"updateLightChangeConfig"
);
console
.
log
(
res
,
"updateLightChangeConfig"
);
...
@@ -344,6 +334,7 @@ export default {
...
@@ -344,6 +334,7 @@ export default {
}
}
},
},
handleWhitelistFileChange
(
file
)
{
handleWhitelistFileChange
(
file
)
{
console
.
log
(
file
,
"file"
);
const
fileInfo
=
file
.
raw
;
const
fileInfo
=
file
.
raw
;
if
(
!
fileInfo
)
if
(
!
fileInfo
)
return
;
return
;
...
@@ -370,22 +361,44 @@ export default {
...
@@ -370,22 +361,44 @@ export default {
};
};
this
.
whitelistFiles
=
[
item
];
this
.
whitelistFiles
=
[
item
];
const
index
=
0
;
const
index
=
0
;
const
success
=
(
res
)
=>
{
const
fail
=
(
msg
)
=>
{
this
.
$set
(
this
.
whitelistFiles
[
index
],
"fileUrl"
,
res
.
aliyunAddress
);
this
.
$set
(
this
.
whitelistFiles
[
index
],
"uploadProgress"
,
100
);
this
.
configData
.
phoneWhitelistFileUrl
=
res
.
aliyunAddress
;
};
const
fail
=
()
=>
{
this
.
whitelistFiles
=
[];
this
.
whitelistFiles
=
[];
this
.
configData
.
phoneWhitelistFileUrl
=
""
;
this
.
configData
.
phoneWhitelistFileUrl
=
""
;
this
.
$refs
.
whitelistUpload
&&
this
.
$refs
.
whitelistUpload
.
clearFiles
();
this
.
$refs
.
whitelistUpload
&&
this
.
$refs
.
whitelistUpload
.
clearFiles
();
msg
&&
this
.
$message
.
error
(
msg
);
};
};
this
.
handleOssUpload
(
fileInfo
,
fileInfo
.
name
,
success
,
fail
);
},
const
onProcess
=
(
progressEvent
)
=>
{
handleOssUpload
(
file
,
fileName
,
success
,
fail
)
{
const
total
=
progressEvent
?.
total
||
0
;
const
bucketName
=
"jinrong-huidan-test"
;
const
loaded
=
progressEvent
?.
loaded
||
0
;
const
fileType
=
fileName
.
substr
(
fileName
.
lastIndexOf
(
"."
)
+
1
);
if
(
!
total
)
this
.
GlOssApi
.
multipartUpload
(
file
,
success
,
fail
,
bucketName
,
fileType
);
return
;
const
percent
=
Math
.
min
(
99
,
Math
.
max
(
0
,
Math
.
floor
((
loaded
/
total
)
*
100
)));
this
.
$set
(
this
.
whitelistFiles
[
index
],
"uploadProgress"
,
percent
);
};
importLightChangePhone
({
file
:
fileInfo
,
onProcess
,
cancelFun
:
this
.
whitelistFiles
[
index
].
cancelAxios
,
})
.
then
((
res
)
=>
{
this
.
$set
(
this
.
whitelistFiles
[
index
],
"uploadProgress"
,
100
);
// 尝试从返回值中取可预览的 url(不同后端可能字段不同)
const
url
=
(
typeof
res
===
"string"
&&
/^https
?
:
\/\/
/
.
test
(
res
))
?
res
:
(
res
?.
fileUrl
||
res
?.
url
||
res
?.
aliyunAddress
||
""
);
if
(
url
)
{
this
.
$set
(
this
.
whitelistFiles
[
index
],
"fileUrl"
,
url
);
this
.
configData
.
phoneWhitelistFileUrl
=
url
;
}
this
.
$message
.
success
(
"上传成功"
);
})
.
catch
((
err
)
=>
{
console
.
error
(
err
);
fail
(
err
?.
message
||
"上传失败"
);
});
},
},
handleWhitelistExceed
()
{
handleWhitelistExceed
()
{
this
.
$message
.
error
(
"最多可上传 1 个文件"
);
this
.
$message
.
error
(
"最多可上传 1 个文件"
);
...
...
src/views/serviceCentre/shortCourse/lightChange.vue
View file @
0b53f03
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
getLightChangePage
,
switchLightChange
}
from
"@api/serviceCentre"
;
import
{
getLightChangePage
,
importLightChangePhone
,
switchLightChange
}
from
"@api/serviceCentre"
;
import
dayjs
from
"dayjs"
;
import
dayjs
from
"dayjs"
;
import
{
mapActions
,
mapState
}
from
"vuex"
;
import
{
mapActions
,
mapState
}
from
"vuex"
;
import
{
import
{
...
@@ -339,8 +339,6 @@ export default {
...
@@ -339,8 +339,6 @@ export default {
try
{
try
{
const
params
=
await
this
.
beforeSearchFn
(
2
);
// type = 2 表示导出 获取导出传参
const
params
=
await
this
.
beforeSearchFn
(
2
);
// type = 2 表示导出 获取导出传参
params
.
currentPage
=
1
;
params
.
currentPage
=
1
;
// params.method
// = "dj.api.smartcarlife.servicecenter.sop.detail.page.export";
params
.
method
=
"dj.api.smartcarlife.servicecenter.short.course.task.page.export"
;
params
.
method
=
"dj.api.smartcarlife.servicecenter.short.course.task.page.export"
;
const
list
=
[
const
list
=
[
...
this
.
dowloadList
,
...
this
.
dowloadList
,
...
...
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