Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
1785f837
Commit
1785f837
authored
Sep 29, 2021
by
xhx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: news
parent
b7170d35
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
21 deletions
+32
-21
editorUpload.vue
src/components/Editor/editorUpload.vue
+3
-0
index.vue
src/components/Editor/index.vue
+2
-1
index.vue
src/views/Root/News/index.vue
+8
-8
publish.vue
src/views/Root/News/publish.vue
+19
-12
No files found.
src/components/Editor/editorUpload.vue
View file @
1785f837
...
...
@@ -52,6 +52,9 @@ export default Vue.extend({
this
.
imageUrl
=
newV
}
},
created
()
{
this
.
imageUrl
=
this
.
path
},
data
(){
return
{
imageUrl
:
""
,
...
...
src/components/Editor/index.vue
View file @
1785f837
...
...
@@ -47,7 +47,8 @@ export default Vue.extend({
},
extensions
:
[
StarterKit
,
Timage
],
autofocus
:
"start"
,
});
})
this
.
editor
.
commands
.
setContent
(
this
.
text
)
},
beforeDestroy
()
{
this
.
editor
.
destroy
();
...
...
src/views/Root/News/index.vue
View file @
1785f837
...
...
@@ -4,7 +4,7 @@
<!-- 搜索框 -->
<a-input
placeholder=
"标题模糊搜索"
v-model=
"searchPageReqParams.title"
style=
"width: 150px; margin-right:10px;"
/>
<!-- timepicker -->
<span
class=
" font-semibold"
>
注册
时间:
</span>
<span
class=
" font-semibold"
>
发布
时间:
</span>
<timerange
class=
" mr-3"
:startTime=
"searchPageReqParams.start_time"
:endTime=
"searchPageReqParams.end_time"
@
getNewTime=
"getNewTime"
/>
<!-- 咨询分类 -->
...
...
@@ -53,13 +53,13 @@
@
click=
"remove(record)"
>
下架
</a>
<a-divider
type=
"vertical"
/>
<a
v-show=
"record.article_status==1"
@
click=
"release(record
.uuid
, searchPageReqParams.article_type)"
>
<a-divider
v-show=
"record.article_status==1"
type=
"vertical"
/>
<a
v-show=
"record.article_status==1"
@
click=
"release(record, searchPageReqParams.article_type)"
>
编辑
</a>
<a-divider
v-show=
"record.article_status==1"
type=
"vertical"
/>
<a
@
click=
"onDelete(record)"
>
<a
v-show=
"record.article_status==1"
@
click=
"onDelete(record)"
>
删除
</a>
</span>
...
...
@@ -190,9 +190,9 @@ export default Vue.extend({
this
.
searchPageReqParams
.
end_time
=
undefined
this
.
query
()
},
release
(
key
?:
string
,
type
?:
string
){
if
(
key
&&
type
)
{
this
.
$router
.
push
({
name
:
'publishNews'
,
query
:
{
key
,
type
}})
release
(
item
?:
any
,
type
?:
string
){
if
(
item
&&
type
)
{
this
.
$router
.
push
({
name
:
'publishNews'
,
query
:
{
msg
:
JSON
.
stringify
(
item
)
,
type
}})
}
else
{
this
.
$router
.
push
({
name
:
'publishNews'
})
}
...
...
src/views/Root/News/publish.vue
View file @
1785f837
...
...
@@ -66,22 +66,26 @@ export default Vue.extend({
},
methods
:{
getDetails
()
{
// 新增
if
(
Object
.
keys
(
this
.
$route
.
query
).
length
===
0
)
{
this
.
type
=
undefined
return
}
const
type
=
this
.
$route
.
query
.
type
const
id
=
this
.
$route
.
query
.
key
as
string
this
.
type
=
+
type
if
(
+
type
===
1
)
{
news
.
searchPolicy
(
id
).
then
(
res
=>
{
this
.
initData
(
res
.
data
)
})
}
else
{
news
.
searchNews
(
id
).
then
(
res
=>
{
this
.
initData
(
res
.
data
)
})
}
const
msg
=
JSON
.
parse
(
this
.
$route
.
query
.
msg
as
string
)
this
.
initData
(
msg
)
// 编辑
// if (+type === 1) {
// news.searchPolicy(id).then(res => {
// this.initData(res.data)
// })
// } else {
// news.searchNews(id).then(res => {
// this.initData(res.data)
// })
// }
},
initData
(
res
:
any
)
{
this
.
title
=
res
.
title
...
...
@@ -90,6 +94,8 @@ export default Vue.extend({
this
.
imageUrl
=
new
FileService
().
getImageSrc
(
res
.
file_name
)
this
.
summary
=
res
.
desc
this
.
editableContent
=
res
.
content
console
.
log
(
'res'
,
res
)
console
.
log
(
'imageUrl'
,
this
.
imageUrl
)
},
getContent
(
value
:
string
){
this
.
content
=
value
...
...
@@ -115,6 +121,7 @@ export default Vue.extend({
})
},
editForm
()
{
const
msg
=
JSON
.
parse
(
this
.
$route
.
query
.
msg
as
string
)
const
params
=
{
article_type
:
this
.
type
,
content
:
this
.
content
,
...
...
@@ -122,7 +129,7 @@ export default Vue.extend({
file_name
:
this
.
imgUrl
,
title
:
this
.
title
,
writer
:
this
.
author
,
uuid
:
this
.
$route
.
query
.
key
as
string
uuid
:
msg
.
uuid
as
string
}
news
.
editArticle
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
...
...
@@ -133,7 +140,7 @@ export default Vue.extend({
},
onSubmit
()
{
console
.
log
(
this
.
content
)
if
(
this
.
$route
.
query
.
key
)
{
if
(
this
.
$route
.
query
.
msg
)
{
this
.
editForm
()
}
else
{
this
.
addForm
()
...
...
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