Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service-admin-view
Project
Project
Details
Activity
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
external
on-site-service-admin-view
Commits
d27e8323
Commit
d27e8323
authored
Jul 25, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 系统参数
parent
8c8f6e21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
177 additions
and
483 deletions
+177
-483
TableScript.vue
src/components/table/TableScript.vue
+1
-1
user.js
src/store/modules/user.js
+1
-1
websocket.js
src/util/websocket.js
+3
-2
PromotionList.vue
src/views/promotion/PromotionList.vue
+1
-1
SysParamComponent.vue
src/views/system/sysParam/SysParamComponent.vue
+0
-467
SysParamEdit.vue
src/views/system/sysParam/SysParamEdit.vue
+101
-0
SysParamList.vue
src/views/system/sysParam/SysParamList.vue
+70
-11
No files found.
src/components/table/TableScript.vue
View file @
d27e8323
...
...
@@ -41,7 +41,7 @@ export default {
useSelection
:
true
,
// 标题
title
:
'列表'
,
keep
:
fals
e
,
// 保持状态
keep
:
tru
e
,
// 保持状态
useSearch
:
true
,
// 显示搜索
customClass
:
''
,
useTitle
:
true
,
...
...
src/store/modules/user.js
View file @
d27e8323
...
...
@@ -79,7 +79,7 @@ const user = {
commit
(
'SET_AVATAR'
,
data
.
userInfo
.
avatar
);
commit
(
'SET_BUTTONS'
,
buttonAuthList
);
SocketService
.
init
(
data
.
userInfo
.
id
)
SocketService
.
init
()
resolve
(
response
)
...
...
src/util/websocket.js
View file @
d27e8323
...
...
@@ -4,8 +4,9 @@ import { notification } from 'ant-design-vue'
export
default
class
SocketService
{
static
webSocket
=
null
static
reConnectTimeout
=
1000
static
init
(
userId
)
{
const
ws
=
new
WebSocket
(
`
${
process
.
env
.
VUE_APP_WEBSOCKET
}
?userId=
${
userId
}
`
)
static
init
()
{
const
token
=
sessionStorage
.
getItem
(
'Access-Token'
)
||
localStorage
.
getItem
(
'Access-Token'
)
const
ws
=
new
WebSocket
(
`
${
process
.
env
.
VUE_APP_WEBSOCKET
}
?token=
${
token
}
`
)
this
.
reConnectTimeout
=
1000
ws
.
onmessage
=
this
.
onmessage
...
...
src/views/promotion/PromotionList.vue
View file @
d27e8323
...
...
@@ -28,7 +28,7 @@ export default {
return
{
columns
,
useYScroll
:
true
,
title
:
'推广
管理
'
title
:
'推广
统计
'
}
},
methods
:
{
...
...
src/views/system/sysParam/SysParamComponent.vue
deleted
100644 → 0
View file @
8c8f6e21
This diff is collapsed.
Click to expand it.
src/views/system/sysParam/SysParamEdit.vue
0 → 100644
View file @
d27e8323
<
template
>
<a-drawer
title=
"系统参数编辑"
placement=
"right"
:closable=
"false"
@
close=
"onClose"
:visible=
"visible"
width=
"30%"
wrapClassName=
"sys-param"
>
<a-form>
<a-row>
<a-col
v-if=
"param.type == 3"
:span=
"24"
>
<a-form-item
:label=
"param.name"
v-bind=
"formItemLayout"
>
<RichText
ref=
"RichText"
:height=
"600"
/>
</a-form-item>
</a-col>
<a-col
v-if=
"param.type == 1"
:span=
"24"
>
<a-form-item
:label=
"param.name"
v-bind=
"formItemLayout"
>
<a-input-number
style=
"width: 180px"
v-model=
"value"
/>
</a-form-item>
</a-col>
<a-col
v-if=
"param.type == 2"
:span=
"24"
>
<a-form-item
:label=
"param.name"
v-bind=
"formItemLayout"
>
<a-input
v-model=
"value"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
<div
class=
"drawer-form-bottom-toolbar"
>
<a-button
:style=
"
{ marginRight: '8px' }" @click="onClose">
返回
</a-button>
<a-button
type=
"primary"
@
click=
"saveForm(record)"
>
保存
</a-button>
</div>
</a-drawer>
</
template
>
<
script
>
import
RichText
from
'@/components/richtext/richtext-editor'
import
ImageUpload
from
'@/components/image-upload/ImageUpload'
import
{
save
}
from
'@/api/base/sysParam'
export
default
{
name
:
'SysParamEdit'
,
components
:
{
RichText
,
ImageUpload
},
data
()
{
return
{
type
:
1
,
visible
:
false
,
param
:
{
value
:
null
},
value
:
null
}
},
methods
:
{
show
(
row
)
{
this
.
param
=
row
this
.
visible
=
true
this
.
$nextTick
(()
=>
{
if
(
row
.
type
==
3
)
{
this
.
$refs
.
RichText
.
setContent
(
row
.
value
)
}
else
{
this
.
value
=
row
.
value
}
})
},
onClose
()
{
this
.
param
=
{
value
:
null
}
this
.
visible
=
false
},
saveForm
()
{
let
value
=
null
if
(
this
.
param
.
type
==
3
)
{
value
=
this
.
$refs
.
RichText
.
getContent
()
}
else
{
value
=
this
.
value
}
if
(
!
value
)
{
this
.
loading
=
false
this
.
$notification
.
error
({
message
:
'提示'
,
description
:
'参数值不能为空'
,
duration
:
4
})
return
}
save
({
id
:
this
.
param
.
id
,
value
}).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
this
.
$notification
.
success
({
message
:
'系统提示'
,
description
:
'保存成功'
,
duration
:
4
})
this
.
$emit
(
'onSuccess'
)
this
.
onClose
()
}
})
}
}
}
</
script
>
\ No newline at end of file
src/views/system/sysParam/SysParamList.vue
View file @
d27e8323
<
template
>
<div>
<sys-param-component
:type=
"type"
:listName=
"listName"
></sys-param-component>
</div>
<table-template
:soul=
"this"
>
<template
#
action=
"
{ record }">
<a
@
click=
"editRow(record)"
>
编辑
</a>
</
template
>
<
template
#
tags=
"{ value }"
>
<a-tag>
{{
codeMapping
[
'SYS0005'
][
value
]
}}
</a-tag>
</
template
>
<
template
#
value=
"{ record }"
>
<span>
{{
getValue
(
record
)
}}
</span>
</
template
>
<
template
#
free
>
<SysParamEdit
ref=
"SysParamEdit"
@
onSuccess=
"reset"
/>
</
template
>
</table-template>
</template>
<
script
>
import
SysParamComponent
from
'./SysParamComponent'
import
dayjs
from
'dayjs'
import
{
TableTemplate
,
TableScript
,
SearchType
}
from
'@/components/table'
import
{
getPage
}
from
'@/api/base/sysParam'
import
SysParamEdit
from
'./SysParamEdit.vue'
const
columns
=
[
{
title
:
'参数名称'
,
dataIndex
:
'name'
,
width
:
200
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'参数类型'
,
dataIndex
:
'type'
,
width
:
100
,
scopedSlots
:
{
customRender
:
'tags'
},
filter
:
{
type
:
SearchType
.
ENUM
},
enum
:
'SYS0005'
},
{
title
:
'参数值'
,
key
:
'value'
,
scopedSlots
:
{
customRender
:
'value'
}
},
{
title
:
'备注'
,
width
:
100
,
dataIndex
:
'remark'
},
{
title
:
'排序号'
,
width
:
110
,
dataIndex
:
'showOrder'
,
sorter
:
true
},
{
title
:
'修改人'
,
width
:
110
,
dataIndex
:
'username'
},
{
title
:
'修改时间'
,
dataIndex
:
'lmDate'
,
width
:
180
,
sorter
:
true
,
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
{
title
:
'操作'
,
key
:
'operation'
,
width
:
90
,
scopedSlots
:
{
customRender
:
'action'
}
}
]
export
default
{
name
:
'SysParamList'
,
components
:
{
SysParamComponent
},
components
:
{
TableTemplate
,
SysParamEdit
},
mixins
:
[
TableScript
],
data
()
{
return
{
type
:
'system'
,
listName
:
'总控系统参数列表'
title
:
'系统参数'
,
columns
,
codes
:
[[
'SYS0005'
],
[]]
}
},
methods
:
{}
methods
:
{
queryData
:
getPage
,
getValue
(
record
)
{
if
(
record
.
type
==
3
)
{
return
'[点击编辑查看]'
}
return
record
.
value
},
editRow
(
row
)
{
this
.
$refs
.
SysParamEdit
.
show
(
row
)
}
}
}
</
script
>
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