diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
diff --git a/src/views/data/electricity/network.vue b/src/views/data/electricity/network.vue
index 00dc8f8..ad9339d 100644
--- a/src/views/data/electricity/network.vue
+++ b/src/views/data/electricity/network.vue
@@ -53,7 +53,6 @@
getElectricityList(searchQuery).then((res) => {
list.value = res.data.rows
total.value = res.data.total
- console.log(res.data, '配电网管理')
loadingTable.value = false
})
}
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
diff --git a/src/views/data/electricity/network.vue b/src/views/data/electricity/network.vue
index 00dc8f8..ad9339d 100644
--- a/src/views/data/electricity/network.vue
+++ b/src/views/data/electricity/network.vue
@@ -53,7 +53,6 @@
getElectricityList(searchQuery).then((res) => {
list.value = res.data.rows
total.value = res.data.total
- console.log(res.data, '配电网管理')
loadingTable.value = false
})
}
diff --git a/src/views/data/electricity/page.vue b/src/views/data/electricity/page.vue
index d1b96b9..65d85fe 100644
--- a/src/views/data/electricity/page.vue
+++ b/src/views/data/electricity/page.vue
@@ -100,6 +100,7 @@
searchQuery.limit = 20
searchQuery.startTime = ''
searchQuery.endTime = ''
+ search()
}
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size?: number; page?: number }) => {
@@ -131,7 +132,7 @@
-
+
diff --git a/src/api/api/index.ts b/src/api/api/index.ts
index 0af6bf9..c8f1479 100644
--- a/src/api/api/index.ts
+++ b/src/api/api/index.ts
@@ -147,6 +147,37 @@
method: 'get',
})
}
+// 配电网支路查询 分页
+export function electricityBranchPage(params: any) {
+ return request({
+ url: '/branchNodeInfo/listPage',
+ method: 'get',
+ params,
+ })
+}
+// 配电网支路修改
+export function electricityBranchUpdate(data: object) {
+ return request({
+ url: '/branchNodeInfo/update',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路新增
+export function electricityBranchAdd(data: object) {
+ return request({
+ url: '/branchNodeInfo/add',
+ method: 'post',
+ data,
+ })
+}
+// 配电网支路删除
+export function electricityBranchDel(id: string) {
+ return request({
+ url: `/branchNodeInfo/delete?id=${id}`,
+ method: 'post',
+ })
+}
// 光伏/楼宇/电动车管理列表
export function getMonitorStation(params: any) {
return request({
@@ -155,6 +186,13 @@
params,
})
}
+// 光伏详情
+export function getMonitorStationDetail(id: string) {
+ return request({
+ url: `/monitorStation/detail/${id}`,
+ method: 'get',
+ })
+}
// 光伏列表 - 不分页
export function getMonitorStationList() {
return request({
diff --git a/src/views/data/electricity/components/branchAdd.vue b/src/views/data/electricity/components/branchAdd.vue
index 1c760ca..99ae787 100644
--- a/src/views/data/electricity/components/branchAdd.vue
+++ b/src/views/data/electricity/components/branchAdd.vue
@@ -6,22 +6,35 @@
@@ -169,85 +176,109 @@
-
-
+
+
-
-
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
diff --git a/src/views/data/electricity/components/busbarAdd.vue b/src/views/data/electricity/components/busbarAdd.vue
index 535fa65..e453c24 100644
--- a/src/views/data/electricity/components/busbarAdd.vue
+++ b/src/views/data/electricity/components/busbarAdd.vue
@@ -19,6 +19,7 @@
const dialogFormVisible = ref(false) // 对话框是否显示
const dialogStatus = ref('') // 对话框类型:create,update
const isEditMode = ref(true)
+const rowData = ref()
const areaForm = ref({
type: '', // 节点类型
gs: '', // 节点并联电导
@@ -32,7 +33,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -46,16 +50,25 @@
NodeListAll.value = res.data.map(item => item.busId.toString())
})
}
-// 节点编号验证规则
+// 节点编号验证规则(不能重复)
const validateBusId = (rule: any, value: any, callback: any) => {
- if (value && dialogStatus.value === 'update') {
- callback()
+ // 修改的验证
+ if (dialogStatus.value === 'update') {
+ if (!(NodeListAll.value.filter(item => item !== rowData.value.busId.toString()).includes(value.toString()))) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
- // if () {
- // callback()
- // }
else {
- callback(new Error('验证失败'))
+ // 新增的验证
+ if (!NodeListAll.value.includes(value.toString())) {
+ callback()
+ }
+ else {
+ callback(new Error('验证失败'))
+ }
}
}
const rules: FormRules = {
@@ -71,6 +84,9 @@
vmin: [{ required: true, message: '节点最小电压', trigger: ['blur', 'change'] }],
pd: [{ required: true, message: '负荷有功功率', trigger: ['blur', 'change'] }],
qd: [{ required: true, message: '负荷无功功率', trigger: ['blur', 'change'] }],
+ lng: [{ required: true, message: '节点经度', trigger: ['blur', 'change'] }],
+ lat: [{ required: true, message: '节点纬度', trigger: ['blur', 'change'] }],
+ nodeName: [{ required: true, message: '节点名称', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
const resetForm = () => {
@@ -87,7 +103,10 @@
pd: '', // 负荷有功功率
qd: '', // 负荷无功功率
id: '',
- busId: '',
+ electricityId: '',
+ nodeName: '',
+ lng: '',
+ lat: '',
}
}
const nodeTypeList = ref([])
@@ -99,9 +118,9 @@
}
fetchNodeType()
-fetchDataList()
// 初始化对话框
-const initDialog = (dialogStatusValue: string, row: any) => {
+const initDialog = (dialogStatusValue: string, row: any, id: string) => {
+ fetchDataList()
dialogStatus.value = dialogStatusValue
dialogFormVisible.value = true
btnLoading.value = false
@@ -111,11 +130,12 @@
nextTick(() => {
dataFormRef.value.clearValidate()
})
+ areaForm.value.electricityId = id
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
areaForm.value = row
+ rowData.value = JSON.parse(JSON.stringify(row))
areaForm.value.type = row.type.toString()
- console.log(areaForm.value)
isEditMode.value = true
}
}
@@ -174,7 +194,6 @@
// 保存数据
const saveData = () => {
- console.log(dialogStatus.value)
if (dialogStatus.value === 'update') {
updateData()
}
@@ -209,6 +228,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/data/electricity/components/networkBranch.vue b/src/views/data/electricity/components/networkBranch.vue
index d4245ed..35513f5 100644
--- a/src/views/data/electricity/components/networkBranch.vue
+++ b/src/views/data/electricity/components/networkBranch.vue
@@ -6,7 +6,7 @@
diff --git a/src/views/data/electricity/network.vue b/src/views/data/electricity/network.vue
index 00dc8f8..ad9339d 100644
--- a/src/views/data/electricity/network.vue
+++ b/src/views/data/electricity/network.vue
@@ -53,7 +53,6 @@
getElectricityList(searchQuery).then((res) => {
list.value = res.data.rows
total.value = res.data.total
- console.log(res.data, '配电网管理')
loadingTable.value = false
})
}
diff --git a/src/views/data/electricity/page.vue b/src/views/data/electricity/page.vue
index d1b96b9..65d85fe 100644
--- a/src/views/data/electricity/page.vue
+++ b/src/views/data/electricity/page.vue
@@ -100,6 +100,7 @@
searchQuery.limit = 20
searchQuery.startTime = ''
searchQuery.endTime = ''
+ search()
}
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size?: number; page?: number }) => {
@@ -131,7 +132,7 @@
-
+
diff --git a/src/views/data/electricity/pageAdd.vue b/src/views/data/electricity/pageAdd.vue
index 223a07d..f4c41a3 100644
--- a/src/views/data/electricity/pageAdd.vue
+++ b/src/views/data/electricity/pageAdd.vue
@@ -3,7 +3,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import dayjs from 'dayjs'
import { getDictByCode } from '@/api/system/dict'
-import { addMonitorStation, getDeviceList, updateMonitorStation } from '@/api/api/index'
+import { addMonitorStation, getDeviceList, getMonitorStationDetail, updateMonitorStation } from '@/api/api/index'
const emits = defineEmits(['refresh'])
const dataFormRef = ref()
const dialogFormVisible = ref(false) // 对话框是否显示
@@ -21,6 +21,9 @@
pmax: '', // 最大有功
pmin: '', // 最小有功
strength: '', // 碳排强度
+ stationType: '0',
+ stationName: '',
+ deviceId: '',
}) // 表单
const textMap: { [key: string]: string } = {
update: '编辑',
@@ -39,6 +42,8 @@
pmax: [{ required: true, message: '最大有功不能为空', trigger: ['blur', 'change'] }],
pmin: [{ required: true, message: '最小有功不能为空', trigger: ['blur', 'change'] }],
strength: [{ required: true, message: '碳排强度不能为空', trigger: ['blur', 'change'] }],
+ stationName: [{ required: true, message: '名称不能为空', trigger: ['blur', 'change'] }],
+ deviceId: [{ required: true, message: '设备不能为空', trigger: ['blur', 'change'] }],
} // 前端校验规则
// 重置表单
@@ -55,24 +60,27 @@
pmax: '', // 最大有功
pmin: '', // 最小有功
strength: '', // 碳排强度
+ stationType: '0',
+ stationName: '',
+ deviceId: '',
}
}
-const deviceTypeList = ref([])
-// 获取设备类型列表
-const fetchDeviceType = () => {
- getDictByCode('device_type').then((res) => {
- deviceTypeList.value = res.data
- console.log(res, 'res')
+const statusTypeList = ref([])
+// 获取运行状态
+const fetchStatusType = () => {
+ getDictByCode('station_status').then((res) => {
+ statusTypeList.value = res.data
})
}
-const deviceList = ref([])
+fetchStatusType()
+// 获取设备列表
+const deviceList = ref([])
const fetchDeviceList = () => {
- getDeviceList({ offset: 1, limit: 99999 }).then((res) => {
+ getDeviceList({ limit: 9999, offset: 1 }).then((res) => {
deviceList.value = res.data.rows
})
}
fetchDeviceList()
-fetchDeviceType()
// 初始化对话框
const initDialog = (dialogStatusValue: string, row: any) => {
dialogStatus.value = dialogStatusValue
@@ -86,10 +94,14 @@
})
}
else if (dialogStatus.value === 'update') { // 如果是修改,将row中数据填写到输入框中
- areaForm.value = row
- isEditMode.value = true
+ getMonitorStationDetail(row.id).then((res) => {
+ areaForm.value = res.data
+ areaForm.value.status = areaForm.value.status.toString()
+ isEditMode.value = true
+ })
+ // areaForm.value = row
+ // isEditMode.value = true
}
- areaForm.value.stationType = row.stationType
}
defineExpose({
initDialog,
@@ -99,9 +111,7 @@
const createData = () => {
dataFormRef.value.validate((valid: any) => {
if (valid) {
- areaForm.value.uploadTime = dayjs().format('YYYY-MM-DD')
btnLoading.value = true
- console.log(areaForm.value, 'areaForm.value')
addMonitorStation(areaForm.value).then((response) => {
if (response.code === 200) {
btnLoading.value = false
@@ -126,7 +136,6 @@
const updateData = () => {
dataFormRef.value.validate((valid: any) => {
if (valid) {
- areaForm.value.uploadTime = dayjs().format('YYYY-MM-DD')
btnLoading.value = true
updateMonitorStation(areaForm.value).then((response) => {
if (response.code === 200) {
@@ -166,21 +175,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
@@ -222,7 +245,13 @@
-
+
+
+
+