|
@@ -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 => {
|