Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
study-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
study-platform
Commits
3bf889bc
Commit
3bf889bc
authored
Mar 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改人员学习
parent
a42bcdbf
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
706 additions
and
505 deletions
+706
-505
study-manager-ui/admin/.env
study-manager-ui/admin/.env
+1
-1
study-manager-ui/admin/.env.test
study-manager-ui/admin/.env.test
+1
-1
study-manager-ui/admin/src/assets/mixins/formdialog.js
study-manager-ui/admin/src/assets/mixins/formdialog.js
+4
-2
study-manager-ui/admin/src/assets/mixins/table.js
study-manager-ui/admin/src/assets/mixins/table.js
+1
-1
study-manager-ui/admin/src/components/FileUpload.vue
study-manager-ui/admin/src/components/FileUpload.vue
+59
-22
study-manager-ui/admin/src/views/notice/dialogshow.vue
study-manager-ui/admin/src/views/notice/dialogshow.vue
+423
-382
study-manager-ui/admin/src/views/notice/study/view.vue
study-manager-ui/admin/src/views/notice/study/view.vue
+111
-91
study-manager-ui/admin/src/views/project/dialogshow.vue
study-manager-ui/admin/src/views/project/dialogshow.vue
+42
-1
study-manager-ui/admin/src/views/project/study/view.vue
study-manager-ui/admin/src/views/project/study/view.vue
+48
-2
study-manager/pom.xml
study-manager/pom.xml
+1
-1
study-manager/src/main/java/com/mortals/xhx/base/system/upload/service/impl/UploadServiceImpl.java
...hx/base/system/upload/service/impl/UploadServiceImpl.java
+1
-1
study-manager/src/main/java/com/mortals/xhx/base/system/upload/web/UploadController.java
.../mortals/xhx/base/system/upload/web/UploadController.java
+14
-0
No files found.
study-manager-ui/admin/.env
View file @
3bf889bc
...
@@ -10,5 +10,5 @@ VUE_APP_WEBSOCKET_API =127.0.0.1:18222/m
...
@@ -10,5 +10,5 @@ VUE_APP_WEBSOCKET_API =127.0.0.1:18222/m
# 门户登录地址
# 门户登录地址
VUE_APP_PORTAL_URL = /portal_home
VUE_APP_PORTAL_URL = /portal_home
VUE_APP_PORTAL_PORT = 1
1089
VUE_APP_PORTAL_PORT = 1
7300
study-manager-ui/admin/.env.test
View file @
3bf889bc
...
@@ -5,4 +5,4 @@ VUE_APP_API_BASE_URL=/basics_api
...
@@ -5,4 +5,4 @@ VUE_APP_API_BASE_URL=/basics_api
#图片地址拼接
#图片地址拼接
VUE_APP_PORTAL_URL
=
/
portal_home
VUE_APP_PORTAL_URL
=
/
portal_home
VUE_APP_PORTAL_PORT
=
1
1089
VUE_APP_PORTAL_PORT
=
1
7300
study-manager-ui/admin/src/assets/mixins/formdialog.js
View file @
3bf889bc
...
@@ -31,7 +31,7 @@ export default {
...
@@ -31,7 +31,7 @@ export default {
this
.
pageInfo
.
edit
=
path
+
"
/edit
"
;
this
.
pageInfo
.
edit
=
path
+
"
/edit
"
;
this
.
pageInfo
.
view
=
path
+
"
/view
"
;
this
.
pageInfo
.
view
=
path
+
"
/view
"
;
},
},
// 默认拉取数据
// 默认拉取数据
getData
()
{
getData
()
{
this
.
loading
=
true
;
this
.
loading
=
true
;
...
@@ -46,7 +46,9 @@ export default {
...
@@ -46,7 +46,9 @@ export default {
res
.
entity
=
this
.
util_toDateStr
(
res
.
entity
,
this
.
toDate
);
res
.
entity
=
this
.
util_toDateStr
(
res
.
entity
,
this
.
toDate
);
this
.
form
=
Object
.
assign
({},
this
.
form
,
res
.
entity
);
this
.
form
=
Object
.
assign
({},
this
.
form
,
res
.
entity
);
this
.
dict
=
Object
.
assign
({},
this
.
dict
,
res
.
dict
);
this
.
dict
=
Object
.
assign
({},
this
.
dict
,
res
.
dict
);
console
.
log
(
this
.
form
)
this
.
afterRender
(
res
);
this
.
afterRender
(
res
);
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
...
...
study-manager-ui/admin/src/assets/mixins/table.js
View file @
3bf889bc
...
@@ -264,7 +264,7 @@ export default {
...
@@ -264,7 +264,7 @@ export default {
// 自定义索引号
// 自定义索引号
handleIndexMethod
(
index
)
{
handleIndexMethod
(
index
)
{
//prePageResult 每页条数
//prePageResult 每页条数
console
.
log
(
"
index:
"
+
index
)
//
console.log("index:"+index)
let
size
=
this
.
tableData
.
pageInfo
.
prePageResult
;
let
size
=
this
.
tableData
.
pageInfo
.
prePageResult
;
let
page
=
this
.
tableData
.
pageInfo
.
currPage
;
let
page
=
this
.
tableData
.
pageInfo
.
currPage
;
let
count
=
parseInt
(
size
)
*
(
parseInt
(
page
)
-
1
)
let
count
=
parseInt
(
size
)
*
(
parseInt
(
page
)
-
1
)
...
...
study-manager-ui/admin/src/components/FileUpload.vue
View file @
3bf889bc
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<el-link
<el-link
:underline=
"false"
:underline=
"false"
style=
"font-size: 12px"
style=
"font-size: 12px"
@
click=
"handleDelete(index)"
@
click=
"handleDelete(
file.url,
index)"
type=
"danger"
type=
"danger"
>
删除
</el-link
>
删除
</el-link
>
>
...
@@ -71,7 +71,7 @@ export default {
...
@@ -71,7 +71,7 @@ export default {
type
:
Number
,
type
:
Number
,
default
:
200
,
default
:
200
,
},
},
fileNumber
:
{
fileNumber
:
{
type
:
Number
,
type
:
Number
,
default
:
1
,
default
:
1
,
},
},
...
@@ -99,34 +99,55 @@ export default {
...
@@ -99,34 +99,55 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
number
:
0
,
uploadFileUrl
:
"
/study/file/commonupload
"
,
// 上传的地址
uploadFileUrl
:
"
/study/file/commonupload
"
,
// 上传的地址
uploadList
:
[],
headers
:{},
headers
:{},
fileList
:
[],
fileList
:
[],
};
};
},
},
/* watch: {
value: {
handler(val) {
console.log("value",this.value);
if (val) {
let temp = 1;
// 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(',');
// 然后将数组转为对象数组
this.fileList = list.map(item => {
item = { name: item.name, url: item.url};
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
this.fileList = [];
return [];
}
},
}
},*/
computed
:
{
computed
:
{
// 是否显示提示
// 是否显示提示
showTip
()
{
showTip
()
{
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
return
this
.
isShowTip
&&
(
this
.
fileType
||
this
.
fileSize
);
},
},
// 列表
// 列表
list
()
{
list
()
{
let
temp
=
1
;
let
temp
=
1
;
if
(
this
.
value
)
{
if
(
this
.
value
)
{
console
.
log
(
"
value
"
,
this
.
value
)
// 首先将值转为数组
// 首先将值转为数组
const
list
=
Array
.
isArray
(
this
.
value
)
?
this
.
value
:
[
this
.
value
];
const
list
=
Array
.
isArray
(
this
.
value
)
?
this
.
value
:
[
this
.
value
];
// 然后将数组转为对象数组
// 然后将数组转为对象数组
return
list
.
map
((
item
)
=>
{
this
.
fileList
=
list
.
map
(
item
=>
{
if
(
typeof
item
===
"
string
"
)
{
item
=
{
name
:
item
.
name
,
url
:
item
.
url
};
if
(
this
.
fileName
!=
''
){
item
=
{
name
:
this
.
fileName
,
url
:
item
};
}
else
{
item
=
{
name
:
item
,
url
:
item
};
}
}
item
.
uid
=
item
.
uid
||
new
Date
().
getTime
()
+
temp
++
;
item
.
uid
=
item
.
uid
||
new
Date
().
getTime
()
+
temp
++
;
return
item
;
return
item
;
});
});
return
this
.
fileList
;
}
else
{
}
else
{
this
.
fileList
=
[];
this
.
fileList
=
[];
return
[];
return
[];
...
@@ -160,11 +181,12 @@ export default {
...
@@ -160,11 +181,12 @@ export default {
return
false
;
return
false
;
}
}
}
}
this
.
number
++
;
return
true
;
return
true
;
},
},
// 文件个数超出
// 文件个数超出
handleExceed
()
{
handleExceed
()
{
this
.
$message
.
error
(
`
只允许上传单个文件
`
);
this
.
$message
.
error
(
`
上传文件数量不能超过
${
this
.
limit
}
个!
`
);
},
},
// 上传失败
// 上传失败
handleUploadError
(
err
)
{
handleUploadError
(
err
)
{
...
@@ -172,19 +194,34 @@ export default {
...
@@ -172,19 +194,34 @@ export default {
},
},
// 上传成功回调
// 上传成功回调
handleUploadSuccess
(
res
,
file
)
{
handleUploadSuccess
(
res
,
file
)
{
this
.
$message
.
success
(
"
上传成功
"
);
if
(
res
.
code
===
1
)
{
this
.
$emit
(
"
input
"
,
res
.
url
);
this
.
uploadList
.
push
({
name
:
res
.
fileName
,
url
:
res
.
url
});
this
.
fileName
=
res
.
fileName
console
.
log
(
"
uploadList:
"
,
this
.
uploadList
)
this
.
$emit
(
"
getFileName
"
,
res
.
fileName
);
if
(
this
.
uploadList
.
length
===
this
.
number
)
{
this
.
fileList
=
this
.
fileList
.
concat
(
this
.
uploadList
);
this
.
uploadList
=
[];
this
.
number
=
0
;
this
.
$emit
(
"
input
"
,
this
.
fileList
);
}
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
// this.$message.success("上传成功");
// this.$emit("input", res.url);
// this.fileName=res.fileName
// this.$emit("getFileName", res.fileName);
},
},
// 删除文件
// 删除文件
handleDelete
(
index
)
{
handleDelete
(
url
,
index
)
{
this
.
fileList
.
splice
(
index
,
1
);
//todo 接口请求删除
this
.
$emit
(
"
input
"
,
''
);
this
.
value
=
this
.
value
.
filter
(
item
=>
item
.
url
!=
url
)
// this.fileList.splice(index, 1);
this
.
$emit
(
"
input
"
,
this
.
value
);
},
},
// 获取文件名称
// 获取文件名称
getFileName
(
name
)
{
getFileName
(
name
)
{
if
(
name
.
lastIndexOf
(
"
/
"
)
>
-
1
)
{
//console.log("name",name)
if
(
name
&&
name
.
lastIndexOf
(
"
/
"
)
>
-
1
)
{
return
name
.
slice
(
name
.
lastIndexOf
(
"
/
"
)
+
1
).
toLowerCase
();
return
name
.
slice
(
name
.
lastIndexOf
(
"
/
"
)
+
1
).
toLowerCase
();
}
else
{
}
else
{
return
name
;
return
name
;
...
@@ -192,7 +229,7 @@ export default {
...
@@ -192,7 +229,7 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
fileList
=
this
.
list
;
//
this.fileList = this.list;
},
},
};
};
</
script
>
</
script
>
...
...
study-manager-ui/admin/src/views/notice/dialogshow.vue
View file @
3bf889bc
This diff is collapsed.
Click to expand it.
study-manager-ui/admin/src/views/notice/study/view.vue
View file @
3bf889bc
<
template
>
<
template
>
<layout-view>
<layout-view>
<el-row
justify=
"center"
align=
"middle"
::span=
"24"
>
<el-row
justify=
"center"
align=
"middle"
::span=
"24"
>
<el-col
:span=
"24"
style=
"display:flex;justify-content:center;"
>
<el-col
:span=
"24"
style=
"display:flex;justify-content:center;"
>
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<el-row>
<el-row>
<span
class=
"my-custom-text"
>
{{
form
.
title
}}
</span>
<span
class=
"my-custom-text"
>
{{
form
.
title
}}
</span>
<el-button
type=
"primary"
style=
"float: right"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
<el-button
type=
"primary"
style=
"float: right"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
</el-row>
</el-row>
<!--
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
-->
<!--
<el-button
type=
"primary"
@
click=
"$router.go(-1)"
size=
"small"
>
返回
</el-button>
-->
<el-divider
style=
"width: 100%"
></el-divider>
<el-divider
style=
"width: 100%"
></el-divider>
<el-descriptions
style=
"text-align: center;width:50%; margin: auto"
:column=
"3"
>
<el-descriptions
style=
"text-align: center;width:50%; margin: auto"
:column=
"3"
>
<el-descriptions-item
label-width=
"0"
label=
"公告类型"
>
<el-descriptions-item
label-width=
"0"
label=
"公告类型"
>
{{
util_formatters
(
"
noticetType
"
,
form
.
noticetType
)
}}
{{
util_formatters
(
"
noticetType
"
,
form
.
noticetType
)
}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label=
"发布时间"
label-width=
"0"
>
<el-descriptions-item
label=
"发布时间"
label-width=
"0"
>
{{
util_formatterDate
(
form
.
createTime
)
}}
{{
util_formatterDate
(
form
.
createTime
)
}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item
label-width=
"0"
label=
"发布部门"
>
<el-descriptions-item
label-width=
"0"
label=
"发布部门"
>
{{
form
.
deptName
}}
{{
form
.
deptName
}}
</el-descriptions-item>
</el-descriptions-item>
</el-descriptions>
</el-descriptions>
<el-divider
style=
"width: 100%"
></el-divider>
<el-divider
style=
"width: 100%"
></el-divider>
<div
class=
"ql-editor"
style=
""
v-html=
"form.noticeContent"
></div>
<div
class=
"ql-editor"
style=
""
v-html=
"form.noticeContent"
></div>
<el-divider
style=
"width: 100%"
></el-divider>
<el-divider
style=
"width: 100%"
></el-divider>
<div
v-if=
"isImage"
>
<img
:src=
"form.filePath"
alt=
"图片描述"
>
<ul
class=
"attachment-list"
>
</div>
<li
v-for=
"(file, index) in attachmentList"
:key=
"index"
>
<div
v-else-if=
"isVideo"
>
<div
class=
"file-preview"
>
<video
id=
"myVideo"
controls
>
<template
v-if=
"checkImage(file)"
>
<source
:src=
"form.filePath"
type=
"video/mp4"
>
<img
:src=
"file.url"
alt=
""
/>
</video>
</
template
>
</div>
<
template
v-else-if=
"checkVideo(file)"
>
<video
:src=
"file.url"
controls
preload=
"metadata"
width=
"200"
></video>
<div
v-else
>
</
template
>
<el-link
type=
"primary"
:href=
"form.filePath"
>
{{
form
.
fileName
}}
</el-link>
<
template
v-else
>
</div>
<el-link
type=
"primary"
:href=
"file.url"
>
{{
file
.
fileName
}}
</el-link>
</el-card>
</
template
>
</el-col>
</div>
</el-row>
<div
class=
"file-info"
>
<span
class=
"file-name"
>
{{ file.fileName }}
</span>
</layout-view>
</div>
<el-divider
style=
"width: 100%"
></el-divider>
</li>
</ul>
</el-card>
</el-col>
</el-row>
</layout-view>
</template>
</template>
<
script
>
<
script
>
import
view
from
"
@/assets/mixins/view
"
;
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
mixins
:
[
view
],
export
default
{
components
:
{
mixins
:
[
view
],
},
components
:
{},
methods
:
{
methods
:
{
afterRender
(
data
)
{
beforeRender
(
data
)
{
this
.
checkFileType
()
const
nameArrays
=
data
.
entity
.
fileName
.
split
(
'
;
'
);
},
const
pathArrays
=
data
.
entity
.
filePath
.
split
(
'
;
'
);
checkFileType
()
{
for
(
let
i
=
0
;
i
<
nameArrays
.
length
;
i
++
)
{
const
extension
=
this
.
form
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
let
obj
=
{
fileName
:
nameArrays
[
i
],
url
:
pathArrays
[
i
]}
if
([
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
].
indexOf
(
extension
)
!==
-
1
)
{
this
.
attachmentList
.
push
(
obj
)
this
.
isImage
=
true
;
}
}
else
if
([
'
mp4
'
].
indexOf
(
extension
)
!==
-
1
)
{
return
data
this
.
isVideo
=
true
},
}
checkImage
(
file
)
{
else
{
const
extension
=
file
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
this
.
isImage
=
false
;
if
([
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
].
indexOf
(
extension
)
!==
-
1
)
{
}
return
true
;
},
}
else
{
},
return
false
;
data
()
{
}
return
{
},
isImage
:
false
,
checkVideo
(
file
)
{
isVideo
:
false
,
const
extension
=
file
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
size
:
"
small
"
,
if
([
'
mp4
'
,
'
MP4
'
].
indexOf
(
extension
)
!==
-
1
)
{
column
:
2
,
return
true
toString
:[
}
else
{
"
noticetType
"
,
return
false
;
"
noticeStatus
"
,
}
"
top
"
,
},
],
},
toArrays
:
[
data
()
{
return
{
],
attachmentList
:
[],
toDate
:
[
isImage
:
false
,
isVideo
:
false
,
]
size
:
"
small
"
,
}
column
:
2
,
}
toString
:
[
"
noticetType
"
,
"
noticeStatus
"
,
"
top
"
,
],
toArrays
:
[],
toDate
:
[]
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.labelClass{
.labelClass
{
width: 200px;
width: 200px;
}
}
.el-descriptions__body{
.el-descriptions__body {
margin-left: 5px;
margin-left: 5px;
margin-right: 5px;
margin-right: 5px;
color: #606266;
color: #606266;
background-color: #FFF;
background-color: #FFF;
}
}
.contentClass{
.contentClass {
}
}
...
@@ -119,7 +139,7 @@
...
@@ -119,7 +139,7 @@
font-weight: bold;
font-weight: bold;
}
}
.el-divider{
.el-divider
{
margin: 18px 0;
margin: 18px 0;
background: 0 0;
background: 0 0;
border-top: 1px solid #E6EBF5;
border-top: 1px solid #E6EBF5;
...
...
study-manager-ui/admin/src/views/project/dialogshow.vue
View file @
3bf889bc
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
<editor
v-model=
"form.studyContent"
:min-height=
"256"
/>
<editor
v-model=
"form.studyContent"
:min-height=
"256"
/>
</Field>
</Field>
<Field
:span=
"22"
label=
"项目附件"
>
<Field
:span=
"22"
label=
"项目附件"
>
<fileUpload
v-model=
"form.filePath"
@
getFileName=
"getProjectFileName"
prePath=
"/file/fileupload"
/>
<fileUpload
v-model=
"form.filePath"
fileNumber=
"5"
prePath=
"/file/fileupload"
/>
</Field>
</Field>
</el-row>
</el-row>
...
@@ -361,10 +361,51 @@ export default {
...
@@ -361,10 +361,51 @@ export default {
this
.
open
=
false
;
this
.
open
=
false
;
},
},
/**获取数据后弹框 */
/**获取数据后弹框 */
beforeRender
(
data
)
{
//降filepath转换成数组
if
(
data
.
entity
.
fileName
===
null
||
data
.
entity
.
fileName
===
undefined
||
data
.
entity
.
fileName
===
''
){
data
.
entity
.
filePath
=
[]
return
data
}
const
nameArrays
=
data
.
entity
.
fileName
.
split
(
'
;
'
);
const
pathArrays
=
data
.
entity
.
filePath
.
split
(
'
;
'
);
let
arrs
=
[]
for
(
let
i
=
0
;
i
<
nameArrays
.
length
;
i
++
)
{
let
obj
=
{
name
:
nameArrays
[
i
],
url
:
pathArrays
[
i
]}
arrs
.
push
(
obj
)
}
data
.
entity
.
filePath
=
arrs
return
data
;
},
/**获取数据后弹框 */
afterRender
(
data
)
{
afterRender
(
data
)
{
this
.
open
=
true
;
this
.
open
=
true
;
},
},
beforeSubmit
(
data
)
{
if
(
Array
.
isArray
(
data
.
filePath
))
{
const
fileNameArray
=
data
.
filePath
.
map
((
element
,
index
)
=>
{
if
(
index
===
data
.
filePath
.
length
-
1
)
{
return
element
.
name
;
}
else
{
return
element
.
name
+
"
;
"
;
}
});
const
fileName
=
fileNameArray
.
join
(
""
)
const
filePathArray
=
data
.
filePath
.
map
((
element
,
index
)
=>
{
if
(
index
===
data
.
filePath
.
length
-
1
)
{
return
element
.
url
;
}
else
{
return
element
.
url
+
"
;
"
;
}
});
const
filePath
=
filePathArray
.
join
(
""
)
data
.
filePath
=
filePath
;
data
.
fileName
=
fileName
;
}
return
data
;
},
afterSubmit
(
data
)
{
afterSubmit
(
data
)
{
this
.
open
=
false
;
this
.
open
=
false
;
this
.
$emit
(
"
ok
"
);
this
.
$emit
(
"
ok
"
);
...
...
study-manager-ui/admin/src/views/project/study/view.vue
View file @
3bf889bc
...
@@ -36,8 +36,26 @@
...
@@ -36,8 +36,26 @@
<div
class=
"ql-editor"
v-html=
"form.studyContent"
></div>
<div
class=
"ql-editor"
v-html=
"form.studyContent"
></div>
<el-divider
style=
"width: 100%"
></el-divider>
<el-divider
style=
"width: 100%"
></el-divider>
<el-link
type=
"primary"
:href=
"form.filePath"
>
{{
form
.
fileName
}}
</el-link>
<ul
class=
"attachment-list"
>
<li
v-for=
"(file, index) in attachmentList"
:key=
"index"
>
<div
class=
"file-preview"
>
<template
v-if=
"checkImage(file)"
>
<img
:src=
"file.url"
alt=
""
/>
</
template
>
<
template
v-else-if=
"checkVideo(file)"
>
<video
:src=
"file.url"
controls
preload=
"metadata"
width=
"200"
></video>
</
template
>
<
template
v-else
>
<el-link
type=
"primary"
:href=
"file.url"
>
{{
file
.
fileName
}}
</el-link>
</
template
>
</div>
<div
class=
"file-info"
>
<span
class=
"file-name"
>
{{ file.fileName }}
</span>
</div>
<el-divider
style=
"width: 100%"
></el-divider>
</li>
</ul>
</el-card>
</el-card>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -52,10 +70,38 @@
...
@@ -52,10 +70,38 @@
components
:
{
components
:
{
},
},
methods
:
{
methods
:
{
beforeRender
(
data
)
{
const
nameArrays
=
data
.
entity
.
fileName
.
split
(
'
;
'
);
const
pathArrays
=
data
.
entity
.
filePath
.
split
(
'
;
'
);
for
(
let
i
=
0
;
i
<
nameArrays
.
length
;
i
++
)
{
let
obj
=
{
fileName
:
nameArrays
[
i
],
url
:
pathArrays
[
i
]}
this
.
attachmentList
.
push
(
obj
)
}
return
data
},
checkImage
(
file
)
{
const
extension
=
file
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
if
([
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
].
indexOf
(
extension
)
!==
-
1
)
{
return
true
;
}
else
{
return
false
;
}
},
checkVideo
(
file
)
{
const
extension
=
file
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
if
([
'
mp4
'
,
'
MP4
'
].
indexOf
(
extension
)
!==
-
1
)
{
return
true
}
else
{
return
false
;
}
},
},
},
data
()
{
data
()
{
return
{
return
{
attachmentList
:
[],
isImage
:
false
,
isVideo
:
false
,
size
:
"
small
"
,
size
:
"
small
"
,
column
:
2
,
column
:
2
,
toString
:[
toString
:[
...
...
study-manager/pom.xml
View file @
3bf889bc
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<profiles.server.port>
17300
</profiles.server.port>
<profiles.server.port>
17300
</profiles.server.port>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.gatewayport>
11078
</profiles.server.gatewayport>
<profiles.server.path>
/study
</profiles.server.path>
<profiles.server.path>
/study
</profiles.server.path>
<profiles.nacos.server-addr>
192.168.
0.5
4:8848
</profiles.nacos.server-addr>
<profiles.nacos.server-addr>
192.168.
1.10
4:8848
</profiles.nacos.server-addr>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov-cs
</profiles.nacos.namespace>
<profiles.nacos.namespace>
smart-gov-cs
</profiles.nacos.namespace>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
<profiles.log.path>
/mortals/app/logs
</profiles.log.path>
...
...
study-manager/src/main/java/com/mortals/xhx/base/system/upload/service/impl/UploadServiceImpl.java
View file @
3bf889bc
...
@@ -55,7 +55,7 @@ public class UploadServiceImpl implements UploadService {
...
@@ -55,7 +55,7 @@ public class UploadServiceImpl implements UploadService {
log
.
error
(
"文件上传大小超过限制,当前文件---"
+
tempFile
.
getSize
()
+
",允许大小----------"
+
type
.
getMaxSize
());
log
.
error
(
"文件上传大小超过限制,当前文件---"
+
tempFile
.
getSize
()
+
",允许大小----------"
+
type
.
getMaxSize
());
throw
new
AppException
(
"文件上传大小超过限制!"
);
throw
new
AppException
(
"文件上传大小超过限制!"
);
}
}
if
(
null
!=
fileName
&&
fileName
.
length
()
>
50
)
{
if
(
null
!=
fileName
&&
fileName
.
length
()
>
255
)
{
throw
new
AppException
(
"文件名称过长,无法上传!"
);
throw
new
AppException
(
"文件名称过长,无法上传!"
);
}
}
...
...
study-manager/src/main/java/com/mortals/xhx/base/system/upload/web/UploadController.java
View file @
3bf889bc
...
@@ -122,5 +122,19 @@ public class UploadController extends BaseController {
...
@@ -122,5 +122,19 @@ public class UploadController extends BaseController {
}
}
}
}
/**
* 通用文件删除
*
* @param fileName 文件名称
*/
@GetMapping
(
"fileupload/{fileName}"
)
public
void
fileDel
(
@PathVariable
(
value
=
"fileName"
)
String
fileName
,
HttpServletResponse
response
)
{
try
{
//uploadService.uploadDownload(fileName, response);
}
catch
(
Exception
e
)
{
log
.
error
(
"下载文件失败:"
,
e
);
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment