Parcourir la source

- 修复WPS的bug

Huanyi il y a 3 mois
Parent
commit
83c42cb037

+ 2 - 2
.env.development

@@ -1,6 +1,6 @@
 # 页面标题
-VITE_APP_TITLE = eTMF
-VITE_APP_LOGO_TITLE = eTMF
+VITE_APP_TITLE = 道修远智能eTMF
+VITE_APP_LOGO_TITLE = 道修远智能eTMF
 
 # 开发环境配置
 VITE_APP_ENV = 'development'

+ 2 - 2
.env.production

@@ -1,6 +1,6 @@
 # 页面标题
-VITE_APP_TITLE = eTMF
-VITE_APP_LOGO_TITLE = eTMF
+VITE_APP_TITLE = 道修远智能eTMF
+VITE_APP_LOGO_TITLE = 道修远智能eTMF
 
 # 生产环境配置
 VITE_APP_ENV = 'production'

+ 25 - 0
src/api/setting/textin/index.ts

@@ -0,0 +1,25 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { TextinVO, TextinForm } from '@/api/setting/textin/types';
+
+/**
+ * 获取 TextIn 配置
+ */
+export const getTextinConfig = (): AxiosPromise<TextinVO> => {
+  return request({
+    url: '/setting/textin',
+    method: 'get'
+  });
+};
+
+/**
+ * 更新 TextIn 配置
+ * @param data
+ */
+export const updateTextinConfig = (data: TextinForm) => {
+  return request({
+    url: '/setting/textin',
+    method: 'put',
+    data: data
+  });
+};

+ 53 - 0
src/api/setting/textin/types.ts

@@ -0,0 +1,53 @@
+export interface TextinVO {
+  /**
+   * 序号
+   */
+  id: string | number;
+
+  /**
+   * x-ti-app-id 
+   */
+  appId: string | number;
+
+  /**
+   * x-ti-secret-code
+   */
+  secretCode: string;
+
+}
+
+export interface TextinForm extends BaseEntity {
+  /**
+   * 序号
+   */
+  id?: string | number;
+
+  /**
+   * x-ti-app-id 
+   */
+  appId?: string | number;
+
+  /**
+   * x-ti-secret-code
+   */
+  secretCode?: string;
+
+}
+
+export interface TextinQuery extends PageQuery {
+
+  /**
+   * x-ti-app-id 
+   */
+  appId?: string | number;
+
+  /**
+   * x-ti-secret-code
+   */
+  secretCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 5 - 6
src/components/DocumentAuditDialog/index.vue

@@ -690,14 +690,13 @@ const handleCleanComments = async () => {
     cleaningComments.value = true;
     console.log('[清空批注] 开始清空文档批注,文档ID:', props.document.id, 'ossId:', props.document.ossId, '当前版本:', currentVersion.value);
 
-    await cleanDocumentComments(props.document.ossId);
+    // 调用后端接口清空批注,获取新版本号
+    const res = await cleanDocumentComments(props.document.ossId);
+    const newVersion = res.data; // 后端返回的新版本号
+    currentVersion.value = newVersion;
 
     ElMessage.success('批注已清空');
-    console.log('[清空批注] 批注清空成功');
-
-    // 版本号递增
-    currentVersion.value += 1;
-    console.log('[清空批注] 版本号递增至:', currentVersion.value);
+    console.log('[清空批注] 批注清空成功,新版本号:', newVersion);
 
     // 销毁当前 WPS 编辑器
     destroyWpsEditor();

+ 0 - 14
src/views/setting/ai/index.vue

@@ -20,7 +20,6 @@
 
         <el-form-item>
           <el-button type="primary" :loading="saveLoading" @click="handleSave">{{ t('ai.button.save') }}</el-button>
-          <el-button @click="handleReset">{{ t('ai.button.reset') }}</el-button>
         </el-form-item>
       </el-form>
 
@@ -44,7 +43,6 @@ const loading = ref(true);
 const saveLoading = ref(false);
 const formRef = ref<FormInstance>();
 const aiData = ref<AiSettingVO | null>(null);
-const originalData = ref<AiSettingVO | null>(null);
 
 // 表单验证规则
 const rules: FormRules = {
@@ -62,8 +60,6 @@ const fetchData = async () => {
     const res = await getAiSetting();
     if (res.code === 200) {
       aiData.value = res.data;
-      // 保存原始数据用于重置
-      originalData.value = JSON.parse(JSON.stringify(res.data));
     } else {
       proxy?.$modal.msgError(res.msg || t('ai.message.fetchFailed'));
     }
@@ -99,16 +95,6 @@ const handleSave = async () => {
   });
 };
 
-/**
- * 重置表单
- */
-const handleReset = () => {
-  if (originalData.value) {
-    aiData.value = JSON.parse(JSON.stringify(originalData.value));
-  }
-  formRef.value?.clearValidate();
-};
-
 onMounted(() => {
   fetchData();
 });

+ 3 - 25
src/views/setting/carousel/index.vue

@@ -1,18 +1,5 @@
 <template>
   <div class="p-2">
-    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
-      <div v-show="showSearch" class="mb-[10px]">
-        <el-card shadow="hover">
-          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
-            <el-form-item>
-              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
-              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-            </el-form-item>
-          </el-form>
-        </el-card>
-      </div>
-    </transition>
-
     <el-card shadow="never">
       <template #header>
         <el-row :gutter="10" class="mb8">
@@ -25,10 +12,9 @@
           <el-col :span="1.5">
             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['setting:carousel:remove']">删除</el-button>
           </el-col>
-          <el-col :span="1.5">
-            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['setting:carousel:export']">导出</el-button>
-          </el-col>
-          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+<!--          <el-col :span="1.5">-->
+<!--            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['setting:carousel:export']">导出</el-button>-->
+<!--          </el-col>-->
         </el-row>
       </template>
 
@@ -88,13 +74,11 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const carouselList = ref<CarouselVO[]>([]);
 const buttonLoading = ref(false);
 const loading = ref(true);
-const showSearch = ref(true);
 const ids = ref<Array<string | number>>([]);
 const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
 
-const queryFormRef = ref<ElFormInstance>();
 const carouselFormRef = ref<ElFormInstance>();
 
 const dialog = reactive<DialogOption>({
@@ -158,12 +142,6 @@ const handleQuery = () => {
   getList();
 }
 
-/** 重置按钮操作 */
-const resetQuery = () => {
-  queryFormRef.value?.resetFields();
-  handleQuery();
-}
-
 /** 多选框选中数据 */
 const handleSelectionChange = (selection: CarouselVO[]) => {
   ids.value = selection.map(item => item.id);

+ 153 - 0
src/views/setting/textin/index.vue

@@ -0,0 +1,153 @@
+<template>
+  <div class="p-4">
+    <el-card shadow="never">
+      <template #header>
+        <div class="card-header">
+          <span class="card-title">TextIn 配置</span>
+          <span class="card-subtitle">配置 TextIn API 的认证信息</span>
+        </div>
+      </template>
+
+      <el-form
+        ref="textinFormRef"
+        :model="form"
+        :rules="rules"
+        label-width="150px"
+        class="textin-form"
+        v-loading="loading"
+      >
+        <el-form-item label="x-ti-app-id" prop="appId">
+          <el-input
+            v-model="form.appId"
+            placeholder="请输入 x-ti-app-id"
+            clearable
+            maxlength="100"
+            show-word-limit
+          />
+          <div class="form-tip">用于 TextIn API 认证的应用 ID</div>
+        </el-form-item>
+
+        <el-form-item label="x-ti-secret-code" prop="secretCode">
+          <el-input
+            v-model="form.secretCode"
+            placeholder="请输入 x-ti-secret-code"
+            clearable
+            maxlength="100"
+            show-word-limit
+            type="password"
+            show-password
+          />
+          <div class="form-tip">用于 TextIn API 认证的密钥</div>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button type="primary" @click="handleSave" :loading="saving" v-hasPermi="['setting:textin:edit']">
+            <el-icon><Check /></el-icon>
+            保存配置
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script setup name="Textin" lang="ts">
+import { getTextinConfig, updateTextinConfig } from '@/api/setting/textin';
+import { TextinForm } from '@/api/setting/textin/types';
+import { Check } from '@element-plus/icons-vue';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const textinFormRef = ref<ElFormInstance>();
+const loading = ref(false);
+const saving = ref(false);
+
+const initFormData: TextinForm = {
+  id: undefined,
+  appId: undefined,
+  secretCode: undefined,
+};
+
+const form = ref<TextinForm>({ ...initFormData });
+
+const rules = reactive({
+  appId: [
+    { required: true, message: '请输入 App ID', trigger: 'blur' }
+  ],
+  secretCode: [
+    { required: true, message: '请输入 Secret Code', trigger: 'blur' }
+  ]
+});
+
+/** 获取配置 */
+const getConfig = async () => {
+  loading.value = true;
+  try {
+    const res = await getTextinConfig();
+    form.value = { ...res.data };
+  } catch (error) {
+    console.error('获取配置失败:', error);
+    proxy?.$modal.msgError('获取配置失败');
+  } finally {
+    loading.value = false;
+  }
+};
+
+/** 保存配置 */
+const handleSave = () => {
+  textinFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      saving.value = true;
+      try {
+        await updateTextinConfig(form.value);
+        proxy?.$modal.msgSuccess('保存成功');
+      } catch (error) {
+        console.error('保存失败:', error);
+        proxy?.$modal.msgError('保存失败');
+      } finally {
+        saving.value = false;
+      }
+    }
+  });
+};
+
+onMounted(() => {
+  getConfig();
+});
+</script>
+
+<style scoped lang="scss">
+.card-header {
+  display: flex;
+  flex-direction: column;
+  gap: 4px;
+
+  .card-title {
+    font-size: 16px;
+    font-weight: 600;
+    color: #303133;
+  }
+
+  .card-subtitle {
+    font-size: 13px;
+    color: #909399;
+  }
+}
+
+.textin-form {
+  max-width: 800px;
+  margin-top: 20px;
+
+  .form-tip {
+    font-size: 12px;
+    color: #909399;
+    margin-top: 4px;
+    line-height: 1.5;
+  }
+
+  :deep(.el-form-item__content) {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+}
+</style>