浏览代码

修复build错误

yangtaodemon 18 小时之前
父节点
当前提交
99cdf7ba79

+ 0 - 2
src/App.vue

@@ -1,7 +1,5 @@
 <script setup lang='ts'>
 import { RouterView } from "vue-router"
-import request from './utils/request';
-import Acidmodelmap from "./views/User/acidModel/acidmodelmap.vue";
 
 </script>
 

+ 0 - 1
src/components/layout/AppHeader.vue

@@ -28,7 +28,6 @@
 </template>
 
 <script setup lang="ts">
-import { reactive } from "vue";
 import { ElMessage } from "element-plus";
 import { useTokenStore } from "@/stores/mytoken";
 import { logout } from "@/API/users";

+ 2 - 14
src/components/layout/AppLayout.vue

@@ -105,14 +105,12 @@
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, computed, watch, defineAsyncComponent, onMounted } from "vue";
+import { ref, reactive, computed, watch, defineAsyncComponent } from "vue";
 import { useRouter, useRoute } from "vue-router";
 import { useTokenStore } from "@/stores/mytoken";
 import { ElMessageBox, ElMessage } from "element-plus"; // 确保导入ElMessage
 import { logout } from "@/API/users";
-import { useI18n } from "vue-i18n";
 
-const { t } = useI18n();
 const router = useRouter();
 const route = useRoute();
 const tokenStore = useTokenStore();
@@ -318,7 +316,7 @@ watch(
 
 // 点击 tab
 const activeAsideTab = ref(activeName.value || "");
-const handleClick = (tab: any, event?: Event) => {
+const handleClick = (tab: any, _event?: Event) => {
   activeAsideTab.value = tab.name || tab.props?.name;
 };
 
@@ -341,16 +339,6 @@ const showAside = computed(
 );
 
 // ============ 显示全局消息 ============
-const showMessage = (message: string, type: "success" | "error" = "success") => {
-  globalMessage.value = message;
-  messageType.value = type;
-  showGlobalMessage.value = true;
-  
-  // 3秒后自动隐藏消息
-  setTimeout(() => {
-    showGlobalMessage.value = false;
-  }, 3000);
-};
 
 // 登出逻辑
 const handleLogout = async () => {

+ 1 - 1
src/router/index.ts

@@ -208,7 +208,7 @@ const router = createRouter({
 
 // ========== 3. ✅ 添加全局前置守卫 ==========
 // src/router/index.ts
-router.beforeEach((to, from, next) => {
+router.beforeEach((to, _from, next) => {
   const store = useTokenStore();
 
   // 1. 未登录:只能访问登录页

+ 1 - 3
src/utils/request.ts

@@ -5,9 +5,7 @@ import type {
   AxiosRequestConfig,
   AxiosResponse,
   AxiosError,
-  InternalAxiosRequestConfig,
-  AxiosRequestHeaders
-} from 'axios';
+  InternalAxiosRequestConfig} from 'axios';
 
 // 检测当前环境
 const isDevelopment = import.meta.env.MODE === 'development';

+ 1 - 54
src/views/Admin/dataManagement/Soil Acidification and Acid Reduction Data Management/soilAcidReductionData.vue

@@ -253,7 +253,6 @@ import {
   ElMessage,
   ElForm,
   ElMessageBox,
-  ElNotification,
   FormRules,
   FormItemRule,
 } from "element-plus";
@@ -337,10 +336,6 @@ const currentTableName: TableName = "current_reflux";
 const emptyCellErrors = ref<EmptyCellError[]>([]);
 const emptyCellDialogVisible = ref(false);
 
-const showEmptyCellErrors = (errors: EmptyCellError[]) => {
-  emptyCellErrors.value = errors;
-  emptyCellDialogVisible.value = true;
-};
 
 const tableData = ref<any[]>([]);
 const selectedRow = ref<any | null>(null);
@@ -708,32 +703,6 @@ const handleFileSelect = async (uploadFile: any) => {
   await importDataAction(file);
 };
 
-interface AxiosError extends Error {
-  response?: {
-    data?: {
-      detail?: any;
-      message?: string;
-      [key: string]: any;
-    };
-    status?: number;
-    statusText?: string;
-    headers?: any;
-    config?: any;
-  };
-  request?: any;
-  config?: any;
-}
-
-interface ErrorResponse {
-  error?: string;
-  message?: string;
-  [key: string]: any;
-}
-
-// 定义详细信息展示函数的类型
-interface ShowDetailedInfo {
-  (title: string, content: string): void;
-}
 
 // 优化后的数据导入函数
 const importDataAction = async (file: File) => {
@@ -910,12 +879,6 @@ const importDataAction = async (file: File) => {
 };
 
 // 定义详细信息展示函数,带有明确的参数类型
-const showDetailedInfo: ShowDetailedInfo = (title: string, content: string) => {
-  // 这里可以实现一个模态框或侧边栏来展示详细内容
-  console.log(`=== ${title} ===`);
-  console.log(content);
-  console.log('====================================');
-};
 
 const handleSizeChange = (val: number) => {
   pageSize4.value = val;
@@ -926,7 +889,7 @@ const handleCurrentChange = (val: number) => {
   currentPage4.value = val;
 };
 
-const formatTableValue = (row: any, column: any, cellValue: any) => {
+const formatTableValue = (_row: any, _column: any, cellValue: any) => {
   return normalizeValue(cellValue);
 };
 
@@ -979,22 +942,6 @@ const showMessage = (
   });
 };
 
-const showNotification = (
-  title: string,
-  message: string,
-  type: "success" | "warning" | "info" | "error" = "info",
-  duration: number = 4500
-) => {
-  ElNotification({
-    title,
-    message,
-    type,
-    duration,
-    customClass: `unified-notification notification-${type}`,
-    dangerouslyUseHTMLString: true,
-  });
-};
-
 // 详情弹窗相关
 const detailsVisible = ref(false);
 const detailsContent = ref('');

+ 3 - 65
src/views/Admin/dataManagement/Soil Acidification and Acid Reduction Data Management/soilAcidificationData.vue

@@ -253,7 +253,6 @@ import {
   ElMessage,
   ElForm,
   ElMessageBox,
-  ElNotification,
   FormRules,
   FormItemRule,
 } from "element-plus";
@@ -283,15 +282,6 @@ interface Column {
   options?: Array<{ label: string; value: string | number }>;
 }
 
-const fieldTypeMap: Record<string, "text" | "number"> = {
-  Q_over_b: "number",
-  pH: "number",
-  OM: "number",
-  CL: "number",
-  H: "number",
-  Al: "number",
-};
-
 const columns: Column[] = [
   { key: "id", dataKey: "id", title: "ID", width: 100 },
   {
@@ -344,12 +334,6 @@ const currentTableName: TableName = "current_reduce";
 
 const emptyCellErrors = ref<EmptyCellError[]>([]);
 const emptyCellDialogVisible = ref(false);
-
-const showEmptyCellErrors = (errors: EmptyCellError[]) => {
-  emptyCellErrors.value = errors;
-  emptyCellDialogVisible.value = true;
-};
-
 const tableData = ref<any[]>([]);
 const selectedRow = ref<any | null>(null);
 const loading = ref(false);
@@ -715,32 +699,6 @@ const handleFileSelect = async (uploadFile: any) => {
   await importDataAction(file);
 };
 
-interface AxiosError extends Error {
-  response?: {
-    data?: {
-      detail?: any;
-      message?: string;
-      [key: string]: any;
-    };
-    status?: number;
-    statusText?: string;
-    headers?: any;
-    config?: any;
-  };
-  request?: any;
-  config?: any;
-}
-
-interface ErrorResponse {
-  error?: string;
-  message?: string;
-  [key: string]: any;
-}
-
-// 定义详细信息展示函数的类型
-interface ShowDetailedInfo {
-  (title: string, content: string): void;
-}
 
 // 优化后的数据导入函数
 const importDataAction = async (file: File) => {
@@ -916,13 +874,7 @@ const importDataAction = async (file: File) => {
   }
 };
 
-// 定义详细信息展示函数,带有明确的参数类型
-const showDetailedInfo: ShowDetailedInfo = (title: string, content: string) => {
-  // 这里可以实现一个模态框或侧边栏来展示详细内容
-  console.log(`=== ${title} ===`);
-  console.log(content);
-  console.log('====================================');
-};
+
 
 const handleSizeChange = (val: number) => {
   pageSize4.value = val;
@@ -933,7 +885,7 @@ const handleCurrentChange = (val: number) => {
   currentPage4.value = val;
 };
 
-const formatTableValue = (row: any, column: any, cellValue: any) => {
+const formatTableValue = (_row: any, _column: any, cellValue: any) => {
   return normalizeValue(cellValue);
 };
 
@@ -986,21 +938,7 @@ const showMessage = (
   });
 };
 
-const showNotification = (
-  title: string,
-  message: string,
-  type: "success" | "warning" | "info" | "error" = "info",
-  duration: number = 4500
-) => {
-  ElNotification({
-    title,
-    message,
-    type,
-    duration,
-    customClass: `unified-notification notification-${type}`,
-    dangerouslyUseHTMLString: true,
-  });
-};
+
 
 // 详情弹窗相关
 const detailsVisible = ref(false);

+ 1 - 10
src/views/Admin/modelManagement/AcidReductionModel/ModelSelection.vue

@@ -230,16 +230,8 @@ const pagedFilteredModels = computed(() => {
 });
 
 // 过滤后的数据集数据
-const filteredRows = computed(() =>
-  selectedModelType.value ? rows.value.filter((row) => row.type === selectedModelType.value) : []
-);
 
-// 分页后的过滤数据集数据
-const pagedFilteredRows = computed(() => {
-  const start = (currentPage.value - 1) * pageSize.value;
-  const end = start + pageSize.value;
-  return filteredRows.value.slice(start, end);
-});
+
 
 const handleModelTypeChange = (value: string) => {
   selectedModelType.value = value;
@@ -290,7 +282,6 @@ const switchModel = async () => {
 
 const errorOccurred = ref(false);
 const errorMessage = ref('');
-const selectedRows = ref<Dataset[]>([]);
 
 onMounted(() => {
   fetchAllModels();

+ 2 - 2
src/views/Admin/modelManagement/AcidReductionModel/ModelTrain.vue

@@ -217,8 +217,8 @@ const selectRow = (row: Dataset) => {
 };
 
 const showMessageDialog = (
-  message: string,
-  type: "success" | "warning" | "info" | "error"
+  _message: string,
+  _type: "success" | "warning" | "info" | "error"
 ) => {
   ElMessage({
     message: "提示信息",

+ 0 - 1
src/views/Admin/parameterConfig/ModelSelection.vue

@@ -141,7 +141,6 @@ const selectedModelTypeLabel = ref<string>("请选择模型类型");
 const selectedModel = ref<ModelData | null>(null);
 const errorOccurred = ref(false);
 const errorMessage = ref("");
-const selectedRows = ref<Dataset[]>([]);
 
 const modelTypes = [
   { value: "reduce", label: "降酸模型(Reduce Model)" },

+ 1 - 1
src/views/Admin/userManagement/UserManagement.vue

@@ -76,7 +76,7 @@ const form = reactive({
 const tableLoading = ref(false);
 const submitLoading = ref(false);
 
-const typeFormatter = (row: any, column: any, cellValue: string) => {
+const typeFormatter = (_row: any, _column: any, cellValue: string) => {
   if (cellValue === "admin") return "管理员";
   if (cellValue === "user") return "普通用户";
   return cellValue;

+ 1 - 8
src/views/ErrorPage.vue

@@ -8,14 +8,7 @@
     </div>
   </template>
   
-  <script setup lang="ts">
-  import { useRouter } from 'vue-router';
-  const router = useRouter()
- 
-const toLogin = () => {
-    router.push('/login')
-    }
- 
+  <script setup lang="ts"> 
   </script>
   
  

+ 6 - 6
src/views/User/acidModel/acidmodelmap.vue

@@ -317,7 +317,7 @@ const acidInversionRules = reactive({
     { required: true, message: '请输入NO3', trigger: 'change' },
     { type: 'number', message: '请输入有效数字', trigger: 'change' },
     { 
-      validator: (rule: any, value: number, callback: any) => {
+      validator: (_rule: any, value: number, callback: any) => {
         if (value < 0) {
           callback(new Error('值不能为负数'));
         } else {
@@ -331,7 +331,7 @@ const acidInversionRules = reactive({
     { required: true, message: '请输入NH4', trigger: 'change' },
     { type: 'number', message: '请输入有效数字', trigger: 'change' },
     { 
-      validator: (rule: any, value: number, callback: any) => {
+      validator: (_rule: any, value: number, callback: any) => {
         if (value < 0) {
           callback(new Error('值不能为负数'));
         } else {
@@ -360,7 +360,7 @@ const acidReductionRules = reactive({
     { required: true, message: '请输入目标pH值', trigger: 'blur' },
     { type: 'number', message: '请输入有效数字', trigger: 'blur' },
     { 
-      validator: (rule: any, value: number, callback: any) => {
+      validator: (_rule: any, value: number, callback: any) => {
         if (value < 0 || value > 14) {
           callback(new Error('值范围在0-14之间'));
         } else {
@@ -374,7 +374,7 @@ const acidReductionRules = reactive({
     { required: true, message: '请输入NO3', trigger: 'blur' },
     { type: 'number', message: '请输入有效数字', trigger: 'blur' },
     { 
-      validator: (rule: any, value: number, callback: any) => {
+      validator: (_rule: any, value: number, callback: any) => {
         if (value < 0) {
           callback(new Error('值不能为负数'));
         } else {
@@ -388,7 +388,7 @@ const acidReductionRules = reactive({
     { required: true, message: '请输入NH4', trigger: 'blur' },
     { type: 'number', message: '请输入有效数字', trigger: 'blur' },
     { 
-      validator: (rule: any, value: number, callback: any) => {
+      validator: (_rule: any, value: number, callback: any) => {
         if (value < 0) {
           callback(new Error('值不能为负数'));
         } else {
@@ -510,7 +510,7 @@ const drawHighlightFeature = (geoJsonFeature: any) => {
 };
 
 // 获取地块信息
-const getFeatureInfo = async (latlng: any, point: any): Promise<boolean> => {
+const getFeatureInfo = async (_latlng: any, point: any): Promise<boolean> => {
   if (!map.value) return false;
   
   featureInfo.loading = true;

+ 1 - 2
src/views/User/acidModel/pHPrediction.vue

@@ -116,7 +116,7 @@
 </template>
 
 <script setup lang="ts">
-import { reactive, ref, nextTick } from "vue";
+import { reactive, ref } from "vue";
 import { ElMessage } from "element-plus";
 import { api5000 } from "../../../utils/request";
 
@@ -148,7 +148,6 @@ const form = reactive<Form>({
 
 const imageSrc = ref<string | null>(null);
 const dialogVisible = ref(false);
-const predictForm = ref<any>(null);
 const errorMessages = reactive<Record<string, string>>({
   OM: "",
   CL: "",

+ 1 - 12
src/views/User/introduction/IntroUpdateModal.vue

@@ -84,18 +84,7 @@ watch(() => props.targetId, (newTargetId, oldTargetId) => {
 const updateIntro = async () => {
   isUpdating.value = true;
   try {
-    // 将 <br> 标签替换回换行符
-    let processedIntro = updatedIntro.value.intro.replace(/<br>/gi, '\r\n');
-    const dataToSend = {
-      title: updatedIntro.value.title,
-      intro: processedIntro
-    };
-    // 发送 PUT 请求更新数据http
-    const response = await axios.put(`https://soilgd.com:5000/software-intro/${props.targetId}`, dataToSend, {
-      headers: {
-        'Content-Type': 'application/json'
-      }
-    });
+    // 将 <br> 标签替换回换行符    // 发送 PUT 请求更新数据http
     console.log('介绍更新成功!');
     ElMessage.success('更新成功!');
     emits('updateSuccess');

+ 0 - 9
src/views/User/introduction/Introduce.vue

@@ -37,17 +37,8 @@ const isLoading = ref(true);
 const error = ref('');
 
 // 判断是否为标题段落
-const isTitle = (paragraph: string) => {
-  return /^[^\s].*[::]$/.test(paragraph);
-};
 
-const imageBaseUrl = ref(import.meta.env.VITE_IMAGE_BASE_URL);
 // 处理段落,将图片路径转换为  标签
-const processParagraph = (paragraph: string) => {
-  // 假设图片路径是相对路径
-  const imgRegex = /([^\s]+(\.jpg|\.jpeg|\.png|\.gif))/g;
-  return paragraph.replace(imgRegex, ``);
-};
 
 onMounted(async () => {
   try {

+ 1 - 1
src/views/login/loginView.vue

@@ -158,7 +158,7 @@
 </template>
 
 <script setup lang="ts">
-import { reactive, ref, computed, watch, onMounted } from "vue";
+import { reactive, ref, computed, watch } from "vue";
 import { ElForm, ElMessage } from "element-plus";
 import type { FormRules } from "element-plus";
 import { login, register } from "@/API/users";

+ 1 - 1
src/views/packaged/PaginationComponent.vue

@@ -13,7 +13,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, watch, onMounted } from 'vue';
+import { ref, watch } from 'vue';
 
 // 定义 props
 interface Props {