Commit 9390ddfa authored by “yiyousong”'s avatar “yiyousong”
parents cc414884 091e9b9a
......@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<link rel="icon" href="<%= BASE_URL %>sbgl.ico" />
<title>设备管理平台</title>
<link
rel="stylesheet"
......
......@@ -328,3 +328,7 @@
text-align: right;
}
.addclass {
background: linear-gradient(90deg, #5ab6ff 0%, #2e9aff 100%) !important;
color: #fff !important;
}
......@@ -199,7 +199,7 @@ export default {
formatterLink(row, column, val) {
//const content = formatter(this.tableData, column-2, val);
return <el-link type="primary" href={val} target="_blank">{row.fileName}</el-link>
return <el-link type="primary" class="addclass" href={val} target="_blank">{row.fileName}</el-link>
//return content;
// return content ? <el-tag type={'info'} size='mini'>{content}</el-tag> : val
},
......
......@@ -7,7 +7,7 @@
<p>{{message}}</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="change">确定</el-button>
<el-button type="primary" class="addclass" size="mini" @click="change">确定</el-button>
</div>
<label slot="reference">
<slot></slot>
......
......@@ -7,7 +7,7 @@
<el-button size="mini" type="text" @click="visible = false"
>取消</el-button
>
<el-button type="primary" size="mini" @click="statusClick"
<el-button type="primary" class="addclass" size="mini" @click="statusClick"
>确定</el-button
>
</div>
......
......@@ -14,7 +14,7 @@
ref="upload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
<el-button size="mini" type="primary" class="addclass" >选取文件</el-button>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
......
......@@ -15,7 +15,7 @@
height="27"
width="27"
/>
<b style="color: white; font-size: 18px; margin-right: 42px">
<b style="color: white; font-size: 20px; font-weight: bold; margin-right: 20px">
AIOT智慧边缘物联网系统</b
>
</router-link>
......@@ -250,9 +250,10 @@ export default {
line-height: 66px;
font-size: 14px;
color: #eee;
background: #2681e8;
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
.layout-logo {
height: 50px;
padding-left: 23px;
.el-icon-menu {
display: none;
}
......@@ -276,8 +277,9 @@ export default {
//background: #1890ff;
color: #fff;
list-style-type: none;
border-bottom: 3px solid #fff;
// border-bottom: 3px solid #fff;
padding-bottom: 2px;
background-color: #1890ff;
}
}
}
......@@ -305,7 +307,7 @@ export default {
li {
a {
display: block;
padding: 0 10px;
padding: 0 15px;
height: 40px;
line-height: 40px;
font-size: 14px;
......@@ -313,6 +315,7 @@ export default {
&.router-link-active,
&[active] {
color: #1890ff;
font-weight: 600;
border-bottom: 2px solid #1890ff;
}
}
......@@ -321,7 +324,7 @@ export default {
}
}
@media screen and (max-width: 800px) {
@media screen and (max-width: 1500px) {
.layout-header {
.mobile-menu-list {
display: flex;
......@@ -351,6 +354,7 @@ export default {
width: 100%;
.layout-logo {
width: 40px;
height: 66px;
.el-icon-menu {
margin: auto;
display: inline-block;
......
......@@ -30,7 +30,7 @@
</div>
<div class="site-btn">
<el-button
type="primary"
type="primary" class="addclass"
size="small"
style="margin-right: 10px"
@click="onSucessSite"
......@@ -156,7 +156,7 @@ export default {
}
.ant-dropdown-link {
padding: 0 20px;
font-size: 14px;
font-size: 16px;
min-width: 200px;
color: #eee;
display: inline-block;
......
......@@ -146,7 +146,7 @@ export default {
<style lang="less">
.tuli {
width: 400px;
top: 60px;
top: 20px;
left: 34px;
position: absolute;
float: left;
......
......@@ -153,7 +153,7 @@
<el-form-item>
<el-button
type="primary"
type="primary" class="addclass"
icon="el-icon-search"
@click="onSubmit"
title="查询"
......
......@@ -7,7 +7,7 @@
<el-button size="mini" type="text" @click="visible = false"
>取消</el-button
>
<el-button type="primary" size="mini" @click="statusClick"
<el-button type="primary" class="addclass" size="mini" @click="statusClick"
>确定</el-button
>
</div>
......
......@@ -13,7 +13,7 @@
<slot name="table-head-center">
<el-button
v-if="isShowButton('notAdd')"
type="primary"
type="primary" class="addclass"
icon="el-icon-plus"
plain
size="mini"
......@@ -316,7 +316,7 @@ export default {
margin-bottom: 10px;
//padding-bottom: 12px;
// padding-top: 7px;
border-bottom: 1px solid #ededed;
// border-bottom: 1px solid #ededed;
.el-breadcrumb {
margin-right: 30px;
}
......
......@@ -3,7 +3,7 @@
<el-form-item>
<slot name="prepend"></slot>
<slot>
<el-button v-if="!noSaveBtn" type="primary" @click='$emit("submit")' size='small' icon='el-icon-circle-check-outline'>保存</el-button>
<el-button v-if="!noSaveBtn" type="primary" class="addclass" @click='$emit("submit")' size='small' icon='el-icon-circle-check-outline'>保存</el-button>
<el-button v-if="!noCancelBtn" @click="$router.go(-1)" size='small' icon='el-icon-circle-close-outline'>取消</el-button>
</slot>
<slot name="append"></slot>
......
This diff is collapsed.
......@@ -45,7 +45,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -12,7 +12,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small"
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small"
>返回</el-button
>
</template>
......
......@@ -13,7 +13,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>
<el-button slot="table-head-left2" style="margin-left: 10px" type="primary" size="mini" @click="doExport"
:disabled="isExport">导出</el-button>
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
......@@ -135,6 +128,7 @@ export default {
<style lang="less" >
.buttons {
display: flex;
.el-row {
margin-left: 20px;
}
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="电话号码" label-class-name="labelClass" content-class-name="contentClass">
{{form.mobile}}
......
......@@ -28,7 +28,7 @@
</div>
<div class="site-btn">
<el-button
type="primary"
type="primary" class="addclass"
size="small"
style="margin-right: 10px"
@click="onSucessSite"
......
......@@ -14,7 +14,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="应用编码" label-class-name="labelClass" content-class-name="contentClass">
{{form.appCode}}
......
......@@ -58,7 +58,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
<template>
<div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>
<el-button slot="table-head-left2" style="margin-left: 10px" type="primary" class="addclass" size="mini" @click="doExport"
:disabled="isExport">导出</el-button>
<el-tag slot="table-head-row2-left" size="mini"
>告警次数:{{ tableData.totalCount }}</el-tag
>
<el-tag slot="table-head-row2-left" size="mini" style="margin: 10px">告警次数:{{ tableData.totalCount }}</el-tag>
<el-tag
slot="table-head-row2-left"
size="mini"
style="margin: 5px"
type="danger"
>危险:{{ tableData.dangerCount }}</el-tag
>
<el-tag slot="table-head-row2-left" size="mini" style="margin: 10px" type="danger">危险:{{ tableData.dangerCount
}}</el-tag>
<el-tag
slot="table-head-row2-left"
size="mini"
style="margin: 5px"
type="warning"
>次要:{{ tableData.subCount }}</el-tag
>
<el-tag slot="table-head-row2-left" size="mini" style="margin: 10px" type="warning">次要:{{ tableData.subCount
}}</el-tag>
<el-tag
slot="table-head-row2-left"
size="mini"
style="margin: 5px"
type="info"
>一般:{{ tableData.normalCount }}</el-tag
>
<el-tag slot="table-head-row2-left" size="mini" style="margin: 10px" type="info">一般:{{ tableData.normalCount
}}</el-tag>
</LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
......
......@@ -29,7 +29,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -12,7 +12,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="设备编号" label-class-name="labelClass" content-class-name="contentClass">
{{form.deviceNum}}
......
......@@ -10,7 +10,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -17,7 +17,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="产品Id" label-class-name="labelClass" content-class-name="contentClass">
{{form.productId}}
......
......@@ -12,7 +12,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="模块名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.moduleName}}
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="模块名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.moduleName}}
......
......@@ -11,7 +11,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
<template>
<div class="page">
<div class="xs-title">
<div class="active">生产产商</div>
</div>
<LayoutTable :data="tableData" :config="tableConfig"> </LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
......@@ -17,7 +20,7 @@ export default {
drawerShow,
},
mixins: [table],
created() {},
created() { },
methods: {
/** 重写新增方法 */
toAdd(row) {
......@@ -85,4 +88,23 @@ export default {
};
},
};
</script>
\ No newline at end of file
</script>
<style scoped lang="less">
.xs-title {
padding-left: 20px;
background: #fff;
border-bottom: 1px solid #ededed;
display: flex;
height: 40px;
line-height: 40px;
font-size: 14px;
.active {
color: #1890ff;
font-weight: 600;
border-bottom: 2px solid #1890ff;
padding: 0 15px;
}
}
</style>
\ No newline at end of file
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="设备生产厂商名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.firmName}}
......
......@@ -19,7 +19,7 @@
</el-form-item>
<el-form-item size="large">
<el-button
type="primary"
type="primary" class="addclass"
native-type="submit"
:loading="loading"
@click="onSubmit"
......
......@@ -16,7 +16,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -11,7 +11,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -6,7 +6,7 @@
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
<el-button type="primary" class="addclass" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="产品Id" label-class-name="labelClass" content-class-name="contentClass">
{{form.productId}}
......
......@@ -35,7 +35,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -57,7 +57,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
<template>
<div class="page">
<el-row :gutter="20">
<el-row :gutter="20" class="pd20">
<el-col :span="6" :xs="12" class="mytree">
<el-card>
<div slot="header">
<span><b class="cardTitle">站点分布</b></span>
<el-button style="float: right" @click="switchStat" type="text"
>切换为地图模式</el-button
>
<el-button style="float: right" @click="switchStat" type="text">切换为地图模式</el-button>
</div>
<el-scrollbar style="height: 100%">
<el-tree
size="mini"
ref="siteTree"
:data="areaData"
id="el-tree"
node-key="id"
indent="4"
:props="treeProps"
:load="loadNode"
highlight-current
default-expand-all
:expand-on-click-node="false"
:render-content="renderContent"
@node-click="handleNodeClick"
>
<el-tree size="mini" ref="siteTree" :data="areaData" id="el-tree" node-key="id" indent="4" :props="treeProps"
:load="loadNode" highlight-current default-expand-all :expand-on-click-node="false"
:render-content="renderContent" @node-click="handleNodeClick">
</el-tree>
</el-scrollbar>
</el-card>
......@@ -33,22 +19,9 @@
<el-col :span="18" :xs="12">
<el-card>
<el-row>
<LayoutTable
ref="layoutTable"
:data="tableData"
notAdd
notDel
:config="tableConfig"
>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>
<LayoutTable ref="layoutTable" :data="tableData" notAdd notDel :config="tableConfig">
<el-button slot="table-head-left2" style="margin-left: 10px" type="primary" class="addclass" size="mini" @click="doExport"
:disabled="isExport">导出</el-button>
</LayoutTable>
</el-row>
</el-card>
......@@ -245,9 +218,11 @@ export default {
.el-card__body {
padding: 10px;
}
.el-calendar-table .el-calendar-day {
height: 70px;
}
.is-selected {
color: #fa3b19;
}
......@@ -261,32 +236,32 @@ export default {
border-bottom: 3px solid rgb(20, 134, 248);
padding-bottom: 2px;
}
.mytree ::v-deep {
.el-tree--highlight-current
::v-deep
.el-tree-node.is-checked
> .el-tree-node__content {
.el-tree--highlight-current ::v-deep .el-tree-node.is-checked>.el-tree-node__content {
background-color: rgb(255, 255, 255);
color: rgb(64, 158, 255);
}
.el-tree--highlight-current
::v-deep
.el-tree-node.is-current
> .el-tree-node__content {
.el-tree--highlight-current ::v-deep .el-tree-node.is-current>.el-tree-node__content {
background-color: rgb(255, 255, 255);
color: rgb(64, 158, 255);
}
.el-tree > .el-tree-node:after {
.el-tree>.el-tree-node:after {
border-top: none;
}
.el-tree-node {
position: relative;
padding-left: 16px;
}
//节点有间隙,隐藏掉展开按钮就好了,如果觉得空隙没事可以删掉
.el-tree-node__expand-icon.is-leaf {
display: none;
}
.el-tree-node__children {
padding-left: 16px;
}
......@@ -295,11 +270,11 @@ export default {
height: 38px;
}
.el-tree > .el-tree-node:before {
.el-tree>.el-tree-node:before {
border-left: none;
}
.el-tree > .el-tree-node:after {
.el-tree>.el-tree-node:after {
border-top: none;
}
......
......@@ -2,21 +2,13 @@
<div>
<MapDetail ref="map" :markersData="originData" @choose="getDetailData">
<el-card body-style="padding:0px;" slot="leftTop1">
<el-button
type="text"
size="mini"
style="margin-left: 10px"
icon="el-icon-back"
@click="switchStat"
>返回至站点分布</el-button
>
<el-button type="text" size="mini" style="margin-left: 10px" icon="el-icon-back"
@click="switchStat">返回至站点分布</el-button>
</el-card>
<el-card slot="leftTop">
<el-row type="flex" justify="space-between">
<span style="font-size: 18px"
><b>{{ info.siteName }}</b></span
>
<span style="font-size: 18px"><b>{{ info.siteName }}</b></span>
</el-row>
<el-divider></el-divider>
......@@ -27,11 +19,8 @@
<el-descriptions-item label="站点地址">{{
info.address
}}</el-descriptions-item>
<el-descriptions-item
label="联系人"
:labelStyle="{ 'text-align': 'right', width: '50px' }"
>{{ info.leadingOfficial }}</el-descriptions-item
>
<el-descriptions-item label="联系人" :labelStyle="{ 'text-align': 'right', width: '50px' }">{{ info.leadingOfficial
}}</el-descriptions-item>
<el-descriptions-item label="联系电话">
{{ info.leadingOfficialTelephone }}
</el-descriptions-item>
......@@ -43,33 +32,23 @@
<el-divider></el-divider>
<el-row type="flex" justify="space-around">
<el-col :span="4">
<span style="font-size: 13px"
><b>{{ info.deviceTotal }}</b></span
><br />
<span style="font-size: 13px"><b>{{ info.deviceTotal }}</b></span><br />
<span style="font-size: 12px">设备总数</span>
</el-col>
<el-col :span="4">
<span style="font-size: 13px"
><b style="color: green">{{ info.onlineCount }}</b></span
><br />
<span style="font-size: 13px"><b style="color: green">{{ info.onlineCount }}</b></span><br />
<span style="font-size: 12px">在线</span>
</el-col>
<el-col :span="4">
<span style="font-size: 13px"
><b style="color: red">{{ info.offlineCount }}</b></span
><br />
<span style="font-size: 13px"><b style="color: red">{{ info.offlineCount }}</b></span><br />
<span style="font-size: 12px">离线</span>
</el-col>
<el-col :span="4">
<span style="font-size: 13px"
><b style="color: orange">{{ info.stopCount }}</b></span
><br />
<span style="font-size: 13px"><b style="color: orange">{{ info.stopCount }}</b></span><br />
<span style="font-size: 12px">停用</span>
</el-col>
<el-col :span="4">
<span style="font-size: 13px"
><b style="color: grey">{{ info.unActiveCount }}</b></span
><br />
<span style="font-size: 13px"><b style="color: grey">{{ info.unActiveCount }}</b></span><br />
<span style="font-size: 12px">待激活</span>
</el-col>
</el-row>
......@@ -77,81 +56,39 @@
<el-divider></el-divider>
<el-row type="flex" justify="space-around" style="margin-top: 10px">
<el-button
type="primary"
@click="switchList"
size="mini"
icon="el-icon-tickets"
>列表模式</el-button
>
<el-button type="primary" size="mini" icon="el-icon-edit-outline"
>编辑站点</el-button
>
<el-button
type="primary"
size="mini"
@click="addDevice"
icon="el-icon-plus"
>添加设备</el-button
>
<el-button type="primary" class="addclass" @click="switchList" size="mini">列表模式</el-button>
<el-button type="primary" class="addclass" size="mini" icon="el-icon-edit-outline">编辑站点</el-button>
<el-button type="primary" class="addclass" size="mini" @click="addDevice" icon="el-icon-plus">添加设备</el-button>
</el-row>
</el-card>
<el-col
slot="rightTop"
style="box-shadow: 12px 2px 12px 12px rgba(0, 0, 0, 0.1)"
>
<el-col slot="rightTop" style="box-shadow: 12px 2px 12px 12px rgba(0, 0, 0, 0.1)">
<el-row type="flex" justify="space-around">
<el-select
style="padding: 5px"
size="mini"
@change="deviceStatuschange"
v-model="deviceStatus"
placeholder="请选择设备状态"
>
<el-option
v-for="($label, $value) in tableData.dict.deviceStatus"
:key="$value"
:label="$label"
:value="$value"
></el-option>
<el-select style="padding: 5px" size="mini" @change="deviceStatuschange" v-model="deviceStatus"
placeholder="请选择设备状态">
<el-option v-for="($label, $value) in tableData.dict.deviceStatus" :key="$value" :label="$label"
:value="$value"></el-option>
</el-select>
<span> </span>
</el-row>
<el-row>
<el-input
size="mini"
v-model="deviceName"
@change="deviceNameChange"
style="padding: 5px"
placeholder="请输入设备编码"
></el-input>
<el-input size="mini" v-model="deviceName" @change="deviceNameChange" style="padding: 5px"
placeholder="请输入设备编码"></el-input>
</el-row>
<el-divider></el-divider>
<el-row
v-for="(label, value, index) in tableData.dict.productId"
:key="index"
type="flex"
style="border-bottom: 1px solid #e8eaec; padding: 10px"
justify="space-between"
>
<el-row v-for="(label, value, index) in tableData.dict.productId" :key="index" type="flex"
style="border-bottom: 1px solid #e8eaec; padding: 10px" justify="space-between">
<!-- <img src="../../assets/images/排队机.png" alt="" /> -->
<img :src="require(`../../assets/images/${label}.png`)" />
<!-- <i style="font-size: 20px" class="el-icon-location-information"></i> -->
<span style="font-size: 12px">{{ label }}</span>
<el-switch
v-model="items[index]"
:active-value="value"
:inactive-value="0"
@change="switchChange"
active-color="#2882ED"
inactive-color="#8C8B8E"
>
<el-switch v-model="items[index]" :active-value="value" :inactive-value="0" @change="switchChange"
active-color="#2882ED" inactive-color="#8C8B8E">
</el-switch>
</el-row>
</el-col>
......@@ -363,6 +300,7 @@ export default {
background: 0 0;
border-top: 1px solid #e8eaec;
}
.back {
width: 200px;
top: 20px;
......@@ -370,9 +308,11 @@ export default {
position: absolute;
float: left;
}
.el-row {
margin-bottom: 5px;
margin-top: 5px;
&:last-child {
margin: 0;
}
......@@ -384,58 +324,72 @@ export default {
font-size: 18px;
color: red;
}
.location1 {
font-size: 18px;
color: blueviolet;
}
.location2 {
font-size: 18px;
color: aqua;
}
.location3 {
font-size: 18px;
color: coral;
}
.location4 {
font-size: 18px;
color: slateblue;
}
.location5 {
font-size: 18px;
color: purple;
}
.location6 {
font-size: 18px;
color: darkgreen;
}
.location7 {
font-size: 18px;
color: magenta;
}
.location8 {
font-size: 18px;
color: goldenrod;
}
.location9 {
font-size: 18px;
color: orchid;
}
.location10 {
font-size: 18px;
color: navy;
}
.location11 {
font-size: 18px;
color: darkred;
}
.location12 {
font-size: 18px;
color: forestgreen;
}
.location13 {
font-size: 18px;
color: cyan;
}
.location14 {
font-size: 18px;
color: deepskyblue;
......
......@@ -69,7 +69,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -58,7 +58,7 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button type="primary" class="addclass" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
......
......@@ -66,7 +66,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -29,7 +29,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -31,7 +31,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="auth.visible = false">取 消</el-button>
<el-button size="mini" type="primary" @click="saveAuth"
<el-button size="mini" type="primary" class="addclass" @click="saveAuth"
>确 定</el-button
>
</div>
......@@ -74,7 +74,7 @@
/>
<el-col style="text-align: center">
<el-button
type="primary"
type="primary" class="addclass"
size="mini"
icon="el-icon-search"
@click="searchUserList"
......@@ -145,7 +145,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" @click="user.visible = false">取 消</el-button>
<el-button size="mini" type="primary" @click="saveUser"
<el-button size="mini" type="primary" class="addclass" @click="saveUser"
>确 定</el-button
>
</div>
......
......@@ -60,7 +60,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -55,7 +55,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
type="primary"
type="primary" class="addclass"
v-if="pageInfo.type !== 'view'"
@click="submitForm"
>确 定</el-button
......
......@@ -35,7 +35,7 @@
/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="userRoleConfirm">确 定</el-button>
<el-button type="primary" class="addclass" @click="userRoleConfirm">确 定</el-button>
<el-button @click="userRoleDialog.open = false">取 消</el-button>
</div>
</el-dialog>
......
......@@ -72,7 +72,8 @@
<profiles.redis.port>6379</profiles.redis.port>
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password>hotel@2020</profiles.redis.password>
<profiles.redis.database>6</profiles.redis.database>
<profiles.redis.database>3</profiles.redis.database>
<profiles.redis.sentinel>192.168.0.252:26379,192.168.0.251:26379,192.168.0.98:26379</profiles.redis.sentinel>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
......@@ -147,6 +148,7 @@
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password>hotel@2020</profiles.redis.password>
<profiles.redis.database>6</profiles.redis.database>
<profiles.redis.database>6</profiles.redis.database>
<profiles.rabbitmq.host>172.15.28.115</profiles.rabbitmq.host>
<profiles.rabbitmq.port>5672</profiles.rabbitmq.port>
<profiles.rabbitmq.username>taxi_mq</profiles.rabbitmq.username>
......
......@@ -71,8 +71,17 @@ public class CustomerKeyExpirationListener implements MessageListener {
if (deviceEntity.getDeviceStatus() == DeviceStatusEnum.在线.getValue()) {
deviceEntity.setOfflineTime(new Date());
deviceEntity.setDeviceStatus(DeviceStatusEnum.离线.getValue());
deviceService.update(deviceEntity);
DeviceEntity entity = new DeviceEntity();
entity.setOnlineTime(new Date());
entity.setUpdateTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.离线.getValue());
DeviceEntity condition = new DeviceEntity();
condition.setId(deviceEntity.getId());
deviceService.getDeviceDao().update(entity, condition);
deviceService.putCache(deviceEntity.getId().toString(), deviceEntity);
log.info("deviceCode:{},deviceName:{}==>离线", deviceEntity.getDeviceCode(), deviceEntity.getDeviceName());
// deviceService.update(deviceEntity);
PlatformEntity platformEntity = platformService.get(deviceEntity.getPlatformId());
ProductEntity productEntity = productService.get(deviceEntity.getProductId());
if (!ObjectUtils.isEmpty(platformEntity) && !ObjectUtils.isEmpty(productEntity)) {
......
......@@ -67,7 +67,7 @@ public class DirectDynamicListener implements MessageListener {
String messageType = queueMsg.getHeaders().getData().get(MESSAGETYPE);
try {
if (ObjectUtils.isEmpty(deviceCode)) {
log.info("onMessage deviceCode is null,receive data:{},queue:{}", data,queue);
log.info("onMessage deviceCode is null,receive data:{},queue:{}", data, queue);
return;
}
......@@ -82,10 +82,9 @@ public class DirectDynamicListener implements MessageListener {
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
DeviceEntity condition = new DeviceEntity();
condition.setId(deviceEntity.getId());
deviceService.getDeviceDao().update(entity, condition);
int update = deviceService.getDeviceDao().update(entity, condition);
// deviceService.update(deviceEntity);
deviceService.putCache(deviceEntity.getId().toString(),deviceEntity);
PlatformEntity platformEntity = platformService.get(deviceEntity.getPlatformId());
ProductEntity productEntity = productService.get(deviceEntity.getProductId());
......@@ -93,6 +92,7 @@ public class DirectDynamicListener implements MessageListener {
//新增设备通知第三方平台
deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.ONLINE);
}
log.info("id:{},deviceCode:{} deviceStatus:{}==>上线 ", deviceEntity.getId(), deviceEntity.getDeviceCode(), deviceEntity.getDeviceStatus());
}
if (!Constant.MESSAGETYPE_HEARTBEAT.equalsIgnoreCase(messageType)) {
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
......
......@@ -2,7 +2,7 @@ package com.mortals.xhx.busiz.req;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
......@@ -14,5 +14,10 @@ public class UploadDeviceReq extends DeviceReq {
private String action;
private List<String> deviceCodeList;
private String content;
}
package com.mortals.xhx.busiz.web;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.URLDecoder;
......@@ -990,7 +991,7 @@ public class DeviceApiController {
}
public static void main(String[] args) {
public static void main(String[] args) throws Exception {
String domain = "http://10.12.185.213:11078";
UrlBuilder urlBuilder = UrlBuilder.ofHttp(domain).addPath("test");
......@@ -1025,6 +1026,18 @@ public class DeviceApiController {
System.out.println(decrypt);*/
//String content = EncryptUtil.myEnscrt("", 9, DES_STR, ENCRYPT_STR);
//System.out.println(content);
/* String decrypt = EncryptUtil.decrypt("W10=", ENCRYPT_STR);
System.out.println(decrypt);*/
System.out.println(new String(Base64.decode("W10=")));
}
......
package com.mortals.xhx.busiz.web;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
......@@ -25,6 +26,7 @@ import com.mortals.xhx.queue.TbQueueMsg;
import com.mortals.xhx.queue.TbQueueMsgHeaders;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -66,9 +68,9 @@ public class DeviceSendMsgController {
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, MESSAGETYPE_NOTIFY_REFRESH);
header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime());
header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), "W10=", header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE, Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg));
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE, Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(), JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
......@@ -82,13 +84,12 @@ public class DeviceSendMsgController {
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity,null);
deviceLogService.save(deviceLogEntity, null);
}
TimeUnit.SECONDS.sleep(1);
}
}
catch (InterruptedException e) {
log.error("异常",e);
} catch (InterruptedException e) {
log.error("异常", e);
}
};
Thread thread = new Thread(runnable);
......@@ -105,5 +106,66 @@ public class DeviceSendMsgController {
}
/**
* 下发消息
*
* @param req
* @return
*/
@PostMapping("downMsg")
@UnAuth
public String downMsg(@RequestBody UploadDeviceReq req) {
log.info("【设备通知数据】【请求体】--> " + JSONObject.toJSONString(req));
ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try {
if (!ObjectUtils.isEmpty(req.getDeviceCodeList())) {
DeviceQuery deviceQuery = new DeviceQuery();
deviceQuery.setDeviceCodeList(req.getDeviceCodeList());
//查询站点设备并通知每个设备
List<DeviceEntity> deviceList = deviceService.find(deviceQuery);
String content = "W10=";
if (!ObjectUtils.isEmpty(req.getContent())) {
content = Base64.encode(req.getContent());
}
try {
for (DeviceEntity deviceEntity : deviceList) {
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, req.getAction());
header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), content, header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE, Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(), JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(req.getAction());
deviceLogEntity.setContent(content);
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity, null);
}
} catch (Exception e) {
log.error("异常", e);
}
}
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
}
log.debug("响应【设备通知刷新数据】【响应体】--> " + JSONObject.toJSONString(rsp));
return JSON.toJSONString(rsp);
}
}
......@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ILogService;
import com.mortals.framework.service.impl.FileLogServiceImpl;
import com.mortals.xhx.busiz.req.TestReq;
......@@ -43,6 +44,8 @@ public class TestSendMsgController {
private ProductService productService;
@Autowired
private DeviceService deviceService;
@Autowired
private ICacheService cacheService;
/**
* 发送日志消息
......@@ -126,6 +129,15 @@ public class TestSendMsgController {
}
@RequestMapping(value = "{key}/{value}", method = RequestMethod.GET)
public String setData(@PathVariable("key") String key,
@PathVariable("value") String value) {
cacheService.set(key, value);
String s =cacheService.get(key);
return s;
}
public static void main(String[] args) {
String resp = HttpUtil.get("http://59.225.206.13:8331/oauth-pro/admin-pro/sys/randomImage/1675827431800?_t=1675827431");
......
package com.mortals.xhx.daemon.applicationservice;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.xhx.base.framework.listener.DirectDynamicListener;
import com.mortals.xhx.base.system.message.impl.MessageProducer;
......@@ -12,14 +11,11 @@ import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.service.PlatformService;
import com.mortals.xhx.module.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.listener.DirectMessageListenerContainer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.Collection;
/**
* 初始化设备消费者注册
*
......@@ -44,8 +40,6 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
private SendTaskThreadPool sendTaskThreadPool;
@Autowired
private DirectDynamicListener directDynamicListener;
@Autowired
private RabbitTemplate rabbitTemplate;
@Override
public void start() {
......@@ -53,8 +47,6 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
sendTaskThreadPool.init(20);
log.info("服务端消息队列初始化服务开始..");
Collection<String> rabbitmqQueues = rabbitTemplate.expectedQueueNames();
log.info("queues:{}", JSON.toJSONString(rabbitmqQueues));
deviceService.find(new DeviceEntity())
......@@ -71,6 +63,7 @@ public class DeviceComsumersRegisterService implements IApplicationStartedServic
.stream()
.filter(f -> !ObjectUtils.isEmpty(platformService.get(f.getPlatformId())))
.filter(f -> !ObjectUtils.isEmpty(productService.get(f.getProductId())))
.filter(f->!ObjectUtils.isEmpty(f.getDeviceCode()))
.map(item -> Constant.UPLOAD_TOPIC + item.getDeviceCode())
.toArray(String[]::new);
......
......@@ -80,8 +80,7 @@ public class DeviceRestartTaskImpl implements ITaskExcuteService {
});
//定时删除日志 7天前
DeviceLogQuery contidion = new DeviceLogQuery();
DateUtils.addCurrDate(-7);
contidion.setCreateTimeEnd(DateUtils.getDateTimeStr(DateUtils.addCurrDate(-7),DateUtils.P_yyyy_MM_dd_HH_mm_ss));
contidion.setCreateTimeEnd(DateUtils.getDateTimeStr(DateUtils.addCurrDate(-3),DateUtils.P_yyyy_MM_dd_HH_mm_ss));
deviceLogService.getDao().delete(contidion);
}
......
......@@ -596,7 +596,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
protected void removeBefore(Long[] ids, Context context) throws AppException {
Long[] removeIds = Arrays.asList(ids).stream().map(id -> {
DeviceEntity deviceEntity = this.get(id, context);
if (!ObjectUtils.isEmpty(deviceEntity)) {
......
......@@ -32,6 +32,9 @@ spring:
min-idle: 0
max-active: 100
max-wait: 1000
# sentinel:
# master: mymaster
# nodes: @profiles.redis.sentinel@
cloud:
loadbalancer:
ribbon:
......
......@@ -179,13 +179,13 @@ Content-Type: application/json
[
{
"data": "{xxxx}",
"data": "xxxx",
"deviceCode": "a102",
"messageType": "aaaa",
"timestamp": 1654656951795
},
{
"data": "{bbbbbb}",
"data": "bbbbbb",
"deviceCode": "a102",
"messageType": "bbbb",
"timestamp": 1654656951795
......
......@@ -42,5 +42,10 @@ GET {{baseUrl}}/sms/set/delete?id={{SmsSet_id}}
Accept: application/json
###redis 测试
GET {{baseUrl}}/test/one/49
Accept: application/json
......@@ -726,6 +726,44 @@ data|object|数据对象|-
```
### 接收第三方平台下发设备消息
**请求URL:** m/notify/downMsg
**请求方式:** POST
**内容类型:** application/json;charset=utf-8
**简要描述:**
**请求参数:**
参数名称| 类型 |备注|必填|其它
:------|:--------|:--|:---|:---
deviceCodeList| Arrays |设备编码列表|是|-
action| String |设备下发消息行为,消息类型编号|是|-
content| String |下发消息内容|是|默认为[]数组内容
**请求样例:**
```
{}
```
**响应参数:**
参数名称 |参数类型|备注|其它
---|---|---|---
code|Integer|结果码|见附录码表
msg|String|消息|-
data|object|数据对象|-
**响应消息样例:**
```
```
### 接收第三方平台命令消息
**请求URL:** m/api/callback
......
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 to comment