chd hai 5 meses
pai
achega
734a661bf5
Modificáronse 2 ficheiros con 5 adicións e 9 borrados
  1. 5 7
      src/entrypoints/content.js
  2. 0 2
      src/utils/contentUtils.js

+ 5 - 7
src/entrypoints/content.js

@@ -145,10 +145,11 @@ export default defineContentScript({
             item.type === 'number'
           ) {
             if (!input) {
-              if (item.label) {
+              if (item.item) {
                 const label = [...form.getElementsByTagName('label')].find(
-                  (label) => label.innerText.includes(item.label)
+                  (label) => label.innerText.includes(item.item)
                 )
+                console.log(item,label)
                 if (label) {
                   const input = findLabelForInput(label)
                   if (input) {
@@ -158,16 +159,13 @@ export default defineContentScript({
               }
             }
             if (input) {
-              console.log(input, excelDataA[item.excelColumn]);
-              
               await simulateUserInput(input, excelDataA[item.excelColumn])
-              input.value = '32321312'
             }
           }
           if (item.type === 'radio' || item.type === 'checkbox') {
-            if (item.label) {
+            if (item.item) {
               const label = [...form.getElementsByTagName('label')].find(
-                (label) => label.innerText.includes(item.label)
+                (label) => label.innerText.includes(item.item)
               )
               if (label) {
                 const span = findLabelForSpan(label)

+ 0 - 2
src/utils/contentUtils.js

@@ -133,8 +133,6 @@ export async  function simulateCompleteUserAction  (
     }
 }
 export async function simulateUserInput(element, value) {
-    console.log(35656);
-    
     // 设置值
     if (element.tagName.toLowerCase() === 'textarea') {
         element.focus()