Browse Source

部署修改

Zhangbw 2 months ago
parent
commit
abf959f50c
5 changed files with 76 additions and 40 deletions
  1. 6 6
      src/layout/components/Navbar.vue
  2. 2 2
      src/main.ts
  3. 4 4
      src/views/login.vue
  4. 54 24
      src/views/miniapp/feedback/index.vue
  5. 10 4
      vite.config.ts

+ 6 - 6
src/layout/components/Navbar.vue

@@ -6,7 +6,7 @@
 
     <div class="right-menu flex align-center">
       <template v-if="appStore.device !== 'mobile'">
-        <el-select
+        <!-- <el-select
           v-if="userId === 1 && tenantEnabled"
           v-model="companyName"
           class="min-w-244px"
@@ -19,7 +19,7 @@
         >
           <el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"> </el-option>
           <template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
-        </el-select>
+        </el-select> -->
 
         <search-menu ref="searchMenuRef" />
         <el-tooltip content="搜索" effect="dark" placement="bottom">
@@ -42,13 +42,13 @@
             </el-popover>
           </div>
         </el-tooltip>
-        <el-tooltip content="Github" effect="dark" placement="bottom">
+        <!-- <el-tooltip content="Github" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
-        <el-tooltip :content="proxy.$t('navbar.document')" effect="dark" placement="bottom">
+        <!-- <el-tooltip :content="proxy.$t('navbar.document')" effect="dark" placement="bottom">
           <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
+        </el-tooltip> -->
 
         <el-tooltip :content="proxy.$t('navbar.full')" effect="dark" placement="bottom">
           <screenfull id="screenfull" class="right-menu-item hover-effect" />

+ 2 - 2
src/main.ts

@@ -29,7 +29,7 @@ import ElementIcons from '@/plugins/svgicon';
 import './permission';
 
 // 开发者工具保护
-import { initDevToolsProtection } from '@/utils/devtools-protection';
+// import { initDevToolsProtection } from '@/utils/devtools-protection';
 
 // 国际化
 import i18n from '@/lang/index';
@@ -60,4 +60,4 @@ directive(app);
 app.mount('#app');
 
 // 初始化开发者工具保护(仅生产环境)
-initDevToolsProtection();
+// initDevToolsProtection();

+ 4 - 4
src/views/login.vue

@@ -44,7 +44,7 @@
         </div>
       </el-form-item>
       <el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0">{{ proxy.$t('login.rememberPassword') }}</el-checkbox>
-      <el-form-item style="float: right">
+      <!-- <el-form-item style="float: right">
         <el-button circle :title="proxy.$t('login.social.wechat')" @click="doSocialLogin('wechat')">
           <svg-icon icon-class="wechat" />
         </el-button>
@@ -60,7 +60,7 @@
         <el-button circle :title="proxy.$t('login.social.github')" @click="doSocialLogin('github')">
           <svg-icon icon-class="github" />
         </el-button>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item style="width: 100%">
         <el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
           <span v-if="!loading">{{ proxy.$t('login.login') }}</span>
@@ -72,9 +72,9 @@
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-login-footer">
+    <!-- <div class="el-login-footer">
       <span>Copyright © 2018-2026 疯狂的狮子Li All Rights Reserved.</span>
-    </div>
+    </div> -->
   </div>
 </template>
 

+ 54 - 24
src/views/miniapp/feedback/index.vue

@@ -43,16 +43,15 @@
         <el-table-column label="反馈ID" align="center" prop="id" width="80" />
         <el-table-column label="用户昵称" align="center" prop="nickname" :show-overflow-tooltip="true" />
         <el-table-column label="手机号" align="center" prop="phone" width="120" />
-        <el-table-column label="反馈内容" align="center" prop="content" :show-overflow-tooltip="true" min-width="200" />
-        <el-table-column label="图片" align="center" width="100">
+        <el-table-column label="反馈内容" align="center" prop="content" min-width="200">
           <template #default="scope">
-            <el-button v-if="scope.row.images" link type="primary" @click="handleViewImages(scope.row)">查看图片</el-button>
-            <span v-else class="text-gray-400">无</span>
+            <div class="content-ellipsis">{{ scope.row.content }}</div>
           </template>
         </el-table-column>
         <el-table-column label="创建时间" align="center" prop="createTime" width="170" />
-        <el-table-column label="操作" align="center" width="80">
+        <el-table-column label="操作" align="center" width="150">
           <template #default="scope">
+            <el-button link type="primary" icon="View" @click="handleViewDetail(scope.row)">详情</el-button>
             <el-tooltip content="删除" placement="top">
               <el-button v-hasPermi="['miniapp:feedback:remove']" link type="danger" icon="Delete" @click="handleDelete(scope.row)"></el-button>
             </el-tooltip>
@@ -69,18 +68,27 @@
       />
     </el-card>
 
-    <!-- 图片预览对话框 -->
-    <el-dialog v-model="imageDialogVisible" title="反馈图片" width="800px">
-      <div class="image-preview-container">
-        <el-image
-          v-for="(image, index) in currentImages"
-          :key="index"
-          :src="image"
-          :preview-src-list="currentImages"
-          :initial-index="index"
-          fit="cover"
-          class="preview-image"
-        />
+    <!-- 详情对话框 -->
+    <el-dialog v-model="detailDialogVisible" title="反馈详情" width="800px">
+      <div class="feedback-detail">
+        <div class="detail-section">
+          <h4>反馈内容</h4>
+          <div class="content-text">{{ currentDetail.content }}</div>
+        </div>
+        <div v-if="currentDetail.images" class="detail-section">
+          <h4>反馈图片</h4>
+          <div class="image-preview-container">
+            <el-image
+              v-for="(image, index) in currentImages"
+              :key="index"
+              :src="image"
+              :preview-src-list="currentImages"
+              :initial-index="index"
+              fit="cover"
+              class="preview-image"
+            />
+          </div>
+        </div>
       </div>
     </el-dialog>
   </div>
@@ -100,7 +108,8 @@ const showSearch = ref(true);
 const total = ref(0);
 const ids = ref<number[]>([]);
 const multiple = ref(true);
-const imageDialogVisible = ref(false);
+const detailDialogVisible = ref(false);
+const currentDetail = ref<any>({});
 const currentImages = ref<string[]>([]);
 
 const queryFormRef = ref<ElFormInstance>();
@@ -155,19 +164,20 @@ const handleSelectionChange = (selection: any[]) => {
   multiple.value = !selection.length;
 };
 
-/** 查看图片 */
-const handleViewImages = (row: any) => {
+/** 查看详情 */
+const handleViewDetail = (row: any) => {
+  currentDetail.value = row;
   if (row.images) {
-    // 将逗号分隔的图片URL转换为数组
     currentImages.value = row.images.split(',').map((url: string) => {
-      // 如果是相对路径,拼接小程序后端代理路径
       if (url.startsWith('/')) {
         return '/miniapp-api' + url;
       }
       return url;
     });
-    imageDialogVisible.value = true;
+  } else {
+    currentImages.value = [];
   }
+  detailDialogVisible.value = true;
 };
 
 /** 删除按钮(工具栏) */
@@ -205,6 +215,21 @@ onMounted(() => {
 </script>
 
 <style scoped>
+.detail-section {
+  margin-bottom: 20px;
+}
+
+.detail-section h4 {
+  margin-bottom: 10px;
+  font-weight: 600;
+}
+
+.content-text {
+  white-space: pre-wrap;
+  word-break: break-word;
+  line-height: 1.6;
+}
+
 .image-preview-container {
   display: flex;
   flex-wrap: wrap;
@@ -215,6 +240,11 @@ onMounted(() => {
   width: 150px;
   height: 150px;
   cursor: pointer;
-  border-radius: 4px;
+}
+
+.content-ellipsis {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
 }
 </style>

+ 10 - 4
vite.config.ts

@@ -24,16 +24,22 @@ export default defineConfig(({ mode, command }) => {
       open: true,
       proxy: {
         // 小程序后端代理(用于图片等静态资源)
-        '/miniapp-api': {
+       /*  '/miniapp-api': {
           target: 'http://localhost:8081',
           changeOrigin: true,
           ws: true,
-          rewrite: (path) => path.replace(/^\/miniapp-api/, '')
+          rewrite: (path) => path.replace(/^\/miniapp-api/, '') */
+        // 小程序后端代理(用于图片等静态资源)
+        '/miniapp-api': {
+          target: 'https://www.whzhangsheng.cn',
+          changeOrigin: true,
+          ws: true,
+          rewrite: (path) => path.replace(/^\/miniapp-api/, '/applet-api')
         },
         // 管理后台后端代理
         [env.VITE_APP_BASE_API]: {
-          target: 'http://localhost:8080',
-          // target: 'https://www.whzhangsheng.cn/admin-api/',
+/*           target: 'http://localhost:8080', */
+          target: 'https://www.whzhangsheng.cn/admin-api/',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')