feat: 查询补充
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
:cancel="() => (visible = false)"
|
||||
placement="right">
|
||||
<ns-form
|
||||
ref="editGroupRef"
|
||||
:schemas="schemas(inputDisabled)"
|
||||
:model="model"
|
||||
formLayout="vertical"
|
||||
@@ -15,7 +16,7 @@
|
||||
<template #addonAfter="data">
|
||||
<template v-if="data.field === 'groupName'">
|
||||
<div class="iconOP">
|
||||
<EditOutlined v-if="inputDisabled" @click="() => (inputDisabled = false)" />
|
||||
<EditOutlined v-if="inputDisabled" @click="editGroup" />
|
||||
<CheckOutlined v-else @click="op" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -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('操作成功');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user