通知和租户功能修改
This commit is contained in:
parent
f6e771085a
commit
00193a7252
@ -1,52 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询公告列表
|
||||
export function listNotice(query) {
|
||||
return request({
|
||||
url: '/system/notice/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/system/notice/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询公告详细
|
||||
export function getNotice(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/get?id=' + noticeId,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/notice/get?id=" + noticeId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增公告
|
||||
export function addNotice(data) {
|
||||
return request({
|
||||
url: '/system/notice/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/system/notice/create",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改公告
|
||||
export function updateNotice(data) {
|
||||
return request({
|
||||
url: '/system/notice/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/notice/update",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
export function delNotice(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/delete?id=' + noticeId,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/notice/delete?id=" + noticeId,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 推送公告
|
||||
export function pushNotice(noticeId) {
|
||||
return request({
|
||||
url: '/system/notice/push?id=' + noticeId,
|
||||
method: 'post'
|
||||
})
|
||||
url: "/system/notice/push?id=" + noticeId,
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
//推送公告直接到站内信
|
||||
export function pushMessage(noticeId) {
|
||||
return request({
|
||||
url: "/system/notice/pushMessage?id=" + noticeId,
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
@ -1,65 +1,73 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 使用租户名,获得租户编号
|
||||
export function getTenantIdByName(name) {
|
||||
return request({
|
||||
url: '/system/tenant/get-id-by-name',
|
||||
method: 'get',
|
||||
url: "/system/tenant/get-id-by-name",
|
||||
method: "get",
|
||||
params: {
|
||||
name
|
||||
}
|
||||
})
|
||||
name,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 创建租户
|
||||
export function createTenant(data) {
|
||||
return request({
|
||||
url: '/system/tenant/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/system/tenant/create",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新租户
|
||||
export function updateTenant(data) {
|
||||
return request({
|
||||
url: '/system/tenant/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/tenant/update",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除租户
|
||||
export function deleteTenant(id) {
|
||||
return request({
|
||||
url: '/system/tenant/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/tenant/delete?id=" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 获得租户
|
||||
export function getTenant(id) {
|
||||
return request({
|
||||
url: '/system/tenant/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/tenant/get?id=" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 获得租户分页
|
||||
export function getTenantPage(query) {
|
||||
return request({
|
||||
url: '/system/tenant/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/system/tenant/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出租户 Excel
|
||||
export function exportTenantExcel(query) {
|
||||
return request({
|
||||
url: '/system/tenant/export-excel',
|
||||
method: 'get',
|
||||
url: "/system/tenant/export-excel",
|
||||
method: "get",
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
responseType: "blob",
|
||||
});
|
||||
}
|
||||
|
||||
//获取租户列表信息
|
||||
export function getTenantList() {
|
||||
return request({
|
||||
url: "/system/tenant/getList",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
@ -261,11 +261,11 @@
|
||||
align="center"
|
||||
prop="equipNo"
|
||||
/>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="机床组件名"
|
||||
align="center"
|
||||
prop="componentName"
|
||||
/>
|
||||
/> -->
|
||||
<el-table-column
|
||||
label="规则参数名"
|
||||
align="center"
|
||||
@ -301,7 +301,7 @@
|
||||
align="center"
|
||||
prop="reasonDescription"
|
||||
/> -->
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
@ -310,7 +310,7 @@
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
@ -369,7 +369,6 @@
|
||||
@click="handelPatrolPlan"
|
||||
>
|
||||
点检方案提交</el-button>
|
||||
<el-button
|
||||
<el-button
|
||||
v-if="maintenanceOrderId !== null"
|
||||
type="success"
|
||||
@ -520,8 +519,8 @@
|
||||
style="height:500px"
|
||||
></div>
|
||||
</el-dialog>
|
||||
<alarm-submit-maintenance-order-form ref="submitOrderForm"/>
|
||||
<alarm-submit-maintenance-patrol-plan-form ref="submitPatrolPlanForm"/>
|
||||
<alarm-submit-maintenance-order-form ref="submitOrderForm" />
|
||||
<alarm-submit-maintenance-patrol-plan-form ref="submitPatrolPlanForm" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -535,10 +534,7 @@ import { getFieldList } from "@/api/data/query.js";
|
||||
import { getAlarmRules } from "@/api/system/alarm/alarmrules";
|
||||
import AlarmSubmitMaintenanceOrderForm from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue";
|
||||
import { getGatewayCardTree } from "@/api/system/gatewayinfo/card";
|
||||
import AlarmSubmitMaintenanceOrderForm
|
||||
from "@/views/system/maintenance/maintenanceInfo/alarmSubmitMaintenanceOrderForm.vue";
|
||||
import AlarmSubmitMaintenancePatrolPlanForm
|
||||
from "@/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue";
|
||||
import AlarmSubmitMaintenancePatrolPlanForm from "@/views/system/maintenance/maintenanceInfo/AlarmSubmitMaintenancePatrolPlanForm.vue";
|
||||
var _ = require("lodash");
|
||||
export default {
|
||||
name: "AlarmData",
|
||||
@ -637,16 +633,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
//判断显示维修工单提交还是显示点检方案提交
|
||||
showSubmitButton(){
|
||||
EquipAlarmDataApi.isSubmitPatrolPlan(this.$route.query.equipAlarmId).then(res=>{
|
||||
this.showPatrolPlanSubmit = res.data;
|
||||
console.log("this.showPatrolPlanSubmit",this.showPatrolPlanSubmit);
|
||||
if (res.data){
|
||||
EquipAlarmDataApi.isSubmitOrder(this.$route.query.equipAlarmId).then(res=>{
|
||||
this.maintenanceOrderId = res.data
|
||||
})
|
||||
showSubmitButton() {
|
||||
EquipAlarmDataApi.isSubmitPatrolPlan(this.$route.query.equipAlarmId).then(
|
||||
(res) => {
|
||||
this.showPatrolPlanSubmit = res.data;
|
||||
console.log("this.showPatrolPlanSubmit", this.showPatrolPlanSubmit);
|
||||
if (res.data) {
|
||||
EquipAlarmDataApi.isSubmitOrder(
|
||||
this.$route.query.equipAlarmId
|
||||
).then((res) => {
|
||||
this.maintenanceOrderId = res.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
},
|
||||
cardChange(e) {
|
||||
// console.log("选择:", e);
|
||||
@ -661,6 +661,7 @@ export default {
|
||||
async handleAlarmDataQuery(row) {
|
||||
//需要row提供匹配数据名称和单位等信息
|
||||
this.loading = true;
|
||||
console.log("时间", this.datetimeRange);
|
||||
//根据时间查询参数数据
|
||||
// this.dataQueryParams.nameKey = row
|
||||
// ? row.nameKey
|
||||
@ -687,7 +688,7 @@ export default {
|
||||
// );
|
||||
const alarmTime = new Date(this.selectedRow.lastAlarmTime);
|
||||
const hoursAgo = new Date(alarmTime.getTime() - 1 * 60 * 60 * 1000);
|
||||
this.datetimeRange = [hoursAgo, alarmTime];
|
||||
this.datetimeRange = [hoursAgo.toISOString(), alarmTime.toISOString()];
|
||||
this.handleAlarmDataQuery(null);
|
||||
},
|
||||
/**报警原因 */
|
||||
@ -699,7 +700,7 @@ export default {
|
||||
this.detailLoading = false;
|
||||
},
|
||||
/**报警趋势 */
|
||||
handleAlarmTrend(row) {
|
||||
async handleAlarmTrend(row) {
|
||||
if (_.endsWith(row.nameKey, "_diff")) {
|
||||
row.nameKey = row.nameKey.substr(0, row.nameKey.length - 5);
|
||||
}
|
||||
@ -766,7 +767,7 @@ export default {
|
||||
this.$refs.submitOrderForm.open(this.$route.query.equipAlarmId);
|
||||
},
|
||||
handelPatrolPlan() {
|
||||
this.$refs.submitPatrolPlanForm.open(this.$route.query.equipAlarmId)
|
||||
this.$refs.submitPatrolPlanForm.open(this.$route.query.equipAlarmId);
|
||||
},
|
||||
/**echart表初始化 */
|
||||
initchart(xData, yData, name, unit) {
|
||||
|
@ -1,71 +1,212 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<doc-alert title="站内信配置" url="https://doc.iocoder.cn/notify/" />
|
||||
<doc-alert
|
||||
title="站内信配置"
|
||||
url="https://doc.iocoder.cn/notify/"
|
||||
/>
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="是否已读" prop="readStatus">
|
||||
<el-select v-model="queryParams.readStatus" placeholder="请选择状态" clearable>
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item
|
||||
label="是否已读"
|
||||
prop="readStatus"
|
||||
>
|
||||
<el-select
|
||||
v-model="queryParams.readStatus"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="发送时间" prop="createTime">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
||||
<el-form-item
|
||||
label="发送时间"
|
||||
prop="createTime"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button>
|
||||
<el-button
|
||||
icon="el-icon-refresh"
|
||||
@click="resetQuery"
|
||||
>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 操作工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-row
|
||||
:gutter="10"
|
||||
class="mb8"
|
||||
>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpdateList">标记已读</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleUpdateList"
|
||||
>标记已读</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpdateAll">全部已读</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleUpdateAll"
|
||||
>全部已读</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" ref="tables" :data="list">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="发送人" align="center" prop="templateNickname" width="120" />
|
||||
<el-table-column label="发送时间" align="center" prop="createTime" width="180">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="tables"
|
||||
:data="list"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
/>
|
||||
<el-table-column
|
||||
label="发送人"
|
||||
align="center"
|
||||
prop="templateNickname"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
label="发送时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" align="center" prop="templateType" width="80">
|
||||
<el-table-column
|
||||
label="类型"
|
||||
align="center"
|
||||
prop="templateType"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.templateType" />
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE"
|
||||
:value="scope.row.templateType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="内容" align="center" prop="templateContent" />
|
||||
<el-table-column label="是否已读" align="center" prop="readStatus" width="80">
|
||||
<el-table-column
|
||||
label="标题"
|
||||
align="center"
|
||||
prop="title"
|
||||
/>
|
||||
<el-table-column
|
||||
label="内容"
|
||||
align="center"
|
||||
prop="content"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.readStatus"/>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
@click="handleUpdateSingle(scope.row)"
|
||||
>详情</el-button> -->
|
||||
<el-popover
|
||||
placement="right"
|
||||
width="400"
|
||||
trigger="hover"
|
||||
>
|
||||
<div style="text-align:center">消息通知内容详情</div>
|
||||
<div v-html="scope.row.content" />
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
type="text"
|
||||
>详情</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||
<el-table-column
|
||||
label="是否已读"
|
||||
align="center"
|
||||
prop="readStatus"
|
||||
width="80"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-button v-show="!scope.row.readStatus" size="mini" type="text" icon="el-icon-check" @click="handleUpdateSingle(scope.row)">已读</el-button>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.INFRA_BOOLEAN_STRING"
|
||||
:value="scope.row.readStatus"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
width="150"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
v-show="!scope.row.readStatus"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
@click="handleUpdateSingle(scope.row)"
|
||||
>已读</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMyNotifyMessagePage, updateAllNotifyMessageRead, updateNotifyMessageRead} from "@/api/system/notify/message";
|
||||
import {
|
||||
getNotifyMessagePage,
|
||||
getMyNotifyMessagePage,
|
||||
updateAllNotifyMessageRead,
|
||||
updateNotifyMessageRead,
|
||||
} from "@/api/system/notify/message";
|
||||
|
||||
export default {
|
||||
name: "SystemMyNotify",
|
||||
@ -84,7 +225,7 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
readStatus: null,
|
||||
createTime: []
|
||||
createTime: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -96,7 +237,12 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getMyNotifyMessagePage(this.queryParams).then(response => {
|
||||
// getMyNotifyMessagePage(this.queryParams).then(response => {
|
||||
// this.list = response.data.list;
|
||||
// this.total = response.data.total;
|
||||
// this.loading = false;
|
||||
// });
|
||||
getNotifyMessagePage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
@ -117,23 +263,23 @@ export default {
|
||||
if (list.length === 0) {
|
||||
return;
|
||||
}
|
||||
this.handleUpdate(list.map(v => v.id))
|
||||
this.handleUpdate(list.map((v) => v.id));
|
||||
},
|
||||
handleUpdateSingle(row) {
|
||||
this.handleUpdate([row.id])
|
||||
this.handleUpdate([row.id]);
|
||||
},
|
||||
handleUpdate(ids) {
|
||||
updateNotifyMessageRead(ids).then(response => {
|
||||
updateNotifyMessageRead(ids).then((response) => {
|
||||
this.$modal.msgSuccess("标记已读成功!");
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
handleUpdateAll(){
|
||||
updateAllNotifyMessageRead().then(response => {
|
||||
handleUpdateAll() {
|
||||
updateAllNotifyMessageRead().then((response) => {
|
||||
this.$modal.msgSuccess("全部已读成功!");
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user