pull/1/head
pnoker 5 years ago
parent 3225b3f64e
commit 432da7e71a

@ -9,58 +9,94 @@ export const driverApi = {
url: '/device_api/manager/driver/list',
method: 'post',
data: driver
})
};
export const driverAttributeApi = {
add: (driverAttribute) => request({
url: '/device_api/manager/driverAttribute/add',
method: 'post',
data: driverAttribute
}),
dictionary: () => request({
url: '/device_api/manager/driver/dictionary',
method: 'get'
delete: (id) => request({
url: '/device_api/manager/driverAttribute/delete/' + id,
method: 'post'
}),
update: (driverAttribute) => request({
url: '/device_api/manager/driverAttribute/update',
method: 'post',
data: driverAttribute
}),
list: (driverAttribute) => request({
url: '/device_api/manager/driverAttribute/list',
method: 'post',
data: driverAttribute
})
};
export const connectInfoApi = {
add: (connectInfo) => request({
url: '/device_api/manager/connectInfo/add',
export const driverInfoApi = {
add: (driverInfo) => request({
url: '/device_api/manager/driverInfo/add',
method: 'post',
data: connectInfo
data: driverInfo
}),
delete: (id) => request({
url: '/device_api/manager/connectInfo/delete/' + id,
url: '/device_api/manager/driverInfo/delete/' + id,
method: 'post'
}),
update: (connectInfo) => request({
url: '/device_api/manager/connectInfo/update',
update: (driverInfo) => request({
url: '/device_api/manager/driverInfo/update',
method: 'post',
data: connectInfo
data: driverInfo
}),
list: (connectInfo) => request({
url: '/device_api/manager/connectInfo/list',
list: (driverInfo) => request({
url: '/device_api/manager/driverInfo/list',
method: 'post',
data: connectInfo
data: driverInfo
})
};
export const profileInfoApi = {
add: (profileInfo) => request({
url: '/device_api/manager/profileInfo/add',
export const pointAttributeApi = {
add: (pointAttribute) => request({
url: '/device_api/manager/pointAttribute/add',
method: 'post',
data: profileInfo
data: pointAttribute
}),
delete: (id) => request({
url: '/device_api/manager/profileInfo/delete/' + id,
url: '/device_api/manager/pointAttribute/delete/' + id,
method: 'post'
}),
update: (profileInfo) => request({
url: '/device_api/manager/profileInfo/update',
update: (pointAttribute) => request({
url: '/device_api/manager/pointAttribute/update',
method: 'post',
data: profileInfo
data: pointAttribute
}),
list: (profileInfo) => request({
url: '/device_api/manager/profileInfo/list',
list: (pointAttribute) => request({
url: '/device_api/manager/pointAttribute/list',
method: 'post',
data: pointAttribute
})
};
export const pointInfoApi = {
add: (pointInfo) => request({
url: '/device_api/manager/pointInfo/add',
method: 'post',
data: profileInfo
data: pointInfo
}),
dictionary: () => request({
url: '/device_api/manager/profileInfo/dictionary',
method: 'get'
delete: (id) => request({
url: '/device_api/manager/pointInfo/delete/' + id,
method: 'post'
}),
update: (pointInfo) => request({
url: '/device_api/manager/pointInfo/update',
method: 'post',
data: pointInfo
}),
list: (pointInfo) => request({
url: '/device_api/manager/pointInfo/list',
method: 'post',
data: pointInfo
})
};
@ -83,10 +119,6 @@ export const profileApi = {
url: '/device_api/manager/profile/list',
method: 'post',
data: profile
}),
dictionary: () => request({
url: '/device_api/manager/profile/dictionary',
method: 'get'
})
};
@ -109,10 +141,6 @@ export const groupApi = {
url: '/device_api/manager/group/list',
method: 'post',
data: group
}),
dictionary: () => request({
url: '/device_api/manager/group/dictionary',
method: 'get'
})
};
@ -135,10 +163,6 @@ export const deviceApi = {
url: '/device_api/manager/device/list',
method: 'post',
data: device
}),
dictionary: () => request({
url: '/device_api/manager/device/dictionary',
method: 'get'
})
};
@ -161,32 +185,6 @@ export const pointApi = {
url: '/device_api/manager/point/list',
method: 'post',
data: point
}),
dictionary: () => request({
url: '/device_api/manager/point/dictionary',
method: 'get'
})
};
export const pointInfoApi = {
add: (pointInfo) => request({
url: '/device_api/manager/pointInfo/add',
method: 'post',
data: pointInfo
}),
delete: (id) => request({
url: '/device_api/manager/pointInfo/delete/' + id,
method: 'post'
}),
update: (pointInfo) => request({
url: '/device_api/manager/pointInfo/update',
method: 'post',
data: pointInfo
}),
list: (pointInfo) => request({
url: '/device_api/manager/pointInfo/list',
method: 'post',
data: pointInfo
})
};
@ -202,3 +200,34 @@ export const scheduleApi = {
data: schedule
})
};
export const dictionaryApi = {
driverDictionary: () => request({
url: '/device_api/manager/dictionary/driver',
method: 'get'
}),
profileDictionary: () => request({
url: '/device_api/manager/dictionary/profile',
method: 'get'
}),
driverAttributeDictionary: () => request({
url: '/device_api/manager/dictionary/driverAttribute',
method: 'get'
}),
pointAttributeDictionary: () => request({
url: '/device_api/manager/dictionary/pointAttribute',
method: 'get'
}),
groupDictionary: () => request({
url: '/device_api/manager/dictionary/group',
method: 'get'
}),
deviceDictionary: (parent) => request({
url: '/device_api/manager/dictionary/device/' + parent,
method: 'get'
}),
pointDictionary: (parent) => request({
url: '/device_api/manager/dictionary/point/' + parent,
method: 'get'
})
};

@ -21,19 +21,19 @@ export default [
},
component: () => import('@/views/driver/Driver')
}, {
name: 'connect',
path: '/connect',
name: 'driverAttribute',
path: '/driverAttribute',
meta: {
isAuth: true
},
component: () => import('@/views/connect/Connect')
component: () => import('@/views/driver/DriverAttribute')
}, {
name: 'attribute',
path: '/attribute',
name: 'pointAttribute',
path: '/pointAttribute',
meta: {
isAuth: true
},
component: () => import('@/views/attribute/Attribute')
component: () => import('@/views/point/PointAttribute')
}, {
name: 'profile',
path: '/profile',
@ -41,6 +41,13 @@ export default [
isAuth: true
},
component: () => import('@/views/profile/Profile')
}, {
name: 'driverInfo',
path: '/driverInfo',
meta: {
isAuth: true
},
component: () => import('@/views/driver/DriverInfo')
}, {
name: 'point',
path: '/point',
@ -63,12 +70,12 @@ export default [
},
component: () => import('@/views/device/Device')
}, {
name: 'config',
path: '/config',
name: 'pointInfo',
path: '/pointInfo',
meta: {
isAuth: true
},
component: () => import('@/views/config/Config')
component: () => import('@/views/point/PointInfo')
}, {
name: 'schedule',
path: '/schedule',

@ -23,7 +23,7 @@
</template>
<script>
import {deviceApi, groupApi, profileApi} from '@/api/manager'
import {deviceApi, groupApi, profileApi,dictionaryApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -115,7 +115,7 @@
}, {
label: '所属分组',
prop: 'groupId',
width: 150,
width: 180,
search: true,
searchSpan: 5,
type: 'select',
@ -194,14 +194,14 @@
});
},
group() {
groupApi.dictionary().then(res => {
dictionaryApi.groupDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('groupId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
profile() {
profileApi.dictionary().then(res => {
dictionaryApi.profileDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('profileId')].dicData = res.data;
}).catch((e) => {
console.log(e);

@ -23,7 +23,7 @@
</template>
<script>
import {connectInfoApi, driverApi} from '@/api/manager'
import {dictionaryApi, driverAttributeApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -37,7 +37,9 @@
index: true,
stripe: true,
border: true,
addBtn: false,
viewBtn: true,
editBtn: false,
height: 664,
align: 'center',
column: [
@ -191,7 +193,7 @@
{
list(page) {
this.loading = true;
connectInfoApi.list(Object.assign({
driverAttributeApi.list(Object.assign({
page: {
current: page.currentPage,
size: page.pageSize
@ -205,14 +207,14 @@
});
},
driver() {
driverApi.dictionary().then(res => {
dictionaryApi.driverDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('driverId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
listAdd(row, done, loading) {
connectInfoApi.add(row).then(() => {
driverAttributeApi.add(row).then(() => {
loading();
this.list(this.page);
successMessage();
@ -226,14 +228,14 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return connectInfoApi.delete(row.id);
return driverAttributeApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
connectInfoApi.update(row).then(() => {
driverAttributeApi.update(row).then(() => {
loading();
this.list(this.page);
successMessage();

@ -0,0 +1,211 @@
<template>
<el-col :span="24">
<base-card>
<avue-crud :option="listOption"
:data="listData"
:page="page"
:table-loading="loading"
ref="crud"
v-model="listForm"
@on-load="list"
@row-save="listAdd"
@row-del="listDelete"
@row-update="listUpdate"
@search-reset="searchReset"
@search-change="searchChange"
@refresh-change="refreshChange"
@size-change="sizeChange"
@current-change="currentChange"
>
</avue-crud>
</base-card>
</el-col>
</template>
<script>
import {dictionaryApi, driverInfoApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
data() {
return {
query: {},
listForm: {},
listData: [],
listOption: {
tip: false,
index: true,
stripe: true,
border: true,
viewBtn: true,
height: 664,
align: 'center',
column: [
{
label: '属性',
prop: 'driverAttributeId',
span: 12,
search: true,
searchSpan: 12,
type: 'tree',
dicData: [],
defaultExpandAll: true,
rules: [
{
required: true,
message: '请选择属性',
trigger: 'click'
}
]
}, {
label: '内容',
prop: 'value',
span: 12
}, {
label: '所属模板',
prop: 'profileId',
span: 24,
search: true,
searchSpan: 12,
type: 'tree',
dicData: [],
defaultExpandAll: true,
rules: [
{
required: true,
message: '请选择所属模板',
trigger: 'click'
}
]
}, {
label: '备注',
prop: 'description',
width: 200,
span: 24,
type: 'textarea',
overHidden: true,
rules: [
{
max: 380,
message: '最多输入380个字符',
trigger: 'blur'
}
]
}, {
label: '修改日期',
prop: 'updateTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss'
}, {
label: '创建日期',
prop: 'createTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss'
}
]
},
loading: true,
page: {
total: 0,
pageSize: 20,
currentPage: 1
}
}
},
created() {
this.profile();
this.driverAttribute();
},
methods:
{
list(page) {
this.loading = true;
driverInfoApi.list(Object.assign({
page: {
current: page.currentPage,
size: page.pageSize
}
}, this.query)).then(res => {
const data = res.data;
this.page.total = data.total;
this.listData = data.records;
}).finally(() => {
this.loading = false;
});
},
profile() {
dictionaryApi.profileDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('profileId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
driverAttribute() {
dictionaryApi.driverAttributeDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('driverAttributeId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
listAdd(row, done, loading) {
driverInfoApi.add(row).then(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
listDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return driverInfoApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
driverInfoApi.update(row).then(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
refreshChange() {
this.list(this.page);
},
currentChange(page) {
this.page.currentPage = page;
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
searchChange(params, done) {
this.query = params;
this.list(this.page);
done();
},
searchReset() {
this.query = {};
this.list(this.page);
}
}
}
</script>
<style lang="scss">
</style>

@ -11,14 +11,15 @@
:router=true>
<el-menu-item index="/home"><span class="el-icon-menu"/>首页</el-menu-item>
<el-menu-item index="/driver">驱动</el-menu-item>
<el-menu-item index="/connect">连接</el-menu-item>
<el-menu-item index="/attribute">属性</el-menu-item>
<el-menu-item index="/driverAttribute">驱动属性</el-menu-item>
<el-menu-item index="/pointAttribute">位号属性</el-menu-item>
<el-menu-item index="/profile">模板</el-menu-item>
<el-menu-item index="/driverInfo">驱动配置</el-menu-item>
<el-menu-item index="/point">位号</el-menu-item>
<el-menu-item index="/group">分组</el-menu-item>
<el-menu-item index="/device">设备</el-menu-item>
<el-menu-item index="/config">配置</el-menu-item>
<el-menu-item index="/schedule">任务</el-menu-item>
<el-menu-item index="/pointInfo">位号配置</el-menu-item>
<el-menu-item index="/schedule">调度</el-menu-item>
<!--<el-menu-item index="/now">实时</el-menu-item>
<el-menu-item index="/history">历史</el-menu-item>
<el-menu-item index="/video">视频</el-menu-item>

@ -23,7 +23,7 @@
</template>
<script>
import {pointApi, profileApi} from '@/api/manager'
import {pointApi, profileApi,dictionaryApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -321,7 +321,7 @@
});
},
profile() {
profileApi.dictionary().then(res => {
dictionaryApi.profileDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('profileId')].dicData = res.data;
}).catch((e) => {
console.log(e);

@ -23,7 +23,7 @@
</template>
<script>
import {driverApi, profileInfoApi} from '@/api/manager'
import {dictionaryApi, pointAttributeApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -191,7 +191,7 @@
{
list(page) {
this.loading = true;
profileInfoApi.list(Object.assign({
pointAttributeApi.list(Object.assign({
page: {
current: page.currentPage,
size: page.pageSize
@ -205,14 +205,14 @@
});
},
driver() {
driverApi.dictionary().then(res => {
dictionaryApi.driverDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('driverId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
listAdd(row, done, loading) {
profileInfoApi.add(row).then(() => {
pointAttributeApi.add(row).then(() => {
loading();
this.list(this.page);
successMessage();
@ -226,14 +226,14 @@
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return profileInfoApi.delete(row.id);
return pointAttributeApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
profileInfoApi.update(row).then(() => {
pointAttributeApi.update(row).then(() => {
loading();
this.list(this.page);
successMessage();

@ -23,7 +23,7 @@
</template>
<script>
import {deviceApi, pointApi, pointInfoApi, profileInfoApi} from '@/api/manager'
import {dictionaryApi, pointInfoApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -43,7 +43,7 @@
column: [
{
label: '属性',
prop: 'profileInfoId',
prop: 'pointAttributeId',
span: 12,
search: true,
searchSpan: 8,
@ -139,7 +139,7 @@
created() {
this.device();
this.point();
this.profileInfo();
this.pointAttribute();
},
methods:
{
@ -159,22 +159,22 @@
});
},
device() {
deviceApi.dictionary().then(res => {
dictionaryApi.deviceDictionary('group').then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('deviceId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
point() {
pointApi.dictionary().then(res => {
dictionaryApi.pointDictionary('profile').then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('pointId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
profileInfo() {
profileInfoApi.dictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('profileInfoId')].dicData = res.data;
pointAttribute() {
dictionaryApi.pointAttributeDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('pointAttributeId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});

@ -23,7 +23,7 @@
</template>
<script>
import {driverApi, profileApi} from '@/api/manager'
import {dictionaryApi, profileApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -167,7 +167,7 @@
});
},
driver() {
driverApi.dictionary().then(res => {
dictionaryApi.driverDictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('driverId')].dicData = res.data;
}).catch((e) => {
console.log(e);

@ -21,7 +21,7 @@
</template>
<script>
import {deviceApi, scheduleApi} from '@/api/manager'
import {dictionaryApi, scheduleApi} from '@/api/manager'
import {successMessage} from "@/util/util";
export default {
@ -160,7 +160,7 @@
});
},
device() {
deviceApi.dictionary().then(res => {
dictionaryApi.deviceDictionary('group').then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('deviceId')].dicData = res.data;
}).catch((e) => {
console.log(e);

Loading…
Cancel
Save