设备登记列表

This commit is contained in:
zhujiyan
2024-06-12 18:05:35 +08:00
parent 67bc106c1d
commit d76037e7b6
7 changed files with 2172 additions and 1555 deletions

View File

@@ -18,7 +18,7 @@
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts4": "npm:echarts@^4.9.0", "echarts4": "npm:echarts@^4.9.0",
"element-plus": "^2.5.3", "element-plus": "^2.7.5",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",

3314
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,6 @@ export const resetEquipmentDelivery = (id: any) => {
} }
// 编辑出厂设备 // 编辑出厂设备
export const editEquipmentDelivery = (data: any) => { export const editEquipmentDelivery = (data: any) => {
return createAxios({ return createAxios({
url: '/cs-device-boot/EquipmentDelivery/updateEquipmentDelivery', url: '/cs-device-boot/EquipmentDelivery/updateEquipmentDelivery',
@@ -64,3 +63,27 @@ export const batchImportDevice = (file: any) => {
data: form data: form
}) })
} }
// 直连设备注册接入
export const governDeviceRegister = (data: any) => {
return createAxios({
url: `/access-boot/device/register?nDid=${data.nDid}&type=${data.type}`,
method: 'POST'
})
}
// 便携式设备注册
export const portableDeviceRegister = (data: any) => {
return createAxios({
url: `/access-boot/device/wlRegister?nDid=${data.nDid}`,
method: 'POST',
})
}
// 便携式设备接入
export const portableDeviceAccess = (data: any) => {
return createAxios({
url: `/access-boot/device/wlAccess?nDid=${data.nDid}`,
method: 'POST',
})
}

View File

@@ -69,7 +69,27 @@ body,
background: #fff; background: #fff;
margin: var(--ba-main-space) var(--ba-main-space) 0px var(--ba-main-space); margin: var(--ba-main-space) var(--ba-main-space) 0px var(--ba-main-space);
} }
.form-style {
.form-one {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.el-form-item {
display: flex;
width: 98%;
margin-bottom: 15px !important;
.el-form-item__content {
flex: 1;
.el-select,
.el-cascader,
.el-input__inner,
.el-date-editor {
width: 100%;
}
}
}
}
.form-two {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
@@ -78,19 +98,40 @@ body,
width: 48%; width: 48%;
.el-form-item__content { .el-form-item__content {
flex: 1; flex: 1;
.el-select { .el-select,
width: 100%; .el-cascader,
} .el-input__inner,
.el-input__inner {
width: 100%;
}
.el-date-editor { .el-date-editor {
width: 100%; width: 100%;
} }
} }
} }
} }
//修改上传文件filelist位置
.uploadFile {
.el-form-item__content {
line-height: 20px !important;
div {
display: flex !important;
align-items: center !important;
}
.el-upload-list__item-name {
width: 150px !important;
}
.el-upload-list--text {
margin: 0px 20px 0 !important;
}
}
}
.el-tree{
.el-tree-node__children{
display: block !important;
overflow: auto;
}
.el-tree-node .is-hidden .is-focusable{
display: block !important;
}
}
.zoom-handle { .zoom-handle {
position: absolute; position: absolute;
width: 20px; width: 20px;
@@ -157,53 +198,53 @@ body,
/* 表格-e */ /* 表格-e */
/* 新增/编辑表单-s */ // /* 新增/编辑表单-s */
.cn-operate-dialog { // .cn-operate-dialog {
overflow: hidden; // overflow: hidden;
border-radius: var(--el-border-radius-base); // border-radius: var(--el-border-radius-base);
} // }
.cn-operate-dialog .el-dialog__header { // .cn-operate-dialog .el-dialog__header {
padding-bottom: 16px; // padding-bottom: 16px;
border-bottom: 1px solid var(--ba-bg-color); // border-bottom: 1px solid var(--ba-bg-color);
} // }
.cn-operate-dialog .el-dialog__body { // .cn-operate-dialog .el-dialog__body {
height: 60vh; // max-height: 60vh;
padding-top: 20px; // padding-top: 20px;
padding-bottom: 52px; // padding-bottom: 52px;
} // }
.cn-operate-dialog .el-dialog__body .el-scrollbar { // .cn-operate-dialog .el-dialog__body .el-scrollbar {
// padding-right: 60px; // // padding-right: 60px;
} // }
.cn-operate-dialog .el-dialog__footer { // .cn-operate-dialog .el-dialog__footer {
padding: 10px var(--el-dialog-padding-primary); // padding: 15px;
box-shadow: var(--el-box-shadow); // box-shadow: var(--el-box-shadow);
position: absolute; // position: absolute;
width: 100%; // width: 100%;
bottom: 0; // bottom: 0;
} // }
.cn-operate-dialog .el-form { // .cn-operate-dialog .el-form {
width: calc(100% - 60px); // width: calc(100% - 60px);
} // }
.cn-operate-dialog .el-form--inline { // .cn-operate-dialog .el-form--inline {
display: grid; // display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); // grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
grid-gap: 20px 10px; // grid-gap: 20px 10px;
.el-form-item { // .el-form-item {
margin-right: 0; // margin-right: 0;
margin-bottom: 0; // margin-bottom: 0;
} // }
} // }
.cn-operate-dialog .el-form--inline .el-select { // .cn-operate-dialog .el-form--inline .el-select {
width: 100%; // width: 100%;
} // }
.ba-operate-form { .ba-operate-form {
padding-top: 20px; padding-top: 20px;
@@ -351,21 +392,31 @@ body,
background: #fff; background: #fff;
z-index: 2; z-index: 2;
} }
.bjs-powered-by {
display: none;
}
@font-face { @font-face {
font-family: "AlimamaFangYuanTiVF"; font-family: 'AlimamaFangYuanTiVF';
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'), src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
url("../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff2") format('woff2'); url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff2') format('woff2');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
//阿里变形字体
@font-face {
font-family: 'nablaRegular';
src: url('../assets/font/ali/Nabla_Regular.woff') format('woff'),
url('../assets/font/ali/Nabla_Regular.woff2') format('woff2');
font-weight: normal;
font-style: normal;
}
@font-face { @font-face {
font-family: "AlimamaDongFangDaKai"; font-family: 'AlimamaDongFangDaKai';
src: url('../assets/font/ali/AlimamaDongFangDaKai-Regular.woff') format('woff'), src: url('../assets/font/ali/AlimamaDongFangDaKai-Regular.woff') format('woff'),
url("../assets/font/ali/AlimamaDongFangDaKai-Regular.woff2") format('woff2'); url('../assets/font/ali/AlimamaDongFangDaKai-Regular.woff2') format('woff2');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }

View File

@@ -29,16 +29,38 @@
} }
} }
} }
.el-dialog {
padding: 0px !important;
.el-dialog__footer {
padding: 15px;
box-shadow: var(--el-box-shadow);
width: 100%;
bottom: 0;
}
}
.el-dialog__body {
max-height: 60vh;
overflow-y: auto;
padding: 10px;
}
.el-dialog__header { .el-dialog__header {
background: var(--el-color-primary); background: var(--el-color-primary);
margin-right: 0; padding: 15px;
margin-right: 0px;
.el-dialog__headerbtn { .el-dialog__headerbtn {
top: 5px;
.el-icon { .el-icon {
color: var(--el-color-white); color: var(--el-color-white);
} }
} }
.el-dialog__headerbtn:hover {
.el-icon {
color: #409eff;
}
}
.el-dialog__title { .el-dialog__title {
color: var(--el-color-white); color: var(--el-color-white);
@@ -61,10 +83,6 @@
padding: 5px 11px; padding: 5px 11px;
} }
.el-dialog__body {
padding: 10px;
}
/* dialog滚动条-s */ /* dialog滚动条-s */
.el-overlay-dialog, .el-overlay-dialog,
.el-tabs__content, .el-tabs__content,
@@ -131,7 +149,7 @@
} }
.el-select { .el-select {
min-width: 220px; min-width: 200px;
} }
.el-tabs__content { .el-tabs__content {
@@ -143,8 +161,8 @@
.el-button--primary:focus { .el-button--primary:focus {
color: var(--el-color-white); color: var(--el-color-white);
border-color: var(--el-color-primary); // border-color: var(--el-color-primary);
background-color: var(--el-color-primary); // background-color: var(--el-color-primary);
outline: 0; outline: 0;
} }
.el-button--primary:hover { .el-button--primary:hover {
@@ -173,3 +191,24 @@
color: var(--el-color-primary-light-5); color: var(--el-color-primary-light-5);
background-color: var(--el-color-primary-light-9) !important; background-color: var(--el-color-primary-light-9) !important;
} }
.el-divider--horizontal {
margin: 15px 0;
}
.el-step__title {
cursor: pointer;
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner,
.el-radio__input.is-disabled.is-checked .el-radio__inner {
background-color: var(--el-color-primary);
opacity: 0.6;
}
.sgmap-ctrl-bottom-left {
display: none !important;
}
.el-drawer__header {
margin-bottom: 0 !important;
}

View File

@@ -75,21 +75,22 @@ const tableStore = new TableStore({
url: '/system-boot/csDictData/list', url: '/system-boot/csDictData/list',
method: 'POST', method: 'POST',
column: [ column: [
{ title: '数据分类', field: 'dataTypeName' }, { title: '数据分类', field: 'dataTypeName' , width: 170 },
{ title: '数据名称', field: 'name' }, { title: '数据名称', field: 'name' , width: 220 },
{ title: '别名', field: 'otherName' }, { title: '别名', field: 'otherName' , width: 220 },
{ title: '展示名称', field: 'showName' }, { title: '展示名称', field: 'showName' , width: 170 },
{ title: '相别', field: 'phaseName', width: 80 }, { title: '相别', field: 'phaseName', width: 80 },
{ title: '单位', field: 'unit', width: 80 }, { title: '单位', field: 'unit', width: 80 },
{ title: '基础数据类型', field: 'type', width: 80 }, { title: '基础数据类型', field: 'type', width: 170 },
{ title: '数据谐波次数', field: 'harmStartEnd' }, { title: '数据谐波次数', field: 'harmStartEnd', width: 170 },
{ title: '数据统计方法', field: 'statMethod' }, { title: '数据统计方法', field: 'statMethod', width: 170 },
{ title: '数据存储', field: 'classIdName' }, { title: '数据存储', field: 'classIdName' , width: 120 },
{ title: '数据来源', field: 'resourcesIdName' }, { title: '数据来源', field: 'resourcesIdName' , width: 120 },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: '180', width: '180',
fixed: 'right',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
{ {

View File

@@ -66,8 +66,9 @@
:title="dialogTitle" :title="dialogTitle"
v-model="dialogFormVisible" v-model="dialogFormVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
class="cn-operate-dialog"
:before-close="resetForm" :before-close="resetForm"
draggable
width="40%"
> >
<el-form :model="form" label-width="120px" :rules="rules" ref="ruleFormRef"> <el-form :model="form" label-width="120px" :rules="rules" ref="ruleFormRef">
<el-form-item label="设备名称:" prop="name"> <el-form-item label="设备名称:" prop="name">
@@ -136,7 +137,10 @@ import {
deleteEquipmentDelivery, deleteEquipmentDelivery,
editEquipmentDelivery, editEquipmentDelivery,
batchImportDevice, batchImportDevice,
resetEquipmentDelivery resetEquipmentDelivery,
governDeviceRegister,
portableDeviceRegister,
portableDeviceAccess
} from '@/api/cs-system-boot/device' } from '@/api/cs-system-boot/device'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import { fullUrl } from '@/utils/common' import { fullUrl } from '@/utils/common'
@@ -216,20 +220,14 @@ const tableStore = new TableStore({
title: '设备类型', title: '设备类型',
field: 'devType', field: 'devType',
formatter: row => { formatter: row => {
return ( return devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
)
} }
}, },
{ {
title: '设备型号', title: '设备型号',
field: 'devModel', field: 'devModel',
formatter: row => { formatter: row => {
return ( return devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0]?.label
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
)
} }
}, },
{ {
@@ -244,15 +242,13 @@ const tableStore = new TableStore({
{ {
title: '状态', title: '状态',
field: 'status', field: 'status',
// formatter: row => { width: 100,
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
render: 'tag', render: 'tag',
custom: { custom: {
1: 'warning', 1: 'warning',
2: 'success', 2: 'success',
3: 'primary', 3: 'primary',
4: 'danger' 4: 'primary'
}, },
replaceValue: { replaceValue: {
1: '未注册', 1: '未注册',
@@ -260,6 +256,9 @@ const tableStore = new TableStore({
3: '接入', 3: '接入',
4: '已取消' 4: '已取消'
} }
// formatter: row => {
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
}, },
{ {
title: '操作', title: '操作',
@@ -267,6 +266,104 @@ const tableStore = new TableStore({
width: '180', width: '180',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
//直连装置注册
{
title: '注册',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '1'
)
},
click: row => {
// 直连设备注册
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
governDeviceRegister({
nDid: row.ndid,
type: '4'
}).then(res => {
ElMessage.success(res.message)
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
}
},
//便携式设备注册
{
title: '注册',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '1'
)
},
click: row => {
// 便携式设备注册
ElMessageBox.confirm('确定注册该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
portableDeviceRegister({
nDid: row.ndid
}).then(res => {
console.log(res,"8888");
ElMessage.success(res.message)
tableStore.index()
})
})
.catch(e => {})
}
},
//直连设备接入
{
title: '接入',
type: 'primary',
icon: 'el-icon-Grid',
render: 'basicButton',
disabled: row => {
return (
(row.devType == '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel == 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status != '2'
)
},
click: row => {
// 直连设备接入
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
governDeviceRegister({
nDid: row.ndid,
type: '4'
}).then(res => {
ElMessage.success(res.message)
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
}
},
//便携式设备接入
{ {
title: '接入', title: '接入',
type: 'primary', type: 'primary',
@@ -275,12 +372,26 @@ const tableStore = new TableStore({
disabled: row => { disabled: row => {
return ( return (
(row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' && (row.devType != '8b45cf6b7f5266e777d07c166ad5fa77' &&
row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') || row.devModel != 'a0d4da4b5c17b2172362a3f5a27bf217') ||
row.status == '3' row.status != '2'
) )
}, },
click: row => { click: row => {
console.log('接入') // 便携式设备接入
ElMessageBox.confirm('确定接入该设备吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
portableDeviceAccess({
nDid: row.ndid
}).then(res => {
ElMessage.success(res.message)
tableStore.index()
})
})
.catch(e => {})
} }
}, },
{ {
@@ -339,12 +450,14 @@ const tableStore = new TableStore({
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => {
deleteEquipmentDelivery(row.id).then(res => {
ElMessage.success('删除成功!')
tableStore.onTableAction('search', {})
})
}) })
.then(() => {
deleteEquipmentDelivery(row.id).then(res => {
ElMessage.success('删除成功!')
tableStore.onTableAction('search', {})
})
})
.catch(e => {})
} }
} }
] ]