Browse Source

add.api连接,由于token权限问题,除上传文件外五个接口无法访问

chen xueyi 2 years ago
parent
commit
22f8cefe48
7 changed files with 920 additions and 177 deletions
  1. 5 1
      components.d.ts
  2. 458 1
      package-lock.json
  3. 3 2
      package.json
  4. 220 95
      src/components/TCFinalList.vue
  5. 156 28
      src/components/TCList.vue
  6. 77 20
      src/components/Upload.vue
  7. 1 30
      src/pinia/docx.ts

+ 5 - 1
components.d.ts

@@ -7,11 +7,14 @@ export {}
 
 declare module 'vue' {
   export interface GlobalComponents {
+    ElAside: typeof import('element-plus/es')['ElAside']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElContainer: typeof import('element-plus/es')['ElContainer']
     ElFooter: typeof import('element-plus/es')['ElFooter']
+    ElForm: typeof import('element-plus/es')['ElForm']
+    ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElMain: typeof import('element-plus/es')['ElMain']
@@ -20,7 +23,8 @@ declare module 'vue' {
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTag: typeof import('element-plus/es')['ElTag']
-    ElUpload: typeof import('element-plus/es')['ElUpload']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     Layout: typeof import('./src/components/Layout.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']

+ 458 - 1
package-lock.json

@@ -8,11 +8,20 @@
       "name": "se-testcase-generation",
       "version": "0.0.0",
       "dependencies": {
+        "@element-plus/icons-vue": "^2.3.1",
+        "axios": "^1.6.8",
+        "dayjs": "^1.11.10",
+        "echarts": "^5.5.0",
         "element-plus": "^2.6.0",
+        "form-data": "^4.0.0",
+        "mammoth": "^1.7.1",
+        "pinia": "^2.1.7",
         "vue": "^3.4.19",
-        "vue-router": "^4.3.0"
+        "vue-router": "^4.3.0",
+        "xlsx": "^0.18.5"
       },
       "devDependencies": {
+        "@types/node": "^20.12.6",
         "@vitejs/plugin-vue": "^5.0.4",
         "typescript": "^5.2.2",
         "unplugin-auto-import": "^0.17.5",
@@ -707,6 +716,15 @@
         "@types/lodash": "*"
       }
     },
+    "node_modules/@types/node": {
+      "version": "20.12.6",
+      "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.12.6.tgz",
+      "integrity": "sha512-3KurE8taB8GCvZBPngVbp0lk5CKi8M9f9k1rsADh0Evdz5SzJ+Q+Hx9uHoFGsLnLnd1xmkDQr2hVhlA0Mn0lKQ==",
+      "dev": true,
+      "dependencies": {
+        "undici-types": "~5.26.4"
+      }
+    },
     "node_modules/@types/web-bluetooth": {
       "version": "0.0.16",
       "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
@@ -956,6 +974,14 @@
         }
       }
     },
+    "node_modules/@xmldom/xmldom": {
+      "version": "0.8.10",
+      "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
+      "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==",
+      "engines": {
+        "node": ">=10.0.0"
+      }
+    },
     "node_modules/acorn": {
       "version": "8.11.3",
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
@@ -968,6 +994,14 @@
         "node": ">=0.4.0"
       }
     },
+    "node_modules/adler-32": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmmirror.com/adler-32/-/adler-32-1.3.1.tgz",
+      "integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
     "node_modules/anymatch": {
       "version": "3.1.3",
       "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
@@ -981,17 +1015,45 @@
         "node": ">= 8"
       }
     },
+    "node_modules/argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
+      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "dependencies": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
     "node_modules/async-validator": {
       "version": "4.2.5",
       "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz",
       "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg=="
     },
+    "node_modules/asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
+      "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
+    },
+    "node_modules/axios": {
+      "version": "1.6.8",
+      "resolved": "https://registry.npmmirror.com/axios/-/axios-1.6.8.tgz",
+      "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
+      "dependencies": {
+        "follow-redirects": "^1.15.6",
+        "form-data": "^4.0.0",
+        "proxy-from-env": "^1.1.0"
+      }
+    },
     "node_modules/balanced-match": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
       "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
       "dev": true
     },
+    "node_modules/base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz",
+      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
+    },
     "node_modules/binary-extensions": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
@@ -1001,6 +1063,11 @@
         "node": ">=8"
       }
     },
+    "node_modules/bluebird": {
+      "version": "3.4.7",
+      "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.4.7.tgz",
+      "integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA=="
+    },
     "node_modules/brace-expansion": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
@@ -1022,6 +1089,18 @@
         "node": ">=8"
       }
     },
+    "node_modules/cfb": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmmirror.com/cfb/-/cfb-1.2.2.tgz",
+      "integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
+      "dependencies": {
+        "adler-32": "~1.3.0",
+        "crc-32": "~1.2.0"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
     "node_modules/chokidar": {
       "version": "3.6.0",
       "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
@@ -1046,12 +1125,47 @@
         "fsevents": "~2.3.2"
       }
     },
+    "node_modules/codepage": {
+      "version": "1.15.0",
+      "resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz",
+      "integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
+      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+      "dependencies": {
+        "delayed-stream": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
     "node_modules/computeds": {
       "version": "0.0.1",
       "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz",
       "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==",
       "dev": true
     },
+    "node_modules/core-util-is": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz",
+      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
+    },
+    "node_modules/crc-32": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmmirror.com/crc-32/-/crc-32-1.2.2.tgz",
+      "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
+      "bin": {
+        "crc32": "bin/crc32.njs"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
     "node_modules/csstype": {
       "version": "3.1.3",
       "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
@@ -1085,6 +1199,36 @@
         }
       }
     },
+    "node_modules/delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/dingbat-to-unicode": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz",
+      "integrity": "sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w=="
+    },
+    "node_modules/duck": {
+      "version": "0.1.12",
+      "resolved": "https://registry.npmmirror.com/duck/-/duck-0.1.12.tgz",
+      "integrity": "sha512-wkctla1O6VfP89gQ+J/yDesM0S7B7XLXjKGzXxMDVFg7uEn706niAtyYovKbyq1oT9YwDcly721/iUWoc8MVRg==",
+      "dependencies": {
+        "underscore": "^1.13.1"
+      }
+    },
+    "node_modules/echarts": {
+      "version": "5.5.0",
+      "resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.0.tgz",
+      "integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==",
+      "dependencies": {
+        "tslib": "2.3.0",
+        "zrender": "5.5.0"
+      }
+    },
     "node_modules/element-plus": {
       "version": "2.6.0",
       "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.6.0.tgz",
@@ -1218,6 +1362,40 @@
         "node": ">=8"
       }
     },
+    "node_modules/follow-redirects": {
+      "version": "1.15.6",
+      "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz",
+      "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
+      "engines": {
+        "node": ">=4.0"
+      },
+      "peerDependenciesMeta": {
+        "debug": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/form-data": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
+      "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/frac": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/frac/-/frac-1.1.2.tgz",
+      "integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
     "node_modules/fsevents": {
       "version": "2.3.3",
       "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@@ -1274,6 +1452,16 @@
         "he": "bin/he"
       }
     },
+    "node_modules/immediate": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmmirror.com/immediate/-/immediate-3.0.6.tgz",
+      "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ=="
+    },
+    "node_modules/inherits": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
+      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+    },
     "node_modules/is-binary-path": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
@@ -1328,12 +1516,36 @@
         "node": ">=0.12.0"
       }
     },
+    "node_modules/isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="
+    },
     "node_modules/jsonc-parser": {
       "version": "3.2.1",
       "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz",
       "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==",
       "dev": true
     },
+    "node_modules/jszip": {
+      "version": "3.10.1",
+      "resolved": "https://registry.npmmirror.com/jszip/-/jszip-3.10.1.tgz",
+      "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==",
+      "dependencies": {
+        "lie": "~3.3.0",
+        "pako": "~1.0.2",
+        "readable-stream": "~2.3.6",
+        "setimmediate": "^1.0.5"
+      }
+    },
+    "node_modules/lie": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmmirror.com/lie/-/lie-3.3.0.tgz",
+      "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
+      "dependencies": {
+        "immediate": "~3.0.5"
+      }
+    },
     "node_modules/local-pkg": {
       "version": "0.5.0",
       "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz",
@@ -1370,6 +1582,16 @@
         "lodash-es": "*"
       }
     },
+    "node_modules/lop": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmmirror.com/lop/-/lop-0.4.1.tgz",
+      "integrity": "sha512-9xyho9why2A2tzm5aIcMWKvzqKsnxrf9B5I+8O30olh6lQU8PH978LqZoI4++37RBgS1Em5i54v1TFs/3wnmXQ==",
+      "dependencies": {
+        "duck": "^0.1.12",
+        "option": "~0.2.1",
+        "underscore": "^1.13.1"
+      }
+    },
     "node_modules/lru-cache": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
@@ -1393,6 +1615,29 @@
         "node": ">=12"
       }
     },
+    "node_modules/mammoth": {
+      "version": "1.7.1",
+      "resolved": "https://registry.npmmirror.com/mammoth/-/mammoth-1.7.1.tgz",
+      "integrity": "sha512-ckxfvNH5sUaJh+SbYbxpvB7urZTGS02jA91rFCNiL928CgE9FXXMyXxcJBY0n+CpmKE/eWh7qaV0+v+Dbwun3Q==",
+      "dependencies": {
+        "@xmldom/xmldom": "^0.8.6",
+        "argparse": "~1.0.3",
+        "base64-js": "^1.5.1",
+        "bluebird": "~3.4.0",
+        "dingbat-to-unicode": "^1.0.1",
+        "jszip": "^3.7.1",
+        "lop": "^0.4.1",
+        "path-is-absolute": "^1.0.0",
+        "underscore": "^1.13.1",
+        "xmlbuilder": "^10.0.0"
+      },
+      "bin": {
+        "mammoth": "bin/mammoth"
+      },
+      "engines": {
+        "node": ">=12.0.0"
+      }
+    },
     "node_modules/memoize-one": {
       "version": "6.0.0",
       "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
@@ -1420,6 +1665,25 @@
         "node": ">=8.6"
       }
     },
+    "node_modules/mime-db": {
+      "version": "1.52.0",
+      "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
+      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mime-types": {
+      "version": "2.1.35",
+      "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
+      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+      "dependencies": {
+        "mime-db": "1.52.0"
+      },
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
     "node_modules/minimatch": {
       "version": "9.0.3",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
@@ -1490,12 +1754,30 @@
       "resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
       "integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
     },
+    "node_modules/option": {
+      "version": "0.2.4",
+      "resolved": "https://registry.npmmirror.com/option/-/option-0.2.4.tgz",
+      "integrity": "sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A=="
+    },
+    "node_modules/pako": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz",
+      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
+    },
     "node_modules/path-browserify": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
       "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
       "dev": true
     },
+    "node_modules/path-is-absolute": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+      "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
     "node_modules/path-parse": {
       "version": "1.0.7",
       "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
@@ -1525,6 +1807,50 @@
         "url": "https://github.com/sponsors/jonschlinkert"
       }
     },
+    "node_modules/pinia": {
+      "version": "2.1.7",
+      "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.1.7.tgz",
+      "integrity": "sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==",
+      "dependencies": {
+        "@vue/devtools-api": "^6.5.0",
+        "vue-demi": ">=0.14.5"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.4.0",
+        "typescript": ">=4.4.4",
+        "vue": "^2.6.14 || ^3.3.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        },
+        "typescript": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/pinia/node_modules/vue-demi": {
+      "version": "0.14.7",
+      "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",
+      "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
+      "hasInstallScript": true,
+      "bin": {
+        "vue-demi-fix": "bin/vue-demi-fix.js",
+        "vue-demi-switch": "bin/vue-demi-switch.js"
+      },
+      "engines": {
+        "node": ">=12"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.0.0-rc.1",
+        "vue": "^3.0.0-0 || ^2.6.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/pkg-types": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz",
@@ -1563,6 +1889,16 @@
         "node": "^10 || ^12 || >=14"
       }
     },
+    "node_modules/process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+    },
+    "node_modules/proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+    },
     "node_modules/queue-microtask": {
       "version": "1.2.3",
       "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -1583,6 +1919,20 @@
         }
       ]
     },
+    "node_modules/readable-stream": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmmirror.com/readable-stream/-/readable-stream-2.3.8.tgz",
+      "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+      "dependencies": {
+        "core-util-is": "~1.0.0",
+        "inherits": "~2.0.3",
+        "isarray": "~1.0.0",
+        "process-nextick-args": "~2.0.0",
+        "safe-buffer": "~5.1.1",
+        "string_decoder": "~1.1.1",
+        "util-deprecate": "~1.0.1"
+      }
+    },
     "node_modules/readdirp": {
       "version": "3.6.0",
       "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
@@ -1677,6 +2027,11 @@
         "queue-microtask": "^1.2.2"
       }
     },
+    "node_modules/safe-buffer": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.1.2.tgz",
+      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+    },
     "node_modules/scule": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz",
@@ -1698,6 +2053,11 @@
         "node": ">=10"
       }
     },
+    "node_modules/setimmediate": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz",
+      "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="
+    },
     "node_modules/source-map-js": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
@@ -1706,6 +2066,30 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
+      "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
+    },
+    "node_modules/ssf": {
+      "version": "0.11.2",
+      "resolved": "https://registry.npmmirror.com/ssf/-/ssf-0.11.2.tgz",
+      "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
+      "dependencies": {
+        "frac": "~1.1.2"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/string_decoder": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz",
+      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+      "dependencies": {
+        "safe-buffer": "~5.1.0"
+      }
+    },
     "node_modules/strip-literal": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz",
@@ -1742,6 +2126,11 @@
         "node": ">=8.0"
       }
     },
+    "node_modules/tslib": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
+      "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
+    },
     "node_modules/typescript": {
       "version": "5.3.3",
       "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
@@ -1761,6 +2150,17 @@
       "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==",
       "dev": true
     },
+    "node_modules/underscore": {
+      "version": "1.13.6",
+      "resolved": "https://registry.npmmirror.com/underscore/-/underscore-1.13.6.tgz",
+      "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A=="
+    },
+    "node_modules/undici-types": {
+      "version": "5.26.5",
+      "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
+      "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+      "dev": true
+    },
     "node_modules/unimport": {
       "version": "3.7.1",
       "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.7.1.tgz",
@@ -1886,6 +2286,11 @@
         "url": "https://github.com/sponsors/antfu"
       }
     },
+    "node_modules/util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
+    },
     "node_modules/vite": {
       "version": "5.1.5",
       "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz",
@@ -2017,11 +2422,63 @@
       "integrity": "sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==",
       "dev": true
     },
+    "node_modules/wmf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/wmf/-/wmf-1.0.2.tgz",
+      "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/word": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmmirror.com/word/-/word-0.3.0.tgz",
+      "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/xlsx": {
+      "version": "0.18.5",
+      "resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz",
+      "integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
+      "dependencies": {
+        "adler-32": "~1.3.0",
+        "cfb": "~1.2.1",
+        "codepage": "~1.15.0",
+        "crc-32": "~1.2.1",
+        "ssf": "~0.11.2",
+        "wmf": "~1.0.1",
+        "word": "~0.3.0"
+      },
+      "bin": {
+        "xlsx": "bin/xlsx.njs"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/xmlbuilder": {
+      "version": "10.1.1",
+      "resolved": "https://registry.npmmirror.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz",
+      "integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==",
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
     "node_modules/yallist": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
       "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
       "dev": true
+    },
+    "node_modules/zrender": {
+      "version": "5.5.0",
+      "resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.5.0.tgz",
+      "integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==",
+      "dependencies": {
+        "tslib": "2.3.0"
+      }
     }
   }
 }

+ 3 - 2
package.json

@@ -10,9 +10,11 @@
   },
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
+    "axios": "^1.6.8",
     "dayjs": "^1.11.10",
     "echarts": "^5.5.0",
     "element-plus": "^2.6.0",
+    "form-data": "^4.0.0",
     "mammoth": "^1.7.1",
     "pinia": "^2.1.7",
     "vue": "^3.4.19",
@@ -20,6 +22,7 @@
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
+    "@types/node": "^20.12.6",
     "@vitejs/plugin-vue": "^5.0.4",
     "typescript": "^5.2.2",
     "unplugin-auto-import": "^0.17.5",
@@ -28,5 +31,3 @@
     "vue-tsc": "^1.8.27"
   }
 }
-
-

+ 220 - 95
src/components/TCFinalList.vue

@@ -1,24 +1,4 @@
-<template>
-  <el-container>
-    <el-main>
-      <el-card class="card">
-        <el-table :data="tableData" border height="300" style="width: 100%">
-          <el-table-column prop="编号" label="编号" width="100" />
-          <el-table-column prop="用例标题" label="用例标题" width="180" />
-          <el-table-column prop="前置条件" label="前置条件" width="180" />
-          <el-table-column prop="步骤描述" label="步骤描述" width="180" />
-          <el-table-column prop="预期结果" label="预期结果" width="180" />
-        </el-table>
-      </el-card>
-    </el-main>
-    <el-footer>
-      <div class="button-container">
-        <el-button type="primary" class="custom-button" @click="gotoLastPage">上一步</el-button>
-        <el-button type="primary" class="custom-button" @click="exportTestCase">导出</el-button>
-      </div>
-    </el-footer>
-  </el-container>
-</template>
+
 
 <style scoped>
 .button-container {
@@ -36,78 +16,139 @@
 <script lang="ts" setup>
 import * as XLSX from 'xlsx'
 import { useRouter } from 'vue-router';
-const tableData = [
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-  {
-    编号: '2016',
-    用例标题: 'Tom',
-    前置条件: 'No. 189, Grove St, Los Angeles',
-    步骤描述: 'aaaaaa',
-    预期结果: 'aaaa',
-  },
-]
+import { useDocxStore } from '../pinia/docx'
+import {ref} from "vue";
+import axios, {AxiosResponse, AxiosError, AxiosRequestConfig} from 'axios';
+
+const useStore = useDocxStore()
+const token = 'sk-rZoIsfohUX3K0TbSV+GXetuk7T4OwG3d8LyHFYxsutg='
+type docxList = {
+  docxName: String,
+  docxMessageList?: Array<object>
+}
+const itemIndex = ref(0)
+const docxList = ref<docxList[]>([])
+docxList.value = useStore.DocxList
+let tableData
+//生成完整测试用例
+const docxMessage = (index: number) => {
+  itemIndex.value = index
+
+  interface InputVariable {
+    name: string;
+    value: string;
+  }
+
+  const data: {
+    inputVariables: InputVariable[];
+    volumeName: string;
+  } = {
+    inputVariables: [
+      {
+        name: "conversationId",
+        value: "7",
+      },
+    ],
+    volumeName: "文字测试用例生成",
+  };
+
+  const fullConfig: AxiosRequestConfig = {
+    method: 'post',
+    url: 'http://47.120.7.208:8000/api/executions?versionId=21&isAsync=false',
+    headers: {
+      'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+      'Content-Type': 'application/json',
+      'Authorization': `Bearer ${token}`,
+    },
+    data: data,
+  };
+
+  axios(fullConfig)
+      .then((response: AxiosResponse<any>) => {
+        console.log(JSON.stringify(response.data));
+
+        //Todo:更新table
+        tableData = JSON.stringify(response.data)
+      })
+      .catch((error: AxiosError<any>) => {
+        console.log(error);
+      });
+
+
+}
+
+// const tableData = [
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+//   {
+//     编号: '2016',
+//     用例标题: 'Tom',
+//     前置条件: 'No. 189, Grove St, Los Angeles',
+//     步骤描述: 'aaaaaa',
+//     预期结果: 'aaaa',
+//   },
+// ]
 const router = useRouter();
 const gotoLastPage = () => {
   router.push('/testcaseList');
@@ -115,8 +156,6 @@ const gotoLastPage = () => {
 
 const exportTestCase = async () => {
 
-
-
   // 导出 工作簿
   // 创建一个新的工作簿
    const wb = XLSX.utils.book_new();
@@ -138,3 +177,89 @@ const exportTestCase = async () => {
         document.body.removeChild(link);
 }
 </script>
+
+<template>
+  <el-container>
+    <el-aside width="200px" style="overflow: hidden; margin-right:20px;">
+      <el-card style="width:100%; border:0;" body-style="padding:0; margin:0;">
+        <template #header>
+          <div class="card-header">
+            <span>文件名</span>
+          </div>
+        </template>
+
+        <div class="card-item" v-for="(item, index) in docxList" :key="index" @click="docxMessage(index)"
+             :class="{ active: index === itemIndex }">
+          {{ item.docxName }}
+        </div>
+
+      </el-card>
+    </el-aside>
+    <el-container>
+      <el-main>
+        <el-card class="card">
+          <el-table :data="tableData" border height="300" style="width: 100%">
+            <el-table-column prop="编号" label="编号" width="100" />
+            <el-table-column prop="用例标题" label="用例标题" width="180" />
+            <el-table-column prop="前置条件" label="前置条件" width="180" />
+            <el-table-column prop="步骤描述" label="步骤描述" width="180" />
+            <el-table-column prop="预期结果" label="预期结果" width="180" />
+          </el-table>
+        </el-card>
+      </el-main>
+      <el-footer>
+        <div class="button-container">
+          <el-button type="primary" class="custom-button" @click="gotoLastPage">上一步</el-button>
+          <el-button type="primary" class="custom-button" @click="exportTestCase">导出</el-button>
+        </div>
+      </el-footer>
+    </el-container>
+  </el-container>
+</template>
+
+<style scoped>
+
+.card {
+  margin: auto;
+}
+
+
+.card-item {
+  margin: 0;
+  padding: 0;
+  width: 100%;
+  height: 10vh;
+  line-height: 10vh;
+  text-align: center;
+  background-color: #fcfcfc;
+  cursor: pointer;
+}
+
+
+.active {
+  background-color: #409eff;
+  color: #fff;
+}
+
+/* 启用滚动条样式化,需要在浏览器设置中启用 */
+::-webkit-scrollbar {
+  width: 10px; /* 滚动条的宽度 */
+}
+
+/* 滚动条轨道 */
+::-webkit-scrollbar-track {
+  background: #f0f0f0; /* 滚动条轨道背景颜色 */
+}
+
+/* 滚动条滑块 */
+::-webkit-scrollbar-thumb {
+  background: #696969; /* 滚动条滑块颜色 */
+  border-radius: 10px; /* 滑块边角弧度 */
+}
+
+/* 滑块悬停状态 */
+::-webkit-scrollbar-thumb:hover {
+  background: #555; /* 鼠标悬停在滑块上时的颜色 */
+}
+
+</style>

+ 156 - 28
src/components/TCList.vue

@@ -2,16 +2,17 @@
 import { ref,onMounted} from "vue";
 import { useRouter } from 'vue-router';
 import { useDocxStore } from '../pinia/docx'
-
+import axios, {AxiosResponse, AxiosError, AxiosRequestConfig} from 'axios';
 import { ElMessage } from 'element-plus'
 import * as echarts from 'echarts';
 const useStore = useDocxStore()
-
+const token = 'sk-rZoIsfohUX3K0TbSV+GXetuk7T4OwG3d8LyHFYxsutg='
 
 onMounted(()=>{
   Showecharts()
 })
 
+
 type docxList = {
   docxName: String,
   docxMessageList?: Array<object>
@@ -20,14 +21,15 @@ const docxList = ref<docxList[]>([])
 docxList.value = useStore.DocxList
 const itemIndex = ref(0)
 const textarea = ref('')
-const titles = ref('')
- type ActionList = {
+
+
+//历史操作记录
+type ActionList = {
    docxName: String;
    description: string;
  };
 
-//历史操作记录,还要调整,最好能做到单个文件展示,我再调调
-var actionList = ref<ActionList[]>([]);
+let actionList = ref<ActionList[]>([]);
 actionList.value = [
     {
       docxName: "文件名",
@@ -36,19 +38,17 @@ actionList.value = [
 }
 ];
 
+
+interface InputVariable {
+  name: string;
+  value: string;
+}
+
 const testCase = ref<any>([]);
 // 默认展示第一个列表
 testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
 
-const handleImproveButton = (p: { row: any }) => {
-  console.log(p.row);
-  actionList.value.push({
-    docxName: "文件名",
-    description: "细化用例",
-
-  })
-};
-
+//关于路由
 const router = useRouter();
 const gotoLastPage = () => {
   router.push('/upload');
@@ -62,32 +62,159 @@ const docxMessage = (index: number) => {
   testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
 }
 
+//细化用例
+const handleImproveButton = (p: { row: any }) => {
+  console.log(p.row);
+  let improve_id = p.row.id;
+
+  //调接口
+
+  const data: {
+    inputVariables: InputVariable[];
+    volumeName: string;
+  } = {
+    inputVariables: [
+      {
+        name: "testCaseId",
+        value: improve_id,
+      },
+      {
+        name: "conversationId",
+        value: "7",
+      },
+    ],
+    volumeName: "文字测试用例生成",
+  };
 
-// 删除列表
+  const config: AxiosRequestConfig = {
+    method: 'post',
+    url: 'http://47.120.7.208:8000/api/executions?versionId=13&isAsync=false',
+    headers: {
+      'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+      'Content-Type': 'application/json',
+      'Authorization': `Bearer ${token}`,
+    },
+    data: data,
+  };
+
+  axios(config)
+      .then((response: AxiosResponse<any>) => {
+        console.log(JSON.stringify(response.data));
+      })
+      .catch((error: AxiosError<any>) => {
+        console.log(error);
+      });
+  //Todo:更新用例列表
+
+  //更新操作记录
+  actionList.value.push({
+    docxName: useStore.DocxList[itemIndex.value].docxName,
+    description: "细化用例"+improve_id,
+  })
+};
+
+// 删除用例
 const deteleList = (scope: any) => {
   const obj: any = {
     id: scope.row.id,
     index: itemIndex.value
   }
+  let delete_id = scope.row.id;
+  const data: {
+    inputVariables: InputVariable[];
+    volumeName: string;
+  } = {
+    inputVariables: [
+      {
+        name: "testCaseId",
+        value: delete_id,
+      },
+      {
+        name: "conversationId",
+        value: "7",
+      },
+    ],
+    volumeName: "文字测试用例生成",
+  };
+
+  const deleteConfig: AxiosRequestConfig = {
+    method: 'post',
+    url: 'http://47.120.7.208:8000/api/executions?versionId=14&isAsync=false',
+    headers: {
+      'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+      'Content-Type': 'application/json',
+      'Authorization': `Bearer ${token}`,
+    },
+    data: data,
+  };
+
+  axios(deleteConfig)
+      .then((response: AxiosResponse<any>) => {
+        console.log(JSON.stringify(response.data));
+      })
+      .catch((error: AxiosError<any>) => {
+        console.log(error);
+      });
+  //更新用例列表
   useStore.DeteleDocxList(obj)
+  //更新操作列表
   actionList.value.push({
-    docxName: "文件名",
-    description: "删除用例",
+    docxName: useStore.DocxList[itemIndex.value].docxName,
+    description: "删除用例"+delete_id,
 
   })
   testCase.value = useStore.DocxList[itemIndex.value].docxMessageList
 }
 
+//添加用例
 const addDocxList = () => {
   if (textarea.value !== '') {
-    let ids: any = useStore.DocxList[itemIndex.value].docxMessageList?.length
-    useStore.DocxList[itemIndex.value].docxMessageList?.unshift({
-      id: ids + 1,
+    //调用接口
+    const data: {
+      inputVariables: InputVariable[];
+      volumeName: string;
+    } = {
+      inputVariables: [
+        {
+          name: "testCaseToAdd",
+          value: textarea.value,
+        },
+        {
+          name: "conversationId",
+          value: "7",
+        },
+      ],
+      volumeName: "文字测试用例生成",
+    };
+
+    const addConfig: AxiosRequestConfig = {
+      method: 'post',
+      url: 'http://47.120.7.208:8000/api/executions?versionId=15&isAsync=false',
+      headers: {
+        'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+        'Content-Type': 'application/json',
+        'Authorization': `Bearer ${token}`,
+      },
+      data: data,
+    };
+
+    axios(addConfig)
+        .then((response: AxiosResponse<any>) => {
+          console.log(JSON.stringify(response.data));
+        })
+        .catch((error: AxiosError<any>) => {
+          console.log(error);
+        });
+    //更新用力列表
+    let new_id: any = useStore.DocxList[itemIndex.value].docxMessageList?.length+1
+    useStore.DocxList[itemIndex.value].docxMessageList?.push({
+      id: new_id,
       description: textarea.value
     })
+    //更新操作列表
     actionList.value.push({
-      docxName: "文件名",
-      description: "新增用例",
+      docxName: useStore.DocxList[itemIndex.value].docxName,
+      description: "新增用例"+new_id,
 
     })
     ElMessage({
@@ -173,9 +300,9 @@ function Showecharts() {
           :class="{ active: index == itemIndex }">
           {{ item.docxName }}
         </div>
-
       </el-card>
     </el-aside>
+
     <el-container>
       <el-main style="display:flex; overflow: hidden; margin:0; padding:0;">
         <div class="root">
@@ -221,8 +348,8 @@ function Showecharts() {
           <div class="header-Box">
             <el-timeline>
               <el-timeline-item v-for="(activity, index) in actionList" :key="index" :timestamp="activity.time"
-                size="large">
-                {{ activity.description }}
+                size=large>
+                {{ activity.docxName+"+"+activity.description }}
               </el-timeline-item>
             </el-timeline>
           </div>
@@ -342,13 +469,14 @@ function Showecharts() {
 }
 
 .timeline {
-  width: 15vw;
+  width: 30vw;
   height: 100vh;
+  padding-top: 2%;
 }
 
 .header-Box {
   width: 100%;
-  height: 50vh;
+  height: 45vh;
   overflow: hidden;
   overflow-y: auto;
 }

+ 77 - 20
src/components/Upload.vue

@@ -1,3 +1,4 @@
+
 <template>
   <div class="common-layout">
     <transition name="el-fade-in-linear">
@@ -48,16 +49,25 @@ import { useRouter } from 'vue-router';
 import { ref } from 'vue'
 import { useDocxStore } from '../pinia/docx'
 import { ElMessage } from 'element-plus';
+import axios, {AxiosError, AxiosRequestConfig, AxiosResponse} from "axios";
+import FormData from 'form-data';
+import * as fs from 'fs';
 const useStore = useDocxStore()
 // const parsedContent = ref('')
 const router = useRouter()
 const uploadInput = ref<HTMLDivElement | null>(null);
 const showBox = ref(false)
-
+const token = 'sk-rZoIsfohUX3K0TbSV+GXetuk7T4OwG3d8LyHFYxsutg='
 // const form = reactive({
 //   title: '',
 //   message: ''
 // })
+
+interface InputVariable {
+  name: string;
+  value: string;
+}
+
 const dealfilechange = async (event: Event) => {
   const target = event.target as HTMLInputElement;
   const files = target.files;
@@ -69,34 +79,81 @@ const dealfilechange = async (event: Event) => {
       if (fileExtension === 'docx') {
         console.log(file.name);
         useStore.DocxList.unshift({ docxName: file.name, docxMessageList: [], time: dayjs().format('YYYY-MM-DD HH:mm:ss') })
+        //调用上传接口
+        const data = new FormData()
+        data.append('file',file)
+
+        const uploadConfig: AxiosRequestConfig = {
+          method: 'put',
+          url: 'http://47.120.7.208:8000/api/volumes/2/files?path=.',
+          headers: {
+            'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+            ...data.getHeaders ? data.getHeaders() : { 'Content-Type': 'multipart/form-data' },
+            'Authorization': `Bearer ${token}`,
+          },
+          data: data,
+        };
+
+        axios(uploadConfig)
+            .then((uploadResponse: AxiosResponse<any>) => {
+              let file_id = uploadResponse.data.id;
+              console.log(file_id);
+              console.log(JSON.stringify(uploadResponse.data));
+
+              // 上传文件成功,现在可以调用处理接口
+              const data2: {
+                inputVariables: InputVariable[];
+                volumeName: string;
+              } = {
+                inputVariables: [
+                  {
+                    name: "filePath",
+                    value: file.name,
+                  },
+                  {
+                    name: "conversationId",
+                    value: "7",
+                  },
+                ],
+                volumeName: "文字测试用例生成",
+              };
+
+              const processConfig: axios.AxiosRequestConfig = {
+                method: 'post',
+                url: 'http://47.120.7.208:8000/api/executions?versionId=12&isAsync=false',
+                headers: {
+                  'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
+                  'Content-Type': 'application/json',
+                  'Authorization': `Bearer ${token}`,
+                },
+                data: data2,
+              };
+
+              axios(processConfig)
+                  .then((response) => {
+                    console.log(JSON.stringify(response.data));
+                  })
+                  .catch((error) => {
+                    console.log(error);
+                  });
+              //向docxMessageList中添加同理列表
+
+            })
+
+
         ElMessage({
           message: '上传文件成功',
           type: 'success'
-        })
+        });
+
+
       } else {
         ElMessage({
           message: '请上传.docx文件',
           type: 'warning'
         })
       }
-      // if (fileExtension === 'docx') {
-      //   const reader = new FileReader();
-      //   reader.onload = (e: ProgressEvent<FileReader>) => {
-      //     const arrayBuffer = e.target?.result as ArrayBuffer;
-      //     mammoth.convertToHtml({ arrayBuffer: arrayBuffer })
-      //       .then((result) => {
-      //         console.log(result.value);
-      //         parsedContent.value = result.value; // 得到的 HTML 内容
-      //         console.log(result.messages); // 解析过程中的消息
-      //       })
-      //       .catch((error) => {
-      //         console.error('解析错误:', error);
-      //       });
-      //   };
-      //   reader.readAsArrayBuffer(file);
-      // } else {
-      //   alert('请选择一个 .docx 文件');
-      // }
+
     }
   } else {
     ElMessage({

+ 1 - 30
src/pinia/docx.ts

@@ -13,36 +13,7 @@ interface obj {
     index: Number
 }
 export const useDocxStore = defineStore('docx', () => {
-    const DocxList = ref<DocxList[]>([{
-        docxName: '文件名1',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    }, {
-        docxName: '文件名2',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    }, {
-        docxName: '文件名3',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    }, {
-        docxName: '文件名4',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    }, {
-        docxName: '文件名5',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    },
-    {
-        docxName: '文件名6',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    },{
-        docxName: '文件名7',
-        time:dayjs().format('YYYY-MM-DD HH:mm:ss'),
-        docxMessageList: []
-    }])
+    const DocxList = ref<DocxList[]>([])
 
 
     const DeteleDocxList = (obj: obj) => {