Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
cfe66423
authored
2025-06-14 13:29:05 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' into dev
2 parents
d53c1365
ba9b352a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
97 additions
and
23 deletions
package.json
src/components/FileUpload/index.vue
src/components/ImageUpload/index.vue
src/lang/package/zh-cn.js
src/views/demo/demo/index.vue
src/views/legao/advertisement/index.vue
src/views/legao/course/index.vue
src/views/legao/problem/index.vue
src/views/legao/upgradation/index.vue
src/views/system/user/index.vue
package.json
View file @
cfe6642
...
...
@@ -10,6 +10,7 @@
"preview"
:
"vite preview"
},
"dependencies"
:
{
"sortablejs"
:
"^1.15.6"
,
"@element-plus/icons-vue"
:
"2.0.10"
,
"@vueup/vue-quill"
:
"1.2.0"
,
"@vueuse/core"
:
"9.5.0"
,
...
...
src/components/FileUpload/index.vue
View file @
cfe6642
...
...
@@ -25,8 +25,20 @@
的文件
</div>
<!-- 文件列表 -->
<transition-group
class=
"upload-file-list el-upload-list el-upload-list--text"
name=
"el-fade-in-linear"
tag=
"ul"
>
<li
:key=
"file.uid"
class=
"el-upload-list__item ele-upload-list__item-content"
v-for=
"(file, index) in fileList"
>
<transition-group
class=
"upload-file-list el-upload-list el-upload-list--text"
name=
"el-fade-in-linear"
tag=
"ul"
ref=
"fileListWrapper"
@
update=
"handleSortUpdate"
>
<li
:key=
"file.uid"
class=
"el-upload-list__item ele-upload-list__item-content draggable"
v-for=
"(file, index) in fileList"
:draggable=
"true"
:title=
"limit > 1 ? '可拖动文件进行调序' : ''"
>
<el-link
:href=
"`${file.url}`"
:underline=
"false"
target=
"_blank"
>
<span
class=
"el-icon-document"
>
{{ getFileName(file.name) }}
</span>
</el-link>
...
...
@@ -41,6 +53,7 @@
<
script
setup
>
import
{
getToken
}
from
"@/utils/auth"
;
import
{
listByIds
,
delOss
}
from
"@/api/system/oss"
;
import
Sortable
from
'sortablejs'
;
const
props
=
defineProps
({
modelValue
:
[
String
,
Object
,
Array
],
...
...
@@ -70,13 +83,43 @@ const { proxy } = getCurrentInstance();
const
emit
=
defineEmits
();
const
number
=
ref
(
0
);
const
uploadList
=
ref
([]);
const
baseUrl
=
import
.
meta
.
env
.
VITE_APP_BASE_API
;
const
baseUrl
=
import
.
meta
.
env
.
VITE_APP_BASE_API
||
''
;
const
uploadFileUrl
=
ref
(
baseUrl
+
"/system/oss/upload"
);
// 上传文件服务器地址
const
headers
=
ref
({
Authorization
:
"Bearer "
+
getToken
()
});
const
fileList
=
ref
([]);
const
showTip
=
computed
(
()
=>
props
.
isShowTip
&&
(
props
.
fileType
||
props
.
fileSize
)
);
// 初始化拖拽排序
onMounted
(()
=>
{
const
el
=
proxy
.
$refs
.
fileListWrapper
.
$el
;
// 确保transition-group添加ref="fileListWrapper"
if
(
el
)
{
new
Sortable
(
el
,
{
animation
:
150
,
// 过渡动画时长
draggable
:
'.draggable'
,
// 可拖拽的元素
onUpdate
:
(
evt
)
=>
{
// 拖拽结束时更新列表顺序
const
oldIndex
=
evt
.
oldIndex
;
const
newIndex
=
evt
.
newIndex
;
// 移动元素位置
fileList
.
value
.
splice
(
newIndex
,
0
,
fileList
.
value
.
splice
(
oldIndex
,
1
)[
0
]);
// 触发排序更新事件
handleSortUpdate
();
}
});
}
});
// 排序更新处理
function
handleSortUpdate
()
{
// 更新父组件modelValue
emit
(
"update:modelValue"
,
listToString
(
fileList
.
value
));
// 输出排序后的列表(可选)
console
.
log
(
'排序后的文件列表:'
,
fileList
.
value
);
}
watch
(()
=>
props
.
modelValue
,
async
val
=>
{
if
(
val
)
{
...
...
@@ -216,4 +259,7 @@ function listToString(list, separator) {
.ele-upload-list__item-content-action
.el-link
{
margin-right
:
10px
;
}
.draggable
{
cursor
:
move
;
}
</
style
>
...
...
src/components/ImageUpload/index.vue
View file @
cfe6642
...
...
@@ -59,7 +59,7 @@ const props = defineProps({
// 大小限制(MB)
fileSize
:
{
type
:
Number
,
default
:
5
,
default
:
5
0
,
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType
:
{
...
...
src/lang/package/zh-cn.js
View file @
cfe6642
...
...
@@ -82,6 +82,7 @@ export default {
blockName
:
'系列名称'
,
buildName
:
'搭建'
,
caseName
:
'有无案例'
,
packName
:
'是否打包'
,
tableControlsName
:
'操作'
,
controlsDelName
:
'删除'
,
controlsEditName
:
'编辑'
,
...
...
@@ -92,12 +93,13 @@ export default {
dialogTitleEdit
:
'修改'
,
dialogName
:
'课程名称'
,
dialogBlock
:
'系列'
,
dialogPack
:
'是否打包'
,
dialogTypes
:
'搭建类型'
,
dialogTwoD
:
'2D'
,
dialogThreeD
:
'3D'
,
dialogCase
:
'
案例
'
,
dialogCase
:
'
视频
'
,
dialogTeaching
:
'教案'
,
dialogPpt
:
'
PPT
'
,
dialogPpt
:
'
课程
'
,
dialogPhoto
:
'课程图片'
,
dialogConfim
:
'确认'
,
dialogExit
:
'退出'
,
...
...
src/views/demo/demo/index.vue
View file @
cfe6642
...
...
@@ -162,7 +162,6 @@
<
el
-
dialog
:
title
=
"upload.title"
:
visible
.
sync
=
"upload.open"
width
=
"400px"
append
-
to
-
body
>
<
el
-
upload
ref
=
"uploadRef"
:
limit
=
"1"
accept
=
".xlsx, .xls"
:
headers
=
"upload.headers"
:
action
=
"upload.url + '?updateSupport=' + upload.updateSupport"
...
...
src/views/legao/advertisement/index.vue
View file @
cfe6642
...
...
@@ -100,7 +100,7 @@
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('advertisement.tablePhotoName')"
label-width=
"80"
>
<imageUpload
v-model=
"showForm.form.ossId"
:limit=
'1'
:fileType=
'["png", "jpg", "jpeg", "ico"]'
/>
<imageUpload
v-model=
"showForm.form.ossId"
:limit=
'1'
:fileType=
'["png", "jpg", "jpeg", "ico"
,"mp4"
]'
/>
</el-form-item>
<el-form-item
:label=
"$t('advertisement.tableSortName')"
label-width=
"80"
>
<el-input-number
v-model=
"showForm.form.sort"
controls-position=
"right"
:min=
"0"
/>
...
...
src/views/legao/course/index.vue
View file @
cfe6642
...
...
@@ -44,6 +44,14 @@
<el-table-column
:label=
"$t('course.blockName')"
prop=
"buildingBlockName"
/>
<el-table-column
:label=
"$t('course.buildName')"
prop=
"type"
/>
<el-table-column
:label=
"$t('course.caseName')"
prop=
"caseName"
/>
<el-table-column
:label=
"$t('course.packName')"
prop=
"canPack"
>
<template
#
default=
"
{ row }">
<dict-tag
:options=
"constrain_status"
:value=
"row.canPack"
></dict-tag>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('course.tableControlsName')"
class-name=
"small-padding fixed-width"
>
<
template
#
default=
"{ row }"
>
<el-button
...
...
@@ -82,6 +90,21 @@
style=
"width: 180px;"
/>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogPack')"
prop=
"canPack"
label-width=
"80"
>
<el-select
v-model=
"showForm.form.canPack"
placeholder=
"请选择是否打包"
closeabled
style=
"width: 180px;"
>
<el-option
v-for=
"item in constrain_status"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogTypes')"
prop=
"type"
label-width=
"80"
>
<el-checkbox-group
v-model=
"showForm.form.type"
>
<div
style=
"display: flex;align-items: center;"
>
...
...
@@ -93,8 +116,8 @@
<el-form-item
v-if=
"determineStatus('2D')"
:label=
"$t('course.dialogTwoD')"
label-width=
"80"
>
<
template
v-if=
"true"
>
<imageUpload
v-model=
"showForm.form.twoDimensionalOssId"
:limit=
'10'
:fileType=
'["png", "jpg", "jpeg", "ico"]'
/>
<fileUpload
v-model=
"showForm.form.twoDimensionalUrl"
:
limit=
"1"
:fileType=
'["ldr","png","jpg","jpeg","ico","json","pdf
"]'
/>
<fileUpload
v-model=
"showForm.form.twoDimensionalType"
:
limit=
"1"
:fileType=
'["ldr","png","jpg","jpeg","ico","json","pdf
"]'
/>
<fileUpload
v-model=
"showForm.form.twoDimensionalUrl"
:
fileType=
'["ldr","png","jpg","jpeg","ico","json","pdf","mp4
"]'
/>
<fileUpload
v-model=
"showForm.form.twoDimensionalType"
:
fileType=
'["ldr","png","jpg","jpeg","ico","json","pdf","mp4
"]'
/>
</
template
>
<
template
v-else
>
<el-input
v-model=
"showForm.form.twoDimensionalUrl"
placeholder=
"请输入链接URL"
/>
...
...
@@ -103,21 +126,21 @@
<el-form-item
v-if=
"determineStatus('3D')"
:label=
"$t('course.dialogThreeD')"
label-width=
"80"
>
<
template
v-if=
"true"
>
<imageUpload
v-model=
"showForm.form.threeDimensionalOssId"
:limit=
'10'
:fileType=
'["png", "jpg", "jpeg", "ico"]'
/>
<fileUpload
v-model=
"showForm.form.threeDimensionalUrl"
:
limit=
"1"
:fileType=
'["ldr","ldr.json"]'
/
>
<fileUpload
v-model=
"showForm.form.threeDimensionalType"
:
limit=
"1"
:fileType=
'["ldr","ldr.
json"]'
/>
<fileUpload
v-model=
"showForm.form.threeDimensionalUrl"
:
fileType=
'["ldr"]'
/>
<!--ldr.json--
>
<fileUpload
v-model=
"showForm.form.threeDimensionalType"
:
fileType=
'["
json"]'
/>
</
template
>
<
template
v-else
>
<el-input
v-model=
"showForm.form.threeDimensionalUrl"
placeholder=
"请输入链接URL"
/>
</
template
>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogCase')"
prop=
"caseOssId"
label-width=
"80"
>
<fileUpload
v-model=
"showForm.form.caseOssId"
:limit=
"1
"
:fileType=
'["mp4", "avi", "mov", "flv
"]'
/>
<fileUpload
v-model=
"showForm.form.caseOssId"
:limit=
"1
0"
:fileType=
'["mp4", "avi", "mov", "flv","pdf
"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogTeaching')"
label-width=
"80"
>
<fileUpload
v-model=
"showForm.form.teachingOssId"
:limit=
"1
"
:fileType=
'["pdf
"]'
/>
<fileUpload
v-model=
"showForm.form.teachingOssId"
:limit=
"1
0"
:fileType=
'["pdf","mp4
"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogPpt')"
label-width=
"80"
>
<fileUpload
v-model=
"showForm.form.pptOssId"
:limit=
"1
"
:fileType=
'["pdf","ppt","pptx
"]'
/>
<fileUpload
v-model=
"showForm.form.pptOssId"
:limit=
"1
0"
:fileType=
'["pdf","mp4
"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('course.dialogPhoto')"
prop=
"ossId"
label-width=
"80"
>
<imageUpload
v-model=
"showForm.form.ossId"
:limit=
'1'
:fileType=
'["png", "jpg", "jpeg", "ico"]'
/>
...
...
@@ -144,7 +167,7 @@ const { windowSize } = useTableHeight('max-height')
// 导入字典
const
{
proxy
}
=
getCurrentInstance
();
const
{
dimensional_type
}
=
proxy
.
useDict
(
"dimensional_type
"
);
const
{
dimensional_type
,
constrain_status
}
=
proxy
.
useDict
(
"dimensional_type"
,
"constrain_status
"
);
const
props
=
{
label
:
'name'
,
...
...
@@ -168,13 +191,12 @@ const data = reactive({
title
:
''
,
open
:
false
,
form
:
{
}
},
rules
:
{
name
:
[{
required
:
true
,
message
:
"课程名称不能为空"
,
trigger
:
"blur"
}],
buildingBlockId
:
[{
required
:
true
,
message
:
"系列不能为空"
,
trigger
:
"blur"
}],
type
:
[{
required
:
true
,
message
:
"搭建类型不能为空"
,
trigger
:
"blur"
}],
caseOssId
:
[{
required
:
true
,
message
:
"案例不能为空"
,
trigger
:
"blur"
}],
ossId
:
[{
required
:
true
,
message
:
"课程图片不能为空"
,
trigger
:
"blur"
}]
}
...
...
@@ -232,9 +254,11 @@ function handleEdit (row) {
open
:
true
,
form
:
{
...
row
,
type
:
row
.
type
.
split
(
'、'
)
type
:
row
.
type
.
split
(
'、'
),
canPack
:
row
.
canPack
?
String
(
row
.
canPack
)
:
'0'
// 将数字转换为字符串
}
}
console
.
log
(
'编辑表单数据:'
,
showForm
.
value
.
form
)
// 添加日志查看数据
}
function
btn_add
()
{
...
...
@@ -242,7 +266,10 @@ function btn_add () {
showForm
.
value
.
title
=
proxy
.
$t
(
'advertisement.dialogTitleAdd'
)
showForm
.
value
=
{
...
showForm
.
value
,
open
:
true
open
:
true
,
form
:
{
canPack
:
'0'
// 设置默认值
}
}
}
...
...
src/views/legao/problem/index.vue
View file @
cfe6642
...
...
@@ -101,7 +101,7 @@
<imageUpload
v-model=
"showForm.form.coverOssId"
:limit=
"1"
:fileType=
'["png", "jpg", "jpeg", "ico"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('problem.dialogMovie')"
label-width=
"80"
>
<fileUpload
v-model=
"showForm.form.videoOssId"
:
limit=
"1"
:
fileType=
'["mp4", "avi", "mov", "flv"]'
/>
<fileUpload
v-model=
"showForm.form.videoOssId"
:fileType=
'["mp4", "avi", "mov", "flv"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('problem.dialogSort')"
label-width=
"80"
>
<el-input-number
v-model=
"showForm.form.sort"
controls-position=
"right"
:min=
"0"
/>
...
...
src/views/legao/upgradation/index.vue
View file @
cfe6642
...
...
@@ -131,7 +131,7 @@
<el-dialog
:title=
"showForm.title"
v-model=
"showForm.open"
width=
"500px"
append-to-body
@
close=
"closeDialog"
>
<el-form
ref=
"tableRefs"
:model=
"showForm.form"
:rules=
"rules"
label-width=
"100"
>
<el-form-item
:label=
"$t('upgradation.dialogFile')"
>
<fileUpload
v-model=
"showForm.form.fileOssId"
:fileSize=
"20"
:
limit=
"1"
:
fileType=
'["apk", "bin", "ppd", "exe"]'
/>
<fileUpload
v-model=
"showForm.form.fileOssId"
:fileSize=
"20"
:fileType=
'["apk", "bin", "ppd", "exe"]'
/>
</el-form-item>
<el-form-item
:label=
"$t('upgradation.dialogFileUrl')"
>
<el-input
v-model=
"showForm.form.fileUrl"
placeholder=
"请输入链接URL"
/>
...
...
src/views/system/user/index.vue
View file @
cfe6642
...
...
@@ -379,7 +379,6 @@
width=
"400px"
append-to-body
>
<el-upload
ref=
"uploadRef"
:limit=
"1"
accept=
".xlsx, .xls"
:headers=
"upload.headers"
:action=
"upload.url + '?updateSupport=' + upload.updateSupport"
...
...
Write
Preview
Styling with
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