Browse Source

优化咨询记录

zhengjinyi 1 năm trước cách đây
mục cha
commit
402bbff64d

+ 1 - 0
package.json

@@ -39,6 +39,7 @@
     "three-dots": "^0.3.2",
     "vue": "2.6.10",
     "vue-count-to": "1.0.13",
+    "vue-preview": "^1.1.3",
     "vue-router": "3.0.2",
     "vue-splitpane": "1.0.4",
     "vuedraggable": "2.20.0",

+ 14 - 0
pnpm-lock.yaml

@@ -77,6 +77,9 @@ dependencies:
   vue-count-to:
     specifier: 1.0.13
     version: 1.0.13
+  vue-preview:
+    specifier: ^1.1.3
+    version: 1.1.3
   vue-router:
     specifier: 3.0.2
     version: 3.0.2(vue@2.6.10)
@@ -10326,6 +10329,11 @@ packages:
     resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==, tarball: https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz}
     dev: true
 
+  /photoswipe@4.1.3:
+    resolution: {integrity: sha512-89Z43IRUyw7ycTolo+AaiDn3W1EEIfox54hERmm9bI12IB9cvRfHSHez3XhAyU8XW2EAFrC+2sKMhh7SJwn0bA==, tarball: https://registry.npmmirror.com/photoswipe/-/photoswipe-4.1.3.tgz}
+    engines: {node: '>= 0.8.0'}
+    dev: false
+
   /picocolors@0.2.1:
     resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==, tarball: https://registry.npmmirror.com/picocolors/-/picocolors-0.2.1.tgz}
     dev: true
@@ -13546,6 +13554,12 @@ packages:
       - whiskers
     dev: true
 
+  /vue-preview@1.1.3:
+    resolution: {integrity: sha512-ko/W1vxgmngiDTL/cMSc36Hq2k7ZPynKBdPoRGupNMlESGkjSdo1RTJcHmYDZZgtSbm10OBJPuPYmzdW1N76xQ==, tarball: https://registry.npmmirror.com/vue-preview/-/vue-preview-1.1.3.tgz}
+    dependencies:
+      photoswipe: 4.1.3
+    dev: false
+
   /vue-router@3.0.2(vue@2.6.10):
     resolution: {integrity: sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==, tarball: https://registry.npmmirror.com/vue-router/-/vue-router-3.0.2.tgz}
     peerDependencies:

+ 46 - 22
src/views/sys/menus/list.vue

@@ -5,47 +5,61 @@
       <el-select v-model="listQuery.status" style="width: 140px" class="filter-item" @change="handleFilter">
         <el-option v-for="item in statusOptions" :key="item.key" :label="item.label" :value="item.key" />
       </el-select>
-      <el-button v-if="checkPermission('sys:menu:edit')" class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">
+      <el-button
+        v-if="checkPermission('sys:menu:edit')"
+        class="filter-item"
+        style="margin-left: 10px"
+        type="primary"
+        icon="el-icon-edit"
+        @click="handleCreate"
+      >
         添加菜单
       </el-button>
     </div>
-    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width:100%">
+    <el-table :key="tableKey" v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
       <el-table-column label="序号" align="center" width="50">
         <template slot-scope="scope">{{ scope.$index + 1 }}</template>
       </el-table-column>
       <el-table-column label="菜单ID" align="center">
-        <template slot-scope="{row}">{{ row.id }}</template>
+        <template slot-scope="{ row }">{{ row.id }}</template>
       </el-table-column>
       <el-table-column label="菜单名称" align="center">
-        <template slot-scope="{row}">{{ row.title }}</template>
+        <template slot-scope="{ row }">{{ row.title }}</template>
       </el-table-column>
       <el-table-column label="路由名称" align="center">
-        <template slot-scope="{row}">{{ row.name }}</template>
+        <template slot-scope="{ row }">{{ row.name }}</template>
       </el-table-column>
       <el-table-column label="前端图标" width="80" align="center">
-        <template slot-scope="{row}">
-          <i v-if="isElementIcon(row.icon)" :class="row.icon" />
+        <template slot-scope="{ row }">
+          <i v-if="isElementIcon(row.icon)" :class="row.icon"> </i>
           <svg-icon v-else-if="row.icon" :icon-class="row.icon" />
         </template>
       </el-table-column>
       <el-table-column label="状态" width="80" align="center">
-        <template slot-scope="{row}">
-          <el-switch v-model="row.status" :active-value="0" :inactive-value="1" active-color="#1890ff" inactive-color="#DCDFE6" @change="handleHiddenChange($index, row)" />
+        <template slot-scope="{ row }">
+          <el-switch
+            v-model="row.status"
+            :active-value="0"
+            :inactive-value="1"
+            active-color="#1890ff"
+            inactive-color="#DCDFE6"
+            @change="handleHiddenChange($index, row)"
+          />
         </template>
       </el-table-column>
       <el-table-column label="排序" width="80" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-input v-model="row.sort" maxlength="4" minlength="1" @blur="handleOnInputBlur(row)" />
         </template>
       </el-table-column>
       <el-table-column label="设置" width="250" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-button plain size="mini" :disabled="row.childCount | disableNextLevel" @click="handleShowNextLevel(row)">查看子菜单</el-button>
           <el-button v-if="checkPermission('sys:menu:edit')" plain size="mini" @click="handleCreateNextLevel(row)">添加子菜单</el-button>
         </template>
       </el-table-column>
       <el-table-column label="操作" width="150" align="center">
-        <template slot-scope="{row}">
+        <template slot-scope="{ row }">
           <el-button v-if="checkPermission('sys:menu:edit')" size="mini" type="primary" @click="handleUpdate(row)">编辑
           </el-button>
           <el-button v-if="checkPermission('sys:menu:del')" size="mini" type="danger" @click="handleDelete(row)">删除
@@ -54,8 +68,13 @@
       </el-table-column>
     </el-table>
 
-    <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
-
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
@@ -128,7 +147,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      fetchList(this.listQuery).then(response => {
+      fetchList(this.listQuery).then((response) => {
         this.listLoading = false
         this.list = response.data.results
         this.total = response.data.totalRecord
@@ -145,10 +164,16 @@ export default {
       this.$router.go(-1)
     },
     handleCreate() {
-      this.$router.push({ path: '/sys/menus/add', query: { parentId: this.listQuery.parentId, title: this.parentTitle }})
+      this.$router.push({
+        path: '/sys/menus/add',
+        query: { parentId: this.listQuery.parentId, title: this.parentTitle }
+      })
     },
     handleUpdate(row) {
-      this.$router.push({ path: '/sys/menus/edit', query: { id: row.id, parentId: this.listQuery.parentId, title: this.parentTitle }})
+      this.$router.push({
+        path: '/sys/menus/edit',
+        query: { id: row.id, parentId: this.listQuery.parentId, title: this.parentTitle }
+      })
     },
     handleShowNextLevel(row) {
       this.$router.push({ path: '/sys/menus/list', query: { parentId: row.id, title: row.title }})
@@ -162,7 +187,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteMenu(row.id).then(response => {
+        deleteMenu(row.id).then((response) => {
           this.$message({
             message: '删除成功',
             type: 'success',
@@ -174,7 +199,7 @@ export default {
     },
     handleOnInputBlur(row) {
       // 更新排序
-      updateSelective(row.id, { sort: row.sort }).then(response => {
+      updateSelective(row.id, { sort: row.sort }).then((response) => {
         this.$message({
           message: '操作成功',
           type: 'success',
@@ -185,7 +210,7 @@ export default {
     },
     handleHiddenChange(index, row) {
       // 操作开关
-      updateSelective(row.id, { status: row.status }).then(response => {
+      updateSelective(row.id, { status: row.status }).then((response) => {
         this.$message({
           message: '操作成功',
           type: 'success',
@@ -210,5 +235,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

+ 9 - 4
src/views/user/consult/detail.vue

@@ -185,7 +185,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -214,7 +214,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -236,17 +236,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -434,6 +436,9 @@ export default {
       } catch (error) {
         console.log(error)
       }
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }

+ 20 - 7
src/views/user/consult/list.vue

@@ -240,7 +240,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -269,7 +269,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -291,17 +291,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -432,15 +434,22 @@ export default {
   methods: {
     initDate() {
       // 初始化获取当前年月
+      this.handleInfo()
+      this.getClassName()
+      this.getServiceList(this.listQuery.startTime, this.listQuery.endTime)
+      this.getList()
+    },
+    handleInfo() {
       if (this.$route.query.clubId) {
         this.listQuery.clubId = this.$route.query.clubId
+      } else {
+        this.listQuery.clubId = ''
       }
       if (this.$route.query.clubName) {
         this.listQuery.clubName = this.$route.query.clubName
+      } else {
+        this.listQuery.clubName = ''
       }
-      this.getClassName()
-      this.getServiceList(this.listQuery.startTime, this.listQuery.endTime)
-      this.getList()
     },
     // 选择时间
     handleDatePick() {
@@ -456,6 +465,7 @@ export default {
     },
     // 获取行为记录列表
     getList() {
+      this.handleInfo()
       this.listQuery.pageNum = 1
       this.getRemarksRegistList()
     },
@@ -563,6 +573,9 @@ export default {
       this.listQuery.serviceProviderId = item.serviceProviderId
       this.listQuery.pageNum = 1
       this.getList()
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }

+ 9 - 4
src/views/user/consult/unreg-detail.vue

@@ -156,7 +156,7 @@
               <el-col v-if="item.consultType" :span="12">
                 <b>咨询类别:</b>
                 <el-tag
-                  v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
+                  v-for="(consultType, consultTypeIndex) in handleFormatStr(item.consultType)"
                   :key="consultTypeIndex"
                   style="margin: 0 1px"
                   type="info"
@@ -185,7 +185,7 @@
               <el-col :span="24">
                 <b>标签词:</b>
                 <el-tag
-                  v-for="(remarks, remarksIndex) in item.remarks.split(',')"
+                  v-for="(remarks, remarksIndex) in handleFormatStr(item.remarks)"
                   :key="remarksIndex"
                   style="margin: 0 1px"
                   type="success"
@@ -207,17 +207,19 @@
                 <b>图片:</b>
               </el-col>
               <el-col :span="24">
-                <div
+                <a
                   v-for="(image, imageIndex) in item.imageList"
                   :key="imageIndex"
+                  :href="image"
                   class="item-image"
+                  target="_blank"
                   style="width: 100px; height: 100px; margin: 5px; float: left"
                 >
                   <el-popover placement="top-start" title="" width="180" trigger="hover">
                     <img :src="image" alt="" style="width: 150px; height: 150px" />
                     <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
                   </el-popover>
-                </div>
+                </a>
               </el-col>
             </el-row>
             <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
@@ -387,6 +389,9 @@ export default {
       const params = `fileName=${encodeURIComponent(file.fileName)}&ossName=${encodeURIComponent(file.ossName)}`
       const url = process.env.VUE_APP_BASE_API + `/user/remarks/remarks/download?${params}`
       downloadWithUrl(url, file.fileName)
+    },
+    handleFormatStr(data) {
+      return data.split(',')
     }
   }
 }