Explorar el Código

页面级组件统一导出

yuwenjun1997 hace 2 años
padre
commit
0e526d07d3

+ 6 - 0
src/views/components/index.js

@@ -1,2 +1,8 @@
 export { default as ClubDetail } from './ClubDetail/index.vue'
 export { default as DeviceDetail } from './DeviceDetail/index.vue'
+export { default as AuthCardTemplate } from './AuthCardTemplate/index.vue'
+export { default as CustomItems } from './CustomItems/index.vue'
+export { default as DeviceSection } from './DeviceSection/index.vue'
+export { default as DoctorCustomItems } from './DoctorCustomItems/index.vue'
+export { default as MemberBenefits } from './MemberBenefits/index.vue'
+export { default as RadioCard } from './RadioCard/index.vue'

+ 1 - 1
src/views/components/payment/pay-bank.vue

@@ -37,7 +37,7 @@
 <script>
 import handleClipboard from '@/utils/clipboard'
 // 单选 / 多选
-import RadioCard from '@/views/components/RadioCard'
+import { RadioCard } from '@/views/components'
 import { createPayUrl, fetchBankcodeList, payVipWithUnion } from '@/api/pay'
 export default {
   components: { RadioCard },

+ 14 - 8
src/views/normal/personnel/operate/edit.vue

@@ -51,7 +51,12 @@
       <el-form-item label="操作师标签:" prop="tagList">
         <el-input v-show="false" v-model="formData.tagList" />
         <div class="tag-control">
-          <input v-model="tagName" class="el-input el-input__inner" placeholder="输入标签名后点击添加按钮(15个字符内)" maxlength="15">
+          <input
+            v-model="tagName"
+            class="el-input el-input__inner"
+            placeholder="输入标签名后点击添加按钮(15个字符内)"
+            maxlength="15"
+          >
           <el-button type="primary" @click="addTag">添加</el-button>
         </div>
         <div class="tag-list">
@@ -80,8 +85,7 @@
 <script>
 import { Promise } from 'jszip/lib/external'
 import { mapGetters } from 'vuex'
-import DeviceSection from '@/views/components/DeviceSection/index.vue'
-import DoctorCustomItems from '@/views/components/DoctorCustomItems/index.vue'
+import { DeviceSection, DoctorCustomItems } from '@/views/components'
 import UploadImage from '@/components/UploadImage'
 import { doctorSave, doctorFormData, fetchDoctorClubList } from '@/api/doctor'
 
@@ -212,10 +216,12 @@ export default {
     initFormData() {
       if (this.editType !== 'edit') {
         this.$nextTick(() => {
-          this.$refs.customItems.setParamsItem([{
-            name: '',
-            content: ''
-          }])
+          this.$refs.customItems.setParamsItem([
+            {
+              name: '',
+              content: ''
+            }
+          ])
         })
         this.isRequest = false
         return
@@ -370,7 +376,7 @@ export default {
 .tag-list {
   padding-top: 8px;
 
-  .el-tag{
+  .el-tag {
     margin-right: 6px;
   }
 }

+ 33 - 28
src/views/normal/personnel/training/edit.vue

@@ -20,12 +20,7 @@
           placeholder="所在机构"
           @change="onDoctorClubChange"
         >
-          <el-option
-            v-for="item in clubList"
-            :key="item.authId"
-            :label="item.authParty"
-            :value="item.authId"
-          />
+          <el-option v-for="item in clubList" :key="item.authId" :label="item.authParty" :value="item.authId" />
         </el-select>
         <el-input v-show="false" v-model="formData.clubName" />
       </el-form-item>
@@ -56,18 +51,24 @@
       <el-form-item label="培训师标签" prop="tagList">
         <el-input v-show="false" v-model="formData.tagList" />
         <div class="tag-control">
-          <input v-model="tagName" class="el-input el-input__inner" placeholder="输入标签名后点击添加按钮(15个字符内)" maxlength="15">
+          <input
+            v-model="tagName"
+            class="el-input el-input__inner"
+            placeholder="输入标签名后点击添加按钮(15个字符内)"
+            maxlength="15"
+          >
           <el-button type="primary" @click="addTag">添加</el-button>
         </div>
         <div class="tag-list">
-          <el-tag v-for="(item,index) in addTagList" :key="index" closable @close="onTagClose(index)">{{ item }}</el-tag>
+          <el-tag v-for="(item, index) in addTagList" :key="index" closable @close="onTagClose(index)">{{
+            item
+          }}</el-tag>
         </div>
       </el-form-item>
 
       <el-form-item label="自定义属性">
         <doctor-custom-items v-if="!isRequest" ref="customItems" @change="customItemsChange" />
       </el-form-item>
-
     </el-form>
     <div class="submit-btn">
       <el-button type="primary" @click="submit">保存</el-button>
@@ -79,7 +80,7 @@
 <script>
 import { Promise } from 'jszip/lib/external'
 import { mapGetters } from 'vuex'
-import DoctorCustomItems from '@/views/components/DoctorCustomItems/index.vue'
+import { DoctorCustomItems } from '@/views/components'
 import UploadImage from '@/components/UploadImage'
 import { doctorSave, doctorFormData, fetchDoctorClubList } from '@/api/doctor'
 
@@ -172,7 +173,6 @@ export default {
     this.initFormData()
   },
   methods: {
-
     // 添加标签
     addTag() {
       this.addTagList.push(this.tagName.trim())
@@ -211,15 +211,17 @@ export default {
     initFormData() {
       if (this.editType !== 'edit') {
         this.$nextTick(() => {
-          this.$refs.customItems.setParamsItem([{
-            name: '',
-            content: ''
-          }])
+          this.$refs.customItems.setParamsItem([
+            {
+              name: '',
+              content: ''
+            }
+          ])
         })
         this.isRequest = false
         return
       }
-      doctorFormData({ doctorId: this.doctorId }).then(res => {
+      doctorFormData({ doctorId: this.doctorId }).then((res) => {
         this.setFormData(res.data)
       })
     },
@@ -235,7 +237,7 @@ export default {
       this.formData.banner = data.bannerList.length
       this.formData.equipmentList = data.equipmentList.length
       this.doctorImageList.push({ url: data.doctorImage, name: 'doctor' })
-      this.bannerList = data.bannerList.map(item => ({ url: item, name: '' }))
+      this.bannerList = data.bannerList.map((item) => ({ url: item, name: '' }))
       this.deviceList = data.equipmentList
       this.paramList = data.paramList
       this.addTagList = data.tagList
@@ -255,7 +257,7 @@ export default {
         // this.$refs.subForm.valideAllForm(),
         this.$refs.submitForm.validate(),
         this.$refs.customItems.valideAllForm()
-      ]).then(res => {
+      ]).then((res) => {
         this.save()
       })
     },
@@ -279,9 +281,13 @@ export default {
 
       console.log(this.formData)
 
-      data.bannerList = this.bannerList.map(item => item.response ? item.response.data : item.url)
-      data.equipmentList = this.deviceList.map(item => ({ equipmentName: item.equipmentName, brand: item.brand, image: item.image }))
-      doctorSave(data).then(res => {
+      data.bannerList = this.bannerList.map((item) => (item.response ? item.response.data : item.url))
+      data.equipmentList = this.deviceList.map((item) => ({
+        equipmentName: item.equipmentName,
+        brand: item.brand,
+        image: item.image
+      }))
+      doctorSave(data).then((res) => {
         this.$message.success('保存成功')
         this.$store.dispatch('tagsView/delView', this.$route)
         this.$router.push('/personnel/training/list')
@@ -336,7 +342,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.doctor-edit{
+.doctor-edit {
   margin-bottom: 80px;
 }
 
@@ -352,21 +358,20 @@ export default {
   }
 }
 
-.tag-control{
+.tag-control {
   display: flex;
   justify-content: space-between;
   align-items: center;
-  .el-input{
+  .el-input {
     flex: 1;
     margin-right: 16px;
   }
 }
 
-.tag-list{
-    padding-top: 8px;
-    .el-tag{
+.tag-list {
+  padding-top: 8px;
+  .el-tag {
     margin-right: 6px;
   }
 }
-
 </style>

+ 14 - 7
src/views/normal/vip/index.vue

@@ -9,7 +9,12 @@
           <div class="subname" v-text="item.subName" />
         </div>
       </div>
-      <el-button class="open-vip" type="primary" :style="[themeStyle.border, themeStyle.background]" @click="toPayPage">{{ themeText }}</el-button>
+      <el-button
+        class="open-vip"
+        type="primary"
+        :style="[themeStyle.border, themeStyle.background]"
+        @click="toPayPage"
+      >{{ themeText }}</el-button>
     </div>
     <div class="section benefits">
       <div class="title">会员权益对比</div>
@@ -20,7 +25,9 @@
     <!-- 开通、续费会员 -->
     <div class="open-control" :style="themeStyle.border">
       <div class="tip"><i class="vip-icon" /><span>会员</span>享有机构授权认证、设备授权认证等特权</div>
-      <el-button class="submit" type="primary" :style="[themeStyle.border, themeStyle.background]" @click="toPayPage">{{ themeText }}</el-button>
+      <el-button class="submit" type="primary" :style="[themeStyle.border, themeStyle.background]" @click="toPayPage">{{
+        themeText
+      }}</el-button>
     </div>
   </div>
 </template>
@@ -34,7 +41,7 @@ import vipIcon5 from '@/assets/img/vip-icon-05.png'
 import vipIcon6 from '@/assets/img/vip-icon-06.png'
 import vipIcon7 from '@/assets/img/vip-icon-07.png'
 
-import MemberBenefits from '@/views/components/MemberBenefits'
+import { MemberBenefits } from '@/views/components'
 export default {
   components: {
     MemberBenefits
@@ -176,15 +183,15 @@ export default {
   margin: 90px auto;
   border: 1px solid #1890ff;
 
-  .tip{
+  .tip {
     display: flex;
     justify-content: flex-start;
     align-items: center;
     color: #101010;
     font-size: 18px;
 
-    span{
-      color: #1890FF;
+    span {
+      color: #1890ff;
       font-weight: bold;
     }
   }
@@ -196,7 +203,7 @@ export default {
     border-radius: 0;
   }
 
-  .vip-icon{
+  .vip-icon {
     margin-bottom: 10px;
   }
 }