与后端接口进行首次联调

This commit is contained in:
GYYM
2024-10-31 08:51:30 +08:00
parent 6bcb22686d
commit 6c6d2fe566
9 changed files with 170 additions and 71 deletions

View File

@@ -41,6 +41,7 @@
<script lang="ts" setup>
import { FormInstance,FormItemRule } from 'element-plus'
import { ProTableInstance } from '@/components/ProTable/interface'
import { ref,computed } from 'vue'
import { Role } from '@/api/role/interface'
import {dialogSmall} from '@/utils/elementBind'
@@ -51,10 +52,11 @@
} from '@/api/role/role'
const dictStore = useDictStore()
const {dialogVisible,title,data,openType} = defineProps<{
const {dialogVisible,title,data,openType,getTableList} = defineProps<{
dialogVisible:boolean;
title:string;
openType:string;
getTableList:Function;
data:{
id?: string; //角色类型ID
name: string; //角色类型名称
@@ -81,11 +83,9 @@
}
const handleOK = () => {
console.log(data,11111)
ElMessage.info('角色数据提交')
try {
formRuleRef.value?.validate((valid: boolean) => {
try {
formRuleRef.value?.validate((valid: boolean) => {
if (valid) {
// 将表单数据转为json,发送到后端
// let confirmFormData = JSON.parse(JSON.stringify(form.value))
@@ -96,7 +96,7 @@
if(res.code === "200")
{
ElMessage.success(res.message)
updataList()
getTableList()
}
else
ElMessage.error(res.message)
@@ -109,7 +109,7 @@
if(res.code === "200")
{
ElMessage.success(res.message)
updataList()
getTableList()
}
else
ElMessage.error(res.message)