Browse Source

开发ing

zhoujump 2 weeks ago
parent
commit
7ad349f73c
3 changed files with 258 additions and 120 deletions
  1. 92 92
      src/router/index.js
  2. 74 24
      src/views/exhibitorManage/exhibitorSetting.vue
  3. 92 4
      src/views/preRegManage/list.vue

+ 92 - 92
src/router/index.js

@@ -59,6 +59,97 @@ export const constantRoutes = [
         }
         }
       },
       },
       {
       {
+        path: 'exhibitor',
+        component: () => import('@/views/exhibitorManage/index'),
+        name: 'ExhibitorManage',
+        meta: {
+          title: '展会管理',
+          icon: 'el-icon-office-building',
+          roles: 'exhibitor'
+        },
+        redirect: '/exhibitor/list',
+        children: [
+          {
+            component: () => import('@/views/exhibitorManage/exhibitorList'),
+            path: 'list',
+            name: 'exhibitorManageList',
+            meta: {
+              title: '展会管理',
+              icon: 'el-icon-edit',
+              roles: 'exhibitor.list',
+              func: [
+                {
+                  roles: 'exhibitor.addList',
+                  name: '添加展会'
+                },
+                {
+                  roles: 'exhibitor.search',
+                  name: '搜索展会'
+                },
+                {
+                  roles: 'exhibitor.handelView',
+                  name: '预览展会'
+                },
+                {
+                  roles: 'exhibitor.copyLink',
+                  name: '复制表单连接'
+                },
+                {
+                  roles: 'exhibitor.handelEdit',
+                  name: '编辑展会'
+                },
+                {
+                  roles: 'exhibitor.handelCopy',
+                  name: '复制展会'
+                },
+                {
+                  roles: 'exhibitor.handelDisable',
+                  name: '禁用展会'
+                },
+                {
+                  roles: 'exhibitor.handelDelete',
+                  name: '删除展会'
+                },
+                {
+                  roles: 'exhibitor.handel',
+                  name: '展会翻页'
+                }
+              ] }
+          },
+          {
+            component: () => import('@/views/exhibitorManage/exhibitorSetting'),
+            name: 'exhibitorEdit',
+            path: 'edit/:id',
+            meta: {
+              title: '配置展会',
+              icon: 'el-icon-setting',
+              roles: 'exhibitor.setting',
+              hidden: true,
+              func: [
+                {
+                  roles: 'exhibitor.save',
+                  name: '保存展会'
+                },
+                {
+                  roles: 'exhibitor.copyright',
+                  name: '是否显示底部信息开关'
+                }
+              ]
+            }
+          },
+          {
+            component: () => import('@/views/exhibitorManage/exhibitorSetting'),
+            name: 'exhibitorAdd',
+            path: 'add',
+            meta: {
+              title: '添加展会',
+              icon: 'el-icon-document-add',
+              roles: 'exhibitor.add'
+            }
+          }
+        ]
+      },
+      {
         path: 'preRegister',
         path: 'preRegister',
         component: () => import('@/views/preRegManage/index'),
         component: () => import('@/views/preRegManage/index'),
         name: 'preRegManage',
         name: 'preRegManage',
@@ -184,97 +275,6 @@ export const constantRoutes = [
         ]
         ]
       },
       },
       {
       {
-        path: 'exhibitor',
-        component: () => import('@/views/exhibitorManage/index'),
-        name: 'ExhibitorManage',
-        meta: {
-          title: '展会管理',
-          icon: 'el-icon-office-building',
-          roles: 'exhibitor'
-        },
-        redirect: '/exhibitor/list',
-        children: [
-          {
-            component: () => import('@/views/exhibitorManage/exhibitorList'),
-            path: 'list',
-            name: 'exhibitorManageList',
-            meta: {
-              title: '展会管理',
-              icon: 'el-icon-edit',
-              roles: 'exhibitor.list',
-              func: [
-                {
-                  roles: 'exhibitor.addList',
-                  name: '添加展会'
-                },
-                {
-                  roles: 'exhibitor.search',
-                  name: '搜索展会'
-                },
-                {
-                  roles: 'exhibitor.handelView',
-                  name: '预览展会'
-                },
-                {
-                  roles: 'exhibitor.copyLink',
-                  name: '复制表单连接'
-                },
-                {
-                  roles: 'exhibitor.handelEdit',
-                  name: '编辑展会'
-                },
-                {
-                  roles: 'exhibitor.handelCopy',
-                  name: '复制展会'
-                },
-                {
-                  roles: 'exhibitor.handelDisable',
-                  name: '禁用展会'
-                },
-                {
-                  roles: 'exhibitor.handelDelete',
-                  name: '删除展会'
-                },
-                {
-                  roles: 'exhibitor.handel',
-                  name: '展会翻页'
-                }
-              ] }
-          },
-          {
-            component: () => import('@/views/exhibitorManage/exhibitorSetting'),
-            name: 'exhibitorEdit',
-            path: 'edit/:id',
-            meta: {
-              title: '配置展会',
-              icon: 'el-icon-setting',
-              roles: 'exhibitor.setting',
-              hidden: true,
-              func: [
-                {
-                  roles: 'exhibitor.save',
-                  name: '保存展会'
-                },
-                {
-                  roles: 'exhibitor.copyright',
-                  name: '是否显示底部信息开关'
-                }
-              ]
-            }
-          },
-          {
-            component: () => import('@/views/exhibitorManage/exhibitorSetting'),
-            name: 'exhibitorAdd',
-            path: 'add',
-            meta: {
-              title: '添加展会',
-              icon: 'el-icon-document-add',
-              roles: 'exhibitor.add'
-            }
-          }
-        ]
-      },
-      {
         path: 'invitation',
         path: 'invitation',
         component: () => import('@/views/invitationManage/index'),
         component: () => import('@/views/invitationManage/index'),
         name: 'invitationManage',
         name: 'invitationManage',
@@ -372,7 +372,7 @@ export const constantRoutes = [
         component: () => import('@/views/shareUtm/index'),
         component: () => import('@/views/shareUtm/index'),
         name: 'shareUtm',
         name: 'shareUtm',
         meta: {
         meta: {
-          title: '分享与UTM',
+          title: '分享与追踪',
           icon: 'el-icon-data-line',
           icon: 'el-icon-data-line',
           roles: 'share&utm'
           roles: 'share&utm'
         },
         },

+ 74 - 24
src/views/exhibitorManage/exhibitorSetting.vue

@@ -20,7 +20,7 @@ export default Vue.extend({
         logo: '/common/2025/0915/68c7b25cc9e26.webp',
         logo: '/common/2025/0915/68c7b25cc9e26.webp',
         images: ['/common/2025/0915/68c7b263bc4b1.webp'],
         images: ['/common/2025/0915/68c7b263bc4b1.webp'],
         social_links: {
         social_links: {
-          facebook: '',
+          facebook: ''
         },
         },
         form_template_id: '',
         form_template_id: '',
         urla: '',
         urla: '',
@@ -29,6 +29,7 @@ export default Vue.extend({
         seo_keywords: '',
         seo_keywords: '',
         show_official_footer: '1'
         show_official_footer: '1'
       },
       },
+      isShowMore: false,
       formList: [],
       formList: [],
       loading: false,
       loading: false,
       ossUrl: process.env.VUE_APP_OSS_DOMAIN
       ossUrl: process.env.VUE_APP_OSS_DOMAIN
@@ -111,8 +112,7 @@ export default Vue.extend({
         this.exhibitorSetting.location === '' ||
         this.exhibitorSetting.location === '' ||
         this.exhibitorSetting.organizer === '' ||
         this.exhibitorSetting.organizer === '' ||
         this.exhibitorSetting.contact_phone === '' ||
         this.exhibitorSetting.contact_phone === '' ||
-        this.exhibitorSetting.contact_email === '' ||
-        this.exhibitorSetting.urla === ''
+        this.exhibitorSetting.contact_email === ''
       ) {
       ) {
         this.$notify({
         this.$notify({
           title: '提示',
           title: '提示',
@@ -124,6 +124,9 @@ export default Vue.extend({
       if (this.loading) {
       if (this.loading) {
         return
         return
       }
       }
+      if (this.exhibitorSetting.urla === '') {
+        this.exhibitorSetting.urla = this.exhibitorSetting.expo_name
+      }
       this.loading = true
       this.loading = true
       saveExpo(
       saveExpo(
         this.exhibitorSetting.id,
         this.exhibitorSetting.id,
@@ -160,6 +163,46 @@ export default Vue.extend({
           type: 'error'
           type: 'error'
         })
         })
       })
       })
+    },
+    canAddSocialShow() {
+      if (this.exhibitorSetting.social_links.facebook === undefined ||
+          this.exhibitorSetting.social_links.twitter === undefined ||
+          this.exhibitorSetting.social_links.linkedin === undefined) {
+        return true
+      } else {
+        return false
+      }
+    },
+    removeSocial(key) {
+      delete this.exhibitorSetting.social_links[key]
+      this.exhibitorSetting.social_links = { ...this.exhibitorSetting.social_links }
+    },
+    addSocial() {
+      console.log(this.exhibitorSetting.social_links)
+      if (this.exhibitorSetting.social_links.facebook === undefined) {
+        this.exhibitorSetting.social_links.facebook = ''
+        this.exhibitorSetting.social_links = { ...this.exhibitorSetting.social_links }
+        return
+      }
+      if (this.exhibitorSetting.social_links.twitter === undefined) {
+        this.exhibitorSetting.social_links.twitter = ''
+        this.exhibitorSetting.social_links = { ...this.exhibitorSetting.social_links }
+        return
+      }
+      if (this.exhibitorSetting.social_links.linkedin === undefined) {
+        this.exhibitorSetting.social_links.linkedin = ''
+        this.exhibitorSetting.social_links = { ...this.exhibitorSetting.social_links }
+        return
+      }
+    },
+    socialInput(key, value) {
+      this.exhibitorSetting.social_links[key] = value
+    },
+    changeSocialType(oldType, type) {
+      console.log(oldType, type)
+      this.exhibitorSetting.social_links[type] = this.exhibitorSetting.social_links[oldType]
+      delete this.exhibitorSetting.social_links[oldType]
+      this.exhibitorSetting.social_links = { ...this.exhibitorSetting.social_links }
     }
     }
   }
   }
 })
 })
@@ -215,18 +258,19 @@ export default Vue.extend({
           <div class="label">社交账号</div>
           <div class="label">社交账号</div>
           <div class="social-list">
           <div class="social-list">
             <div v-for="(value,key) in exhibitorSetting.social_links" class="social-item">
             <div v-for="(value,key) in exhibitorSetting.social_links" class="social-item">
-              <el-input :value="value" :placeholder="'请输入'+key+'主页地址'">
-                <el-select :value="key" slot="append">
-                  <el-option :disabled="exhibitorSetting.social_links.facebook!==undefined" value="facebook" label="facebook"></el-option>
-                  <el-option :disabled="exhibitorSetting.social_links.twitter!==undefined" value="twitter" label="twitter"></el-option>
-                  <el-option :disabled="exhibitorSetting.social_links.linkedin!==undefined" value="linkedin" label="linkedin"></el-option>
+              <el-input :value="value" :placeholder="'请输入'+key+'主页地址'" @input="socialInput(key,$event)">
+                <el-select slot="prepend" :value="key" @change="changeSocialType(key,$event)">
+                  <el-option :disabled="exhibitorSetting.social_links.facebook!==undefined" value="facebook" label="facebook" />
+                  <el-option :disabled="exhibitorSetting.social_links.twitter!==undefined" value="twitter" label="twitter" />
+                  <el-option :disabled="exhibitorSetting.social_links.linkedin!==undefined" value="linkedin" label="linkedin" />
                 </el-select>
                 </el-select>
+                <el-button slot="append" icon="el-icon-delete" @click="removeSocial(key)" />
               </el-input>
               </el-input>
             </div>
             </div>
-            <el-button type="primary" class="add-social el-icon-plus">添加</el-button>
+            <el-button v-if="canAddSocialShow()" type="primary" class="add-social el-icon-plus" @click="addSocial()">添加</el-button>
           </div>
           </div>
         </div>
         </div>
-        <div class="form-item required">
+        <div class="form-item">
           <div class="label">表单模板</div>
           <div class="label">表单模板</div>
           <el-select v-model="exhibitorSetting.form_template_id">
           <el-select v-model="exhibitorSetting.form_template_id">
             <el-option v-for="item in formList" :key="item.id" :value="item.id" :label="item.template_name" />
             <el-option v-for="item in formList" :key="item.id" :value="item.id" :label="item.template_name" />
@@ -236,22 +280,28 @@ export default Vue.extend({
           <div class="label">表单底部显示系统信息</div>
           <div class="label">表单底部显示系统信息</div>
           <el-switch v-model="exhibitorSetting.show_official_footer" active-value="1" inactive-value="0" class="input" />
           <el-switch v-model="exhibitorSetting.show_official_footer" active-value="1" inactive-value="0" class="input" />
         </div>
         </div>
-        <div class="form-item required">
-          <div class="label">url短名称</div>
-          <el-input v-model="exhibitorSetting.urla" class="input" placeholder="请输入url" />
-        </div>
-        <div class="form-item">
-          <div class="label">SEO标题</div>
-          <el-input v-model="exhibitorSetting.seo_title" class="input" placeholder="请输入SEO标题" />
-        </div>
         <div class="form-item">
         <div class="form-item">
-          <div class="label">SEO关键字</div>
-          <el-input v-model="exhibitorSetting.seo_keywords" class="input" placeholder="请输入SEO关键字" />
-        </div>
-        <div class="form-item">
-          <div class="label">SEO描述</div>
-          <el-input v-model="exhibitorSetting.seo_description" class="input" placeholder="请输入SEO描述" />
+          <div class="label">高级设置</div>
+          <el-switch v-model="isShowMore" />
         </div>
         </div>
+        <template v-if="isShowMore">
+          <div class="form-item required">
+            <div class="label">url短名称</div>
+            <el-input v-model="exhibitorSetting.urla" class="input" placeholder="请输入url" />
+          </div>
+          <div class="form-item">
+            <div class="label">SEO标题</div>
+            <el-input v-model="exhibitorSetting.seo_title" class="input" placeholder="请输入SEO标题" />
+          </div>
+          <div class="form-item">
+            <div class="label">SEO关键字</div>
+            <el-input v-model="exhibitorSetting.seo_keywords" class="input" placeholder="请输入SEO关键字" />
+          </div>
+          <div class="form-item">
+            <div class="label">SEO描述</div>
+            <el-input v-model="exhibitorSetting.seo_description" class="input" placeholder="请输入SEO描述" />
+          </div>
+        </template>
       </div>
       </div>
     </div>
     </div>
     <div class="desc">
     <div class="desc">

+ 92 - 4
src/views/preRegManage/list.vue

@@ -1,11 +1,16 @@
 <script>
 <script>
 import Vue from 'vue'
 import Vue from 'vue'
 import { getFormList, setFormStatus, deleteForm } from '@/api/form'
 import { getFormList, setFormStatus, deleteForm } from '@/api/form'
+import { getExpoList, getMyExpoInfo, saveExpo } from '@/api/expo'
 export default Vue.extend({
 export default Vue.extend({
   name: 'Index',
   name: 'Index',
   data() {
   data() {
     return {
     return {
+      expoList: [],
       formList: [],
       formList: [],
+      selectExpo: '',
+      waitToBind: {},
+      bindVisible: false,
       current_page: 0,
       current_page: 0,
       last_page: 1,
       last_page: 1,
       total: 0,
       total: 0,
@@ -17,11 +22,23 @@ export default Vue.extend({
   },
   },
   mounted() {
   mounted() {
     this.getList()
     this.getList()
+    this.getExpoList()
   },
   },
   methods: {
   methods: {
     handleCreate() {
     handleCreate() {
       this.$router.push({ path: '/preRegister/add' })
       this.$router.push({ path: '/preRegister/add' })
     },
     },
+    getExpoList() {
+      getExpoList(1, 1000).then(res => {
+        this.expoList = res.data.data
+      }).catch(err => {
+        this.$notify({
+          title: '提示',
+          message: '获取展会列表失败' + err,
+          type: 'error'
+        })
+      })
+    },
     search(event) {
     search(event) {
       if (this.searchTimer) {
       if (this.searchTimer) {
         clearTimeout(this.searchTimer)
         clearTimeout(this.searchTimer)
@@ -53,7 +70,7 @@ export default Vue.extend({
       }).catch(err => {
       }).catch(err => {
         this.$notify({
         this.$notify({
           title: '提示',
           title: '提示',
-          message: '设置状态失败'+err,
+          message: '设置状态失败' + err,
           type: 'error'
           type: 'error'
         })
         })
         this.loading = false
         this.loading = false
@@ -80,7 +97,7 @@ export default Vue.extend({
             }).catch(err => {
             }).catch(err => {
               this.$notify({
               this.$notify({
                 title: '提示',
                 title: '提示',
-                message: '删除表单失败'+err,
+                message: '删除表单失败' + err,
                 type: 'error'
                 type: 'error'
               })
               })
               this.loading = false
               this.loading = false
@@ -110,6 +127,35 @@ export default Vue.extend({
         this.formList = res.data.data
         this.formList = res.data.data
         this.loading = false
         this.loading = false
       })
       })
+    },
+    bindToExp(row) {
+      this.waitToBind = row
+      this.bindVisible = true
+    },
+    stratBind() {
+      this.bindVisible = false
+      let expoData = {}
+      getMyExpoInfo(this.selectExpo)
+        .then(res => {
+          expoData = res.data
+          expoData.form_template_id = this.waitToBind.id
+          return saveExpo(expoData.id, expoData.expo_name, expoData.start_date, expoData.end_date, expoData.location, expoData.organizer, expoData.contact_phone, expoData.contact_email, expoData.content, expoData.logo, expoData.images, expoData.social_links, expoData.form_template_id, expoData.page_template_id, expoData.urla, expoData.show_official_footer, expoData.seo_title, expoData.seo_description, expoData.seo_keywords)
+        })
+        .then(res2 => {
+          console.log(res2)
+          this.$notify({
+            title: '提示',
+            message: '绑定成功',
+            type: 'success'
+          })
+        })
+        .catch(err => {
+          this.$notify({
+            title: '提示',
+            message: '绑定失败' + err,
+            type: 'error'
+          })
+        })
     }
     }
   }
   }
 })
 })
@@ -122,7 +168,7 @@ export default Vue.extend({
         <el-button v-if="searchWord" slot="append" icon="el-icon-delete" @click="searchWord='';search()" />
         <el-button v-if="searchWord" slot="append" icon="el-icon-delete" @click="searchWord='';search()" />
       </el-input>
       </el-input>
       <el-button v-permission="'preReg.creat'" icon="el-icon-plus" type="primary" @click="handleCreate">创建表单</el-button>
       <el-button v-permission="'preReg.creat'" icon="el-icon-plus" type="primary" @click="handleCreate">创建表单</el-button>
-      <!--      <el-button icon="el-icon-copy-document">批量复制</el-button>-->
+      <!--<el-button icon="el-icon-copy-document">批量复制</el-button>-->
     </div>
     </div>
     <div class="body">
     <div class="body">
       <el-table v-loading="loading" :data="formList" height="100%" class="table">
       <el-table v-loading="loading" :data="formList" height="100%" class="table">
@@ -155,9 +201,10 @@ export default Vue.extend({
         <el-table-column
         <el-table-column
           label="操作"
           label="操作"
           fixed="right"
           fixed="right"
-          width="200"
+          width="220"
         >
         >
           <template slot-scope="scope">
           <template slot-scope="scope">
+            <span v-permission="'preReg.handelEdit'" class="button" @click="bindToExp(scope.row)">绑定</span>
             <span v-permission="'preReg.handelEdit'" :class="['button',scope.row.is_use?'disable':'']" @click="edit(scope.row)">编辑</span>
             <span v-permission="'preReg.handelEdit'" :class="['button',scope.row.is_use?'disable':'']" @click="edit(scope.row)">编辑</span>
             <span v-permission="'preReg.handelCopy'" class="button" @click="copy(scope.row)">复制</span>
             <span v-permission="'preReg.handelCopy'" class="button" @click="copy(scope.row)">复制</span>
             <span v-permission="'preReg.handelDisable'" class="button" @click="setStatus(scope.row)">{{ scope.row.status?'启用':'禁用' }}</span>
             <span v-permission="'preReg.handelDisable'" class="button" @click="setStatus(scope.row)">{{ scope.row.status?'启用':'禁用' }}</span>
@@ -182,6 +229,24 @@ export default Vue.extend({
         @current-change="current_page=$event;getList()"
         @current-change="current_page=$event;getList()"
       />
       />
     </div>
     </div>
+    <el-dialog
+      :title="'将 '+waitToBind.template_name+' 绑定至展会'"
+      :visible.sync="bindVisible"
+      :append-to-body="true"
+      width="30%"
+    >
+      <div class="bind-dialog-body">
+        <div class="expo-list">
+          <el-radio-group v-model="selectExpo">
+            <el-radio v-for="item in expoList" :key="item.id" border :label="item.id">{{ item.expo_name }}</el-radio>
+          </el-radio-group>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="bindVisible = false">取 消</el-button>
+        <el-button :disabled="!selectExpo" type="primary" @click="stratBind()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -241,3 +306,26 @@ export default Vue.extend({
     }
     }
   }
   }
 </style>
 </style>
+<style lang="scss">
+.bind-dialog-body{
+  position: relative;
+  height: 40vh;
+  .expo-list{
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    overflow-y: auto;
+    .el-radio-group{
+      display: flex;
+      flex-direction: column;
+      gap: 8px;
+      .el-radio{
+        margin: 0;
+      }
+    }
+  }
+}
+
+</style>