Huanyi 2 miesięcy temu
rodzic
commit
fda9fe950b

+ 0 - 24
components/TreeView/index.vue

@@ -69,7 +69,6 @@ export default {
   watch: {
     treeData: {
       handler() {
-        console.log('TreeView - treeData 变化:', this.treeData)
         this.parsePermission()
         this.buildFlattenedTree()
       },
@@ -78,7 +77,6 @@ export default {
     },
     permission: {
       handler() {
-        console.log('TreeView - permission 变化:', this.permission)
         this.parsePermission()
         this.buildFlattenedTree()
       },
@@ -88,15 +86,11 @@ export default {
   methods: {
     // 解析权限配置
     parsePermission() {
-      console.log('========== 解析权限 ==========')
-      console.log('权限配置:', this.permission)
-      
       this.permissionIds.clear()
       this.allowedNodeIds.clear()
       
       // 如果是 '*',表示全部可选
       if (this.permission === '*') {
-        console.log('权限为 *,全部节点可选')
         return
       }
       
@@ -104,11 +98,9 @@ export default {
       if (this.permission && this.permission.trim()) {
         const ids = this.permission.split(',').map(id => parseInt(id.trim())).filter(id => !isNaN(id))
         ids.forEach(id => this.permissionIds.add(id))
-        console.log('有权限的节点ID:', Array.from(this.permissionIds))
         
         // 收集所有允许选择的节点(包括子节点)
         this.collectAllowedNodes(this.treeData)
-        console.log('允许选择的节点ID:', Array.from(this.allowedNodeIds))
       }
     },
     
@@ -149,17 +141,13 @@ export default {
     
     // 将树形数据扁平化
     buildFlattenedTree() {
-      console.log('========== 开始构建扁平化树 ==========')
       this.flattenedTree = []
       this.flattenNode(this.treeData, 0)
-      console.log('扁平化树构建完成,节点数:', this.flattenedTree.length)
-      console.log('扁平化树:', this.flattenedTree)
     },
     
     // 递归扁平化节点
     flattenNode(nodes, level, parentPath = []) {
       if (!nodes || !Array.isArray(nodes)) {
-        console.log('节点不是数组:', nodes)
         return
       }
       
@@ -185,11 +173,8 @@ export default {
           originalNode: node
         })
         
-        console.log(`添加节点: ${node.name}, level: ${level}, hasChildren: ${hasChildren}, expanded: ${isExpanded}, selectable: ${isSelectable}, path: ${fullPath}`)
-        
         // 如果展开且有子节点,递归处理子节点
         if (isExpanded && hasChildren) {
-          console.log(`展开子节点: ${node.name}, 子节点数: ${node.children.length}`)
           this.flattenNode(node.children, level + 1, currentPath)
         }
       })
@@ -197,16 +182,10 @@ export default {
     
     // 切换展开/收起
     toggleExpand(item) {
-      console.log('========== 切换展开状态 ==========')
-      console.log('节点:', item.name)
-      console.log('当前展开状态:', item.expanded)
-      
       if (item.expanded) {
         this.expandedIds.delete(item.id)
-        console.log('收起节点')
       } else {
         this.expandedIds.add(item.id)
-        console.log('展开节点')
       }
       
       // 重新构建扁平化树
@@ -220,9 +199,6 @@ export default {
     
     // 选择节点
     handleSelect(item) {
-      console.log('选择节点:', item.name, '是否可选:', item.selectable)
-      console.log('完整路径:', item.fullPath)
-      
       if (!item.selectable) {
         uni.showToast({
           title: '无权限选择此文件夹',

+ 1 - 27
pages/scan/folderSelect/components/FolderTreeItem.vue

@@ -75,22 +75,9 @@ export default {
   },
   computed: {
     hasChildren() {
-      const result = this.folder.children && this.folder.children.length > 0
-      console.log(`文件夹 ${this.folder.name} hasChildren:`, result, '子节点数:', this.folder.children?.length || 0)
-      return result
+      return this.folder.children && this.folder.children.length > 0
     }
   },
-  mounted() {
-    console.log('========== FolderTreeItem mounted ==========')
-    console.log('文件夹名称:', this.folder.name)
-    console.log('层级:', this.level)
-    console.log('类型:', this.folder.type)
-    console.log('完整 folder 对象:', this.folder)
-    console.log('children:', this.folder.children)
-    console.log('children 是否为数组:', Array.isArray(this.folder.children))
-    console.log('children 长度:', this.folder.children?.length || 0)
-    console.log('hasChildren 计算结果:', this.hasChildren)
-  },
   methods: {
     // 获取文件夹图标
     getFolderIcon(type) {
@@ -111,24 +98,11 @@ export default {
     
     // 切换展开/收起
     handleToggle() {
-      console.log('========== 点击切换 ==========')
-      console.log('文件夹:', this.folder.name)
-      console.log('当前展开状态:', this.isExpanded)
-      console.log('有子节点:', this.hasChildren)
-      console.log('子节点数量:', this.folder.children?.length || 0)
-      
       if (this.hasChildren) {
         this.isExpanded = !this.isExpanded
-        console.log('切换后展开状态:', this.isExpanded)
         
         // 强制更新
         this.$forceUpdate()
-        
-        // 延迟检查子节点是否渲染
-        setTimeout(() => {
-          console.log('延迟检查 - 当前展开状态:', this.isExpanded)
-          console.log('延迟检查 - 子节点:', this.folder.children)
-        }, 100)
       }
     },
     

+ 24 - 43
pages/scan/folderSelect/index.vue

@@ -52,6 +52,7 @@
               type="text"
               placeholder="请输入具体文档名"
               class="input-field"
+              @input="handleDocumentNameInput"
             />
           </view>
           <view class="date-picker-wrapper">
@@ -131,15 +132,9 @@ export default {
     }
   },
   onLoad(options) {
-    console.log('页面参数:', options)
-    
     this.projectId = parseInt(options.projectId) || 0
     this.projectName = decodeURIComponent(options.projectName || '')
     this.projectCode = decodeURIComponent(options.projectCode || '')
-    
-    console.log('解析后的projectId:', this.projectId)
-    console.log('解析后的projectName:', this.projectName)
-    console.log('解析后的projectCode:', this.projectCode)
   },
   onReady() {
     // 获取系统信息
@@ -166,16 +161,10 @@ export default {
       try {
         this.loading = true
         
-        console.log('========== 开始加载文件夹列表 ==========')
-        console.log('projectId:', this.projectId)
-        
         const response = await getFolderList({
           projectId: this.projectId
         })
         
-        console.log('========== 后端返回的原始数据 ==========')
-        console.log('完整响应:', response)
-        
         // 保存原始数据
         this.rawData = response
         
@@ -186,15 +175,13 @@ export default {
         }
         
       } catch (error) {
-        console.error('========== 加载失败 ==========')
-        console.error('错误信息:', error)
+        console.error('加载失败:', error)
         uni.showToast({
           title: '加载失败',
           icon: 'none'
         })
       } finally {
         this.loading = false
-        console.log('========== 加载完成 ==========')
       }
     },
     
@@ -210,8 +197,6 @@ export default {
         ...countries
       ]
       
-      console.log('解析后的国家列表:', this.countryList)
-      
       // 初始化时加载第一个国家(NA)的中心列表
       if (this.countryList.length > 0) {
         this.loadCenterList(0)
@@ -237,8 +222,6 @@ export default {
             ...allCenters
           ]
         }
-        
-        console.log('国家:', country.name, '中心列表:', this.centerList)
       } else {
         this.centerList = [{ id: 'NA', name: 'NA', type: 2, displayName: 'NA' }]
       }
@@ -279,8 +262,6 @@ export default {
       const column = e.detail.column // 哪一列变化了
       const value = e.detail.value   // 变化后的值
       
-      console.log('列变化:', column, '值:', value)
-      
       // 如果是第一列(国家)变化
       if (column === 0) {
         this.selectedCountryIndex = value
@@ -296,15 +277,6 @@ export default {
       const values = e.detail.value
       this.selectedCountryIndex = values[0]
       this.selectedCenterIndex = values[1]
-      
-      console.log('选择完成 - 国家索引:', this.selectedCountryIndex, '中心索引:', this.selectedCenterIndex)
-      
-      if (this.countryList[this.selectedCountryIndex]) {
-        console.log('选中国家:', this.countryList[this.selectedCountryIndex].name)
-      }
-      if (this.centerList[this.selectedCenterIndex]) {
-        console.log('选中中心:', this.centerList[this.selectedCenterIndex].name)
-      }
     },
     
     // 获取显示文本
@@ -324,7 +296,27 @@ export default {
     // 日期选择变化
     handleDateChange(e) {
       this.effectiveDate = e.detail.value
-      console.log('选择的生效日期:', this.effectiveDate)
+    },
+    
+    // 处理文档名称输入,禁止输入 "-" 字符
+    handleDocumentNameInput(e) {
+      const value = e.detail.value
+      
+      // 检测是否包含 "-" 字符
+      if (value.includes('-')) {
+        // 移除所有 "-" 字符
+        const filteredValue = value.replace(/-/g, '')
+        this.documentName = filteredValue
+        
+        // 提示用户
+        uni.showToast({
+          title: '文档名称不能包含"-"字符',
+          icon: 'none',
+          duration: 1500
+        })
+      } else {
+        this.documentName = value
+      }
     },
     
     // 格式化日期为 YYYYMMDD 格式(用于显示)
@@ -439,10 +431,6 @@ export default {
     handleCenterChange(e) {
       const index = parseInt(e.detail.value)
       this.selectedCenterIndex = index
-      
-      if (index >= 0 && this.centerList[index]) {
-        console.log('选中中心:', this.centerList[index].name)
-      }
     },
     
     // 提交
@@ -512,15 +500,9 @@ export default {
           files: fileBase64List
         }
         
-        console.log('========== 提交参数 ==========')
-        console.log('params:', params)
-        
         // 调用上传接口
         const response = await uploadScanFile(params)
         
-        console.log('========== 上传响应 ==========')
-        console.log('response:', response)
-        
         uni.hideLoading()
         
         if (response.code === 200) {
@@ -545,8 +527,7 @@ export default {
         
       } catch (error) {
         uni.hideLoading()
-        console.error('========== 提交失败 ==========')
-        console.error('错误信息:', error)
+        console.error('提交失败:', error)
         uni.showToast({
           title: error.message || '提交失败',
           icon: 'none'

+ 1 - 24
pages/scan/uploadEdit/index.vue

@@ -140,16 +140,9 @@ export default {
     }
   },
   onLoad(options) {
-    console.log('========== 编辑上传文件页面 ==========')
-    console.log('页面参数:', options)
-    
     this.folderId = parseInt(options.folderId) || 0
     this.projectId = parseInt(options.projectId) || 0
     this.folderPath = decodeURIComponent(options.folderPath || '')
-    
-    console.log('文件夹ID:', this.folderId)
-    console.log('项目ID:', this.projectId)
-    console.log('文件夹路径:', this.folderPath)
   },
   onReady() {
     // 获取系统信息
@@ -160,9 +153,6 @@ export default {
     const fileBase64List = getApp().globalData.scannedFileBase64List
     const pdfData = getApp().globalData.pdfData
     
-    console.log('fileBase64List:', fileBase64List)
-    console.log('pdfData:', pdfData)
-    
     if (fileBase64List && fileBase64List.length > 0) {
       // 如果有 pdfData(包含文件名和路径),使用它
       if (pdfData && pdfData.length > 0) {
@@ -179,7 +169,6 @@ export default {
           path: null
         }))
       }
-      console.log('文件列表:', this.fileList)
     } else {
       console.error('未找到文件列表')
       uni.showToast({
@@ -250,13 +239,6 @@ export default {
         return
       }
       
-      console.log('========== 开始上传 ==========')
-      console.log('文件夹ID:', this.folderId)
-      console.log('项目ID:', this.projectId)
-      console.log('文件名:', this.uploadForm.fileName)
-      console.log('备注:', this.uploadForm.note)
-      console.log('文件数量:', this.fileList.length)
-      
       // 准备上传数据(在关闭弹出框之前)
       const uploadData = {
         folderId: this.folderId,
@@ -312,9 +294,6 @@ export default {
     
     // 预览文件
     async handlePreview(file, index) {
-      console.log('预览文件:', file.name)
-      console.log('文件索引:', index)
-      
       if (!file.base64) {
         uni.showToast({
           title: '文件数据异常',
@@ -341,8 +320,6 @@ export default {
           'base64'
         )
         
-        console.log('临时文件路径:', filePath)
-        
         uni.hideLoading()
         
         // 使用 uni.openDocument 打开文件
@@ -351,7 +328,7 @@ export default {
           fileType: 'pdf',
           showMenu: true,
           success: () => {
-            console.log('文档打开成功')
+            // 文档打开成功
           },
           fail: (err) => {
             console.error('文档打开失败:', err)