Browse Source

add:计划添加

temp
zhaohy 4 months ago
parent
commit
e4c46d9da3
  1. 7
      hx-ai-intelligent/src/api/planToAdd.ts
  2. 3
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts
  3. 9
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

7
hx-ai-intelligent/src/api/planToAdd.ts

@ -1,6 +1,5 @@
export enum planToAddApi {
getActivatedPlanTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanTree', //计划树
getActivatedPlanListByTree = '/carbon-smart/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表
updPlan = '', //修改计划
delPlan = '', //修改计划
getActivatedPlanTree = '/carbon-smart/api/api/deviceCtrlPlan/getActivatedPlanTree', //计划树
getActivatedPlanListByTree = '/carbon-smart/api/deviceCtrlPlan/getActivatedPlanListByTree', //计划列表
updPlan = '/carbon-smart/api/deviceCtrlPlan/updateActivatedPlan', //修改计划
}

3
hx-ai-intelligent/src/view/equipmentControl/planToAdd/config.ts

@ -115,7 +115,7 @@ export const tableConfig = (
dynamicParams: ['uuid', 'appealType'],
confirm: true,
handle: (data: any) => {
http.post(planToAddApi.delPlan, { id: data.id, orgId: data.orgId }).then((res) => {
http.post(planToAddApi.updPlan, { id: data.id, isDeleted: 1 }).then((res) => {
if (res.msg === 'success') {
NsMessage.success('操作成功');
mainRef.value?.nsTableRef.reload();
@ -123,7 +123,6 @@ export const tableConfig = (
NsMessage.error(res.msg);
}
});
console.log(data, '删除');
mainRef.value?.nsTableRef.reload();
},
},

9
hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

@ -13,6 +13,8 @@
import { ref, onMounted } from 'vue';
import NsModalFrom from '/@/components/ns-modal-form.vue';
import { planToAddApi } from '/@/api/planToAdd';
import { NsMessage } from '/nerv-lib/component';
//
const orgId = ref('');
const projectId = ref('');
@ -41,7 +43,7 @@
allowClear: true,
fieldMap: ['startTime', 'endTime'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD hh:mm:ss',
placeholder: ['开始日期', '结束日期'],
},
rules: [
@ -56,8 +58,11 @@
bodyStyle: { paddingBottom: 0 },
},
success: (data: any) => {
console.log(data, '数据');
if (data.msg === 'success') {
mainRef.value?.nsTableRef.reload();
} else {
NsMessage.error(data.msg);
}
},
});
//

Loading…
Cancel
Save