Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tea-resources-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
tea-resources-web
Commits
5b25d660
Commit
5b25d660
authored
Mar 26, 2024
by
王飞龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新闻资讯 中心案例修改
parent
0fd74ca6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
184 deletions
+117
-184
cmsProject.js
src/api/contentManagement/cmsProject.js
+10
-0
sysContentNewsInformation.js
src/api/contentManagement/sysContentNewsInformation.js
+10
-0
index.vue
src/views/contentManagement/centralCase/index.vue
+59
-62
index.vue
src/views/contentManagement/newsInformation/index.vue
+38
-122
No files found.
src/api/contentManagement/cmsProject.js
View file @
5b25d660
...
...
@@ -66,3 +66,13 @@ export function exportCmsProject(query) {
responseType
:
'blob'
})
}
// 修改状态
export
function
updateProjectStatus
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/cmsproject/updateStatus/'
+
businessId
,
method
:
'put'
,
data
:
data
})
}
src/api/contentManagement/sysContentNewsInformation.js
View file @
5b25d660
...
...
@@ -66,3 +66,13 @@ export function exportSysContentNewsInformation(query) {
responseType
:
'blob'
})
}
// 7. 修改新闻资讯状态
export
function
updateStatus
(
data
)
{
const
businessId
=
data
.
businessId
data
=
Qs
.
stringify
(
data
)
return
request
({
url
:
'/syscontentnewsinformation/updateStatus/'
+
businessId
,
method
:
'put'
,
data
:
data
})
}
src/views/contentManagement/centralCase/index.vue
View file @
5b25d660
...
...
@@ -38,7 +38,6 @@
</div>
</el-form>
</div>
<!--------------------------------------------------------课程功能块---------------------------------------------------->
<div
style=
"padding:5px 10px"
>
<el-table
v-loading=
"fullscreenLoading"
:data=
"tableData"
border
sortable=
"true"
>
<span
slot=
"empty"
>
{{
tableDataTips
}}
</span>
...
...
@@ -50,7 +49,9 @@
<el-table-column
align=
"center"
prop=
"title"
label=
"标题"
/>
<el-table-column
align=
"center"
label=
"封面"
prop=
"path"
>
<
template
slot-scope=
"scope"
>
<el-image
:src=
"scope.row.path"
:preview-src-list=
"scope.row.srclist"
style=
"width:100%;height:100%;"
@
mouseover=
"justEnter($event)"
@
mouseout=
"justOut($event)"
/>
<div
:id=
"step(scope.$index)"
>
<el-image
:src=
"scope.row.path"
:preview-src-list=
"scope.row.srclist"
style=
"width:100%;height:100%;"
@
click=
"handleClickStop(scope.$index)"
@
mouseover=
"justEnter($event)"
@
mouseout=
"justOut($event)"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"unit"
label=
"案例单位"
/>
...
...
@@ -70,6 +71,16 @@
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建人"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createByName
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建日期"
prop=
"createDate"
>
<
template
slot-scope=
"scope"
>
<span>
{{
replace
(
scope
.
row
.
createDate
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
>
<
template
slot-scope=
"scope"
>
...
...
@@ -94,7 +105,8 @@
<
script
>
import
commonField
from
'@/utils/commonField'
import
{
delCmsProject
,
listCmsProject
}
from
'@/api/contentManagement/cmsProject'
import
{
updateProjectStatus
,
delCmsProject
,
listCmsProject
}
from
'@/api/contentManagement/cmsProject'
import
{
parseTime
}
from
'@/utils'
export
default
{
name
:
'Index'
,
// components: {
...
...
@@ -176,6 +188,32 @@ export default {
this
.
loadData
()
},
methods
:
{
step
(
index
)
{
return
'step'
+
index
},
/**
* @description: 点击蒙版关闭预览图片
* @author: gaoyu
* @param: imageId
* @return:
**/
handleClickStop
(
imageId
)
{
this
.
$nextTick
(()
=>
{
var
domImageView
=
document
.
querySelector
(
`#
${
this
.
step
(
imageId
)}
.el-image-viewer__mask`
)
if
(
!
domImageView
)
{
return
}
var
closeButton
=
document
.
querySelector
(
`#
${
this
.
step
(
imageId
)}
.el-image-viewer__close`
)
domImageView
.
addEventListener
(
'click'
,
()
=>
{
closeButton
.
click
()
})
})
},
// 日期格式转换
replace
(
time
)
{
return
parseTime
(
time
,
'{y}/{m}/{d}'
)
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
=
{
...
...
@@ -287,66 +325,25 @@ export default {
)
}
},
// test
picturecover
(
index
,
row
)
{
// alert(index);
this
.
dialogVisible
=
true
this
.
lineindex
=
index
this
.
teacode
=
this
.
tableData
[
index
].
tcode
},
// confirm image
confirm
()
{
const
_this
=
this
const
cover
=
this
.
filelist
[
0
]
const
fileType
=
cover
.
name
.
substring
(
cover
.
name
.
lastIndexOf
(
'.'
)
+
1
)
if
(
cover
==
'undefined'
||
cover
==
null
)
{
_this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件不能为空'
,
type
:
'warning'
})
}
else
if
(
fileType
!==
'jpg'
&&
fileType
!==
'png'
)
{
_this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件只能为.jpg格式/.png格式'
,
type
:
'warning'
})
}
else
{
_this
.
fullscreenLoading
=
true
_this
.
eduUtil
.
ajaxPostUtil
(
'BLesson/picImport'
,
{
importFile
:
cover
,
code
:
_this
.
teacode
},
res
=>
{
_this
.
fullscreenLoading
=
false
_this
.
dialogVisible
=
false
let
type
=
res
.
code
const
message
=
res
.
message
type
=
(
type
==
200
)
?
'success'
:
'error'
_this
.
$notify
({
title
:
'成功'
,
message
:
message
,
type
:
type
})
_this
.
loadData
()
_this
.
filelist
=
[]
},
err
=>
{
_this
.
fullscreenLoading
=
false
console
.
log
(
err
)
})
// 修改状态
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
const
params
=
{
businessId
:
row
.
businessId
,
flag
:
row
.
flag
}
},
beforeUpload
(
file
)
{
// console.log(file);
// this.filelist = [];
this
.
filelist
.
push
(
file
)
},
uploadCustom
()
{
const
cover
=
this
.
filelist
[
0
]
}
,
removeCover
(
file
,
fileList
)
{
const
cover
=
null
this
.
filelist
=
[]
this
.
$confirm
(
'是否确认操作?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
updateProjectStatus
(
params
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
})
},
/** 新增按钮操作 */
handleAdd
()
{
...
...
src/views/contentManagement/newsInformation/index.vue
View file @
5b25d660
...
...
@@ -37,9 +37,7 @@
</el-form-item>
</div>
</el-form>
</div>
<!--------------------------------------------------------课程功能块---------------------------------------------------->
<div
style=
"padding:5px 10px"
>
</div><div
style=
"padding:5px 10px"
>
<el-table
v-loading=
"fullscreenLoading"
:data=
"tableData"
border
sortable=
"true"
>
<span
slot=
"empty"
>
{{
tableDataTips
}}
</span>
<el-table-column
align=
"center"
prop=
"id"
label=
"序号"
width=
"55px"
>
...
...
@@ -51,13 +49,13 @@
<el-table-column
align=
"center"
label=
"封面"
prop=
"pictureId"
>
<
template
slot-scope=
"scope"
>
<div
:id=
"step(scope.$index)"
>
<el-image
@
click=
"handleClickStop(scope.$index)"
:src=
"scope.row.pictureId"
:preview-src-list=
"scope.row.srclist"
style=
"width:100%;height:100%;"
@
mouseover=
"justEnter($event)"
@
mouseout=
"justOut($event)"
/>
<el-image
:src=
"scope.row.pictureId"
:preview-src-list=
"scope.row.srclist"
style=
"width:100%;height:100%;"
@
click=
"handleClickStop(scope.$index)"
@
mouseover=
"justEnter($event)"
@
mouseout=
"justOut($event)"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
prop=
"releaseDate"
label=
"发布日期"
>
<
template
slot-scope=
"scope"
>
<span
style=
"max-width: 150px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap"
:title=
"scope.row.releaseDate"
>
{{
scope
.
row
.
releaseDate
}}
</span>
<span>
{{
scope
.
row
.
releaseDate
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"排序"
prop=
"weight"
>
...
...
@@ -81,6 +79,16 @@
/>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建人"
prop=
"createBy"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
nickName
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"创建日期"
prop=
"createDate"
>
<
template
slot-scope=
"scope"
>
<span>
{{
replace
(
scope
.
row
.
createDate
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
...
...
@@ -107,8 +115,10 @@
import
commonField
from
'@/utils/commonField'
import
{
delSysContentNewsInformation
,
listSysContentNewsInformation
listSysContentNewsInformation
,
updateStatus
,
}
from
'@/api/contentManagement/sysContentNewsInformation'
import
{
error
}
from
'autoprefixer/lib/utils'
import
{
parseTime
}
from
'@/utils'
export
default
{
name
:
'Index'
,
// components: {
...
...
@@ -211,6 +221,11 @@ export default {
})
})
},
// 日期格式转换
replace
(
time
)
{
return
parseTime
(
time
,
'{y}/{m}/{d}'
)
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
=
{
...
...
@@ -251,125 +266,26 @@ export default {
})
_this
.
dataIsReady
=
true
_this
.
uploadList
.
fm
=
this
.
interfaceUrl
+
'BLesson/picImport'
_this
.
getCourseDirection
()
},
// 上传
importmould
()
{
document
.
getElementById
(
'btn_file'
).
click
()
},
fileupload
()
{
const
_this
=
this
this
.
fullscreenLoading
=
true
const
dom
=
document
.
getElementById
(
'btn_file'
)
const
fileSize
=
dom
.
files
[
0
].
size
// 文件的大小,单位为字节B
if
(
fileSize
>
5
*
1024
*
1024
)
{
this
.
fullscreenLoading
=
false
this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件大小不能超过5M'
,
type
:
'warning'
})
return
false
}
// 获取欲上传的文件路径
const
filePath
=
dom
.
value
const
suf
=
filePath
.
split
(
'.'
)[
filePath
.
split
(
'.'
).
length
-
1
]
if
(
suf
!==
'xls'
&&
suf
!==
'xlsx'
)
{
this
.
$notify
({
title
:
'提示'
,
message
:
'只能上传.xls/.xlsx格式的文件'
,
type
:
'warning'
})
dom
.
value
=
''
_this
.
fullscreenLoading
=
false
}
else
{
_this
.
eduUtil
.
ajaxPostUtil
(
'BLesson/excelImport'
,
{
importFile
:
dom
.
files
[
0
]
},
function
(
res
)
{
console
.
log
(
res
)
dom
.
value
=
''
_this
.
fullscreenLoading
=
false
if
(
res
.
code
===
200
)
{
_this
.
$notify
({
title
:
'成功'
,
message
:
res
.
message
,
type
:
'success'
})
_this
.
loadData
()
}
else
{
_this
.
$notify
({
title
:
'失败'
,
message
:
res
.
message
,
type
:
'error'
})
}
},
function
(
err
)
{
dom
.
value
=
''
_this
.
$notify
({
title
:
'失败'
,
message
:
err
.
message
,
type
:
'error'
})
_this
.
fullscreenLoading
=
false
}
)
// 修改状态
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
const
params
=
{
businessId
:
row
.
businessId
,
flag
:
row
.
flag
}
},
// test
picturecover
(
index
,
row
)
{
// alert(index);
this
.
dialogVisible
=
true
this
.
lineindex
=
index
this
.
teacode
=
this
.
tableData
[
index
].
tcode
},
// confirm image
confirm
()
{
const
_this
=
this
const
cover
=
this
.
filelist
[
0
]
const
fileType
=
cover
.
name
.
substring
(
cover
.
name
.
lastIndexOf
(
'.'
)
+
1
)
if
(
cover
==
'undefined'
||
cover
==
null
)
{
_this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件不能为空'
,
type
:
'warning'
})
}
else
if
(
fileType
!==
'jpg'
&&
fileType
!==
'png'
)
{
_this
.
$notify
({
title
:
'提示'
,
message
:
'上传文件只能为.jpg格式/.png格式'
,
type
:
'warning'
})
}
else
{
_this
.
fullscreenLoading
=
true
_this
.
eduUtil
.
ajaxPostUtil
(
'BLesson/picImport'
,
{
importFile
:
cover
,
code
:
_this
.
teacode
},
res
=>
{
_this
.
fullscreenLoading
=
false
_this
.
dialogVisible
=
false
let
type
=
res
.
code
const
message
=
res
.
message
type
=
(
type
==
200
)
?
'success'
:
'error'
_this
.
$notify
({
title
:
'成功'
,
message
:
message
,
type
:
type
})
_this
.
loadData
()
_this
.
filelist
=
[]
},
err
=>
{
_this
.
fullscreenLoading
=
false
console
.
log
(
err
)
this
.
$confirm
(
'是否确认操作?'
,
'警告'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
updateStatus
(
params
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}
}
)
},
beforeUpload
(
file
)
{
// console.log(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