|
@@ -37,7 +37,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
import { QuiskExpose } from "@/helper/mount";
|
|
-import type { FormInstance, FormRules } from "element-plus";
|
|
|
|
|
|
+import { ElMessage, type FormInstance, type FormRules } from "element-plus";
|
|
// import { ElMessage } from "element-plus";
|
|
// import { ElMessage } from "element-plus";
|
|
import type { OrganizationType } from '@/request/organization'
|
|
import type { OrganizationType } from '@/request/organization'
|
|
import {
|
|
import {
|
|
@@ -103,32 +103,14 @@ onMounted(async () => {
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
-// const setParentId = () => {
|
|
|
|
-// if (user.value) {
|
|
|
|
-// const isSuper = user.value.roles.filter(item => item.roleKey === "super_admin").length > 0;
|
|
|
|
-// data.value.parentId = isSuper ? 0 : Number(user.value.orgId)
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// const handleSelect = (item: SelectType) => {
|
|
|
|
-// data.value.orgId = item.id
|
|
|
|
-// console.log('handleSelect-id', item.id)
|
|
|
|
-// }
|
|
|
|
-// const querySearch = (queryString: string, cb: any) => {
|
|
|
|
-// const results = queryString
|
|
|
|
-// ? allOrgs.value.filter(i => i.value.toLowerCase().includes(queryString.toLowerCase()))
|
|
|
|
-// : allOrgs.value
|
|
|
|
-// console.log('queryString', queryString)
|
|
|
|
-// console.log('results', results)
|
|
|
|
-// cb(results)
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
defineExpose<QuiskExpose>({
|
|
defineExpose<QuiskExpose>({
|
|
async submit() {
|
|
async submit() {
|
|
-
|
|
|
|
if (unref(baseFormRef)) {
|
|
if (unref(baseFormRef)) {
|
|
-
|
|
|
|
const res = await unref(baseFormRef)?.validate();
|
|
const res = await unref(baseFormRef)?.validate();
|
|
if (res) {
|
|
if (res) {
|
|
await props.submit(data.value as any as OrganizationType);
|
|
await props.submit(data.value as any as OrganizationType);
|
|
|
|
+ ElMessage.success('新增成功!');
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
throw "";
|
|
throw "";
|