- (inputDisabled = false)" />
+
@@ -53,6 +54,7 @@
const emit = defineEmits(['sure']);
const props = defineProps({ params: Object });
const visible = ref(false);
+ const editGroupRef = ref();
const model = ref({});
const inputDisabled = ref(true);
const selectedRowKeys = ref([]);
@@ -63,6 +65,7 @@
};
const startCararcter = 65;
+ // 点击新增按钮新增分组
const addGroup = () => {
opType = true;
getCode();
@@ -71,19 +74,30 @@
model.value = { groupName: '' };
// if(mockDataSource.value.length)
};
+
const op = () => {
inputDisabled.value = !inputDisabled.value;
add();
};
- //新增
+
+ const editGroup = () => {
+ if (!selectedRowKeys.value?.length) {
+ NsMessage.warn('请先选择需要编辑的分组');
+ return;
+ }
+ inputDisabled.value = false;
+ };
+ //点击对钩按钮处理保存逻辑
const add = () => {
const finalParams = { ...props.params, ...model.value };
if (opType) {
delete finalParams.id;
}
- http.post(group.saveComputeGroup, finalParams).then(() => {
- getTableData();
- NsMessage.success('操作成功');
+ editGroupRef.value.triggerSubmit().then(() => {
+ http.post(group.saveComputeGroup, finalParams).then(() => {
+ getTableData();
+ NsMessage.success('操作成功');
+ });
});
};
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
index 389320f..8ddb9c9 100644
--- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
+++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
@@ -16,7 +16,14 @@