Commit dbeb1a5e by LJM

css

parent 33d90318
......@@ -12,23 +12,27 @@ import Util from "../tool";
const envs = process.env.NODE_ENV;
export let NODE_ENVS = "/";
export let NODE_ENVS_MSG = "/";//消息系统
switch (envs) {
case 'development':
//开发环境
NODE_ENVS = 'http://cloud.liexindev.net';
NODE_ENVS_MSG = 'http://192.168.1.252:16543';
break;
case 'test':
//测试环境
NODE_ENVS = 'http://cloud.liexindev.net';
NODE_ENVS_MSG = 'http://192.168.1.252:16543';
break;
case 'production':
//线上环境
NODE_ENVS = '//cloud.ichunt.com';
NODE_ENVS_MSG = 'https://msg.ichunt.net';
break;
}
export const http = (method, url, param,loading) => {
export const http = (method, url, param, loading) => {
//axios.defaults.withCredentials = true; // 携带cookie
//loading 默认加载loading 传1 不加载
param = param && typeof param === 'object' ? param : {};
......@@ -39,19 +43,19 @@ export const http = (method, url, param,loading) => {
transformRequest: [function (param) {
return qs.stringify(param);
}],
loading:(loading?false:true)
loading: (loading ? false : true)
};
//param.token=token
if(url!="/auth/cp"&&url!="/auth/login"){
config.headers={
if (url != "/auth/cp" && url != "/auth/login") {
config.headers = {
'Authorization': 'Bearer ' + token
}
}
// post请求时需要设定Content-Type
if (method == 'post'||method == 'POST') {
if (method == 'post' || method == 'POST') {
config.data = param;
} else if (method === 'get'||method == 'GET') {
} else if (method === 'get' || method == 'GET') {
config.params = param;
}
return axios(config);
......
......@@ -253,6 +253,8 @@
import Vue from 'vue';
import Util from "../tool";
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'
Vue.prototype.$message = Message;
......@@ -364,7 +366,7 @@ export default {
if (msg_notice) {
return;
}
axios.post(news_url + '/get_category_msg_list', {
axios.post(NODE_ENVS_MSG + '/get_category_msg_list', {
page: this.page,
limit: this.limit,
msg_status: 0,
......@@ -397,7 +399,7 @@ export default {
return;
}
}
axios.post(news_url + '/get_latest_msg', {
axios.post(NODE_ENVS_MSG + '/get_latest_msg', {
page: 1,
limit: 1,
user_id: this.supplier_id,//供应商id
......@@ -453,7 +455,7 @@ export default {
* 获取新闻信息
*/
getNews() {
axios.post(news_url + '/get_category_msg_list', {
axios.post(NODE_ENVS_MSG + '/get_category_msg_list', {
page: this.page,
limit: this.limit,
msg_status: this.msg_status,
......@@ -485,7 +487,7 @@ export default {
* 获取tab的数量
*/
getNotReadCount() {
axios.post(news_url + '/get_not_read_count', {
axios.post(NODE_ENVS_MSG + '/get_not_read_count', {
user_id: this.supplier_id,//供应商id
sys_id: 17//云芯系统
}).then((res) => {
......@@ -514,7 +516,7 @@ export default {
var msg_ids = this.multipleSelection.map(obj => {
return obj.id
})
axios.post(news_url + '/update_msg', {
axios.post(NODE_ENVS_MSG + '/update_msg', {
user_id: this.supplier_id,//供应商id
sys_id: 17,//云芯系统
msg_ids: msg_ids.join(',')
......@@ -549,7 +551,7 @@ export default {
var msg_ids = this.multipleSelection.map(obj => {
return obj.id
})
axios.post(news_url + '/delete_msg', {
axios.post(NODE_ENVS_MSG + '/delete_msg', {
user_id: this.supplier_id,//供应商id
sys_id: 17,//云芯系统
msg_ids: msg_ids.join(',')
......
......@@ -4,10 +4,18 @@
<!--列表区-->
<div class="data-box">
<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="msg_type" label="消息内容" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="msg_type" label="附件" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="create_time" label="创建时间" width="160" :show-overflow-tooltip="true" align="center"></el-table-column>
<el-table-column prop="title" label="消息名称" :show-overflow-tooltip="true" align="center">
<template slot-scope="scope">
<a href="javascript:;" class="alink">{{ scope.row.title }}</a>
</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-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>
......@@ -19,6 +27,8 @@
import Vue from '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 {NODE_ENVS_MSG} from "../../ajax";
import axios from "_axios@0.21.4@axios";
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm;
......@@ -29,12 +39,11 @@ export default {
name: "notice",
data() {
return {
supplier_id: Number(localStorage.getItem('supplier_id')) || 0,
total: 0,
page: 1,
limit: 10,
list: [],
dialogVisible: false,
msgDetail: {}
list: []
};
},
created() {
......@@ -42,33 +51,32 @@ export default {
},
methods: {
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) {
this.list = res.data.list || [];
this.total = Number(res.data.total) || 0;
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;
}
} else {
this.$message({
message: res.msg,
type: 'error'
type: 'warning'
});
}
})
});
},
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 {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
viewChange(index, row) {
this.getMsgDetail(row.id);
handleSizeChange(val) {
this.limit = val;
this.getData();
},
handleCurrentChange(val) {
this.page = val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment