|
@@ -25,9 +25,10 @@ import { shallowRef, PropType, ref, defineAsyncComponent, onMounted } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { i18n } from '@/stores'
|
|
import { i18n } from '@/stores'
|
|
|
-import { roleadd } from '@/services/api/member'
|
|
|
|
|
|
|
+import { roleadd, initAdd } from '@/services/api/member'
|
|
|
import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
record: {
|
|
record: {
|
|
@@ -44,7 +45,15 @@ const { global: { t } } = i18n
|
|
|
const formRef = ref<FormInstance>()
|
|
const formRef = ref<FormInstance>()
|
|
|
const show = shallowRef(true)
|
|
const show = shallowRef(true)
|
|
|
const refresh = shallowRef(false)
|
|
const refresh = shallowRef(false)
|
|
|
-const loading = shallowRef(false)
|
|
|
|
|
|
|
+
|
|
|
|
|
+const { data, loading } = useRequest(initAdd, {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ role: 'operate'
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: (err) => {
|
|
|
|
|
+ ElMessage.error(err)
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const formData = ref<Partial<Member.RoleAddReq>>({
|
|
const formData = ref<Partial<Member.RoleAddReq>>({
|
|
|
roleid: 2
|
|
roleid: 2
|