This commit is contained in:
2021-10-28 15:33:57 +08:00
parent 1f69e958b5
commit 03043f1c6d
28 changed files with 13254 additions and 1 deletions

30
src/App.vue Normal file
View File

@@ -0,0 +1,30 @@
<!--
* @Author: zwq
* @Date: 2021-10-11 08:46:56
* @LastEditors: zwq
* @LastEditTime: 2021-10-26 14:25:17
* @Description:
-->
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
height: calc(100vh - 20px);
background-color: #e7eaed;
}
</style>

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,59 @@
<!--
* @Author: zwq
* @Date: 2021-10-12 14:02:20
* @LastEditors: zwq
* @LastEditTime: 2021-10-26 14:46:02
* @Description:
-->
<template>
<el-main
style="border:5px solid #00A6AC;padding:0;box-shadow: 1px 1px 15px #888888;"
>
<canvas id="mycanvas"> </canvas>
</el-main>
</template>
<script>
export default {
data() {
return {
ctx: {},
top: 0,
left: 0,
}
},
mounted () {
let canvas = document.getElementById('mycanvas')
this.ctx = canvas.getContext('2d')
canvas.width = window.innerWidth - 412
canvas.height = window.innerHeight - 270
this.top = canvas.getBoundingClientRect().top
this.left = canvas.getBoundingClientRect().left
this.ctx.beginPath()
this.ctx.lineWidth = 3
this.ctx.strokeStyle = '#FD8829'
this.ctx.moveTo(10, window.innerHeight - 290)
this.ctx.lineTo(100, window.innerHeight - 290)
this.ctx.moveTo(20, window.innerHeight - 280)
this.ctx.lineTo(20, window.innerHeight - 380)
this.ctx.moveTo(20, window.innerHeight/2 - 200)
this.ctx.lineTo(1000, window.innerHeight/2 - 200)
this.ctx.fillText('X', 60, window.innerHeight - 275)
this.ctx.fillText('Y', 10, window.innerHeight - 330)
this.ctx.stroke()
this.ctx.closePath()
},
created () {
this.init()
},
methods: {
init(){
console.log('aaa')
}
}
}
</script>
<style scoped>
</style>

55
src/components/main.vue Normal file
View File

@@ -0,0 +1,55 @@
<!--
* @Author: zwq
* @Date: 2021-10-12 13:49:08
* @LastEditors: zwq
* @LastEditTime: 2021-10-26 14:38:01
* @Description:
-->
<template>
<el-container style="padding:20px">
<el-aside style="width:200px;height:calc(100vh - 60px)">
<div style="width:199px;height:70px;margin-bottom:2px;background-color:#545c64">
<i class="el-icon-set-up" style="font-size: 42px;color:white;line-height:70px;"></i>
</div>
<el-menu
:default-active="activeIndex"
@select="handleSelect"
background-color="#545c64"
text-color="#fff"
style="height:calc(100vh - 132px)"
active-text-color="#ffd04b"
>
<el-menu-item index="1">任务信息</el-menu-item>
<el-menu-item index="2">任务日志</el-menu-item>
<el-menu-item index="3">设备运行监控</el-menu-item>
</el-menu>
</el-aside>
<el-main style="padding:0;padding-left:20px;">
<router-view></router-view>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
activeIndex: "1",
urlArr: ["/taskInfo", "/taskLog", "/equipmentMonitor"]
};
},
mounted() {
this.init();
},
methods: {
init() {
this.$router.push({ path: this.urlArr[this.activeIndex - 1] });
},
handleSelect(key) {
this.$router.push({ path: this.urlArr[key - 1] });
}
}
};
</script>
<style scoped></style>

129
src/components/taskInfo.vue Normal file
View File

@@ -0,0 +1,129 @@
<!--
* @Author: zwq
* @Date: 2021-10-11 16:38:28
* @LastEditors: zwq
* @LastEditTime: 2021-10-27 16:17:23
* @Description:
-->
<template>
<div>
<div style="margin:0 0 20px;text-align:left">
<el-button type="primary" icon="el-icon-refresh" @click="init"
>刷新</el-button
>
</div>
<div>
<el-table :data="tableData" stripe border style="width: 100%">
<el-table-column type="index" align="center" label="序号" width="80">
</el-table-column>
<el-table-column prop="code" align="center" label="任务编码">
</el-table-column>
<el-table-column prop="status" align="center" label="状态">
<template slot-scope="scope">
<span>{{
scope.row.status === 0
? "等待执行"
: scope.row.status === 1
? "执行中"
: "执行完成"
}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
v-show="scope.row.status === 1"
@click="handleEdit(scope.row.id)"
>停止</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
current: 1,
size: 500,
tableData: []
};
},
mounted() {
this.init();
},
methods: {
init() {
this.$axios({
method: "post",
url: "/api/business/t-wcs-task/findAll",
data: {
current: this.current,
size: this.size
}
}).then(res => {
if (res && res.data.code === 0) {
this.tableData = res.data.data.records;
} else {
this.$message.error(res.data.msg);
}
});
},
handleEdit(id) {
this.$axios({
method: "post",
url: "/api/business/t-wcs-task/delete",
data: {
id
}
}).then(res => {
if (res.data && res.data.code === 0) {
this.$message({
type: "success",
message: "已停止",
onClose: () => {
this.init();
}
});
} else {
this.$message.error(res.data.msg);
}
});
},
handleDelete(id) {
this.$axios({
method: "post",
url: "/api/business/t-wcs-task/delete",
data: {
id
}
}).then(res => {
if (res.data && res.data.code === 0) {
this.$message({
type: "success",
message: "成功删除",
onClose: () => {
this.init();
}
});
} else {
this.$message.error(res.data.msg);
}
});
}
}
};
</script>
<style></style>

120
src/components/taskLog.vue Normal file
View File

@@ -0,0 +1,120 @@
<!--
* @Author: zwq
* @Date: 2021-10-11 16:38:28
* @LastEditors: zwq
* @LastEditTime: 2021-10-12 14:54:56
* @Description:
-->
<template>
<div>
<div style="margin:0 0 20px;text-align:left">
时间段:
<el-date-picker
v-model="timeArr"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
<el-button type="primary" icon="el-icon-search" @click="search"
>查询</el-button
>
</div>
<div>
<el-table :data="tableData" stripe border style="width: 100%">
<el-table-column type="index" align="center" label="序号" width="80">
</el-table-column>
<el-table-column prop="createTime" align="center" label="获取时间">
</el-table-column>
<el-table-column prop="source" align="center" label="数据发送源">
</el-table-column>
<el-table-column prop="Status" align="center" label="数据类型">
<template slot-scope="scope">
<span>{{
scope.row.receiveStatus
? "数据已接收"
: "数据未接收"
}}</span>
<span>{{
scope.row.sendStatus
? "数据已发送"
: "数据未发送"
}}</span>
</template>
</el-table-column>
<el-table-column prop="content" align="center" label="内容">
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="current"
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
timeArr: [],
tableData: [],
current: 1,
size: 10,
totalPage: 0,
};
},
mounted() {
this.init(1)
},
methods: {
init(val) {
this.current = val
this.$axios({
method: "post",
url: "/api/business/t-wcs-task-log/findAll",
data: {
current: this.current,
size: this.size
}
}).then(res => {
if (res && res.data.code === 0) {
this.tableData = res.data.data.records;
} else {
this.$message.error(res.data.msg);
}
});
},
search() {
this.$axios({
method: "post",
url: "/api/business/t-wcs-task-log/findAll",
data: {
current: this.current,
size: this.size
},
}).then(res => {
console.log(res);
});
},
// 每页数
sizeChangeHandle (val) {
this.size = val
this.init(1)
},
// 当前页
currentChangeHandle (val) {
this.init(val)
},
// 多选
}
};
</script>
<style></style>

30
src/main.js Normal file
View File

@@ -0,0 +1,30 @@
/*
* @Author: zwq
* @Date: 2021-10-11 08:46:56
* @LastEditors: zwq
* @LastEditTime: 2021-10-12 13:41:36
* @Description:
*/
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router'
import axios from 'axios'
//axios.defaults.baseURL = 'http://192.168.1.188:8009'
//axios.defaults.headers.post['Content-Type'] = 'text/plain'
Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.use(ElementUI);
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})

43
src/router/index.js Normal file
View File

@@ -0,0 +1,43 @@
/*
* @Author: zwq
* @Date: 2021-10-11 08:46:56
* @LastEditors: zwq
* @LastEditTime: 2021-10-12 14:03:01
* @Description:
*/
import Vue from 'vue'
import Router from 'vue-router'
import taskInfo from '@/components/taskInfo'
import taskLog from '@/components/taskLog'
import equipmentMonitor from '@/components/equipment-monitor'
import main from '@/components/main'
Vue.use(Router)
export default new Router({
routes: [
{
path: '/',
name: 'main',
component: main,
redirect:'/taskInfo',
children:[
{
path: '/taskInfo',
name: 'taskInfo',
component: taskInfo
},
{
path: '/taskLog',
name: 'taskLog',
component: taskLog
},
{
path: '/equipmentMonitor',
name: 'equipmentMonitor',
component: equipmentMonitor
},
]
},
]
})