Browse Source

feat: #0000 菜单管理 100%

luoyali 1 năm trước cách đây
mục cha
commit
0aa4d43272
1 tập tin đã thay đổi với 13 bổ sung11 xóa
  1. 13 11
      src/views/setting/menu/save.vue

+ 13 - 11
src/views/setting/menu/save.vue

@@ -82,10 +82,11 @@
 </template>
 
 <script setup>
-import IconSelect from '@/components/IconSelect'
-import ScFormTable from '@/components/ScFormTable'
 import { ref } from 'vue'
 import resource from '@/api/system/resource'
+import IconSelect from '@/components/IconSelect'
+import ScFormTable from '@/components/ScFormTable'
+import { ElMessage } from 'element-plus'
 
 const form = ref({
 	id: '',
@@ -117,16 +118,17 @@ const apiListAddTemplate = ref({
 const loading = ref(false)
 
 // methods
-const save = () => {
+const save = async () => {
 	// 保存
-	// this.loading = true
-	// let res = await this.$API.resource.save(this.form)
-	// this.loading = false
-	// if (res.code == 200) {
-	// 	this.$message.success('保存成功')
-	// } else {
-	// 	this.$message.warning(res.message)
-	// }
+	loading.value = true
+	try {
+		await resource.resourceAddOrEditSaveApi(form.value)
+		ElMessage.success('保存成功')
+		loading.value = false
+	} catch (e) {
+		loading.value = false
+		console.log(e, '保存菜单失败')
+	}
 }
 
 const setData = async data => {