pull/1/head
pnoker 5 years ago
parent 9c660fe4c9
commit 0f17ec277f

@ -30,32 +30,62 @@ export const driverApi = {
})
};
export const groupApi = {
add: (group) => request({
url: '/device_api/manager/group/add',
export const connectInfoApi = {
add: (connectInfo) => request({
url: '/device_api/manager/connectInfo/add',
method: 'post',
data: group
data: connectInfo
}),
delete: (id) => request({
url: '/device_api/manager/group/delete/' + id,
url: '/device_api/manager/connectInfo/delete/' + id,
method: 'post'
}),
update: (group) => request({
url: '/device_api/manager/group/update',
update: (connectInfo) => request({
url: '/device_api/manager/connectInfo/update',
method: 'post',
data: group
data: connectInfo
}),
selectById: (id) => request({
url: '/device_api/manager/group/id/' + id,
url: '/device_api/manager/connectInfo/id/' + id,
method: 'get'
}),
list: (group) => request({
url: '/device_api/manager/group/list',
list: (connectInfo) => request({
url: '/device_api/manager/connectInfo/list',
method: 'post',
data: group
data: connectInfo
}),
dictionary: () => request({
url: '/device_api/manager/group/dictionary',
url: '/device_api/manager/connectInfo/dictionary',
method: 'get'
})
};
export const profileInfoApi = {
add: (profileInfo) => request({
url: '/device_api/manager/profileInfo/add',
method: 'post',
data: profileInfo
}),
delete: (id) => request({
url: '/device_api/manager/profileInfo/delete/' + id,
method: 'post'
}),
update: (profileInfo) => request({
url: '/device_api/manager/profileInfo/update',
method: 'post',
data: profileInfo
}),
selectById: (id) => request({
url: '/device_api/manager/profileInfo/id/' + id,
method: 'get'
}),
list: (profileInfo) => request({
url: '/device_api/manager/profileInfo/list',
method: 'post',
data: profileInfo
}),
dictionary: () => request({
url: '/device_api/manager/profileInfo/dictionary',
method: 'get'
})
};
@ -90,32 +120,32 @@ export const profileApi = {
})
};
export const pointApi = {
add: (point) => request({
url: '/device_api/manager/point/add',
export const groupApi = {
add: (group) => request({
url: '/device_api/manager/group/add',
method: 'post',
data: point
data: group
}),
delete: (id) => request({
url: '/device_api/manager/point/delete/' + id,
url: '/device_api/manager/group/delete/' + id,
method: 'post'
}),
update: (point) => request({
url: '/device_api/manager/point/update',
update: (group) => request({
url: '/device_api/manager/group/update',
method: 'post',
data: point
data: group
}),
selectById: (id) => request({
url: '/device_api/manager/point/id/' + id,
url: '/device_api/manager/group/id/' + id,
method: 'get'
}),
list: (point) => request({
url: '/device_api/manager/point/list',
list: (group) => request({
url: '/device_api/manager/group/list',
method: 'post',
data: point
data: group
}),
dictionary: () => request({
url: '/device_api/manager/point/dictionary',
url: '/device_api/manager/group/dictionary',
method: 'get'
})
};
@ -157,3 +187,63 @@ export const deviceApi = {
method: 'get'
})
};
export const pointApi = {
add: (point) => request({
url: '/device_api/manager/point/add',
method: 'post',
data: point
}),
delete: (id) => request({
url: '/device_api/manager/point/delete/' + id,
method: 'post'
}),
update: (point) => request({
url: '/device_api/manager/point/update',
method: 'post',
data: point
}),
selectById: (id) => request({
url: '/device_api/manager/point/id/' + id,
method: 'get'
}),
list: (point) => request({
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
}),
selectById: (id) => request({
url: '/device_api/manager/pointInfo/id/' + id,
method: 'get'
}),
list: (pointInfo) => request({
url: '/device_api/manager/pointInfo/list',
method: 'post',
data: pointInfo
}),
dictionary: () => request({
url: '/device_api/manager/pointInfo/dictionary',
method: 'get'
})
};

@ -8,7 +8,7 @@ export default [
meta: {
isAuth: false
},
component: () => import('@/views/login/index')
component: () => import('@/views/login/Login')
}, {
name: 'index',
path: '/',

@ -1,4 +1,4 @@
import Index from '@/views/layout/index'
import Index from '@/views/layout/Layout'
export default [
{
@ -21,19 +21,54 @@ export default [
},
component: () => import('@/views/driver/Driver')
}, {
name: 'template',
path: '/template',
name: 'connect',
path: '/connect',
meta: {
isAuth: true
},
component: () => import('@/views/template/Template')
component: () => import('@/views/connect/Connect')
}, {
name: 'things',
path: '/things',
name: 'attribute',
path: '/attribute',
meta: {
isAuth: true
},
component: () => import('@/views/things/Things')
component: () => import('@/views/attribute/Attribute')
}, {
name: 'profile',
path: '/profile',
meta: {
isAuth: true
},
component: () => import('@/views/profile/Profile')
}, {
name: 'point',
path: '/point',
meta: {
isAuth: true
},
component: () => import('@/views/point/Point')
}, {
name: 'group',
path: '/group',
meta: {
isAuth: true
},
component: () => import('@/views/group/Group')
}, {
name: 'device',
path: '/device',
meta: {
isAuth: true
},
component: () => import('@/views/device/Device')
}, {
name: 'config',
path: '/config',
meta: {
isAuth: true
},
component: () => import('@/views/config/Config')
}, {
name: 'now',
path: '/now',
@ -55,13 +90,6 @@ export default [
isAuth: true
},
component: () => import('@/views/Alarm')
}, {
name: 'point',
path: '/point',
meta: {
isAuth: true
},
component: () => import('@/views/point/Point')
}, {
name: 'video',
path: '/video',

@ -25,7 +25,6 @@
data() {
return {
form: {},
selectionList: [],
query: {},
page: {
pageSize: 10,
@ -54,18 +53,19 @@
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: '姓名',
prop: 'name',
search: true,
rules: [{
rules: [
{
required: true,
message: "请输入部门名称",
trigger: "blur"
}]
}
]
},
{
label: '性别',

@ -0,0 +1,267 @@
<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 {driverApi, profileInfoApi} 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: 'displayName',
span: 12,
search: true,
searchSpan: 6,
rules: [
{
required: true,
message: '请输入 显示名称',
trigger: 'blur'
}, {
min: 2,
max: 32,
message: '请输入 2~32 位字长的显示名称',
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的显示名称'
}
]
}, {
label: '属性',
prop: 'name',
span: 12,
search: true,
searchSpan: 6,
rules: [
{
required: true,
message: '请输入 属性名称',
trigger: 'blur'
}, {
min: 2,
max: 32,
message: '请输入 2~32 位字长的属性名称',
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的属性名称'
}
]
}, {
label: '类型',
prop: 'type',
span: 12,
search: true,
searchSpan: 6,
type: 'select',
searchFilterable: true,
value: 'string',
dicData: [
{
label: '字符串',
value: 'string'
}, {
label: '整数',
value: 'int'
}, {
label: '双精度浮点数',
value: 'double'
}, {
label: '浮点数',
value: 'float'
}, {
label: '长整数',
value: 'long'
}, {
label: '开关量',
value: 'boolean'
}
],
rules: [
{
required: true,
message: '请选择连接属性类型',
trigger: 'click'
}
]
}, {
label: '默认',
prop: 'value',
span: 12
}, {
label: '所属驱动',
prop: 'driverId',
span: 24,
search: true,
searchSpan: 6,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
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.driver();
},
methods:
{
list(page) {
this.loading = true;
profileInfoApi.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;
});
},
driver() {
driverApi.dictionary().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(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
listDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return profileInfoApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
profileInfoApi.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>

@ -0,0 +1,235 @@
<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 {deviceApi, pointApi, pointInfoApi, profileInfoApi} 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: 'profileInfoId',
span: 12,
search: true,
searchSpan: 8,
type: 'tree',
dicData: [],
defaultExpandAll: true,
rules: [
{
required: true,
message: '请选择属性',
trigger: 'click'
}
]
}, {
label: '内容',
prop: 'value',
span: 12
}, {
label: '所属设备',
prop: 'deviceId',
span: 12,
search: true,
searchSpan: 8,
type: 'tree',
dicData: [],
defaultExpandAll: true,
rules: [
{
required: true,
message: '请选择所属设备',
trigger: 'click'
}
]
}, {
label: '所属位号',
prop: 'pointId',
span: 12,
search: true,
searchSpan: 8,
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.device();
this.point();
this.profileInfo();
},
methods:
{
list(page) {
this.loading = true;
pointInfoApi.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;
});
},
device() {
deviceApi.dictionary().then(res => {
this.listOption.column[this.$refs.crud.findColumnIndex('deviceId')].dicData = res.data;
}).catch((e) => {
console.log(e);
});
},
point() {
pointApi.dictionary().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;
}).catch((e) => {
console.log(e);
});
},
listAdd(row, done, loading) {
pointInfoApi.add(row).then(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
listDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return pointInfoApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
pointInfoApi.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>

@ -0,0 +1,267 @@
<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 {connectInfoApi, driverApi} 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: 'displayName',
span: 12,
search: true,
searchSpan: 6,
rules: [
{
required: true,
message: '请输入 显示名称',
trigger: 'blur'
}, {
min: 2,
max: 32,
message: '请输入 2~32 位字长的显示名称',
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的显示名称'
}
]
}, {
label: '属性',
prop: 'name',
span: 12,
search: true,
searchSpan: 6,
rules: [
{
required: true,
message: '请输入 属性名称',
trigger: 'blur'
}, {
min: 2,
max: 32,
message: '请输入 2~32 位字长的属性名称',
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的属性名称'
}
]
}, {
label: '类型',
prop: 'type',
span: 12,
search: true,
searchSpan: 6,
type: 'select',
searchFilterable: true,
value: 'string',
dicData: [
{
label: '字符串',
value: 'string'
}, {
label: '整数',
value: 'int'
}, {
label: '双精度浮点数',
value: 'double'
}, {
label: '浮点数',
value: 'float'
}, {
label: '长整数',
value: 'long'
}, {
label: '开关量',
value: 'boolean'
}
],
rules: [
{
required: true,
message: '请选择连接属性类型',
trigger: 'click'
}
]
}, {
label: '默认',
prop: 'value',
span: 12
}, {
label: '所属驱动',
prop: 'driverId',
span: 24,
search: true,
searchSpan: 6,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
rules: [
{
required: true,
message: '请选择所属驱动',
trigger: 'change'
}
]
}, {
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.driver();
},
methods:
{
list(page) {
this.loading = true;
connectInfoApi.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;
});
},
driver() {
driverApi.dictionary().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(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
listDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return connectInfoApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
connectInfoApi.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>

@ -38,14 +38,12 @@
stripe: true,
border: true,
viewBtn: true,
selection: true,
height: 664,
align: 'center',
column: [
{
label: '设备',
prop: 'name',
width: 220,
span: 24,
search: true,
searchSpan: 5,
@ -61,58 +59,20 @@
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的设备名称,例:\'name01\' 或 \'名称01\''
message: '请输入 正确格式的设备名称'
}
]
}, {
label: '编码',
prop: 'code',
width: 280,
width: 300,
search: true,
searchSpan: 5,
disabled: true
}, {
label: '分组',
prop: 'groupId',
width: 150,
search: true,
searchSpan: 5,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
props: {
label: 'name',
value: 'id'
},
rules: [{
required: true,
message: '请选择所属分组',
trigger: 'click'
}]
}, {
label: '模板',
prop: 'profileId',
width: 180,
search: true,
searchSpan: 5,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
props: {
label: 'name',
value: 'id'
},
rules: [{
required: true,
message: '请选择使用模板',
trigger: 'click'
}]
}, {
label: '状态',
prop: 'status',
width: 100,
width: 80,
search: true,
searchSpan: 4,
disabled: true,
@ -138,11 +98,44 @@
}
]
}, {
label: '描述',
label: '所属模板',
prop: 'profileId',
search: true,
searchSpan: 5,
type: 'tree',
dicData: [],
defaultExpandAll: true,
rules: [
{
required: true,
message: '请选择使用模板',
trigger: 'click'
}
]
}, {
label: '所属分组',
prop: 'groupId',
width: 150,
search: true,
searchSpan: 5,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
rules: [
{
required: true,
message: '请选择所属分组',
trigger: 'click'
}
]
}, {
label: '备注',
prop: 'description',
width: 220,
width: 200,
span: 24,
type: 'textarea',
overHidden: true,
rules: [
{
max: 380,
@ -151,18 +144,18 @@
}
]
}, {
label: '创建日期',
prop: 'createTime',
width: 180,
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: 'updateTime',
width: 180,
label: '创建日期',
prop: 'createTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
@ -171,7 +164,6 @@
}
]
},
selectionList: [],
loading: true,
page: {
total: 0,
@ -225,7 +217,7 @@
});
},
listDelete(row) {
this.$confirm('是否删除该条设备', '提示', {
this.$confirm('是否删除该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

@ -38,14 +38,12 @@
border: true,
addBtn: false,
viewBtn: true,
selection: true,
height: 664,
align: 'center',
column: [
{
label: '协议',
label: '名称',
prop: 'name',
width: 220,
span: 12,
search: true,
searchSpan: 12,
@ -53,43 +51,17 @@
}, {
label: '服务',
prop: 'serviceName',
width: 220,
span: 12,
search: true,
searchSpan: 12,
disabled: true
}, {
label: '连接属性',
prop: 'connectInfo',
width: 250,
span: 24,
type: 'textarea',
rules: [
{
required: true,
message: '请输入 连接属性',
trigger: 'blur'
}
]
}, {
label: '配置属性',
prop: 'profileInfo',
width: 250,
span: 24,
type: 'textarea',
rules: [
{
required: true,
message: '请输入 配置属性',
trigger: 'blur'
}
]
}, {
label: '描述',
label: '备注',
prop: 'description',
width: 220,
width: 200,
span: 24,
type: 'textarea',
overHidden: true,
rules: [
{
max: 380,
@ -98,18 +70,18 @@
}
]
}, {
label: '创建日期',
prop: 'createTime',
width: 180,
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: 'updateTime',
width: 180,
label: '创建日期',
prop: 'createTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
@ -118,7 +90,6 @@
}
]
},
selectionList: [],
loading: true,
page: {
total: 0,
@ -145,7 +116,7 @@
});
},
listDelete(row) {
this.$confirm('是否删除该条驱动', '提示', {
this.$confirm('是否删除该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

@ -0,0 +1,175 @@
<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 {groupApi} 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: 'name',
span: 24,
search: true,
searchSpan: 24,
rules: [
{
required: true,
message: '请输入 分组名称',
trigger: 'blur'
}, {
min: 2,
max: 32,
message: '请输入 2~32 位字长的分组名称',
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的分组名称'
}
]
}, {
label: '备注',
prop: 'description',
span: 24,
type: 'textarea',
overHidden: true,
rules: [
{
max: 380,
message: '最多输入380个字符',
trigger: 'blur'
}
]
}, {
label: '修改日期',
prop: 'updateTime',
span: 12,
disabled: true,
type: 'date',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss'
}, {
label: '创建日期',
prop: 'createTime',
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
}
}
},
methods:
{
list(page) {
this.loading = true;
groupApi.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;
});
},
listAdd(row, done, loading) {
groupApi.add(row).then(() => {
loading();
this.list(this.page);
successMessage();
}).finally(() => {
done();
});
},
listDelete(row) {
this.$confirm('是否删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return groupApi.delete(row.id);
}).then(() => {
this.list(this.page);
successMessage();
});
},
listUpdate(row, index, done, loading) {
groupApi.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,15 +11,19 @@
: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="/template">模板</el-menu-item>
<el-menu-item index="/connect">连接</el-menu-item>
<el-menu-item index="/attribute">属性</el-menu-item>
<el-menu-item index="/profile">模板</el-menu-item>
<el-menu-item index="/point">位号</el-menu-item>
<el-menu-item index="/things">设备</el-menu-item>
<el-menu-item index="/now">实时</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="/now">实时</el-menu-item>
<el-menu-item index="/history">历史</el-menu-item>
<el-menu-item index="/video">视频</el-menu-item>
<el-menu-item index="/alarm">报警</el-menu-item>
<el-menu-item index="/setting">设置</el-menu-item>
<el-menu-item index="/about">关于</el-menu-item>
<el-menu-item index="/about">关于</el-menu-item>-->
</el-menu>
</el-col>
<el-col :span="2" class="header_item">

@ -38,7 +38,6 @@
stripe: true,
border: true,
viewBtn: true,
selection: true,
height: 664,
align: 'center',
column: [
@ -61,33 +60,13 @@
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的位号名称,例:\'point01\' 或 \'位号01\''
message: '请输入 正确格式的位号名称'
}
]
}, {
label: '模板',
prop: 'profileId',
width: 220,
span: 8,
search: true,
searchSpan: 6,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
props: {
label: 'name',
value: 'id'
},
rules: [{
required: true,
message: '请选择使用模板',
trigger: 'click'
}]
}, {
label: '类型',
prop: 'type',
width: 100,
width: 120,
span: 8,
search: true,
searchSpan: 4,
@ -115,11 +94,13 @@
value: 'boolean'
}
],
rules: [{
rules: [
{
required: true,
message: '请选择位号数据类型',
trigger: 'click'
}]
}
]
}, {
label: '读/写',
prop: 'rw',
@ -142,11 +123,13 @@
value: 2
}
],
rules: [{
rules: [
{
required: true,
message: '请选择位号读写类型',
trigger: 'click'
}]
}
]
}, {
label: '累计标识',
prop: 'accrue',
@ -166,16 +149,18 @@
value: false
}
],
rules: [{
rules: [
{
required: true,
message: '请选择模板共享类型',
message: '请选择位号是否为累计数据',
trigger: 'click'
}]
}
]
}, {
label: '值',
prop: 'value',
width: 100,
span: 6,
span: 8,
searchSpan: 12,
disabled: true,
value: '--'
@ -183,49 +168,102 @@
label: '最小值',
prop: 'minimum',
width: 100,
span: 6,
span: 8,
searchSpan: 12,
value: -999999
value: -999999,
rules: [
{
pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/,
message: '请输入 正确格式的最小值'
}
]
}, {
label: '最大值',
prop: 'maximum',
width: 100,
span: 6,
span: 8,
searchSpan: 12,
value: 999999
value: 999999,
rules: [
{
pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/,
message: '请输入 正确格式的最大值'
}
]
}, {
label: '倍数',
prop: 'multiple',
width: 100,
span: 6,
width: 80,
span: 8,
searchSpan: 12,
value: 1
value: 1,
rules: [
{
required: true,
message: '请输入 倍数',
trigger: 'blur'
}, {
pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/,
message: '请输入 正确格式的倍数'
}
]
}, {
label: '基值',
prop: 'base',
width: 100,
width: 80,
span: 8,
searchSpan: 12,
value: 0
value: 0,
rules: [
{
pattern: /^-?(([0-9]*(\.[0-9]{1,3})$)|([0-9]+$))/,
message: '请输入 正确格式的基值'
}
]
}, {
label: '格式',
prop: 'format',
width: 100,
width: 80,
span: 8,
searchSpan: 12,
value: '#.##'
value: '%.3f',
rules: [
{
required: true,
message: '请输入 格式',
trigger: 'blur'
}
]
}, {
label: '单位',
prop: 'unit',
width: 100,
width: 80,
span: 8,
searchSpan: 12
}, {
label: '描述',
prop: 'description',
label: '所属模板',
prop: 'profileId',
width: 220,
span: 24,
search: true,
searchSpan: 6,
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,
@ -234,18 +272,18 @@
}
]
}, {
label: '创建日期',
prop: 'createTime',
width: 180,
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: 'updateTime',
width: 180,
label: '创建日期',
prop: 'createTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
@ -254,7 +292,6 @@
}
]
},
selectionList: [],
loading: true,
page: {
total: 0,
@ -300,7 +337,7 @@
});
},
listDelete(row) {
this.$confirm('是否删除该条模板', '提示', {
this.$confirm('是否删除该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

@ -38,14 +38,12 @@
stripe: true,
border: true,
viewBtn: true,
selection: true,
height: 664,
align: 'center',
column: [
{
label: '模板',
prop: 'name',
width: 230,
span: 24,
search: true,
searchSpan: 12,
@ -61,7 +59,7 @@
trigger: 'blur'
}, {
pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+$/,
message: '请输入 正确格式的模板名称,例:\'profile01\' 或 \'模板01\''
message: '请输入 正确格式的模板名称'
}
]
}, {
@ -82,49 +80,36 @@
value: false
}
],
rules: [{
rules: [
{
required: true,
message: '请选择模板共享类型',
trigger: 'click'
}]
}
]
}, {
label: '驱动',
label: '所属驱动',
prop: 'driverId',
width: 220,
search: true,
searchSpan: 6,
type: 'select',
filterable: true,
searchFilterable: true,
dicData: [],
props: {
label: 'name',
value: 'id'
},
rules: [{
required: true,
message: '请选择使用驱动',
trigger: 'click'
}]
}, {
label: '配置属性',
prop: 'config',
width: 360,
span: 24,
type: 'textarea',
rules: [
{
required: true,
message: '请输入 配置属性',
trigger: 'blur'
message: '请选择所属驱动',
trigger: 'click'
}
]
}, {
label: '描述',
label: '备注',
prop: 'description',
width: 220,
width: 200,
span: 24,
type: 'textarea',
overHidden: true,
rules: [
{
max: 380,
@ -133,18 +118,18 @@
}
]
}, {
label: '创建日期',
prop: 'createTime',
width: 180,
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: 'updateTime',
width: 180,
label: '创建日期',
prop: 'createTime',
width: 155,
span: 12,
disabled: true,
type: 'date',
@ -153,7 +138,6 @@
}
]
},
selectionList: [],
loading: true,
page: {
total: 0,
@ -199,7 +183,7 @@
});
},
listDelete(row) {
this.$confirm('是否删除该条模板', '提示', {
this.$confirm('是否删除该条数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
Loading…
Cancel
Save