3535<script >
3636import { ref , reactive , computed } from ' vue'
3737import { Button , Collapse , CollapseItem , Form , FormItem , Input } from ' @opentiny/vue'
38- import { useLayout , useNotify , getMetaApi , META_SERVICE } from ' @opentiny/tiny-engine-meta-register'
38+ import { useLayout , useNotify } from ' @opentiny/tiny-engine-meta-register'
3939import { PluginSetting , ButtonGroup , SvgButton } from ' @opentiny/tiny-engine-common'
4040import { createResourceGroup , updateResourceGroup } from ' ./js/http'
4141
@@ -53,7 +53,6 @@ const state = reactive({
5353export const openResourceSettingPanel = (data ) => {
5454 if (data) {
5555 state .data = { ... data }
56- console .log (state .data )
5756 }
5857 isShow .value = true
5958}
@@ -87,9 +86,12 @@ export default {
8786 })
8887 const saveResourceSetting = () => {
8988 generalForm .value .validate ((valid ) => {
89+ if (! valid) {
90+ return
91+ }
9092 if (state .data .id ) {
9193 updateResourceGroup (state .data .id , { name: state .data .name , description: state .data .description })
92- .then ((res ) => {
94+ .then (() => {
9395 emit (' create-group' )
9496 closeResourceSettingPanel ()
9597 useNotify ({ message: ' 修改资源分组成功' , type: ' success' })
@@ -99,7 +101,7 @@ export default {
99101 })
100102 } else {
101103 createResourceGroup (state .data )
102- .then ((res ) => {
104+ .then (() => {
103105 emit (' create-group' )
104106 closeResourceSettingPanel ()
105107 useNotify ({ message: ' 添加资源分组成功' , type: ' success' })
0 commit comments