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
e9461eaa
Commit
e9461eaa
authored
Sep 23, 2021
by
lshan
Browse files
Options
Browse Files
Download
Plain Diff
上下架,删除,查询,增加
parents
0ec44ead
ea5e0099
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1063 additions
and
249 deletions
+1063
-249
ImageModal.vue
src/components/Editor/ImageModal.vue
+5
-2
editorUpload.vue
src/components/Editor/editorUpload.vue
+1
-2
index.vue
src/components/Editor/index.vue
+1
-2
index.vue
src/components/TimePicker/index.vue
+1
-1
chatColumns.ts
src/const/columns/chatColumns.ts
+12
-6
msgColumns.ts
src/const/columns/msgColumns.ts
+6
-3
newsColunms.ts
src/const/columns/newsColunms.ts
+7
-4
outletColumns.ts
src/const/columns/outletColumns.ts
+22
-15
index.ts
src/filter/index.ts
+21
-8
main.ts
src/main.ts
+1
-0
chat.ts
src/mock/chat.ts
+4
-3
index.ts
src/service/AddressService/index.ts
+37
-2
types.ts
src/service/AddressService/types.ts
+11
-0
index.ts
src/service/FAQService/index.ts
+6
-3
index.ts
src/service/LoanProductService/index.ts
+13
-13
index.ts
src/service/News/index.ts
+209
-0
index.ts
src/service/Notify/index.ts
+97
-0
type.ts
src/store/LoanProductManagement/type.ts
+7
-7
index.ts
src/utils/days/index.ts
+1
-1
transfer.ts
src/utils/time/transfer.ts
+34
-1
index.vue
src/views/Root/Chat/index.vue
+111
-68
index.vue
src/views/Root/Msg/index.vue
+160
-37
detail.vue
src/views/Root/News/detail.vue
+35
-7
index.vue
src/views/Root/News/index.vue
+146
-35
publish.vue
src/views/Root/News/publish.vue
+93
-8
index.vue
src/views/Root/OutletManagement/index.vue
+0
-0
publish.vue
src/views/Root/Product/Loan/publish.vue
+22
-21
No files found.
src/components/Editor/ImageModal.vue
View file @
e9461eaa
...
...
@@ -45,6 +45,7 @@
import
Vue
,
{
PropType
}
from
'vue'
import
vue2Dropzone
from
'vue2-dropzone'
import
'vue2-dropzone/dist/vue2Dropzone.min.css'
import
FileService
from
'@/service/FileService/index'
import
{
Editor
}
from
'@tiptap/vue-2'
export
default
Vue
.
extend
({
...
...
@@ -60,10 +61,11 @@ export default Vue.extend({
confirmLoading
:
false
,
imageSrc
:
''
,
dropzoneOptions
:
{
url
:
'/
api
/upload'
,
url
:
'/
proxyApi/api/v1/image
/upload'
,
thumbnailWidth
:
200
,
maxFilesize
:
200
,
dictDefaultMessage
:
'拖动/选择文件上传图片(200M以内)'
,
paramName
:
'uploadFile'
},
tab
:
1
,
}
...
...
@@ -79,7 +81,8 @@ export default Vue.extend({
showModal
()
{
this
.
visible
=
true
},
vfileUploaded
(
file
:
File
|
Blob
)
{
vfileUploaded
(
file
:
File
|
Blob
,
res
:
{
data
:
string
})
{
this
.
imageSrc
=
new
FileService
().
getImageSrc
(
res
.
data
)
/** Here is where you get your URL/Base64 string or what ever.*/
},
cursorToEnd
(){
...
...
src/components/Editor/editorUpload.vue
View file @
e9461eaa
...
...
@@ -105,4 +105,4 @@ export default Vue.extend({
margin-top
:
8px
;
color
:
#666
;
}
</
style
>
\ No newline at end of file
</
style
>
src/components/Editor/index.vue
View file @
e9461eaa
...
...
@@ -73,4 +73,4 @@ export default Vue.extend({
height
:
0
;
font-style
:
italic
;
}
</
style
>
\ No newline at end of file
</
style
>
src/components/TimePicker/index.vue
View file @
e9461eaa
...
...
@@ -39,7 +39,7 @@ export default Vue.extend({
startTime
=
firstM
.
_d
.
getTime
()
endTime
=
secondM
.
_d
.
getTime
()
}
console
.
log
(
startTime
)
this
.
$emit
(
'getNewTime'
,
startTime
,
endTime
)
},
}
...
...
src/const/columns/chatColumns.ts
View file @
e9461eaa
...
...
@@ -4,22 +4,28 @@ const columns:Array<column>=
{
title
:
'发布时间'
,
align
:
'center'
,
dataIndex
:
'time'
,
dataIndex
:
'created_at'
,
scopedSlots
:{
customRender
:
'created_at'
}
},
{
title
:
'
类型
'
,
title
:
'
问题
'
,
align
:
'center'
,
dataIndex
:
'
type
'
,
dataIndex
:
'
question
'
,
},
{
title
:
'
内容
'
,
title
:
'
回复
'
,
align
:
'center'
,
dataIndex
:
'
content
'
,
dataIndex
:
'
answer
'
,
},
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'state'
,
dataIndex
:
'faq_status'
,
scopedSlots
:
{
customRender
:
'faq_status'
,
}
},
{
title
:
'操作'
,
...
...
src/const/columns/msgColumns.ts
View file @
e9461eaa
...
...
@@ -4,7 +4,8 @@ const columns:Array<column>=
{
title
:
'发布时间'
,
align
:
'center'
,
dataIndex
:
'time'
dataIndex
:
'time'
,
scopedSlots
:
{
customRender
:
'time'
},
},
{
title
:
'消息标题'
,
...
...
@@ -20,12 +21,14 @@ const columns:Array<column>=
{
title
:
'显示类型'
,
align
:
'center'
,
dataIndex
:
'type'
dataIndex
:
'type'
,
scopedSlots
:
{
customRender
:
'type'
},
},
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'state'
dataIndex
:
'state'
,
scopedSlots
:
{
customRender
:
'status'
},
},
{
title
:
'操作'
,
...
...
src/const/columns/newsColunms.ts
View file @
e9461eaa
...
...
@@ -3,7 +3,8 @@ const columns:Array<column>=[
{
title
:
'发布时间'
,
align
:
'center'
,
dataIndex
:
'time'
,
dataIndex
:
'created_at'
,
scopedSlots
:
{
customRender
:
'created_at'
},
},
{
title
:
'资讯标题'
,
...
...
@@ -13,12 +14,13 @@ const columns:Array<column>=[
{
title
:
'咨询分类'
,
align
:
'center'
,
dataIndex
:
'type'
,
dataIndex
:
'article_type'
,
scopedSlots
:
{
customRender
:
'type'
},
},
{
title
:
'作者名称'
,
align
:
'center'
,
dataIndex
:
'
autho
r'
,
dataIndex
:
'
write
r'
,
},
{
title
:
'新闻内容'
,
...
...
@@ -29,7 +31,8 @@ const columns:Array<column>=[
{
title
:
'状态'
,
align
:
'center'
,
dataIndex
:
'state'
,
dataIndex
:
'article_status'
,
scopedSlots
:
{
customRender
:
'status'
},
},
{
title
:
'操作'
,
...
...
src/const/columns/outletColumns.ts
View file @
e9461eaa
export
default
[
{
title
:
'创建日期'
,
align
:
'center'
,
dataIndex
:
'time'
,
},
{
title
:
'所属一级分行'
,
align
:
'center'
,
dataIndex
:
'
title
'
,
dataIndex
:
'
first_branch
'
,
},
{
title
:
'所属二级分行'
,
align
:
'center'
,
dataIndex
:
'content'
,
scopedSlots
:
{
customRender
:
'content'
},
dataIndex
:
'second_branch'
,
},
{
title
:
'所属一级支行'
,
align
:
'center'
,
dataIndex
:
'
state
'
,
dataIndex
:
'
first_sub_branch
'
,
},
{
title
:
'所属二级支行'
,
align
:
'center'
,
dataIndex
:
'
action
'
,
dataIndex
:
'
second_sub_branch
'
,
},
{
title
:
'详细地址'
,
align
:
'center'
,
dataIndex
:
'action'
,
dataIndex
:
'location'
,
},
{
title
:
'经度'
,
align
:
'center'
,
dataIndex
:
'longitude'
,
},
{
title
:
'纬度'
,
align
:
'center'
,
dataIndex
:
'latitude'
,
},
{
title
:
'是否营业'
,
align
:
'center'
,
dataIndex
:
'action'
,
dataIndex
:
'is_normal_work'
,
scopedSlots
:
{
customRender
:
'is_normal_work'
},
},
{
title
:
'营业时间'
,
align
:
'center'
,
dataIndex
:
'action'
,
dataIndex
:
'opening_hours'
,
scopedSlots
:
{
customRender
:
'opening_hours'
},
},
{
title
:
'
备注
'
,
title
:
'
不营业原因
'
,
align
:
'center'
,
dataIndex
:
'action'
,
dataIndex
:
'note'
,
scopedSlots
:
{
customRender
:
'note'
},
},
{
title
:
'操作'
,
...
...
src/filter/index.ts
View file @
e9461eaa
...
...
@@ -3,6 +3,7 @@ import { eUserStatus } from '@/types/user'
import
{
editableProductStatus
,
eGuaranteeType
,
eProductType
}
from
'@/types/loanProduct'
// import { activityStatus } from "@/service/ActivityService/type"
import
moment
from
'moment'
import
{
activityStatus
}
from
'@/service/ActivityService/type'
export
default
{
formatDate
(
timeStamp
:
number
)
{
...
...
@@ -87,14 +88,26 @@ export default {
return
'已发布热门'
}
},
// filterActivitytatus(status:activityStatus) {
// switch (status) {
// case activityStatus.editable:
// return '待发布'
// case activityStatus.published:
// return '已发布'
// }
// },
filterActivitytatus
(
status
:
activityStatus
)
{
switch
(
status
)
{
case
activityStatus
.
editable
:
return
'待发布'
case
activityStatus
.
published
:
return
'已发布'
}
},
filterWorkDay
(
weekend_status
:
number
){
const
silly
=
'周一至周五'
if
(
weekend_status
===
0
){
return
silly
;
}
else
if
(
weekend_status
===
1
){
return
silly
+
', 周六'
}
else
if
(
weekend_status
===
2
){
return
silly
+
', 周日'
}
else
if
(
weekend_status
===
3
){
return
'周一至周日'
}
}
}
as
{
[
key
:
string
]:
(...
args
:
any
)
=>
any
}
src/main.ts
View file @
e9461eaa
...
...
@@ -6,6 +6,7 @@ import 'ant-design-vue/dist/antd.css'
import
'tailwindcss/tailwind.css'
import
'element-ui/lib/theme-chalk/index.css'
import
filter
from
'./filter'
import
moment
from
'moment'
Vue
.
config
.
productionTip
=
false
...
...
src/mock/chat.ts
View file @
e9461eaa
...
...
@@ -11,14 +11,14 @@ export const chatList:Array<chat>=[
{
key
:
2
,
time
:
'2020-09-21'
,
type
:
'常用
语
'
,
type
:
'常用
问题
'
,
content
:
'没什么可以帮我'
,
state
:
'已发布'
},
{
key
:
3
,
time
:
'2020-09-21'
,
type
:
'常用
语
'
,
type
:
'常用
问题
'
,
content
:
'你们最近的网点在哪里'
,
state
:
'已下架'
},
...
...
@@ -28,5 +28,6 @@ export const chatList:Array<chat>=[
type
:
'自动回复'
,
content
:
'您好?我们是中小企业协会综合服务平台'
,
state
:
'已下架'
}
},
]
src/service/AddressService/index.ts
View file @
e9461eaa
import
baseAxios
from
'../index'
import
{
iOutLetDetail
}
from
'./types'
export
default
class
AddressService
{
prefix
:
string
pr
ivate
pr
efix
:
string
static
instance
:
AddressService
max_len_gps
:
number
private
max_len_gps
:
number
static
getInstance
()
{
if
(
!
AddressService
.
instance
)
{
AddressService
.
instance
=
new
AddressService
()
...
...
@@ -55,4 +56,38 @@ export default class AddressService {
})
}
}
getOutlet
(
data
:
{
outlet_name
:
string
})
{
return
baseAxios
<
iOutLetDetail
>
({
url
:
'/address/getOutlet'
,
method
:
'post'
,
data
,
})
}
note
(
id
:
number
)
{
return
baseAxios
({
url
:
'/address/note'
,
method
:
'post'
,
data
:
{
id
,
},
})
}
update
(
data
:
{
id
:
number
is_normal_work
:
boolean
lat_lon
:
string
location
:
string
note
:
string
opening_hours
:
string
weekend_status
:
number
})
{
return
baseAxios
({
url
:
'/address/update'
,
method
:
'post'
,
data
,
})
}
}
src/service/AddressService/types.ts
0 → 100644
View file @
e9461eaa
export
interface
iOutLetDetail
{
id
:
number
city_name
:
string
is_normal_work
:
boolean
latitude
:
string
location
:
string
longitude
:
string
opening_hours
:
string
outlet_name
:
string
region_name
:
string
}
src/service/FAQService/index.ts
View file @
e9461eaa
...
...
@@ -16,10 +16,12 @@ export default class FAQService {
data
,
})
}
DeleteQueAns
(
data
:{
question
:
string
}){
DeleteQueAns
(
data
:{
id
:
string
}){
return
baseAxios
({
url
:
'faq/admin/
add
'
,
url
:
'faq/admin/
delete
'
,
method
:
'DELETE'
,
// data
params
:
data
,
})
}
CheckQueAnsList
(
data
:{
...
...
@@ -31,7 +33,8 @@ export default class FAQService {
}){
return
baseAxios
({
url
:
'faq/admin/list'
,
method
:
'POST'
method
:
'POST'
,
data
})
}
ModifyQueAns
(
data
:{
faq_status
:
eAQRStatus
,
id
:
number
}){
...
...
src/service/LoanProductService/index.ts
View file @
e9461eaa
...
...
@@ -20,15 +20,15 @@ export default class LoanProductService {
guarantee_type
:
eGuaranteeType
inst_name
:
string
loan_type
:
eProductType
max_amount
:
string
max_date
:
string
max_amount
:
number
max_date
:
number
product_name
:
string
products
:
string
rate_lower
:
string
rate_upper
:
string
rate_lower
:
number
rate_upper
:
number
submit_cond
:
string
min_date
:
string
min_amount
:
string
min_date
:
number
min_amount
:
number
}
)
{
return
baseAxios
({
...
...
@@ -45,16 +45,16 @@ export default class LoanProductService {
features
:
string
guarantee_type
:
eGuaranteeType
inst_name
:
string
product
_type
:
eProductType
max_amount
:
string
max_date
:
string
loan
_type
:
eProductType
max_amount
:
number
max_date
:
number
product_name
:
string
products
:
string
rate_lower
:
string
rate_upper
:
string
rate_lower
:
number
rate_upper
:
number
submit_cond
:
string
min_amount
:
string
min_date
:
string
min_amount
:
number
min_date
:
number
uuid
:
string
}
)
{
...
...
src/service/News/index.ts
0 → 100644
View file @
e9461eaa
import
baseAxios
from
'../index'
export
default
class
NewsService
{
static
instance
:
NewsService
static
getInstance
()
{
if
(
!
NewsService
.
instance
)
{
NewsService
.
instance
=
new
NewsService
()
}
return
NewsService
.
instance
}
/**
* 新增资讯
* @param data
* @returns
*/
addArticle
(
data
:
{
article_type
:
number
,
content
:
string
,
desc
:
string
,
file_name
:
string
,
title
:
string
,
writer
:
string
})
{
return
baseAxios
({
url
:
'/article/admin/add'
,
method
:
'post'
,
data
,
})
}
/**
* 删除新闻文章
* @param data
* @returns
*/
delArticle
(
params
:
{
uuid
:
string
})
{
return
baseAxios
({
url
:
'/article/admin/delete/news'
,
method
:
'delete'
,
params
,
})
}
/**
* 删除政策文章
* @param data
* @returns
*/
delPolicyArticle
(
params
:
{
uuid
:
string
})
{
return
baseAxios
({
url
:
'/article/admin/delete/policy'
,
method
:
'delete'
,
params
,
})
}
/**
* 查询列表
* @param data
* @returns
*/
articleList
(
data
:
{
article_status
:
number
|
string
,
article_type
:
number
|
undefined
,
end_time
:
number
|
undefined
,
limit
:
number
,
offset
:
number
,
start_time
:
number
|
undefined
})
{
return
baseAxios
({
url
:
'/article/admin/list'
,
method
:
'post'
,
data
,
})
}
/**
* 修改资讯
* @param data
* @returns
*/
editArticle
(
data
:
{
article_type
:
number
,
content
:
string
,
desc
:
string
,
file_name
:
string
,
title
:
string
,
writer
:
string
,
uuid
:
string
})
{
return
baseAxios
({
url
:
'/article/admin/modify'
,
method
:
'post'
,
data
,
})
}
/**
* 修改资讯状态
* @param data
* @returns
*/
modifyStatus
(
data
:
{
uuid
:
string
,
article_status
:
number
,
article_type
:
number
|
undefined
})
{
return
baseAxios
({
url
:
'/article/admin/modify/status'
,
method
:
'post'
,
data
,
})
}
/**
* 模糊查询新闻标题
* @param data
* @returns
*/
searchByTitle
(
data
:
{
title
:
string
})
{
return
baseAxios
({
url
:
'/article/query/fuzzy/news'
,
method
:
'get'
,
params
:
data
,
})
}
/**
* 模糊查询政策文章
* @param data
* @returns
*/
searchByPolicy
(
data
:
{
title
:
string
})
{
return
baseAxios
({
url
:
'/article/query/fuzzy/policy'
,
method
:
'get'
,
params
:
data
,
})
}
/**
* 查询新闻
* @param data
* @returns
*/
searchNews
(
uuid
:
string
)
{
return
baseAxios
({
url
:
'/article/query/news'
,
method
:
'get'
,
params
:
{
uuid
},
})
}
/**
* 查询新闻列表
* @param data
* @returns
*/
searchList
(
data
:
{
limit
:
number
,
offset
:
number
})
{
return
baseAxios
({
url
:
'/article/query/news/list'
,
method
:
'post'
,
data
,
})
}
/**
* 查询政策文章
* @param data
* @returns
*/
searchPolicy
(
uuid
:
string
)
{
return
baseAxios
({
url
:
'/article/query/policy'
,
method
:
'get'
,
params
:
{
uuid
},
})
}
/**
* 查询政策列表
* @param data
* @returns
*/
searchPolicyList
(
data
:
{
limit
:
number
,
offset
:
number
})
{
return
baseAxios
({
url
:
'/article/query/policy/list'
,
method
:
'post'
,
data
,
})
}
}
src/service/Notify/index.ts
0 → 100644
View file @
e9461eaa
import
baseAxios
from
'../index'
export
default
class
NotifyService
{
static
instance
:
NotifyService
static
getInstance
()
{
if
(
!
NotifyService
.
instance
)
{
NotifyService
.
instance
=
new
NotifyService
()
}
return
NotifyService
.
instance
}
/**
* 新增消息
* @param data
* @returns
*/
addNotify
(
data
:
{
content
:
string
,
notify_type
:
number
,
title
:
string
})
{
return
baseAxios
({
url
:
'/notify/admin/add'
,
method
:
'post'
,
data
,
})
}
/**
* 删除消息
* @param uuid
* @returns
*/
removeNotify
(
uuid
:
string
)
{
return
baseAxios
({
url
:
'/notify/admin/delete'
,
method
:
'delete'
,
params
:
{
uuid
},
})
}
/**
* 消息列表
* @param data
* @returns
*/
notifyList
(
data
:
{
end_time
?:
number
,
limit
:
number
,
notify_status
:
number
,
notify_type
:
number
,
offset
:
number
,
start_time
?:
number
})
{
return
baseAxios
({
url
:
'/notify/admin/list'
,
method
:
'post'
,
data
,
})
}
/**
* 修改消息
* @param data
* @returns
*/
modifyNotify
(
data
:
{
content
:
string
,
notify_type
:
number
,
title
:
string
,
uuid
:
string
})
{
return
baseAxios
({
url
:
'/notify/admin/modify'
,
method
:
'post'
,
data
,
})
}
/**
* 修改消息状态
* @param data
* @returns
*/
modifyNotifyStatus
(
data
:
{
notify_status
:
number
,
uuid
:
string
})
{
return
baseAxios
({
url
:
'/notify/admin/modify/status'
,
method
:
'post'
,
data
,
})
}
}
src/store/LoanProductManagement/type.ts
View file @
e9461eaa
...
...
@@ -7,16 +7,16 @@ export interface iListItem {
features
:
string
,
guarantee_type
:
number
,
inst_name
:
string
,
max_amount
:
string
,
max_date
:
string
,
min_amount
:
string
,
min_date
:
string
,
max_amount
:
number
,
max_date
:
number
,
min_amount
:
number
,
min_date
:
number
,
product_name
:
string
,
product_status
:
number
,
product
_type
:
number
,
loan
_type
:
number
,
products
:
string
,
rate_lower
:
string
,
rate_upper
:
string
,
rate_lower
:
number
,
rate_upper
:
number
,
submit_cond
:
string
,
update_at
:
number
,
uuid
:
string
...
...
src/utils/days/index.ts
View file @
e9461eaa
function
getDate
(
day
:
Date
,
isSmaller
:
Boolean
)
{
export
function
getDate
(
day
:
Date
,
isSmaller
:
Boolean
)
{
let
mm
:
Number
,
dd
:
Number
if
(
isSmaller
){
mm
=
day
.
getMonth
()
+
1
<
10
?
+
(
day
.
getMonth
()
+
1
):
day
.
getMonth
()
+
1
;
...
...
src/utils/time/transfer.ts
View file @
e9461eaa
import
moment
from
'moment'
import
moment
,
{
Moment
}
from
'moment'
export
default
function
transferTimeStampToMoment
(
startTime
:
number
,
...
...
@@ -7,3 +7,36 @@ export default function transferTimeStampToMoment(
if
(
startTime
&&
endTime
)
return
[
moment
(
startTime
),
moment
(
endTime
)]
else
return
[]
}
// 早上9:00 下午17:00
export
function
transfterStrToDate
(
str
:
string
)
{
const
arr
=
str
.
split
(
' '
)
if
(
arr
.
length
===
2
)
{
let
[
start
,
end
]
=
arr
start
=
start
.
replace
(
':'
,
':'
).
replace
(
'早上'
,
''
).
replace
(
'下午'
,
''
)
end
=
end
.
replace
(
':'
,
':'
).
replace
(
'早上'
,
''
).
replace
(
'下午'
,
''
)
const
d
=
new
Date
()
start
=
`
${
d
.
getFullYear
()}
${
d
.
getMonth
()
+
1
}
${
d
.
getDate
()}
${
start
}
`
end
=
`
${
d
.
getFullYear
()}
${
d
.
getMonth
()
+
1
}
${
d
.
getDate
()}
${
end
}
`
const
startDate
=
new
Date
(
start
)
const
endDate
=
new
Date
(
end
)
return
[
startDate
,
endDate
]
}
else
{
return
undefined
}
}
export
function
getOpeningHoursFromMoment
(
start
:
Moment
,
end
:
Moment
)
{
const
h1
=
start
.
hour
()
const
h2
=
end
.
hour
()
const
c1
=
h1
<=
12
?
'早上'
:
'下午'
const
c2
=
h2
<=
12
?
'早上'
:
'下午'
return
`
${
c1
}${
start
.
format
(
'HH:mm'
)}
${
c2
}${
end
.
format
(
'HH:mm'
)}
`
}
export
function
getWeekendStatusFromArr
(
arr
:
string
[])
{
let
count
=
0
arr
.
indexOf
(
'6'
)
!==
-
1
&&
(
count
+=
1
)
arr
.
indexOf
(
'7'
)
!==
-
1
&&
(
count
+=
2
)
return
count
}
src/views/Root/Chat/index.vue
View file @
e9461eaa
This diff is collapsed.
Click to expand it.
src/views/Root/Msg/index.vue
View file @
e9461eaa
...
...
@@ -3,8 +3,8 @@
<p
class=
" text-2xl font-bold mb-5"
>
消息管理
</p>
<!-- 消息分类 -->
<span
class=
" mr-3"
>
消息分类
</span>
<a-select
:default-value=
"
msgType[0]"
style=
"width: 120px; margin-right:10px;
"
>
<a-select-option
v-for=
"
(type,i) in msgType"
:key=
"i"
>
{{
type
}}
</a-select-option>
<a-select
:default-value=
"
1"
style=
"width: 120px; margin-right:10px;"
v-model=
"types
"
>
<a-select-option
v-for=
"
type in msgType"
:key=
"type.value"
>
{{
type
.
label
}}
</a-select-option>
</a-select>
<!-- 操作 -->
<a-button
type=
"primary"
style=
" margin-right:10px;"
@
click=
"query"
>
查询
</a-button>
...
...
@@ -12,12 +12,12 @@
<!-- 发布弹窗 -->
<a-modal
v-model=
"show"
title=
"发布消息"
:centered=
"true"
footer=
""
>
<a-form-model
:model=
"form"
:label-col=
"labelCol"
:wrapper-col=
"wrapperCol"
ref=
"ruleForm"
:rules=
"rules"
>
<a-form-model-item
label=
"模板名称"
:required=
"true"
prop=
"module"
>
<
!--
<
a-form-model-item
label=
"模板名称"
:required=
"true"
prop=
"module"
>
<a-input
v-model=
"form.module"
placeholder=
"请输入模板名称"
style=
"width: 200px"
/>
</a-form-model-item>
</a-form-model-item>
-->
<a-form-model-item
label=
"消息分类"
:required=
"true"
prop=
"type"
>
<a-select
:default-value=
"msgType[0]"
style=
"width: 200px"
v-model=
"form.type"
>
<a-select-option
v-for=
"
(type,i) in msgType"
:key=
"i"
>
{{
type
}}
</a-select-option>
<a-select
style=
"width: 200px"
v-model=
"form.type"
placeholder=
"请选择分类"
>
<a-select-option
v-for=
"
type in msgType"
:key=
"type.value"
>
{{
type
.
label
}}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item
label=
"消息标题"
:required=
"true"
prop=
"title"
>
...
...
@@ -38,23 +38,46 @@
<p
class=
" text-base"
>
{{
current
.
content
}}
</p>
</a-modal>
<!-- 消息列表 -->
<a-table
:columns=
"columns"
:data-source=
"list"
style=
" text-align: center; margin-top:40px;"
bordered
>
<a-table
:columns=
"columns"
:data-source=
"list"
style=
" text-align: center; margin-top:40px;"
bordered
:pagination=
"pagination"
@
change=
"tableChange"
>
<!-- 发布时间 -->
<span
slot=
"time"
slot-scope=
"text,record"
>
{{
record
.
created_at
|
format
}}
</span>
<!-- 新闻内容 -->
<span
slot=
"content"
slot-scope=
"text,record"
>
<a
href=
"javascript:;"
@
click=
"showModal(record)"
>
查看
</a>
</span>
<!-- 显示类型 -->
<span
slot=
"type"
slot-scope=
"text,record"
>
{{
record
.
notify_type
===
1
?
'滚动通知'
:
'系统消息'
}}
</span>
<!-- 状态 -->
<span
slot=
"status"
slot-scope=
"text,record"
>
{{
record
.
notify_status
===
1
?
'待发布'
:
'已发布'
}}
</span>
<!-- 操作 -->
<span
slot=
"action"
slot-scope=
"text,record"
>
<a
v-if=
"record.
state=='已下架'
"
@
click=
"add(record
.key
)"
>
<a
v-if=
"record.
notify_status==1
"
@
click=
"add(record)"
>
上架
</a>
<a
v-else
@
click=
"remove(record
.key
)"
>
@
click=
"remove(record)"
>
下架
</a>
<a-divider
type=
"vertical"
/>
<a
@
click=
"onDelete(record.key)"
>
<a
v-show=
"record.notify_status === 1"
@
click=
"onEdit(record)"
>
编辑
</a>
<a-divider
v-show=
"record.notify_status === 1"
type=
"vertical"
/>
<a
@
click=
"onDelete(record)"
>
删除
</a>
</span>
...
...
@@ -76,14 +99,22 @@
<
script
lang=
"ts"
>
import
Vue
from
'vue'
;
import
{
columns
}
from
'@/const/columns/msgColumns'
import
{
FormModel
}
from
'ant-design-vue'
import
{
FormModel
,
message
}
from
'ant-design-vue'
import
{
msg
}
from
'@/types/msg'
import
{
msgList
}
from
'@/mock/index'
import
{
modal
}
from
'./const'
import
timerange
from
'@/components/TimePicker/index.vue'
import
Notify
from
'@/service/Notify/index'
import
Filter
from
'@/filter/index'
const
notify
=
new
Notify
()
export
default
Vue
.
extend
({
components
:{
timerange
},
filters
:
{
format
(
value
:
string
)
{
return
Filter
.
formatDate
(
value
)
}
},
computed
:{
columns
(){
return
columns
...
...
@@ -93,46 +124,108 @@ export default Vue.extend({
msgType
:{
type
:
Array
,
default
(){
return
[
'滚动通知'
,
'系统消息'
]
return
[
{
label
:
'滚动通知'
,
value
:
1
},
{
label
:
'系统消息'
,
value
:
2
}
]
}
}
},
created
()
{
this
.
getList
()
},
methods
:{
getList
()
{
console
.
log
(
this
.
form
.
type
)
notify
.
notifyList
({
limit
:
this
.
pagination
.
defaultPageSize
,
offset
:
(
this
.
pagination
.
current
-
1
)
*
this
.
pagination
.
defaultPageSize
,
notify_status
:
0
,
notify_type
:
this
.
types
}).
then
(
res
=>
{
this
.
list
=
res
.
data
.
items
this
.
pagination
.
total
=
res
.
data
.
total
})
},
tableChange
(
e
:
{
current
:
number
})
{
this
.
pagination
.
current
=
e
.
current
this
.
getList
()
},
add
(
record
:
any
){
this
.
type
=
modal
.
on
this
.
showActionModal
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'上架消息'
this
.
text
=
'确定上架该消息吗?'
},
remove
(
record
:
any
){
this
.
type
=
modal
.
off
this
.
showActionModal
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'下架消息'
this
.
text
=
'确定下架该消息吗?'
},
onEdit
(
record
:
any
)
{
this
.
form
=
{
title
:
record
.
title
,
content
:
record
.
content
,
type
:
record
.
notify_type
}
this
.
btnType
=
'edit'
this
.
uuid
=
record
.
uuid
this
.
show
=
true
},
onDelete
(
record
:
any
){
this
.
type
=
modal
.
delete
this
.
showActionModal
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'删除消息'
this
.
text
=
'确定删除该消息吗?'
},
setStatus
(
status
:
number
,
msg
:
string
)
{
notify
.
modifyNotifyStatus
({
notify_status
:
status
,
uuid
:
this
.
uuid
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
msg
)
this
.
getList
()
}
})
},
removeNotify
()
{
notify
.
removeNotify
(
this
.
uuid
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'删除成功'
)
this
.
getList
()
}
})
},
onOk
(
record
:
any
){
if
(
this
.
type
==
modal
.
on
){
this
.
setStatus
(
2
,
'发布成功'
)
}
else
if
(
this
.
type
==
modal
.
off
){
this
.
setStatus
(
1
,
'下架成功'
)
}
else
if
(
this
.
type
==
modal
.
delete
){
this
.
removeNotify
()
this
.
pagination
.
current
=
1
}
this
.
showActionModal
=
false
},
query
(){
this
.
getList
()
},
publish
(){
this
.
resetForm
()
this
.
show
=
true
this
.
btnType
=
'add'
},
showModal
(
current
:
object
){
this
.
visible
=
true
...
...
@@ -141,12 +234,43 @@ export default Vue.extend({
handleOk
(){
this
.
visible
=
false
},
addNotice
()
{
notify
.
addNotify
({
content
:
this
.
form
.
content
,
notify_type
:
this
.
form
.
type
,
title
:
this
.
form
.
title
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'新增成功'
)
this
.
show
=
false
this
.
getList
()
}
})
},
editNotice
()
{
notify
.
modifyNotify
({
content
:
this
.
form
.
content
,
notify_type
:
this
.
form
.
type
,
title
:
this
.
form
.
title
,
uuid
:
this
.
uuid
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'编辑成功'
)
this
.
show
=
false
this
.
getList
()
}
})
},
onSubmit
()
{
(
this
.
$refs
.
ruleForm
as
FormModel
).
validate
(
valid
=>
{
if
(
valid
)
{
this
.
show
=
false
if
(
this
.
btnType
===
'add'
)
{
this
.
addNotice
()
}
else
{
this
.
editNotice
()
}
}
else
{
console
.
log
(
'error submit!!'
);
message
.
error
(
'请先填写表单内容'
)
return
false
;
}
});
...
...
@@ -157,23 +281,14 @@ export default Vue.extend({
Object
.
keys
(
this
.
form
).
forEach
(
m
=>
{
this
.
form
[
m
as
formtype
]
=
''
})
},
edit
(
record
:
msg
){
let
form
=
this
.
form
type
msgtype
=
keyof
msg
type
formtype
=
keyof
typeof
form
Object
.
keys
(
this
.
form
).
map
(
m
=>
{
this
.
form
[
m
as
formtype
]
=
record
[
m
as
msgtype
]
})
this
.
show
=
true
this
.
form
[
'type'
]
=
1
},
},
data
(){
const
list
=
msgList
const
rules
=
{
module
:
[
{
required
:
true
,
message
:
'请输入模板名称'
,
trigger
:
'blur'
},
],
//
module: [
//
{ required: true, message: '请输入模板名称', trigger: 'blur' },
//
],
type
:
[
{
required
:
true
,
message
:
'请选择消息分类'
,
trigger
:
'blur'
},
],
...
...
@@ -195,14 +310,22 @@ export default Vue.extend({
labelCol
:
{
span
:
4
},
wrapperCol
:
{
span
:
14
},
form
:
{
name
:
''
,
//
name: '',
title
:
''
,
type
:
''
,
type
:
1
,
content
:
''
,
module
:
''
//
module:''
},
rules
,
list
uuid
:
""
,
types
:
1
,
list
:
[],
pagination
:
{
current
:
1
,
defaultPageSize
:
10
,
total
:
0
},
btnType
:
'add'
}
}
})
...
...
src/views/Root/News/detail.vue
View file @
e9461eaa
<
template
>
<div>
<p
class=
" text-2xl font-bold mb-5 "
>
{{
title
}}
</p>
<p
class=
" text-gray-400"
>
发布时间:
{{
time
}}
<span
class=
" ml-2"
>
作者:
{{
name
}}
</span></p>
<p
class=
"text-left p-5"
>
{{
content
}}
</p>
<p
class=
" text-2xl font-bold mb-5 "
>
{{
title
}}
</p>
<p
class=
" text-gray-400"
>
发布时间:
{{
time
|
format
}}
<span
class=
" ml-2"
>
作者:
{{
name
}}
</span></p>
<div
class=
"text-left p-5"
v-html=
"content"
></div>
<!--
<p
class=
"text-left p-5"
>
{{
content
}}
</p>
-->
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
News
from
'@/service/News/index'
import
Filter
from
'@/filter/index'
const
news
=
new
News
()
export
default
Vue
.
extend
({
data
(){
return
{
title
:
'银保监会、人民银行联合出台现金管理类理财产品监管规则'
,
time
:
'2021-07-01'
,
name
:
'丁洁'
,
content
:
'“中国冰雪大篷车”是国家体育总局深入推进冰雪运动“南展西扩东进”战略,落实“带动三亿人参与冰雪运动”目标的重要群众性活动之一。“中国冰雪大篷车”将在为期半年的时间里,深入全国30余个城市,举办100场线下活动,同时结合持续的线上互动,以创新的体验模式、丰富的活动内容和众多的展示渠道,普及冰雪运动常识,推广冰雪运动理念,让普通大众在家门口就能感受冰雪运动的乐趣。'
title
:
''
,
time
:
''
,
name
:
''
,
content
:
''
}
},
filters
:
{
format
(
value
:
string
)
{
return
Filter
.
formatDate
(
value
)
}
},
methods
:
{
getDetails
()
{
const
type
=
this
.
$route
.
query
.
type
const
uuid
=
this
.
$route
.
query
.
key
as
string
const
request
=
+
type
===
1
?
'searchPolicy'
:
'searchNews'
news
[
request
](
uuid
).
then
(
res
=>
{
console
.
log
(
res
)
const
{
data
}
=
res
this
.
time
=
data
.
created_at
this
.
name
=
data
.
writer
this
.
content
=
data
.
content
this
.
title
=
data
.
title
})
}
},
created
()
{
this
.
getDetails
()
}
})
...
...
src/views/Root/News/index.vue
View file @
e9461eaa
...
...
@@ -5,37 +5,61 @@
<a-input
placeholder=
"标题模糊搜索"
v-model=
"searchPageReqParams.title"
style=
"width: 150px; margin-right:10px;"
/>
<!-- timepicker -->
<span
class=
" font-semibold"
>
注册时间:
</span>
<timerange
class=
" mr-3"
<timerange
class=
" mr-3"
:startTime=
"searchPageReqParams.start_time"
:endTime=
"searchPageReqParams.end_time"
@
getNewTime=
"getNewTime"
/>
<!-- 咨询分类 -->
<span
class=
" mr-3"
>
资讯分类
</span>
<a-select
:default-value=
"newsType[0]"
style=
"width: 120px; margin-right:10px;"
v-model=
"searchPageReqParams.type"
>
<a-select-option
v-for=
"
(type,i) in newsType"
:key=
"i
"
>
{{
type
}}
<a-select
:default-value=
"newsType[0]"
style=
"width: 120px; margin-right:10px;"
v-model=
"searchPageReqParams.
article_
type"
>
<a-select-option
v-for=
"
type in newsType"
:key=
"type.value
"
>
{{
type
.
label
}}
</a-select-option>
</a-select>
<!-- 操作 -->
<a-button
type=
"primary"
style=
" margin-right:10px;"
@
click=
"query"
>
查询
</a-button>
<a-button
type=
"primary"
style=
" margin-right:10px;"
@
click=
"reset"
>
重置
</a-button>
<a-button
type=
"primary"
@
click=
"release"
>
发布
</a-button>
<a-button
type=
"primary"
@
click=
"release
(null, null)
"
>
发布
</a-button>
<!-- 资讯列表 -->
<a-table
:columns=
"columns"
:data-source=
"list"
style=
" text-align: center; margin-top:40px;"
bordered
>
<a-table
:columns=
"columns"
:data-source=
"list"
rowKey=
"columns"
style=
" text-align: center; margin-top:40px;"
bordered
:pagination=
"pagination"
@
change=
"tableChange"
>
<!-- 发布时间 -->
<span
slot=
"created_at"
slot-scope=
"text,record"
>
{{
record
.
created_at
|
format
}}
</span>
<!-- 新闻内容 -->
<span
slot=
"content"
slot-scope=
"text,record"
>
<a
@
click=
"toDetail(record.key)"
>
查看
</a>
<a
@
click=
"toDetail(record.uuid, searchPageReqParams.article_type)"
>
查看
</a>
</span>
<!-- 新闻状态 -->
<span
slot=
"status"
slot-scope=
"text,record"
>
{{
record
.
article_status
===
2
?
'已发布'
:
'未发布'
}}
</span>
<!-- 新闻分类 -->
<span
slot=
"type"
>
{{
searchPageReqParams
.
article_type
===
2
?
'新闻'
:
'政策'
}}
</span>
<!-- 操作 -->
<span
slot=
"action"
slot-scope=
"text,record"
>
<a
v-if=
"record.
state=='已下架'
"
@
click=
"add(record
.key
)"
>
<a
v-if=
"record.
article_status==1
"
@
click=
"add(record)"
>
上架
</a>
<a
v-else
@
click=
"remove(record
.key
)"
>
<a
v-else
-if=
"record.article_status === 2"
@
click=
"remove(record)"
>
下架
</a>
<a-divider
type=
"vertical"
/>
<a
@
click=
"onDelete(record.key)"
>
<a-divider
type=
"vertical"
/>
<a
v-show=
"record.article_status==1"
@
click=
"release(record.uuid, searchPageReqParams.article_type)"
>
编辑
</a>
<a-divider
v-show=
"record.article_status==1"
type=
"vertical"
/>
<a
@
click=
"onDelete(record)"
>
删除
</a>
</span>
...
...
@@ -56,26 +80,39 @@
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
{
newsList
}
from
'@/mock/index'
import
{
columns
}
from
'@/const/columns/newsColunms'
import
{
modal
}
from
'./const'
import
{
getDate
}
from
'@/utils/days/index'
import
timerange
from
'@/components//TimePicker/index.vue'
import
News
from
'@/service/News/index'
import
{
message
}
from
'ant-design-vue'
import
Filter
from
'@/filter/index'
const
news
=
new
News
()
export
default
Vue
.
extend
({
components
:{
timerange
},
filters
:
{
format
(
value
:
string
)
{
return
Filter
.
formatDate
(
value
)
}
},
computed
:{
columns
(){
return
columns
},
list
(){
return
newsList
}
},
props
:{
newsType
:{
type
:
Array
,
default
(){
return
[
'全部'
,
'政策'
,
'新闻'
]
return
[{
label
:
'新闻'
,
value
:
2
},
{
label
:
'政策'
,
value
:
1
}]
}
}
},
...
...
@@ -83,32 +120,81 @@ export default Vue.extend({
return
{
show
:
false
,
title
:
''
,
list
:
[],
type
:
modal
.
on
,
text
:
''
,
searchPageReqParams
:
{
title
:
''
,
type
:
''
,
startTime
:
undefined
as
undefined
|
number
,
endTime
:
undefined
as
undefined
|
number
,
article_status
:
0
,
article_type
:
1
as
undefined
|
number
,
start_time
:
undefined
as
undefined
|
number
,
end_time
:
undefined
as
undefined
|
number
,
},
pagination
:
{
current
:
1
,
defaultPageSize
:
10
,
total
:
0
},
uuid
:
''
}
},
created
()
{
this
.
getList
()
},
methods
:{
tableChange
(
e
:
any
)
{
this
.
pagination
.
current
=
e
.
current
this
.
getList
()
},
getList
()
{
const
params
=
{
...
this
.
searchPageReqParams
,
limit
:
this
.
pagination
.
defaultPageSize
,
// offset: 10
offset
:
(
this
.
pagination
.
current
-
1
)
*
this
.
pagination
.
defaultPageSize
}
news
.
articleList
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
list
=
res
.
data
.
items
this
.
pagination
.
total
=
res
.
data
.
total
// if (this.searchPageReqParams.title) {
// this.findTitle()
// }
})
},
findTitle
()
{
const
searchParams
=
this
.
searchPageReqParams
.
article_type
===
1
?
"searchByPolicy"
:
"searchByTitle"
news
[
searchParams
]({
title
:
this
.
searchPageReqParams
.
title
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
list
=
res
.
data
.
items
this
.
pagination
.
total
=
res
.
data
.
total
})
},
query
(){
console
.
log
(
this
.
searchPageReqParams
);
if
(
this
.
searchPageReqParams
.
title
)
{
this
.
findTitle
()
}
else
{
this
.
getList
()
}
},
getNewTime
(
startTime
:
number
,
endTime
:
number
){
this
.
searchPageReqParams
.
start
T
ime
=
startTime
this
.
searchPageReqParams
.
end
T
ime
=
endTime
this
.
searchPageReqParams
.
start
_t
ime
=
startTime
this
.
searchPageReqParams
.
end
_t
ime
=
endTime
},
reset
(){
this
.
searchPageReqParams
.
title
=
''
this
.
searchPageReqParams
.
type
=
''
this
.
searchPageReqParams
.
startTime
=
undefined
this
.
searchPageReqParams
.
endTime
=
undefined
this
.
searchPageReqParams
.
title
=
''
this
.
searchPageReqParams
.
article_status
=
0
this
.
searchPageReqParams
.
article_type
=
1
this
.
searchPageReqParams
.
start_time
=
undefined
this
.
searchPageReqParams
.
end_time
=
undefined
},
release
(){
this
.
$router
.
push
({
name
:
'publishNews'
})
release
(
key
?:
string
,
type
?:
string
){
if
(
key
&&
type
)
{
this
.
$router
.
push
({
name
:
'publishNews'
,
query
:
{
key
,
type
}})
}
else
{
this
.
$router
.
push
({
name
:
'publishNews'
})
}
},
edit
(
key
:
string
){
this
.
$router
.
push
({
name
:
'publishNews'
,
query
:{
key
:
key
}})
...
...
@@ -116,34 +202,59 @@ export default Vue.extend({
add
(
record
:
any
){
this
.
type
=
modal
.
on
this
.
show
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'上架资讯'
this
.
text
=
'确定上架该资讯吗?'
},
remove
(
record
:
any
){
this
.
type
=
modal
.
off
this
.
show
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'下架资讯'
this
.
text
=
'确定下架该资讯吗?'
},
onDelete
(
record
:
any
){
this
.
type
=
modal
.
delete
this
.
show
=
true
this
.
uuid
=
record
.
uuid
this
.
title
=
'删除资讯'
this
.
text
=
'确定删除该资讯吗?'
},
setStatus
(
status
:
number
,
msg
:
string
)
{
news
.
modifyStatus
({
article_status
:
status
,
article_type
:
this
.
searchPageReqParams
.
article_type
,
uuid
:
this
.
uuid
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
msg
)
this
.
getList
()
}
})
},
removeArticle
()
{
const
props
=
this
.
searchPageReqParams
.
article_type
===
1
?
'delPolicyArticle'
:
'delArticle'
news
[
props
]({
uuid
:
this
.
uuid
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'删除成功'
)
this
.
getList
()
}
})
},
handleOk
(
record
:
any
){
console
.
log
(
record
)
if
(
this
.
type
==
modal
.
on
){
this
.
setStatus
(
2
,
'上架成功'
)
}
else
if
(
this
.
type
==
modal
.
off
){
this
.
setStatus
(
1
,
'下架成功'
)
}
else
if
(
this
.
type
==
modal
.
delete
){
this
.
removeArticle
()
this
.
pagination
.
current
=
1
}
this
.
show
=
false
},
toDetail
(
key
:
string
){
this
.
$router
.
push
({
name
:
'newsDetail'
,
query
:{
key
:
key
}})
toDetail
(
key
:
string
,
type
:
string
){
this
.
$router
.
push
({
name
:
'newsDetail'
,
query
:{
key
:
key
,
type
:
type
}})
}
}
})
...
...
src/views/Root/News/publish.vue
View file @
e9461eaa
...
...
@@ -7,16 +7,16 @@
<!-- 作者 -->
<a-input
v-model=
"author"
placeholder=
"请输入作者名称"
style=
"width: 35%"
/>
<!-- 文章分类 -->
<a-select
style=
"width: 20%"
v-model=
"type"
>
<a-select-option
v-for=
"
type in articalType"
:key=
"type"
>
{{
type
}}
</a-select-option>
<a-select
style=
"width: 20%"
v-model=
"type"
placeholder=
"请选择资讯分类"
>
<a-select-option
v-for=
"
item in articalType"
:key=
"item.value"
>
{{
item
.
label
}}
</a-select-option>
</a-select>
</div>
<!-- 上传概要图片 -->
<editor-upload
class=
" mt-5"
/>
<editor-upload
class=
" mt-5"
:path=
"imageUrl"
@
getFileHash=
"getImage"
/>
<!-- 文章概要 -->
<a-textarea
v-model=
"summary"
:maxLength=
"50"
placeholder=
"请输入文章概要,字数限制50字以内"
auto-size
/>
<!-- 编辑器 -->
<editor
class=
"edit-news text-left mt-5"
<editor
class=
"edit-news text-left mt-5"
:text=
"editableContent"
:editorContent
.
sync=
"content"
@
getContent=
"getContent"
/>
<!-- 发布操作 -->
<a-button
type=
"primary"
@
click=
"onSubmit"
class=
" mt-5"
>
确定发布
</a-button>
...
...
@@ -27,6 +27,11 @@
import
Vue
from
'vue'
;
import
Editor
from
'@/components/Editor/index.vue'
import
EditorUpload
from
'@/components/Editor/editorUpload.vue'
import
News
from
'@/service/News/index'
import
FileService
from
"@/service/FileService/index"
;
import
{
message
}
from
'ant-design-vue'
;
const
news
=
new
News
()
export
default
Vue
.
extend
({
components
:{
Editor
,
EditorUpload
},
...
...
@@ -34,7 +39,13 @@ export default Vue.extend({
articalType
:{
type
:
Array
,
default
(){
return
[
'新闻'
,
'政策'
]
return
[{
label
:
'新闻'
,
value
:
2
},
{
label
:
'政策'
,
value
:
1
}]
}
}
},
...
...
@@ -42,17 +53,91 @@ export default Vue.extend({
return
{
title
:
''
,
author
:
''
,
type
:
'新闻'
,
type
:
undefined
as
number
|
any
,
imgUrl
:
''
,
imageUrl
:
''
,
summary
:
''
,
content
:
''
content
:
''
,
editableContent
:
''
,
}
},
created
()
{
this
.
getDetails
()
},
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
)
})
}
},
initData
(
res
:
any
)
{
this
.
title
=
res
.
title
this
.
author
=
res
.
writer
this
.
imgUrl
=
res
.
file_name
this
.
imageUrl
=
new
FileService
().
getImageSrc
(
res
.
file_name
)
this
.
summary
=
res
.
desc
this
.
editableContent
=
res
.
content
},
getContent
(
value
:
string
){
this
.
content
=
value
console
.
log
(
value
)
},
getImage
(
val
:
string
)
{
this
.
imgUrl
=
val
},
addForm
()
{
const
params
=
{
article_type
:
this
.
type
,
content
:
this
.
content
,
desc
:
this
.
summary
,
file_name
:
this
.
imgUrl
,
title
:
this
.
title
,
writer
:
this
.
author
}
news
.
addArticle
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'新增成功'
)
this
.
$router
.
push
({
name
:
'newsManage'
})
}
})
},
editForm
()
{
const
params
=
{
article_type
:
this
.
type
,
content
:
this
.
content
,
desc
:
this
.
summary
,
file_name
:
this
.
imgUrl
,
title
:
this
.
title
,
writer
:
this
.
author
,
uuid
:
this
.
$route
.
query
.
key
as
string
}
news
.
editArticle
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
message
.
success
(
'编辑成功'
)
this
.
$router
.
push
({
name
:
'newsManage'
})
}
})
},
onSubmit
()
{
// console.log(this.content);
console
.
log
(
this
.
content
)
if
(
this
.
$route
.
query
.
key
)
{
this
.
editForm
()
}
else
{
this
.
addForm
()
}
},
}
})
...
...
src/views/Root/OutletManagement/index.vue
View file @
e9461eaa
This diff is collapsed.
Click to expand it.
src/views/Root/Product/Loan/publish.vue
View file @
e9461eaa
...
...
@@ -71,9 +71,10 @@
</a-form-model-item>
<a-form-model-item
label=
"产品分类"
style=
"width: 100%"
>
<a-select
:default-value=
"
eProductType.company
"
:default-value=
"
form.type
"
style=
"width: 120px; margin-right: 10px"
@
change=
"changeProductType"
v-model=
"form.type"
>
<a-select-option
:value=
"eProductType.company"
>
企业
...
...
@@ -141,7 +142,7 @@ export default Vue.extend({
this
.
form
.
limitMin
=
record
.
min_amount
;
this
.
form
.
limitMax
=
record
.
max_amount
;
this
.
form
.
guarantee
=
record
.
guarantee_type
;
this
.
form
.
type
=
record
.
product
_type
;
this
.
form
.
type
=
record
.
loan
_type
;
this
.
form
.
introduction
=
record
.
products
;
this
.
form
.
characteristic
=
record
.
features
;
this
.
form
.
target
=
record
.
apply_to
;
...
...
@@ -155,12 +156,12 @@ export default Vue.extend({
form
:
{
name
:
""
,
orgnization
:
""
,
startTime
:
0
as
number
|
string
,
endTime
:
0
as
number
|
string
,
interstMax
:
0
as
number
|
string
,
interstMin
:
0
as
number
|
string
,
limitMax
:
0
as
number
|
string
,
limitMin
:
0
as
number
|
string
,
startTime
:
0
,
endTime
:
0
,
interstMax
:
0
,
interstMin
:
0
,
limitMax
:
0
as
number
,
limitMin
:
0
,
guarantee
:
eGuaranteeType
.
credit
,
type
:
eProductType
.
company
,
introduction
:
""
,
...
...
@@ -238,16 +239,16 @@ export default Vue.extend({
features
:
this
.
form
.
characteristic
,
guarantee_type
:
this
.
form
.
guarantee
as
eGuaranteeType
,
inst_name
:
this
.
form
.
orgnization
,
max_amount
:
this
.
form
.
limitMax
.
toString
()
,
max_date
:
this
.
form
.
endTime
.
toString
()
,
max_amount
:
this
.
form
.
limitMax
,
max_date
:
this
.
form
.
endTime
,
product_name
:
this
.
form
.
name
,
products
:
this
.
form
.
introduction
,
product
_type
:
this
.
form
.
type
,
rate_lower
:
this
.
form
.
interstMin
.
toString
()
,
rate_upper
:
this
.
form
.
interstMax
.
toString
()
,
loan
_type
:
this
.
form
.
type
,
rate_lower
:
this
.
form
.
interstMin
,
rate_upper
:
this
.
form
.
interstMax
,
submit_cond
:
this
.
form
.
submissionCon
,
min_amount
:
this
.
form
.
limitMin
.
toString
()
,
min_date
:
this
.
form
.
startTime
.
toString
()
,
min_amount
:
this
.
form
.
limitMin
,
min_date
:
this
.
form
.
startTime
,
uuid
:
this
.
uuid
,
})
.
then
((
ret
)
=>
{
...
...
@@ -267,15 +268,15 @@ export default Vue.extend({
features
:
this
.
form
.
characteristic
,
guarantee_type
:
this
.
form
.
guarantee
as
eGuaranteeType
,
inst_name
:
this
.
form
.
orgnization
,
max_amount
:
this
.
form
.
limitMax
.
toString
()
,
max_date
:
this
.
form
.
endTime
.
toString
()
,
min_amount
:
this
.
form
.
limitMin
.
toString
()
,
min_date
:
this
.
form
.
startTime
.
toString
()
,
max_amount
:
this
.
form
.
limitMax
,
max_date
:
this
.
form
.
endTime
,
min_amount
:
this
.
form
.
limitMin
,
min_date
:
this
.
form
.
startTime
,
loan_type
:
this
.
form
.
type
as
eProductType
,
product_name
:
this
.
form
.
name
,
products
:
this
.
form
.
introduction
,
rate_lower
:
this
.
form
.
interstMin
.
toString
()
,
rate_upper
:
this
.
form
.
interstMax
.
toString
()
,
rate_lower
:
this
.
form
.
interstMin
,
rate_upper
:
this
.
form
.
interstMax
,
submit_cond
:
this
.
form
.
submissionCon
,
})
.
then
((
ret
)
=>
{
...
...
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