Explorar el Código

基本设置已完成,协议设置已完成

Huanyi hace 1 semana
padre
commit
9fa42c8f03

+ 2 - 2
.env.production

@@ -1,6 +1,6 @@
 # 页面标题
-VITE_APP_TITLE = RuoYi-Vue-Plus多租户管理系统
-VITE_APP_LOGO_TITLE = RuoYi-Vue-Plus
+VITE_APP_TITLE = 智能eTMF系统
+VITE_APP_LOGO_TITLE = 智能eTMF系统
 
 # 生产环境配置
 VITE_APP_ENV = 'production'

+ 1 - 1
index.html

@@ -6,7 +6,7 @@
     <meta name="renderer" content="webkit" />
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
 <!--    <link rel="icon" href="/favicon.ico" />-->
-    <link rel="icon" href="?" />
+    <link rel="icon" href="/?" />
     <title>%VITE_APP_TITLE%</title>
     <!--[if lt IE 11
       ]><script>

+ 63 - 0
src/api/setting/applet/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { AppletVO, AppletForm, AppletQuery } from '@/api/setting/applet/types';
+
+/**
+ * 查询小程序设置列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listApplet = (query?: AppletQuery): AxiosPromise<AppletVO[]> => {
+  return request({
+    url: '/setting/applet/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询小程序设置详细
+ * @param id
+ */
+export const getApplet = (id: string | number): AxiosPromise<AppletVO> => {
+  return request({
+    url: '/setting/applet/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增小程序设置
+ * @param data
+ */
+export const addApplet = (data: AppletForm) => {
+  return request({
+    url: '/setting/applet',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改小程序设置
+ * @param data
+ */
+export const updateApplet = (data: AppletForm) => {
+  return request({
+    url: '/setting/applet',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除小程序设置
+ * @param id
+ */
+export const delApplet = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/setting/applet/' + id,
+    method: 'delete'
+  });
+};

+ 52 - 0
src/api/setting/applet/types.ts

@@ -0,0 +1,52 @@
+export interface AppletVO extends BaseEntity {
+  /**
+   * 序号
+   */
+  id?: string | number;
+
+  /**
+   * 用户协议
+   */
+  userAgreement?: string;
+
+  /**
+   * 隐私协议
+   */
+  privacyAgreement?: string;
+}
+
+export interface AppletForm extends BaseEntity {
+  /**
+   * 序号
+   */
+  id?: string | number;
+
+  /**
+   * 用户协议
+   */
+  userAgreement?: string;
+
+  /**
+   * 隐私协议
+   */
+  privacyAgreement?: string;
+
+}
+
+export interface AppletQuery extends PageQuery {
+
+  /**
+   * 用户协议
+   */
+  userAgreement?: string;
+
+  /**
+   * 隐私协议
+   */
+  privacyAgreement?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 3 - 3
src/views/login.vue

@@ -72,9 +72,9 @@
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-login-footer">
-      <span>Copyright © 2018-2025 疯狂的狮子Li All Rights Reserved.</span>
-    </div>
+<!--    <div class="el-login-footer">-->
+<!--      <span>Copyright © 2018-2025 疯狂的狮子Li All Rights Reserved.</span>-->
+<!--    </div>-->
   </div>
 </template>
 

+ 80 - 0
src/views/setting/applet/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="p-4">
+    <el-card v-loading="loading" shadow="never">
+      <template #header>
+        <div class="card-header">
+          <span class="text-lg font-semibold">小程序设置</span>
+        </div>
+      </template>
+
+      <el-tabs v-if="appletData" v-model="activeTab" type="border-card">
+        <el-tab-pane label="用户协议" name="userAgreement">
+          <editor v-model="appletData.userAgreement" :min-height="400"/>
+          <div class="mt-4">
+            <el-button type="primary" :loading="saveLoading" @click="handleSave">保存</el-button>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane label="隐私协议" name="privacyAgreement">
+          <editor v-model="appletData.privacyAgreement" :min-height="400"/>
+          <div class="mt-4">
+            <el-button type="primary" :loading="saveLoading" @click="handleSave">保存</el-button>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+
+      <el-empty v-else description="暂无数据" />
+    </el-card>
+  </div>
+</template>
+
+<script setup name="Applet" lang="ts">
+import { getApplet, updateApplet } from '@/api/setting/applet';
+import { AppletVO } from '@/api/setting/applet/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const loading = ref(true);
+const saveLoading = ref(false);
+const activeTab = ref('userAgreement');
+const appletData = ref<AppletVO | null>(null);
+
+/** 获取小程序设置数据 */
+const fetchData = async () => {
+  loading.value = true;
+  try {
+    const res = await getApplet(1);
+    appletData.value = res.data;
+  } catch (error) {
+    console.error('获取数据失败:', error);
+  } finally {
+    loading.value = false;
+  }
+}
+
+/** 保存数据 */
+const handleSave = async () => {
+  if (!appletData.value) return;
+  
+  saveLoading.value = true;
+  try {
+    // 使用BASE64编码
+    const encodedData = {
+      ...appletData.value,
+      id: 1, // 默认设置为1
+      userAgreement: btoa(unescape(encodeURIComponent(appletData.value.userAgreement || ''))),
+      privacyAgreement: btoa(unescape(encodeURIComponent(appletData.value.privacyAgreement || '')))
+    };
+    
+    await updateApplet(encodedData);
+    proxy?.$modal.msgSuccess("保存成功");
+  } catch (error) {
+    console.error('保存失败:', error);
+  } finally {
+    saveLoading.value = false;
+  }
+}
+
+onMounted(() => {
+  fetchData();
+});
+</script>

+ 6 - 6
src/views/system/tenant/index.vue

@@ -44,12 +44,12 @@
           <el-col :span="1.5">
             <el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
           </el-col>
-          <el-col :span="1.5">
-            <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantConfig">同步租户参数配置</el-button>
-          </el-col>
+<!--          <el-col :span="1.5">-->
+<!--            <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>-->
+<!--          </el-col>-->
+<!--          <el-col :span="1.5">-->
+<!--            <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantConfig">同步租户参数配置</el-button>-->
+<!--          </el-col>-->
           <right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
         </el-row>
       </template>

+ 3 - 3
src/views/system/user/profile/index.vue

@@ -55,9 +55,9 @@
             <el-tab-pane label="修改密码" name="resetPwd">
               <resetPwd />
             </el-tab-pane>
-            <el-tab-pane label="第三方应用" name="thirdParty">
-              <thirdParty :auths="state.auths" />
-            </el-tab-pane>
+<!--            <el-tab-pane label="第三方应用" name="thirdParty">-->
+<!--              <thirdParty :auths="state.auths" />-->
+<!--            </el-tab-pane>-->
             <el-tab-pane label="在线设备" name="onlineDevice">
               <onlineDevice :devices="state.devices" />
             </el-tab-pane>