zhaohy
3 months ago
21 changed files with 408 additions and 218 deletions
@ -1,5 +1,5 @@ |
|||
export enum planToAddApi { |
|||
getActivatedPlanTree = '/carbon-smart/api/api/deviceCtrlPlan/getActivatedPlanTree', //计划树
|
|||
getActivatedPlanListByTree = '/carbon-smart/api/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表
|
|||
updPlan = '/carbon-smart/api/deviceCtrlPlan/updateActivatedPlan', //修改计划
|
|||
getActivatedPlanTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanTree', //计划树
|
|||
getActivatedPlanListByTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表
|
|||
updPlan = '/carbon-smart/deviceCtrlPlan/updateActivatedPlan', //修改计划
|
|||
} |
|||
|
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="12px" height="12px" xmlns="http://www.w3.org/2000/svg"> |
|||
<g transform="matrix(1 0 0 1 -347 -469 )"> |
|||
<path d="M 10.684322033898304 5.219491525423729 C 10.685593220338983 4.930932203389831 10.452966101694914 4.698305084745764 10.165677966101695 4.698305084745764 C 9.878389830508475 4.698305084745764 9.644491525423728 4.930932203389831 9.644491525423728 5.219491525423729 L 9.644491525423728 10.426271186440678 C 9.644491525423728 10.7135593220339 9.410593220338983 10.947457627118645 9.123305084745763 10.947457627118645 L 2.8754237288135593 10.947457627118645 C 2.588135593220339 10.947457627118645 2.354237288135593 10.7135593220339 2.354237288135593 10.426271186440678 L 2.354237288135593 5.219491525423729 C 2.354237288135593 4.932203389830509 2.1216101694915253 4.698305084745764 1.833050847457627 4.698305084745764 C 1.5444915254237288 4.698305084745764 1.3118644067796608 4.930932203389831 1.3118644067796608 5.219491525423729 L 1.3118644067796608 10.426271186440678 C 1.3118644067796608 11.288135593220339 2.01228813559322 11.988559322033899 2.8741525423728818 11.988559322033899 L 9.122033898305085 11.988559322033899 C 9.983898305084745 11.988559322033899 10.684322033898304 11.288135593220339 10.684322033898304 10.426271186440678 L 10.684322033898304 5.219491525423729 Z M 11.98728813559322 2.8766949152542374 C 11.98728813559322 2.589406779661017 11.753389830508475 2.3555084745762715 11.467372881355931 2.3555084745762715 L 9.12457627118644 2.3555084745762715 L 9.12457627118644 1.314406779661017 C 9.12457627118644 0.5961864406779662 8.539830508474576 0.012711864406779662 7.8228813559322035 0.012711864406779662 L 4.177118644067797 0.012711864406779662 C 3.458898305084746 0.012711864406779662 2.87542372881356 0.5961864406779662 2.87542372881356 1.314406779661017 L 2.87542372881356 2.3555084745762715 L 0.5326271186440679 2.3555084745762715 C 0.24661016949152548 2.3555084745762715 0.011440677966101768 2.589406779661017 0.011440677966101768 2.8766949152542374 C 0.011440677966101768 3.1627118644067798 0.2453389830508475 3.3978813559322036 0.5326271186440679 3.3978813559322036 L 11.466101694915254 3.3978813559322036 C 11.752118644067796 3.3978813559322036 11.98728813559322 3.163983050847458 11.98728813559322 2.8766949152542374 Z M 8.083474576271188 2.3555084745762715 L 3.917796610169492 2.3555084745762715 L 3.917796610169492 1.314406779661017 C 3.917796610169492 1.1707627118644068 4.034745762711864 1.053813559322034 4.1783898305084755 1.053813559322034 L 7.822881355932205 1.053813559322034 C 7.966525423728815 1.053813559322034 8.083474576271188 1.1707627118644068 8.083474576271188 1.314406779661017 L 8.083474576271188 2.3555084745762715 Z M 4.698305084745764 9.385169491525422 C 4.985593220338984 9.385169491525422 5.219491525423729 9.149999999999999 5.219491525423729 8.863983050847457 L 5.219491525423729 5.739406779661016 C 5.219491525423729 5.453389830508475 4.985593220338984 5.21822033898305 4.698305084745764 5.21822033898305 C 4.411016949152542 5.21822033898305 4.177118644067797 5.452118644067796 4.177118644067797 5.739406779661016 L 4.177118644067797 8.863983050847457 C 4.177118644067797 9.149999999999999 4.411016949152542 9.385169491525422 4.698305084745764 9.385169491525422 Z M 7.301694915254236 9.385169491525422 C 7.58771186440678 9.383898305084745 7.8228813559322035 9.149999999999999 7.8228813559322035 8.863983050847457 L 7.8228813559322035 5.739406779661016 C 7.8228813559322035 5.453389830508475 7.5889830508474585 5.21822033898305 7.301694915254236 5.21822033898305 C 7.015677966101695 5.21822033898305 6.780508474576271 5.452118644067796 6.780508474576271 5.739406779661016 L 6.780508474576271 8.863983050847457 C 6.780508474576271 9.149999999999999 7.014406779661017 9.385169491525422 7.301694915254236 9.385169491525422 Z " fill-rule="nonzero" fill="#d9001b" stroke="none" transform="matrix(1 0 0 1 347 469 )" /> |
|||
</g> |
|||
</svg> |
@ -0,0 +1,152 @@ |
|||
import { planToAddApi } from '/@/api/planToAdd'; |
|||
import { ref } from 'vue'; |
|||
import { http } from '/nerv-lib/util'; |
|||
import { getEnum } from '/@/api'; |
|||
import { NsMessage } from '/nerv-lib/component'; |
|||
|
|||
const enumData: any = await getEnum({ params: { enumType: 'CtrlDeviceType' } }); |
|||
export const tableConfig = ( |
|||
orgId: any, |
|||
projectId: any, |
|||
mainRef: any, |
|||
nsModalFormConfig: any, |
|||
modalFormRef: any, |
|||
) => { |
|||
return ref({ |
|||
title: '计划库', |
|||
api: planToAddApi.getActivatedPlanListByTree, |
|||
params: { orgId, projectId, deviceType: enumData.data[0].value }, |
|||
treeConfig: { |
|||
defaultExpandAll: true, |
|||
header: { |
|||
icon: 'name', |
|||
title: '执行计划', |
|||
}, |
|||
params: { projectId, deviceType: enumData.data[0].value }, |
|||
dynamicParams: { |
|||
id: 'id', |
|||
pid: 'pid', |
|||
level: 'level', |
|||
projectId: 'projectId', |
|||
deviceType: 'deviceType', |
|||
}, |
|||
api: planToAddApi.getActivatedPlanTree, |
|||
fieldNames: { |
|||
title: 'name', |
|||
key: 'id', |
|||
pid: 'pid', |
|||
level: 'level', |
|||
projectId: 'projectId', |
|||
deviceType: 'deviceType', |
|||
children: 'childList', |
|||
}, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'deviceType', |
|||
label: '告警优先级', |
|||
component: 'nsSelectApi', |
|||
autoSubmit: true, |
|||
componentProps: { |
|||
api: () => getEnum({ params: { enumType: 'CtrlDeviceType' } }), |
|||
immediate: true, |
|||
resultField: 'data', |
|||
labelField: 'label', |
|||
valueField: 'value', |
|||
placeholder: '请选择告警优先级', |
|||
showSearch: true, |
|||
autoSelectFirst: true, |
|||
filterOption: (input: string, option: any) => { |
|||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; |
|||
}, |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
}, |
|||
rowSelection: null, |
|||
columns: [ |
|||
{ |
|||
title: '执行顺序', |
|||
dataIndex: 'address', |
|||
width: 100, |
|||
customRender: (text: any) => { |
|||
return text.index + 1; |
|||
}, |
|||
}, |
|||
{ |
|||
title: '计划类型', |
|||
dataIndex: 'planGroupName', |
|||
}, |
|||
{ |
|||
title: '计划名称', |
|||
dataIndex: 'planName', |
|||
}, |
|||
{ |
|||
title: '执行时间', |
|||
dataIndex: 'executionTime', |
|||
}, |
|||
], |
|||
columnActions: { |
|||
title: '操作', |
|||
width: 200, |
|||
fixed: 'right', |
|||
dataIndex: 'tableAction', |
|||
actions: [ |
|||
{ |
|||
label: '编辑', |
|||
name: 'energyAlarmEdit', |
|||
dynamicParams: ['uuid', 'appealType'], |
|||
handle: (data: any) => { |
|||
const obj = { ...data }; |
|||
nsModalFormConfig.value.title = '编辑'; |
|||
setTimeout(() => { |
|||
nsModalFormConfig.value.data = { |
|||
id: obj.id, |
|||
}; |
|||
if (obj.startTime) { |
|||
nsModalFormConfig.value.data.createTime = obj.startTime |
|||
? [obj.startTime, obj.endTime] |
|||
: []; |
|||
} |
|||
}, 1); |
|||
modalFormRef.value?.toggle(); |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除', |
|||
name: 'energyAlarmDel', |
|||
dynamicParams: ['uuid', 'appealType'], |
|||
confirm: true, |
|||
handle: (data: any) => { |
|||
http.post(planToAddApi.updPlan, { id: data.id, isDeleted: 1 }).then((res) => { |
|||
if (res.msg === 'success') { |
|||
NsMessage.success('操作成功'); |
|||
mainRef.value?.nsTableRef.reload(); |
|||
} else { |
|||
NsMessage.error(res.msg); |
|||
} |
|||
}); |
|||
mainRef.value?.nsTableRef.reload(); |
|||
}, |
|||
}, |
|||
], |
|||
}, |
|||
formConfig: { |
|||
schemas: [ |
|||
{ |
|||
field: 'planName', |
|||
label: '计划标题', |
|||
component: 'NsInput', |
|||
componentProps: { |
|||
allowClear: true, |
|||
placeholder: '请输入计划名称关键字', |
|||
}, |
|||
}, |
|||
], |
|||
params: {}, |
|||
}, |
|||
// pagination: { pageSizeOptions: false },
|
|||
rowKey: 'uuid', |
|||
}); |
|||
}; |
Loading…
Reference in new issue