diff --git a/.env.development b/.env.development index 402ea18..b6f6ffd 100644 --- a/.env.development +++ b/.env.development @@ -13,3 +13,5 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true # 七牛云域名 VUE_APP_QINIU_DOMAIN = 'https://api.ccttiot.com' +# WebSocket地址 +VUE_APP_WS_HOST = 'ws://localhost:4001' diff --git a/.env.production b/.env.production index 9695533..0fdd40b 100644 --- a/.env.production +++ b/.env.production @@ -8,4 +8,7 @@ ENV = 'production' VUE_APP_BASE_API = '/prod-api' # 七牛云域名 -VUE_APP_QINIU_DOMAIN = 'https://api.ccttiot.com' \ No newline at end of file +VUE_APP_QINIU_DOMAIN = 'https://api.ccttiot.com' + +# WebSocket地址 +VUE_APP_WS_HOST = 'wss://pm.chuangtewl.com' \ No newline at end of file diff --git a/src/api/app/message.js b/src/api/app/message.js new file mode 100644 index 0000000..5d10982 --- /dev/null +++ b/src/api/app/message.js @@ -0,0 +1,39 @@ + +import request from '@/utils/request' + +/** + * 获取本人接收的消息列表 + * @param {Object} query 查询参数 + * @returns {Promise} + */ +export function appGetReceiveList(query) { + return request({ + url: '/app/message/receiveList', + method: 'get', + params: query + }) +} + +/** + * 标记消息已读 + * @param {number} id 消息ID + * @returns {Promise} + */ +export function appReadMessage(id) { + return request({ + url: '/app/message/read', + method: 'post', + params: { id } + }) +} + +/** + * 查询本人未读消息数量 + * @returns {Promise} + */ +export function appGetUnreadCount() { + return request({ + url: '/app/message/unreadCount', + method: 'get' + }) +} diff --git a/src/api/bst/message.js b/src/api/bst/message.js new file mode 100644 index 0000000..c9c621b --- /dev/null +++ b/src/api/bst/message.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询消息列表 +export function listMessage(query) { + return request({ + url: '/bst/message/list', + method: 'get', + params: query + }) +} + +// 查询消息详细 +export function getMessage(id) { + return request({ + url: '/bst/message/' + id, + method: 'get' + }) +} + +// 新增消息 +export function addMessage(data) { + return request({ + url: '/bst/message', + method: 'post', + data: data + }) +} + +// 修改消息 +export function updateMessage(data) { + return request({ + url: '/bst/message', + method: 'put', + data: data + }) +} + +// 删除消息 +export function delMessage(id) { + return request({ + url: '/bst/message/' + id, + method: 'delete' + }) +} diff --git a/src/components/Avatar/index.vue b/src/components/Avatar/index.vue index 7bd1343..bc2311b 100644 --- a/src/components/Avatar/index.vue +++ b/src/components/Avatar/index.vue @@ -1,10 +1,5 @@ @@ -128,6 +128,17 @@ export default { } }, methods: { + onCancel() { + this.refreshList(); + this.getInfo(this.detail.id); + }, + onSubmit() { + this.refreshList(); + this.getInfo(this.detail.id); + }, + refreshList() { + this.$emit('refresh'); + }, getRealUrl, // 取消任务 handleCancel() { diff --git a/src/views/bst/task/index.vue b/src/views/bst/task/index.vue index 10b3a0f..1eade09 100644 --- a/src/views/bst/task/index.vue +++ b/src/views/bst/task/index.vue @@ -121,11 +121,12 @@ @@ -227,14 +229,13 @@ export default { columns: [ {key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"}, {key: 'description', visible: true, label: '任务内容', minWidth: "350", sortable: false, overflow: false, align: 'left', width: null}, - {key: 'type', visible: true, label: '类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"}, - {key: 'level', visible: true, label: '优先', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"}, - {key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"}, {key: 'picture', visible: true, label: '图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, {key: 'projectName', visible: true, label: '项目', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, {key: 'owner', visible: true, label: '负责人', minWidth: null, sortable: false, overflow: false, align: 'center', width: "150"}, {key: 'createName', visible: true, label: '创建人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null}, - {key: 'createTime', visible: true, label: '时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "190"}, + {key: 'submitCount', visible: true, label: '提交', minWidth: null, sortable: false, overflow: false, align: 'center', width: "50"}, + {key: 'passCount', visible: true, label: '完成', minWidth: null, sortable: false, overflow: false, align: 'center', width: "50"}, + {key: 'createTime', visible: true, label: '时间', minWidth: null, sortable: true, overflow: false, align: 'left', width: "190"}, ], // 排序方式 orderSorts: ['ascending', 'descending', null],