add:照明系统/通风系统 交互改动
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
title="此操作将移除该数据"
|
||||
ok-text="确定"
|
||||
cancel-text="取消"
|
||||
placement="topRight"
|
||||
@confirm="deletePlan(row)">
|
||||
<div class="tabDelete">删除</div>
|
||||
</a-popconfirm>
|
||||
@@ -60,7 +61,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="out-dialog" v-if="addVisible">
|
||||
<div class="content" v-if="addVisible">
|
||||
<div class="content">
|
||||
<div class="div-operation"></div>
|
||||
<span class="text-operation">计划库</span>
|
||||
</div>
|
||||
@@ -126,6 +127,11 @@
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @method resetAll 刷新3个tab中的全部数据(修改计划,会影响tab1数据信息,生成tab3日志)
|
||||
*/
|
||||
const emit = defineEmits(['resetAll']);
|
||||
|
||||
// tab页部分 ========================================================
|
||||
|
||||
// 设置枚举的颜色 与 文本
|
||||
@@ -150,7 +156,15 @@
|
||||
// 计划启用/禁用事件
|
||||
const togglePlan = (state: number) => {
|
||||
dataSource.value.forEach((item: any) => {
|
||||
item.executeStatus.value = state;
|
||||
// 执行中 无法修改为待执行
|
||||
if (state == 1) {
|
||||
if (item.executeStatus.value != 2) {
|
||||
item.executeStatus.value = state;
|
||||
}
|
||||
// 任何状态都可以修改为 暂停
|
||||
} else {
|
||||
item.executeStatus.value = state;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -178,6 +192,9 @@
|
||||
if (row.executeStatus.value == 1) {
|
||||
return message.info('该数据已是待执行状态,无需再次修改');
|
||||
}
|
||||
if (row.executeStatus.value == 2) {
|
||||
return message.info('执行中的状态已被启用,无需修改');
|
||||
}
|
||||
row.executeStatus.value = 1;
|
||||
};
|
||||
// 将对表格的修改统一发送
|
||||
@@ -187,13 +204,24 @@
|
||||
url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
|
||||
dataSource.value,
|
||||
)
|
||||
.then(() => {
|
||||
message.success('操作成功');
|
||||
getTable();
|
||||
getLeftPlan();
|
||||
.then((res) => {
|
||||
if (res.retcode == 0) {
|
||||
message.success('操作成功');
|
||||
// 刷新数据
|
||||
emit('resetAll');
|
||||
} else {
|
||||
message.info(res.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const reset = () => {
|
||||
// 计划表格
|
||||
getTable();
|
||||
// 穿梭框原始数据
|
||||
getLeftPlan();
|
||||
};
|
||||
|
||||
// tab页弹窗部分 ====================================================
|
||||
|
||||
// 添加弹窗控制变量
|
||||
@@ -244,14 +272,18 @@
|
||||
http.post(planManage.submitTransData, targetKeys.value).then(() => {
|
||||
message.success('添加成功');
|
||||
// 如果发送成功,则刷新表格
|
||||
getTable();
|
||||
getLeftPlan();
|
||||
reset();
|
||||
});
|
||||
};
|
||||
|
||||
const filterOption = (inputValue: string, option: any) => {
|
||||
return option.description.indexOf(inputValue) > -1;
|
||||
};
|
||||
|
||||
// 向外暴露方法
|
||||
defineExpose({
|
||||
reset,
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@import '../../style/dialogStyle.less';
|
||||
|
Reference in New Issue
Block a user