Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dbeb1a5e
authored
Feb 20, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
css
parent
33d90318
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
37 deletions
src/ajax/index.js
src/components/menu.vue
src/views/News/notice.vue
src/ajax/index.js
View file @
dbeb1a5e
...
@@ -12,23 +12,27 @@ import Util from "../tool";
...
@@ -12,23 +12,27 @@ import Util from "../tool";
const
envs
=
process
.
env
.
NODE_ENV
;
const
envs
=
process
.
env
.
NODE_ENV
;
export
let
NODE_ENVS
=
"/"
;
export
let
NODE_ENVS
=
"/"
;
export
let
NODE_ENVS_MSG
=
"/"
;
//消息系统
switch
(
envs
)
{
switch
(
envs
)
{
case
'development'
:
case
'development'
:
//开发环境
//开发环境
NODE_ENVS
=
'http://cloud.liexindev.net'
;
NODE_ENVS
=
'http://cloud.liexindev.net'
;
NODE_ENVS_MSG
=
'http://192.168.1.252:16543'
;
break
;
break
;
case
'test'
:
case
'test'
:
//测试环境
//测试环境
NODE_ENVS
=
'http://cloud.liexindev.net'
;
NODE_ENVS
=
'http://cloud.liexindev.net'
;
NODE_ENVS_MSG
=
'http://192.168.1.252:16543'
;
break
;
break
;
case
'production'
:
case
'production'
:
//线上环境
//线上环境
NODE_ENVS
=
'//cloud.ichunt.com'
;
NODE_ENVS
=
'//cloud.ichunt.com'
;
NODE_ENVS_MSG
=
'https://msg.ichunt.net'
;
break
;
break
;
}
}
export
const
http
=
(
method
,
url
,
param
,
loading
)
=>
{
export
const
http
=
(
method
,
url
,
param
,
loading
)
=>
{
//axios.defaults.withCredentials = true; // 携带cookie
//axios.defaults.withCredentials = true; // 携带cookie
//loading 默认加载loading 传1 不加载
//loading 默认加载loading 传1 不加载
param
=
param
&&
typeof
param
===
'object'
?
param
:
{};
param
=
param
&&
typeof
param
===
'object'
?
param
:
{};
...
@@ -39,19 +43,19 @@ export const http = (method, url, param,loading) => {
...
@@ -39,19 +43,19 @@ export const http = (method, url, param,loading) => {
transformRequest
:
[
function
(
param
)
{
transformRequest
:
[
function
(
param
)
{
return
qs
.
stringify
(
param
);
return
qs
.
stringify
(
param
);
}],
}],
loading
:
(
loading
?
false
:
true
)
loading
:
(
loading
?
false
:
true
)
};
};
//param.token=token
//param.token=token
if
(
url
!=
"/auth/cp"
&&
url
!=
"/auth/login"
)
{
if
(
url
!=
"/auth/cp"
&&
url
!=
"/auth/login"
)
{
config
.
headers
=
{
config
.
headers
=
{
'Authorization'
:
'Bearer '
+
token
'Authorization'
:
'Bearer '
+
token
}
}
}
}
// post请求时需要设定Content-Type
// post请求时需要设定Content-Type
if
(
method
==
'post'
||
method
==
'POST'
)
{
if
(
method
==
'post'
||
method
==
'POST'
)
{
config
.
data
=
param
;
config
.
data
=
param
;
}
else
if
(
method
===
'get'
||
method
==
'GET'
)
{
}
else
if
(
method
===
'get'
||
method
==
'GET'
)
{
config
.
params
=
param
;
config
.
params
=
param
;
}
}
return
axios
(
config
);
return
axios
(
config
);
...
...
src/components/menu.vue
View file @
dbeb1a5e
...
@@ -253,6 +253,8 @@
...
@@ -253,6 +253,8 @@
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Util
from
"../tool"
;
import
Util
from
"../tool"
;
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
{
NODE_ENVS_MSG
}
from
"../ajax"
;
import
{
Badge
,
Button
,
Checkbox
,
Dialog
,
Form
,
FormItem
,
Input
,
Menu
,
MenuItem
,
MenuItemGroup
,
Message
,
MessageBox
,
Notification
,
Pagination
,
Submenu
,
TabPane
,
Tabs
,
Tooltip
}
from
'element-ui'
import
{
Badge
,
Button
,
Checkbox
,
Dialog
,
Form
,
FormItem
,
Input
,
Menu
,
MenuItem
,
MenuItemGroup
,
Message
,
MessageBox
,
Notification
,
Pagination
,
Submenu
,
TabPane
,
Tabs
,
Tooltip
}
from
'element-ui'
Vue
.
prototype
.
$message
=
Message
;
Vue
.
prototype
.
$message
=
Message
;
...
@@ -364,7 +366,7 @@ export default {
...
@@ -364,7 +366,7 @@ export default {
if
(
msg_notice
)
{
if
(
msg_notice
)
{
return
;
return
;
}
}
axios
.
post
(
news_url
+
'/get_category_msg_list'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/get_category_msg_list'
,
{
page
:
this
.
page
,
page
:
this
.
page
,
limit
:
this
.
limit
,
limit
:
this
.
limit
,
msg_status
:
0
,
msg_status
:
0
,
...
@@ -397,7 +399,7 @@ export default {
...
@@ -397,7 +399,7 @@ export default {
return
;
return
;
}
}
}
}
axios
.
post
(
news_url
+
'/get_latest_msg'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/get_latest_msg'
,
{
page
:
1
,
page
:
1
,
limit
:
1
,
limit
:
1
,
user_id
:
this
.
supplier_id
,
//供应商id
user_id
:
this
.
supplier_id
,
//供应商id
...
@@ -453,7 +455,7 @@ export default {
...
@@ -453,7 +455,7 @@ export default {
* 获取新闻信息
* 获取新闻信息
*/
*/
getNews
()
{
getNews
()
{
axios
.
post
(
news_url
+
'/get_category_msg_list'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/get_category_msg_list'
,
{
page
:
this
.
page
,
page
:
this
.
page
,
limit
:
this
.
limit
,
limit
:
this
.
limit
,
msg_status
:
this
.
msg_status
,
msg_status
:
this
.
msg_status
,
...
@@ -485,7 +487,7 @@ export default {
...
@@ -485,7 +487,7 @@ export default {
* 获取tab的数量
* 获取tab的数量
*/
*/
getNotReadCount
()
{
getNotReadCount
()
{
axios
.
post
(
news_url
+
'/get_not_read_count'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/get_not_read_count'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
//云芯系统
sys_id
:
17
//云芯系统
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
...
@@ -514,7 +516,7 @@ export default {
...
@@ -514,7 +516,7 @@ export default {
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
return
obj
.
id
return
obj
.
id
})
})
axios
.
post
(
news_url
+
'/update_msg'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/update_msg'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
,
//云芯系统
sys_id
:
17
,
//云芯系统
msg_ids
:
msg_ids
.
join
(
','
)
msg_ids
:
msg_ids
.
join
(
','
)
...
@@ -549,7 +551,7 @@ export default {
...
@@ -549,7 +551,7 @@ export default {
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
var
msg_ids
=
this
.
multipleSelection
.
map
(
obj
=>
{
return
obj
.
id
return
obj
.
id
})
})
axios
.
post
(
news_url
+
'/delete_msg'
,
{
axios
.
post
(
NODE_ENVS_MSG
+
'/delete_msg'
,
{
user_id
:
this
.
supplier_id
,
//供应商id
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
,
//云芯系统
sys_id
:
17
,
//云芯系统
msg_ids
:
msg_ids
.
join
(
','
)
msg_ids
:
msg_ids
.
join
(
','
)
...
...
src/views/News/notice.vue
View file @
dbeb1a5e
...
@@ -4,10 +4,18 @@
...
@@ -4,10 +4,18 @@
<!--列表区-->
<!--列表区-->
<div
class=
"data-box"
>
<div
class=
"data-box"
>
<el-table
:data=
"list"
border
max-height=
"600"
>
<el-table
:data=
"list"
border
max-height=
"600"
>
<el-table-column
prop=
"msg_sn"
label=
"消息名称"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
<el-table-column
prop=
"title"
label=
"消息名称"
:show-overflow-tooltip=
"true"
align=
"center"
>
<el-table-column
prop=
"msg_type"
label=
"消息内容"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
<template
slot-scope=
"scope"
>
<el-table-column
prop=
"msg_type"
label=
"附件"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
<a
href=
"javascript:;"
class=
"alink"
>
{{
scope
.
row
.
title
}}
</a>
<el-table-column
prop=
"create_time"
label=
"创建时间"
width=
"160"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
</
template
>
</el-table-column>
<el-table-column
prop=
"content"
label=
"消息内容"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
<el-table-column
prop=
"attach_file"
label=
"附件"
:show-overflow-tooltip=
"true"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<a
:href=
"scope.row.attach_file_link"
class=
"alink"
target=
"_blank"
>
{{
scope
.
row
.
attach_file
}}
</a>
</
template
>
</el-table-column>
<el-table-column
prop=
"create_time"
label=
"创建时间"
:show-overflow-tooltip=
"true"
align=
"center"
></el-table-column>
</el-table>
</el-table>
<el-pagination
layout=
"total, sizes, prev, pager, next, jumper"
:page-sizes=
"[10, 20, 50, 100, 200]"
:total=
"total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"page"
></el-pagination>
<el-pagination
layout=
"total, sizes, prev, pager, next, jumper"
:page-sizes=
"[10, 20, 50, 100, 200]"
:total=
"total"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"page"
></el-pagination>
</div>
</div>
...
@@ -19,6 +27,8 @@
...
@@ -19,6 +27,8 @@
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Menu
from
"@/components/menu.vue"
;
import
Menu
from
"@/components/menu.vue"
;
import
{
Autocomplete
,
Button
,
DatePicker
,
Descriptions
,
DescriptionsItem
,
Dialog
,
Divider
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Form
,
FormItem
,
Input
,
Message
,
MessageBox
,
Option
,
Pagination
,
Popover
,
Select
,
Table
,
TableColumn
,
Tag
,
Tooltip
}
from
'element-ui'
import
{
Autocomplete
,
Button
,
DatePicker
,
Descriptions
,
DescriptionsItem
,
Dialog
,
Divider
,
Dropdown
,
DropdownItem
,
DropdownMenu
,
Form
,
FormItem
,
Input
,
Message
,
MessageBox
,
Option
,
Pagination
,
Popover
,
Select
,
Table
,
TableColumn
,
Tag
,
Tooltip
}
from
'element-ui'
import
{
NODE_ENVS_MSG
}
from
"../../ajax"
;
import
axios
from
"_axios@0.21.4@axios"
;
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$confirm
=
MessageBox
.
confirm
;
Vue
.
prototype
.
$confirm
=
MessageBox
.
confirm
;
...
@@ -29,12 +39,11 @@ export default {
...
@@ -29,12 +39,11 @@ export default {
name
:
"notice"
,
name
:
"notice"
,
data
()
{
data
()
{
return
{
return
{
supplier_id
:
Number
(
localStorage
.
getItem
(
'supplier_id'
))
||
0
,
total
:
0
,
total
:
0
,
page
:
1
,
page
:
1
,
limit
:
10
,
limit
:
10
,
list
:
[],
list
:
[]
dialogVisible
:
false
,
msgDetail
:
{}
};
};
},
},
created
()
{
created
()
{
...
@@ -42,33 +51,32 @@ export default {
...
@@ -42,33 +51,32 @@ export default {
},
},
methods
:
{
methods
:
{
getData
()
{
getData
()
{
this
.
$http
(
'GET'
,
"/api/message/getMsgList"
,
{}).
then
(
res
=>
{
axios
.
post
(
NODE_ENVS_MSG
+
'/get_category_msg_list'
,
{
page
:
this
.
page
,
limit
:
this
.
limit
,
msg_status
:
0
,
msg_category_id
:
10
,
user_id
:
this
.
supplier_id
,
//供应商id
sys_id
:
17
//云芯系统
}).
then
((
res
)
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
this
.
list
=
res
.
data
.
list
||
[];
if
(
res
.
data
.
list
.
length
>
0
)
{
this
.
list
=
res
.
data
.
list
.
map
(
obj
=>
{
return
JSON
.
parse
(
obj
.
msg_data
);
})
this
.
total
=
Number
(
res
.
data
.
total
)
||
0
;
this
.
total
=
Number
(
res
.
data
.
total
)
||
0
;
}
else
{
this
.
$message
({
message
:
res
.
msg
,
type
:
'error'
});
}
}
})
},
getMsgDetail
(
msg_id
)
{
this
.
$http
(
'GET'
,
"/api/message/getMsgDetail"
,
{
msg_id
:
msg_id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
msgDetail
=
res
.
data
;
this
.
dialogVisible
=
true
;
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
message
:
res
.
msg
,
message
:
res
.
msg
,
type
:
'
error
'
type
:
'
warning
'
});
});
}
}
})
})
;
},
},
viewChange
(
index
,
row
)
{
handleSizeChange
(
val
)
{
this
.
getMsgDetail
(
row
.
id
);
this
.
limit
=
val
;
this
.
getData
();
},
},
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
page
=
val
;
this
.
page
=
val
;
...
...
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