Browse Source

Merge branch 'feat/v20241212-人脉银行' into dev

GuYun-D 3 months ago
parent
commit
d6cc8699f5
2 changed files with 31 additions and 26 deletions
  1. 4 4
      src/api/rm-bank/index.js
  2. 27 22
      src/views/rm-bank/activity/components/ActivityModal.vue

+ 4 - 4
src/api/rm-bank/index.js

@@ -51,7 +51,7 @@ export function getClubDetailApi(params) {
 export function patchClubMemberIsAdminApi(params) {
   return request({
     url: '/people-bank-club-member/patchClubMemberIsAdmin',
-    method: 'PATCH',
+    method: 'POST',
     params
   })
 }
@@ -88,7 +88,7 @@ export function getActivityDetailApi(params) {
 export function editMemberApi(data) {
   return request({
     url: '/people-bank-member/patchMember',
-    method: 'PATCH',
+    method: 'POST',
     data
   })
 }
@@ -115,7 +115,7 @@ export function deleteActivityApi(params) {
 export function patchPeopleBankActivitiesByIdApi(data) {
   return request({
     url: '/people-bank-activities/patchPeopleBankActivitiesById',
-    method: 'PATCH',
+    method: 'POST',
     data
   })
 }
@@ -133,7 +133,7 @@ export function getMemberByMemberIdApi(params) {
 export function patchClubMemberApi(data) {
   return request({
     url: '/people-bank-club-member/patchClubMember',
-    method: 'PATCH',
+    method: 'POST',
     data
   })
 }

+ 27 - 22
src/views/rm-bank/activity/components/ActivityModal.vue

@@ -252,24 +252,6 @@ export default {
   },
   methods: {
     show(row) {
-      if (row) {
-        const activitiesAddress = row.activitiesAddress !== DEFAULT_ACTIVITY_ADDRESS ? row.activitiesAddress : ''
-        let activitiesAddressTemp = ''
-        let activitiesDetailAddressTemp = ''
-        if (activitiesAddress) {
-          activitiesAddressTemp = (activitiesAddress.split(' ')[0] || '').replace('undefined', '')
-          activitiesDetailAddressTemp = (activitiesAddress.split(' ')[1] || '').replace('undefined', '')
-          this.selectAddressLabel = (activitiesAddress.split(' ')[0] || '').replace('undefined', '')
-        }
-        Object.assign(this.activityForm.activities, row, {
-          activitiesAddress: activitiesAddressTemp,
-          activitiesDetailAddress: activitiesDetailAddressTemp,
-          id: row.id,
-          typeEnum: getTypeEnumByValue(Number(row.type)),
-          stateEnum: getStateEnumByValue(Number(row.state))
-        })
-        this.handleChangeTypeState()
-      }
       this.activityVisible = true
       setTimeout(this.calcSwiperHeight)
       // 拦截editor的图片上传 转码 -> 服务器上传
@@ -277,6 +259,25 @@ export default {
       this.$nextTick(() => {
         interceptQuillImageUpload(this, this.editorCustomOptions)
         this.stopObserver = listenEditorContentHeightChange(this, this.calcSwiperHeight)
+        this.resetDialog()
+        if (row) {
+          const activitiesAddress = row.activitiesAddress !== DEFAULT_ACTIVITY_ADDRESS ? row.activitiesAddress : ''
+          let activitiesAddressTemp = ''
+          let activitiesDetailAddressTemp = ''
+          if (activitiesAddress) {
+            activitiesAddressTemp = (activitiesAddress.split(' ')[0] || '').replace('undefined', '')
+            activitiesDetailAddressTemp = (activitiesAddress.split(' ')[1] || '').replace('undefined', '')
+            this.selectAddressLabel = (activitiesAddress.split(' ')[0] || '').replace('undefined', '')
+          }
+          Object.assign(this.activityForm.activities, row, {
+            activitiesAddress: activitiesAddressTemp,
+            activitiesDetailAddress: activitiesDetailAddressTemp,
+            id: row.id,
+            typeEnum: getTypeEnumByValue(Number(row.type)),
+            stateEnum: getStateEnumByValue(Number(row.state))
+          })
+          this.handleChangeTypeState()
+        }
       })
     },
 
@@ -320,18 +321,22 @@ export default {
     },
 
     close() {
+      this.resetDialog()
+      this.$nextTick(() => {
+        this.activityVisible = false
+      })
+    },
+
+    resetDialog() {
       this.activityForm = getDefaultActivityForm()
       this.currentStep = 0
-      this.$refs.elCarouselRef.setActiveItem('step-one')
+      this.$refs.elCarouselRef && this.$refs.elCarouselRef.setActiveItem('step-one')
       this.$refs.activityModalFormRef.clearValidate()
       this.$refs.activityNextModalFormRef.clearValidate()
       this.$refs.activityModalFormRef.resetFields()
       this.$refs.activityNextModalFormRef.resetFields()
       this.selectAddressLabel = ''
       typeof this.stopObserver === 'function' && this.stopObserver()
-      this.$nextTick(() => {
-        this.activityVisible = false
-      })
     },
 
     // 计算swiper的高度