浏览代码

添加语音识别界面

gushoubang 1 年之前
父节点
当前提交
f5102f4b29

文件差异内容过多而无法显示
+ 0 - 0
data/geojson/修正.sql


文件差异内容过多而无法显示
+ 5 - 0
data/geojson/修正id.geojson


+ 184 - 33
data/schedule/factor_info.json

@@ -25,7 +25,7 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -33,7 +33,7 @@
                 "id": "aac6e14452ee48f5883afc5c047ea235"
             },
             {
-                "bsm": "TB_CZKFBJ",
+                "bsm": "TB_CZKFBJ_ONE",
                 "name": "城镇开发边界内",
                 "level": 1,
                 "parent_id": "3ad55964b3744393b14bf0e7e647c280",
@@ -51,7 +51,7 @@
                     ],
                     "default": "contain",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -77,7 +77,7 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -103,7 +103,7 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -129,13 +129,39 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
                 "children": [],
                 "id": "664797aec53c4e8fac0462a19a15ea1b"
             },
+            {
+                "bsm": "TB_FJFW",
+                "name": "风景名胜区",
+                "level": 1,
+                "parent_id": "3ad55964b3744393b14bf0e7e647c280",
+                "condition_info": {
+                    "spatial_type": "intersect",
+                    "items": [
+                        {
+                            "key": "intersect",
+                            "name": "相交"
+                        },
+                        {
+                            "key": "not_intersect",
+                            "name": "不相交"
+                        }
+                    ],
+                    "default": "not_intersect",
+                    "hasValue": false,
+                    "defaultValue": "0",
+                    "unit": "米",
+                    "clip": true
+                },
+                "children": [],
+                "id": "664717aec53c4e8fac0462a19a15ea1b"
+            },
             {
                 "bsm": "",
                 "name": "规划分区",
@@ -155,7 +181,7 @@
                     ],
                     "default": "contain",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -165,6 +191,42 @@
         ],
         "id": "3ad55964b3744393b14bf0e7e647c280"
     },
+    {
+        "bsm": "",
+        "name": "权属因子",
+        "level": 0,
+        "parent_id": "",
+        "condition_info": "",
+        "children": [
+            {
+                "bsm": "TB_QS_GYUSEQ",
+                "name": "国有使用权",
+                "level": 1,
+                "parent_id": "3ae55964b3744393b14bf0e7e647c280",
+                "condition_info": {
+                    "spatial_type": "intersect",
+                    "items": [
+                        {
+                            "key": "intersect",
+                            "name": "相交"
+                        },
+                        {
+                            "key": "not_intersect",
+                            "name": "不相交"
+                        }
+                    ],
+                    "default": "not_intersect",
+                    "hasValue": false,
+                    "defaultValue": "0",
+                    "unit": "米",
+                    "clip": true
+                },
+                "children": [],
+                "id": "aac6e14452ee48f6883afc5c047ea235"
+            }
+        ],
+        "id": "3ae55964b3744393b14bf0e7e647c280"
+    },
     {
         "bsm": "",
         "name": "防控因子",
@@ -191,7 +253,7 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -217,13 +279,39 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
                 "children": [],
                 "id": "9c913fd9c7cd4b34af46d8bb44337e44"
             },
+            {
+                "bsm": "TB_SK",
+                "name": "水库",
+                "level": 1,
+                "parent_id": "f8b374cc0a9243fb94326991607c586d",
+                "condition_info": {
+                    "spatial_type": "intersect",
+                    "items": [
+                        {
+                            "key": "intersect",
+                            "name": "相交"
+                        },
+                        {
+                            "key": "not_intersect",
+                            "name": "不相交"
+                        }
+                    ],
+                    "default": "not_intersect",
+                    "hasValue": false,
+                    "defaultValue": "0",
+                    "unit": "米",
+                    "clip": true
+                },
+                "children": [],
+                "id": "9c913fd9c7cd4b36af46d8bb44337e44"
+            },
             {
                 "bsm": "TB_GYL",
                 "name": "公益林",
@@ -243,7 +331,7 @@
                     ],
                     "default": "not_intersect",
                     "hasValue": false,
-                    "defaultValue": 0,
+                    "defaultValue": "0",
                     "unit": "米",
                     "clip": true
                 },
@@ -261,7 +349,7 @@
         "condition_info": "",
         "children": [
             {
-                "bsm": "sy_dsm",
+                "bsm": "RASTER_SLOPE",
                 "name": "坡度",
                 "level": 1,
                 "parent_id": "9fe4202243cc45f7a627f04e702b5c38",
@@ -287,12 +375,49 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 25,
+                    "defaultValue": "25",
                     "unit": "度",
                     "clip": false
                 },
                 "children": [],
                 "id": "56523d852f004bdaa80945464bfcaaed"
+            },{
+                "bsm": "RASTER_DSM",
+                "name": "高程",
+                "level": 1,
+                "parent_id": "9fe4202243cc45f7a627f04e702b5c38",
+                "condition_info": {
+                    "spatial_type": "slop",
+                    "items": [
+                        {
+                            "key": "gt",
+                            "name": "大于"
+                        },
+                        {
+                            "key": "lt",
+                            "name": "小于"
+                        },
+                        {
+                            "key": "get",
+                            "name": "大于等于"
+                        },
+                        {
+                            "key": "let",
+                            "name": "小于等于"
+                        },
+                        {
+                            "key": "between",
+                            "name": "介于"
+                        }
+                    ],
+                    "default": "between",
+                    "hasValue": true,
+                    "defaultValue": "0,100",
+                    "unit": "米",
+                    "clip": false
+                },
+                "children": [],
+                "id": "56523d852f004cdaa80945464bfcaaed"
             }
         ],
         "id": "9fe4202243cc45f7a627f04e702b5c38"
@@ -331,7 +456,7 @@
                     ],
                     "default": "gt",
                     "hasValue": true,
-                    "defaultValue": 2000,
+                    "defaultValue": "2000",
                     "unit": "米",
                     "clip": true
                 },
@@ -365,7 +490,7 @@
                     ],
                     "default": "gt",
                     "hasValue": true,
-                    "defaultValue": 500,
+                    "defaultValue": "500",
                     "unit": "米",
                     "clip": true
                 },
@@ -399,7 +524,7 @@
                     ],
                     "default": "gt",
                     "hasValue": true,
-                    "defaultValue": 100,
+                    "defaultValue": "100",
                     "unit": "米",
                     "clip": true
                 },
@@ -433,7 +558,7 @@
                     ],
                     "default": "gt",
                     "hasValue": true,
-                    "defaultValue": 8.5,
+                    "defaultValue": "8.5",
                     "unit": "米",
                     "clip": true
                 },
@@ -467,12 +592,38 @@
                     ],
                     "default": "gt",
                     "hasValue": true,
-                    "defaultValue": 300,
+                    "defaultValue": "300",
                     "unit": "米",
                     "clip": true
                 },
                 "children": [],
                 "id": "9df88dfa1c97443e96c502fb32bee1fb"
+            },
+            {
+                "bsm": "TB_GS",
+                "name": "古树",
+                "level": 1,
+                "parent_id": "b7f957e32cab4f1a9832a27a502983cd",
+                "condition_info": {
+                    "spatial_type": "intersect",
+                    "items": [
+                        {
+                            "key": "intersect",
+                            "name": "相交"
+                        },
+                        {
+                            "key": "not_intersect",
+                            "name": "不相交"
+                        }
+                    ],
+                    "default": "not_intersect",
+                    "hasValue": false,
+                    "defaultValue": "0",
+                    "unit": "米",
+                    "clip": true
+                },
+                "children": [],
+                "id": "aac6e14453ee48f5883afc5c047ea235"
             }
         ],
         "id": "b7f957e32cab4f1a9832a27a502983cd"
@@ -510,7 +661,7 @@
                             ],
                             "default": "not_intersect",
                             "hasValue": true,
-                            "defaultValue": 0,
+                            "defaultValue": "0",
                             "unit": "米",
                             "clip": false
                         },
@@ -544,7 +695,7 @@
                             ],
                             "default": "gt",
                             "hasValue": true,
-                            "defaultValue": 100,
+                            "defaultValue": "100",
                             "unit": "米",
                             "clip": false
                         },
@@ -588,7 +739,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 500,
+                            "defaultValue": "500",
                             "unit": "米",
                             "clip": false
                         },
@@ -622,7 +773,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 500,
+                            "defaultValue": "500",
                             "unit": "米",
                             "clip": false
                         },
@@ -656,7 +807,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 200,
+                            "defaultValue": "200",
                             "unit": "米",
                             "clip": false
                         },
@@ -690,7 +841,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 500,
+                            "defaultValue": "500",
                             "unit": "米",
                             "clip": false
                         },
@@ -724,7 +875,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 500,
+                            "defaultValue": "500",
                             "unit": "米",
                             "clip": false
                         },
@@ -771,7 +922,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1500,
+                    "defaultValue": "1500",
                     "unit": "米",
                     "clip": false
                 },
@@ -805,7 +956,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },
@@ -839,7 +990,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },
@@ -873,7 +1024,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },
@@ -914,7 +1065,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 300,
+                            "defaultValue": "300",
                             "unit": "米",
                             "clip": false
                         },
@@ -948,7 +1099,7 @@
                             ],
                             "default": "lt",
                             "hasValue": true,
-                            "defaultValue": 500,
+                            "defaultValue": "500",
                             "unit": "米",
                             "clip": false
                         },
@@ -985,7 +1136,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },
@@ -1019,7 +1170,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },
@@ -1053,7 +1204,7 @@
                     ],
                     "default": "lt",
                     "hasValue": true,
-                    "defaultValue": 1000,
+                    "defaultValue": "1000",
                     "unit": "米",
                     "clip": false
                 },

+ 1 - 1
data/schedule/factor_temp/factor_all.json

@@ -26,7 +26,7 @@
         "id": "aac6e14452ee48f5883afc5c047ea235"
     },
     {
-        "bsm": "TB_CZKFBJ",
+        "bsm": "TB_CZKFBJ_ONE",
         "name": "城镇开发边界内",
         "level": 1,
         "parent_id": "3ad55964b3744393b14bf0e7e647c280",

+ 27 - 1
data/schedule/factor_temp/factor_gg.json

@@ -26,7 +26,7 @@
         "id": "aac6e14452ee48f5883afc5c047ea235"
     },
     {
-        "bsm": "TB_CZKFBJ",
+        "bsm": "TB_CZKFBJ_ONE",
         "name": "城镇开发边界内",
         "level": 1,
         "parent_id": "3ad55964b3744393b14bf0e7e647c280",
@@ -129,6 +129,32 @@
         "children": [],
         "id": "664797aec53c4e8fac0462a19a15ea1b"
     },
+    {
+        "bsm": "TB_QS_GYUSEQ",
+        "name": "国有使用权",
+        "level": 0,
+        "parent_id": "",
+        "condition_info": {
+            "spatial_type": "intersect",
+            "items": [
+                {
+                    "key": "intersect",
+                    "name": "相交"
+                },
+                {
+                    "key": "not_intersect",
+                    "name": "不相交"
+                }
+            ],
+            "default": "not_intersect",
+            "hasValue": false,
+            "defaultValue": 0,
+            "unit": "米",
+            "clip": true
+        },
+        "children": [],
+        "id": "aac6e14452ee48f6883afc5c047ea235"
+    },
     {
         "bsm": "sy_dsm",
         "name": "坡度",

+ 27 - 2
data/schedule/factor_temp/factor_residence.json

@@ -26,7 +26,7 @@
         "id": "aac6e14452ee48f5883afc5c047ea235"
     },
     {
-        "bsm": "TB_CZKFBJ",
+        "bsm": "TB_CZKFBJ_ONE",
         "name": "城镇开发边界内",
         "level": 1,
         "parent_id": "3ad55964b3744393b14bf0e7e647c280",
@@ -129,6 +129,32 @@
         "children": [],
         "id": "664797aec53c4e8fac0462a19a15ea1b"
     },
+    {
+        "bsm": "TB_QS_GYUSEQ",
+        "name": "国有使用权",
+        "level": 0,
+        "parent_id": "",
+        "condition_info": {
+            "spatial_type": "intersect",
+            "items": [
+                {
+                    "key": "intersect",
+                    "name": "相交"
+                },
+                {
+                    "key": "not_intersect",
+                    "name": "不相交"
+                }
+            ],
+            "default": "not_intersect",
+            "hasValue": false,
+            "defaultValue": 0,
+            "unit": "米",
+            "clip": true
+        },
+        "children": [],
+        "id": "aac6e14452ee48f6883afc5c047ea235"
+    },
     {
         "bsm": "sy_dsm",
         "name": "坡度",
@@ -333,7 +359,6 @@
         "children": [],
         "id": "9df88dfa1c97443e96c502fb32bee1fb"
     },
-
     {
         "bsm": "TB_WSGXGH",
         "name": "排水",

+ 27 - 1
data/schedule/factor_temp/factor_sy.json

@@ -26,7 +26,7 @@
         "id": "aac6e14452ee48f5883afc5c047ea235"
     },
     {
-        "bsm": "TB_CZKFBJ",
+        "bsm": "TB_CZKFBJ_ONE",
         "name": "城镇开发边界内",
         "level": 1,
         "parent_id": "3ad55964b3744393b14bf0e7e647c280",
@@ -129,6 +129,32 @@
         "children": [],
         "id": "664797aec53c4e8fac0462a19a15ea1b"
     },
+    {
+        "bsm": "TB_QS_GYUSEQ",
+        "name": "国有使用权",
+        "level": 0,
+        "parent_id": "",
+        "condition_info": {
+            "spatial_type": "intersect",
+            "items": [
+                {
+                    "key": "intersect",
+                    "name": "相交"
+                },
+                {
+                    "key": "not_intersect",
+                    "name": "不相交"
+                }
+            ],
+            "default": "not_intersect",
+            "hasValue": false,
+            "defaultValue": 0,
+            "unit": "米",
+            "clip": true
+        },
+        "children": [],
+        "id": "aac6e14452ee48f6883afc5c047ea235"
+    },
     {
         "bsm": "sy_dsm",
         "name": "坡度",

+ 44 - 0
index/geojson.js

@@ -0,0 +1,44 @@
+const fs = require('fs');
+const turf = require('@turf/turf');
+const wkx = require('wkx');
+const Database = require('./db');
+const moment = require('moment');
+
+const pool = new Database({
+    host: '192.168.100.30',
+    database: 'real3d',
+    user: 'postgres',
+    password: 'postgis',
+    port: 5432,
+});
+
+async function readFile(input, output) {
+    // 连接到数据库,设置模式
+    await pool.connect();
+    await pool.setSchema('vector');
+
+    const data = fs.readFileSync(input, 'utf8');
+    const geojson = JSON.parse(data);
+
+    let insertSqlStatements = '';
+
+    for (let i = 0; i < geojson.features.length; i++) {
+
+
+        let feature = geojson.features[i];
+
+        let ewktString = wkx.Geometry.parseGeoJSON(feature.geometry).toWkt();
+
+        const insertSql = `INSERT INTO vector."TB_CZKFBJ_ONE" (id,geom) VALUES (${i},public.st_geomfromewkt('${ewktString}'));`;
+
+        insertSqlStatements+=insertSql+`\n`
+
+        // console.log(insertSql);
+        // const res = await pool.query(insertSql);
+        // console.log(i);
+    }
+    fs.writeFileSync(output, insertSqlStatements, 'utf8');
+    console.log("1");
+}
+
+readFile("./data/geojson/修正id.geojson", "./data/geojson/修正.sql")

+ 41 - 1
index/schedule/factor_temp.js

@@ -67,4 +67,44 @@ async function importItems(insertItems, landTypeCode) {
     }
 }
 
-importFactor("./data/schedule/factor_temp/factor_sy.json", "09")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0701")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "070101")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "070102")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "070103")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "08")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0801")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0802")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0803")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080301")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080302")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0804")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080401")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080402")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080403")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080404")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080405")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0805")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080501")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080502")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0806")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080601")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080602")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080603")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0807")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080701")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080702")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080703")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "080704")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "09")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0901")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090101")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090102")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090103")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090104")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090105")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0902")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0903")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090301")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090302")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "0904")
+importFactor("./data/schedule/factor_temp/factor_residence.json", "090401")

+ 3 - 0
index/schedule_factor.js

@@ -57,6 +57,9 @@ async function importItems(insertItems, parentId) {
             status: 1,
             condition_info: JSON.stringify(element.condition_info),
         }
+        if ((insertObj.bsm === null || insertObj.bsm === ``) && element.children.length == 0) {
+            continue;
+        }
         // 生成数据库的插入语句
         const insertSql = `insert into t_fzss_fzxz_factor (id,bsm,name,level,parent_id,order_index,status,condition_info) values('${insertObj.id}','${insertObj.bsm}','${insertObj.name}',${insertObj.level},'${insertObj.parent_id}',${insertObj.order_index},${insertObj.status},'${insertObj.condition_info}')`;
         console.log(insertSql);

+ 81 - 0
view/voice/voice.html

@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>语音识别示例</title>
+</head>
+<body>
+
+<h2>语音识别示例</h2>
+<p>点击下方按钮开始语音输入:</p>
+
+<!-- 语音输入按钮 -->
+<button id="start-btn">开始语音输入</button>
+
+<!-- 显示识别结果 -->
+<p>识别结果: <span id="result"></span></p>
+
+<script>
+    // 检查浏览器是否支持SpeechRecognition
+    const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
+    if (!SpeechRecognition) {
+        alert('你的浏览器不支持语音识别功能,请使用支持的浏览器,例如Google Chrome。');
+    } else {
+        const recognition = new SpeechRecognition();
+        recognition.lang = 'zh-CN';  // 设置识别语言为中文
+        recognition.interimResults = false;  // 不返回临时结果
+        recognition.maxAlternatives = 1;  // 返回的识别结果数量
+
+        const startBtn = document.getElementById('start-btn');
+        const resultSpan = document.getElementById('result');
+
+        startBtn.onclick = () => {
+            recognition.start();  // 开始语音识别
+        };
+
+        recognition.onstart = () => {
+            console.log('开始语音识别...');
+            startBtn.disabled = true;
+            startBtn.textContent = '正在识别...';
+        };
+
+        recognition.onresult = (event) => {
+            const transcript = event.results[0][0].transcript;
+            console.log('识别结果:', transcript);
+            resultSpan.textContent = transcript;
+            sendToBackend(transcript);  // 将识别结果发送到后台
+        };
+
+        recognition.onerror = (event) => {
+            console.error('识别错误:', event.error);
+            alert('语音识别出错: ' + event.error);
+        };
+
+        recognition.onend = () => {
+            console.log('语音识别结束');
+            startBtn.disabled = false;
+            startBtn.textContent = '开始语音输入';
+        };
+
+        function sendToBackend(transcript) {
+            fetch('/api/your-endpoint', {
+                method: 'POST',
+                headers: {
+                    'Content-Type': 'application/json',
+                },
+                body: JSON.stringify({ transcript: transcript }),
+            })
+            .then(response => response.json())
+            .then(data => {
+                console.log('服务器响应:', data);
+            })
+            .catch((error) => {
+                console.error('发送到后台时发生错误:', error);
+            });
+        }
+    }
+</script>
+
+</body>
+</html>

部分文件因为文件数量过多而无法显示