Hua преди 3 дни
родител
ревизия
f56b0df920
променени са 1 файла, в които са добавени 4 реда и са изтрити 41 реда
  1. 4 41
      src/views/Problem/detail/indexDc.vue

+ 4 - 41
src/views/Problem/detail/indexDc.vue

@@ -212,7 +212,6 @@ function getDe(){
             columns2.value = []
             parSectino.value.forEach(item => {
                 if(item.inspPblmsName === tacObjPblmstb.value.inspPblmsName){
-                    console.log(item);
                     var par = {
                         text: item.checkPoint,
                         value: item.checkPoint
@@ -223,7 +222,6 @@ function getDe(){
             })
             parSectino.value.forEach(item => {
                 if(item.checkPoint === tacObjPblmstb.value.checkPoint){
-                    console.log(item);
                     var par = {
                         text: item.pblmDesc,
                         value: item.pblmDesc
@@ -245,41 +243,6 @@ function getDe(){
         }
     })
 }
-// 获取需要认证的图片并转换为 base64
-async function getAuthImageAsBase64(imageUrl) {
-    try {
-        // 1. 使用 fetch 请求图片,携带 token
-        const response = await fetch(imageUrl, {
-            headers: {
-                'Authorization': `Bearer ${localStorage.getItem('token')}`,
-                'X-Token': localStorage.getItem('token') // 根据实际情况调整
-            }
-        });
-
-        if (!response.ok) {
-            throw new Error(`HTTP错误: ${response.status}`);
-        }
-
-        // 2. 获取图片的 ArrayBuffer
-        const arrayBuffer = await response.arrayBuffer();
-
-        // 3. 转换为 base64
-        const base64 = btoa(
-            new Uint8Array(arrayBuffer).reduce(
-                (data, byte) => data + String.fromCharCode(byte),
-                ''
-            )
-        );
-
-        // 4. 根据图片类型生成 data URL
-        const contentType = response.headers.get('content-type') || 'image/png';
-        return `data:${contentType};base64,${base64}`;
-
-    } catch (error) {
-        console.error('获取认证图片失败:', error);
-        throw error;
-    }
-}
 async function save(){
     console.log(tacObjPblmstb.value);
     tacObjPblmstb.value.ifCasePblm = tacObjPblmstb.value.ifCasePblm === '是' ? '1' : '0';
@@ -297,7 +260,7 @@ async function save(){
                 }
             })
             showSuccessToast('保存成功!');
-            router1.go(-1)
+            // router1.go(-1)
             fileList.value = []
         }
     });
@@ -374,7 +337,7 @@ const dataURLtoBlob = (dataURL) => {
 // 2. 手动构建multipart/form-data(保留之前验证正确的逻辑)
 const buildMultipartFormData = async (file) => {
   if (!file) throw new Error('文件为空');
-
+  console.log(file.content)
   // 生成标准boundary
   const boundary = `----WebKitFormBoundary${Math.random().toString(36).substr(2, 16)}`;
 
@@ -452,7 +415,7 @@ const uploadFileToServer = async (file, bizId) => {
 
     // 使用Fetch API发送请求(原生支持二进制,无兼容性问题)
     const formData = new FormData();
-    formData.append('file', fileList.value[0].content); // 文件参数
+    // formData.append('file', fileList.value[0].content); // 文件参数
     const response = await fetch(fullUrl, {
       method: 'POST',
       headers: {
@@ -530,7 +493,7 @@ onMounted(() => {
   height: 120%;
   padding: 10px 0;
   overflow: auto;
-
+  background-color: #f5f7fa;
   .pblm-detail-label {
     padding: 10px 16px;
     color: #606266;