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
Show 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
...
@@ -47,6 +47,8 @@ export default {
...
@@ -47,6 +47,8 @@ export default {
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
>
>
...
@@ -99,11 +99,35 @@ export default {
...
@@ -99,11 +99,35 @@ 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
()
{
...
@@ -113,20 +137,17 @@ export default {
...
@@ -113,20 +137,17 @@ export default {
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
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"90%"
append-to-body
>
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"90%"
append-to-body
>
<el-dialog
<el-dialog
width=
"30%"
width=
"30%"
title=
"选择部门"
title=
"选择部门"
...
@@ -114,7 +113,6 @@
...
@@ -114,7 +113,6 @@
</el-dialog>
</el-dialog>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-row>
<el-row>
<Field
:span=
"22"
label=
"标题"
prop=
"title"
v-model=
"form.title"
placeholder=
"请输入标题"
/>
<Field
:span=
"22"
label=
"标题"
prop=
"title"
v-model=
"form.title"
placeholder=
"请输入标题"
/>
...
@@ -132,8 +130,12 @@
...
@@ -132,8 +130,12 @@
<Field
:span=
"22"
label=
"是否置顶"
prop=
"top"
v-model=
"form.top"
type=
"radio"
:enumData=
"dict.top"
placeholder=
"请选择是否置顶"
/>
<Field
:span=
"22"
label=
"是否置顶"
prop=
"top"
v-model=
"form.top"
type=
"radio"
:enumData=
"dict.top"
placeholder=
"请选择是否置顶"
/>
<Field
:span=
"22"
label=
"已读要求"
prop=
"readRequest"
v-model=
"form.readRequest"
type=
"radio"
:enumData=
"dict.readRequest"
placeholder=
"请选择已读要求"
/>
<Field
:span=
"22"
label=
"已读要求"
prop=
"readRequest"
v-model=
"form.readRequest"
type=
"radio"
:enumData=
"dict.readRequest"
placeholder=
"请选择已读要求"
/>
<Field
:span=
"22"
label=
"公告内容"
><editor
v-model=
"form.noticeContent"
:min-height=
"512"
/></Field>
<Field
:span=
"22"
label=
"公告内容"
>
<Field
:span=
"22"
label=
"公告文件路径"
><fileUpload
v-model=
"form.filePath"
@
getFileName=
"getNoticeFileName"
prePath=
"/file/fileupload"
/></Field>
<editor
v-model=
"form.noticeContent"
:min-height=
"512"
/>
</Field>
<Field
:span=
"22"
label=
"公告文件路径"
>
<fileUpload
v-model=
"form.filePath"
fileNumber=
"5"
prePath=
"/file/fileupload"
/>
</Field>
</el-row>
</el-row>
...
@@ -146,14 +148,15 @@
...
@@ -146,14 +148,15 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
form
from
"
@/assets/mixins/formdialog
"
;
import
form
from
"
@/assets/mixins/formdialog
"
;
import
dialogShow
from
"
./dialogshow
"
;
import
dialogShow
from
"
./dialogshow
"
;
import
FileUpload
from
'
@/components/FileUpload
'
;
import
FileUpload
from
'
@/components/FileUpload
'
;
import
Editor
from
'
@/components/Editor
'
;
import
Editor
from
'
@/components/Editor
'
;
export
default
{
export
default
{
mixins
:
[
form
],
mixins
:
[
form
],
components
:
{
components
:
{
dialogShow
,
dialogShow
,
FileUpload
,
FileUpload
,
Editor
,
Editor
,
},
},
...
@@ -161,8 +164,8 @@
...
@@ -161,8 +164,8 @@
return
{
return
{
node
:
{},
node
:
{},
data
:
[],
data
:
[],
deptIds
:
[],
deptIds
:
[],
personIds
:
[],
personIds
:
[],
personPageInfoData
:
[],
personPageInfoData
:
[],
deptChecked
:
[],
deptChecked
:
[],
tree
:
[],
tree
:
[],
...
@@ -186,7 +189,7 @@
...
@@ -186,7 +189,7 @@
title
:
"
学习公告
"
,
title
:
"
学习公告
"
,
// 是否显示弹出层
// 是否显示弹出层
open
:
false
,
open
:
false
,
toString
:
[
toString
:
[
"
noticeType
"
,
"
noticeType
"
,
"
pubDeptId
"
,
"
pubDeptId
"
,
"
viewPersion
"
,
"
viewPersion
"
,
...
@@ -196,23 +199,20 @@
...
@@ -196,23 +199,20 @@
// 表单校验
// 表单校验
rules
:
{
rules
:
{
title
:
[
title
:
[
{
required
:
true
,
message
:
"
请输入标题
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入标题
"
,
trigger
:
"
blur
"
},
{
max
:
256
,
message
:
"
最多只能录入256个字符
"
,
trigger
:
"
blur
"
,},
{
max
:
256
,
message
:
"
最多只能录入256个字符
"
,
trigger
:
"
blur
"
,},
],
],
viewPersion
:
[
viewPersion
:
[
{
required
:
true
,
message
:
"
请输入查看人员
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入查看人员
"
,
trigger
:
"
blur
"
},
],
],
top
:
[
top
:
[
{
required
:
true
,
message
:
"
请输入是否置顶
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入是否置顶
"
,
trigger
:
"
blur
"
},
],
],
}
}
};
};
},
},
methods
:
{
methods
:
{
getNoticeFileName
(
fileName
)
{
this
.
form
.
fileName
=
fileName
;
},
searchConfirm
()
{
searchConfirm
()
{
this
.
getPersonList
({
'
userType
'
:
2
});
this
.
getPersonList
({
'
userType
'
:
2
});
},
},
...
@@ -220,8 +220,6 @@
...
@@ -220,8 +220,6 @@
personSearchClear
()
{
personSearchClear
()
{
this
.
searchform
=
{
'
userType
'
:
2
};
this
.
searchform
=
{
'
userType
'
:
2
};
},
},
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
//判断是否选中
//判断是否选中
console
.
log
(
"
selected
"
,
val
);
console
.
log
(
"
selected
"
,
val
);
...
@@ -327,10 +325,10 @@
...
@@ -327,10 +325,10 @@
/** 编辑 */
/** 编辑 */
edit
(
row
)
{
edit
(
row
)
{
this
.
reset
()
this
.
reset
()
this
.
query
=
{
id
:
row
.
id
};
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
notice/edit
"
;
this
.
urls
.
currUrl
=
"
notice/edit
"
;
this
.
getData
();
this
.
getData
();
this
.
pageInfo
.
type
=
"
edit
"
this
.
pageInfo
.
type
=
"
edit
"
this
.
title
=
"
修改学习公告
"
;
this
.
title
=
"
修改学习公告
"
;
},
},
/** 新增 */
/** 新增 */
...
@@ -338,27 +336,70 @@
...
@@ -338,27 +336,70 @@
this
.
reset
()
this
.
reset
()
this
.
urls
.
currUrl
=
"
notice/add
"
;
this
.
urls
.
currUrl
=
"
notice/add
"
;
this
.
getData
();
this
.
getData
();
this
.
pageInfo
.
type
=
"
add
"
this
.
pageInfo
.
type
=
"
add
"
this
.
title
=
"
新增学习公告
"
;
this
.
title
=
"
新增学习公告
"
;
},
},
/** 查看*/
/** 查看*/
view
(
row
)
{
view
(
row
)
{
this
.
reset
()
this
.
reset
()
this
.
query
=
{
id
:
row
.
id
};
this
.
query
=
{
id
:
row
.
id
};
this
.
urls
.
currUrl
=
"
notice/view
"
;
this
.
urls
.
currUrl
=
"
notice/view
"
;
this
.
getData
();
this
.
getData
();
this
.
pageInfo
.
type
=
"
view
"
this
.
pageInfo
.
type
=
"
view
"
this
.
title
=
"
学习公告详细
"
;
this
.
title
=
"
学习公告详细
"
;
},
},
/**取消按钮 */
/**取消按钮 */
cancel
()
{
cancel
()
{
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
"
);
...
@@ -367,17 +408,17 @@
...
@@ -367,17 +408,17 @@
// 表单重置
// 表单重置
reset
()
{
reset
()
{
this
.
form
=
{
this
.
form
=
{
title
:
""
,
title
:
""
,
noticeType
:
0
,
noticeType
:
0
,
pubDeptId
:
null
,
pubDeptId
:
null
,
pubDeptName
:
""
,
pubDeptName
:
""
,
viewPersion
:
0
,
viewPersion
:
0
,
top
:
0
,
top
:
0
,
readRequest
:
0
,
readRequest
:
0
,
noticeContent
:
""
,
noticeContent
:
""
,
filePath
:
""
,
filePath
:
[]
,
fileName
:
""
,
fileName
:
""
,
remark
:
""
,
remark
:
""
,
};
};
this
.
resetForm
(
"
form
"
);
this
.
resetForm
(
"
form
"
);
},
},
...
@@ -387,5 +428,5 @@
...
@@ -387,5 +428,5 @@
}
}
},
},
},
},
};
};
</
script
>
</
script
>
study-manager-ui/admin/src/views/notice/study/view.vue
View file @
3bf889bc
...
@@ -5,21 +5,21 @@
...
@@ -5,21 +5,21 @@
<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>
...
@@ -28,19 +28,29 @@
...
@@ -28,19 +28,29 @@
<el-divider
style=
"width: 100%"
></el-divider>
<el-divider
style=
"width: 100%"
></el-divider>
<div
v-if=
"isImage"
>
<img
:src=
"form.filePath"
alt=
"图片描述"
>
</div>
<div
v-else-if=
"isVideo"
>
<ul
class=
"attachment-list"
>
<video
id=
"myVideo"
controls
>
<li
v-for=
"(file, index) in attachmentList"
:key=
"index"
>
<source
:src=
"form.filePath"
type=
"video/mp4"
>
</video>
</div>
<div
v-else
>
<div
class=
"file-preview"
>
<el-link
type=
"primary"
:href=
"form.filePath"
>
{{
form
.
fileName
}}
</el-link>
<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>
</div>
<el-divider
style=
"width: 100%"
></el-divider>
</li>
</ul>
</el-card>
</el-card>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -49,59 +59,69 @@
...
@@ -49,59 +59,69 @@
</template>
</template>
<
script
>
<
script
>
import
view
from
"
@/assets/mixins/view
"
;
import
view
from
"
@/assets/mixins/view
"
;
export
default
{
export
default
{
mixins
:
[
view
],
mixins
:
[
view
],
components
:
{
components
:
{},
},
methods
:
{
methods
:
{
afterRender
(
data
)
{
beforeRender
(
data
)
{
this
.
checkFileType
()
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
},
},
checkFileType
(
)
{
checkImage
(
file
)
{
const
extension
=
this
.
form
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
const
extension
=
file
.
fileName
.
split
(
'
.
'
).
pop
().
toLowerCase
();
if
([
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
].
indexOf
(
extension
)
!==
-
1
)
{
if
([
'
jpg
'
,
'
jpeg
'
,
'
png
'
,
'
gif
'
].
indexOf
(
extension
)
!==
-
1
)
{
this
.
isImage
=
true
;
return
true
;
}
else
if
([
'
mp4
'
].
indexOf
(
extension
)
!==
-
1
)
{
}
else
{
this
.
isVideo
=
true
return
false
;
}
}
else
{
},
this
.
isImage
=
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
,
isImage
:
false
,
isVideo
:
false
,
isVideo
:
false
,
size
:
"
small
"
,
size
:
"
small
"
,
column
:
2
,
column
:
2
,
toString
:
[
toString
:
[
"
noticetType
"
,
"
noticetType
"
,
"
noticeStatus
"
,
"
noticeStatus
"
,
"
top
"
,
"
top
"
,
],
],
toArrays
:
[
toArrays
:
[],
toDate
:
[]
],
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