From e13f2f0963a1b84271fe8ca767654614186b606c Mon Sep 17 00:00:00 2001 From: YM <479443481@qq.com> Date: 星期四, 13 六月 2024 18:10:49 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TextbookReader --- src/views/index.vue | 2 src/assets/main.css | 1 src/assets/images/operation/list-search.svg | 1 src/views/components/dictionary.vue | 176 + src/plugin/axios/index.ts | 3 src/views/components/newWord.vue | 368 +++ src/qiankunState/state.ts | 4 src/assets/images/operation/delete1.svg | 1 src/assets/images/operation/tag-w.svg | 1 src/views/readerPages/mobileHome.vue | 2127 +++++++++++++++++++++ src/main.ts | 35 /dev/null | 939 --------- src/views/login.vue | 83 src/views/readerPages/webHome.vue | 2068 +++++++++++++------- src/assets/base.css | 8 src/assets/js/config.ts | 2 src/views/readerPages/home.vue | 30 package.json | 2 src/assets/images/operation/sound.png | 0 src/child.ts | 41 src/views/bookshelfList/list.vue | 2 src/router/index.ts | 20 src/App.vue | 25 src/assets/images/menu/allSearch.svg | 1 24 files changed, 4,142 insertions(+), 1,798 deletions(-) diff --git a/package.json b/package.json index 7e42234..8962b88 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "publish": [ { "provider": "generic", - "url": "http://182.92.203.7:3007/" + "url": "https://jsek.bnuic.com/" } ], "releaseInfo": { diff --git a/public/resource.json b/public/resource.json deleted file mode 100644 index a123547..0000000 --- a/public/resource.json +++ /dev/null @@ -1,939 +0,0 @@ -[ - { - "index": 1, - "resourceName": "1-1銆丮ODULE 1锛坙esson one锛�", - "md5": "3B2BB09BF969690D2914A5DF9F56E964", - "resourceType": "PPT", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson one ", - "pagination": 18, - "isTeacherResource": "鏄�" - }, - { - "index": 2, - "resourceName": "1-1銆丮ODULE 1锛坙esson one 锛�", - "md5": "3B2BB09BF969690D2914A5DF9F56E964", - "resourceType": "PPT", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson one ", - "pagination": 18, - "isTeacherResource": "鏄�" - }, - { - "index": 3, - "resourceName": "01-Module one Lesson 1-Listening", - "md5": "422139A2EF66EA888C5ED1D550AE23E0", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson one ", - "pagination": 13, - "isTeacherResource": "鍚�" - }, - { - "index": 4, - "resourceName": "02-Module one Lesson 1-Reading", - "md5": "3F442B682D84C8AB06C800B29D734920", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson one ", - "pagination": 13, - "isTeacherResource": "鍚�" - }, - { - "index": 5, - "resourceName": "03-Module one Lesson 1-Reading-Words&Expressions", - "md5": "E8719EC88026BCFB11D292AA999F6D3D", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson one ", - "pagination": 14, - "isTeacherResource": "鍚�" - }, - { - "index": 6, - "resourceName": "1-2銆丮ODULE 1锛坙esson two锛�", - "md5": "CE90404D3022BEC7678CAA42F55B53F9", - "resourceType": "PPT", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson two", - "pagination": 23, - "isTeacherResource": "鏄�" - }, - { - "index": 7, - "resourceName": "04-Module one Lesson 2-Reading ", - "md5": "43AAC2E2725009F975A611DDB5AF41A4", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson two", - "pagination": 20, - "isTeacherResource": "鍚�" - }, - { - "index": 8, - "resourceName": "05-Module one Lesson 2-Reading-Words&Expressions", - "md5": "9B2DC045F8CD6697F14784714D472DBB", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson two", - "pagination": 21, - "isTeacherResource": "鍚�" - }, - { - "index": 9, - "resourceName": "1-3銆丮ODULE 1锛坙esson three锛�", - "md5": "A598DD3E100CD2A0A100AF1C2AC53F15", - "resourceType": "PPT", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson three", - "pagination": 28, - "isTeacherResource": "鏄�" - }, - { - "index": 10, - "resourceName": "06-Module one Lesson 3-Listening-1", - "md5": "D3DD18BEA1DCB8CF3772E9D1DCC8B893", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson three", - "pagination": 14, - "isTeacherResource": "鍚�" - }, - { - "index": 11, - "resourceName": "07-Module one Lesson 3-Listening-2", - "md5": "F7026C57657D78745D38676F7854E9D7", - "resourceType": "闊抽", - "chapterNum": 5, - "chapter": "MODULE1 CHINA,A WONDERLAND", - "section": "lesson three", - "pagination": 14, - "isTeacherResource": "鍚�" - }, - { - "index": 12, - "resourceName": "2-1銆丮ODULE 2锛坙esson one 锛�", - "md5": "962F7ABE3FEF61D27C6ADB2C68730092", - "resourceType": "PPT", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson one ", - "pagination": 37, - "isTeacherResource": "鏄�" - }, - { - "index": 13, - "resourceName": "08-Module Two Lesson 1-Listening ", - "md5": "D96D6F8082786B037A2B1842860BC0C4 ", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson one ", - "pagination": 31, - "isTeacherResource": "鍚�" - }, - { - "index": 14, - "resourceName": "09-Module Two Lesson 1-Reading", - "md5": "E51F6E052B08F00B19819E4D5504219F", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson one ", - "pagination": 31, - "isTeacherResource": "鍚�" - }, - { - "index": 15, - "resourceName": "10-Module Two Lesson 1-Reading-Words&Expressions ", - "md5": "1456A70576E21C0E8C1497916A6E8D57", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson one ", - "pagination": 32, - "isTeacherResource": "鍚�" - }, - { - "index": 16, - "resourceName": "2-2銆丮ODULE 2锛坙esson two锛�", - "md5": "7FDFE8A1F0C925A90D9ED370C4417C72", - "resourceType": "PPT", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson two", - "pagination": 42, - "isTeacherResource": "鏄�" - }, - { - "index": 17, - "resourceName": "11-Module Two Lesson 2-Warm-up", - "md5": "7301D06AC2208C93FE05A9952C8858E7", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson two", - "pagination": 37, - "isTeacherResource": "鍚�" - }, - { - "index": 18, - "resourceName": "12-Module Two Lesson 2-Reading ", - "md5": "85198824B16CA185AFF073275FC394BE", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson two", - "pagination": 38, - "isTeacherResource": "鍚�" - }, - { - "index": 19, - "resourceName": "13-Module Two Lesson 2-Reading-Words&Expressions", - "md5": "148CD1F30A60DAF665B4E4678755D767", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson two", - "pagination": 39, - "isTeacherResource": "鍚�" - }, - { - "index": 20, - "resourceName": "2-3銆丮ODULE 2锛坙esson three锛�", - "md5": "5CA19662B7E5F39AF73B907F5C4513F8", - "resourceType": "PPT", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson three", - "pagination": 47, - "isTeacherResource": "鏄�" - }, - { - "index": 21, - "resourceName": "14-Module Two Lesson 3-Listening 1", - "md5": "7CE34F30D8440BAE15D4A76479834434", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson three", - "pagination": 33, - "isTeacherResource": "鍚�" - }, - { - "index": 22, - "resourceName": "15-Module Two Lesson 3-Listening 2", - "md5": "D5080B2EEBFE29233A6DB282B1A28D6C", - "resourceType": "闊抽", - "chapterNum": 6, - "chapter": "MODULE2 GOING GLOBAL", - "section": "lesson three", - "pagination": 33, - "isTeacherResource": "鍚�" - }, - { - "index": 23, - "resourceName": "3-1銆丮ODULE 3锛坙esson one 锛�", - "md5": "91ED78195E3A140520285007E8B07496", - "resourceType": "PPT", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson one ", - "pagination": 55, - "isTeacherResource": "鏄�" - }, - { - "index": 24, - "resourceName": "16-Module Three Lesson 1-Listening", - "md5": "BE415E5F4ACF889844A235A19832EB42", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson one ", - "pagination": 49, - "isTeacherResource": "鍚�" - }, - { - "index": 25, - "resourceName": "17-Module Three Lesson 1-Reading", - "md5": "CAA563DB7727326EF9469C71E198DC20", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson one ", - "pagination": 50, - "isTeacherResource": "鍚�" - }, - { - "index": 26, - "resourceName": "18-Module Three Lesson 1-Reading-Words&Expressions ", - "md5": "E18F33A25DEB9B77CCBA5FC2977E3385", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson one ", - "pagination": 51, - "isTeacherResource": "鍚�" - }, - { - "index": 27, - "resourceName": "3-2銆丮ODULE 3锛坙esson two 锛�", - "md5": "104F0A7AC131026929589FBEBC29BAFB", - "resourceType": "PPT", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson two", - "pagination": 61, - "isTeacherResource": "鏄�" - }, - { - "index": 28, - "resourceName": "19-Module Three Lesson 2-Listening ", - "md5": "EE3DC2A770CB6280D5F57930017F8473", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "", - "pagination": "", - "isTeacherResource": "鍚�", - "鎻掑叆鏍峰紡璇︾粏璇存槑": "涔︿腑浣嶇疆娌℃湁璇ヨ祫婧愪綅缃�" - }, - { - "index": 29, - "resourceName": "19-Module Three Lesson 2-Reading", - "md5": "6CC658238756D3B60721712FA2453082", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson two", - "pagination": 57, - "isTeacherResource": "鍚�" - }, - { - "index": 30, - "resourceName": "20-Module Three Lesson 2-Reading-Words&Expressions", - "md5": "7E56A7028EFD4ECB1320DB02D079F2A2", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson two", - "pagination": 58, - "isTeacherResource": "鍚�" - }, - { - "index": 31, - "resourceName": "3-3銆丮ODULE 3锛坙esson three 锛�", - "md5": "79B3C4727A3648ED0D7D77D985083599", - "resourceType": "PPT", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson three", - "pagination": 66, - "isTeacherResource": "鏄�" - }, - { - "index": 32, - "resourceName": "21-Module Three Lesson 3-Listening 1", - "md5": "E143D4F451EA8172C368005710C4692B", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson three", - "pagination": 62, - "isTeacherResource": "鍚�" - }, - { - "index": 33, - "resourceName": "22-Module Three Lesson 3-Listening 2 ", - "md5": "B9FD8D144AB41BB9BFB7D363F0FD7975", - "resourceType": "闊抽", - "chapterNum": 7, - "chapter": "MODULE3 A BETTER WORLD WITH VOLUNTEER", - "section": "lesson three", - "pagination": 62, - "isTeacherResource": "鍚�" - }, - { - "index": 34, - "resourceName": "4-1銆丮ODULE 4锛坙esson one锛�", - "md5": "C1EEDE2F8E823D035E8AFBAA367D8623", - "resourceType": "PPT", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson one ", - "pagination": 75, - "isTeacherResource": "鏄�" - }, - { - "index": 35, - "resourceName": "23-Module Four Lesson 1-Listening", - "md5": "A502FE9E4A034ACF1B055B1D547C4B8F", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson one ", - "pagination": 70, - "isTeacherResource": "鍚�" - }, - { - "index": 36, - "resourceName": "24-Module Four Lesson 1-Reading ", - "md5": "59A4053C6BE193D9A97945841614841D", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson one ", - "pagination": 70, - "isTeacherResource": "鍚�" - }, - { - "index": 37, - "resourceName": "25-Module Four Lesson 1-Reading-Words&Expressions", - "md5": "541CA8B7A9AE8746340C1259A83F8422", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson one ", - "pagination": 71, - "isTeacherResource": "鍚�" - }, - { - "index": 38, - "resourceName": "4-2銆丮ODULE 4锛坙esson two锛� ", - "md5": "2A3BF5E3075DDD2EA5B4887CF08AF33E", - "resourceType": "PPT", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson two", - "pagination": 81, - "isTeacherResource": "鏄�" - }, - { - "index": 39, - "resourceName": "26-Module Four Lesson 2-Reading ", - "md5": "53A742267A1C22C01B8D5D35B13D3B9A", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson two", - "pagination": 76, - "isTeacherResource": "鍚�" - }, - { - "index": 40, - "resourceName": "27-Module Four Lesson 2-Reading-Words&Expressions", - "md5": "2683C3F79104E353CE30961433F6AB35", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson two", - "pagination": 77, - "isTeacherResource": "鍚�" - }, - { - "index": 41, - "resourceName": "4-3銆丮ODULE 4锛坙esson three锛� ", - "md5": "92A9E5D4CA97A09947F9E6DD39292AEF", - "resourceType": "PPT", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson three", - "pagination": 86, - "isTeacherResource": "鏄�" - }, - { - "index": 42, - "resourceName": "28-Module Four Lesson 3-Listening 1", - "md5": "393DD3913EF74B1CCCADCE8EC81EC7E2", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson three", - "pagination": 81, - "isTeacherResource": "鍚�" - }, - { - "index": 43, - "resourceName": "29-Module Four Lesson 3-Listening 2", - "md5": "B65A5824313D5331C53AF83FDB42D6AC", - "resourceType": "闊抽", - "chapterNum": 8, - "chapter": "MODULE4 TECHNOLOGY AND OUR LIFE", - "section": "lesson three", - "pagination": 82, - "isTeacherResource": "鍚�" - }, - { - "index": 44, - "resourceName": "5-1銆丮ODULE 5锛坙esson one锛�", - "md5": "4713C703ABB481B5FD8CB59D4BCEDB44", - "resourceType": "PPT", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson one ", - "pagination": 94, - "isTeacherResource": "鏄�" - }, - { - "index": 45, - "resourceName": "30-Module Five Lesson 1-Listening ", - "md5": "66F0637DD5232C224AF3A791D043A0A7", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson one ", - "pagination": 88, - "isTeacherResource": "鍚�" - }, - { - "index": 46, - "resourceName": "31-Module Five Lesson 1-Reading ", - "md5": "157842B38CA587C8134070E66D174DDE", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson one ", - "pagination": 89, - "isTeacherResource": "鍚�" - }, - { - "index": 47, - "resourceName": "32-Module Five Lesson 1-Reading-Words&Expressions", - "md5": "F0060BCF874B78E05E2DC9FE317A6D37", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson one ", - "pagination": 90, - "isTeacherResource": "鍚�" - }, - { - "index": 48, - "resourceName": "5-2銆丮ODULE 5锛坙esson two锛�", - "md5": "6621ED56EDC5B274F01BBDF8CC68E799", - "resourceType": "PPT", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson two", - "pagination": 100, - "isTeacherResource": "鏄�" - }, - { - "index": 49, - "resourceName": "33-Module Five Lesson 2-Reading", - "md5": "4AC860B7C2CEB89231AF97F85275A9C6", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson two", - "pagination": 96, - "isTeacherResource": "鍚�" - }, - { - "index": 50, - "resourceName": "34-Module Five Lesson 2-Reading-Words&Expressions ", - "md5": "31AE82BE3BFCD4F772C7C3AFD27D0E31", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson two", - "pagination": 97, - "isTeacherResource": "鍚�" - }, - { - "index": 51, - "resourceName": "5-3銆丮ODULE 5锛坙esson three锛�", - "md5": "764736AD5A058748C59CD108953D1E0B", - "resourceType": "PPT", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson three", - "pagination": 105, - "isTeacherResource": "鏄�" - }, - { - "index": 52, - "resourceName": "35-Module Five Lesson 3-Listening 1 ", - "md5": "5D9F90ABD53E30608E09A0DEE07401C1", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson three", - "pagination": 101, - "isTeacherResource": "鍚�" - }, - { - "index": 53, - "resourceName": "36-Module Five Lesson 3-Listening 2", - "md5": "3DF0EEC6B4334C0C7FF7BC69F8322C22", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson three", - "pagination": 101, - "isTeacherResource": "鍚�" - }, - { - "index": 54, - "resourceName": "37-Module Five Unit Project", - "md5": "BB6F58469CF7056440FE458E82960F4A", - "resourceType": "闊抽", - "chapterNum": 9, - "chapter": "MODULE5 BETTER PLANET,BETTER HOME", - "section": "lesson three", - "pagination": 105, - "isTeacherResource": "鍚�" - }, - { - "index": 55, - "resourceName": "6-1銆丮ODULE 6锛坙esson one锛� ", - "md5": "8805836F4D952A280157DEE1F58B1F07", - "resourceType": "PPT", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson one ", - "pagination": 114, - "isTeacherResource": "鏄�" - }, - { - "index": 56, - "resourceName": "38-Module Six Lesson 1-Listening\t", - "md5": "AB15FA5A96B3FA325489F2E6620827FD\t", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson one ", - "pagination": 109, - "isTeacherResource": "鍚�" - }, - { - "index": 57, - "resourceName": "39-Module Six Lesson 1-Reading ", - "md5": "DF353557BE4B2C0E71BB2A50C0CA753C", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson one ", - "pagination": 109, - "isTeacherResource": "鍚�" - }, - { - "index": 58, - "resourceName": "40-Module Six Lesson 1-Reading-Words&Expressions ", - "md5": "88F39B788C726DD5DB25F429570FFF7D", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson one ", - "pagination": 110, - "isTeacherResource": "鍚�" - }, - { - "index": 59, - "resourceName": "6-2銆丮ODULE 6锛坙esson two锛�", - "md5": "3504E1248920017C76D416BA50E157C4", - "resourceType": "PPT", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson two", - "pagination": 121, - "isTeacherResource": "鏄�" - }, - { - "index": 60, - "resourceName": "41-Module Six Lesson 2-Reading", - "md5": "B32CC91B062501D0D75349EC300C37EA", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson two", - "pagination": 116, - "isTeacherResource": "鍚�" - }, - { - "index": 61, - "resourceName": "42-Module Six Lesson 2-Reading-Words&Expressions(1) ", - "md5": "0CFCC206E2DC45FBA070CD9CD7F0428B", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson two", - "pagination": 117, - "isTeacherResource": "鍚�" - }, - { - "index": 62, - "resourceName": "6-3銆丮ODULE 6锛坙esson three锛�", - "md5": "713A0651ED9F26C2EEAACD1248BE98FF", - "resourceType": "PPT", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson three", - "pagination": 126, - "isTeacherResource": "鏄�" - }, - { - "index": 63, - "resourceName": "43-Module Six Lesson 3-Listening 1", - "md5": "B392589318D7CC282BE811EDA2D8E6B0", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson three", - "pagination": 121, - "isTeacherResource": "鍚�" - }, - { - "index": 64, - "resourceName": "44-Module Six Lesson 3-Listening 2", - "md5": "625FDB71EC5BD35CF489AA4DE6730373", - "resourceType": "闊抽", - "chapterNum": 10, - "chapter": "MODULE6 A GLIMPSE OF THR WORK ENVIRONMENT", - "section": "lesson three", - "pagination": 122, - "isTeacherResource": "鍚�" - }, - { - "index": 65, - "resourceName": "7-1銆丮ODULE 7锛坙esson one锛�", - "md5": "AFCF0AF62F3AEE0B2AD3D9F1A34C0BAE", - "resourceType": "PPT", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson one ", - "pagination": 134, - "isTeacherResource": "鏄�" - }, - { - "index": 66, - "resourceName": "45-Module Seven Lesson 1-Listening", - "md5": "20D9B02E3B0C95E7CD524224C57E643A", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson one ", - "pagination": 129, - "isTeacherResource": "鍚�" - }, - { - "index": 67, - "resourceName": "46-Module Seven Lesson 1-Reading ", - "md5": "01A4E8C1E8E2801EF48DDBBA3E4A30BD", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson one ", - "pagination": 130, - "isTeacherResource": "鍚�" - }, - { - "index": 68, - "resourceName": "47-Module Seven Lesson 1-Reading-Words&Expressions", - "md5": "8D5057637DBB959B365E38360121FB41", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson one ", - "pagination": 131, - "isTeacherResource": "鍚�" - }, - { - "index": 69, - "resourceName": "7-2銆丮ODULE 7锛坙esson two锛�", - "md5": "7DCB21F624B0928D3FEC68FC25E7E8E9", - "resourceType": "PPT", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson two", - "pagination": 138, - "isTeacherResource": "鏄�" - }, - { - "index": 70, - "resourceName": "48-Module Seven Lesson 2-Reading", - "md5": "113D24C2D701120C0F6283A72F9F4366", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson two", - "pagination": 135, - "isTeacherResource": "鍚�" - }, - { - "index": 71, - "resourceName": "49-Module Seven Lesson 2-Reading-Words&Expressions", - "md5": "DE0C4081FE1FFE2374EDB989609B25E9", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson two", - "pagination": 136, - "isTeacherResource": "鍚�" - }, - { - "index": 72, - "resourceName": "7-3銆丮ODULE 7锛坙esson three锛�", - "md5": "F37024A9011D81F7E6199D511AF26A7E", - "resourceType": "PPT", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson three", - "pagination": 143, - "isTeacherResource": "鏄�" - }, - { - "index": 73, - "resourceName": "50-Module Seven Lesson 3-Listening 1", - "md5": "DB59D9F65B437605F766F7975026B61D", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson three", - "pagination": 139, - "isTeacherResource": "鍚�" - }, - { - "index": 74, - "resourceName": "51-Module Seven Lesson 3-Listening 2", - "md5": "53543E43DC90215C21CFC432D46CAB18", - "resourceType": "闊抽", - "chapterNum": 11, - "chapter": "MODULE7 WORK ETHIC AND SUCCESS IN THE WORKPLACE", - "section": "lesson three", - "pagination": 139, - "isTeacherResource": "鍚�" - }, - { - "index": 75, - "resourceName": "8-1銆丮ODULE 8锛坙esson one锛�", - "md5": "13C04E5D87E99850A743AB9EEE8BFD30", - "resourceType": "PPT", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson one ", - "pagination": 152, - "isTeacherResource": "鏄�" - }, - { - "index": 76, - "resourceName": "52-Module Eight Lesson 1-Listening", - "md5": "0D60202A6F614D6B23AF7C48AFC39AB6", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson one ", - "pagination": 147, - "isTeacherResource": "鍚�" - }, - { - "index": 77, - "resourceName": "53-Module Eight Lesson 1-Reading", - "md5": "8C19582CDE35B48FDA735B7E0C206F77", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson one ", - "pagination": 147, - "isTeacherResource": "鍚�" - }, - { - "index": 78, - "resourceName": "54-Module Eight Lesson 1-Reading-Words&Expressions", - "md5": "946A5702CC80B0DB657CCFD66DEE1515", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson one ", - "pagination": 148, - "isTeacherResource": "鍚�" - }, - { - "index": 79, - "resourceName": "8-2銆丮ODULE 8锛坙esson two锛�", - "md5": "691BB643727AD0F4DAC5101DC7BACE07", - "resourceType": "PPT", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson two", - "pagination": 159, - "isTeacherResource": "鏄�" - }, - { - "index": 80, - "resourceName": "55-Module Eight Lesson 2-Reading ", - "md5": "ADAFFAB7BC7A868574889809AB1166A6", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson two", - "pagination": 154, - "isTeacherResource": "鍚�" - }, - { - "index": 81, - "resourceName": "56-Module Eight Lesson 2-Reading-Words&Expressions", - "md5": "966C8CEB3448A41D92BDF9B494F02B88", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson two", - "pagination": 155, - "isTeacherResource": "鍚�" - }, - { - "index": 82, - "resourceName": "8-3銆丮ODULE 8锛坙esson three锛�", - "md5": "62F8CEE1D02966E34591AF62828985BC", - "resourceType": "PPT", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson three", - "pagination": "", - "isTeacherResource": "鏄�", - "鎻掑叆鏍峰紡璇︾粏璇存槑": "涔︿笂娌℃湁浣嶇疆" - }, - { - "index": 83, - "resourceName": "57-Module Eight Lesson 3-Listening 1", - "md5": "76546423FCFAB4B861BC8B94C97D24A2", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson three", - "pagination": 159, - "isTeacherResource": "鍚�" - }, - { - "index": 84, - "resourceName": "58-Module Eight Lesson 3-Listening 2", - "md5": "717A3B915B114D7DC5CA9D3AAA1FC3ED", - "resourceType": "闊抽", - "chapterNum": 12, - "chapter": "MODULE8 THE FIRST STEP TOWARD A CAREER", - "section": "lesson three", - "pagination": 160, - "isTeacherResource": "鍚�" - }, - { - "index": 85, - "resourceName": "寰", - "md5": "29A9C275EEF0BF71C52BE68D8842C0E4", - "resourceType": "瑙嗛", - "chapterNum": "", - "chapter": "", - "section": "", - "pagination": "", - "isTeacherResource": "鍚�" - } -] diff --git a/src/App.vue b/src/App.vue index 0e28f6a..93c6e67 100644 --- a/src/App.vue +++ b/src/App.vue @@ -25,7 +25,8 @@ if (window.electronAPI) { window.electronAPI.onLogout((data) => { - localStorage.clear() + localStorage.removeItem("token") + localStorage.removeItem("userInfo") router.replace({ path: '/login' }) @@ -117,21 +118,23 @@ } } -let tokens = getUrlParam('token') let bookId = getUrlParam('bookId') +let token = getUrlParam('token') let tryPageCount = getUrlParam('tryPageCount') -localStorage.setItem('bookId', bookId) -localStorage.setItem('tryPageCount', tryPageCount) -const token = localStorage.getItem('token') || tokens -localStorage.setItem('token', token) -if (tokens && bookId) { +if(bookId){ + localStorage.setItem('bookId', bookId) +} +if(tryPageCount){ + localStorage.setItem('tryPageCount', tryPageCount) +} + +if(token && token != null && token != 'null'){ + localStorage.setItem('token', token) +} +if (bookId) { router.replace({ path: '/home', query: { bookId: bookId } - }) -} else { - router.replace({ - path: '/login' }) } </script> diff --git a/src/assets/base.css b/src/assets/base.css index 116f1de..48c1d52 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -72,14 +72,18 @@ transition: color 0.5s, background-color 0.5s; - - font-family:PingFang SC, PingFang SC; + + font-family: + PingFang SC, + PingFang SC; font-size: 14px; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + } + ::-webkit-scrollbar { width: 8px; height: 10px; diff --git a/src/assets/images/menu/allSearch.svg b/src/assets/images/menu/allSearch.svg new file mode 100644 index 0000000..5e33242 --- /dev/null +++ b/src/assets/images/menu/allSearch.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1717382814360" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10470" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M192 64a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h6.4A320.384 320.384 0 0 1 448 198.4V192a128 128 0 0 0-128-128H192z" fill="#467CF3" p-id="10471"></path><path d="M576 192a128 128 0 0 1 128-128h128a128 128 0 0 1 128 128v128a128 128 0 0 1-128 128h-6.4A320.384 320.384 0 0 0 576 198.4V192zM198.4 576H192a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h128a128 128 0 0 0 128-128v-6.4A320.384 320.384 0 0 1 198.4 576z" fill="#BECFF5" p-id="10472"></path><path d="M640 512a128 128 0 1 1-256 0 128 128 0 0 1 256 0z m2.048 220.544a256 256 0 1 1 90.496-90.496l176.704 176.64a64 64 0 0 1-90.496 90.56l-176.704-176.64z" fill="#467CF3" p-id="10473"></path></svg> \ No newline at end of file diff --git a/src/assets/images/operation/delete1.svg b/src/assets/images/operation/delete1.svg new file mode 100644 index 0000000..b635aaa --- /dev/null +++ b/src/assets/images/operation/delete1.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="15.512" height="15.514" viewBox="0 0 14.512 14.514"><defs><style>.a{fill:#fff;}</style></defs><g transform="translate(0 0)"><path class="a" d="M0,2.591a.514.514,0,0,1,.516-.518H14a.523.523,0,0,1,.516.518A.514.514,0,0,1,14,3.109H.516A.52.52,0,0,1,0,2.591ZM4.666,0H9.848a.518.518,0,0,1,0,1.035H4.666A.518.518,0,1,1,4.666,0ZM11.4,12.953V4.666a.518.518,0,1,1,1.036,0v8.287c0,.862-.92,1.561-2.073,1.561H4.146c-1.145,0-2.073-.7-2.073-1.561V4.666a.518.518,0,1,1,1.035,0v8.287c0,.215.411.524,1.037.524h6.222c.631,0,1.035-.306,1.035-.524Z" transform="translate(0 0)"/><path class="a" d="M366.3,365.653a.517.517,0,0,1,.517.518v5.183a.518.518,0,1,1-1.035,0v-5.181a.517.517,0,0,1,.518-.519Zm3.108,0a.518.518,0,0,1,.518.518v5.183a.518.518,0,0,1-1.035,0v-5.181a.519.519,0,0,1,.518-.519Z" transform="translate(-360.598 -360.47)"/></g></svg> \ No newline at end of file diff --git a/src/assets/images/operation/list-search.svg b/src/assets/images/operation/list-search.svg new file mode 100644 index 0000000..24d0a6d --- /dev/null +++ b/src/assets/images/operation/list-search.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-list-search" style="color:#999999"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M18.5 18.5l2.5 2.5" /><path d="M4 6h16" /><path d="M4 12h4" /><path d="M4 18h4" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/sound.png b/src/assets/images/operation/sound.png new file mode 100644 index 0000000..935beb8 --- /dev/null +++ b/src/assets/images/operation/sound.png Binary files differ diff --git a/src/assets/images/operation/tag-w.svg b/src/assets/images/operation/tag-w.svg new file mode 100644 index 0000000..f5cc4ed --- /dev/null +++ b/src/assets/images/operation/tag-w.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="23.862" height="20.816" viewBox="0 0 23.862 20.816"><defs><style>.a{fill:#ff6d00;stroke:#ff6d00;stroke-width:0.4px;}</style></defs><path class="a" d="M6.414,89.28a2.467,2.467,0,1,0,2.467,2.467A2.47,2.47,0,0,0,6.414,89.28Zm0,3.947a1.48,1.48,0,1,1,1.48-1.48A1.48,1.48,0,0,1,6.414,93.227Zm16.6,2.088-9.621-9.621a1.225,1.225,0,0,0-.872-.361H1.233A1.235,1.235,0,0,0,0,86.567v8.328a1.225,1.225,0,0,0,.361.872l9.621,9.621a1.233,1.233,0,0,0,1.744,0l.608-.608.608.608a1.233,1.233,0,0,0,1.744,0l8.328-8.328a1.235,1.235,0,0,0,0-1.744ZM11.029,104.69a.247.247,0,0,1-.349,0L1.059,95.069a.245.245,0,0,1-.072-.174V86.567a.247.247,0,0,1,.247-.247H9.561a.245.245,0,0,1,.174.072l9.621,9.621a.247.247,0,0,1,0,.349Zm11.288-8.328-8.328,8.328a.247.247,0,0,1-.349,0l-.608-.608,7.022-7.022a1.235,1.235,0,0,0,0-1.744l-9-9h1.463a.245.245,0,0,1,.174.072l9.621,9.621a.247.247,0,0,1,0,.349Z" transform="translate(0.2 -85.133)"/></svg> \ No newline at end of file diff --git a/src/assets/js/config.ts b/src/assets/js/config.ts index d84bb62..08fadd0 100644 --- a/src/assets/js/config.ts +++ b/src/assets/js/config.ts @@ -1,6 +1,4 @@ // 娴嬭瘯 -export const ctxUrl = "http://182.92.203.7:3007/books/book"; //鏈嶅姟鍣ㄥ湴鍧� -export const resourceUrl = "http://182.92.203.7:3007/books/resource"; //璧勬簮鍦板潃 export const requestCtx = "https://jsek.bnuic.com"; //jsek export const appId = 3; export const requestTimeOut = 300000; // 璇锋眰瓒呮椂鏃堕棿 diff --git a/src/assets/main.css b/src/assets/main.css index 521e39c..347012c 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -291,6 +291,7 @@ } .catalogueLabel{ padding-right:10px; + flex:1; /* width:200px; white-space: nowrap; overflow: hidden; diff --git a/src/child.ts b/src/child.ts index 366c3d5..0153d60 100644 --- a/src/child.ts +++ b/src/child.ts @@ -10,12 +10,11 @@ // }) export const microApps = { - book1: { + childHealth: { // - 蹇呴�夛紝寰簲鐢ㄧ殑鍚嶇О锛屽井搴旂敤涔嬮棿蹇呴』纭繚鍞竴 name: 'app-content', // - 蹇呴�夛紝寰簲鐢ㄧ殑鍏ュ彛 - entry: '//182.92.203.7:3007/books/book', - // entry: '//192.168.3.203:8080', + entry: '//jsek.bnuic.com/books/book/childHealth', // - 蹇呴�夛紝寰簲鐢ㄧ殑瀹瑰櫒鑺傜偣鐨勯�夋嫨鍣ㄦ垨鑰� Element 瀹炰緥 container: '#container', // - 蹇呴�夛紝寰簲鐢ㄧ殑婵�娲昏鍒� @@ -23,6 +22,42 @@ //鏀寔閰嶇疆涓�涓� active function 鍑芥暟鎴栦竴缁� active function銆傚嚱鏁颁細浼犲叆褰撳墠 location 浣滀负鍙傛暟锛屽嚱鏁拌繑鍥� true 鏃惰〃鏄庡綋鍓嶅井搴旂敤浼氳婵�娲汇�傚 location => location.pathname.startsWith('/app1')銆� activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 //loader - (loading: boolean) => void - 鍙�夛紝loading 鐘舵�佸彂鐢熷彉鍖栨椂浼氳皟鐢ㄧ殑鏂规硶銆� + }, + artAndDance: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/artAndDance', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 + }, + english: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/english', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 + }, + lifeCare: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/lifeCare', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 + }, + sportsAndHealth: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/sportsAndHealth', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 + }, + mathBook: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/mathBook', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 + }, + artAndDrama: { + name: 'app-content', + entry: '//jsek.bnuic.com/books/book/artAndDrama', + container: '#container', + activeRule: '/home' //鍖归厤鎵�鏈変互/subPath寮�澶寸殑涓哄瓙搴旂敤 } } diff --git a/src/main.ts b/src/main.ts index 595c414..8a1e974 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,23 +17,24 @@ // 璺敱鎵ц涔嬪墠鐨勪竴浜涙搷浣� router.beforeEach((to, from, next) => { - if (handleGetToken()) { - // 鏄惁鏄櫥褰曢〉闈紝鐩存帴鍒伴椤� - if (to.path === '/login') { - next({ path: '/home',query: { bookId: localStorage.getItem('bookId') } }) - } else { - // 濡傛灉涓嶆槸鐧诲綍椤甸潰锛岃烦杞埌鐩爣鐨勯〉闈� - next() - } - } else { - // 娌℃湁token - if (!to.meta || !to.meta.auth) { - // 鍦ㄥ厤鐧诲綍鐧藉悕鍗曪紝鐩存帴杩涘叆 - next() - } else { - next(`/login?redirect=${to.fullPath}`) // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤� - } - } + next() + // if (handleGetToken()) { + // // 鏄惁鏄櫥褰曢〉闈紝鐩存帴鍒伴椤� + // if (to.path === '/login') { + // next({ path: '/home', query: { bookId: localStorage.getItem('bookId') } }) + // } else { + // // 濡傛灉涓嶆槸鐧诲綍椤甸潰锛岃烦杞埌鐩爣鐨勯〉闈� + // next() + // } + // } else { + // // 娌℃湁token + // if (!to.meta || !to.meta.auth) { + // // 鍦ㄥ厤鐧诲綍鐧藉悕鍗曪紝鐩存帴杩涘叆 + // next() + // } else { + // next(`/login?redirect=${to.fullPath}`) // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤� + // } + // } }) // qiankun涓诲簲鐢ㄤ笌寰簲鐢ㄩ�氳 diff --git a/src/plugin/axios/index.ts b/src/plugin/axios/index.ts index 320cff3..5a9ed77 100644 --- a/src/plugin/axios/index.ts +++ b/src/plugin/axios/index.ts @@ -36,7 +36,8 @@ (error) => { let msg = '璇锋眰鍙戠敓閿欒'; if ((error.response && error.response.status == 401) || error.code == "ERR_NETWORK") { - localStorage.clear() + localStorage.removeItem("token") + localStorage.removeItem("userInfo") router.replace({ path: '/login' }) diff --git a/src/qiankunState/state.ts b/src/qiankunState/state.ts index 43bce93..5ed050b 100644 --- a/src/qiankunState/state.ts +++ b/src/qiankunState/state.ts @@ -10,6 +10,10 @@ delSign:null, scale:100, fontSize:16, + bgColor:'#FBF9F4', + disableSign:false, + searchBookByKeyword: null, + jumpSearchItem:null, } export default state \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 49f42f3..18e560d 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,6 +1,6 @@ import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router' import Layout from '@/layout/layout.vue' -const Reader = () => import('@/views/home.vue') +const Reader = () => import('@/views/readerPages/home.vue') const Login = () => import('@/views/login.vue') const router = createRouter({ @@ -54,6 +54,12 @@ name: 'dictionary', meta: { auth: true, name: '璇嶅吀' }, component: () => import('@/views/components/dictionary.vue') + }, + { + path: '/newWord', + name: 'newWord', + meta: { auth: true, name: '鐢熻瘝' }, + component: () => import('@/views/components/newWord.vue') } ] }, @@ -64,6 +70,18 @@ component: Reader }, { + path: '/webHome', + name: 'webHome', + meta: { auth: true, name: 'web闃呰鍣�' }, + component: () => import('@/views/readerPages/webHome.vue') + }, + { + path: '/mobileHome', + name: 'mobileHome', + meta: { auth: true, name: '绉诲姩闃呰鍣�' }, + component: () => import('@/views/readerPages/mobileHome.vue') + }, + { path: '/login', name: 'login', component: Login diff --git a/src/views/bookshelfList/list.vue b/src/views/bookshelfList/list.vue index 1f1f6b4..c4ceb87 100644 --- a/src/views/bookshelfList/list.vue +++ b/src/views/bookshelfList/list.vue @@ -134,7 +134,7 @@ bookId: item.refCode, } }) - // window.open(config.textReaderUrl+ '?bookId=' + item.product.refCode + "&token=" + localStorage.getItem('jsek-token')) + // window.open(config.textReaderUrl+ '?bookId=' + item.product.refCode + "&token=" + localStorage.getItem('token')) } //.銆傛縺娲诲晢鍝� diff --git a/src/views/components/dictionary.vue b/src/views/components/dictionary.vue index 49c0079..a8d67d7 100644 --- a/src/views/components/dictionary.vue +++ b/src/views/components/dictionary.vue @@ -10,24 +10,38 @@ <div class="resultBox" v-if="searchResult.length > 0"> <div v-for="result in searchResult" :key="result.id"> <div class="phone_con"> - <div class="per-phone">鑻� /<span>{{result.ukPhone}}</span>/</div> - <div class="per-phone">缇� /<span>{{result.usPhone}}</span>/</div> + <div class="per-phone"> + 鑻� <span>/{{ result.ukPhone }}/</span + ><img + :src="sound" + class="soundBtn hover" + @click="soundWord(result.ukPhone)" + /> + </div> + <div class="per-phone"> + 缇� <span>/{{ result.usPhone }}/</span + ><img + :src="sound" + class="soundBtn hover" + @click="soundWord(result.usPhone)" + /> + </div> </div> <div class="trans"> <div v-for="item in result.trans" :key="item"> <div class="itemList"> - <div class="pos">{{item.pos}}.</div> - <div class="tranCn">{{item.tranCn}}</div> + <div class="pos">{{ item.pos }}.</div> + <div class="tranCn">{{ item.tranCn }}</div> </div> </div> </div> <div class="trans" v-if="result.phrase"> <div class="title">璇嶇粍鐭</div> - <div v-for="(item,index) in result.phrase" :key="item"> + <div v-for="(item, index) in result.phrase" :key="item"> <div class="itemList"> - <div class="index">{{index + 1}}</div> - <div class="pos">{{item.pContent}}</div> - <div class="tranCn">{{item.pCn}}</div> + <div class="index">{{ index + 1 }}</div> + <div class="pos">{{ item.pContent }}</div> + <div class="tranCn">{{ item.pCn }}</div> </div> </div> </div> @@ -35,71 +49,84 @@ <div class="title">杩戜箟璇�</div> <div v-for="item in result.syno" :key="item"> <div class="itemList"> - <div class="pos">{{item.pos}}</div> - <div class="tranCn">{{item.tran}}</div> + <div class="pos">{{ item.pos }}</div> + <div class="tranCn">{{ item.tran }}</div> </div> <div class="hwds"> - <div v-for="hw in item.hwds" :key="hw" class="">{{hw.w}}</div> + <div v-for="hw in item.hwds" :key="hw" class="">{{ hw.w }}</div> </div> </div> </div> <div class="trans" v-if="result.sentence"> <div class="title">渚嬪彞</div> - <div v-for="(item,index) in result.sentence" :key="item"> + <div v-for="(item, index) in result.sentence" :key="item"> <div class="itemList1"> - <div class="pos"><span class="index">{{index +1}}</span>{{item.sContent}}</div> - <div class="tranCn">{{item.sCn}}</div> + <div class="pos"> + <span class="index">{{ index + 1 }}</span + >{{ item.sContent }} + </div> + <div class="tranCn">{{ item.sCn }}</div> </div> </div> </div> </div> </div> - <div class="noResultBox" v-else> - 鏆傛棤鍐呭 - </div> + <div class="noResultBox" v-else>鏆傛棤鍐呭</div> </div> </template> <script setup lang="ts"> import { ref, reactive, watch, onMounted, inject } from 'vue' +import sound from '@/assets/images/operation/sound.png' const MG: any = inject('MG') const searchContent = ref('') const isFull = ref(false) -onMounted(() => { -}) +onMounted(() => {}) const searchResult = ref([]) - const getSearchResult = () => { if (searchContent.value) { - MG.edu.findWords([{ - word: searchContent.value, - isFull: isFull.value - }]).then((res) => { + MG.edu + .findWords([ + { + word: searchContent.value, + isFull: isFull.value + } + ]) + .then((res) => { console.log(res) - if (res.length > 0) { - res[0].map((item) => { - item.phrase = JSON.parse(item.phrase) - item.relWord = JSON.parse(item.relWord) - item.sentence = JSON.parse(item.sentence) - item.syno = JSON.parse(item.syno) - item.trans = JSON.parse(item.trans) - }) - searchResult.value = res[0] - } - }) + if (res.length > 0) { + res[0].map((item) => { + item.phrase = JSON.parse(item.phrase) + item.relWord = JSON.parse(item.relWord) + item.sentence = JSON.parse(item.sentence) + item.syno = JSON.parse(item.syno) + item.trans = JSON.parse(item.trans) + }) + searchResult.value = res[0] + } + }) } +} + +const soundWord =(word)=>{ + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterances = new SpeechSynthesisUtterance(searchContent.value) + // utterances.lang = 'EN' // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterances) + } </script> <style lang="less"> -.page{ - height:100%; - overflow-y:auto +.page { + height: 100%; + overflow-y: auto; } .search-Box { - width: 400px; + width: 90%; margin: 0 auto; .custom-input { height: 40px; @@ -118,15 +145,15 @@ } } } -.noResultBox{ - padding:40px; +.noResultBox { + padding: 40px; text-align: center; } -.resultBox{ - padding:20px; - .phone_con{ - .per-phone{ - width:150px; +.resultBox { + padding: 20px; + .phone_con { + .per-phone { + width: 200px; align-items: center; background: #f4f5f7; border-radius: 15px; @@ -136,43 +163,48 @@ font-weight: 500; margin-right: 10px; margin-top: 10px; - // max-width: 100%; + max-width: 100%; padding: 8px 10px; - span{ - margin:0 10px; + span { + margin: 0 10px; + flex: 1; + } + .soundBtn { + width: 18px; + height: 16px; } } } - .trans{ - padding:20px 0; - border-bottom:1px solid #eeeff0; - .title{ - padding:10px 0; - } - .itemList{ - display:flex; + .trans { + padding: 20px 0; + border-bottom: 1px solid #eeeff0; + .title { padding: 10px 0; - .index{ - margin-right:15px; + } + .itemList { + display: flex; + padding: 10px 0; + .index { + margin-right: 15px; } - .pos{ - margin-right:30px; + .pos { + margin-right: 30px; } } - .hwds{ - display:flex; - div{ - padding:0 10px; + .hwds { + display: flex; + div { + padding: 0 10px; } } - .itemList1{ - padding:10px 0; - .index{ - margin-right:15px; + .itemList1 { + padding: 10px 0; + .index { + margin-right: 15px; } - .tranCn{ - margin-left:20px; - margin-top:5px; + .tranCn { + margin-left: 20px; + margin-top: 5px; } } } diff --git a/src/views/components/newWord.vue b/src/views/components/newWord.vue new file mode 100644 index 0000000..2d33c03 --- /dev/null +++ b/src/views/components/newWord.vue @@ -0,0 +1,368 @@ +<template> + <div class="woedPage"> + <div class="wordMenu"> + <el-tree + ref="catalogTree" + default-expand-all="true" + :expand-on-click-node="false" + :data="catalogueList" + :props="defaultProps" + current-node-key="2" + v-if="catalogueList.length > 0" + @node-click="handleNodeClick1" + > + </el-tree> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + <div class="wordContent"> + <div class="tabs-box"> + <div + :class="activeName == 'study' ? 'activeName tabs-Item' : 'tabs-Item'" + @click="handleClick('study')" + > + 瀛︿範妯″紡 + </div> + <div + :class="activeName == 'recite' ? 'activeName tabs-Item' : 'tabs-Item'" + @click="handleClick('recite')" + > + 鑳岃妯″紡 + </div> + </div> + <div class="lists-study" v-if="activeName == 'study'"> + <div v-for="result in wordLists" :key="result"> + <div class="list-title">{{ result.word }}</div> + <div class="list-con"> + <div class="phone_con"> + <div class="per-phone"> + 鑻� <span>/{{ result.ukPhone }}/</span + ><img :src="sound" class="soundBtn hover" @click="soundWord(result.word)" /> + </div> + <div class="per-phone"> + 缇� <span>/{{ result.usPhone }}/</span + ><img :src="sound" class="soundBtn hover" @click="soundWord(result.word)" /> + </div> + </div> + <div class="trans"> + <div v-for="item in result.trans" :key="item"> + <div class="itemList"> + <div class="pos">{{ item.pos }}.</div> + <div class="tranCn">{{ item.tranCn }}</div> + </div> + </div> + </div> + </div> + </div> + </div> + <div class="lists-recite" v-if="activeName == 'recite'"> + <div class="setting"> + <el-select v-model="showData" placeholder="Select" style="width: 120px"> + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + <img :src="setting" class="settingImg" /> + </div> + <div class="list-box"> + <div v-for="(result, index) in wordLists" :key="result" class="list-con"> + <div class="list-title hover" @click="isShow = index"> + <div class="" v-if="showData == 'newWord'">{{ result.word }}</div> + <div class="trans" v-if="showData == 'translation'"> + <div v-for="item in result.trans" :key="item"> + <div class="itemList"> + <div class="pos">{{ item.pos }}.</div> + <div class="tranCn">{{ item.tranCn }}</div> + </div> + </div> + </div> + </div> + <div class="boxCon" v-show="isShow == index"> + <div class="word" v-if="showData == 'translation'">{{ result.word }}</div> + <div class="phone_con" > + <div class="per-phone"> + 鑻� <span>/{{ result.ukPhone }}/</span + ><img :src="sound" class="soundBtn hover" @click="soundWord(result.word)" /> + </div> + <div class="per-phone"> + 缇� <span>/{{ result.usPhone }}/</span + ><img :src="sound" class="soundBtn hover" @click="soundWord(result.word)" /> + </div> + </div> + <div class="trans" v-if="showData == 'newWord'"> + <div v-for="item in result.trans" :key="item"> + <div class="itemList"> + <div class="pos">{{ item.pos }}.</div> + <div class="tranCn">{{ item.tranCn }}</div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> +</template> +<script setup lang="ts"> +import { ref, reactive, watch, onMounted, inject } from 'vue' +import sound from '@/assets/images/operation/sound.png' +import setting from '@/assets/images/operation/setting.png' +import axios from 'axios' +const MG: any = inject('MG') +const props = defineProps<{ resourceUrl: string }>() +const activeName = ref('study') +const catalogueList = ref([]) +const wordData = ref([]) +const wordLists = ref([]) +const showData = ref('newWord') +const isShow = ref(null) +const options = [ + { + value: 'newWord', + label: '鏄剧ず鐢熻瘝' + }, + { + value: 'translation', + label: '鏄剧ず璇戞枃' + } +] +onMounted(() => { + getWordListData() +}) + +const defaultProps = { + children: 'children', + label: 'label' +} + +const getWordListData = () => { + console.log(props, 2) + axios + .get(props.resourceUrl + '/newWords.json') + .then(function (response) { + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + console.log(response.data, '鍗曡瘝') + catalogueList.value = response.data + wordData.value = response.data[0].children[0].words + getSearchResult() + }) + .catch(function (error) { + console.log(error) + }) +} + +const handleNodeClick1 = (data) => { + wordData.value = [] + if (data.words) { + wordData.value = data.words + } + console.log(wordData.value, 22) + getSearchResult() +} + +const handleClick = (type) => { + activeName.value = type +} + +const getSearchResult = () => { + let wordList = [] + if (wordData.value.length > 0) { + wordData.value.forEach((item) => { + wordList.push({ + word: item, + isFull: false + }) + }) + } + MG.edu.findWords(wordList).then((res) => { + console.log(res) + if (res.length > 0) { + wordLists.value = [] + res.forEach((item) => { + console.log(item) + if (item[0]) { + wordLists.value.push({ + word: item[0].word, + usPhone: item[0].usPhone, + ukPhone: item[0].ukPhone, + trans: JSON.parse(item[0].trans) + }) + } + }) + } + }) +} + +const soundWord = (word) => { + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterances = new SpeechSynthesisUtterance(word) + // utterances.lang = 'EN' // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterances) +} +</script> + +<style lang="less"> +.woedPage { + height: 100%; + overflow-y: auto; + display: flex; + .wordMenu { + height: 100%; + width: 300px; + border-right: 1px solid #ececec; + .el-tree-node__label { + padding: 5px 0; + } + } + .wordContent { + padding: 10px 20px; + flex: 1; + .tabs-box { + width: 100%; + display: flex; + background: #f5f6f9; + border-radius: 10px; + padding: 5px; + .tabs-Item { + flex: 1; + text-align: center; + padding: 10px; + font-size: 16px; + border-radius: 7px; + cursor: pointer; + } + .activeName { + background: #fff; + } + } + .lists-study { + padding: 10px 0; + .list-title { + font-weight: bold; + padding: 10px; + + } + .list-con { + padding: 10px 15px; + background: #f3faff; + border-radius: 5px; + .phone_con { + display: flex; + .per-phone { + margin-right: 20px; + align-items: center; + display: flex; + span { + padding: 0 10px; + } + } + .soundBtn { + width: 16px; + height: 14px; + } + } + .trans { + margin-top: 10px; + .itemList { + align-items: center; + display: flex; + margin: 10px 0; + .pos { + width: 35px; + line-height: 16px; + text-align: center; + background: rgba(90, 180, 246, 0.18); + border-radius: 11px; + font-family: FZQiTi-S14T, FZQiTi-S14T; + font-size: 16px; + color: #0093ff; + } + .tranCn { + padding-left: 10px; + flex: 1; + } + } + } + } + } + .lists-recite { + .setting { + padding: 10px 0; + text-align: right; + align-items: center; + display: flex; + justify-content: flex-end; + + .settingImg { + height: 16px; + width: 16px; + margin-left: 10px; + } + } + .list-con { + padding: 10px 15px; + margin: 10px 0; + background: #f3faff; + border-radius: 5px; + .list-title { + div,.tranCn{ + font-weight: bold; + } + } + .boxCon { + background: #fff; + border-radius: 5px; + padding: 10px; + margin-top: 10px; + .word{ + font-weight: bold; + } + } + .phone_con { + display: flex; + margin-top:5px; + .per-phone { + margin-right: 20px; + align-items: center; + display: flex; + span { + padding: 0 10px; + } + } + .soundBtn { + width: 16px; + height: 14px; + } + } + .trans { + .itemList { + align-items: center; + display: flex; + margin: 10px 0; + .pos { + width: 35px; + line-height: 16px; + text-align: center; + background: rgba(90, 180, 246, 0.18); + border-radius: 11px; + font-family: FZQiTi-S14T, FZQiTi-S14T; + font-size: 16px; + color: #0093ff; + } + .tranCn { + padding-left: 10px; + flex: 1; + } + } + } + } + } + } +} +</style> diff --git a/src/views/index.vue b/src/views/index.vue index b524f76..04d3f67 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -24,7 +24,7 @@ onMounted(() => {}) const goRouter = (item) => { - if (!localStorage.getItem('jsek-token')) { + if (!localStorage.getItem('token')) { return router.push({ path: '/home', query: { diff --git a/src/views/login.vue b/src/views/login.vue index f36b347..2bf055d 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -8,19 +8,19 @@ <el-form-item prop="username"> <!-- <el-input v-model="loginData.username"></el-input> --> <el-input v-model="loginData.username" placeholder="璇疯緭鍏ユ墜鏈哄彿" size="large"> - <template #prepend> - <el-select - v-model="select" - placeholder="Select" - class="selectPhone" - > - <el-option label="涓浗+86" value="86" /> - </el-select> - </template> - </el-input> + <template #prepend> + <el-select v-model="select" placeholder="Select" class="selectPhone"> + <el-option label="涓浗+86" value="86" /> + </el-select> + </template> + </el-input> </el-form-item> <el-form-item prop="password"> - <el-input type="password" v-model="loginData.password" placeholder="璇疯緭鍏ュ瘑鐮�"></el-input> + <el-input + type="password" + v-model="loginData.password" + placeholder="璇疯緭鍏ュ瘑鐮�" + ></el-input> </el-form-item> <div class="btnBox"> <el-button @@ -82,7 +82,10 @@ if (route.query.redirect) { router.push(route.query.redirect) } else { - router.push('/home') + router.replace({ + path: '/home', + query: { bookId: localStorage.getItem('bookId') } + }) } } else if (res.data.isError) { ElMessage.error(res.data.errorDescription) @@ -106,13 +109,9 @@ let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') - if (nameAndPassword) { + if (teacherRole && teacherInfos) { let userInfo = { - name: nameAndPassword.credential - } - localStorage.setItem('userInfo', JSON.stringify(userInfo)) - } else if (teacherRole && teacherInfos) { - let userInfo = { + ...teacherInfos, name: teacherInfos.name, role: 'Teacher', roleId: teacherRole.role.id @@ -120,6 +119,7 @@ localStorage.setItem('userInfo', JSON.stringify(userInfo)) } else if (phoneInfo) { let userInfo = { + ...phoneInfo, name: phoneInfo.credential } localStorage.setItem('userInfo', JSON.stringify(userInfo)) @@ -141,13 +141,13 @@ width: 800px; height: 540px; border-radius: 20px; - overflow:hidden; + overflow: hidden; display: flex; - background: #FFFFFF; - box-shadow: 0px 0px 10px 1px rgba(0,0,0,0.1); + background: #ffffff; + box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1); .loginForm { width: 410px; - padding:40px; + padding: 40px; height: 100%; display: flex; flex-direction: column; @@ -177,30 +177,35 @@ box-sizing: border-box; width: 403px; } - .el-input{ + .el-input { height: 40px; } .el-select { - width: 100px; - height: 40px; - .el-select__wrapper { + width: 100px; + height: 40px; + .el-select__wrapper { + height: 100% !important; + .el-input--suffix { height: 100% !important; - .el-input--suffix { - height: 100% !important; - background-color: #fff; - } + background-color: #fff; } } + } - .logInBtn { - width: 304px; - height: 40px; - margin-top: 10px; - margin-bottom: 20px; - border-radius: 3px; - color: #fff; - font-size: 14px; - } + .logInBtn { + width: 304px; + height: 40px; + margin-top: 10px; + margin-bottom: 20px; + border-radius: 3px; + color: #fff; + font-size: 14px; + } + } +} +@media screen and (max-width: 450px) { + .rightImg { + display: none; } } </style> diff --git a/src/views/readerPages/home.vue b/src/views/readerPages/home.vue new file mode 100644 index 0000000..47ca510 --- /dev/null +++ b/src/views/readerPages/home.vue @@ -0,0 +1,30 @@ +<template> + <div class="homePage"> + <webHome v-if="!homeBoxHide"/> + <mobileHome v-if="homeBoxHide"/> + </div> +</template> +<script setup lang="ts"> +import { ref, onMounted } from 'vue' +import webHome from '@/views//readerPages/webHome.vue' +import mobileHome from '@/views//readerPages/mobileHome.vue' +const screenWidth = ref( + window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth +) +const homeBoxHide = ref(false) + +onMounted(() => { + if (screenWidth.value < 420) { + homeBoxHide.value = true + }else{ + homeBoxHide.value = false + } +}) +</script> + +<style lang="less"> +.homePage{ + width:100%; + height:100%; +} +</style> diff --git a/src/views/readerPages/mobileHome.vue b/src/views/readerPages/mobileHome.vue new file mode 100644 index 0000000..bdc6540 --- /dev/null +++ b/src/views/readerPages/mobileHome.vue @@ -0,0 +1,2127 @@ +<template> + <div class="mobileHomeBox"> + <div class="headerBox"> + <el-icon @click="goHome"><ArrowLeft /></el-icon> + <div class="bookName">{{ bookConfig.bookName }}</div> + </div> + <div class="contentBox"> + <div + class="pageBox" + :style="{ background: settingForm.bgColorActive }" + v-show="activeIndex == '0'" + > + <!-- 澶撮儴鏄剧ず --> + <div class="pageBox-header"> + <div class="progress"> + <div v-if="headerData.totlePage && bookConfig.bookName"> + {{ headerData.process }}/{{ headerData.totlePage }} + </div> + </div> + </div> + <!-- 寰簲鐢ㄧ洅瀛� --> + <div class="pageBox-content"> + <div id="container"></div> + </div> + </div> + <div class="catalogBox" v-show="activeIndex == '1'"> + <div class="catalogTab"> + <div class="tabItem hover" @click="selectTabs('catalog')"> + <div :class="activeTabs == 'catalog' ? 'text textActive' : 'text'">鐩綍</div> + </div> + <div class="tabItem hover" @click="selectTabs('reMark')"> + <div :class="activeTabs == 'reMark' ? 'text textActive' : 'text'">涔︾</div> + </div> + </div> + <div class="catalogList" v-if="activeTabs == 'catalog'"> + <el-tree + ref="catalogTree" + default-expand-all="true" + :expand-on-click-node="false" + node-key="start" + highlight-current + :data="catalogueData" + :props="defaultProps" + v-if="catalogueData.length > 0" + @node-click="handleNodeClick" + > + <template #default="{ node, data }"> + <div class="custom-tree-node"> + <div class="catalogueLabel" :title="node.label">{{ node.label }}</div> + <span class="pageNum">{{ data.page }}</span> + </div> + </template> + </el-tree> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + <div class="reMarkList" v-if="activeTabs == 'reMark'"> + <div v-if="reMarkList.length > 0"> + <div v-for="(item, index) in reMarkList" :key="index" class="reMarkItem"> + <div class="reMarkCon hover" @click="goReMark(item)"> + <div>P{{ item.page }}</div> + <div class="con">{{ item.content }}</div> + </div> + <div class="deleteReMarkImg"> + <img :src="shanchu" class="icon hover" @click="deleteReMark(item)" /> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + </div> + <div class="resourceBox" v-show="activeIndex == '2'"> + <div class="resourceTab"> + <div class="tabItem hover" @click="selectResourceType('default')"> + <div>榛樿璧勬簮</div> + <div :class="resourceType == 'default' ? 'text' : 'line'"></div> + </div> + <div class="tabItem hover" @click="selectResourceType('teacher')"> + <div>鏁欏笀璧勬簮</div> + <div :class="resourceType == 'teacher' ? 'text' : 'line'"></div> + </div> + <div class="tabItem hover" @click="selectResourceType('collection')"> + <div>鏀惰棌</div> + <div :class="resourceType == 'collection' ? 'text' : 'line'"></div> + </div> + </div> + <div class="resourceSearchBox" v-if="classifySelectList.length > 0"> + <div class="classification"> + <div + v-for="item in classifySelectList" + :key="item.key" + class="flex1 hover" + @click="classifyClick(item)" + > + <div + :class="item.key == activeClassify ? 'activeClassify classifyItem' : 'classifyItem'" + > + <div class="title">{{ item.title }}</div> + <div class="count">{{ item.count }}</div> + </div> + </div> + <div class="showSearch flex1 hover"> + <div :class="searchShow ? 'imgBox' : 'imgBox activeSearch'" @click="searchBtn"> + <img :src="searchShow ? search : search1" /> + </div> + </div> + </div> + <div class="searchBox"> + <div class="inputBox" v-if="!searchShow"> + <el-input + class="custom-input" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="searchText" + @keyup.enter="searchBook" + clearable + @clear="handleClear" + > + <template #prefix> + <img :src="listSearch" @click="searchBook" /> + </template> + </el-input> + </div> + </div> + </div> + <div v-if="resourceDataList.length > 0" class="resourceList"> + <div v-for="(item, index) in resourceDataList" :key="item" class="resourceItem"> + <div class="resourceImg"> + <img :src="item.resourcePath" mode="" v-if="activeClassify == 'image'" /> + <img :src="item.icon" mode="" v-else-if="item.icon && activeClassify != 'image'" /> + <el-icon v-else-if="activeClassify == 'audio'" size="30"><Headset /></el-icon> + <el-icon v-else-if="activeClassify == 'video'" size="30"><VideoCamera /></el-icon> + <el-icon v-else-if="activeClassify == 'other'" size="30"><Files /></el-icon> + <el-icon v-else-if="activeClassify == 'exercises'" size="30"><Tickets /></el-icon> + </div> + <div class="rName"> + <div>{{ item.resourceName }}</div> + <div class="handleBox"> + <el-icon + class="icon hover" + size="20" + @click="JumpPosition(item)" + v-if="resourceType == 'default'" + ><LocationInformation + /></el-icon> + <el-icon + @click="goPlay(item)" + size="20" + class="icon hover" + v-if="item.resourceType == '瑙嗛'" + ><VideoPlay + /></el-icon> + <el-icon + @click="goPlay(item, index)" + size="20" + class="icon hover" + v-if="item.resourceType == '闊抽' && playIndex != index" + ><VideoPlay + /></el-icon> + <el-icon + @click="goPause()" + size="20" + class="icon hover" + v-if="item.resourceType == '闊抽' && playIndex == index" + ><VideoPause + /></el-icon> + <el-icon + @click="getCapture(item, index)" + size="20" + class="icon hover" + v-if="item.resourceType == '鍥剧墖'" + ><View + /></el-icon> + <el-icon + size="20" + class="icon hover" + @click="goPlay(item)" + v-if=" + !( + item.resourceType == '瑙嗛' || + item.resourceType == '闊抽' || + item.resourceType == '涔犻' || + item.resourceType == '鍥剧墖' + ) + " + ><Download + /></el-icon> + </div> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + <div class="noteBox" v-show="activeIndex == '3'"> + <div class="searchBox"> + <div class="inputBox"> + <el-input + class="custom-input" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="searchText" + @keyup.enter="searchBook" + clearable + @clear="handleClear" + > + <template #prefix> + <img :src="listSearch" @click="searchBook" /> + </template> + </el-input> + </div> + </div> + <div class="screenBox"> + <div class="title">绛涢��</div> + <div class="flex1 hover" @click="searchClick('all')"> + <div :class="menuState.notesColor == 'all' ? ' allActive' : 'all'">鍏ㄩ儴</div> + </div> + <div + v-for="item in colorSelectList" + :key="item.key" + class="flex1 hover" + @click="searchClick(item)" + > + <div + :style="{ background: item.key }" + :class="item.key == menuState.notesColor ? 'activeScribe scribeItem' : 'scribeItem'" + ></div> + </div> + </div> + <div v-if="scribeData.noteList.length > 0"> + <div v-for="(noteItem, index) in scribeData.noteList" :key="noteItem"> + <div class="chapterName"> + <el-icon + @click="noteClose(index)" + v-if="scribeData.isShow && scribeData.openIndex == index" + class="hover" + ><ArrowDown + /></el-icon> + <el-icon @click="noteOpen(index)" v-else class="hover"><ArrowRight /></el-icon> + <span>{{ noteItem.chapterName }}</span> + </div> + <div + v-for="(item, index1) in noteItem.noteList" + :key="item.key" + class="listItem" + v-show="scribeData.isShow && scribeData.openIndex == index" + > + <div class="textBox"> + <div class="title"> + <div class="title-con"> + <div class="border-left" :style="{ 'border-right-color': item.color }"></div> + <span>{{ moment(item.createDate).format('YYYY-MM-DD') }}</span> + </div> + <div> + <img :src="bianji" @click="update(item)" class="hover" /> + <img :src="shanchu" @click="deleteBtn(item)" class="hover" /> + </div> + </div> + <div + class="noteText hover 123456" + @click="jumpContent(item)" + :style="{ + background: + item.color == '#F5E12A' + ? 'rgba(255,234,41,0.1)' + : item.color == '#76F0AE' + ? 'rgba(83,255,162,0.1)' + : item.color == '#59CFF5' + ? 'rgba(93,216,255,0.1)' + : item.color == '#CAA5FC' + ? 'rgba(205,167,255,0.1)' + : item.color == '#F5A0B9' + ? 'rgba(255,167,193,0.1)' + : item.color + }" + > + <div class="con hover"> + {{ item.note }} + </div> + </div> + <div class="chapter">{{ item.txt }}</div> + </div> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + <div class="allSearchBox" v-show="activeIndex == '7'"> + <div class="searchBox"> + <div class="inputBox"> + <el-input + class="custom-input" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="searchText" + @keyup.enter="searchBook" + clearable + @clear="handleClear" + > + <template #prefix> + <img :src="listSearch" @click="searchBook" /> + </template> + </el-input> + </div> + </div> + <div class="allSearch"> + <div v-if="allSearchReault.length > 0" class="allSearchList"> + <div v-for="(reault, index) in allSearchReault" :key="index"> + <div class="chapterName"> + <el-icon + @click="searchClose(index)" + v-if="searchReaultData.isShow && searchReaultData.openIndex == index" + class="hover" + ><ArrowDown + /></el-icon> + <el-icon @click="searchOpen(index)" v-else class="hover"><ArrowRight /></el-icon> + <span>{{ reault.chapterName }} 锛坽{ reault.itemList.length }}锛�</span> + </div> + <div + v-for="(item, index1) in reault.itemList" + :key="index1" + class="searchItem" + v-show="searchReaultData.isShow && searchReaultData.openIndex == index" + > + <div class="index">{{ index1 + 1 }}.</div> + <div class="searchCon hover" @click="goSearchContent(item)"> + {{ item.txt }} + </div> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + </div> + </div> + <div class="footerBox"> + <el-menu + :default-active="activeIndex" + class="el-menu-demo" + mode="horizontal" + ellipsis + @select="handleSelect" + > + <el-menu-item index="1" class="menu-item">鐩綍</el-menu-item> + <el-menu-item index="2" class="menu-item">璧勬簮</el-menu-item> + <el-menu-item index="3" class="menu-item">绗旇</el-menu-item> + <el-menu-item index="4" class="menu-item">璁剧疆</el-menu-item> + <!-- <el-menu-item index="5" class="menu-item">鐣寗閽�</el-menu-item> + <el-menu-item index="6" class="menu-item">涔犻</el-menu-item> --> + <el-menu-item index="7" class="menu-item">妫�绱�</el-menu-item> + </el-menu> + </div> + <!-- 璁剧疆 --> + <el-drawer + v-model="settingDrawer" + title="璁剧疆" + direction ="btt" + size="35%" + > + <div> + <div class="settingBox"> + <el-form :model="settingForm" label-width="auto" style="max-width: 400px"> + <el-form-item label="瀛椾綋澶у皬"> + <div class="lineStyle"> + <div class="lineTypeBox"> + <div + v-for="item in settingForm.fontSizeList" + :key="item.key" + :class=" + settingForm.fontSizeActive == item.key + ? 'typeItem lineTypeActive' + : 'typeItem' + " + @click="fontSizeSelect(item)" + > + {{ item.lable }} + <div class="activeIcon" v-if="settingForm.fontSizeActive == item.key"> + <img :src="xuanzhong" /> + </div> + </div> + </div> + </div> + </el-form-item> + <el-form-item label="搴曡壊"> + <div class="bgColor"> + <div + v-for="item in settingForm.bgColorList" + :key="item.key" + class="flex1 hover" + @click="bgColorSelect(item)" + > + <div + :style="{ + background: item.key, + 'border-color': item.key == settingForm.bgColorActive ? '#0093FF' : '#EBEBEB' + }" + class="scribeItem" + > + <img :src="xuanzhong1" v-if="item.key == settingForm.bgColorActive" /> + </div> + </div> + </div> + </el-form-item> + </el-form> + </div> + </div> + </el-drawer> + <!-- 閫変腑宸ュ叿鏍� --> + <div + class="dialogToolBox" + id="dialogToolBox" + v-show="showToolBox" + :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }" + > + <div class="colorSelectBox" v-show="toolActive == '楂樹寒' || toolActive == '鍒掔嚎'"> + <div + v-for="item in colorSelectList" + :key="item.key" + class="flex1 hover" + @click="clickSelect(item)" + > + <div :style="{ background: item.key }" class="scribeItem"> + <img :src="xuanzhong1" v-if="item.key == colorActive" /> + </div> + </div> + </div> + <div class="toolSelectBox" v-show="toolActive != '楂樹寒' && toolActive != '鍒掔嚎'"> + <div v-for="item in dialogToolList" :key="item.icon" @click="dialogToolHandle(item)"> + <div + :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" + v-if="item.isShow" + > + <el-tooltip class="box-item" effect="dark" :content="item.name" placement="bottom"> + <img :src="item.icon" alt="" /> + </el-tooltip> + </div> + <!-- <span>{{ item.name }}</span> --> + </div> + </div> + </div> + <!-- 鍒掔嚎锛岄珮浜垹闄� --> + <div + class="lineDeleteBox" + v-show="lineDelete.showLineDelete" + :style="{ top: `${lineDelete.top}px`, left: `${lineDelete.left}px` }" + > + <!-- <el-button @click="delUserKey">鍒犻櫎</el-button> --> + <div class="dialogToolItem"> + <el-tooltip class="box-item" effect="dark" content="鍒犻櫎" placement="bottom"> + <img :src="deleteIcon" @click="delUserKey" /> + </el-tooltip> + </div> + <div class="dialogToolItem" v-if="isUpdate"> + <el-tooltip class="box-item" effect="dark" content="绗旇" placement="bottom"> + <img :src="biji2" @click="updateNote" /> + </el-tooltip> + </div> + </div> + </div> + <el-dialog + title="娣诲姞绗旇" + align-center + v-model="addNoteVisble" + :before-close="handleClose" + class="myNoteDialogs" + > + <div class="formBox"> + <el-input + type="textarea" + :rows="4" + v-model="formData.desc" + placeholder="璇疯緭鍏ョ瑪璁板唴瀹�" + ></el-input> + </div> + <div class="noteColorSelectBox"> + <div + v-for="item in colorSelectList" + :key="item.key" + class="flex1 hover" + @click="clickSelectColor(item)" + > + <div :style="{ background: item.key }" class="scribeItem"> + <img :src="xuanzhong" v-if="item.key == noteColorActive" /> + </div> + </div> + </div> + <template #footer> + <span class="dialog-footer"> + <el-button @click="handleClose">鍙� 娑�</el-button> + <el-button type="primary" @click="addUserKey" v-if="!isUpdate">纭� 瀹�</el-button> + <el-button type="primary" @click="updateUserKey" v-if="isUpdate">纭� 瀹�</el-button> + </span> + </template> + </el-dialog> + <!-- 鍥剧墖 --> + <el-image-viewer + v-if="confirmDialog" + :zoom-rate="1.2" + @close="closePreview" + :initial-index="previewIndex" + :url-list="imgPreviewList" + /> + <el-dialog + title="璧勬簮" + align-center + v-model="resourVisble" + width="845" + class="resourDialog" + :before-close="resourVisbleClose" + > + <div class="videoBox" v-if="resourType == '瑙嗛'"> + <video controls controlslist="nodownload" :src="testVideo"></video> + </div> + + <!-- <div class="wordBox" v-if="resourType == 'word'"> + <vue-office-docx :src="testWord" /> + </div> --> + </el-dialog> + <div class="audioBox" v-show="false"> + <audio ref="audioPlayer" :src="testAudio" controls @loadedmetadata="autoPlay"></audio> + </div> +</template> +<script setup lang="ts"> +import { ref, reactive, watch, onMounted, onBeforeMount, inject } from 'vue' +import axios from 'axios' +import { useRouter, useRoute } from 'vue-router' +import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' +import useClipboard from 'vue-clipboard3' +const { toClipboard } = useClipboard() +const MG: any = inject('MG') +const toolClass = inject('toolClass') +const qiankunActions = inject('qiankunActions') +import { loadMicroApp } from 'qiankun' +import { microApps } from '@/child.ts' +//鑾峰彇璺敱鍣� +let router = useRouter() +//鑾峰彇褰撳墠璺敱鐨勪俊鎭� +let route = useRoute() +import moment from 'moment' + +import bianji from '@/assets/images/operation/bianji.png' +import shanchu from '@/assets/images/operation/delete.png' +import listSearch from '@/assets/images/operation/list-search.svg' +import search from '@/assets/images/operation/search.png' +import search1 from '@/assets/images/operation/search1.png' +import xuanzhong from '@/assets/images/operation/xuanzhong.png' + +let microApp = null // 寰簲鐢ㄥ疄渚� +const bookConfig = ref({}) +//褰撳墠鏄剧ず绔犺妭 +const activeCatalog = ref() +onMounted(() => { + // 鍔犺浇寰簲鐢� + microApp = loadMicroApp(microApps[localStorage.getItem('bookId')], { + sandbox: { + strictStyleIsolation: true, + experimentalStyleIsolation: true + }, + singular: true + }) + + window.qiankunActions.onGlobalStateChange((state, prev) => { + console.log('鐖跺眰state鍙樺寲', state) + window.qiankunState = state + + if (window.qiankunState && window.qiankunState.initTestBook) { + window.qiankunState.initTestBook( + localStorage.getItem('bookId') + '', + localStorage.getItem('tryPageCount') + ) + } + }) + + // 瀹氫箟鐖跺眰鏂规硶 + window.qiankunActions.setGlobalState({ + disableSign: false, + // windowSelection: (data) => { + // // 缁戝畾瀛愬簲鐢ㄩ�夋嫨鐩戝惉浜嬩欢 + // console.log(data, '瀛愬簲鐢ㄩ�夋嫨') + // if (data.txt) { + // getSelection(data) + // } else { + // showToolBox.value = false + // lineDelete.showLineDelete = false + // dictionaryData.showContent = false + // isUpdate.value = false + // toolActive.value = '' + // lineDelete.top = data.y + 20 + // lineDelete.left = data.x + // } + // }, + // chooseWords: (data) => { + // console.log(data, '鑻辫鐢熻瘝') + // switch (data.type) { + // case 'word': + // if (data) { + // dialogToolData.txt = data.word + // dialogToolData.left = data.x + // dialogToolData.top = data.y + 20 + // // getSearchResult() + // } + // break + // case 'swdt': + // siweiVisble.value = true + // break + // case 'readText': + // window.speechSynthesis.cancel() + // const synth = window.speechSynthesis + // const utterances = new SpeechSynthesisUtterance(data.data) + // // utterances.lang = 'EN' // 璁剧疆璇█涓轰腑鏂� + // synth.speak(utterances) + + // break + // } + // }, + getBookConfig: (data) => { + console.log(data.bookConfig, '鍥句功閰嶇疆') + bookConfig.value = data.bookConfig + getCatalogueData() + // getResourceData() + // getTextbookComponents() + // getReMarkList() + }, + catalogChange: (data) => { + activeCatalog.value = data.showCatalogList + if (window.qiankunState.disableSign) { + // getSignData() + } + // getSignData() + console.log(data, '绔犺妭鍒囨崲锛氱洰鍓嶆樉绀虹殑涓変釜绔犺妭') + }, + pageChange: (data) => { + headerData.process = Number(data.page) + // currentChapter.value = data.catalog + // console.log(data, '椤甸潰鍒囨崲锛氱洰鍓嶆樉绀洪〉闈㈠拰瀵瑰簲鐨勭珷鑺備俊鎭�') + // if (catalogTree.value) { + // catalogTree.value.setCurrentKey(Number(data.page)) + // } + // showToolBox.value = false + // lineDelete.showLineDelete = false + // dictionaryData.showContent = false + + // reMarkCon.value = data.text + // reMarResult.value = reMarkData.value.find((item) => { + // return item.chapterNum == data.catalog && item.page == data.page + // }) + // if (reMarResult.value) { + // floatingToolData.activeToolData = '涔︾' + // } else { + // floatingToolData.activeToolData = '' + // } + } + }) +}) + +//鑿滃崟 +const activeIndex = ref('0') +const handleSelect = (key: string, keyPath: string[]) => { + console.log(key, keyPath) + if (key == '4') { + settingDrawer.value=true + } else { + activeIndex.value = key + switch (activeIndex.value) { + case '1': + getReMarkList() + break + case '2': + getResourceData() + break + case '3': + getNotesList() + break + } + } +} +const goHome = () => { + activeIndex.value = '0' +} + +const catalogueData = ref([]) //鑾峰彇鐩綍 +const reMarkList = ref([]) //涔︾ +const reMarkData = ref([]) //涔︾ + +const defaultProps = { + children: 'children', + label: 'label', + start: 'start' +} +const headerData = reactive({ + process: 0, + totlePage: 0 +}) + +//鐩綍鑿滃崟 +const activeTabs = ref('catalog') +const selectTabs = (type) => { + activeTabs.value = type + if (type == 'catalog') { + getCatalogueData() + } else { + getReMarkList() + } +} +//鐩綍鍒楄〃 +const getCatalogueData = () => { + axios + .get(bookConfig.value.resourceUrl + '/information.json') + .then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + console.log(json, '鐩綍') + catalogueData.value = json.data + headerData.totlePage = json.data[json.data.length - 1].end + }) + .catch(function (error) { + console.log(error) + }) +} +const handleNodeClick = (data) => { + console.log(data) + activeIndex.value = '0' + if (localStorage.getItem('tryPageCount')) { + if (data.start < localStorage.getItem('tryPageCount')) { + headerData.process = data.start + if (window.qiankunState && window.qiankunState.gotoPage) + window.qiankunState.gotoPage(data.chapter, data.start) + } else { + ElMessage({ + message: '璇曡宸茬粨鏉�!', + type: 'warning' + }) + } + } else { + headerData.process = data.start + if (window.qiankunState && window.qiankunState.gotoPage) + window.qiankunState.gotoPage(data.chapter, data.start) + } +} + +//鍏ㄦ枃妫�绱� +const catalogTree = ref() +const allSearchReault = ref([]) +const searchReaultData = reactive({ + isShow: true, + openIndex: 0 +}) + +const getAllSearchReault = () => { + allSearchReault.value = [] + console.log(window.qiankunState.searchBookByKeyword) + if (window.qiankunState && window.qiankunState.searchBookByKeyword) { + let searchReault = window.qiankunState.searchBookByKeyword(searchText.value) + if (searchReault.length > 0) { + let catalogueList = sortArr(catalogueData.value, 'chapter') + if (catalogueList.length > 0) { + catalogueList.forEach((item) => { + let labels = '' + if (item.length > 1) { + labels = item.map((i) => i.label).join('/') + } + let itemList = [] + searchReault.forEach((item1) => { + if (item[0].chapter == item1.catalog) { + itemList.push(item1) + } + }) + if (itemList.length > 0) { + allSearchReault.value.push({ + chapter: item[0].chapter, + chapterName: labels ? labels : item[0].label, + itemList: itemList + }) + } + }) + } + console.log(allSearchReault.value, 444) + } + } +} +function sortArr(arr, str) { + var _arr = [], + _t = [], + // 涓存椂鐨勫彉閲� + _tmp + + // 鎸夌収鐗瑰畾鐨勫弬鏁板皢鏁扮粍鎺掑簭灏嗗叿鏈夌浉鍚屽�煎緱鎺掑湪涓�璧� + arr = arr.sort(function (a, b) { + var s = a[str], + t = b[str] + + return s < t ? -1 : 1 + }) + + if (arr.length) { + _tmp = arr[0][str] + } + // console.log( arr ); + // 灏嗙浉鍚岀被鍒殑瀵硅薄娣诲姞鍒扮粺涓�涓暟缁� + for (var i in arr) { + if (arr[i][str] === _tmp) { + _t.push(arr[i]) + } else { + _tmp = arr[i][str] + _arr.push(_t) + _t = [arr[i]] + } + } + // 灏嗘渶鍚庣殑鍐呭鎺ㄥ嚭鏂版暟缁� + _arr.push(_t) + return _arr +} + +//妫�绱㈢珷鑺傛敹璧� +const searchOpen = (index) => { + searchReaultData.isShow = true + searchReaultData.openIndex = index +} +//妫�绱㈢珷鑺傛墦寮� +const searchClose = (index) => { + searchReaultData.isShow = false + searchReaultData.openIndex = index +} + +//妫�绱㈣烦杞� +const goSearchContent = (item) => { + console.log(item) + activeIndex.value = '0' + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.jumpSearchItem(item) + } +} + +//涔︾鍒楄〃 +const getReMarkList = () => { + reMarkList.value = [] + reMarkData.value = [] + MG.identity + .getUserKey({ + domain: 'reMark', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res && res.length > 0 && res[0].value) { + reMarkData.value = JSON.parse(res[0].value) + let list = JSON.parse(res[0].value) + list.forEach((item) => { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.name.indexOf(text) > -1) { + reMarkList.value.push(item) + } + } else { + reMarkList.value.push(item) + } + }) + } + }) +} + +//璺宠浆 +const goReMark = (item) => { + console.log(item) + activeIndex.value = '0' + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page)) + } +} +//涔︾鍒楄〃鍒犻櫎涔︾ +const deleteReMark = (item) => { + let list = reMarkList.value.filter((itemData) => itemData.id !== item.id) + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'reMark', + key: bookConfig.value.bookId, + value: JSON.stringify(list) + } + ] + }) + .then((res) => { + ElMessage({ + message: '鍒犻櫎涔︾鎴愬姛!', + type: 'success' + }) + getReMarkList() + }) +} + +//璧勬簮 +const classifySelectList = ref([]) //璧勬簮鍒楄〃 +//璧勬簮绫诲瀷 +const resourceType = ref('default') //榛樿/鏁欏笀 +const activeClassify = ref('') +const searchShow = ref(true) +const defaultResourceList = ref([]) +const teacherResourceList = ref([]) +const resourceDataList = ref([]) +const resourVisble = ref(false) +const resourType = ref('') //璧勬簮绫诲瀷鍥剧墖/闊抽 +const testVideo = ref('') //瑙嗛閾炬帴 +const testAudio = ref('') //闊抽閾炬帴 +const testWord = ref('') //word閾炬帴 +const playIndex = ref(null) //闊抽鎾斁 +const audioPlayer = ref(null) +const imgPreviewList = ref([]) +const imgUrl = ref() +const confirmDialog = ref<Boolean>(false) +const previewIndex = ref(0) + +const getResourceData = () => { + imgPreviewList.value = [] + axios + .get(bookConfig.value.resourceUrl + '/resource.json?t=12') + .then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (json.length > 0) { + defaultResourceList.value = [] + teacherResourceList.value = [] + // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺 + json.forEach((item) => { + if (item.iconPath) { + item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath + } else { + item.icon = '' + } + if (resourceType.value == 'default') { + if (item.isTeacherResource == '鍚�') { + defaultResourceList.value.push(item) + } + } else { + if (item.isTeacherResource == '鏄�') { + teacherResourceList.value.push(item) + } + } + }) + if (defaultResourceList.value.length > 0) { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + defaultResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else if (resItem.resourceType == '涔犻') { + if (activeClassify.value == 'exercises') { + resourceDataList.value.push(resItem) + } + exercisesCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ + } + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) + } + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (exercisesCount > 0) { + classifySelectList.value.push({ + title: '涔犻', + count: exercisesCount, + key: 'exercises' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + defaultResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } + } else { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + teacherResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else if (resItem.resourceType == '涔犻') { + if (activeClassify.value == 'exercises') { + resourceDataList.value.push(resItem) + } + exercisesCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ + } + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) + } + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (exercisesCount > 0) { + classifySelectList.value.push({ + title: '涔犻', + count: exercisesCount, + key: 'exercises' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + teacherResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } + } + } + }) + .catch(function (error) { + console.log(error) + }) +} +//璧勬簮鎾斁瑙嗛 +const goPlay = (data, index) => { + resourType.value = data.resourceType + if (data.resourceType == '瑙嗛') { + if (data.md5) { + testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 + } else { + testVideo.value = bookConfig.value.resourceUrl + '/' + data.resourcePath + } + resourVisble.value = true + } else if (data.resourceType == '闊抽') { + playIndex.value = index + if (data.md5) { + testAudio.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 + } else { + testAudio.value = bookConfig.value.resourceUrl + '/' + data.resourcePath + } + autoPlay() + } else { + if (data.md5) { + window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5) + } else if (data.resourcePath) { + window.open(bookConfig.value.resourceUrl + '/' + data.resourcePath) + } + } + + // else if (data.resourceType == 'word') { + // testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath + // } +} +// 鍏抽棴瑙嗛 +const resourVisbleClose = () => { + resourVisble.value = false + testVideo.value = '' +} +const autoPlay = () => { + if (audioPlayer.value) { + audioPlayer.value.play() + } +} +const goPause = () => { + playIndex.value = null + testAudio.value = '' +} + +//鏌ョ湅鎴浘 +const getCapture = (item, index) => { + imgUrl.value = item.imgUrl || item.resourcePath + previewIndex.value = index + confirmDialog.value = true +} +const closePreview = () => { + confirmDialog.value = false +} + +//璧勬簮璺宠浆鍒版寚瀹氫綅缃� +const JumpPosition = (data) => { + console.log(data, '璺宠浆') + activeIndex.value = '0' + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination)) + } +} + +//璧勬簮绫诲瀷閫夋嫨榛樿/鏁欏笀 +const selectResourceType = (type) => { + resourceType.value = type + searchText.value = '' + if (type == 'collection') { + } else { + getResourceData() + } +} +//璧勬簮绫诲瀷鍥剧墖/瑙嗛/闊抽/涔犻/鍏朵粬 +const classifyClick = (item) => { + activeClassify.value = item.key + resourceDataList.value = [] + searchText.value = '' + getResourceData() +} +const searchBtn = () => { + if (searchShow.value) { + searchShow.value = false + } else { + searchShow.value = true + } +} + +//绗旇锛岄珮浜紝鍒掔嚎 +const scribeData = reactive({ + isShow: true, + openIndex: 0, + loading: false, + scribeDataList: [], //鍒掔嚎鑿滃崟鍒楄〃 + lineHeightList: [], //楂樹寒鑿滃崟鍒楄〃 + noteList: [] //绗旇鑿滃崟鍒楄〃 +}) +const noteColorActive = ref('') +//绗旇寮圭獥 +const addNoteVisble = ref(false) +const isUpdate = ref(false) +const formData = reactive({ + id: '', + desc: '' +}) + +const colorSelectList = reactive([ + { + label: '榛勮壊', + key: '#F5E12A' + }, + { + label: '缁胯壊', + key: '#76F0AE' + }, + { + label: '钃濊壊', + key: '#59CFF5' + }, + { + label: '绱壊', + key: '#CAA5FC' + }, + { + label: '绮夎壊', + key: '#F5A0B9' + } +]) + +//鑿滃崟绗旇鍒楄〃 +const getNotesList = () => { + let chapterList = [] + catalogueData.value.forEach((item) => { + chapterList.push(item.chapter + '') + }) + let uniqueArray = [...new Set(chapterList)] + scribeData.noteList = [] + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: uniqueArray + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + // 鍌ㄥ�� + let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key)) + // console.log(data,'666') + let dataList = [] + if (catalogueData.value.length > 0) { + catalogueData.value.forEach((item1) => { + if (item1.chapter == Number(item.key)) { + dataList.push(item1) + } + }) + } + let labels = '' + if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/') + + let list = JSON.parse(item.value) + let itemList = [] + if (list.length > 0) { + list.forEach((item) => { + if (searchText.value) { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) { + if (menuState.notesColor == 'all') { + itemList = list + } else if (item.color == menuState.notesColor) { + itemList.push(item) + } + } + } else { + if (menuState.notesColor == 'all') { + itemList = list + } else if (item.color == menuState.notesColor) { + itemList.push(item) + } + } + }) + } + if (dataList[0].chapter == Number(item.key) && itemList.length > 0) { + scribeData.noteList.push({ + chapter: dataList[0].chapter, + chapterName: labels ? labels : dataList[0].label, + noteList: itemList + }) + } + } + console.log(scribeData.noteList, 'scribeData.noteList') + } + }) +} +//绗旇棰滆壊绛涢�� +const searchClick = (item) => { + if (item != 'all') { + menuState.notesColor = item.key + } else { + menuState.notesColor = 'all' + } + getNotesList() +} +//绗旇绔犺妭鏀惰捣 +const noteOpen = (index) => { + console.log(scribeData.isShow, index) + scribeData.isShow = true + scribeData.openIndex = index +} +//绗旇绔犺妭鎵撳紑 +const noteClose = (index) => { + scribeData.isShow = false + scribeData.openIndex = index +} +//绗旇璺宠浆 +const jumpContent = (item) => { + console.log(item) + activeIndex.value = '0' + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page)) + } +} + +//绗旇閫夐鑹� +const clickSelectColor = (item) => { + noteColorActive.value = item.key +} + +//鑿滃崟绗旇缂栬緫 +const update = (item) => { + console.log(item) + dialogToolData.chapter = item.chapterNum + noteColorActive.value = item.color + formData.id = item.id + formData.desc = item.note + addNoteVisble.value = true + isUpdate.value = true +} +const updateUserKey = () => { + let data = scribeData.noteList.find((item1) => item1.chapter == dialogToolData.chapter) + data.noteList.forEach((itemNote) => { + if ((itemNote.id = formData.id)) { + itemNote.note = formData.desc + itemNote.color = noteColorActive.value + } + }) + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'notes-' + bookConfig.value.bookId, + key: dialogToolData.chapter, + value: JSON.stringify(data.noteList) + } + ] + }) + .then((res) => { + addNoteVisble.value = false + isUpdate.value = false + getNotesList() + if (!window.qiankunState.disableSign) { + getSignData() + } + }) +} + +//绗旇寮圭獥鍏抽棴 +const handleClose = () => { + addNoteVisble.value = false + showToolBox.value = false + colorActive.value = '' +} + +//鑿滃崟鍒犻櫎绗旇 +const deleteBtn = (item) => { + let data = scribeData.noteList.find((item1) => item1.chapter == Number(item.chapterNum)) + // 绉婚櫎 + let list = data.noteList.filter((itemData) => itemData.id !== item.id) + ElMessageBox.confirm('纭畾瑕佸垹闄ゆ绗旇鍚楋紵', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'notes-' + bookConfig.value.bookId, + key: item.chapterNum, + value: JSON.stringify(list) + } + ] + }) + .then((res) => { + ElMessage({ + message: '鍒犻櫎绗旇鎴愬姛!', + type: 'success' + }) + getNotesList() + if (window.qiankunState && window.qiankunState.delSign) { + window.qiankunState.delSign({ ids: [item.id] }) + } + }) + }) + .catch(() => {}) +} + +const searchText = ref('') +const menuState = reactive({ + open: true, + notesColor: 'all' //绗旇棰滆壊 +}) +const searchBook = async () => { + switch (activeIndex.value) { + case '3': + getNotesList() + break + case '2': + let dataList = JSON.parse(JSON.stringify(resourceDataList.value)) + if (searchText.value) { + resourceDataList.value = [] + searchText.value = searchText.value.replace(/^\s*|\s*$/g, '') + let text = searchText.value.replace(/^\s*|\s*$/g, '') + dataList.forEach((item) => { + if (item.resourceName.indexOf(text) > -1) { + resourceDataList.value.push(item) + } + }) + } else { + getResourceData() + } + break + case '1': + getReMarkList() + break + case '7': + getAllSearchReault() + break + } +} +const handleClear = () => { + switch (activeIndex.value) { + case '3': + getNotesList() + break + case '2': + getResourceData() + break + case '1': + getReMarkList() + break + case '7': + break + } +} + +//閫変腑鏂囧瓧宸ュ叿鏍� +const showToolBox = ref(false) +const toolActive = ref('') +const colorActive = ref('') +const dialogToolData = reactive({ + left: 500, + top: 300, + txt: '', + page: '', + chapter: '', //閫変腑鏂囧瓧鎵�鍦ㄧ珷鑺� + lineHeight: [], //楂樹寒 + scribeList: [], //鍒掔嚎 + notesList: [] //绗旇 +}) + +///鍐呭閫変腑 +const getSelection = (data) => { + if (data.txt) { + toolActive.value = '' + dialogToolData.txt = data.txt + dialogToolData.page = data.page + dialogToolData.chapter = data.chapterNum + dialogToolData.left = data.x + dialogToolData.top = data.y + showToolBox.value = true + dictionaryData.showContent = false + lineDelete.showLineDelete = false + dictionaryData.showContent = false + } +} + +const clickSelect = (item) => { + colorActive.value = item.key + addUserKey() +} + +const addUserKey = () => { + let dom = '' + let data = null + switch (toolActive.value) { + case '楂樹寒': + dom = 'highLightData-' + bookConfig.value.bookId + data = dialogToolData.lineHeight[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Highlight', + color: colorActive.value + }) + break + case '鍒掔嚎': + dom = 'underline-' + bookConfig.value.bookId + data = dialogToolData.scribeList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Dashing', + color: colorActive.value + }) + break + case '绗旇': + if (!formData.desc.replace(/^\s*|\s*$/g, '')) { + ElMessage.error('绗旇鍐呭涓嶈兘涓虹┖!') + return + } + if (!noteColorActive.value) { + ElMessage.error('璇烽�夋嫨绗旇棰滆壊!') + return + } + dom = 'notes-' + bookConfig.value.bookId + data = dialogToolData.notesList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Note', + color: noteColorActive.value, + createDate: new Date(), + note: formData.desc.replace(/^\s*|\s*$/g, '') + }) + + break + } + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: dom, + key: dialogToolData.chapter, + value: JSON.stringify(data) + } + ] + }) + .then((res) => { + showToolBox.value = false + addNoteVisble.value = false + colorActive.value = '' + noteColorActive.value = '' + toolActive.value = '' + getSignData() + getNotesList() + }) +} + +const getSignData = () => { + MG.identity + .getUserKey({ + domain: 'highLightData-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.lineHeight[item.key] = data + // 娓叉煋 + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } + } + } + }) + MG.identity + .getUserKey({ + domain: 'underline-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.scribeList[item.key] = data + + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } + } + } + } + }) + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.notesList[item.key] = data + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } + } + } + } + }) +} + +//姝f枃涓垹闄ら珮浜紝鍒掔嚎锛岀瑪璁版搷浣滄 +const lineDelete = reactive({ + showLineDelete: false, + top: 0, + left: 0, + deleteType: '', + id: '' +}) + +//璁剧疆 +const settingDrawer = ref(false) +const settingForm = reactive({ + fontSizeList: [ + { + lable: '灏�', + key: 14 + }, + { + lable: '涓�', + key: 16 + }, + + { + lable: '澶�', + key: 18 + } + ], + fontSizeActive: 16, + bgColorList: [ + { + lable: '鐧�', + key: '#fff' + }, + { + lable: '榛�', + key: '#FBF9F4' + }, + { + lable: '缁�', + key: '#F2FFF7' + }, + { + lable: '绱�', + key: '#F6F4FC' + }, + { + lable: '绮�', + key: '#FFFAF9' + } + ], + bgColorActive: '#FBF9F4' +}) +// 璁剧疆瀛楀彿 +const fontSizeSelect = (item) => { + settingForm.fontSizeActive = item.key + window.qiankunActions.setGlobalState({ + fontSize: item.key + }) +} +//璁剧疆鑳屾櫙鑹� +const bgColorSelect = (item) => { + settingForm.bgColorActive = item.key +} +</script> + +<style lang="less"> +.mobileHomeBox { + width: 100%; + height: 100%; + .headerBox { + width: 100%; + height: 50px; + display: flex; + align-items: center; + position: fixed; + left: 0; + top: 0; + z-index: 2; + background-color: #fff; + border-bottom: 1px solid #e0e0e0; + .el-icon { + margin: 0 10px; + } + .bookName { + flex: 1; + text-align: center; + } + } + .footerBox { + width: 100%; + height: 50px; + position: fixed; + left: 0; + bottom: 0; + z-index: 2020; + background-color: #fff; + border-top: 1px solid #e0e0e0; + .el-menu-demo { + width: 100%; + justify-content: center; + .menu-item { + min-width: calc(100% / 4); + } + } + } + .contentBox { + margin: 50px 0; + height: 100%; + width: 100%; + .pageBox { + .pageBox-header { + width: 100%; + height: 30px; + padding: 0 10px; + line-height: 30px; + text-align: right; + } + .pageBox-content { + height: 100%; + height: calc(100vh - 130px); + #container { + background: #fbf9f4; + height: 100%; + #__qiankun_microapp_wrapper_for_app_content_1__ { + height: 100%; + } + } + } + } + .catalogBox { + height: calc(100vh - 100px); + .catalogTab { + height: 50px; + display: flex; + // justify-content: center; + align-items: center; + border-bottom: 1px solid #e0e0e0; + .tabItem { + flex: 1; + text-align: center; + .textActive { + color: #0093ff; + } + } + } + .catalogList { + height: calc(100vh - 150px); + overflow: auto; + padding: 20px; + } + .reMarkList { + padding: 20px; + .reMarkItem { + border-bottom: 1px solid #efefef; + padding: 10px 0; + .deleteReMarkImg { + text-align: right; + } + } + } + } + .searchBox { + padding: 5px; + + .inputBox { + width: 85%; + margin: 10px auto; + .custom-input { + border: 1px solid #0093ff !important; + border-radius: 50px; + overflow: hidden; + background: #fff; + height: 34px; + } + + .is-focus, + .el-input__wrapper { + box-shadow: none !important; + .el-input__inner { + border: none !important; + height: 34px !important; + } + } + .el-input-group__append { + padding: 0 10px !important; + background: none !important; + } + } + } + .resourceBox { + .resourceTab { + width: 100%; + height: 50px; + display: flex; + justify-content: center; + align-items: center; + font-size: 16px; + border-bottom: 1px solid #e0e0e0; + .tabItem { + flex: 1; + text-align: center; + line-height: 47px; + } + .text { + width: 43px; + height: 3px; + margin: 0 auto; + background: #0093ff; + border-radius: 3px 3px 0px 0px; + } + .line { + height: 3px; + } + } + .resourceSearchBox { + border-bottom: 1px solid #efefef; + } + .classification { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px; + .flex1 { + flex: 1; + text-align: center; + } + .title { + color: #999999; + } + .count { + width: 35px; + margin: 0 auto; + margin-top: 5px; + border-radius: 10px; + background: #fff; + color: #c8c8c8; + height: 18px; + font-size: 12px; + } + .activeClassify, + .classifyItem:hover { + .title { + color: #0093ff; + } + .count { + background: #0093ff; + color: #fff; + } + } + .showSearch { + .imgBox { + width: 39px; + height: 24px; + border-radius: 16px; + margin: 0 auto; + } + .imgBox:hover, + .activeSearch { + border: 1px solid #0093ff; + } + } + } + .inputBox { + margin: 0 auto !important; + } + .resourceList { + padding: 20px; + .resourceItem { + padding: 10px 0; + display: flex; + .resourceImg { + width: 150px; + height: 80px; + background: #fff; + border-radius: 5px; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + position: relative; + border: 1px solid #efefef; + img { + height: 100%; + width: 100%; + object-fit: contain; + } + } + .rName { + flex: 1; + margin-left: 20px; + position: relative; + .handleBox { + position: absolute; + bottom: 0; + left: 0; + .el-icon { + margin-right: 10px; + } + } + } + } + } + } + .screenBox { + display: flex; + padding: 0 10px; + width: 350px; + .title { + margin: 0; + padding: 0 10px; + border: none; + } + + .flex1 { + flex: 1; + display: flex; + // align-items: center; + justify-content: space-between; + } + + .all { + width: 50px; + height: 22px; + border-radius: 17px; + margin: 0px 10px 10px 0; + border: 1px solid #d8d8d8; + text-align: center; + line-height: 20px; + font-size: 12px; + } + + .allActive { + width: 50px; + height: 22px; + border-radius: 17px; + margin: 0px 10px 10px 0; + text-align: center; + line-height: 20px; + color: #fff; + background: #0093ff; + border: 1px solid #0093ff; + font-size: 12px; + } + + .scribeItem { + width: 18px; + height: 18px; + border-radius: 3px; + margin: 0px auto; + border: none; + } + + .activeScribe { + border: 1px solid #0093ff; + } + } + + .noteBox { + .chapterName { + margin: 15px; + display: flex; + align-items: center; + span { + margin-left: 5px; + } + } + .listItem { + border-bottom: 1px solid rgba(212, 212, 212, 0.16); + position: relative; + margin: 10px; + line-height: 20px; + background: #fff; + border-radius: 5px; + padding: 10px 0; + .textBox { + .title { + display: flex; + justify-content: space-between; + align-items: center; + margin-right: 10px; + .border-left { + height: 25px; + border-right: 4px solid; + border-radius: 0 5px 5px 0; + margin-right: 10px; + } + .title-con { + display: flex; + align-items: center; + color: #949494; + .round { + width: 10px; + height: 10px; + border-radius: 50%; + margin-right: 5px; + } + } + + img { + margin-left: 5px; + } + } + .chapter { + color: #b7b7b7; + margin: 5px 5px 5px 14px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + border-left: 3px solid #b7b7b7; + border-left-radius: 20px; + padding: 0 5px; + } + } + .noteText { + margin: 10px 10px 10px 15px; + border-radius: 3px; + padding: 2px 5px; + .con { + max-height: 65px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; + } + } + } + } + .allSearch { + padding: 20px; + .allSearchList { + .searchItem { + margin: 15px; + background: #fff; + border-radius: 10px; + padding: 10px; + display: flex; + .index { + line-height: 24px; + width: 25px; + } + .searchCon { + flex: 1; + width: 240px; + overflow: hidden; + margin-right: 8px; + height: 45px; + line-height: 22px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + text-overflow: ellipsis; + } + } + } + } + } + .settingBox{ + margin-bottom: 50px !important; + } +} +</style> diff --git a/src/views/home.vue b/src/views/readerPages/webHome.vue similarity index 68% rename from src/views/home.vue rename to src/views/readerPages/webHome.vue index 73d43c4..d7fb39c 100644 --- a/src/views/home.vue +++ b/src/views/readerPages/webHome.vue @@ -6,14 +6,19 @@ <span></span> <div class="userInfoBox"> <div class="userName" v-if="userInfo.name">{{ userInfo.name }}</div> - <div><div class="layout hover" @click="layoutBtn">閫�鍑�</div></div> + <div v-if="token"><div class="layout hover" @click="layoutBtn">閫�鍑�</div></div> + <div v-else><div class="layout hover" @click="goLogin">鐧诲綍</div></div> </div> </div> <div class="contentBox"> <!-- 鑿滃崟 --> <div class="menuBox"> - <div v-for="(item, index) in menuData" :key="index" @click="menuItemClick(item.name)"> - <div :class="['menuItem', activeMenu == item.name ? 'active' : '']" v-if="item.isShow"> + <div v-for="(item, index) in menuData" :key="index"> + <div + :class="['menuItem', activeMenu == item.name ? 'active' : '']" + @click="menuItemClick(item.name)" + v-if="item.isShow" + > <div class="menuIcon imgBox"> <img :src="item.icon" /> </div> @@ -88,41 +93,21 @@ <!-- 鑿滃崟鍐呭 --> <div class="menuContent" v-if="menuState.open"> <div class="searchBox"> - <div class="inputBox" v-if="activeMenu !== '璧勬簮'"> + <div class="inputBox" v-if="activeMenu !== '璧勬簮' && activeMenu !== '涔犻'"> <el-input class="custom-input" placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchText" @keyup.enter="searchBook" + clearable + @clear="handleClear" > <template #prefix> - <el-icon><Search /></el-icon> - </template> - <template #suffix> - <svg - @click="searchBook" - xmlns="http://www.w3.org/2000/svg" - width="24" - height="24" - viewBox="0 0 24 24" - fill="none" - stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" - class="icon icon-tabler icons-tabler-outline icon-tabler-list-search hover" - > - <path stroke="none" d="M0 0h24v24H0z" fill="none" /> - <path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /> - <path d="M18.5 18.5l2.5 2.5" /> - <path d="M4 6h16" /> - <path d="M4 12h4" /> - <path d="M4 18h4" /> - </svg> + <img :src="listSearch" @click="searchBook" class="hover" /> </template> </el-input> </div> - <div v-else class="resourceTab"> + <div v-if="activeMenu == '璧勬簮'" class="resourceTab"> <div class="tabItem hover" @click="selectResourceType('default')"> <div>榛樿璧勬簮</div> <div :class="resourceType == 'default' ? 'text' : 'line'"></div> @@ -133,15 +118,26 @@ <div :class="resourceType == 'teacher' ? 'text' : 'line'"></div> </div> </div> + <div v-if="activeMenu == '涔犻'" class="resourceTab"> + <div class="tabItem hover" @click="selectExercisesType('exercises')"> + <div>涔犻</div> + <div :class="exercisesType == 'exercises' ? 'text' : 'line'"></div> + </div> + <hr class="hr" /> + <div class="tabItem hover" @click="selectExercisesType('wrong')"> + <div>閿欓鏈�</div> + <div :class="exercisesType == 'wrong' ? 'text' : 'line'"></div> + </div> + </div> </div> <!-- 鐩綍 --> - <div class="menuList" v-if="activeMenu == '鐩綍'"> + <div class="menuList" v-if="activeMenu == '鐩綍'" v-loading="listLoading"> <el-tree ref="catalogTree" default-expand-all="true" :expand-on-click-node="false" - highlight-current node-key="start" + highlight-current :data="catalogueData" :props="defaultProps" v-if="catalogueData.length > 0" @@ -154,9 +150,45 @@ <span class="pageNum">{{ data.page }}</span> </div> </template> + <template #empty> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </template> </el-tree> - <div v-else> - <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + <div v-else></div> + </div> + <div class="allSearch" v-if="activeMenu == '妫�绱�'"> + <div class="list-box" v-loading="listLoading"> + <div v-if="allSearchReault.length > 0" class="allSearchList"> + <div v-for="(reault, index) in allSearchReault" :key="index"> + <div class="chapterName"> + <el-icon + @click="searchClose(index)" + v-if="searchReaultData.isShow && searchReaultData.openIndex == index" + class="hover" + ><ArrowDown + /></el-icon> + <el-icon @click="searchOpen(index)" v-else class="hover"><ArrowRight /></el-icon> + <span>{{ reault.chapterName }} 锛坽{ reault.itemList.length }}锛�</span> + </div> + <div + v-for="(item, index1) in reault.itemList" + :key="index1" + class="searchItem" + v-show="searchReaultData.isShow && searchReaultData.openIndex == index" + > + <div class="index">{{ index1 + 1 }}.</div> + <div + class="searchCon hover" + @click="goSearchContent(item)" + v-html="item.txt1" + :title="item.txt" + ></div> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> </div> </div> <!-- 绗旇 --> @@ -178,7 +210,7 @@ ></div> </div> </div> - <div class="list-box"> + <div class="list-box" v-loading="listLoading"> <div v-if="scribeData.noteList.length > 0"> <div v-for="(noteItem, index) in scribeData.noteList" :key="noteItem"> <div class="chapterName"> @@ -244,8 +276,8 @@ </div> </div> <!-- 璧勬簮 --> - <div class="" v-if="activeMenu == '璧勬簮'"> - <div class="resourceBox" v-if="classifySelectList.length > 0"> + <div class="resourceBox" v-if="activeMenu == '璧勬簮'" v-loading="listLoading"> + <div class="resourceSearchBox" v-if="classifySelectList.length > 0"> <div class="classification"> <div v-for="item in classifySelectList" @@ -274,31 +306,11 @@ placeholder="璇疯緭鍏ュ唴瀹�" v-model="searchText" @keyup.enter="searchBook" + clearable + @clear="handleClear" > <template #prefix> - <el-icon><Search /></el-icon> - </template> - <template #suffix> - <svg - @click="searchBook" - xmlns="http://www.w3.org/2000/svg" - width="20" - height="20" - viewBox="0 0 20 20" - fill="none" - stroke="currentColor" - stroke-width="2" - stroke-linecap="round" - stroke-linejoin="round" - class="icon icon-tabler icons-tabler-outline icon-tabler-list-search hover" - > - <path stroke="none" d="M0 0h24v24H0z" fill="none" /> - <path d="M15 15m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /> - <path d="M18.5 18.5l2.5 2.5" /> - <path d="M4 6h16" /> - <path d="M4 12h4" /> - <path d="M4 18h4" /> - </svg> + <img :src="listSearch" @click="searchBook" class="hover" /> </template> </el-input> </div> @@ -313,8 +325,13 @@ @mouseover="showHandle = index" @mouseleave="showHandle = null" > - <img :src="item.icon" mode="" v-if="item.icon" /> - <el-icon v-else-if="activeClassify == 'image'" size="30"><Picture /></el-icon> + <img :src="item.resourcePath" mode="" v-if="activeClassify == 'image'" /> + <img + :src="item.icon" + mode="" + v-else-if="item.icon && activeClassify != 'image'" + /> + <!-- <el-icon v-else-if="activeClassify == 'image'" size="30"></el-icon> --> <el-icon v-else-if="activeClassify == 'audio'" size="30"><Headset /></el-icon> <el-icon v-else-if="activeClassify == 'video'" size="30" ><VideoCamera @@ -340,11 +357,18 @@ ><VideoPlay /></el-icon> <el-icon - @click="goPlay(item)" + @click="goPlay(item, index)" size="20" class="icon hover" - v-if="item.resourceType == '闊抽'" - ><Headset + v-if="item.resourceType == '闊抽' && playIndex != index" + ><VideoPlay + /></el-icon> + <el-icon + @click="goPause()" + size="20" + class="icon hover" + v-if="item.resourceType == '闊抽' && playIndex == index" + ><VideoPause /></el-icon> <el-icon @click="getCapture(item, index)" @@ -363,7 +387,7 @@ item.resourceType == '闊抽' || item.resourceType == '涔犻' || item.resourceType == '鍥剧墖' - ) + ) && item.isDownload == '鏄�' " ><Download /></el-icon> @@ -389,8 +413,8 @@ </div> </div> <!-- 鎴浘 --> - <div class="" v-if="activeMenu == '鎴浘'"> - <div class="list-box"> + <div class="screenshotList" v-if="activeMenu == '鎴浘'"> + <div class="list-box" v-loading="listLoading"> <div class="screenshot" v-if="screenshotList.length > 0"> <div v-for="(item, index) in screenshotList" :key="item" class="captureItem"> <div class="imgBox" @mouseover="showDelete = index" @mouseleave="showDelete = null"> @@ -413,14 +437,50 @@ </div> </div> </div> - <!-- 鏍囩 --> - <div class="" v-if="activeMenu == '涔︾'"> - <div class="list-box"> + <!-- 涔︾ --> + <div class="reMarkList" v-if="activeMenu == '涔︾'"> + <div class="list-box" v-loading="listLoading"> <div v-if="reMarkList.length > 0"> <div v-for="(item, index) in reMarkList" :key="index" class="reMarkItem"> - <div class="reMarkCon">{{ item.chapterName }} P{{ item.page }}</div> + <div class="reMarkCon hover" @click="goReMark(item)"> + <span class="con">{{ item.content }}</span> <span>P{{ item.page }}</span> + </div> <div class="deleteReMarkImg"> <img :src="shanchu" class="icon hover" @click="deleteReMark(item)" /> + </div> + </div> + </div> + <div v-else> + <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> + </div> + </div> + </div> + <div class="questionList" v-if="activeMenu == '涔犻'"> + <div class="resourceSearchBox"> + <div class="inputBox"> + <el-input + class="custom-input" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="searchText" + @keyup.enter="searchBook" + clearable + @clear="handleClear" + > + <template #prefix> + <img :src="listSearch" @click="searchBook" class="hover" /> + </template> + </el-input> + </div> + </div> + <div class="list-box" v-loading="listLoading"> + <div v-if="questionList.length > 0"> + <div v-for="(item, index) in questionList" :key="index" class="reMarkItem"> + <div + class="questionCon hover" + @click="JumpPosition(item)" + :title="item.resourceName" + > + {{ item.resourceName }} </div> </div> </div> @@ -471,9 +531,9 @@ </div> <div class="rightBox"> <div class="pageSizeBox"> - <div><img :src="zoomOut" @click="changePageSize('reduce')" /></div> + <div class="hover"><img :src="zoomOut" @click="changePageSize('reduce')" /></div> <div>{{ headerData.pageSize }}%</div> - <div><img :src="zoomIn" @click="changePageSize('add')" /></div> + <div class="hover"><img :src="zoomIn" @click="changePageSize('add')" /></div> </div> <!-- <div class="brushImgBox"> <div @click="jumpContent('note' + index)"> @@ -713,9 +773,8 @@ </div> <div class="menuList"> <ul class="menu" v-if="teachToolsMenuData.length > 0"> - <li v-for="item in teachToolsMenuData" :key="item.key"> + <li v-for="item in teachToolsMenuData" :key="item.key" class="hover"> <div - :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" :style="!toolState.open ? 'padding:10px 15px' : ''" v-if="item.isShow" @click="selectTeachTools(item)" @@ -726,7 +785,10 @@ </li> </ul> </div> - <div :class="['openBox', toolState.open ? 'right' : '']"> + <div + :class="['openBox', toolState.open ? 'right' : '']" + v-if="teachToolsMenuData.length > 0" + > <!-- <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> --> <!-- <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> --> <svg @@ -810,12 +872,7 @@ :style="`left:${floatingToolData.elLeft}px`" v-if="floatingToolBox.length > 0" > - <div - class="hover" - v-for="item in floatingToolBox" - :key="item.name" - @click="floatItemHandle(item)" - > + <div v-for="item in floatingToolBox" :key="item.name" @click="floatItemHandle(item)"> <div v-if="item.isShow"> <el-popover placement="right" @@ -852,13 +909,24 @@ </div> </template> </el-popover> + <div class="floatToolItem mark" v-if="floatingToolData.activeBookmark == '涔︾'"> + <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> + <div class="imgBox"> + <img :src="tagW" alt="" v-if="floatingToolData.activeBookmark == item.name" /> + <img :src="item.icon" alt="" v-else /> + </div> + </el-tooltip> + </div> <div :class=" floatingToolData.activeToolData == item.name ? 'floatToolActive floatToolItem' : 'floatToolItem' " - v-else + v-else-if=" + floatingToolData.activeToolData != '涔︾' && + floatingToolData.activeToolData != '鏍囪' + " > <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> <div class="imgBox"> @@ -890,7 +958,7 @@ </div> </div> </div> - <div class="toolSelectBox" v-show="!(toolActive == '楂樹寒' || toolActive == '鍒掔嚎')"> + <div class="toolSelectBox" v-show="toolActive != '楂樹寒' && toolActive != '鍒掔嚎'"> <div v-for="item in dialogToolList" :key="item.icon" @click="dialogToolHandle(item)"> <div :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" @@ -915,12 +983,12 @@ <!-- <el-button @click="delUserKey">鍒犻櫎</el-button> --> <div class="dialogToolItem"> <el-tooltip class="box-item" effect="dark" content="鍒犻櫎" placement="bottom"> - <img :src="trash" @click="delUserKey" /> + <img :src="deleteIcon" @click="delUserKey" /> </el-tooltip> </div> - <div class="dialogToolItem"> - <el-tooltip class="box-item" effect="dark" content="绗旇" placement="bottom" v-if="isUpdate"> - <img :src="noteUpdate" @click="updateNote" /> + <div class="dialogToolItem" v-if="isUpdate"> + <el-tooltip class="box-item" effect="dark" content="绗旇" placement="bottom"> + <img :src="biji2" @click="updateNote" /> </el-tooltip> </div> </div> @@ -943,14 +1011,23 @@ :style="{ top: `${dialogToolData.top}px`, left: `${dialogToolData.left}px` }" > <div class="content"> + <div class="word">{{ dictionaryData.data.word }}</div> <div class="phone_con"> <div class="per-phone"> - 鑻� /<span>{{ dictionaryData.data.ukPhone }}</span - >/ + 鑻� <span>/{{ dictionaryData.data.ukPhone }}/</span + ><img + :src="sound" + class="soundBtn hover" + @click="soundWord(dictionaryData.data.word, 'en-UK')" + /> </div> <div class="per-phone"> - 缇� /<span>{{ dictionaryData.data.usPhone }}</span - >/ + 缇� <span>/{{ dictionaryData.data.usPhone }}/</span + ><img + :src="sound" + class="soundBtn hover" + @click="soundWord(dictionaryData.data.word, 'en-US')" + /> </div> </div> <div class="trans"> @@ -964,18 +1041,26 @@ </div> </div> - <el-dialog title="璧勬簮" align-center v-model="resourVisble" width="845" class="resourDialog"> + <el-dialog + title="璧勬簮" + align-center + v-model="resourVisble" + width="845" + class="resourDialog" + :before-close="resourVisbleClose" + > <div class="videoBox" v-if="resourType == '瑙嗛'"> <video controls controlslist="nodownload" :src="testVideo"></video> </div> - <div class="videoBox" v-if="resourType == '闊抽'"> - <!-- <video controls controlslist="nodownload" :src="testVideo"></video> --> - <audio ref="audioPlayer" :src="testVideo" controls></audio> - </div> + <!-- <div class="wordBox" v-if="resourType == 'word'"> <vue-office-docx :src="testWord" /> </div> --> </el-dialog> + <div class="audioBox" v-show="false"> + <!-- <video controls controlslist="nodownload" :src="testVideo"></video> --> + <audio ref="audioPlayer" :src="testAudio" controls @loadedmetadata="autoPlay"></audio> + </div> <!-- 鍥剧墖 --> <el-image-viewer v-if="confirmDialog" @@ -1082,11 +1167,15 @@ <iframe src="https://adjam93.github.io/threejs-model-viewer/#" frameborder="0"></iframe> </div> </el-dialog> + <el-dialog title="鐢熻瘝鍗$墖" align-center v-model="shengciVisble" width="800" class="myDialogs"> + <div class="wendabox"> + <newWord :resourceUrl="resourceUrl" /> + </div> + </el-dialog> </template> <script setup lang="ts"> -import { ref, reactive, watch, onMounted, onBeforeMount, inject } from 'vue' -import { ctxUrl } from '@/assets/js/config' +import { ref, reactive, watch, onMounted, onBeforeMount, onBeforeUnmount, inject } from 'vue' import { useRouter, useRoute } from 'vue-router' import useClipboard from 'vue-clipboard3' const { toClipboard } = useClipboard() @@ -1099,6 +1188,7 @@ let route = useRoute() import moment from 'moment' import dictionary from '@/views/components/dictionary.vue' +import newWord from '@/views/components/newWord.vue' import { ElMessage, ElMessageBox, valueEquals } from 'element-plus' import logo from '@/assets/images/header/logo.png' import mulu from '@/assets/images/menu/mulu.png' @@ -1107,10 +1197,13 @@ import zhishitupu from '@/assets/images/menu/zhishitupu.png' import jietu from '@/assets/images/menu/jietu.png' import biaoqian from '@/assets/images/menu/biaoqian.png' +import allSearch from '@/assets/images/menu/allSearch.svg' import topbg from '@/assets/images/header/top-bg.png' import setting from '@/assets/images/operation/setting.png' import search from '@/assets/images/operation/search.png' import search1 from '@/assets/images/operation/search1.png' +import sound from '@/assets/images/operation/sound.png' +import listSearch from '@/assets/images/operation/list-search.svg' import aIzhinengwenda from '@/assets/images/menu/AIzhinengwenda.png' import aIyuyinyuedu from '@/assets/images/menu/AIyuyinyuedu.png' @@ -1129,56 +1222,57 @@ import daiban from '@/assets/images/menu/daiban.png' import shouqiR from '@/assets/images/menu/shouqi-R.png' import shouqiL from '@/assets/images/menu/shouqi-L.png' -import charuziyuan from '../assets/images/operation/charuziyuan.png' -import charuziyuan_blue from '../assets/images/operation/charuziyuan_blue.png' -import dati_charu from '../assets/images/operation/dati_charu.png' -import dati_charu_blue from '../assets/images/operation/dati_charu_blue.png' -import xiake from '../assets/images/operation/xiake.png' +import charuziyuan from '@/assets/images/operation/charuziyuan.png' +import charuziyuan_blue from '@/assets/images/operation/charuziyuan_blue.png' +import dati_charu from '@/assets/images/operation/dati_charu.png' +import dati_charu_blue from '@/assets/images/operation/dati_charu_blue.png' +import xiake from '@/assets/images/operation/xiake.png' -import huabi from '../assets/images/operation/huabi-w.png' -import wenzi2 from '../assets/images/operation/wenzi.png' -import biaoqianw from '../assets/images/operation/biaoqian-w.png' -import baiban from '../assets/images/operation/baiban-w.png' -import biaozhu from '../assets/images/operation/pencil-minus.svg' -import jieping from '../assets/images/operation/screenshot-w.png' -import clearPrevious from '../assets/images/operation/clearPrevious.png' -import hide from '../assets/images/operation/hide.png' -import show from '../assets/images/operation/show.png' -import tuichu from '../assets/images/operation/tuichu.png' -import tuxing from '../assets/images/operation/tuxing.png' -import chongzuo from '../assets/images/operation/chongzuo.png' -import qingchu2 from '../assets/images/operation/qingchu.png' +import huabi from '@/assets/images/operation/huabi-w.png' +import wenzi2 from '@/assets/images/operation/wenzi.png' +import biaoqianw from '@/assets/images/operation/biaoqian-w.png' +import tagW from '@/assets/images/operation/tag-w.svg' +import baiban from '@/assets/images/operation/baiban-w.png' +import biaozhu from '@/assets/images/operation/pencil-minus.svg' +import jieping from '@/assets/images/operation/screenshot-w.png' +import clearPrevious from '@/assets/images/operation/clearPrevious.png' +import hide from '@/assets/images/operation/hide.png' +import show from '@/assets/images/operation/show.png' +import tuichu from '@/assets/images/operation/tuichu.png' +import tuxing from '@/assets/images/operation/tuxing.png' +import chongzuo from '@/assets/images/operation/chongzuo.png' +import qingchu2 from '@/assets/images/operation/qingchu.png' -import gaoliang from '../assets/images/operation/gaoliang.png' -import gaoliang1 from '../assets/images/operation/gaoliang-b.png' -import huaxian from '../assets/images/operation/huaxian.png' -import huaxian1 from '../assets/images/operation/huaxian1.png' -import biji2 from '../assets/images/operation/biji.png' -import biji1 from '../assets/images/operation/biji-b.png' -import biaozhu2 from '../assets/images/operation/biaozhu.png' -import biaozhu3 from '../assets/images/operation/biaozhu1.png' -import fuzhi from '../assets/images/operation/fuzhi.png' -import fuzhi1 from '../assets/images/operation/fuzhi-b.png' -import AIyuedu from '../assets/images/operation/AIyuedu.png' -import AIyuedu1 from '../assets/images/operation/AIyuedu-b.png' -import cidian2 from '../assets/images/operation/cidian.png' -import cidian1 from '../assets/images/operation/cidian-b.png' -import baidu from '../assets/images/operation/baidu.png' -import baidu1 from '../assets/images/operation/baidu-b.png' -import yuyinyuedu from '../assets/images/operation/yuyinyuedu.png' -import yuyinyuedu1 from '../assets/images/operation/yuyinyuedu-b.png' -import xuanzhong from '../assets/images/operation/xuanzhong.png' -import xuanzhong1 from '../assets/images/operation/xuanzhong1.png' +import gaoliang from '@/assets/images/operation/gaoliang.png' +import gaoliang1 from '@/assets/images/operation/gaoliang-b.png' +import huaxian from '@/assets/images/operation/huaxian.png' +import huaxian1 from '@/assets/images/operation/huaxian1.png' +import biji2 from '@/assets/images/operation/biji.png' +import biji1 from '@/assets/images/operation/biji-b.png' +import biaozhu2 from '@/assets/images/operation/biaozhu.png' +import biaozhu3 from '@/assets/images/operation/biaozhu1.png' +import fuzhi from '@/assets/images/operation/fuzhi.png' +import fuzhi1 from '@/assets/images/operation/fuzhi-b.png' +import AIyuedu from '@/assets/images/operation/AIyuedu.png' +import AIyuedu1 from '@/assets/images/operation/AIyuedu-b.png' +import cidian2 from '@/assets/images/operation/cidian.png' +import cidian1 from '@/assets/images/operation/cidian-b.png' +import baidu from '@/assets/images/operation/baidu.png' +import baidu1 from '@/assets/images/operation/baidu-b.png' +import yuyinyuedu from '@/assets/images/operation/yuyinyuedu.png' +import yuyinyuedu1 from '@/assets/images/operation/yuyinyuedu-b.png' +import xuanzhong from '@/assets/images/operation/xuanzhong.png' +import xuanzhong1 from '@/assets/images/operation/xuanzhong1.png' -import zoomIn from '../assets/images/operation/zoomIn.png' -import zoomOut from '../assets/images/operation/zoomOut.png' -import huabi2 from '../assets/images/operation/huabi.svg' -import trash from '../assets/images/operation/trash.svg' -import noteUpdate from '../assets/images/operation/Note-b.svg' +import zoomIn from '@/assets/images/operation/zoomIn.png' +import zoomOut from '@/assets/images/operation/zoomOut.png' +import huabi2 from '@/assets/images/operation/huabi.svg' +import deleteIcon from '@/assets/images/operation/delete1.svg' +import noteUpdate from '@/assets/images/operation/Note-b.svg' -import shanchu from '../assets/images/operation/delete.png' -import bianji from '../assets/images/operation/bianji.png' -import video from '../assets/images/content/resource.png' +import shanchu from '@/assets/images/operation/delete.png' +import bianji from '@/assets/images/operation/bianji.png' +import video from '@/assets/images/content/resource.png' //寮曞叆VueOfficeDocx缁勪欢 import VueOfficeDocx from '@vue-office/docx' //寮曞叆鐩稿叧鏍峰紡 @@ -1191,6 +1285,7 @@ import { loadMicroApp } from 'qiankun' import { microApps } from '@/child.ts' +let token = localStorage.getItem('token') const canvasWith = ref(1000) const canvasheight = ref(3000) const screenWidth = ref( @@ -1202,7 +1297,9 @@ const activeCatalog = ref() const reMarResult = ref() onMounted(() => { - getUserInfo() + if (token) { + getUserInfo() + } setTimeout(() => { canvasWith.value = document.querySelector('.content-box').offsetWidth canvasheight.value = document.querySelector('.content-box').offsetHeight @@ -1220,9 +1317,8 @@ window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth })() } - // 鍔犺浇寰簲鐢� - microApp = loadMicroApp(microApps.book1, { + microApp = loadMicroApp(microApps[localStorage.getItem('bookId')], { sandbox: { strictStyleIsolation: true, experimentalStyleIsolation: true @@ -1233,6 +1329,7 @@ window.qiankunActions.onGlobalStateChange((state, prev) => { console.log('鐖跺眰state鍙樺寲', state) window.qiankunState = state + if (window.qiankunState && window.qiankunState.initTestBook) { window.qiankunState.initTestBook( localStorage.getItem('bookId') + '', @@ -1243,7 +1340,8 @@ // 瀹氫箟鐖跺眰鏂规硶 window.qiankunActions.setGlobalState({ - state: 1, // 鍔犺浇瀛愬簲鐢� + state: 1, + disableSign: false, windowSelection: (data) => { // 缁戝畾瀛愬簲鐢ㄩ�夋嫨鐩戝惉浜嬩欢 console.log(data, '瀛愬簲鐢ㄩ�夋嫨') @@ -1253,6 +1351,7 @@ showToolBox.value = false lineDelete.showLineDelete = false dictionaryData.showContent = false + isUpdate.value = false toolActive.value = '' lineDelete.top = data.y + 20 lineDelete.left = data.x @@ -1260,30 +1359,47 @@ }, chooseWords: (data) => { console.log(data, '鑻辫鐢熻瘝') - if (data) { - dialogToolData.txt = data.word - dialogToolData.left = data.x - dialogToolData.top = data.y + 20 - getSearchResult() + switch (data.type) { + case 'word': + if (data) { + dialogToolData.txt = data.word + dialogToolData.left = data.x + dialogToolData.top = data.y + 20 + getSearchResult() + } + break + case 'swdt': + console.log() + siweiVisble.value = true + break + case 'readText': + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterances = new SpeechSynthesisUtterance(data.data) + // utterances.lang = 'EN' // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterances) + + break } }, getBookConfig: (data) => { console.log(data.bookConfig, '鍥句功閰嶇疆') bookConfig.value = data.bookConfig getCatalogueData() - getResourceData() + // getResourceData() getTextbookComponents() - getReMarkList() + // getReMarkList() }, catalogChange: (data) => { activeCatalog.value = data.showCatalogList - getSignData() + if (!window.qiankunState.disableSign && token) { + getSignData() + } console.log(data, '绔犺妭鍒囨崲锛氱洰鍓嶆樉绀虹殑涓変釜绔犺妭') }, pageChange: (data) => { headerData.process = Number(data.page) currentChapter.value = data.catalog - // catalogTree.value.filter(Number(data.start)) console.log(data, '椤甸潰鍒囨崲锛氱洰鍓嶆樉绀洪〉闈㈠拰瀵瑰簲鐨勭珷鑺備俊鎭�') if (catalogTree.value) { catalogTree.value.setCurrentKey(Number(data.page)) @@ -1291,20 +1407,31 @@ showToolBox.value = false lineDelete.showLineDelete = false dictionaryData.showContent = false + + reMarkCon.value = data.text reMarResult.value = reMarkData.value.find((item) => { return item.chapterNum == data.catalog && item.page == data.page }) if (reMarResult.value) { + floatingToolData.activeBookmark = '涔︾' floatingToolData.activeToolData = '涔︾' } else { + floatingToolData.activeBookmark = '' floatingToolData.activeToolData = '' } } }) - // 璋冪敤瀛愬眰鏂规硶 - // if (window.qiankunState && window.qiankunState.aa) window.qiankunState.aa(1) + // // 璋冪敤瀛愬眰鏂规硶 + // if (window.qiankunState && window.qiankunState.getAnswers){ + // window.qiankunState.getAnswers(localStorage.getItem("")) + // } }) +onBeforeUnmount(() => { + if (microApp) { + microApp.unmount() // 鍗歌浇寰簲鐢� + } +}) // watch( // () => screenWidth.value, // (val) => { @@ -1326,21 +1453,26 @@ if (res) { let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') + let wechatInfo = res.infoList.find((item) => item.type == 'WeChat') + let studentInfo = res.infoList.find((item) => item.type == 'Default') let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') - if (nameAndPassword) { + if (teacherRole && teacherInfos) { userInfo.value = { - name: nameAndPassword.credential - } - localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) - } else if (teacherRole && teacherInfos) { - userInfo.value = { + ...teacherInfos, name: teacherInfos.name, role: 'Teacher', roleId: teacherRole.role.id } localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) + } else if (wechatInfo) { + userInfo.value = { + ...wechatInfo, + phoneNumber: phoneInfo?.credential, + Email: emailInfo?.credential, + role: 'Student' + } } else if (phoneInfo) { userInfo.value = { name: phoneInfo.credential @@ -1367,6 +1499,11 @@ isShow: bookConfig.value.textbookComponents.indexOf('1E16353F') > -1 }, { + name: '妫�绱�', + icon: allSearch, + isShow: bookConfig.value.textbookComponents.indexOf('B7C5B45D') > -1 + }, + { name: '绗旇', icon: biji, isShow: bookConfig.value.textbookComponents.indexOf('A3298FCF') > -1 @@ -1390,7 +1527,12 @@ name: '涔︾', icon: biaoqian, isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 - } + }, + // { + // name: '涔犻', + // icon: zhishitupu, + // isShow: true + // } ] teachToolsMenuData = [ { @@ -1404,7 +1546,7 @@ isShow: bookConfig.value.textbookComponents.indexOf('83FB80FD') > -1 }, { - name: '鐢熷瓧鍗$墖', + name: '鐢熻瘝鍗$墖', icon: shengzikapian, isShow: bookConfig.value.textbookComponents.indexOf('38D32EE3') > -1 }, @@ -1535,10 +1677,12 @@ ] } +const listLoading = ref(false) //鑾峰彇鐩綍 const catalogueData = ref([]) const getCatalogueData = () => { + listLoading.value = true axios .get(bookConfig.value.resourceUrl + '/information.json') .then(function (response) { @@ -1547,6 +1691,7 @@ console.log(json, '鐩綍') catalogueData.value = json.data headerData.totlePage = json.data[json.data.length - 1].end + listLoading.value = false }) .catch(function (error) { console.log(error) @@ -1555,7 +1700,7 @@ const defaultProps = { children: 'children', label: 'label', - page: 'page' + start: 'start' } const filterNode = (value, data) => { @@ -1565,9 +1710,22 @@ const handleNodeClick = (data) => { console.log(data) - headerData.process = data.start - if (window.qiankunState && window.qiankunState.gotoPage) - window.qiankunState.gotoPage(data.chapter, data.start) + if (localStorage.getItem('tryPageCount')) { + if (data.start < localStorage.getItem('tryPageCount')) { + headerData.process = data.start + if (window.qiankunState && window.qiankunState.gotoPage) + window.qiankunState.gotoPage(data.chapter, data.start) + } else { + ElMessage({ + message: '璇曡宸茬粨鏉�!', + type: 'warning' + }) + } + } else { + headerData.process = data.start + if (window.qiankunState && window.qiankunState.gotoPage) + window.qiankunState.gotoPage(data.chapter, data.start) + } } //鑾峰彇璧勬簮 @@ -1583,208 +1741,227 @@ const resourVisble = ref(false) const resourType = ref('') //璧勬簮绫诲瀷鍥剧墖/闊抽 const testVideo = ref('') //瑙嗛閾炬帴 +const testAudio = ref('') //闊抽閾炬帴 const testWord = ref('') //word閾炬帴 const showHandle = ref(null) - +const playIndex = ref(null) //闊抽鎾斁 +const audioPlayer = ref(null) const getResourceData = () => { - imgPreviewList.value = [] - axios - .get(bookConfig.value.resourceUrl + '/resource.json?t=12') - .then(function (response) { - var json = response.data - // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 - if (json.length > 0) { - defaultResourceList.value = [] - teacherResourceList.value = [] - // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺 - json.forEach((item) => { - if (resourceType.value == 'default') { - if (item.isTeacherResource == '鍚�') { - defaultResourceList.value.push(item) + if (token) { + imgPreviewList.value = [] + listLoading.value = true + axios + .get(bookConfig.value.resourceUrl + '/resource.json?t=12') + .then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (json.length > 0) { + defaultResourceList.value = [] + teacherResourceList.value = [] + // 鑾峰彇鏁扮粍涓墍鏈夊璞$殑age灞炴�х殑鏁伴噺 + json.forEach((item) => { + if (item.iconPath) { + item.icon = bookConfig.value.resourceUrl + '/' + item.iconPath + } else { + item.icon = '' + } + if (resourceType.value == 'default') { + if (item.isTeacherResource == '鍚�') { + defaultResourceList.value.push(item) + } + } else { + if (item.isTeacherResource == '鏄�') { + teacherResourceList.value.push(item) + } + } + }) + if (defaultResourceList.value.length > 0) { + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + defaultResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ + } + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) + } + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) + } + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) + } + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + defaultResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) } } else { - if (item.isTeacherResource == '鏄�') { - teacherResourceList.value.push(item) + let imgCount = 0 + let audioCount = 0 + let videoCount = 0 + let exercisesCount = 0 + let otherCount = 0 + resourceDataList.value = [] + teacherResourceList.value.forEach((resItem) => { + if (resItem.resourceType == '鍥剧墖') { + if (resItem.resourcePath) { + resItem.resourcePath = bookConfig.value.resourceUrl + '/' + resItem.resourcePath + } else { + resItem.resourcePath = + bookConfig.value.requestCtx + '/file/GetPreViewImage?md5=' + resItem.md5 + } + imgPreviewList.value.push(resItem.resourcePath) + if (activeClassify.value == 'image') { + resourceDataList.value.push(resItem) + } + imgCount++ + } else if (resItem.resourceType == '闊抽') { + if (activeClassify.value == 'audio') { + resourceDataList.value.push(resItem) + } + audioCount++ + } else if (resItem.resourceType == '瑙嗛') { + if (activeClassify.value == 'video') { + resourceDataList.value.push(resItem) + } + videoCount++ + } else { + if (activeClassify.value == 'other') { + resourceDataList.value.push(resItem) + } + otherCount++ + } + }) + classifySelectList.value = [] + if (imgCount > 0) { + classifySelectList.value.push({ + title: '鍥剧墖', + count: imgCount, + key: 'image' + }) } - } - }) - if (defaultResourceList.value.length > 0) { - let imgCount = 0 - let audioCount = 0 - let videoCount = 0 - let exercisesCount = 0 - let otherCount = 0 - resourceDataList.value = [] - defaultResourceList.value.forEach((resItem) => { - if (resItem.resourceType == '鍥剧墖') { - if (activeClassify.value == 'image') { - resourceDataList.value.push(resItem) - } - imgCount++ - } else if (resItem.resourceType == '闊抽') { - if (activeClassify.value == 'audio') { - resourceDataList.value.push(resItem) - } - audioCount++ - } else if (resItem.resourceType == '瑙嗛') { - if (activeClassify.value == 'video') { - resourceDataList.value.push(resItem) - } - videoCount++ - } else if (resItem.resourceType == '涔犻') { - if (activeClassify.value == 'exercises') { - resourceDataList.value.push(resItem) - } - exercisesCount++ - } else { - if (activeClassify.value == 'other') { - resourceDataList.value.push(resItem) - } - otherCount++ + if (audioCount > 0) { + classifySelectList.value.push({ + title: '闊抽', + count: audioCount, + key: 'audio' + }) } - }) - classifySelectList.value = [] - if (imgCount > 0) { - classifySelectList.value.push({ - title: '鍥剧墖', - count: imgCount, - key: 'image' - }) - imgPreviewList.value = resourceDataList.value - } - if (audioCount > 0) { - classifySelectList.value.push({ - title: '闊抽', - count: audioCount, - key: 'audio' - }) - } - if (videoCount > 0) { - classifySelectList.value.push({ - title: '瑙嗛', - count: videoCount, - key: 'video' - }) - } - if (exercisesCount > 0) { - classifySelectList.value.push({ - title: '涔犻', - count: exercisesCount, - key: 'exercises' - }) - } - if (otherCount > 0) { - classifySelectList.value.push({ - title: '鍏朵粬', - count: otherCount, - key: 'other' - }) - } - if (!activeClassify.value) { - activeClassify.value = classifySelectList.value[0].key - defaultResourceList.value.forEach((resItem1) => { - if (resItem1.resourceType == classifySelectList.value[0].title) { - resourceDataList.value.push(resItem1) - } - }) - } - } else { - let imgCount = 0 - let audioCount = 0 - let videoCount = 0 - let exercisesCount = 0 - let otherCount = 0 - resourceDataList.value = [] - teacherResourceList.value.forEach((resItem) => { - if (resItem.resourceType == '鍥剧墖') { - if (activeClassify.value == 'image') { - resourceDataList.value.push(resItem) - } - imgCount++ - } else if (resItem.resourceType == '闊抽') { - if (activeClassify.value == 'audio') { - resourceDataList.value.push(resItem) - } - audioCount++ - } else if (resItem.resourceType == '瑙嗛') { - if (activeClassify.value == 'video') { - resourceDataList.value.push(resItem) - } - videoCount++ - } else if (resItem.resourceType == '涔犻') { - if (activeClassify.value == 'exercises') { - resourceDataList.value.push(resItem) - } - exercisesCount++ - } else { - if (activeClassify.value == 'other') { - resourceDataList.value.push(resItem) - } - otherCount++ + if (videoCount > 0) { + classifySelectList.value.push({ + title: '瑙嗛', + count: videoCount, + key: 'video' + }) } - }) - classifySelectList.value = [] - if (imgCount > 0) { - classifySelectList.value.push({ - title: '鍥剧墖', - count: imgCount, - key: 'image' - }) - imgPreviewList.value = resourceDataList.value - } - if (audioCount > 0) { - classifySelectList.value.push({ - title: '闊抽', - count: audioCount, - key: 'audio' - }) - } - if (videoCount > 0) { - classifySelectList.value.push({ - title: '瑙嗛', - count: videoCount, - key: 'video' - }) - } - if (exercisesCount > 0) { - classifySelectList.value.push({ - title: '涔犻', - count: exercisesCount, - key: 'exercises' - }) - } - if (otherCount > 0) { - classifySelectList.value.push({ - title: '鍏朵粬', - count: otherCount, - key: 'other' - }) - } - if (!activeClassify.value) { - activeClassify.value = classifySelectList.value[0].key - teacherResourceList.value.forEach((resItem1) => { - if (resItem1.resourceType == classifySelectList.value[0].title) { - resourceDataList.value.push(resItem1) - } - }) + if (otherCount > 0) { + classifySelectList.value.push({ + title: '鍏朵粬', + count: otherCount, + key: 'other' + }) + } + if (!activeClassify.value) { + activeClassify.value = classifySelectList.value[0].key + teacherResourceList.value.forEach((resItem1) => { + if (resItem1.resourceType == classifySelectList.value[0].title) { + resourceDataList.value.push(resItem1) + } + }) + } } } - } + listLoading.value = false + }) + .catch(function (error) { + console.log(error) + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) - .catch(function (error) { - console.log(error) - }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } //璧勬簮鎾斁瑙嗛 -const goPlay = (data) => { +const goPlay = (data, index) => { resourType.value = data.resourceType - if (data.resourceType == '瑙嗛' || data.resourceType == '闊抽') { - resourVisble.value = true + if (data.resourceType == '瑙嗛') { if (data.md5) { testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 } else { testVideo.value = bookConfig.value.resourceUrl + '/' + data.resourcePath } + resourVisble.value = true + } else if (data.resourceType == '闊抽') { + playIndex.value = index + if (data.md5) { + testAudio.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 + } else { + testAudio.value = bookConfig.value.resourceUrl + '/' + data.resourcePath + } + autoPlay() } else { if (data.md5) { window.open(bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5) @@ -1797,9 +1974,25 @@ // testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath // } } +// 鍏抽棴瑙嗛 +const resourVisbleClose = () => { + resourVisble.value = false + testVideo.value = '' +} +const autoPlay = () => { + if (audioPlayer.value) { + audioPlayer.value.play() + } +} +const goPause = () => { + playIndex.value = null + testAudio.value = '' +} +// //璧勬簮璺宠浆鍒版寚瀹氫綅缃� const JumpPosition = (data) => { + console.log(data, '璺宠浆') if (window.qiankunState && window.qiankunState.gotoPage) { window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination)) } @@ -1826,12 +2019,63 @@ } } +//涔犻 +const exercisesType = ref('exercises') //涔犻绫诲瀷 +const questionList = ref([]) +const getExercisesList = () => { + if (token) { + listLoading.value = true + questionList.value = [] + axios.get(bookConfig.value.resourceUrl + '/resource.json').then(function (response) { + var json = response.data + // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 + if (json.length > 0) { + json.forEach((item) => { + if (item.resourceType == '涔犻') { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.resourceName.indexOf(text) > -1) { + questionList.value.push(item) + } + } else { + questionList.value.push(item) + } + } + }) + } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } +} +const selectExercisesType = (type) => { + exercisesType.value = type + searchText.value = '' + + if (type == 'exercises') { + getExercisesList() + } else { + questionList.value = [] + } +} + // 閫変腑鑿滃崟 const activeMenu = ref('鐩綍') // 鑿滃崟鐐瑰嚮 const menuItemClick = (name) => { searchText.value = '' + allSearchReault.value = [] if (menuState.open && activeMenu.value == name) { menuState.open = false } else { @@ -1845,6 +2089,7 @@ getNotesList() break case '璧勬簮': + getResourceData() break case '鐭ヨ瘑鍥捐氨': break @@ -1853,6 +2098,11 @@ break case '涔︾': getReMarkList() + break + case '妫�绱�': + break + case '涔犻': + getExercisesList() break } } @@ -1899,6 +2149,10 @@ animation: false, bgColorList: [ { + lable: '鐧�', + key: '#fff' + }, + { lable: '榛�', key: '#FBF9F4' }, @@ -1936,6 +2190,9 @@ }) } const bgColorSelect = (item) => { + window.qiankunActions.setGlobalState({ + bgColor: item.key + }) settingForm.bgColorActive = item.key } //绗旇棰滆壊绛涢�� @@ -1960,6 +2217,11 @@ } const catalogTree = ref() +const allSearchReault = ref([]) +const searchReaultData = reactive({ + isShow: true, + openIndex: 0 +}) const searchBook = async () => { switch (activeMenu.value) { case '鐩綍': @@ -1991,6 +2253,127 @@ case '涔︾': getReMarkList() break + case '涔犻': + getExercisesList() + break + case '妫�绱�': + listLoading.value = true + allSearchReault.value = [] + console.log(window.qiankunState.searchBookByKeyword) + if (window.qiankunState && window.qiankunState.searchBookByKeyword) { + let searchReault = window.qiankunState.searchBookByKeyword(searchText.value) + if (searchReault.length > 0) { + let catalogueList = sortArr(catalogueData.value, 'chapter') + if (catalogueList.length > 0) { + catalogueList.forEach((item) => { + let labels = '' + if (item.length > 1) { + labels = item.map((i) => i.label).join('/') + } + let itemList = [] + let text = searchText.value.replace(/^\s*|\s*$/g, '') + searchReault.forEach((item1) => { + if (item[0].chapter == item1.catalog) { + item1.txt1 = item1.txt + let replaceStr = "<span class='searchColor'>" + text + '</span>' + + let htmlStr = item1.txt1.split(text).join(replaceStr) + item1.txt1 = '<p>' + htmlStr + '</p>' + itemList.push(item1) + } + }) + if (itemList.length > 0) { + allSearchReault.value.push({ + chapter: item[0].chapter, + chapterName: labels ? labels : item[0].label, + itemList: itemList + }) + } + }) + } + console.log(allSearchReault.value, 444) + listLoading.value = false + } + } + break + } +} + +function sortArr(arr, str) { + var _arr = [], + _t = [], + // 涓存椂鐨勫彉閲� + _tmp + + // 鎸夌収鐗瑰畾鐨勫弬鏁板皢鏁扮粍鎺掑簭灏嗗叿鏈夌浉鍚屽�煎緱鎺掑湪涓�璧� + arr = arr.sort(function (a, b) { + var s = a[str], + t = b[str] + + return s < t ? -1 : 1 + }) + + if (arr.length) { + _tmp = arr[0][str] + } + // console.log( arr ); + // 灏嗙浉鍚岀被鍒殑瀵硅薄娣诲姞鍒扮粺涓�涓暟缁� + for (var i in arr) { + if (arr[i][str] === _tmp) { + _t.push(arr[i]) + } else { + _tmp = arr[i][str] + _arr.push(_t) + _t = [arr[i]] + } + } + // 灏嗘渶鍚庣殑鍐呭鎺ㄥ嚭鏂版暟缁� + _arr.push(_t) + return _arr +} +//妫�绱㈢珷鑺傛敹璧� +const searchOpen = (index) => { + searchReaultData.isShow = true + searchReaultData.openIndex = index +} +//妫�绱㈢珷鑺傛墦寮� +const searchClose = (index) => { + searchReaultData.isShow = false + searchReaultData.openIndex = index +} + +//妫�绱㈣烦杞� +const goSearchContent = (item) => { + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.jumpSearchItem(item) + } +} + +const handleClear = () => { + switch (activeMenu.value) { + case '鐩綍': + if (catalogTree) catalogTree.value.filter(searchText.value) + break + case '绗旇': + getNotesList() + break + case '璧勬簮': + getResourceData() + break + case '鐭ヨ瘑鍥捐氨': + break + case '鎴浘': + getScreenshotList() + break + case '涔︾': + getReMarkList() + break + case '妫�绱�': + allSearchReault.value = [] + break + case '涔犻': + getExercisesList() + break } } @@ -2000,29 +2383,47 @@ const functionVisible = ref(false) const siweiVisble = ref(false) const modelToolVisble = ref(false) +const shengciVisble = ref(false) const activeTool = ref(0) const toolState = reactive({ open: true }) +const resourceUrl = ref('') const selectTeachTools = (item) => { - activeTool.value = item.name - switch (item.name) { - case 'AI鏅鸿兘闂瓟': - wendaVisible.value = true - break - case 'GGB鍑芥暟宸ュ叿': - functionVisible.value = true - break - case '鎬濈淮瀵煎浘': - siweiVisble.value = true - break - case '妯″瀷宸ュ叿': - modelToolVisble.value = true - break - case '璇嶅吀': - cidianVisible.value = true - break + if (token) { + activeTool.value = item.name + switch (item.name) { + case 'AI鏅鸿兘闂瓟': + wendaVisible.value = true + break + case 'GGB鍑芥暟宸ュ叿': + functionVisible.value = true + break + case '鎬濈淮瀵煎浘': + siweiVisble.value = true + break + case '妯″瀷宸ュ叿': + modelToolVisble.value = true + break + case '璇嶅吀': + cidianVisible.value = true + break + case '鐢熻瘝鍗$墖': + resourceUrl.value = bookConfig.value.resourceUrl + shengciVisble.value = true + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) } } @@ -2055,6 +2456,7 @@ let canvas = null const floatingToolData = reactive({ activeToolData: '', //閫変腑宸ュ叿 + activeBookmark: '', //閫変腑涔︾ elLeft: 390, startclientx: 0, startclienty: 0 @@ -2084,9 +2486,6 @@ console.log(floatingToolData.activeToolData, 'floatingToolData.activeToolData') if (floatingToolData.activeToolData == '鐢荤瑪') { floatingToolData.activeToolData = '' - } else if (floatingToolData.activeToolData == '涔︾') { - delReMark() - floatingToolData.activeToolData = '' } else { floatingToolData.activeToolData = item.name } @@ -2100,7 +2499,10 @@ case '鏍囪': break case '涔︾': - reMark() + if (floatingToolData.activeBookmark != '涔︾') { + floatingToolData.activeBookmark = '涔︾' + reMark() + } break case '鎴睆': jitT() @@ -2185,8 +2587,18 @@ console.log(str, '鏍囪') if (str == 'hide') { if (window.qiankunState && window.qiankunState.delSign) { - window.qiankunState.delSign({ ids: [] }) + window.qiankunState.delSign({ type: 'Highlight' }) + window.qiankunState.delSign({ type: 'Dashing' }) + window.qiankunState.delSign({ type: 'Note' }) } + window.qiankunActions.setGlobalState({ + disableSign: true + }) + } else { + window.qiankunActions.setGlobalState({ + disableSign: false + }) + getSignData() } } @@ -2195,63 +2607,111 @@ const reMarkList = ref([]) const reMarkData = ref([]) const reMarkId = ref([]) +const reMarkCon = ref('') const reMark = () => { - let chapterData = catalogueData.value.find((item) => item.chapter == Number(currentChapter.value)) - console.log(chapterData) - if (chapterData) { - reMarkData.value.push({ - id: toolClass.uuid(8), - createDate: new Date(), - page: headerData.process, - chapterNum: currentChapter.value, - chapterName: chapterData.label - }) - MG.identity - .setUserKey({ - setKeyRequests: [ - { - domain: 'reMark', - key: bookConfig.value.bookId, - value: JSON.stringify(reMarkData.value) - } - ] + if (token) { + let chapterData = catalogueData.value.find( + (item) => item.chapter == Number(currentChapter.value) + ) + if (catalogueData.value.length > 0) { + catalogueData.value.forEach((item1) => { + if (item1.chapter == Number(currentChapter.value) && item1.start == headerData.process) { + chapterData.label = item1.label + } }) - .then((res) => { - floatingToolData.activeToolData = '' - ElMessage({ - message: '娣诲姞涔︾鎴愬姛!', - type: 'success' + } + + if (chapterData) { + reMarkData.value.push({ + id: toolClass.uuid(8), + createDate: new Date(), + page: headerData.process, + chapterNum: currentChapter.value, + chapterName: chapterData.label, + content: reMarkCon.value || chapterData.label + }) + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'reMark', + key: bookConfig.value.bookId, + value: JSON.stringify(reMarkData.value) + } + ] }) - getReMarkList() + .then((res) => { + floatingToolData.activeToolData = '' + + ElMessage({ + message: '娣诲姞涔︾鎴愬姛!', + type: 'success' + }) + getReMarkList() + }) + .catch(function (error) {}) + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') }) - .catch(function (error) {}) + .catch(() => {}) } } const getReMarkList = () => { - reMarkList.value = [] - reMarkData.value = [] - MG.identity - .getUserKey({ - domain: 'reMark', - keys: [bookConfig.value.bookId] - }) - .then((res) => { - if (res && res.length > 0 && res[0].value) { - reMarkData.value = JSON.parse(res[0].value) - let list = JSON.parse(res[0].value) - list.forEach((item) => { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (searchText.value) { - if (item.name.indexOf(text) > -1) { + if (token) { + reMarkList.value = [] + reMarkData.value = [] + listLoading.value = true + MG.identity + .getUserKey({ + domain: 'reMark', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res && res.length > 0 && res[0].value) { + reMarkData.value = JSON.parse(res[0].value) + let list = JSON.parse(res[0].value) + list.forEach((item) => { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.content.indexOf(text) > -1) { + reMarkList.value.push(item) + } + } else { reMarkList.value.push(item) } - } else { - reMarkList.value.push(item) - } - }) - } + }) + } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } +} + +//璺宠浆 +const goReMark = (item) => { + console.log(item) + if (window.qiankunState && window.qiankunState.gotoPage) { + window.qiankunState.gotoPage(Number(item.chapterNum), Number(item.page)) + } } // 鍐呭椤靛垹闄や功绛� const delReMark = () => { @@ -2299,12 +2759,25 @@ //鎴浘 //鎴浘浜嬩欢 function jitT() { - const screenShotHandler = new ScreenShort({ - enableWebRtc: false, // 鏄惁鏄剧ず閫夐」妗� - level: 99, // 灞傜骇绾у埆 - completeCallback: callback, //纭鍥炶皟 - closeCallback: closeFn //鍙栨秷鍥炶皟 - } as any) + if (token) { + const screenShotHandler = new ScreenShort({ + enableWebRtc: false, // 鏄惁鏄剧ず閫夐」妗� + level: 999, // 灞傜骇绾у埆 + completeCallback: callback, //纭鍥炶皟 + closeCallback: closeFn //鍙栨秷鍥炶皟 + } as any) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } //纭鍥炶皟 const callback = (val: any) => { @@ -2323,7 +2796,7 @@ if (isUpdateImg.value) { screenshotData.value = [] screenshotList.value.forEach((itemNote) => { - if ((itemNote.id = screenshotId.value)) { + if (itemNote.id == screenshotId.value) { itemNote.name = nameData.value } }) @@ -2369,41 +2842,55 @@ } const getScreenshotList = () => { - screenshotData.value = [] - screenshotList.value = [] - imgPreviewList.value = [] - MG.identity - .getUserKey({ - domain: 'screenshot', - keys: [bookConfig.value.bookId] - }) - .then((res) => { - if (res && res.length > 0 && res[0].value) { - screenshotData.value = JSON.parse(res[0].value) - let list = JSON.parse(res[0].value) - list.forEach((item) => { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (searchText.value) { - if (item.name.indexOf(text) > -1) { + if (token) { + screenshotData.value = [] + screenshotList.value = [] + imgPreviewList.value = [] + listLoading.value = true + MG.identity + .getUserKey({ + domain: 'screenshot', + keys: [bookConfig.value.bookId] + }) + .then((res) => { + if (res && res.length > 0 && res[0].value) { + screenshotData.value = JSON.parse(res[0].value) + let list = JSON.parse(res[0].value) + list.forEach((item) => { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (searchText.value) { + if (item.name.indexOf(text) > -1) { + screenshotList.value.push(item) + imgPreviewList.value.push(item.imgUrl) + } + } else { screenshotList.value.push(item) imgPreviewList.value.push(item.imgUrl) } - } else { - screenshotList.value.push(item) - imgPreviewList.value.push(item.imgUrl) - } - }) - } + }) + } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } //鏌ョ湅鎴浘 const getCapture = (item, index) => { - imgUrl.value = item.imgUrl + imgUrl.value = item.imgUrl || item.resourcePath previewIndex.value = index confirmDialog.value = true } const closePreview = () => { - imgPreviewList.value = [] confirmDialog.value = false } // 缂栬緫鎴浘鍚嶇О @@ -2468,6 +2955,9 @@ dialogToolData.left = data.x dialogToolData.top = data.y showToolBox.value = true + dictionaryData.showContent = false + lineDelete.showLineDelete = false + dictionaryData.showContent = false } } @@ -2530,53 +3020,71 @@ const synth = window.speechSynthesis const dialogToolHandle = async (item) => { - toolActive.value = item.name - colorActive.value = '' - switch (item.name) { - case 'AI闃呰': - const utterance = new SpeechSynthesisUtterance(dialogToolData.txt) - utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂� - synth.speak(utterance) - showToolBox.value = false - break - case '鍒掔嚎': - break - case '楂樹寒': - break - case '绗旇': - formData.desc = '' - noteColorActive.value = '#F5E12A' - addNoteVisble.value = true - showToolBox.value = false - break - case '鏍囨敞': - break - case '澶嶅埗': - try { - //澶嶅埗 - await toClipboard(dialogToolData.txt) - //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣� - ElMessage({ - message: '澶嶅埗鎴愬姛', - type: 'success' - }) - } catch (err) { - ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err) - } - showToolBox.value = false - toolActive.value = '' - break - case '璇嶅吀': - getSearchResult() + if (token) { + toolActive.value = item.name + colorActive.value = '' + switch (item.name) { + case 'AI闃呰': + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterance = new SpeechSynthesisUtterance(dialogToolData.txt) + console.log(utterance, 1) + utterance.lang = 'zh-CN' // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterance) + showToolBox.value = false + break + case '鍒掔嚎': + break + case '楂樹寒': + break + case '绗旇': + formData.desc = '' + noteColorActive.value = '#F5E12A' + addNoteVisble.value = true + showToolBox.value = false + break + case '鏍囨敞': + break + case '澶嶅埗': + try { + //澶嶅埗 + await toClipboard(dialogToolData.txt) + //涓嬮潰鍙互璁剧疆澶嶅埗鎴愬姛鐨勬彁绀烘绛夋搷浣� + ElMessage({ + message: '澶嶅埗鎴愬姛', + type: 'success' + }) + } catch (err) { + ElMessage.error('鏃犳硶澶嶅埗鏂囨湰锛�' + err) + } + showToolBox.value = false + toolActive.value = '' + break + case '璇嶅吀': + getSearchResult() - showToolBox.value = false - // cidianVisible.value = true - console.log(dialogToolData.txt) - break - case '鐧剧': - console.log('https://baike.baidu.com/item/' + dialogToolData.txt) - baiduVisible.value = true - break + showToolBox.value = false + // cidianVisible.value = true + console.log(dialogToolData.txt) + break + case '鐧剧': + console.log('https://baike.baidu.com/item/' + dialogToolData.txt) + baiduVisible.value = true + break + } + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' + }) + .then(() => { + router.push('/login') + }) + .catch(() => { + showToolBox.value = false + }) } } @@ -2590,213 +3098,257 @@ } const addUserKey = () => { - let dom = '' - let data = null - switch (toolActive.value) { - case '楂樹寒': - dom = 'highLightData-' + bookConfig.value.bookId - data = dialogToolData.lineHeight[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Highlight', - color: colorActive.value - }) - break - case '鍒掔嚎': - dom = 'underline-' + bookConfig.value.bookId - data = dialogToolData.scribeList[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Dashing', - color: colorActive.value - }) - break - case '绗旇': - if (!formData.desc.replace(/^\s*|\s*$/g, '')) { - ElMessage.error('绗旇鍐呭涓嶈兘涓虹┖!') - return - } - if (!noteColorActive.value) { - ElMessage.error('璇烽�夋嫨绗旇棰滆壊!') - return - } - dom = 'notes-' + bookConfig.value.bookId - data = dialogToolData.notesList[dialogToolData.chapter] - if (!data) data = [] - data.push({ - id: toolClass.uuid(8), - txt: dialogToolData.txt, - page: dialogToolData.page, - chapterNum: dialogToolData.chapter, - type: 'Note', - color: noteColorActive.value, - createDate: new Date(), - note: formData.desc.replace(/^\s*|\s*$/g, '') - }) - - break - } - MG.identity - .setUserKey({ - setKeyRequests: [ - { - domain: dom, - key: dialogToolData.chapter, - value: JSON.stringify(data) + if (token) { + let dom = '' + let data = null + switch (toolActive.value) { + case '楂樹寒': + dom = 'highLightData-' + bookConfig.value.bookId + data = dialogToolData.lineHeight[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Highlight', + color: colorActive.value + }) + break + case '鍒掔嚎': + dom = 'underline-' + bookConfig.value.bookId + data = dialogToolData.scribeList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Dashing', + color: colorActive.value + }) + break + case '绗旇': + if (!formData.desc.replace(/^\s*|\s*$/g, '')) { + ElMessage.error('绗旇鍐呭涓嶈兘涓虹┖!') + return } - ] + if (!noteColorActive.value) { + ElMessage.error('璇烽�夋嫨绗旇棰滆壊!') + return + } + dom = 'notes-' + bookConfig.value.bookId + data = dialogToolData.notesList[dialogToolData.chapter] + if (!data) data = [] + data.push({ + id: toolClass.uuid(8), + txt: dialogToolData.txt, + page: dialogToolData.page, + chapterNum: dialogToolData.chapter, + type: 'Note', + color: noteColorActive.value, + createDate: new Date(), + note: formData.desc.replace(/^\s*|\s*$/g, '') + }) + + break + } + MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: dom, + key: dialogToolData.chapter, + value: JSON.stringify(data) + } + ] + }) + .then((res) => { + showToolBox.value = false + addNoteVisble.value = false + colorActive.value = '' + noteColorActive.value = '' + toolActive.value = '' + getSignData() + getNotesList() + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) - .then((res) => { - showToolBox.value = false - addNoteVisble.value = false - colorActive.value = '' - noteColorActive.value = '' - toolActive.value = '' - getSignData() - getNotesList() - }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } const getSignData = () => { - MG.identity - .getUserKey({ - domain: 'highLightData-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.lineHeight[item.key] = data - // 娓叉煋 - for (let j = 0; j < data.length; j++) { - const citem = data[j] - console.log(citem.type, citem) - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + if (token) { + MG.identity + .getUserKey({ + domain: 'highLightData-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.lineHeight[item.key] = data + // 娓叉煋 + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } } } - } - }) - MG.identity - .getUserKey({ - domain: 'underline-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.scribeList[item.key] = data + }) + MG.identity + .getUserKey({ + domain: 'underline-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.scribeList[item.key] = data - // 娓叉煋 - for (let j = 0; j < data.length; j++) { - const citem = data[j] - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } + } } } - } - }) - MG.identity - .getUserKey({ - domain: 'notes-' + bookConfig.value.bookId, - keys: activeCatalog.value.map((item) => item + '') - }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - const data = JSON.parse(item.value) - // 鍌ㄥ�� - dialogToolData.notesList[item.key] = data - // 娓叉煋 - for (let j = 0; j < data.length; j++) { - const citem = data[j] - if (window.qiankunState && window.qiankunState.renderSign) - window.qiankunState.renderSign(citem.type, citem) + }) + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: activeCatalog.value.map((item) => item + '') + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + const data = JSON.parse(item.value) + // 鍌ㄥ�� + dialogToolData.notesList[item.key] = data + // 娓叉煋 + if (data.length > 0) { + for (let j = 0; j < data.length; j++) { + const citem = data[j] + if (window.qiankunState && window.qiankunState.renderSign) + window.qiankunState.renderSign(citem.type, citem) + } + } } } - } + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } //鑿滃崟绗旇鍒楄〃 const getNotesList = () => { - let chapterList = [] - catalogueData.value.forEach((item) => { - chapterList.push(item.chapter + '') - }) - let uniqueArray = [...new Set(chapterList)] - scribeData.noteList = [] - MG.identity - .getUserKey({ - domain: 'notes-' + bookConfig.value.bookId, - keys: uniqueArray + if (token) { + let chapterList = [] + listLoading.value = true + catalogueData.value.forEach((item) => { + chapterList.push(item.chapter + '') }) - .then((res) => { - if (res && res.length > 0) { - for (let i = 0; i < res.length; i++) { - const item = res[i] - // 鍌ㄥ�� - let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key)) - // console.log(data,'666') - let dataList = [] - if (catalogueData.value.length > 0) { - catalogueData.value.forEach((item1) => { - if (item1.chapter == Number(item.key)) { - dataList.push(item1) - } - }) - } - let labels = '' - if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/') + let uniqueArray = [...new Set(chapterList)] + scribeData.noteList = [] + MG.identity + .getUserKey({ + domain: 'notes-' + bookConfig.value.bookId, + keys: uniqueArray + }) + .then((res) => { + if (res && res.length > 0) { + for (let i = 0; i < res.length; i++) { + const item = res[i] + // 鍌ㄥ�� + let data = catalogueData.value.find((item1) => item1.chapter == Number(item.key)) + // console.log(data,'666') + let dataList = [] + if (catalogueData.value.length > 0) { + catalogueData.value.forEach((item1) => { + if (item1.chapter == Number(item.key)) { + dataList.push(item1) + } + }) + } + let labels = '' + if (dataList.length > 1) labels = dataList.map((item) => item.label).join('/') - let list = JSON.parse(item.value) - let itemList = [] - if (list.length > 0) { - list.forEach((item) => { - if (searchText.value) { - let text = searchText.value.replace(/^\s*|\s*$/g, '') - if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) { + let list = JSON.parse(item.value) + let itemList = [] + if (list.length > 0) { + list.forEach((item) => { + if (searchText.value) { + let text = searchText.value.replace(/^\s*|\s*$/g, '') + if (item.note.indexOf(text) > -1 || item.txt.indexOf(text) > -1) { + if (menuState.notesColor == 'all') { + itemList.push(item) + } else if (item.color == menuState.notesColor) { + itemList.push(item) + } + } + } else { if (menuState.notesColor == 'all') { - itemList = list + itemList.push(item) } else if (item.color == menuState.notesColor) { itemList.push(item) } } - } else { - if (menuState.notesColor == 'all') { - itemList = list - } else if (item.color == menuState.notesColor) { - itemList.push(item) - } - } - }) + }) + } + if (dataList[0].chapter == Number(item.key) && itemList.length > 0) { + scribeData.noteList.push({ + chapter: dataList[0].chapter, + chapterName: labels ? labels : dataList[0].label, + noteList: itemList + }) + } } - if (dataList[0].chapter == Number(item.key) && itemList.length > 0) { - scribeData.noteList.push({ - chapter: dataList[0].chapter, - chapterName: labels ? labels : dataList[0].label, - noteList: itemList - }) - } + console.log(scribeData.noteList, 'scribeData.noteList') } - console.log(scribeData.noteList, 'scribeData.noteList') - } + listLoading.value = false + }) + } else { + ElMessageBox.confirm('璇峰厛鐧诲綍锛�', { + confirmButtonText: '鍘荤櫥褰�', + cancelButtonText: '鍙栨秷', + autofocus: false, + type: 'warning' }) + .then(() => { + router.push('/login') + }) + .catch(() => {}) + } } //姝f枃涓垹闄ら珮浜紝鍒掔嚎锛岀瑪璁版搷浣滄 @@ -2816,6 +3368,7 @@ lineDelete.id = id lineDelete.showLineDelete = true if (type == 'Note') { + noteContent.show = false let list = dialogToolData.notesList[chapterNum] let data = list.find((item) => item.id == id) formData.id = id @@ -2840,22 +3393,21 @@ color: '' }) window.noteHover = (type, id, chapterNum) => { - console.log(type, 'typetype') let list = dialogToolData.notesList[chapterNum] let data = list.find((item) => item.id == id) noteContent.note = data.note noteContent.color = data.color + noteContent.show = true document.addEventListener('mousemove', function (event) { var x = event.offsetX var y = event.offsetY // console.log('榧犳爣鍧愭爣浣嶇疆锛�', x, y) - noteContent.top = event.clientY + 10 + noteContent.top = event.clientY + 20 noteContent.left = event.clientX - noteContent.show = true }) } -window.noteOut = () => { - console.log(123) +window.noteOut = (type) => { + console.log(type, 123) noteContent.show = false } @@ -2894,7 +3446,9 @@ if (window.qiankunState && window.qiankunState.delSign) { window.qiankunState.delSign({ ids: [ids] }) } - getSignData() + if (!window.qiankunState.disableSign) { + getSignData() + } if (type == 'Note') { getNotesList() } @@ -2922,7 +3476,7 @@ const updateUserKey = () => { let data = scribeData.noteList.find((item1) => item1.chapter == dialogToolData.chapter) data.noteList.forEach((itemNote) => { - if ((itemNote.id = formData.id)) { + if (itemNote.id == formData.id) { itemNote.note = formData.desc itemNote.color = noteColorActive.value } @@ -2941,7 +3495,9 @@ addNoteVisble.value = false isUpdate.value = false getNotesList() - getSignData() + if (!window.qiankunState.disableSign) { + getSignData() + } }) } @@ -3004,6 +3560,15 @@ }) } } + +//鍗曡瘝闃呰 +const soundWord = (word, en) => { + window.speechSynthesis.cancel() + const synth = window.speechSynthesis + const utterances = new SpeechSynthesisUtterance(word) + // utterances.lang = en // 璁剧疆璇█涓轰腑鏂� + synth.speak(utterances) +} //鍐呭鍖哄煙椤堕儴鏄剧ず const headerData = reactive({ @@ -3058,7 +3623,12 @@ } const layoutBtn = () => { - localStorage.clear() + localStorage.removeItem('token') + localStorage.removeItem('userInfo') + router.push('/login') +} +const goLogin = () => { + localStorage.removeItem('userInfo') router.push('/login') } </script> @@ -3072,6 +3642,7 @@ display: flex; flex-direction: column; padding: 0 15px; + .headerBox { height: 48px; // background-image: url('@/assets/images/header/top-bg.png'); @@ -3123,6 +3694,10 @@ box-shadow: 10px 0 10px -10px rgba(0, 0, 0, 0.07); background: #fff; border-radius: 16px 0px 0px 0px; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; + .menuItem { text-align: center; line-height: 1; @@ -3142,11 +3717,11 @@ display: inline-block; width: 32px; height: 32px; - .name { - text-align: center; - line-height: 1; - color: #2c3e50; - } + } + .name { + text-align: center; + line-height: 1; + color: #2c3e50; } } .reload { @@ -3168,6 +3743,9 @@ height: calc(100vh - 48px); overflow-y: auto; background: #e0f2ff; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; .searchBox { width: 100%; height: 60px; @@ -3177,7 +3755,7 @@ align-items: center; border-bottom: 1px solid #efefef; } - .resourceBox { + .resourceSearchBox { padding: 10px 0; margin: 0 20px; border-bottom: 1px solid rgba(204, 204, 204, 0.32); @@ -3270,6 +3848,7 @@ background: #fff; height: 34px; } + .is-focus, .el-input__wrapper { box-shadow: none !important; @@ -3277,6 +3856,10 @@ border: none !important; height: 34px !important; } + } + .el-input-group__append { + padding: 0 10px !important; + background: none !important; } } .screenBox { @@ -3514,18 +4097,66 @@ border-radius: 10px; padding: 10px; display: flex; + justify-content: space-between; .reMarkCon { - width: 240px; - // white-space: nowrap; - // overflow: hidden; - // text-overflow: ellipsis; - margin-right: 8px; + display: flex; + .con { + width: 200px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-right: 8px; + } } .deleteReMarkImg { display: flex; align-items: center; } + .questionCon { + width: 240px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } } + + .allSearchList { + .searchItem { + margin: 15px; + background: #fff; + border-radius: 10px; + padding: 10px; + display: flex; + .index { + line-height: 24px; + margin-right: 10px; + } + .searchCon { + flex: 1; + width: 240px; + overflow: hidden; + margin-right: 8px; + height: 45px; + line-height: 22px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + text-overflow: ellipsis; + .searchColor { + background: rgb(245, 225, 42, 0.5); + } + } + } + } + } + .allSearch, + .notesBox, + .resourceBox, + .reMarkList, + .questionList, + .screenshotList { + height: calc(100% - 60px); + overflow-y: auto; } } .menuStateBox { @@ -3589,6 +4220,8 @@ div { padding: 5px; + display: flex; + align-items: center; img { width: 18px; height: 18px; @@ -3643,6 +4276,9 @@ box-shadow: -3px 0px 6px 1px rgba(0, 0, 0, 0.07); background: #fff; border-radius: 0px 16px 0px 0px; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; .toolTitle { height: 57px; line-height: 53px; @@ -3894,6 +4530,7 @@ width: 190px; display: flex; background: #ffffff; + box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.16); border-radius: 5px; margin-bottom: 10px; @@ -3918,22 +4555,24 @@ z-index: 2; box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); padding: 5px 10px; - background: #fff; + // background: #fff; + background-color: rgba(90, 90, 90, 0.9); border-radius: 5px; display: flex; .dialogToolItem { padding: 3px; - margin: 0 10px; + margin: 0 5px; border-radius: 5px; display: flex; justify-content: center; align-items: center; } .dialogToolItem:hover { - background-color: rgba(44, 44, 44, 0.2); + background-color: rgba(255, 255, 255, 0.3); } } .noteContentBox { + max-width: 240px; position: fixed; z-index: 2; padding: 10px; @@ -3946,10 +4585,13 @@ padding: 5px 20px; background: #fff; border-radius: 5px; + .word { + font-weight: bold; + } .phone_con { .per-phone { - width: 150px; align-items: center; + // justify-content: space-between; background: #f4f5f7; border-radius: 15px; box-sizing: border-box; @@ -3961,7 +4603,12 @@ padding: 8px 10px; span { margin: 0 10px; + flex: 1; } + } + .soundBtn { + width: 16px; + height: 14px; } } .trans { @@ -3980,7 +4627,8 @@ } .wendabox { width: 100%; - height: 700px; + height: 80vh; + iframe { width: 100%; height: 100%; @@ -4020,8 +4668,12 @@ box-sizing: border-box; } } +.myDialogs { + height: 90vh; +} .myAnserDialogs { - width: 628px; + width: 700px; + height: 90vh; } .myNoteDialogs { width: 500px !important; @@ -4056,9 +4708,9 @@ video { width: 100%; } - audio { - width: 100%; - } +} +.audioBox { + // display:none; } .wordBox { -- Gitblit v1.9.1