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. 13
      hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue

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

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

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

@ -115,7 +115,7 @@ export const tableConfig = (
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
confirm: true, confirm: true,
handle: (data: any) => { 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') { if (res.msg === 'success') {
NsMessage.success('操作成功'); NsMessage.success('操作成功');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
@ -123,7 +123,6 @@ export const tableConfig = (
NsMessage.error(res.msg); NsMessage.error(res.msg);
} }
}); });
console.log(data, '删除');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}, },
}, },

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

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

Loading…
Cancel
Save