diff --git a/web/src/components/atuneTemplete.vue b/web/src/components/atuneTemplete.vue index 6abafc496fc878c98fe07ba47b69882481a58307..8a59f4a57f0f37ff4fdffd3c1f6a86ebd4f7ca0d 100644 --- a/web/src/components/atuneTemplete.vue +++ b/web/src/components/atuneTemplete.vue @@ -53,6 +53,11 @@ let props = defineProps({ default: false, required: true, }, + isUpdate: { + type: Boolean, + default: false, + required: false, + }, selectedEditRow: { type: Object as () => Atune, default: null, @@ -70,7 +75,7 @@ const form = reactive({ restore: "", note: "", }); -const emit = defineEmits(["closeDialog"]); +const emit = defineEmits(["closeDialog", "refreshData"]); // 获取所有的调优模板 const getAllTune = () => { getAtuneAllName().then((res) => { @@ -116,6 +121,7 @@ const saveTuneData = () => { saveTune(form) .then((res) => { if (res.data.code === 200) { + emit('refreshData') ElMessage.success(res.data.msg); } else { ElMessage.error(res.data.msg); @@ -129,6 +135,7 @@ const updateTuneData = () => { updateTune(form) .then((res) => { if (res.data.code === 200) { + emit('refreshData') ElMessage.success(res.data.msg); } else { ElMessage.error(res.data.msg); @@ -141,7 +148,7 @@ const updateTuneData = () => { const onSubmit = () => { emit("closeDialog"); - if (form.id === 0) { + if (!props.isUpdate) { saveTuneData(); } else { updateTuneData(); diff --git a/web/src/views/atuneList.vue b/web/src/views/atuneList.vue index 2269331d6ec8e09c18a229b0268a77eba9ff482a..706ea90d8f74e962b1586e1e2e63d4720132fbdf 100644 --- a/web/src/views/atuneList.vue +++ b/web/src/views/atuneList.vue @@ -23,7 +23,8 @@ - + @@ -41,6 +42,7 @@ const selectedEditRow = ref({} as Atune); const type = ref(''); // 弹窗类型 const title = ref('调优模板信息'); const width = ref('50%') +const isUpdate = ref(false) // 关闭dialog弹框 const closeDialog = () => { @@ -50,11 +52,16 @@ const closeDialog = () => { const handleCreat = () => { showDialog.value = true; type.value = 'edit'; + isUpdate.value = false; }; // 删除 const handleDelete = () => { tuneRef.value.handleDelete(); }; +// 刷新 +const handleRefresh = () => { + tuneRef.value.handleRefresh(); +} // 详情 const handleDetail = (row: Atune) => { showDialog.value = true; @@ -68,6 +75,7 @@ const handleEdit = (row: Atune) => { selectedEditRow.value = row; showDialog.value = true; type.value = 'edit'; + isUpdate.value = true; title.value = row.custom_name + '信息'; }; diff --git a/web/src/views/taskList.vue b/web/src/views/taskList.vue index dfb852519d2477562100646e464f6b1f78d5daca..e55cc9a1d8452316ad21e5cf9fa35a7f66701b4f 100644 --- a/web/src/views/taskList.vue +++ b/web/src/views/taskList.vue @@ -1,12 +1,7 @@