init
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/instruction',
|
||||
|
||||
@@ -7,7 +7,6 @@ import echarts from 'echarts'
|
||||
require('echarts/theme/macarons') // echarts theme
|
||||
import { debounce } from '@/utils'
|
||||
|
||||
|
||||
export default {
|
||||
props: {
|
||||
className: {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<template>
|
||||
<div class="navbar">
|
||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||
@toggleClick="toggleSideBar"/>
|
||||
<hamburger
|
||||
id="hamburger-container"
|
||||
:is-active="sidebar.opened"
|
||||
class="hamburger-container"
|
||||
@toggleClick="toggleSideBar"
|
||||
/>
|
||||
|
||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import 'mavon-editor/dist/css/index.css'
|
||||
// 数据字典
|
||||
import dict from './components/Dict'
|
||||
|
||||
|
||||
import scroll from 'vue-seamless-scroll'
|
||||
Vue.use(scroll)
|
||||
|
||||
@@ -52,7 +51,6 @@ Vue.use(AFTableColumn)
|
||||
Vue.use(VXETable)
|
||||
Vue.prototype.$XModal = VXETable.modal
|
||||
|
||||
|
||||
Vue.use(VueHighlightJS)
|
||||
Vue.use(mavonEditor)
|
||||
Vue.use(permission)
|
||||
|
||||
@@ -337,7 +337,7 @@ export default {
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="500px">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="坐标标识" prop="ioc_uuid">
|
||||
<el-input v-model="form.ioc_uuid" style="width: 370px;" />
|
||||
@@ -48,8 +53,14 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="ioc_uuid" label="坐标标识" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
@@ -62,8 +73,12 @@
|
||||
<el-table-column prop="create_time" label="创建时间" />
|
||||
<el-table-column prop="update_by" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" />
|
||||
<el-table-column v-permission="['admin','routeLoc:edit','routeLoc:del']" label="操作" width="150px"
|
||||
align="center">
|
||||
<el-table-column
|
||||
v-permission="['admin','routeLoc:edit','routeLoc:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="500px">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item v-if="false" label="方案标识" prop="plan_uuid">
|
||||
<el-input v-model="form.plan_uuid" style="width: 370px;" />
|
||||
@@ -27,8 +32,14 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="plan_uuid" label="方案标识" />
|
||||
<el-table-column prop="plan_code" label="编码" />
|
||||
@@ -38,8 +49,12 @@
|
||||
<el-table-column prop="create_time" label="创建时间" />
|
||||
<el-table-column prop="update_by" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" />
|
||||
<el-table-column v-permission="['admin','routePlan:edit','routePlan:del']" label="操作" width="150px"
|
||||
align="center">
|
||||
<el-table-column
|
||||
v-permission="['admin','routePlan:edit','routePlan:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title" width="500px">
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item v-if="false" label="舞台标识" prop="stage_uuid">
|
||||
<el-input v-model="form.stage_uuid" style="width: 370px;" />
|
||||
@@ -27,8 +32,14 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="stage_uuid" label="舞台标识" />
|
||||
<el-table-column prop="stage_code" label="舞台编码" />
|
||||
|
||||
@@ -99,7 +99,7 @@ export default {
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}, }
|
||||
}}
|
||||
)
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.driverCode" clearable size="small" placeholder="输入驱动编码" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-input v-model="query.driverName" clearable size="small" placeholder="输入驱动名称" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select class="filter-item" style="width: 200px" size="small" v-model="query.fitDeviceTypes" placeholder="驱动类型" @change="crud.toQuery" clearable>
|
||||
<el-option label="输送机-Conveyor" value="conveyor"></el-option>
|
||||
<el-option label="固定货台-Station" value="station"></el-option>
|
||||
<el-option label="堆垛机-Stacker" value="stacker"></el-option>
|
||||
<el-option label="自动导引搬运车辆-AGV" value="agv"></el-option>
|
||||
<el-select v-model="query.fitDeviceTypes" class="filter-item" style="width: 200px" size="small" placeholder="驱动类型" clearable @change="crud.toQuery">
|
||||
<el-option label="输送机-Conveyor" value="conveyor" />
|
||||
<el-option label="固定货台-Station" value="station" />
|
||||
<el-option label="堆垛机-Stacker" value="stacker" />
|
||||
<el-option label="自动导引搬运车辆-AGV" value="agv" />
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
@@ -33,7 +33,7 @@
|
||||
{{ form.deviceDriverType }}
|
||||
</el-form-item>
|
||||
<el-form-item label="适用驱动类型:">
|
||||
<el-tag v-for="city in form.fitDeviceTypes" :label="city" :key="city" effect="dark">{{city}}</el-tag>
|
||||
<el-tag v-for="city in form.fitDeviceTypes" :key="city" :label="city" effect="dark">{{ city }}</el-tag>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@@ -68,7 +68,7 @@ import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = { driverCode: null, driverName: null, driverDescription: null, deviceDriverType: null, fitDeviceTypes: null }
|
||||
export default {
|
||||
name: 'devicedriver',
|
||||
name: 'Devicedriver',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
cruds() {
|
||||
@@ -91,7 +91,6 @@ export default {
|
||||
},
|
||||
rules: {
|
||||
|
||||
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
queryTypeOptions: [
|
||||
@@ -104,8 +103,8 @@ export default {
|
||||
methods: {
|
||||
// 获取异常详情
|
||||
handleClick(row) {
|
||||
this.form = row;
|
||||
this.dialogFormVisible=true;
|
||||
this.form = row
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
|
||||
@@ -128,6 +128,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.webSocket()
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
@@ -135,7 +138,7 @@ export default {
|
||||
},
|
||||
webSocket() {
|
||||
const that = this
|
||||
if (typeof (WebSocket) == 'undefined') {
|
||||
if (typeof (WebSocket) === 'undefined') {
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: '当前浏览器无法接收实时报警信息,请使用谷歌浏览器!',
|
||||
@@ -143,7 +146,7 @@ export default {
|
||||
duration: 0
|
||||
})
|
||||
} else {
|
||||
let id = '123'
|
||||
const id = '123'
|
||||
// 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
|
||||
// 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
|
||||
const socketUrl = process.env.VUE_APP_WS_API + id
|
||||
@@ -151,17 +154,16 @@ export default {
|
||||
// 监听socket打开
|
||||
this.socket.onopen = function() {
|
||||
console.log('浏览器WebSocket已打开')
|
||||
that.socket.send("测试客户端发送消息");
|
||||
that.socket.send('测试客户端发送消息')
|
||||
}
|
||||
|
||||
// 监听socket消息接收
|
||||
|
||||
this.socket.onmessage = function(msg) {
|
||||
console.log(msg);
|
||||
console.log(msg)
|
||||
|
||||
// 转换为json对象
|
||||
/* const data = JSON.parse(msg.data);*/
|
||||
|
||||
}
|
||||
|
||||
// 监听socket错误
|
||||
@@ -177,12 +179,8 @@ export default {
|
||||
this.socket.onclose = function() {
|
||||
console.log('WebSocket已关闭')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.webSocket()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user