From cc26637f18b8ed178420122d7335b3f89be92ada Mon Sep 17 00:00:00 2001 From: litian <2804272236@qq.com> Date: 星期四, 23 五月 2024 10:34:44 +0800 Subject: [PATCH] shujia --- src/assets/images/book-cover.png | 0 src/views/index.vue | 73 + src/views/components/dictionary.vue | 13 src/qiankunState/state.ts | 1 src/assets/images/content/dialogRightImg.png | 0 src/assets/images/default-book-img.png | 0 src/assets/js/config.ts | 9 src/assets/images/menu/list-search.svg | 1 src/assets/js/middleGround/api/store.js | 676 ++++++++++++ src/router/index.ts | 48 src/assets/images/operation/brush.svg | 1 src/assets/images/operation/pencil-minus.svg | 1 src/views/messageList/list.vue | 21 src/assets/main.css | 4 src/views/jobManagement/list.vue | 21 src/views/classeManagement/list.vue | 20 src/assets/images/operation/bookmark-plus.svg | 1 src/assets/js/middleGround/api/identity.js | 181 +++ src/views/components/menuView.vue | 119 ++ src/assets/images/operation/chalkboard.svg | 1 src/main.ts | 44 src/views/personalCenter/index.vue | 21 src/assets/images/operation/trash.svg | 1 src/layout/layout.vue | 2 /dev/null | 495 --------- src/assets/images/operation/crop.svg | 1 src/assets/images/operation/pencil.svg | 1 src/assets/js/middleGround/api/app.js | 22 src/views/login.vue | 186 ++ src/assets/js/middleGround/tool.js | 438 +++++++ src/assets/js/middleGround/WebMiddleGroundApi.js | 14 src/views/bookshelfList/list.vue | 73 + src/views/home.vue | 796 ++++++------- src/App.vue | 2 34 files changed, 2,311 insertions(+), 976 deletions(-) diff --git a/src/App.vue b/src/App.vue index f5bfb0e..3fa40f4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,7 +42,7 @@ } if (taskInfo) { router.replace({ - path: '/transmission' + path: '/home' }) window.electronAPI.newDownloadTask(taskInfo) } diff --git a/src/assets/images/book-cover.png b/src/assets/images/book-cover.png new file mode 100644 index 0000000..bd40923 --- /dev/null +++ b/src/assets/images/book-cover.png Binary files differ diff --git a/src/assets/images/content/dialogRightImg.png b/src/assets/images/content/dialogRightImg.png new file mode 100644 index 0000000..a7e676f --- /dev/null +++ b/src/assets/images/content/dialogRightImg.png Binary files differ diff --git a/src/assets/images/default-book-img.png b/src/assets/images/default-book-img.png new file mode 100644 index 0000000..bd40923 --- /dev/null +++ b/src/assets/images/default-book-img.png Binary files differ diff --git a/src/assets/images/menu/list-search.svg b/src/assets/images/menu/list-search.svg new file mode 100644 index 0000000..303779c --- /dev/null +++ b/src/assets/images/menu/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"><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/bookmark-plus.svg b/src/assets/images/operation/bookmark-plus.svg new file mode 100644 index 0000000..19d1a00 --- /dev/null +++ b/src/assets/images/operation/bookmark-plus.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-bookmark-plus" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 17l-6 4v-14a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v5" /><path d="M16 19h6" /><path d="M19 16v6" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/brush.svg b/src/assets/images/operation/brush.svg new file mode 100644 index 0000000..80990d5 --- /dev/null +++ b/src/assets/images/operation/brush.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-brush" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 21v-4a4 4 0 1 1 4 4h-4" /><path d="M21 3a16 16 0 0 0 -12.8 10.2" /><path d="M21 3a16 16 0 0 1 -10.2 12.8" /><path d="M10.6 9a9 9 0 0 1 4.4 4.4" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/chalkboard.svg b/src/assets/images/operation/chalkboard.svg new file mode 100644 index 0000000..f8b34b0 --- /dev/null +++ b/src/assets/images/operation/chalkboard.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-chalkboard" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 19h-3a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v11a1 1 0 0 1 -1 1" /><path d="M11 16m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v1a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/crop.svg b/src/assets/images/operation/crop.svg new file mode 100644 index 0000000..2eaff36 --- /dev/null +++ b/src/assets/images/operation/crop.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-crop" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 5v10a1 1 0 0 0 1 1h10" /><path d="M5 8h10a1 1 0 0 1 1 1v10" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/pencil-minus.svg b/src/assets/images/operation/pencil-minus.svg new file mode 100644 index 0000000..2bf53ac --- /dev/null +++ b/src/assets/images/operation/pencil-minus.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-pencil-minus" style="color:#fff"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /><path d="M13.5 6.5l4 4" /><path d="M16 19h6" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/pencil.svg b/src/assets/images/operation/pencil.svg new file mode 100644 index 0000000..07605bd --- /dev/null +++ b/src/assets/images/operation/pencil.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-pencil"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4" /><path d="M13.5 6.5l4 4" /></svg> \ No newline at end of file diff --git a/src/assets/images/operation/trash.svg b/src/assets/images/operation/trash.svg new file mode 100644 index 0000000..aa84b02 --- /dev/null +++ b/src/assets/images/operation/trash.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-trash" style="color:707070"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 7l16 0" /><path d="M10 11l0 6" /><path d="M14 11l0 6" /><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" /><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" /></svg> \ No newline at end of file diff --git a/src/assets/js/config.ts b/src/assets/js/config.ts index 7a89807..d84bb62 100644 --- a/src/assets/js/config.ts +++ b/src/assets/js/config.ts @@ -1,7 +1,12 @@ // 娴嬭瘯 -export const ctx = "http://182.92.203.7:3001"; -export const downloaderFileCtx = "http://182.92.203.7:3007/DigitalTextbookReader"; 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; // 璇锋眰瓒呮椂鏃堕棿 +export const tokenKey = "token"; +export const userInfoKey = "website-front-userInfo"; // 鐢ㄦ埛淇℃伅key +export const appRefCode = "jingshieke"; +export const goodsStore = `defaultGoodsStore${appId}`; // 榛樿鍟嗗搧搴�(涔﹀煄) +export const digitalTextbooks = "jsek_digitalTextbooks";//鏁板瓧鏁欐潗 diff --git a/src/assets/js/middleGround/WebMiddleGroundApi.js b/src/assets/js/middleGround/WebMiddleGroundApi.js new file mode 100644 index 0000000..0611524 --- /dev/null +++ b/src/assets/js/middleGround/WebMiddleGroundApi.js @@ -0,0 +1,14 @@ +// 鍙栨秷鎺ュ彛璋冪敤鑳藉姏锛� +// 闃熷垪鐨勫繀瑕佹�э紵锛� + +import store from "./api/store.js"; +import identity from "./api/identity.js"; +import app from "./api/app.js"; + +const WebMiddleGroundApi = { + store, + identity, + app, +}; + +export default WebMiddleGroundApi; diff --git a/src/assets/js/middleGround/api/app.js b/src/assets/js/middleGround/api/app.js new file mode 100644 index 0000000..f7edc50 --- /dev/null +++ b/src/assets/js/middleGround/api/app.js @@ -0,0 +1,22 @@ +import request from "@/plugin/axios/index.ts"; +const appApi = { + // 鑾峰彇鐢ㄦ埛娑堟伅鍒楄〃 + getAppMessageList(data) { + return request({ + url: "/app/api/ApiGetAppMessageList", + method: "post", + data + }); + }, + // 鑾峰彇鐢ㄦ埛娑堟伅璇︽儏 + getMessage(data) { + return request({ + url: "/app/api/ApiGetMessage", + method: "post", + data + }); + }, + +}; + +export default appApi; diff --git a/src/assets/js/middleGround/api/identity.js b/src/assets/js/middleGround/api/identity.js new file mode 100644 index 0000000..bdd37e4 --- /dev/null +++ b/src/assets/js/middleGround/api/identity.js @@ -0,0 +1,181 @@ +import request from "@/plugin/axios/index.ts"; +const identityApi = { + // 鑾峰彇鍥惧舰楠岃瘉鐮� + getImgCode() { + return request({ + url: "/identity/NewCaptcha", + method: "post", + }); + }, + + // 楠岃瘉鍥惧舰楠岃瘉鐮� + verificationImgCode(data) { + return request({ + url: "/identity/ValidCaptcha", + method: "post", + data, + }); + }, + + // 鑾峰彇鐭俊楠岃瘉鐮� + getPhoneCode(data) { + return request({ + url: "/identity/NewSms", + method: "post", + data, + }); + }, + // 楠岃瘉鐭俊楠岃瘉鐮� + verificationPhoneCode(data) { + return request({ + url: "/identity/api/ApiValidMobilePhone", + method: "post", + data, + }); + }, + + // 閫氳繃鎵嬫満鍙锋敞鍐岀敤鎴� + registerAppUserWithPhone(data) { + return request({ + url: "/identity/api/RegisterAppUserWithPhone", + method: "post", + data, + }); + }, + + // 璐﹀彿瀵嗙爜鐧诲綍 + loginByPassword(data) { + return request({ + url: "/identity/api/LoginByPassword", + method: "post", + data, + }); + }, + + // 鐭俊楠岃瘉鐮佺櫥褰� + loginByMobilePhone(data) { + return request({ + url: "/identity/api/LoginByMobilePhone", + method: "post", + data, + }); + }, + + // 璁剧疆鐢ㄦ埛key + setUserKey(data) { + return request({ + url: "/identity/api/ApiAppUserSetKey", + method: "post", + data, + }); + }, + + // 鑾峰彇鐢ㄦ埛key + getUserKey(data) { + return request({ + url: "/identity/api/ApiGetAppUserKey", + method: "post", + data, + }); + }, + + // 鍒犻櫎鐢ㄦ埛key + delUserKey(data) { + return request({ + url: "/identity/api/ApiDelAppUserKey", + method: "post", + data, + }); + }, + + // 鑾峰彇鍘诲綋鍓嶇敤鎴蜂俊鎭� + getCurrentAppUser() { + return request({ + url: "/identity/api/GetCurrentAppUser", + method: "post", + }); + }, + + // 娣诲姞鐢ㄦ埛淇℃伅 + setAppUserInfo(data) { + return request({ + url: "/identity/api/SetAppUserInfoRequest", + method: "post", + data, + }); + }, + + // 鐢ㄦ埛鏇存崲缁戝畾鎵嬫満鍙凤紝濡傛病鏈夌粦瀹氭墜鏈哄垯鑷姩鍒涘缓 + userSetPhoneNumber(data) { + return request({ + url: "/identity/api/ApiUserSetPhoneNumber", + method: "post", + data, + }); + }, + + // 妫�娴嬬敤鎴锋槸鍚︾粦瀹氬井淇� + checkBuildingWeChat(data) { + return request({ + url: "/identity/api/ApiCheckBuildingWeChat", + method: "post", + data, + }); + }, + + + // 閫氳繃鎵嬫満鍙烽噸缃瘑鐮� + changePasswordByMobilePhone(data) { + return request({ + url: "/identity/api/ChangePasswordByMobilePhone", + method: "post", + data, + }); + }, + + // 寰俊寮�鏀惧钩鍙版壂鐮佺櫥褰� + loginByWeChatOpenCode(data) { + return request({ + url: "/identity/api/LoginByWeChatOpenCode", + method: "post", + data, + }); + }, + + // 鐢ㄦ埛缁戝畾寰俊鍙� + bindingWeChat(data) { + return request({ + url: "/identity/api/ApiBindingWeChat", + method: "post", + data, + }); + }, + + // 璁剧疆鐧诲綍鐨勭敤鎴峰悕鍜屽瘑鐮侊紝鐢ㄦ埛鍚嶅拰瀵嗙爜鑷冲皯6浣� + setLoginNameAndPassword(data) { + return request({ + url: "/identity/api/ApiUserSetLoginNameAndPassword", + method: "post", + data, + }); + }, + + // 鑾峰彇閭楠岃瘉鐮� + getEmailCode(data) { + return request({ + url: "/identity/api/SendVerifyEMail", + method: "post", + data, + }); + }, + // 鐢ㄦ埛缁戝畾閭 + bindingEmail(data) { + return request({ + url: "/identity/api/ApiBindEMail", + method: "post", + data, + }); + }, +}; + +export default identityApi; \ No newline at end of file diff --git a/src/assets/js/middleGround/api/store.js b/src/assets/js/middleGround/api/store.js new file mode 100644 index 0000000..d5c7f07 --- /dev/null +++ b/src/assets/js/middleGround/api/store.js @@ -0,0 +1,676 @@ +import request from '@/plugin/axios/index.ts' +import { tokenKey, goodsStore } from '@/assets/js/config.ts' +import { handleQueryResourceListData, handleDetailQueryRequestData } from '../tool' +const storeApi = { + /* + **鑾峰彇鍟嗗搧鍒楄〃** + path: 鏁版嵁璺緞 + storeInfo: 浠撳偍 + channelInfo: 棰戦亾 + subAccess: + queryType: 妫�绱㈢被鍨� + paging: 鍒嗛〉 + sort: 鎺掑簭 + fields: 鑷畾涔夊瓧娈� + */ + getProductList: ({ + path = '', + storeInfo = goodsStore, + storeEventIdOrRefCode = '', + favoriteTypes = '', + queryType, + linkType, + subAccess = [], + paging = {}, + sort, + fields, + filterList, + coverSize, + mainProductId, + handelEBooK + }) => { + const query = { + AccessControl: { + Path: path, + StoreRefCode: storeInfo + '', + Type: queryType || '\\', + LinkType: linkType || '' + }, + FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], + SubAccess: subAccess.length > 0 ? subAccess : [], + PageQuery: { + Start: paging.start || '0', + Size: paging.size || '10' + }, + SortQuery: + sort?.length == 0 + ? [] + : sort + ? [sort] + : [ + { + LinkOrder: 'Desc' + } + ], + CreateDate: [], + Description: [], + Name: [], + Icon: [], + RefCode: [], + TypeId: [], + SysType: [], + State: [], + Tag: [], + BeginDate: [], + EndDate: [], + ProductLinkInfo: [], + AllowDonate: [], + // DonatePriceList: [], + StoreEvent: [], + SubProductCount: [], + SaleMethod: [], + SaleMethodValid: [], + StoreEventIdOrRefCode: storeEventIdOrRefCode, + ...fields, + ...filterList + } + if (mainProductId) { + query.AccessControl.MainProductId = mainProductId + } + if (handelEBooK) { + query.ProductCmsQuery = [ + { + QueryCms: { + Path: '*', + Type: '\\', + Name: [], + Icon: [], + TypeId: [], + RefCode: [], + ChildrenCount: [], + ChildrenFolderCount: [], + CreateDate: [], + SysType: [], + SaleMethod: [], + PageQuery: { + Start: 0, + Size: 9999 + }, + ProductLinkInfo: [] + } + } + ] + } + const body = { + query: JSON.stringify({ + Query: [ + { + Q1: query + } + ] + }) + } + let token = localStorage.getItem(tokenKey) + let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' + return request({ + url: url, + method: 'post', + data: body + }).then((resp) => { + if (resp.length > 0) { + const data = resp[0] + const datas = handleQueryResourceListData({ + datas: data.datas, + fields, + path, + storeInfo, + coverSize, + handelEBooK + }) + return { + datas, + total: data.totalCount, + extraInfos: data.extraInfos?.StoreEvent + } + } + return { + datas: [], + total: 0 + } + }) + }, + /* + **鑾峰彇鍟嗗搧璇︽儏** + path: 鏁版嵁璺緞 + storeInfo: 浠撳偍 + channelInfo: 棰戦亾 + subAccess: + fields: 鑷畾涔夊瓧娈� + productId: 鍟嗗搧ID + cmsPath锛歝msPath + */ + getProductDetail: ({ + path = '', + storeInfo = goodsStore, + channelInfo = '', + favoriteTypes = '', + queryType, + subAccess = [], + fields, + productId, + cmsPath, + cmsType, + coverSize, + itemId, + itemIds, + itemFields, + linkTypes, + filterList, + handelEBooK, + sort, + cmsSort, + source + }) => { + const subQuery = {} + if (cmsPath) { + subQuery['QueryCms'] = { + Path: cmsPath + '', + Type: cmsType || '\\', + Name: [], + Icon: [], + TypeId: [], + RefCode: [], + ChildrenCount: [], + ChildrenFolderCount: [], + CreateDate: [], + SysType: [], + SaleMethod: [], + PageQuery: { + Start: 0, + Size: 9999 + }, + SortQuery: cmsSort + ? [cmsSort] + : [ + { + ProductLinkOrder: 'Asc' + } + ], + ProductLinkInfo: [], + ...itemFields + } + if (itemId) subQuery['QueryCms']['Id='] = [`${itemId}`] + if (itemIds) subQuery['QueryCms']['Id='] = itemIds + } else { + subQuery['QueryCms'] = { + Path: '*', + Type: '\\', + Name: [], + Icon: [], + TypeId: [], + RefCode: [], + ChildrenCount: [], + ChildrenFolderCount: [], + CreateDate: [], + SysType: [], + SaleMethod: [], + PageQuery: { + Start: 0, + Size: 9999 + }, + ProductLinkInfo: [] + } + } + // 鑾峰彇鍏宠仈璧勬簮 + let linkFields = {} + if (linkTypes && linkTypes.length) { + for (let i = 0; i < linkTypes.length; i++) { + const linkType = linkTypes[i] + subQuery['QueryLink_' + linkType.linkType] = { + Path: cmsPath + '', + Type: '\\', + Name: [], + Icon: [], + TypeId: [], + RefCode: [], + LinkTypes: [linkType.linkType], + PageQuery: { + Start: 0, + Size: 100 + }, + ProductLinkInfo: [], + ...linkType.fields + } + linkFields = { + ...linkFields, + ...linkType.fields + } + } + } + const query = { + AccessControl: { + Path: path, + StoreRefCode: storeInfo + '', + ChannelRefCode: channelInfo + '', + Type: queryType || '\\' + }, + FavoriteTypes: favoriteTypes ? [favoriteTypes] : [], + SubAccess: subAccess.length > 0 ? subAccess : [], + PageQuery: { + Start: '0', + Size: '1' + }, + 'Id=': [`${productId}`], + SortQuery: sort + ? [sort] + : [ + { + LinkOrder: 'Desc' + } + ], + CreateDate: [], + Description: [], + Name: [], + Icon: [], + RefCode: [], + TypeId: [], + SysType: [], + State: [], + Tag: [], + BeginDate: [], + EndDate: [], + ProductLinkInfo: [], + AllowDonate: [], + DonatePriceList: [], + StoreEvent: [], + SaleMethod: [], + SaleMethodValid: [], + CmsItemValid: [], + ProductCmsQuery: [subQuery], + ...fields, + ...filterList + } + if (productId) query['Id='] = [`${productId}`] + + const body = { + query: JSON.stringify({ + Query: [ + { + Q1: query + } + ] + }) + } + let token = localStorage.getItem(tokenKey) + let url = token ? '/store/api/ApiQueryProductByAppUser' : '/store/api/ApiQueryProduct' + return request({ + url: url, + method: 'post', + data: body, + cancelToken: source?.token + }) + .then((resp) => { + if (resp.length > 0) { + const data = resp[0] + if (data.datas.length) { + data.datas[0].subDatas = data.datas[0].cmsDatas + const datas = handleDetailQueryRequestData({ + item: data.datas[0], + fields, + itemFields: { + ...itemFields, + ...linkFields + }, + path, + coverSize, + handelEBooK, + + }) + return { + datas, + total: data.totalCount + } + } else { + return { + datas: [], + total: 0 + } + } + } + return { + datas: [], + total: 0 + } + }) + }, + + // 鑾峰彇浼樻儬鍒稿垪琛� + getChannelPromoteCodeList(data) { + return request({ + url: '/store/api/ApiGetChannelPromoteCodeList', + method: 'post', + data + }) + }, + + // 鑾峰彇鐢ㄦ埛宸查鍙栫殑浼樻儬鍒稿垪琛� + getPromoteCodeList(data) { + return request({ + url: '/store/api/ApiGetPromoteCodeList', + method: 'post', + data + }) + }, + + // 鑾峰彇鐢ㄦ埛娴忚鎺掕 + getProductViewRank(data) { + return request({ + url: '/store/api/ApiGetProductViewRank', + method: 'post', + data + }) + }, + + // 鑾峰彇鐢ㄦ埛閿�鍞帓琛� + getProductSaleRank(data) { + return request({ + url: '/store/api/ApiGetProductSaleRank', + method: 'post', + data + }) + }, + + // 鑾峰彇鍟嗗搧鍙敤浼樻儬鍒� + getProductPromoteCodeList(data) { + return request({ + url: '/store/api/ApiGetProductPromoteCodeList', + method: 'post', + data + }) + }, + + // 鑾峰彇璁㈠崟鍙敤浼樻儬鍒� + getOrderPromoteCodeList(data) { + return request({ + url: '/store/api/GetOrderPromoteCodeList', + method: 'post', + data + }) + }, + + // 鑾峰彇閿�鍞柟寮忓彲鐢ㄤ紭鎯犲埜 + getSaleMethodPromoteCodeList(data) { + return request({ + url: '/store/api/GetSaleMethodPromoteCodeList', + method: 'post', + data + }) + }, + + // 棰嗗彇浼樻儬鍗� + getPromoteCode(data) { + return request({ + url: '/store/api/ApiGetPromoteCode', + method: 'post', + data + }) + }, + + // 涓鸿鍗曚娇鐢ㄤ紭鎯犲埜 + updateOrderPromoteCode(data) { + return request({ + url: '/store/api/UpdateOrderPromoteCode', + method: 'post', + data + }) + }, + + // 涓洪攢鍞柟寮忎娇鐢ㄤ紭鎯犲埜 + updateSaleMethodPromoteCode(data) { + return request({ + url: '/store/api/UpdateSaleMethodPromoteCode', + method: 'post', + data + }) + }, + + // 閫氳繃璁㈠崟鍙疯幏鍙栬鍗� + getOrderByOrderNum(data) { + return request({ + url: '/store/api/GetOrderByOrderNum', + method: 'post', + data + }) + }, + + // 鍒涘缓璁㈠崟 + initOrder(data) { + return request({ + url: '/store/api/InitOrder', + method: 'post', + data + }) + }, + + // 纭璁㈠崟 + confirmOrder(data) { + return request({ + url: '/store/api/ConfirmOrder', + method: 'post', + data + }) + }, + + // 鍙栨秷璁㈠崟 + cancelOrder(data) { + return request({ + url: '/store/api/CancelOrder', + method: 'post', + data + }) + }, + + // 璧炶祻 + CreateDonateOrder(data) { + return request({ + url: '/store/api/CreateDonateOrder', + method: 'post', + data + }) + }, + + //鑾峰彇鐢ㄦ埛璁㈠崟鍒楄〃 + getUserOrderList(data) { + return request({ + url: '/store/api/GetUserOrderList', + method: 'post', + data + }) + }, + + //鑾峰彇棰戦亾涓嬬殑鍒楄〃 + getStoreChannelList(data) { + return request({ + url: '/store/api/ApiGetStoreChannelList', + method: 'post', + data + }) + }, + + //鑾峰彇璐墿杞� + getShoppingCartProductList(data) { + return request({ + url: '/store/api/ApiGetShoppingCartProductList', + method: 'post', + data + }) + }, + + //娣诲姞鍒拌喘鐗╄溅 + addShoppingCart(data) { + return request({ + url: '/store/api/ApiAddShoppingCart', + method: 'post', + data + }) + }, + + //璐墿杞﹀垹闄ゅ晢鍝� + delShoppingCart(data) { + return request({ + url: '/store/api/ApiDelShoppingCart', + method: 'post', + data + }) + }, + + //浠庤喘鐗╄溅鍒涘缓璁㈠崟 + shoppingCartCreateOrder(data) { + return request({ + url: '/store/api/ApiShoppingCartCreateOrder', + method: 'post', + data + }) + }, + + //鑾峰彇宸茶喘涔扮殑鍟嗗搧鍒楄〃 + getPurchasedProductList(data) { + return request({ + url: '/store/api/ApiGetPurchasedProductList', + method: 'post', + data + }) + }, + + //璋冨彇寰俊鏀粯 + makeWeChatPay(data) { + return request({ + url: '/store/api/MakeWeChatPay', + method: 'post', + data + }) + }, + + //璋冨彇寰俊浜岀淮鐮佹敮浠� + makeWeChatQrPay(data) { + return request({ + url: '/store/api/MakeWeChatQrPay', + method: 'post', + data + }) + }, + + // 鑾峰彇婵�娲荤爜璇︽儏 + getActiveCode(data) { + return request({ + url: '/store/api/ApiGetActiveCode', + method: 'post', + data + }) + }, + + // 浣跨敤婵�娲荤爜 + userActiveCode(data) { + return request({ + url: '/store/api/ApiUseActiveCode', + method: 'post', + data + }) + }, + // 浣跨敤婵�娲荤爜浣跨敤璁板綍 + userActiveCodeList(data) { + return request({ + url: '/store/api/ApiGetUsedActiveCodeList', + method: 'post', + data + }) + }, + + // 鍟嗗搧鏌ヨ绫诲瀷瀛楁鎺ュ彛 + getProductTypeField(data) { + return request({ + url: '/store/api/ApiGetProductTypeField', + method: 'post', + data + }) + }, + + // 鏀惰棌鎴栧姞鍏ヤ功鏋� + addProductLink(data) { + return request({ + url: '/store/api/ApiAddProductLink', + method: 'post', + data + }) + }, + + // 鍙栨秷鏀惰棌鎴栫Щ闄や功鏋� + delProductLink(data) { + return request({ + url: '/store/api/ApiDelProductLink', + method: 'post', + data + }) + }, + + //璐拱鍏嶈垂鍟嗗搧 + MakeFreeOrderPay(data) { + return request({ + url: '/store/api/MakeFreeOrderPay', + method: 'post', + data + }) + }, + + // 鐢宠璁㈠崟寮�绁� + requestOrderInvoice(data) { + return request({ + url: '/store/api/RequestOrderInvoice', + method: 'post', + data + }) + }, + + // 鑾峰彇鐢ㄦ埛閽卞寘 + getUserWallet(data) { + return request({ + url: '/store/api/GetWallet', + method: 'post', + data + }) + }, + // 鑾峰彇鐢ㄦ埛閽卞寘璁板綍 + getWalletHistory(data) { + return request({ + url: '/store/api/GetWalletHistory', + method: 'post', + data + }) + }, + // 閫氳繃閽卞寘鑷姩璐拱 + autoPayWithWallet(data) { + return request({ + url: '/store/api/AutoPayWithWallet', + method: 'post', + data + }) + }, + // 鏌ヨ鍟嗗搧鎵�鍦⊿tore + getProductStore(data) { + return request({ + url: '/store/api/ApiGetProductStore', + method: 'post', + data + }) + }, + //鏍规嵁閿�鍞柟寮忔煡璇㈠晢鍝佷俊鎭� + getProductBySaleMethod(data) { + return request({ + url: '/store/api/ApiGetProductBySaleMethod', + method: 'post', + data + }) + } +} + +export default storeApi diff --git a/src/assets/js/middleGround/tool.js b/src/assets/js/middleGround/tool.js new file mode 100644 index 0000000..600201e --- /dev/null +++ b/src/assets/js/middleGround/tool.js @@ -0,0 +1,438 @@ +import { requestCtx, appId } from "@/assets/js/config.ts"; +import defaultImg from "@/assets/images/default-book-img.png"; +import bookCover from "@/assets/images/book-cover.png"; +import moment from "moment"; +// 澶勭悊鍒楄〃鏌ヨ缁撴灉 +export function handleQueryResourceListData({ + datas, + fields, + path, + storeInfo, + repositoryInfo, + coverSize, + handelEBooK, +}) { + const dataList = []; + for (let i = 0; i < datas.length; i++) { + const item = datas[i]; + // 澶勭悊瀛楁 + const _fields = {}; + if (fields != null) { + for (let fieldKey in fields) { + if (item.datas[fieldKey]) { + const values = JSON.parse(item.datas[fieldKey]); + if (values.length > 0) { + // 鐢ㄥ瓧娈靛悕澶勭悊杩斿洖鐨勫瓧娈靛�� + if (values[0].Value) { + _fields[fieldKey] = values[0].Value; + } else if (values[0].Data) { + _fields[fieldKey] = values[0].Data.Value; + } + item.datas[fieldKey] = values[0]; + } + } + } + } + const subDatas = {}; + if (item.subDatas) { + for (let subData of item.subDatas) { + const tag = subData.queryTag.replace("Query", ""); + subDatas[tag] = subData.datas; + } + } + + let obj = { + ...item, + id: item.id, + name: item.datas.Name, + icon: getPublicImage( + item.datas.Icon, + coverSize?.width, + coverSize?.height, + storeInfo + ), + repositoryInfo: repositoryInfo, + refCode: item.datas.RefCode === "[]" ? null : item.datas.RefCode, + state: item.datas.State, + type: item.datas.Type, + tag: item.datas.Tag, + creator: item.datas.Creator ? JSON.parse(item.datas.Creator) : undefined, + storeInfo: storeInfo, + linkType: item.datas.LinkType, + childrenCount: parseInt(item.datas.ChildrenCount ?? "0"), + childrenFolderCount: parseInt(item.datas.ChildrenFolderCount ?? "0"), + childrenChannelCount: parseInt(item.datas.ChildrenChannelCount ?? "0"), + createDate: moment(item.datas.CreateDate).format("YYYY-MM-DD"), + beginDate: moment(item.datas.BeginDate).format("YYYY-MM-DD"), + endDate: moment(item.datas.EndDate).format("YYYY-MM-DD"), + description: item.datas.Description, + sysType: item.datas.SysType, + idPath: path + "\\" + item.id, + typeId: parseInt(item.datas.TypeId), + linkFile: JSON.parse(item.datas.LinkFile ?? "[]"), + cmsItemType: item.datas.CmsItemType, + allowDonate: item.datas.AllowDonate == "True", + // donatePriceList: JSON.parse(item.datas.DonatePriceList ?? "[]"), + productLinkInfo: item.datas.ProductLinkInfo ?? "[]", + storeEvent: JSON.parse(item.datas.StoreEvent ?? "[]"), + linkInfo: JSON.parse(item.datas.LinkInfo ?? "[]"), + saleMethod: JSON.parse(item.datas.SaleMethod ?? "[]"), + subProductCount: parseInt(item.datas.SubProductCount), + ..._fields, + datas: item.datas, + subDatas, + }; + + // 缁熶竴澶勭悊浠锋牸 + if (obj.defaultSaleMethod) { + if (handelEBooK) { + // 鑾峰彇闅忎功璧勬簮鐨勯攢鍞柟寮� + let saleMethod = []; + try { + saleMethod = obj.cmsDatas[0].datas.find( + (item) => item.datas.RefCode == "tourism_accompanyingResources" + ).datas.SaleMethod; + saleMethod = JSON.parse(saleMethod); + } catch (error) { + saleMethod = []; + } + if (saleMethod.length) { + Object.keys(saleMethod[0]).map((key) => { + let newKey = key.replace(key[0], key[0].toLowerCase()); + saleMethod[0][newKey] = saleMethod[0][key]; + delete saleMethod[0][key]; + }); + obj.defaultSaleMethod = saleMethod[0]; + obj.defaultSaleMethodId = saleMethod[0].id; + obj.alreadyBuy = + obj.purchasedSaleMethodIdList.indexOf(obj.defaultSaleMethodId) > -1; + } + } + if (obj.defaultSaleMethod.allowEvent && obj.storeEvent.length) { + // 宸插弬鍔犳椿鍔紝鑾峰彇鏈夋晥娲诲姩骞惰绠椾环鏍� + let time = new Date().getTime(); + // 杩囨护杩囨湡娲诲姩 + let event = obj.storeEvent.filter((item) => { + let endTime = new Date(item.EndDate).getTime(); + return endTime > time; + }); + + // 鍙鐞嗕竴鏉℃湁鏁堟椿鍔� + if (event.length) { + obj.price = (obj.defaultSaleMethod.price * event[0].Value).toFixed(2); + obj.oldPrice = obj.defaultSaleMethod.price; + obj.storeEventId = event[0].Id; + if ( + moment().format("YYYY-MM-DD") < + moment(obj.defaultSaleMethod.endDate).format("YYYY-MM-DD") + ) { + obj.defaultSaleMethodState = "Normal"; + } else { + obj.defaultSaleMethodState = "Beyond"; + } + } + } else { + if ( + moment().format("YYYY-MM-DD") < + moment(obj.defaultSaleMethod.endDate).format("YYYY-MM-DD") + ) { + obj.defaultSaleMethodState = "Normal"; + } else { + obj.defaultSaleMethodState = "Beyond"; + } + obj.price = obj.defaultSaleMethod.price; + obj.oldPrice = obj.defaultSaleMethod.virtualPrice; + } + } + dataList.push(obj); + } + return dataList; +} + +// 澶勭悊璇︽儏鏌ヨ缁撴灉 +export function handleDetailQueryRequestData({ + item, + fields, + path, + coverSize, + itemFields, + handelEBooK, +}) { + item.fileMap = {}; + let itemFieldsData = []; + for (const key in itemFields) { + itemFieldsData.push(key); + } + let fieldsData = []; + for (const key in fields) { + fieldsData.push(key); + } + for (let i = 0; i < fieldsData.length; i++) { + const field = fieldsData[i]; + item.datas[field] = JSON.parse(item.datas[field]); + const datas = item.datas[field]; + if (datas.length > 0) { + if (datas[0].Value) { + item[field] = datas[0].Value; + if (datas[0].Data.FileLinkList && datas[0].Data.FileLinkList.length) { + item.fileMap = { + ...item.fileMap, + ...handleLinkFileInfo( + datas[0].Data.FileLinkList.map((item) => { + return { + ...item.File, + ...item, + }; + }) + ), + }; + } + } else if (datas[0].Data) { + item[field] = datas[0].Data.Value; + if (datas[0].Data.FileLinkList && datas[0].Data.FileLinkList.length) { + item.fileMap = { + ...item.fileMap, + ...handleLinkFileInfo( + datas[0].Data.FileLinkList.map((item) => { + return { + ...item.File, + ...item, + }; + }) + ), + }; + } + } + } + } + + // 澶勭悊cms璧勬簮 + const subDatas = item.subDatas; + const linkItemsMap = {}; + if (subDatas) { + for (const sdata of subDatas) { + const tag = sdata.queryTag; + for (const subItem of sdata.datas) { + convertCmsItemBase(subItem, coverSize, handelEBooK); + subItem.fileMap = {}; + for (let i = 0; i < itemFieldsData.length; i++) { + const itemField = itemFieldsData[i]; + try { + subItem.datas[itemField] = JSON.parse(subItem.datas[itemField]); + } catch (error) { + subItem.datas[itemField] = []; + } + const itemDatas = subItem.datas[itemField]; + if (itemDatas.length > 0) { + if (itemDatas[0].Value) { + subItem[itemField] = itemDatas[0].Value; + if (itemDatas[0].FileList && itemDatas[0].FileList.length) { + subItem.fileMap = { + ...subItem.fileMap, + ...handleLinkFileInfo(itemDatas[0].FileList), + }; + } + } else if (itemDatas[0].Data) { + subItem[itemField] = itemDatas[0].Data.Value; + if ( + itemDatas[0].Data.FileList && + itemDatas[0].Data.FileList.length + ) { + subItem.fileMap = { + ...subItem.fileMap, + ...handleLinkFileInfo(itemDatas[0].Data.FileList), + }; + } + } else if (itemDatas[0].CmsItemData) { + subItem[itemField] = itemDatas[0].CmsItemData.Value; + if ( + itemDatas[0].CmsItemData.FileList && + itemDatas[0].CmsItemData.FileList.length + ) { + subItem.fileMap = { + ...subItem.fileMap, + ...handleLinkFileInfo(itemDatas[0].CmsItemData.FileList), + }; + } + } + } + } + if (subItem.productLinkInfo && subItem.productLinkInfo.length) + subItem.productLinkPath = + subItem.productLinkInfo[0].LinkPath + + "\\" + + subItem.productLinkInfo[0].CmsItemId; + if (subItem.linkInfo && subItem.linkInfo.length) + subItem.linkPath = + subItem.linkInfo[0].LinkPath + "\\" + subItem.linkInfo[0].CmsItemId; + } + linkItemsMap[tag] = sdata.datas; + } + } + convertCmsItemBase(item, coverSize, handelEBooK); + item.idPath = path + "\\" + item.id; + item.subItems = linkItemsMap; + return item; +} + +const handleLinkFileInfo = (linkList) => { + let linkFileMap = {}; + for (let z = 0; z < linkList.length; z++) { + const linkItem = linkList[z]; + linkFileMap[linkItem.Md5] = { + linkType: linkItem.LinkType, + extension: linkItem.Extension, + fileName: linkItem.FileName, + fileType: linkItem.Type, + md5: linkItem.Md5, + icon: linkItem.Icon, + size: linkItem.Size, + metaData: JSON.parse(linkItem.MetaData ?? "{}"), + order: linkItem.Order, + protectType: linkItem.ProtectType, + }; + } + return linkFileMap; +}; + +const convertCmsItemBase = (item, coverSize, handelEBooK) => { + item.name = item.datas.Name; + item.description = item.datas.Description; + item.refCode = item.datas.RefCode; + item.state = item.datas.State; + item.type = item.datas.Type; + item.tag = item.datas.Tag; + item.typeId = parseInt(item.datas.TypeId); + item.icon = getPublicImage( + item.datas.Icon, + coverSize?.width, + coverSize?.height + ); + item.sysType = item.datas.SysType; + item.linkFile = JSON.parse(item.datas.LinkFile ?? "[]"); + item.linkType = item.datas.LinkType; + item.linkAppId = parseInt(item.datas.LinkAppId); + item.linkStoreId = parseInt(item.datas.LinkStore); + item.linkRepoId = item.datas.LinkRepository; + item.childrenCount = parseInt(item.datas.ChildrenCount ?? "0"); + (item.childrenFolderCount = parseInt(item.datas.ChildrenFolderCount ?? "0")), + (item.childrenChannelCount = parseInt( + item.datas.ChildrenChannelCount ?? "0" + )), + (item.linkId = parseInt(item.datas.LinkId)); + item.linkOrg = JSON.parse(item.datas.LinkOrg ?? "[]")[0]; + item.linkDepartment = JSON.parse(item.datas.LinkDepartment ?? "[]")[0]; + item.linkInfo = JSON.parse(item.datas.LinkInfo ?? "[]"); + item.productLinkInfo = JSON.parse(item.datas.ProductLinkInfo ?? "[]"); + item.saleMethod = JSON.parse(item.datas.SaleMethod ?? "[]"); + item.allowDonate = item.datas.AllowDonate == "True"; + // item.donatePriceList = JSON.parse(item.datas.DonatePriceList ?? "[]"); + item.createDate = moment(item.datas.CreateDate).format("YYYY-MM-DD"); + item.beginDate = moment(item.datas.BeginDate).format("YYYY-MM-DD"); + item.endDate = moment(item.datas.EndDate).format("YYYY-MM-DD"); + item.storeEvent = JSON.parse(item.datas.StoreEvent ?? "[]"); + // 缁熶竴澶勭悊浠锋牸 + if (item.defaultSaleMethod) { + if (handelEBooK) { + // 鑾峰彇闅忎功璧勬簮鐨勯攢鍞柟寮� + let saleMethod = item.cmsDatas[0].datas.find( + (item) => item.refCode == "tourism_accompanyingResources" + ).saleMethod; + if (saleMethod && saleMethod.length > 0) { + Object.keys(saleMethod[0]).map((key) => { + let newKey = key.replace(key[0], key[0].toLowerCase()); + saleMethod[0][newKey] = saleMethod[0][key]; + delete saleMethod[0][key]; + }); + item.defaultSaleMethod = saleMethod[0]; + item.defaultSaleMethodId = saleMethod[0].id; + item.alreadyBuy = + item.purchasedSaleMethodIdList.indexOf(item.defaultSaleMethodId) > -1; + } + } + if (item.defaultSaleMethod.allowEvent && item.storeEvent.length) { + // 宸插弬鍔犳椿鍔紝鑾峰彇鏈夋晥娲诲姩骞惰绠椾环鏍� + let time = new Date().getTime(); + // 杩囨护杩囨湡娲诲姩 + let event = item.storeEvent.filter((item) => { + let endTime = new Date(item.EndDate).getTime(); + return endTime > time; + }); + // 鍙鐞嗕竴鏉℃湁鏁堟椿鍔� + if (event.length) { + item.price = (item.defaultSaleMethod.price * event[0].Value).toFixed(2); + item.oldPrice = item.defaultSaleMethod.price; + if ( + moment().format("YYYY-MM-DD") < + moment(item.defaultSaleMethod.endDate).format("YYYY-MM-DD") + ) { + item.defaultSaleMethodState = "Normal"; + } else { + item.defaultSaleMethodState = "Beyond"; + } + item.storeEventId = event[0].Id; + } + } else { + item.price = item.defaultSaleMethod.price; + item.oldPrice = item.defaultSaleMethod.virtualPrice; + if ( + moment().format("YYYY-MM-DD") < + moment(item.defaultSaleMethod.endDate).format("YYYY-MM-DD") + ) { + item.defaultSaleMethodState = "Normal"; + } else { + item.defaultSaleMethodState = "Beyond"; + } + } + } +}; + +export function getTopicMsgCmsItemFile(fileType, fileList) { + let obj = {}; + fileType.forEach((item) => { + item.sequenceNum = item.config ? JSON.parse(item.config).uuid : ""; + fileList.forEach((e) => { + if (item.sequenceNum == e.sequenceNum) { + try { + if (e.fileLinkList.length > 0) { + for (let i = 0; i < e.fileLinkList.length; i++) { + const ele = e.fileLinkList[i]; + ele.name = ele.file.fileName; + ele.md5 = ele.file.md5; + ele.status = "success"; + } + obj[item.typeField.refCode] = e.fileLinkList; + } else { + const val = JSON.parse(e.value); + obj[item.typeField.refCode] = val; + } + } catch (error) { + obj[item.typeField.refCode] = e.value; + } + } + }); + }); + return obj; +} + +// 鑾峰彇涓嶅彈淇濇姢鐨勫浘鐗� +export function getPublicImage(md5, width, height,storeInfo) { + let src = null; + if (md5) { + src = requestCtx + `/file/GetPreViewImage?md5=${md5}`; + } else { + if(storeInfo == 'jsek_bookFair') { + // return defaultBookFair; + return + }else if(storeInfo == `defaultGoodsStore${appId}`){ + return bookCover; + }else + { + return defaultImg; + } + + } + if (width) src += `&width=${width}`; + if (height) src += `&height=${height}`; + return src; +} diff --git a/src/assets/main.css b/src/assets/main.css index 5998ad9..6fdd628 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -300,4 +300,8 @@ float: right; color:#707070; padding-right:5px; +} + +.icon-tabler-arrow-bar-to-left,.icon-tabler-arrow-bar-to-right{ + color:#707070 !important; } \ No newline at end of file diff --git a/src/layout/layout.vue b/src/layout/layout.vue index 2185c8c..82fc189 100644 --- a/src/layout/layout.vue +++ b/src/layout/layout.vue @@ -2,7 +2,7 @@ <div class="layoutBox"> <RouterView /> </div> -</template> +</template> <script setup lang="ts"> import { ref, reactive, watch } from 'vue' diff --git a/src/main.ts b/src/main.ts index 8aeabc8..440b309 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,20 +8,52 @@ import router from './router' import * as ElementPlusIconsVue from '@element-plus/icons-vue' import toolClass from '@/assets/js/toolClass' -import request from '@/plugin/axios/index.ts' +import MG from "@/assets/js/middleGround/WebMiddleGroundApi.js" import './child.ts' const handleGetToken = () => { return localStorage.getItem('token') } +const getUrlParam =(paraName)=>{ + var url = window.location.toString(); + var arrObj = url.split("?"); + if (arrObj.length > 1) { + var arrPara = arrObj[1].split("&"); + var arr; + for (var i = 0; i < arrPara.length; i++) { + arr = arrPara[i].split("="); + if (arr != null && arr[0] == paraName) { + return arr[1]; + } + } + return ""; + } else { + return ""; + } +} + // 璺敱鎵ц涔嬪墠鐨勪竴浜涙搷浣� router.beforeEach((to, from, next) => { - // 濡傛灉鏈塼oken - if (handleGetToken()) { + let token = getUrlParam('token'); + let bookId = getUrlParam('bookId'); + if(bookId){ + localStorage.setItem('bookId', bookId) + } + + if (token) { + localStorage.setItem('token', token) + + if (to.path === '/login') { + next({ path: '/home' }) + } else { + // 濡傛灉涓嶆槸鐧诲綍椤甸潰锛岃烦杞埌鐩爣鐨勯〉闈� + next() + } + }else if (handleGetToken()) { // 鏄惁鏄櫥褰曢〉闈紝鐩存帴鍒伴椤� if (to.path === '/login') { - next({ path: '/transmission' }) + next({ path: '/home' }) } else { // 濡傛灉涓嶆槸鐧诲綍椤甸潰锛岃烦杞埌鐩爣鐨勯〉闈� next() @@ -36,7 +68,6 @@ } } }) - // qiankun涓诲簲鐢ㄤ笌寰簲鐢ㄩ�氳 // import { initGlobalState, type MicroAppStateActions } from 'qiankun' @@ -68,7 +99,7 @@ const app = createApp(App) app.provide('toolClass', toolClass) -app.provide('request', request) +app.provide('MG', MG) app.use(router) app.use(ElementPlus) app.use(pinia) @@ -77,4 +108,3 @@ } app.mount('#parentApp') - diff --git a/src/qiankunState/state.ts b/src/qiankunState/state.ts index 186f2c5..affe189 100644 --- a/src/qiankunState/state.ts +++ b/src/qiankunState/state.ts @@ -1,6 +1,5 @@ const state = { state: 0, - bookName:"", bookId:0, getBookConfig: null, windowSelection: null, diff --git a/src/router/index.ts b/src/router/index.ts index 4c1125e..1242777 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 Home = () => import('@/views/home.vue') +const Reader = () => import('@/views/home.vue') const Login = () => import('@/views/login.vue') const router = createRouter({ @@ -11,19 +11,59 @@ component: Layout, children: [ { + path: '/index', + name: 'index', + meta: { auth: true }, + component: () => import('@/views/index.vue'), + children: [ + { + path: '/bookshelfList', + name: 'bookshelfList', + meta: { auth: true, name: '涔︽灦' }, + component: () => import('@/views/bookshelfList/list.vue') + }, + { + path: '/classeManagement', + name: 'classeManagement', + meta: { auth: true, name: '鐝骇' }, + component: () => import('@/views/classeManagement/list.vue') + }, + { + path: '/jobManagement', + name: 'jobManagement', + meta: { auth: true, name: '浣滀笟' }, + component: () => import('@/views/jobManagement/list.vue') + }, + { + path: '/personalCenter', + name: 'personalCenter', + meta: { auth: true, name: '涓汉涓績' }, + component: () => import('@/views/personalCenter/index.vue') + }, + { + path: '/messageList', + name: 'messageList', + meta: { auth: true, name: '娑堟伅' }, + component: () => import('@/views/messageList/list.vue') + } + ] + }, + { path: '/home', name: 'home', - meta: { auth: true }, - component: Home + meta: { auth: true, name: '闃呰鍣�' }, + component: Reader }, + { path: '/dictionary', name: 'dictionary', - meta: { auth: true }, + meta: { auth: true, name: '璇嶅吀' }, component: () => import('@/views/components/dictionary.vue') } ] }, + { path: '/login', name: 'login', diff --git a/src/views/bookshelfList/list.vue b/src/views/bookshelfList/list.vue new file mode 100644 index 0000000..ce7dc23 --- /dev/null +++ b/src/views/bookshelfList/list.vue @@ -0,0 +1,73 @@ +<template> + <div class="page"> + <div class="topBox"> + <div class="searchBox"> + <el-input + class="custom-input" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="searchText" + @keyup.enter="searchBook" + > + <template #suffix> + <el-icon @click="searchBook"><Search /></el-icon> + </template> + </el-input> + </div> + <div class="manageBox"> + <div class="manageItem"><img :src="jihe" /><div class="label">婵�娲�</div></div> + <div class="manageItem"><img :src="jihe" /><div class="label">绠$悊</div></div> + <div class="manageItem"><img :src="jihe" /><div class="label">鏇村鏁欐潗</div></div> + </div> + </div> + <div class="contentBox"></div> + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from 'vue-router' +import { ref, onMounted,inject } from 'vue' +const router = useRouter() +const MG: any = inject('MG') + +import jihe from '@/assets/images/menu/jihe.png' + +const searchText = ref('') +onMounted(() => {}) + +const searchBook = () => {} +</script> + +<style lang="less"> +.page { + width: 100%; + height: 100%; + padding: 20px; + .topBox { + display: flex; + .searchBox { + padding: 0 20px; + .el-input .el-input__wrapper{ + border-radius:20px !important; + height:34px; + background: #FFFFFF; + + } + } + .manageBox { + display: flex; + .manageItem { + margin: 0 15px; + display:flex; + align-items: center; + justify-content: center; + img{ + width:24px; + height:24px; + } + .label{ + padding-left:10px; + } + } + } + } +} +</style> diff --git a/src/views/classeManagement/list.vue b/src/views/classeManagement/list.vue new file mode 100644 index 0000000..4f549e1 --- /dev/null +++ b/src/views/classeManagement/list.vue @@ -0,0 +1,20 @@ +<template> + <div class="contentPage"> + 鐝骇 + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from "vue-router"; +import { ref, onMounted } from "vue"; +const router = useRouter(); + + +onMounted(() => { +}) + +</script> + +<style lang="less"> + + +</style> \ No newline at end of file diff --git a/src/views/components/dictionary.vue b/src/views/components/dictionary.vue index 79c2595..6e6a1d7 100644 --- a/src/views/components/dictionary.vue +++ b/src/views/components/dictionary.vue @@ -60,16 +60,25 @@ import { ref, reactive, watch, onMounted, inject } from 'vue' const request = inject('request') const props = defineProps({ - searchCon: Boolean + searchCon: String }) const searchContent = ref('') const isFull = ref(false) watch(props, (newValue) => { // 缁熺洃鍚琾rops鐨勫�煎彉鍖栵紝鍔ㄦ�佷慨鏀筰sShow鐨勫�� searchContent.value = newValue.searchCon + getSearchResult() +}) + +onMounted(() => { + if(props){ + searchContent.value = props.searchCon + getSearchResult() + } }) const searchResult = ref([]) + const getSearchResult = () => { if (searchContent.value) { @@ -81,8 +90,6 @@ isFull: isFull.value } }).then((res) => { - console.log(JSON.parse(res[0].sentence)[0].sCn) - // encodeURIComponent(res[0].syno[0].tran) if (res.length > 0) { res.map((item) => { item.phrase = JSON.parse(item.phrase) diff --git a/src/views/components/front006.vue b/src/views/components/front006.vue deleted file mode 100644 index 0091c0e..0000000 --- a/src/views/components/front006.vue +++ /dev/null @@ -1,458 +0,0 @@ -锘�<template> - <div> - <ul> - <li> - <a @click="goDetails('a007')">涓撻涓� 瀛﹀墠鍎跨鐢熺悊鍙戣偛鐗圭偣涓庝繚鍋�</a> - <ul class="h2"> - <li> - <a @click="goDetails('b001')">瀛︿範涓婚涓� 杩愬姩绯荤粺</a> - <ul> - <li><a @click="goDetails('c001')">涓�銆佸鍓嶅効绔ヨ繍鍔ㄧ郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c002')">浜屻�佸鍓嶅効绔ヨ繍鍔ㄧ郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b002')">瀛︿範涓婚浜� 鍛煎惛绯荤粺</a> - <ul> - <li><a @click="goDetails('c003')">涓�銆佸鍓嶅効绔ュ懠鍚哥郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c004')">浜屻�佸鍓嶅効绔ュ懠鍚哥郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b003')">瀛︿範涓婚涓� 寰幆绯荤粺</a> - <ul> - <li><a @click="goDetails('c005')">涓�銆佸鍓嶅効绔ュ惊鐜郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c006')">浜屻�佸鍓嶅効绔ュ惊鐜郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b004')">瀛︿範涓婚鍥� 娑堝寲绯荤粺</a> - <ul> - <li><a @click="goDetails('c007')">涓�銆佸鍓嶅効绔ユ秷鍖栫郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c008')">浜屻�佸鍓嶅効绔ユ秷鍖栫郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b005')">瀛︿範涓婚浜� 娉屽翱绯荤粺</a> - <ul> - <li><a @click="goDetails('c009')">涓�銆佸鍓嶅効绔ユ硨灏跨郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c010')">浜屻�佸鍓嶅効绔ユ硨灏跨郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b006')">瀛︿範涓婚鍏� 鐢熸畺绯荤粺</a> - <ul> - <li><a @click="goDetails('c011')">涓�銆佸鍓嶅効绔ョ敓娈栫郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c012')">浜屻�佸鍓嶅効绔ョ敓娈栫郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b007')">瀛︿範涓婚涓� 鍐呭垎娉岀郴缁�</a> - <ul> - <li><a @click="goDetails('c013')">涓�銆佸鍓嶅効绔ュ唴鍒嗘硨绯荤粺鐨勭壒鐐�</a></li> - <li><a @click="goDetails('c014')">浜屻�佸鍓嶅効绔ュ唴鍒嗘硨绯荤粺鐨勪繚鍋�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b008')">瀛︿範涓婚鍏� 绁炵粡绯荤粺</a> - <ul> - <li><a @click="goDetails('c015')">涓�銆佺缁忕郴缁熺殑鏋勬垚</a></li> - <li><a @click="goDetails('c016')">浜屻�佸鍓嶅効绔ョ缁忕郴缁熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c017')">涓夈�佸鍓嶅効绔ョ缁忕郴缁熺殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b009')">瀛︿範涓婚涔� 鎰熻鍣ㄥ畼</a> - <ul> - <li><a @click="goDetails('c018')">涓�銆佽瑙夊櫒瀹樷�斺�旂溂</a></li> - <li><a @click="goDetails('c019')">浜屻�佸惉瑙夊櫒瀹樷�斺�旇��</a></li> - <li><a @click="goDetails('c020')">涓夈�佹湰浣撴劅瑙夊櫒瀹樷�斺�旂毊鑲�</a></li> - <li><a @click="goDetails('c021')">鍥涖�佸叾浠栨劅瑙夊櫒瀹�</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a008')">涓撻浜� 瀛﹀墠鍎跨鐨勭敓闀垮彂鑲�</a> - <ul> - <li> - <a @click="goDetails('b010')">瀛︿範涓婚涓� 璁よ瘑瀛﹀墠鍎跨鐢熼暱鍙戣偛</a> - <ul> - <li> - <a @click="goDetails('c022')">涓�銆佺敓闀裤�佸彂鑲蹭笌鎴愮啛</a> - </li> - <li> - <a @click="goDetails('c023')">浜屻�佸鍓嶅効绔ュ勾榫勯樁娈电殑鍒掑垎鍙婂悇闃舵鐢熼暱鍙戣偛鐨勭壒鐐�</a> - </li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b011')">瀛︿範涓婚浜� 瀛﹀墠鍎跨鐢熼暱鍙戣偛鐨勮寰�</a> - <ul> - <li> - <a @click="goDetails('c024')">涓�銆佺敓闀垮彂鑲茬殑杩炵画鎬у拰闃舵鎬�</a> - </li> - <li> - <a @click="goDetails('c025')">浜屻�佺敓闀垮彂鑲茬殑绋嬪簭鎬�</a> - </li> - <li> - <a @click="goDetails('c026')">涓夈�佺敓闀垮彂鑲茬殑涓嶅潎琛℃��</a> - </li> - <li> - <a @click="goDetails('c027')">鍥涖�佺敓闀垮彂鑲茬殑鐩镐簰鍏宠仈鎬�</a> - </li> - <li> - <a @click="goDetails('c028')">浜斻�佺敓闀垮彂鑲茬殑涓綋宸紓鎬�</a> - </li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b012')">瀛︿範涓婚涓� 褰卞搷瀛﹀墠鍎跨鐢熼暱鍙戣偛鐨勫洜绱�</a> - <ul> - <li><a @click="goDetails('c029')">涓�銆侀仐浼犲洜绱�</a></li> - <li><a @click="goDetails('c030')">浜屻�佺幆澧冨洜绱�</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a009')">涓撻涓� 瀛﹀墠鍎跨蹇冪悊鍙戝睍鐗圭偣涓庝繚鍋�</a> - <ul> - <li> - <a @click="goDetails('b013')">瀛︿範涓婚涓� 瀛﹀墠鍎跨蹇冪悊鐨勫彂灞�</a> - <ul> - <li><a @click="goDetails('c030')">涓�銆佸鍓嶅効绔ュ績鐞嗗彂灞曠殑鐗圭偣</a></li> - <li><a @click="goDetails('c032')">浜屻�佸奖鍝嶅鍓嶅効绔ュ績鐞嗗彂灞曠殑鍥犵礌</a></li> - <li><a @click="goDetails('c033')">涓夈�佸鍓嶅効绔ョ殑蹇冪悊鍋ュ悍</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b014')">瀛︿範涓婚浜� 瀛﹀墠鍎跨甯歌鐨勫績鐞嗚涓洪棶棰樺強鍏跺紩瀵�</a> - <ul> - <li><a @click="goDetails('c034')">涓�銆佸鍓嶅効绔ヤ骇鐢熷帇鍔涚殑鍘熷洜</a></li> - <li><a @click="goDetails('c035')">浜屻�佸効绔ュ父瑙佺殑蹇冪悊琛屼负闂鍙婂叾寮曞</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b015')">瀛︿範涓婚涓� 瀛﹀墠鍎跨甯歌鐨勫績鐞嗙柧鐥呭強鍏堕闃�</a> - <ul> - <li><a @click="goDetails('c036')">涓�銆佽█璇拰璇█闅滅</a></li> - <li><a @click="goDetails('c037')">浜屻�佺簿绁炲彂鑲茶繜婊�</a></li> - <li><a @click="goDetails('c038')">涓夈�佸鐙棁</a></li> - <li><a @click="goDetails('c039')">鍥涖�佸効绔ュ鍔ㄧ棁</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a010')">涓撻鍥� 瀛﹀墠鍎跨鍋ュ悍璇勪环</a> - <ul> - <li> - <a @click="goDetails('b016')">瀛︿範涓婚涓� 瀛﹀墠鍎跨韬綋鍋ュ悍鐨勮瘎浠�</a> - <ul> - <li><a @click="goDetails('c040')">涓�銆佸鍓嶅効绔ョ敓闀垮彂鑲茬殑璇勪环</a></li> - <li><a @click="goDetails('c041')">浜屻�佸鍓嶅効绔ュ仴搴锋鏌�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b017')">瀛︿範涓婚浜� 瀛﹀墠鍎跨蹇冪悊鍋ュ悍鐨勮瘎浠�</a> - <ul> - <li><a @click="goDetails('c042')">涓�銆佸鍓嶅効绔ュ績鐞嗚瘎浼扮殑姒傚康鍜岀壒鐐�</a></li> - <li><a @click="goDetails('c043')">浜屻�佸鍓嶅効绔ュ績鐞嗘祴璇曠殑鏂规硶</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a011')">涓撻浜� 瀛﹀墠鍎跨钀ュ吇鍗敓涓庝繚鍋�</a> - <ul> - <li> - <a @click="goDetails('b018')">瀛︿範涓婚涓� 钀ュ吇瀛﹀熀纭�鐭ヨ瘑</a> - <ul> - <li><a @click="goDetails('c044')">涓�銆佸鍓嶅効绔ュ鑳介噺鐨勯渶姹�</a></li> - <li><a @click="goDetails('c045')">浜屻�佷骇鑳借惀鍏荤礌</a></li> - <li><a @click="goDetails('c046')">涓夈�侀潪浜ц兘钀ュ吇绱�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b019')">瀛︿範涓婚浜� 濠村効鍠傚吇</a> - <ul> - <li><a @click="goDetails('c047')">涓�銆佹瘝涔冲杺鍏�</a></li> - <li><a @click="goDetails('c048')">浜屻�佷汉宸ュ杺鍏诲拰娣峰悎鍠傚吇</a></li> - <li><a @click="goDetails('c049')">涓夈�佽緟椋熺殑娣诲姞</a></li> - <li><a @click="goDetails('c050')">鍥涖�佹柇濂�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b020')">瀛︿範涓婚涓� 瀛﹀墠鍎跨鐨勮喅椋�</a> - <ul> - <li><a @click="goDetails('c051')">涓�銆佸鍓嶅効绔ヨ喅椋熺殑閰嶅埗鍘熷垯</a></li> - <li><a @click="goDetails('c052')">浜屻�佸鍓嶅効绔ラギ椋熷崼鐢�</a></li> - <li><a @click="goDetails('c053')">涓夈�佸鍓嶅効绔ョ殑楗琛屼负</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b021')">瀛︿範涓婚鍥� 鎵樺辜鏈烘瀯鐨勮喅椋熺鐞�</a> - <ul> - <li><a @click="goDetails('c054')">涓�銆佹墭骞兼満鏋勭殑鑶抽璁″垝</a></li> - <li><a @click="goDetails('c055')">浜屻�佽喅椋熻皟鏌�</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a012')">涓撻鍏� 瀛﹀墠鍎跨鍚勫勾榫勬湡鐨勭壒鐐逛笌淇濆仴</a> - <ul> - <li> - <a @click="goDetails('b022')">瀛︿範涓婚涓� 鑳庡効鏈熺殑鐗圭偣涓庝繚鍋�</a> - <ul> - <li><a @click="goDetails('c056')">涓�銆佽儙鍎挎湡鐨勭壒鐐�</a></li> - <li><a @click="goDetails('c057')">浜屻�佸瓡濡囩殑鍗敓涓庝繚鍋�</a></li> - <li><a @click="goDetails('c058')">涓夈�佽儙鍎跨殑淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b023')">瀛︿範涓婚浜� 鏂扮敓鍎挎湡鐨勭壒鐐逛笌淇濆仴</a> - <ul> - <li><a @click="goDetails('c059')">涓�銆佹柊鐢熷効鏈熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c060')">浜屻�佹柊鐢熷効鏈熺殑淇濆仴</a></li> - <li><a @click="goDetails('c061')">涓夈�佹湭鎴愮啛鍎夸笌杩囩啛鍎�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b024')">瀛︿範涓婚涓� 濠村効鏈熺殑鐗圭偣涓庝繚鍋�</a> - <ul> - <li><a @click="goDetails('c062')">涓�銆佸┐鍎挎湡鐨勭壒鐐�</a></li> - <li><a @click="goDetails('c063')">浜屻�佸┐鍎挎湡鐨勬姢鐞嗕笌淇濆仴</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b025')">瀛︿範涓婚鍥� 骞煎効鍓嶆湡鐨勭壒鐐逛笌淇濆仴</a> - <ul> - <li><a @click="goDetails('c064')">涓�銆佸辜鍎垮墠鏈熺殑鐗圭偣</a></li> - <li><a @click="goDetails('c065')">浜屻�佸辜鍎垮墠鏈熺殑鎶ょ悊涓庝繚鍋�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b026')">瀛︿範涓婚浜� 骞煎効鏈熺殑鐗圭偣涓庝繚鍋�</a> - <ul> - <li><a @click="goDetails('c066')">涓�銆佸辜鍎挎湡鐨勭壒鐐�</a></li> - <li><a @click="goDetails('c067')">浜屻�佸辜鍎挎湡鐨勬姢鐞嗕笌淇濆仴</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a013')">涓撻涓� 瀛﹀墠鍎跨鐤剧梾鍙婂叾棰勯槻</a> - <ul> - <li> - <a @click="goDetails('b027')">瀛︿範涓婚涓� 鐤剧梾鍩虹</a> - <ul> - <li><a @click="goDetails('c068')">涓�銆佺柧鐥呯殑绉嶇被</a></li> - <li><a @click="goDetails('c069')">浜屻�佺柧鐥呮棭鍙戠幇</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b028')">瀛︿範涓婚浜� 閬椾紶鐥呭強鍏堕闃�</a> - <ul> - <li><a @click="goDetails('c070')">涓�銆佽璇嗛仐浼犵梾</a></li> - <li><a @click="goDetails('c071')">浜屻�佽繎浜茬粨濠氫笌闅愭�ч仐浼犵梾</a></li> - <li><a @click="goDetails('c072')">涓夈�侀仐浼犵梾鐨勯闃测�斺�斾紭鐢�</a></li> - <li><a @click="goDetails('c073')">鍥涖�佷紭鐢熸帾鏂�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b029')">瀛︿範涓婚涓� 鏂扮敓鍎垮父瑙佺柧鐥呭強鍏堕闃�</a> - <ul> - <li><a @click="goDetails('c074')">涓�銆佹柊鐢熷効纭偪鐥�</a></li> - <li><a @click="goDetails('c075')">浜屻�佹柊鐢熷効鑴愮値</a></li> - <li><a @click="goDetails('c076')">涓夈�佹柊鐢熷効鑲虹値</a></li> - <li><a @click="goDetails('c077')">鍥涖�侀箙鍙g柈</a></li> - <li><a @click="goDetails('c078')">浜斻�佹柊鐢熷効鐮翠激椋�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b030')">瀛︿範涓婚鍥� 濠村辜鍎垮父瑙佺梾鍙婂叾棰勯槻</a> - <ul> - <li><a @click="goDetails('c079')">涓�銆佽偉鑳栫棁</a></li> - <li><a @click="goDetails('c080')">浜屻�佺淮鐢熺礌D缂轰箯鎬т綕鍋荤梾</a></li> - <li><a @click="goDetails('c081')">涓夈�佺己閾佹�ц传琛�</a></li> - <li><a @click="goDetails('c082')">鍥涖�佷笂鍛煎惛閬撴劅鏌�</a></li> - <li><a @click="goDetails('c083')">浜斻�佹�ユ�ф墎妗冧綋鐐�</a></li> - <li><a @click="goDetails('c084')">鍏�佽偤鐐�</a></li> - <li><a @click="goDetails('c085')">涓冦�佽吂娉�</a></li> - <li><a @click="goDetails('c086')">鍏�侀緥榻�</a></li> - <li><a @click="goDetails('c087')">涔濄�佹�ユ�у寲鑴撴�т腑鑰崇値</a></li> - <li><a @click="goDetails('c088')">鍗併�佸急瑙�</a></li> - <li><a @click="goDetails('c089')">鍗佷竴銆佺棻瀛�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b031')">瀛︿範涓婚浜� 瀛﹀墠鍎跨甯歌浼犳煋鐥呭強鍏堕闃�</a> - <ul> - <li><a @click="goDetails('c090')">涓�銆佷紶鏌撶梾鐨勫熀纭�鐭ヨ瘑</a></li> - <li><a @click="goDetails('c091')">浜屻�佸鍓嶅効绔ュ父瑙佷紶鏌撶梾鍙婂叾棰勯槻</a></li> - <li><a @click="goDetails('c092')">涓夈�佸瘎鐢熻櫕鐥呴槻娌�</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a014')">涓撻鍏� 瀛﹀墠鍎跨甯哥敤鎶ょ悊涓庢�ユ晳鎶�鏈�</a> - <ul> - <li> - <a @click="goDetails('b032')">瀛︿範涓婚涓� 甯哥敤鎶ょ悊鎶�鏈�</a> - <ul> - <li><a @click="goDetails('c093')">涓�銆佹祴閲忎綋娓�</a></li> - <li><a @click="goDetails('c094')">浜屻�佺墿鐞嗛檷娓�</a></li> - <li><a @click="goDetails('c095')">涓夈�佺儹鏁锋硶</a></li> - <li><a @click="goDetails('c096')">鍥涖�佹祴閲忚剦鎼�</a></li> - <li><a @click="goDetails('c097')">浜斻�佽瀵熷懠鍚�</a></li> - <li><a @click="goDetails('c098')">鍏�佸杺鑽�</a></li> - <li><a @click="goDetails('c099')">涓冦�佺炕杞溂鐨�</a></li> - <li><a @click="goDetails('c101')">鍏�佹淮鐪艰嵂姘淬�佹秱鐪艰嵂鑶�</a></li> - <li><a @click="goDetails('c101')">涔濄�佹淮榧昏嵂姘�</a></li> - <li><a @click="goDetails('c102')">鍗併�佹淮鑰宠嵂姘�</a></li> - <li><a @click="goDetails('c103')">鍗佷竴銆佹榧昏</a></li> - <li><a @click="goDetails('c104')">鍗佷簩銆佺畝鏄撻�氫究娉�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b033')">瀛︿範涓婚浜� 瀛﹀墠鍎跨甯歌鐨勬剰澶栦簨鏁呭強鎬ユ晳</a> - <ul> - <li><a @click="goDetails('c105')">涓�銆佸父瑙佹剰澶栦簨鏁呭強鍏跺鐞�</a></li> - <li><a @click="goDetails('c106')">浜屻�佸父鐢ㄦ�ユ晳鏈�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b034')">瀛︿範涓婚涓� 鎵樺辜鏈烘瀯鎰忓浜嬫晠鐨勫父瑙佸師鍥犱笌瀹夊叏绠$悊</a> - <ul> - <li><a @click="goDetails('c107')">涓�銆佹墭骞兼満鏋勬剰澶栦簨鏁呯殑甯歌鍘熷洜</a></li> - <li><a @click="goDetails('c108')">浜屻�佹墭骞兼満鏋勭殑瀹夊叏绠$悊</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a015')">涓撻涔� 瀛﹀墠鍎跨鐢熸椿淇濆仴鍒跺害</a> - <ul> - <li> - <a @click="goDetails('b035')">瀛︿範涓婚涓� 瀛﹀墠鍎跨鐢熸椿鍒跺害</a> - <ul> - <li><a @click="goDetails('c109')">涓�銆佸埗瀹氬悎鐞嗙殑鐢熸椿鍒跺害鐨勬剰涔�</a></li> - <li><a @click="goDetails('c110')">浜屻�佸埗瀹氫竴鏃ョ敓娲诲埗搴︾殑渚濇嵁</a></li> - <li><a @click="goDetails('c111')">涓夈�佹墽琛屼竴鏃ョ敓娲诲埗搴︾殑娉ㄦ剰浜嬮」</a></li> - <li><a @click="goDetails('c112')">鍥涖�佸鍓嶅効绔ヤ竴鏃ョ敓娲诲悇鐜妭鐨勫崼鐢熻姹�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b036')">瀛︿範涓婚浜� 鎵樺辜鏈烘瀯鐨勫崼鐢熶繚鍋ュ埗搴�</a> - <ul> - <li><a @click="goDetails('c113')">涓�銆佷綋鏍兼鏌ュ埗搴�</a></li> - <li><a @click="goDetails('c114')">浜屻�侀闃叉帴绉嶅埗搴�</a></li> - <li><a @click="goDetails('c115')">涓夈�侀殧绂诲埗搴�</a></li> - <li><a @click="goDetails('c116')">鍥涖�佹秷姣掑埗搴�</a></li> - <li><a @click="goDetails('c117')">浜斻�佺幆澧冨崼鐢熷埗搴�</a></li> - <li><a @click="goDetails('c118')">鍏�佸崼鐢熶繚鍋ョ櫥璁板拰缁熻鍒跺害</a></li> - </ul> - </li> - </ul> - </li> - <li> - <a @click="goDetails('a016')">涓撻鍗� 鎵樺辜鏈烘瀯鐨勭幆澧冨崼鐢�</a> - <ul> - <li> - <a @click="goDetails('b037')">瀛︿範涓婚涓� 鎵樺辜鏈烘瀯鐨勫缓绛戝崼鐢�</a> - <ul> - <li><a @click="goDetails('c119')">涓�銆佸辜鍎垮洯鍥潃鐨勯�夋嫨</a></li> - <li><a @click="goDetails('c120')">浜屻�佸洯鍐呭竷灞�鐨勫崼鐢熻姹�</a></li> - <li><a @click="goDetails('c121')">涓夈�佸辜鍎垮洯鍚勫閰嶇疆鐨勫崼鐢熻姹�</a></li> - <li><a @click="goDetails('c122')">鍥涖�佸鍐呯殑閲囧厜鍜岀収鏄�</a></li> - <li><a @click="goDetails('c123')">浜斻�佸鍐呯殑閫氶鍜岄噰鏆�</a></li> - </ul> - </li> - </ul> - <ul> - <li> - <a @click="goDetails('b038')">瀛︿範涓婚浜� 鎵樺辜鏈烘瀯鐨勮澶囧強鏁欏叿銆佺帺鍏峰崼鐢�</a> - <ul> - <li><a @click="goDetails('c124')">涓�銆佸鍏风殑鍗敓</a></li> - <li><a @click="goDetails('c125')">浜屻�佹枃鍏枫�佹暀鍏峰強鐜╁叿鐨勫崼鐢�</a></li> - <li><a @click="goDetails('c126')">涓夈�佷綋鑲茶澶囧崼鐢�</a></li> - </ul> - </li> - </ul> - </li> - <li><a @click="goDetails('a017')">缁煎悎浜戞祴璇�</a></li> - <li><a @click="goDetails('a018')">鍙傝�冩枃鐚�</a></li> - <li><a @click="goDetails('a019')">闄勫綍 甯歌椋熺墿鍙堕吀鍚噺琛�</a></li> - </ul> - </div> -</template> - -<script lang="ts" setup> -const goDetails = (index) => { - console.log(index) - document.getElementById(index).scrollIntoView() -} -</script> - -<style lang="less" scoped> -ul ul { - margin-left: 15px; -} -</style> diff --git a/src/views/components/menuView.vue b/src/views/components/menuView.vue new file mode 100644 index 0000000..375edf8 --- /dev/null +++ b/src/views/components/menuView.vue @@ -0,0 +1,119 @@ +<template> + <div class="menuList"> + <ul class="menu-top"> + <li + v-for="item in menuList.menu" + :key="item.key" + @click="goRouter(item)" + :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + > + <img :src="item.icon" alt="" /> + <div>{{ item.label }}</div> + </li> + </ul> + <ul class="menu-bottom"> + <li + v-for="item in menuList.user" + :key="item.key" + @click="goRouter(item)" + :class="`/${item.path}` === path ? 'activeItem hover' : 'menuItem hover'" + > + <img :src="item.icon" alt="" /> + <div>{{ item.label }}</div> + </li> + </ul> + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from 'vue-router' +import { ref, reactive, onMounted } from 'vue' +const router = useRouter() +const routerVal = router.currentRoute.value +const path = ref(routerVal.path) +import ziyuan from '@/assets/images/menu/ziyuan.png' + +const menuList = reactive({ + menu: [ + { + label: '涔︽灦', + key: '1', + path: 'bookshelfList', + icon: ziyuan + }, + { + label: '鐝骇', + key: '2', + path: 'classeManagement', + icon: ziyuan + }, + { + label: '浣滀笟', + key: '3', + path: 'jobManagement', + icon: ziyuan + } + ], + user: [ + { + label: '涓汉涓績', + key: '4', + path: 'personalCenter', + icon: ziyuan + }, + { + label: '娑堟伅', + key: '5', + path: 'messageList', + icon: ziyuan + }, + { + label: '璁剧疆', + key: '6', + path: 'setting', + icon: ziyuan + } + ] +}) +onBeforeRouteUpdate(async (to, from) => { + path.value = to.fullPath +}) +onMounted(() => {}) +const goRouter = (item) => { + if (!localStorage.getItem('token')) { + return router.push({ + path: '/home' + }) + } + router.push({ path: item.path }) +} +</script> + +<style lang="less"> +.menuList { + height: 100%; + padding: 10px; + text-align: center; + position: relative; + font-size: 14px; + color: #b3b3b3; + li { + margin-bottom: 10px; + img { + width: 24px; + height: 24px; + } + } + .menuItem { + color: #b3b3b3; + } + + .menu-bottom { + position: absolute; + bottom: 20px; + margin: 0 auto; + } + .activeItem { + color: #4d4d4d; + } +} +</style> diff --git a/src/views/exportTask.vue b/src/views/exportTask.vue deleted file mode 100644 index 7feec2c..0000000 --- a/src/views/exportTask.vue +++ /dev/null @@ -1,363 +0,0 @@ -<template> - <div class="exportTaskBox"> - <div class="taskList"> - <p class="blockTitle">浠诲姟鍒楄〃</p> - <p @click="newTask">娴嬭瘯鍒涘缓浠诲姟</p> - <div - :class="'taskItem ' + selectedTaskIndex == index ? 'active' : ''" - v-for="(task, index) in tasks" - :key="index" - > - <p class="taskItemTitle">{{ task.bookTplName + '_' + task.id }}</p> - <p class="taskItemDesc"> - <span class="time">{{ task.startDate }}</span> - <span class="state"> - <span style="color: #909399" v-if="task.state == 0">鍒濆鍖�</span> - <span style="color: #909399" v-if="task.state == 1">澶勭悊涓�...</span> - <span style="color: #e6a23c" v-if="task.state == 2">鏆傚仠</span> - <span style="color: #67c23a" v-if="task.state == 3">宸插畬鎴�</span> - <span style="color: #f56c6c" v-if="task.state == 4">澶辫触</span> - </span> - </p> - </div> - </div> - <div class="contentBox"> - <p class="blockTitle">浠诲姟璇︽儏</p> - <div class="taskDetailBox" v-if="selectedTask"> - <div class="baseInfo"> - <span> - 瀵煎嚭妯℃澘锛�<span>{{ selectedTask.bookTplName }}</span> - </span> - <span> - 鏂囦欢妯℃澘锛�<span>{{ selectedTask.fileTplName }}</span> - </span> - <span> - 鍒涘缓鏃堕棿锛�<span>{{ selectedTask.startDate }}</span> - </span> - <span v-if="selectedTask.state == 3"> - 瀹屾垚鏃堕棿锛�<span>{{ selectedTask.endDate }}</span> - </span> - <span style="width: 100%"> - 鏂囦欢璺緞锛� - <span style="width: auto"> - {{ selectedTask.taskPath }} - <el-icon><Search /></el-icon> - </span> - </span> - </div> - <div class="progressInfo"> - <p class="stepItem" v-if="selectedTask.progressInfo.createTask"> - <span>鍒涘缓浠诲姟...</span> - <el-icon v-if="selectedTask.progressInfo.createTask != 3"><Loading /></el-icon> - <el-icon v-if="selectedTask.progressInfo.createTask == 3"><CircleCheck /></el-icon> - </p> - <p class="stepItem" v-if="selectedTask.progressInfo.temporaryFolder"> - <span>鍒涘缓涓存椂鏂囦欢澶�</span> - <el-icon v-if="selectedTask.progressInfo.temporaryFolder != 3"><Loading /></el-icon> - <el-icon v-if="selectedTask.progressInfo.temporaryFolder == 3"><CircleCheck /></el-icon> - </p> - <div class="bookInfoBox" v-if="selectedTask.progressInfo.handleBook.state"> - <p class="progressItem"> - <span>鑾峰彇鍥句功淇℃伅锛�</span> - <span style="display: inline-block; width: 170px"> - <el-progress - :percentage="selectedTask.progressInfo.handleBook.progress" - :status="selectedTask.progressInfo.handleBook.progress < 100 ? '' : 'success'" - /> - </span> - <span> - {{ selectedTask.progressInfo.handleBook.showProgress }} - </span> - </p> - </div> - <p class="stepItem" v-if="selectedTask.progressInfo.handleExcel"> - <span>鐢熸垚Excel</span> - <el-icon v-if="selectedTask.progressInfo.handleExcel != 3"><Loading /></el-icon> - <el-icon v-if="selectedTask.progressInfo.handleExcel == 3"><CircleCheck /></el-icon> - </p> - <div class="fileInfoBox" v-if="selectedTask.progressInfo.showHandleFile"> - <p class="stepItem"> - <span>寮�濮嬩笅杞芥枃浠�...</span> - </p> - <p - class="progressItem" - v-if="bookKey in Object.keys(selectedTask.progressInfo.handleFile)" - :key="bookKey" - > - <span :title="selectedTask.progressInfo.handleFile[bookKey].bookName"> - {{ - selectedTask.progressInfo.handleFile[bookKey].bookName + - (selectedTask.progressInfo.handleFile[bookKey].ISBN - ? '锛�' + selectedTask.progressInfo.handleFile[bookKey].ISBN + '锛�' - : '') - }} - 锛� - </span> - <span style="display: inline-block; width: 170px"> - <el-progress - :percentage="selectedTask.progressInfo.handleFile[bookKey].progress" - :status=" - selectedTask.progressInfo.handleFile[bookKey].progress < 100 ? '' : 'success' - " - /> - </span> - <span> - {{ selectedTask.progressInfo.handleFile[bookKey].showProgress }} - </span> - </p> - </div> - <div class="fileInfoBox" v-if="selectedTask.progressInfo.showHandleFolder"> - <p class="stepItem"> - <span>澶勭悊鏂囦欢澶�...</span> - </p> - <p class="stepItem"> - <span :title="selectedTask.progressInfo.handleFolder[bookKey].bookName"> - {{ - selectedTask.progressInfo.handleFolder[bookKey].bookName + - (selectedTask.progressInfo.handleFolder[bookKey].ISBN - ? '锛�' + selectedTask.progressInfo.handleFolder[bookKey].ISBN + '锛�' - : '') - }} - </span> - <el-icon v-if="selectedTask.progressInfo.handleFolder[bookKey].state != 3" - ><Loading - /></el-icon> - <el-icon v-if="selectedTask.progressInfo.handleFolder[bookKey].state == 3" - ><CircleCheck - /></el-icon> - </p> - </div> - <p class="stepItem" v-if="selectedTask.state == 3"> - <span>瀵煎嚭鎴愬姛锛�</span> - <el-icon><CircleCheck /></el-icon> - </p> - </div> - </div> - </div> - </div> -</template> - -<script setup lang="ts"> -import { ref, reactive, inject, onMounted, watch } from 'vue' -import { useRouter, RouterView } from 'vue-router' -import { ElMessage } from 'element-plus' -import { useExportTask } from '@/store' -const ExportTask = useExportTask() -const router = useRouter() - -const selectedTaskIndex = ref(0) -const tasks = ref([]) -const selectedTask = ref() - -onMounted(() => { - updateListData() -}) - -watch( - () => ExportTask.updateList, - (newValue, oldValue) => { - updateListData() - } -) - -watch( - () => ExportTask.msgData, - (newValue, oldValue) => { - console.log(newValue) - // if (newValue.type == 'showState') { - // stateInfo.value = newValue.msg - // } else if (newValue.type == 'notDownloadFolder') { - // console.log('notDownloadFolder') - // // 涓嬭浇鐩綍妫�娴嬩笉瀛樺湪锛岃缃笅杞界洰褰� - // const path = window.electronAPI.openSelectFileOrFolderDialog({ - // title: '閫夋嫨涓嬭浇鐩綍', - // properties: ['openDirectory'] - // }) - // if (path && path.length > 0) { - // const returnData = window.electronAPI.setDownloadPath(path[0], newValue.msg) - // } - // } else { - // ElMessage({ - // message: newValue.msg, - // type: newValue.type - // }) - // } - } -) - -const newTask = () => { - window.electronAPI.newExportTask({ - bookInfo: [ - { - id: 23627, - idPath: '22288\\26631\\23627', - storeId: 9, - repoId: 16, - typeId: 3 - } - ], - tplInfo: { - type: "user", // sys & user - key: "9102ABDCE3C5CD294E832EBDA51948FF" - } - }) -} - -const updateListData = () => { - // 鑾峰彇瀵煎嚭浠诲姟鍒楄〃 - const taskListData = window.electronAPI.getExportTasks() - console.log(taskListData); -} - -const handleData = (data) => { - // 鏂囦欢淇℃伅 - if (Object.keys(data.progressInfo.handleFile).length) { - let start = false - for (const key in data.progressInfo.handleFile) { - let bookFile = data.progressInfo.handleFile[key] - let bookInfo = data.bookInfo.filter((item) => { - return item.id == key - }) - if (bookInfo.length) { - bookFile.bookName = bookInfo[0].name - if (bookFile.bookName) bookFile.bookName = bookFile.bookName.replace(/[/|\\]/g, '_') - bookFile.ISBN = bookInfo[0].ISBN - if (bookFile.ISBN) bookFile.ISBN = bookFile.ISBN.replace(/[/|\\]/g, '_') - } - if (bookFile.state) { - if (bookFile.info.total) { - bookFile.progress = parseInt((bookFile.info.success / bookFile.info.total) * 100) - } else { - bookFile.progress = 100 - } - bookFile.showProgress = '锛�' + bookFile.info.success + ' / ' + bookFile.info.total + '锛�' - start = true - } - } - - if (start) { - data.progressInfo.showHandleFile = true - } - } - // 澶勭悊鏂囦欢澶� - if (Object.keys(data.progressInfo.handleFolder).length) { - let start = false - for (const key in data.progressInfo.handleFolder) { - let folderState = data.progressInfo.handleFolder[key] - data.progressInfo.handleFolder[key] = { - state: folderState - } - let bookInfo = data.bookInfo.filter((item) => { - return item.id == key - }) - if (bookInfo.length) { - data.progressInfo.handleFolder[key].bookName = bookInfo[0].name - data.progressInfo.handleFolder[key].ISBN = bookInfo[0].ISBN - } - if (folderState) { - start = true - } - } - if (start) { - data.progressInfo.showHandleFolder = true - } - } - // 涔︾睄淇℃伅 - data.progressInfo.handleBook.progress = parseInt( - (data.progressInfo.handleBook.info.success / data.progressInfo.handleBook.info.total) * 100 - ) - data.progressInfo.handleBook.showProgress = - '锛�' + - data.progressInfo.handleBook.info.success + - ' / ' + - data.progressInfo.handleBook.info.total + - '锛�' - - return data -} -</script> - -<style lang="less"> -.exportTaskBox { - width: 100%; - height: 100%; - display: flex; - .taskList { - width: 280px; - padding: 40px 20px; - border-right: 1px solid #e6e7e8; - .taskItem { - padding: 10px; - cursor: pointer; - .taskItemTitle { - color: #000; - font-weight: 500; - font-size: 14px; - margin-bottom: 6px; - } - .taskItemDesc { - color: #666; - font-size: 12px; - overflow: hidden; - .time { - float: left; - } - .state { - float: right; - } - } - &.active { - background: #efefef; - } - } - } - .contentBox { - flex: 1; - padding: 50px; - .taskDetailBox { - width: 100%; - height: 100%; - overflow: auto; - padding: 20px; - .baseInfo { - margin-bottom: 20px; - padding-bottom: 20px; - border-bottom: 1px solid #ccc; - span { - display: inline-block; - width: 50%; - color: #999; - margin-bottom: 5px; - span { - color: #000; - } - } - } - .progressInfo { - .stepItem { - margin-bottom: 6px; - span { - margin-right: 8px; - } - } - .fileInfoBox { - .progressItem { - margin-bottom: 6px; - } - } - .bookInfoBox { - .progressItem { - margin-bottom: 6px; - } - } - } - } - } - .blockTitle { - font-size: 20px; - font-weight: bold; - line-height: 32px; - margin-bottom: 20px; - } -} -</style> diff --git a/src/views/home.vue b/src/views/home.vue index 432a76b..f8ffa9e 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -1,28 +1,25 @@ <template> <div class="homeBox"> <div class="headerBox"> - <!-- <span class="logoTxt">鍖椾含甯堣寖澶у鍑虹増闆嗗洟</span> --> - <img :src="logo" /> + + <img :src="logo" v-if="bookConfig.textbookOwnership == '鍖椾含甯堣寖澶у鍑虹増闆嗗洟'" /> + <!-- <span class="logoTxt" v-else>閾侀亾鍑虹増绀�</span> --> + <span></span> <div class="userInfoBox"> - <div></div> - <div></div> + <div class="userName" v-if="userInfo.name">{{userInfo.name}}</div> <div><div class="layout hover" @click="layoutBtn">閫�鍑�</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 class="menuIcon imgBox"> - <img :src="item.icon" /> + <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 class="menuIcon imgBox"> + <img :src="item.icon" /> + </div> + <div class="name">{{ item.name }}</div> </div> - <div class="name">{{ item.name }}</div> - </div> </div> <!-- <div class="reload hover" @click="reload()">鍒锋柊</div> --> <!-- 璁剧疆 --> @@ -100,7 +97,10 @@ @keyup.enter="searchBook" > <template #prefix> - <el-icon class="hover"><Search /></el-icon> + <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> </template> </el-input> </div> @@ -121,7 +121,7 @@ <el-tree ref="catalogTree" default-expand-all="true" - expand-on-click-node="false" + :expand-on-click-node="false" :data="catalogueData" :props="defaultProps" v-if="catalogueData.length > 0" @@ -135,7 +135,7 @@ </div> </template> </el-tree> - <div v-if="catalogueData.length == 0"> + <div v-else> <el-empty :image-size="60" description="鏆傛棤鏁版嵁" /> </div> </div> @@ -244,6 +244,9 @@ <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> + </template> </el-input> </div> </div> @@ -323,11 +326,13 @@ </div> </div> </div> + <!-- 鑿滃崟鍐呭鏀惰捣 --> + <div class="menuStateBox" v-if="menuState.open"> + <svg @click="menuState.open = false" 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-arrow-bar-to-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12l10 0" /><path d="M10 12l4 4" /><path d="M10 12l4 -4" /><path d="M4 4l0 16" /></svg> + <!-- <img :src="shouqiL" @click="menuState.open = false" /> --> + </div> </div> - <!-- 鑿滃崟鍐呭鏀惰捣 --> - <div class="menuStateBox" v-if="menuState.open"> - <img :src="shouqiL" @click="menuState.open = false" /> - </div> + <!-- 涓棿鍐呭 --> <div class="pageBox"> <!-- 澶撮儴鏄剧ず --> @@ -345,9 +350,9 @@ </div> <div class="rightBox"> <div class="pageSizeBox"> - <div><img :src="zoomIn" @click="changePageSize('add')" /></div> - <div>{{ headerData.pageSize }}%</div> <div><img :src="zoomOut" @click="changePageSize('reduce')" /></div> + <div>{{ headerData.pageSize }}%</div> + <div><img :src="zoomIn" @click="changePageSize('add')" /></div> </div> <!-- <div class="brushImgBox"> <div @click="jumpContent('note' + index)"> @@ -360,10 +365,7 @@ <div class="pageBox-content"> <div class="content-box"> <div - id="container" - @mousedown="handleMouseDown" - @mousemove="handleMousemove" - :style="{ background: settingForm.bgColorActive }" + id="container" :style="{ background: settingForm.bgColorActive }" ></div> <!-- 鐢荤瑪鐢诲竷 --> <div class="canvas-box" v-show="canvasShow"> @@ -371,131 +373,9 @@ </div> </div> </div> - </div> - <!-- 鏁欏缁勪欢 --> - <div class="toolBox"> - <div class="toolTitle"> - <span>{{ toolState.open ? '瀛︿範缁勪欢' : '缁勪欢' }}</span> - <div class="text"></div> - </div> - <div class="menuList"> - <ul class="menu"> - <li v-for="item in teachToolsMenuData" :key="item.key"> - <div :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" :style="!toolState.open ? 'padding:10px 15px' : ''" v-if="item.isShow" @click="selectTeachTools(item)"> - <img :src="item.icon" alt="" /> - <span v-if="toolState.open">{{ item.name }}</span> - </div> - </li> - </ul> - </div> - <div :class="['openBox', toolState.open ? 'right' : '']"> - <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> - <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> - </div> - <div class="classRoomBox" v-if="false"> - <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> - <el-tab-pane label="澶囪缁勪欢" name="first"> - <div class="tabBox"> - <div class="insertSelect"> - <div - :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" - @click="selectTypeClick('resource')" - > - <img :src="selectType == 'resource' ? charuziyuan_blue : charuziyuan" /> - <div>鎻掑叆璧勬簮</div> - </div> - <div - :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" - @click="selectTypeClick('answer')" - > - <img :src="selectType == 'answer' ? dati_charu_blue : dati_charu" /> - <div>鎻掑叆绛旈</div> - </div> - </div> - </div> - </el-tab-pane> - <el-tab-pane label="涓婅缁勪欢" name="second"> - <div class="tabBox"> - <div class="giveLessons hover" @click="giveLessonsClick()"> - <img :src="xiake" /> - <span>{{ classStart ? '涓婅' : '涓嬭' }}</span> - </div> - </div> - </el-tab-pane> - </el-tabs> - </div> - </div> - <!-- 鐢荤瑪宸ュ叿鏍� --> - <div - draggable="true" - class="draggableBox" - @dragstart="dragstart($event)" - @dragend="dragend($event)" - :style="`left:${floatingToolData.elLeft}px;top:${floatingToolData.elTop}px`" - > + <!-- 鐢荤瑪缁勪欢 --> <div - class="hover" - v-for="item in floatingToolBox" - :key="item.name" - @click="floatItemHandle(item)" - @mouseover="floatOverHander(item)" - @mouseout="floatOutHander(item)" - > - <div v-if="item.isShow"> - <el-popover - placement="right" - width="120" - trigger="click" - v-if="floatingToolData.activeToolData == '鏍囪'" - > - <div class="popinnerBox"> - <div class="label" v-if="floatingToolData.activeToolData == '鏍囪'"> - <div class="labelItem hover" @click="labelShow('hide')"> - <img :src="hide" /> - <div>闅愯棌</div> - </div> - <div class="labelItem hover" @click="labelShow('show')"> - <img :src="show" /> - <div>鏄剧ず</div> - </div> - </div> - </div> - <template #reference> - <div - :class=" - floatingToolData.activeToolData == item.name - ? 'floatToolActive floatToolItem' - : 'floatToolItem' - " - > - <img - :src="floatingToolData.activeToolData == item.name ? item.activeIcon : item.icon" - alt="" - /> - <div class="text">{{ item.name }}</div> - </div> - </template> - </el-popover> - <div - :class=" - floatingToolData.activeToolData == item.name - ? 'floatToolActive floatToolItem' - : 'floatToolItem' - " - v-else - > - <img - :src="floatingToolData.activeToolData == item.name ? item.activeIcon : item.icon" - alt="" - /> - <div class="text">{{ item.name }}</div> - </div> - </div> - </div> - </div> - <div class="brushBox" - :style="{ left: brushBoxLeft + 'px' }" v-if="floatingToolData.activeToolData == '鐢荤瑪'" > <div class="toolList"> @@ -562,10 +442,10 @@ </div> <template #reference> <div class="floatToolItem hover" @click="toolSelectHandle('huabi')"> - <div class="imgBox"> - <img :src="huabi2" alt="" /> - </div> - <div class="text">鐢荤瑪</div> + <el-tooltip class="box-item" effect="dark" content="鐢荤瑪" placement="bottom"> + <img :src="huabi2" alt="" class="imgBox"/> + </el-tooltip> + <!-- <div class="text">鐢荤瑪</div> --> </div> </template> </el-popover> @@ -625,10 +505,9 @@ </div> <template #reference> <div class="floatToolItem hover" @click="toolSelectHandle('wenzi')"> - <div class="imgBox"> - <img :src="wenzi2" alt="" /> - </div> - <div class="text">鏂囧瓧</div> + <el-tooltip class="box-item" effect="dark" content="鏂囧瓧" placement="bottom"> + <img :src="wenzi2" alt="" class="imgBox"/> + </el-tooltip> </div> </template> </el-popover> @@ -667,10 +546,9 @@ </div> <template #reference> <div class="floatToolItem hover" @click="toolSelectHandle('tuxing')"> - <div class="imgBox"> - <img :src="tuxing" alt="" /> - </div> - <div class="text">鍥惧舰</div> + <el-tooltip class="box-item" effect="dark" content="鍥惧舰" placement="bottom"> + <img :src="tuxing" alt="" class="imgBox"/> + </el-tooltip> </div> </template> </el-popover> @@ -681,10 +559,9 @@ <div class="text">姗$毊鎿�</div> </div> --> <div class="floatToolItem hover" @click="toolSelectHandle('chexiao')"> - <div class="imgBox"> - <img :src="clearPrevious" alt="" /> - </div> - <div class="text">鎾ら攢</div> + <el-tooltip class="box-item" effect="dark" content="鎾ら攢" placement="bottom"> + <img :src="clearPrevious" alt="" class="imgBox"/> + </el-tooltip> </div> <!-- <div class="floatToolItem" @click="toolSelectHandle('chongzuo')"> <div class="imgBox"> @@ -693,19 +570,148 @@ <div class="text">閲嶅仛</div> </div> --> <div class="floatToolItem hover" @click="toolSelectHandle('qingchu')"> - <div class="imgBox"> - <img :src="qingchu2" alt="" /> - </div> - <div class="text">娓呴櫎</div> + <el-tooltip class="box-item" effect="dark" content="娓呴櫎" placement="bottom"> + <img :src="qingchu2" alt="" class="imgBox"/> + </el-tooltip> </div> - <div class="floatToolItem layOutTool hover" @click="toolSelectHandle('tuichu')"> - <div class="imgBox"> - <img :src="tuichu" alt="" /> - </div> - <div class="text">閫�鍑�</div> + <div class="layOutTool"></div> + <div class="floatToolItem hover" @click="toolSelectHandle('tuichu')"> + <el-tooltip class="box-item" effect="dark" content="閫�鍑�" placement="bottom"> + <img :src="tuichu" alt="" class="imgBox"/> + </el-tooltip> </div> </div> </div> + </div> + <!-- 鏁欏缁勪欢 --> + <div class="toolBox"> + <div class="toolTitle"> + <span>{{ toolState.open ? '瀛︿範缁勪欢' : '缁勪欢' }}</span> + <div class="text"></div> + </div> + <div class="menuList"> + <ul class="menu" v-if="teachToolsMenuData.length > 0"> + <li v-for="item in teachToolsMenuData" :key="item.key"> + <div + :class="item.name === activeTool ? 'activeItem hover' : 'menuItem hover'" + :style="!toolState.open ? 'padding:10px 15px' : ''" + v-if="item.isShow" + @click="selectTeachTools(item)" + > + <img :src="item.icon" alt="" /> + <span v-if="toolState.open">{{ item.name }}</span> + </div> + </li> + </ul> + </div> + <div :class="['openBox', toolState.open ? 'right' : '']"> + <!-- <img :src="shouqiR" v-if="toolState.open" @click="toolState.open = false" /> --> + <!-- <img :src="shouqiL" v-if="!toolState.open" @click="toolState.open = true" /> --> + <svg v-if="!toolState.open" @click="toolState.open = true" 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-arrow-bar-to-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12l10 0" /><path d="M10 12l4 4" /><path d="M10 12l4 -4" /><path d="M4 4l0 16" /></svg> + <svg v-if="toolState.open" @click="toolState.open = false" 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-arrow-bar-to-right"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 12l-10 0" /><path d="M14 12l-4 4" /><path d="M14 12l-4 -4" /><path d="M20 4l0 16" /></svg> + </div> + <div class="classRoomBox" v-if="false"> + <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> + <el-tab-pane label="澶囪缁勪欢" name="first"> + <div class="tabBox"> + <div class="insertSelect"> + <div + :class="selectType == 'resource' ? 'typeActive' : 'selectItem hover'" + @click="selectTypeClick('resource')" + > + <img :src="selectType == 'resource' ? charuziyuan_blue : charuziyuan" /> + <div>鎻掑叆璧勬簮</div> + </div> + <div + :class="selectType == 'answer' ? 'typeActive' : 'selectItem hover'" + @click="selectTypeClick('answer')" + > + <img :src="selectType == 'answer' ? dati_charu_blue : dati_charu" /> + <div>鎻掑叆绛旈</div> + </div> + </div> + </div> + </el-tab-pane> + <el-tab-pane label="涓婅缁勪欢" name="second"> + <div class="tabBox"> + <div class="giveLessons hover" @click="giveLessonsClick()"> + <img :src="xiake" /> + <span>{{ classStart ? '涓婅' : '涓嬭' }}</span> + </div> + </div> + </el-tab-pane> + </el-tabs> + </div> + </div> + <!-- 鐢荤瑪宸ュ叿鏍� --> + <div + draggable="true" + class="draggableBox" + :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-if="item.isShow"> + <el-popover + placement="right" + width="120" + trigger="click" + v-if="floatingToolData.activeToolData == '鏍囪'" + > + <div class="popinnerBox"> + <div class="label" v-if="floatingToolData.activeToolData == '鏍囪'"> + <div class="labelItem hover" @click="labelShow('hide')"> + <img :src="hide" /> + <div>闅愯棌</div> + </div> + <div class="labelItem hover" @click="labelShow('show')"> + <img :src="show" /> + <div>鏄剧ず</div> + </div> + </div> + </div> + <template #reference> + <div + :class=" + floatingToolData.activeToolData == item.name + ? 'floatToolActive floatToolItem' + : 'floatToolItem' + " + > + <el-tooltip + class="box-item" + effect="dark" + :content="item.name" + placement="right" + > + <img :src="item.icon" alt="" /> + </el-tooltip> + <!-- <div class="text">{{ item.name }}</div> --> + </div> + </template> + </el-popover> + <div + :class=" + floatingToolData.activeToolData == item.name + ? 'floatToolActive floatToolItem' + : 'floatToolItem' + " + v-else + > + <el-tooltip class="box-item" effect="dark" :content="item.name" placement="right"> + <img :src="item.icon" alt="" /> + </el-tooltip> + <!-- <div class="text">{{ item.name }}</div> --> + </div> + </div> + </div> + </div> + <!-- 閫変腑宸ュ叿鏍� --> <div class="dialogToolBox" @@ -727,15 +733,16 @@ </div> <div class="toolSelectBox" v-show="!(toolActive == '楂樹寒' || toolActive == '鍒掔嚎')"> <div - :class="item.name == toolActive ? 'dialogToolItem active' : 'dialogToolItem'" v-for="item in dialogToolList" :key="item.icon" @click="dialogToolHandle(item)" - @mouseover="dialogOverHander(item)" - @mouseout="dialogOutHander(item)" > - <img :src="item.name == toolActive ? item.activeIcon : item.icon" alt="" /> - <span>{{ item.name }}</span> + <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> @@ -747,7 +754,12 @@ v-show="lineDelete.showLineDelete" :style="{ top: `${lineDelete.top}px`, left: `${lineDelete.left}px` }" > - <el-button @click="delUserKey">鍒犻櫎</el-button> + <!-- <el-button @click="delUserKey">鍒犻櫎</el-button> --> + <div class="dialogToolItem"> + <el-tooltip class="box-item" effect="dark" content="鍒犻櫎" placement="bottom"> + <img :src="trash" @click="delUserKey"/> + </el-tooltip> + </div> </div> <el-dialog title="璧勬簮" align-center v-model="resourVisble" width="845" class="resourDialog"> @@ -866,7 +878,7 @@ import { useRouter, useRoute } from 'vue-router' import useClipboard from 'vue-clipboard3' const { toClipboard } = useClipboard() -const request = inject('request') +const MG: any = inject('MG') const toolClass = inject('toolClass') const qiankunActions = inject('qiankunActions') //鑾峰彇璺敱鍣� @@ -908,22 +920,12 @@ 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 huabi1 from '../assets/images/operation/huabi-b.png' -import qingchu from '../assets/images/operation/Clearaway-w.png' -import qingchu1 from '../assets/images/operation/Clearaway-b.png' -import wenzi from '../assets/images/operation/wenzi-w.png' -import wenzi1 from '../assets/images/operation/wenzi-b.png' +import huabi from '../assets/images/operation/brush.svg' import wenzi2 from '../assets/images/operation/wenzi.png' -import biaoqianw from '../assets/images/operation/biaoqian-w.png' -import biaoqian1 from '../assets/images/operation/biaoqian-b.png' -import baiban from '../assets/images/operation/baiban-w.png' -import baiban1 from '../assets/images/operation/baiban-b.png' -import biaozhu from '../assets/images/operation/biaozhu-w.png' -import biaozhu1 from '../assets/images/operation/biaozhu-b.png' -import jieping from '../assets/images/operation/screenshot-w.png' -import jieping1 from '../assets/images/operation/screenshot-b.png' -import clear from '../assets/images/operation/clear.png' +import biaoqianw from '../assets/images/operation/bookmark-plus.svg' +import baiban from '../assets/images/operation/chalkboard.svg' +import biaozhu from '../assets/images/operation/pencil-minus.svg' +import jieping from '../assets/images/operation/crop.svg' import clearPrevious from '../assets/images/operation/clearPrevious.png' import hide from '../assets/images/operation/hide.png' import show from '../assets/images/operation/show.png' @@ -956,6 +958,7 @@ 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 shanchu from '../assets/images/operation/delete.png' import bianji from '../assets/images/operation/bianji.png' @@ -977,11 +980,12 @@ const screenWidth = ref( window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth ) -const brushBoxLeft = ref(500) +let userInfo = ref({}) let microApp = null // 寰簲鐢ㄥ疄渚� const bookConfig = ref({}) const activeCatalog = ref() onMounted(() => { + getUserInfo() setTimeout(() => { canvasWith.value = document.querySelector('.content-box').offsetWidth canvasheight.value = document.querySelector('.content-box').offsetHeight @@ -989,8 +993,10 @@ if (screenWidth.value < 1180) { menuState.open = false toolState.open = false + if (!menuState.open) { + floatingToolData.elLeft = 90 + } } - brushBoxLeft.value = (screenWidth.value - 450) / 2 window.onresize = () => { return (() => { screenWidth.value = @@ -1016,6 +1022,7 @@ console.log(window.qiankunActions) window.qiankunActions.setGlobalState({ state: 1, // 鍔犺浇瀛愬簲鐢� + bookId: localStorage.getItem('bookId'), windowSelection: (data) => { // 缁戝畾瀛愬簲鐢ㄩ�夋嫨鐩戝惉浜嬩欢 console.log(data, '瀛愬簲鐢ㄩ�夋嫨') @@ -1051,6 +1058,7 @@ // if (window.qiankunState && window.qiankunState.aa) window.qiankunState.aa(1) }) + watch( () => screenWidth.value, (val) => { @@ -1058,21 +1066,57 @@ if (screenWidth.value < 1180) { menuState.open = false toolState.open = false - floatingToolData.elLeft = 100 + if (!menuState.open) { + floatingToolData.elLeft = 90 + } } else { - floatingToolData.elLeft = 300 } } ) + +const getUserInfo = () => { + MG.identity.getCurrentAppUser().then((res) => { + console.log(res, '鐢ㄦ埛淇℃伅') + if(res){ + let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') + let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') + let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') + let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') + + if (nameAndPassword) { + userInfo.value = { + name: nameAndPassword.credential, + } + localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) + }else if(teacherRole && teacherInfos){ + userInfo.value = { + name: teacherInfos.name, + role: 'Teacher', + roleId: teacherRole.role.id + } + localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) + } else if(phoneInfo){ + userInfo.value = { + name: phoneInfo.credential, + } + localStorage.setItem('userInfo', JSON.stringify(userInfo.value)) + } + + } + }) +} + + let menuData = [] //鑿滃崟 let teachToolsMenuData = [] //鍙充晶瀛︿範缁勪欢 let floatingToolBox = [] //涓棿鎮诞缁勪欢 +let dialogToolList =[] //閫変腑鏂囧瓧鎿嶄綔 //鑾峰彇褰撳墠涔︾睄鎵�闇�缁勪欢 const getTextbookComponents = () => { menuData = [] teachToolsMenuData = [] - floatingToolBox = [] + floatingToolBox = [] menuData = [ { name: '鐩綍', @@ -1104,7 +1148,7 @@ icon: biaoqian, isShow: bookConfig.value.textbookComponents.indexOf('CF2E1400') > -1 } - ]; + ] teachToolsMenuData = [ { name: 'AI鏅鸿兘闂瓟', @@ -1161,38 +1205,43 @@ icon: moxinggongju, isShow: bookConfig.value.textbookComponents.indexOf('366F6CF3') > -1 } - ]; + ] floatingToolBox = [ { icon: huabi, - activeIcon: huabi1, name: '鐢荤瑪', isShow: bookConfig.value.textbookComponents.indexOf('800109C0') > -1 }, { - activeIcon: baiban1, icon: baiban, name: '鐧芥澘', - isShow: false + isShow: bookConfig.value.textbookComponents.indexOf('029DB3E0') > -1 }, { - activeIcon: biaozhu1, icon: biaozhu, name: '鏍囪', isShow: bookConfig.value.textbookComponents.indexOf('2E613A8F') > -1 }, { - activeIcon: biaoqian1, icon: biaoqianw, name: '涔︾', isShow: bookConfig.value.textbookComponents.indexOf('D2D30448') > -1 }, { - activeIcon: jieping1, icon: jieping, name: '鎴睆', isShow: bookConfig.value.textbookComponents.indexOf('86F0A1B8') > -1 } + ] + dialogToolList = [ + { icon: gaoliang,name: '楂樹寒',isShow: bookConfig.value.textbookComponents.indexOf('395B91FC') > -1 }, + { icon: huaxian,name: '鍒掔嚎',isShow: bookConfig.value.textbookComponents.indexOf('229EC161') > -1 }, + { icon: biji2,name: '绗旇',isShow: bookConfig.value.textbookComponents.indexOf('BC9B0CBD') > -1 }, + { icon: biaozhu2,name: '鏍囨敞',isShow: bookConfig.value.textbookComponents.indexOf('A63EE24F') > -1 }, + { icon: fuzhi,name: '澶嶅埗',isShow: bookConfig.value.textbookComponents.indexOf('7D5594B3') > -1 }, + { icon: AIyuedu,name: 'AI闃呰',isShow: bookConfig.value.textbookComponents.indexOf('C05AA457') > -1 }, + { icon: cidian2,name: '璇嶅吀',isShow: bookConfig.value.textbookComponents.indexOf('83FB80FD') > -1 }, + { icon: baidu,name: '鐧剧',isShow: bookConfig.value.textbookComponents.indexOf('65F95274') > -1 } ] } @@ -1200,7 +1249,7 @@ const catalogueData = ref([]) const getCatalogueData = () => { axios - .get(bookConfig.value.resourceUrl + '/1/information.json') + .get(bookConfig.value.resourceUrl + '/information.json') .then(function (response) { console.log(response.data, '鐩綍') var json = response.data @@ -1231,7 +1280,7 @@ //鑾峰彇璧勬簮 //璧勬簮鍒嗙被 -const classifySelectList = ref() +const classifySelectList = ref([]) //璧勬簮绫诲瀷 const resourceType = ref('default') //榛樿/鏁欏笀 const activeClassify = ref('') @@ -1246,7 +1295,7 @@ const getResourceData = () => { axios - .get(bookConfig.value.resourceUrl + '/1/resource.json?t=12') + .get(bookConfig.value.resourceUrl + '/resource.json?t=12') .then(function (response) { var json = response.data // 澶勭悊鑾峰彇鍒扮殑json鏁版嵁 @@ -1438,9 +1487,14 @@ resourType.value = data.resourceType if (data.resourceType == '瑙嗛') { resourVisble.value = true - testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 + if(data.md5){ + testVideo.value = bookConfig.value.requestCtx + '/file/api/ApiDownload?md5=' + data.md5 + }else{ + testVideo.value = bookConfig.value.resourceUrl + '/' + data.resourcePath + } + } else if (data.resourceType == 'word') { - testWord.value = bookConfig.value.resourceUrl + '/resourceData/' + data.name + testWord.value = bookConfig.value.resourceUrl + '/' + data.resourcePath } else { if (window.qiankunState && window.qiankunState.gotoPage) { window.qiankunState.gotoPage(Number(data.chapterNum), Number(data.pagination)) @@ -1556,6 +1610,18 @@ ], bgColorActive: '#FBF9F4' }) + +watch( + () => menuState.open, + (val) => { + if (menuState.open == false) { + floatingToolData.elLeft = 90 + } else { + floatingToolData.elLeft = 390 + } + } +) + const fontSizeSelect = (item) => { settingForm.fontSizeActive = item.key window.qiankunActions.setGlobalState({ @@ -1670,55 +1736,13 @@ let canvas = null const floatingToolData = reactive({ activeToolData: '', //閫変腑宸ュ叿 - elLeft: 400, - elTop: 300, + elLeft: 390, startclientx: 0, startclienty: 0 }) //鐢诲竷 const canvasShow = ref(false) - -const floatOverHander = (item) => { - const curIndex = floatingToolBox.findIndex((f) => f.name == item.name) - switch (curIndex) { - case 0: - floatingToolBox[0].icon = huabi1 - break - case 1: - floatingToolBox[1].icon = baiban1 - break - case 2: - floatingToolBox[2].icon = biaozhu1 - break - case 3: - floatingToolBox[3].icon = biaoqian1 - break - case 4: - floatingToolBox[4].icon = jieping1 - break - } -} -const floatOutHander = (item) => { - const curIndex = floatingToolBox.findIndex((f) => f.name == item.name) - switch (curIndex) { - case 0: - floatingToolBox[0].icon = huabi - break - case 1: - floatingToolBox[1].icon = baiban - break - case 2: - floatingToolBox[2].icon = biaozhu - break - case 3: - floatingToolBox[3].icon = biaoqianw - break - case 4: - floatingToolBox[4].icon = jieping - break - } -} //鎴浘浜嬩欢 const nameRef = ref() @@ -1755,18 +1779,7 @@ break } } -const dragend = (e) => { - let x = e.clientX - floatingToolData.startclientx - let y = e.clientY - floatingToolData.startclienty - if (floatingToolData.elLeft + x > 0 || floatingToolData.elTop + y > 0) { - floatingToolData.elLeft = e.x - 40 - floatingToolData.elTop = e.y - 60 - } -} -const dragstart = (e) => { - floatingToolData.startclientx = e.clientX - floatingToolData.startclienty = e.clientY -} + //鐢荤瑪鎿嶄綔鏍忎簨浠� const toolSelectData = reactive({ activeTool: '', @@ -1865,10 +1878,7 @@ chapterNum: currentChapter.value, chapterName: chapterData.label }) - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'reMark', @@ -1876,8 +1886,7 @@ value: JSON.stringify(reMarkData.value) } ] - } - }) + }) .then((res) => { floatingToolData.activeToolData = '' getReMarkList() @@ -1887,14 +1896,10 @@ const getReMarkList = () => { reMarkList.value = [] reMarkData.value = [] - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'reMark', keys: [bookConfig.value.bookId] - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0 && res[0].value) { reMarkData.value = JSON.parse(res[0].value) let list = JSON.parse(res[0].value) @@ -1915,10 +1920,7 @@ //鍒犻櫎涔︾ const deleteReMark = (item) => { let list = reMarkList.value.filter((itemData) => itemData.id !== item.id) - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'reMark', @@ -1926,8 +1928,7 @@ value: JSON.stringify(list) } ] - } - }).then((res) => { + }).then((res) => { ElMessage({ message: '鍒犻櫎涔︾鎴愬姛!', type: 'success' @@ -1978,10 +1979,7 @@ } screenshotLoading.value = true - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'screenshot', @@ -1989,8 +1987,7 @@ value: JSON.stringify(screenshotData.value) } ] - } - }) + }) .then((res) => { screenshotLoading.value = false getScreenshotList() @@ -2014,14 +2011,10 @@ const getScreenshotList = () => { screenshotData.value = [] screenshotList.value = [] - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'screenshot', keys: [bookConfig.value.bookId] - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0 && res[0].value) { screenshotData.value = JSON.parse(res[0].value) let list = JSON.parse(res[0].value) @@ -2068,10 +2061,7 @@ type: 'warning' }) .then(() => { - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'screenshot', @@ -2079,8 +2069,7 @@ value: JSON.stringify(list) } ] - } - }).then((res) => { + }).then((res) => { ElMessage({ message: '鍒犻櫎鎴浘鎴愬姛!', type: 'success' @@ -2120,18 +2109,7 @@ const toolActive = ref('') const colorActive = ref('') const noteColorActive = ref('') -const dialogToolList = reactive([ - { icon: gaoliang, activeIcon: gaoliang1, name: '楂樹寒' }, - { icon: huaxian, activeIcon: huaxian1, name: '鍒掔嚎' }, - { icon: biji2, activeIcon: biji1, name: '绗旇' }, - { icon: biaozhu2, activeIcon: biaozhu3, name: '鏍囨敞' }, - { icon: fuzhi, activeIcon: fuzhi1, name: '澶嶅埗' }, - { icon: AIyuedu, activeIcon: AIyuedu1, name: 'AI闃呰' }, - { icon: cidian2, activeIcon: cidian1, name: '璇嶅吀' }, - { icon: baidu, activeIcon: baidu, name: '鐧剧' } - // { icon: yuyinyuedu, activeIcon: yuyinyuedu1, name: '璇煶闃呰' } - // { icon: cidian2, activeIcon: cidian1, name: '缈昏瘧' } -]) + const colorSelectList = reactive([ { label: '榛勮壊', @@ -2256,6 +2234,7 @@ break case '绗旇': formData.desc = '' + noteColorActive.value = '#F5E12A' addNoteVisble.value = true showToolBox.value = false break @@ -2278,6 +2257,7 @@ break case '璇嶅吀': cidianVisible.value = true + console.log(dialogToolData.txt) break case '鐧剧': console.log('https://baike.baidu.com/item/' + dialogToolData.txt) @@ -2350,10 +2330,7 @@ break } - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: dom, @@ -2361,8 +2338,7 @@ value: JSON.stringify(data) } ] - } - }).then((res) => { + }).then((res) => { showToolBox.value = false addNoteVisble.value = false colorActive.value = '' @@ -2374,14 +2350,10 @@ } const getSignData = () => { - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'highLightData-' + bookConfig.value.bookId, keys: activeCatalog.value.map((item) => item + '') - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0) { for (let i = 0; i < res.length; i++) { const item = res[i] @@ -2397,14 +2369,10 @@ } } }) - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'underline-' + bookConfig.value.bookId, keys: activeCatalog.value.map((item) => item + '') - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0) { for (let i = 0; i < res.length; i++) { const item = res[i] @@ -2421,14 +2389,10 @@ } } }) - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'notes-' + bookConfig.value.bookId, keys: activeCatalog.value.map((item) => item + '') - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0) { for (let i = 0; i < res.length; i++) { const item = res[i] @@ -2453,14 +2417,10 @@ chapterList.push(item.chapter + '') }) scribeData.noteList = [] - request({ - url: '/identity/api/ApiGetAppUserKey', - method: 'post', - data: { + MG.identity.getUserKey({ domain: 'notes-' + bookConfig.value.bookId, keys: chapterList - } - }).then((res) => { + }).then((res) => { if (res && res.length > 0) { for (let i = 0; i < res.length; i++) { const item = res[i] @@ -2547,10 +2507,7 @@ break } let list = data[dialogToolData.chapter].filter((item) => item.id != ids) - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: dom, @@ -2558,8 +2515,7 @@ value: JSON.stringify(list) } ] - } - }).then((res) => { + }).then((res) => { lineDelete.showLineDelete = false if (window.qiankunState && window.qiankunState.delSign) window.qiankunState.delSign({ ids: [ids] }) @@ -2593,10 +2549,7 @@ itemNote.color = noteColorActive.value } }) - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'notes-' + bookConfig.value.bookId, @@ -2604,8 +2557,7 @@ value: JSON.stringify(data.noteList) } ] - } - }).then((res) => { + }).then((res) => { addNoteVisble.value = false isUpdate.value = false getNotesList() @@ -2625,10 +2577,7 @@ type: 'warning' }) .then(() => { - request({ - url: '/identity/api/ApiAppUserSetKey', - method: 'post', - data: { + MG.identity.setUserKey({ setKeyRequests: [ { domain: 'notes-' + bookConfig.value.bookId, @@ -2636,8 +2585,7 @@ value: JSON.stringify(list) } ] - } - }).then((res) => { + }).then((res) => { ElMessage({ message: '鍒犻櫎绗旇鎴愬姛!', type: 'success' @@ -2737,6 +2685,13 @@ .userInfoBox { display: flex; align-items: center; + .userName{ + font-size: 18px; + margin-right:15px; + padding-right:15px; + border-right:1px solid #e0e0e0; + color: #2C2C2C; + } .layout { width: 69px; height: 30px; @@ -2752,6 +2707,7 @@ overflow: hidden; flex: 1; display: flex; + position: relative; .menuBox { width: 80px; flex-shrink: 0; @@ -2813,6 +2769,7 @@ display: flex; justify-content: center; align-items: center; + border-bottom: 1px solid #efefef; } .resourceBox { padding: 10px 0; @@ -3139,15 +3096,13 @@ .menuStateBox { width: 25px; height: 25px; - background: #fff; border-radius: 3px 0px 0px 3px; - border: 1px solid #bce3ff; - position: fixed; + position: absolute; line-height: 22px; top: 50%; - left: 395px; + left: 380px; text-align: center; - box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16); + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); z-index: 2; img { height: 10px; @@ -3158,6 +3113,7 @@ .pageBox { flex: 1; font-size: 16px; + position: relative; .pageBox-header { height: 57px; padding: 0 20px; @@ -3281,6 +3237,7 @@ } span { + width:80px; margin-left: 10px; } } @@ -3290,11 +3247,10 @@ height: 25px; background: #fff; border-radius: 3px 0px 0px 3px; - border: 1px solid #bce3ff; position: absolute; top: 50%; right: 67px; - box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16); + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; @@ -3305,7 +3261,7 @@ } } .right { - right: 215px !important; + right: 198px !important; border-radius: 0px 3px 3px 0px !important; } .classRoomBox { @@ -3369,69 +3325,75 @@ } .draggableBox { - width: 85px; - background-image: linear-gradient(to bottom, #0093ff, #005dff); - position: fixed; - height: 310px; - top: 300px; - left: 450px; + width: 40px; + background-image: linear-gradient(to bottom, #65bbf9, #1299fb); + // background-color: rgba(44, 44, 44, 0.5); + position: absolute; + // height: 310px; + top: 70px; + left: 380px; z-index: 2000; border-radius: 10px; - padding: 5px; + padding: 6px; overflow: hidden; .floatToolItem { - height: 60px; + margin: 10px 0; + height: 28px; display: flex; justify-content: center; align-items: center; border-radius: 5px; color: #fff; cursor: pointer; - img { - margin-right: 8px; - } .text { margin-right: 5px; } } .floatToolItem:hover, .floatToolActive { - background-color: #fff; - color: #0093ff; + background-color: rgba(255, 255, 255, 0.3); } } .brushBox { - position: fixed; - // left: 40%; - bottom: 20px; + position: absolute; + width:290px; + bottom: 40px; + left: 0; + right: 0; z-index: 99; + margin:auto; border-radius: 5px; background: #fff; - // padding: 10px; overflow: hidden; - border: 1px solid #0093ff; + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); .toolList { display: flex; justify-content: center; align-items: center; .floatToolItem { - margin: 6px; - width: 46px; + margin: 6px 8px; + padding: 5px; + width: 30px; border-radius: 5px; - text-align: center; - flex: 1; + display: flex; + justify-content: center; + align-items: center; + // flex: 1; font-size: 14px; .imgBox { height: 18px; width: 18px; text-align: center; margin: 0 auto; - margin-bottom: 5px; } } + .floatToolItem:hover { + background-color: rgba(44, 44, 44, 0.2); + } .layOutTool { - padding-left: 15px; + height:20px; + margin-right:5px; border-left: 1px solid #e0e0e0; } } @@ -3441,38 +3403,34 @@ position: fixed; z-index: 2; .toolSelectBox { - height: 57px; + height: 40px; display: flex; justify-content: center; align-items: center; border-radius: 12px; overflow: hidden; padding: 5px; - background-image: linear-gradient(to right, #0093ff, #005dff); + background-color: rgba(90,90,90,0.9); + // background-image: linear-gradient(to right, #0093ff, #005dff); .dialogToolItem { user-select: none; - width: 60px; + width: 26px; font-size: 12px; border-radius: 5px; - padding: 5px 0; + padding:3px; + margin:0 5px; cursor: pointer; text-align: center; - img { - margin: 0 auto; - display: block; - margin-bottom: 5px; - height: 16px; - } span { color: #fff; } } .dialogToolItem:hover, .active { - background-color: #fff; - span { - color: #0093ff; - } + background-color: rgba(255, 255, 255, 0.2); + // span { + // color: #0093ff; + // } } } } @@ -3503,10 +3461,20 @@ .lineDeleteBox { position: fixed; z-index: 2; - border: 1px solid #0093ff; - padding: 20px 8px; + box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.3); + padding: 5px 20px; background: #fff; border-radius: 5px; + .dialogToolItem{ + padding:3px; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + } + .dialogToolItem:hover{ + background-color: rgba(44, 44, 44, 0.2); + } } .wendabox { width: 100%; diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..e72055e --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,73 @@ +<template> + <div class="contentPage"> + <div class="headerBox">鏁板瓧鏁欐潗骞冲彴</div> + <div class="contentBox"> + <div class="leftBox"> + <menuView /> + </div> + <div class="rightBox"> + <div> + <router-view /> + </div> + </div> + </div> + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from 'vue-router' +import { ref, onMounted } from 'vue' +import menuView from '@/views/components/menuView.vue' +const router = useRouter() +const routerVal = router.currentRoute.value +const path = ref(routerVal.path) +onBeforeRouteUpdate(async (to, from) => { + path.value = to.fullPath +}) +onMounted(() => {}) + +const goRouter = (item) => { + if (!localStorage.getItem('jsek-token')) { + return router.push({ + path: '/home', + query: { + showLogin: '1' + } + }) + } + router.push({ path: item.path }) +} +</script> + +<style lang="less"> +.contentPage { + height: 100%; + width: 100%; + font-size:14px; +} +.headerBox { + height: 48px; + width: 100%; + background: #fff; + box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.07); + position: fixed; + top: 0; + left: 0; + z-index: 2; + + font-size: 24px; + padding:0 20px; + line-height:48px; + color: #87CCFF; + font-family: Alibaba; +} +.contentBox { + height:100%; + display: flex; + background: #f1f1f1; + padding-top: 48px; + .leftBox { + background: #fff; + width:80px; + } +} +</style> diff --git a/src/views/jobManagement/list.vue b/src/views/jobManagement/list.vue new file mode 100644 index 0000000..9639211 --- /dev/null +++ b/src/views/jobManagement/list.vue @@ -0,0 +1,21 @@ +<template> + <div class="contentPage"> + 浣滀笟 + + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from "vue-router"; +import { ref, onMounted } from "vue"; +const router = useRouter(); + + +onMounted(() => { +}) + +</script> + +<style lang="less"> + + +</style> \ No newline at end of file diff --git a/src/views/login.vue b/src/views/login.vue index b69f592..302d11f 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,40 +1,55 @@ <template> <div class="loginPage"> - <div class="loginForm"> - <p>鏁板瓧鏁欐潗闃呰鍣�</p> - <el-form ref="ruleFormRef" :model="loginData" :rules="rules" label-width="80px"> - <el-form-item label="鐢ㄦ埛鍚嶏細" prop="username"> - <el-input v-model="loginData.username"></el-input> - </el-form-item> - <el-form-item label="瀵嗙爜锛�" prop="password"> - <el-input type="password" v-model="loginData.password"></el-input> - </el-form-item> - <div class="btnBox"> - <el-button - style="width: 120px" - type="primary" - @click="submitForm(ruleFormRef)" - :loading="loading" - >鐧� 褰�</el-button - > + <div class="loginBox"> + <div class="loginForm"> + <div class="singUpPhone"> + <h2>瀵嗙爜鐧诲綍</h2> + <el-form ref="ruleFormRef" :model="loginData" :rules="rules" class=""> + <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> + </el-form-item> + <el-form-item prop="password"> + <el-input type="password" v-model="loginData.password" placeholder="璇疯緭鍏ュ瘑鐮�"></el-input> + </el-form-item> + <div class="btnBox"> + <el-button + class="logInBtn" + type="primary" + @click="submitForm(ruleFormRef)" + :loading="loading" + >鐧� 褰�</el-button + > + </div> + </el-form> </div> - </el-form> + </div> + <el-image :src="dialogRightImg" class="rightImg" /> </div> </div> </template> <script setup lang="ts"> -import { ref, reactive, inject } from 'vue' +import { ref, reactive, inject, onBeforeMount } from 'vue' import { useRoute, useRouter } from 'vue-router' import { ElMessage } from 'element-plus' - +import dialogRightImg from '@/assets/images/content/dialogRightImg.png' +const MG: any = inject('MG') const route = useRoute() const router = useRouter() - const request = inject('request') - const ruleFormRef = ref() - +const select = ref<string>('涓浗+86') const loginData = ref({ username: '', password: '' @@ -52,20 +67,18 @@ await formEl.validate((valid, fields) => { if (valid) { loading.value = true - request({ - url: '/identity/api/LoginByPassword', - method: 'post', - data: { + MG.identity + .loginByPassword({ appRefCode: 'jingshieke', loginName: loginData.value.username, password: loginData.value.password, platform: 'string' - } - }) + }) .then((res) => { console.log(res) if (res.token != null) { localStorage.setItem('token', res.token) + getUserInfo() if (route.query.redirect) { router.push(route.query.redirect) } else { @@ -83,6 +96,37 @@ } }) } + +const getUserInfo = () => { + MG.identity.getCurrentAppUser().then((res) => { + console.log(res, '鐢ㄦ埛淇℃伅') + if (res) { + let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') + let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') + let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') + let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword') + + if (nameAndPassword) { + let userInfo = { + name: nameAndPassword.credential + } + localStorage.setItem('userInfo', JSON.stringify(userInfo)) + } else if (teacherRole && teacherInfos) { + let userInfo = { + name: teacherInfos.name, + role: 'Teacher', + roleId: teacherRole.role.id + } + localStorage.setItem('userInfo', JSON.stringify(userInfo)) + } else if (phoneInfo) { + let userInfo = { + name: phoneInfo.credential + } + localStorage.setItem('userInfo', JSON.stringify(userInfo)) + } + } + }) +} </script> <style lang="less"> @@ -90,27 +134,73 @@ width: 100%; height: 100%; position: relative; - .loginForm { - width: 400px; - height: 300px; - position: absolute; - top: 50%; - left: 50%; - margin-top: -150px; - margin-left: -200px; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - p { - font-size: 20px; - font-weight: bold; - text-align: center; - margin-bottom: 50px; + display: flex; + align-items: center; + justify-content: center; + .loginBox { + width: 800px; + height: 540px; + border-radius: 20px; + overflow:hidden; + display: flex; + background: #FFFFFF; + box-shadow: 0px 6px 9px 1px rgba(0,0,0,0.06); + .loginForm { + width: 410px; + padding:40px; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-around; + .singUpPhone { + height: 400px; + display: flex; + flex-direction: column; + align-items: center; + + h2 { + padding-top: 35px; + font-size: 20px; + color: #000; + font-weight: 700; + text-align: center; + } + .el-form { + margin-top: 26px; + } + .selectPhone { + background: #fff; + } + } } - .btnBox { - text-align: center; - margin-top: 50px; + .leftImg { + box-sizing: border-box; + width: 403px; } + .el-input{ + height: 40px; + } + .el-select { + width: 100px; + height: 40px; + .el-select__wrapper { + height: 100% !important; + .el-input--suffix { + height: 100% !important; + background-color: #fff; + } + } + } + + .logInBtn { + width: 304px; + height: 40px; + margin-top: 10px; + margin-bottom: 20px; + border-radius: 3px; + color: #fff; + font-size: 14px; + } } } </style> diff --git a/src/views/messageList/list.vue b/src/views/messageList/list.vue new file mode 100644 index 0000000..bd02493 --- /dev/null +++ b/src/views/messageList/list.vue @@ -0,0 +1,21 @@ +<template> + <div class="contentPage"> + 娑堟伅 + + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from "vue-router"; +import { ref, onMounted } from "vue"; +const router = useRouter(); + + +onMounted(() => { +}) + +</script> + +<style lang="less"> + + +</style> \ No newline at end of file diff --git a/src/views/personalCenter/index.vue b/src/views/personalCenter/index.vue new file mode 100644 index 0000000..4ec494e --- /dev/null +++ b/src/views/personalCenter/index.vue @@ -0,0 +1,21 @@ +<template> + <div class="contentPage"> + 涓汉涓績 + + </div> +</template> +<script setup lang="ts"> +import { useRouter, onBeforeRouteUpdate } from "vue-router"; +import { ref, onMounted } from "vue"; +const router = useRouter(); + + +onMounted(() => { +}) + +</script> + +<style lang="less"> + + +</style> \ No newline at end of file diff --git a/src/views/setting.vue b/src/views/setting.vue deleted file mode 100644 index bbcdaac..0000000 --- a/src/views/setting.vue +++ /dev/null @@ -1,62 +0,0 @@ -<template> - <page> - <div class="setting"> - <el-divider content-position="left">璁剧疆涓嬭浇鐩綍</el-divider> - <div class="setDownloadPathBox"> - <el-input style="width: 300px; margin-right: 10px" v-model="downloadPath" disabled /> - <el-button type="primary" @click="setPath">璁剧疆鐩綍</el-button> - <el-button type="primary" @click="openPath">鎵撳紑鐩綍</el-button> - </div> - </div> - </page> -</template> - -<script setup lang="ts"> -import { ref, reactive, inject, onMounted } from 'vue' -import { ElMessage } from 'element-plus' -const downloadPath = ref('') -onMounted(() => { - const path = window.electronAPI.getDownloadPath() - downloadPath.value = path -}) -const setPath = () => { - const path = window.electronAPI.openSelectFileOrFolderDialog({ - title: '閫夋嫨涓嬭浇鐩綍', - properties: ['openDirectory'] - }) - downloadPath.value = path[0] - const data = window.electronAPI.setDownloadPath(path[0]) - if (data.state) { - ElMessage({ - message: '璁剧疆鎴愬姛锛�', - type: 'success' - }) - } else { - ElMessage({ - message: data.msg, - type: 'error' - }) - } -} -const openPath = () => { - const data = window.electronAPI.openPath(downloadPath.value) - if (!data.state) { - ElMessage({ - message: data.msg, - type: 'error' - }) - } -} -</script> - -<style lang="less"> -.setting { - width: 100%; - height: 100%; - box-sizing: border-box; - padding: 10px 50px; - .setDownloadPathBox { - display: flex; - } -} -</style> diff --git a/src/views/transmission.vue b/src/views/transmission.vue deleted file mode 100644 index 97b45f6..0000000 --- a/src/views/transmission.vue +++ /dev/null @@ -1,495 +0,0 @@ -<template> - <div class="transmissionBox"> - <div class="subMenuBox"> - <div - :class="['menuItem', selectMenuIndex == index ? 'active' : '']" - v-for="(item, index) in menuData" - @click="selectMenu(index)" - > - <div class="iconBox"> - <el-icon v-if="item.icon == 'download'" :size="20"><Download /></el-icon> - <el-icon v-if="item.icon == 'success'" :size="20"><CircleCheck /></el-icon> - </div> - <p>{{ item.name }}</p> - <span>{{ item.num }}</span> - </div> - </div> - <div class="pageBox"> - <div class="herderBox"> - <p>{{ menuData[selectMenuIndex].name }}</p> - </div> - <div class="toolBox" v-if="selectMenuIndex == 0"> - <p> - 涓嬭浇鍒楄〃 路 <span>宸蹭笅杞� {{ totalProgress }}%{{ allPause ? '锛屽凡鍏ㄩ儴鏆傚仠' : '' }}</span> - </p> - <div class="toolBtnBox"> - <el-button - :icon="Download" - size="small" - type="primary" - :disabled="allStart" - @click="newTask" - >鏂板涓嬭浇</el-button - > - <el-button :icon="CaretRight" size="small" :disabled="allStart" @click="startAll" - >鍏ㄩ儴寮�濮�</el-button - > - <el-button :icon="VideoPause" size="small" :disabled="allPause" @click="pauseAll" - >鍏ㄩ儴鏆傚仠</el-button - > - <el-button :icon="CloseBold" size="small" @click="cleanAll">鍏ㄩ儴鍙栨秷</el-button> - </div> - </div> - <div class="fileList"> - <el-table - :data="tableData" - style="width: 100%" - :height="'100%'" - empty-text="鏆傛棤鏁版嵁" - @cell-mouse-enter="mouseEnter" - @cell-mouse-leave="mouseLeave" - > - <el-table-column prop="name" label="鍚嶇О"> - <template #default="scope"> - <p class="title"> - <span>{{ scope.row.name }}</span> - <span class="tableItemBtnBox" v-show="showId == scope.row.id"> - <el-tooltip - v-if="scope.row.state == 'pause'" - effect="dark" - content="寮�濮�" - placement="top" - > - <el-button :icon="CaretRight" circle @click="start(scope.row.id)" /> - </el-tooltip> - <el-tooltip - v-if="scope.row.state == 'download'" - effect="dark" - content="鏆傚仠" - placement="top" - > - <el-button :icon="VideoPause" circle @click="pause(scope.row.id)" /> - </el-tooltip> - <el-tooltip - effect="dark" - :content="scope.row.state == 'success' ? '鍒犻櫎璁板綍' : '鍙栨秷'" - placement="top" - > - <el-button :icon="CloseBold" circle @click="clean(scope.row.id)" /> - </el-tooltip> - <el-tooltip effect="dark" content="鍦ㄦ湰鍦扮洰褰曟煡鐪�" placement="top"> - <el-button :icon="Search" circle @click="openFile(scope.row.id)" /> - </el-tooltip> - </span> - </p> - </template> - </el-table-column> - <el-table-column prop="size" label="澶у皬" width="180"> - <template #default="scope"> - <span v-if="selectMenuIndex == 0" - >{{ getFileSize(scope.row.offset) }} / {{ getFileSize(scope.row.size) }}</span - > - <span v-if="selectMenuIndex == 1">{{ getFileSize(scope.row.size) }}</span> - </template> - </el-table-column> - <el-table-column prop="createDate" label="鍒涘缓鏃堕棿" width="180" sortable> - </el-table-column> - <el-table-column - v-if="selectMenuIndex == 1" - prop="completeDate" - label="瀹屾垚鏃堕棿" - width="180" - sortable - > - </el-table-column> - <el-table-column v-if="selectMenuIndex == 0" prop="createDate" label="鐘舵��" width="300"> - <template #default="scope"> - <p class="itemState" v-if="scope.row.state == 'download'" style="color: #409eff"> - 姝e湪涓嬭浇 - </p> - <p class="itemState" v-if="scope.row.state == 'pause'" style="color: #e6a23c"> - 宸叉殏鍋� - </p> - <p class="itemState" v-if="scope.row.state == 'getFileInfo'" style="color: #409eff"> - 鑾峰彇鏂囦欢淇℃伅 - </p> - <p class="itemState" v-if="scope.row.state == 'error'" style="color: #f56c6c"> - 涓嬭浇閿欒 - </p> - <p class="itemState" v-if="scope.row.state == 'success'" style="color: #67c23a"> - 宸插畬鎴� - </p> - <el-progress - :show-text="false" - :striped="scope.row.state == 'download'" - :duration="10" - :striped-flow="scope.row.state == 'download'" - :percentage="scope.row.progress" - :color=" - () => { - if (scope.row.state == 'download') { - return '#409EFF' - } else if (scope.row.state == 'success') { - return '#67C23A' - } else { - return '#E6A23C' - } - } - " - /> - </template> - </el-table-column> - </el-table> - </div> - <div class="stateInfoBox" v-if="stateInfo"> - {{ stateInfo }} - </div> - </div> - <el-dialog - v-model="newTaskDialogVisible" - title="鏂板涓嬭浇浠诲姟" - width="400" - align-center - :modal="false" - > - <el-input - v-model="newTaskInfo" - :autosize="{ minRows: 4, maxRows: 8 }" - type="textarea" - placeholder="璇峰~鍐欎换鍔″瓧绗�" - /> - <template #footer> - <span class="dialog-footer"> - <el-button type="primary" @click="submitTask">纭畾</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script setup lang="ts"> -import { ref, reactive, inject, onMounted, watch } from 'vue' -import { Check } from '@element-plus/icons-vue' -import { useRouter, RouterView } from 'vue-router' -import { Download, CaretRight, CloseBold, VideoPause, Search } from '@element-plus/icons-vue' -import { ElMessage } from 'element-plus' -import { useDownloadTask } from '@/store' -const router = useRouter() -const { getFileSize } = inject('toolClass') -const downloadTask = useDownloadTask() - -// 鑿滃崟 -const menuData = ref([ - { - name: '涓嬭浇', - num: 0, - icon: 'download' - }, - { - name: '宸插畬鎴�', - num: 0, - icon: 'success' - } -]) -const selectMenuIndex = ref(0) -const selectMenu = (index) => { - selectMenuIndex.value = index - updateListData() -} - -// 鎬昏繘搴� -const totalProgress = ref(0) -// 鍏ㄩ儴鏆傚仠 -const allPause = ref(false) -// 鍏ㄩ儴寮�濮� -const allStart = ref(false) - -// 鏂囦欢鍒楄〃 -const tableData = ref([]) - -const stateInfo = ref() - -onMounted(() => { - updateListData() - - // 缁戝畾娑堟伅鎻愰啋 - // window.electronAPI.onShowMessage((data) => { - // console.log(data) - // if (data.type == 'showState') { - // stateInfo.value = data.msg - // } else if (data.type == 'notDownloadFolder') { - // console.log('notDownloadFolder') - // // 涓嬭浇鐩綍妫�娴嬩笉瀛樺湪锛岃缃笅杞界洰褰� - // const path = window.electronAPI.openSelectFileOrFolderDialog({ - // title: '閫夋嫨涓嬭浇鐩綍', - // properties: ['openDirectory'] - // }) - // if (path && path.length > 0) { - // console.log('setDownloadPath') - // debugger - // const returnData = window.electronAPI.setDownloadPath(path[0], data.msg) - // } - // } else { - // ElMessage({ - // message: data.msg, - // type: data.type - // }) - // } - // }) -}) - -watch( - () => downloadTask.updateList, - (newValue, oldValue) => { - updateListData() - } -) - -watch( - () => downloadTask.msgData, - (newValue, oldValue) => { - if (newValue.type == 'showState') { - stateInfo.value = newValue.msg - } else if (newValue.type == 'notDownloadFolder') { - console.log('notDownloadFolder') - // 涓嬭浇鐩綍妫�娴嬩笉瀛樺湪锛岃缃笅杞界洰褰� - const path = window.electronAPI.openSelectFileOrFolderDialog({ - title: '閫夋嫨涓嬭浇鐩綍', - properties: ['openDirectory'] - }) - if (path && path.length > 0) { - const returnData = window.electronAPI.setDownloadPath(path[0], newValue.msg) - } - } else { - ElMessage({ - message: newValue.msg, - type: newValue.type - }) - } - } -) - -const updateListData = () => { - // 鑾峰彇涓嬭浇浠诲姟鍒楄〃 - const taskListData = window.electronAPI.getDownloadTasks() - if (selectMenuIndex.value == 0) { - tableData.value = taskListData - .filter((item) => item.state != 'success') - .map((item) => { - // if(item.state == "download") alert(JSON.stringify(item)) - return { - ...item, - progress: (item.offset / item.size) * 100 - } - }) - } else if (selectMenuIndex.value == 1) { - tableData.value = taskListData.filter((item) => item.state == 'success') - } - - menuData.value[0].num = taskListData.filter((item) => item.state != 'success').length - menuData.value[1].num = taskListData.filter((item) => item.state == 'success').length - - let totalOffset = 0 - let totalSize = 0 - taskListData.forEach((item) => { - if (item.state != 'success') { - totalOffset += item.offset - totalSize += item.size - } - }) - - totalProgress.value = totalSize ? ((totalOffset / totalSize) * 100).toFixed(2) : 0 -} - -const newTaskDialogVisible = ref(false) -const newTaskInfo = ref('') -const newTask = () => { - newTaskInfo.value = '' - newTaskDialogVisible.value = true -} - -const submitTask = () => { - console.log(newTaskInfo.value) - if (newTaskInfo.value) { - let infoData = null - try { - infoData = JSON.parse(newTaskInfo.value) - } catch (error) { - infoData = null - } - if (infoData) { - // 鏂板缓浠诲姟 - window.electronAPI.newDownloadTask(infoData) - newTaskDialogVisible.value = false - } else { - ElMessage({ - message: '鏃犳硶璇嗗埆鎮ㄨ緭鍏ョ殑鍐呭锛岃纭鍚庨噸鏂板~鍐�', - type: 'warning' - }) - } - } else { - ElMessage({ - message: '璇峰~鍐欐柊寤烘暟鎹�', - type: 'warning' - }) - } -} - -const clean = (id) => { - window.electronAPI.cleanTask(id) -} - -const cleanAll = () => { - tableData.value = [] - window.electronAPI.cleanAll() -} - -const start = (id) => { - window.electronAPI.startTask(id) -} - -const startAll = () => { - window.electronAPI.startAllTask() -} - -const pause = (id) => { - window.electronAPI.pauseTask(id) -} - -const pauseAll = () => { - window.electronAPI.pauseAllTask() -} - -const openFile = (id) => { - window.electronAPI.openPathByTaskId(id) -} - -const showId = ref() -const mouseEnter = (row) => { - showId.value = row.id //璧嬪�艰id锛屼究浜庨〉闈㈠垽鏂� -} -//榧犳爣绉诲嚭鍗曞厓鏍间簨浠� -const mouseLeave = (row) => { - showId.value = '' -} -</script> - -<style lang="less"> -.transmissionBox { - width: 100%; - height: 100%; - display: flex; - .subMenuBox { - width: 180px; - height: 100%; - overflow: auto; - border-right: 1px solid #e6e7e8; - padding: 40px 20px; - .menuItem { - display: flex; - width: 100%; - padding: 10px; - border-radius: 10px; - cursor: pointer; - margin-bottom: 10px; - position: relative; - &.active { - background-color: #ebebed; - span { - background-color: #409eff; - color: #fff; - border-color: #409eff; - } - } - &:hover { - background-color: #ebebed; - } - .iconBox { - display: inline-block; - width: 20px; - height: 20px; - vertical-align: middle; - margin-right: 16px; - } - p { - vertical-align: middle; - line-height: 20px; - } - span { - position: absolute; - right: 10px; - top: 11px; - font-size: 12px; - background-color: #f6f6f7; - display: inline-block; - width: 30px; - padding: 1px 0; - border-radius: 50px; - text-align: center; - color: #999; - border: 1px solid #ccc; - } - } - } - .pageBox { - flex: 1; - height: 100%; - padding: 50px; - box-sizing: border-box; - display: flex; - flex-direction: column; - overflow: auto; - position: relative; - .herderBox { - overflow: hidden; - margin-bottom: 20px; - p { - float: left; - font-size: 20px; - font-weight: bold; - line-height: 32px; - } - } - .toolBox { - border-bottom: 1px solid #e6e7e8; - padding: 16px 0; - margin-bottom: 10px; - overflow: hidden; - p { - float: left; - font-size: 14px; - color: #333; - line-height: 24px; - span { - font-size: 12px; - color: #666; - } - } - .toolBtnBox { - float: right; - } - } - .fileList { - flex: 1; - overflow: hidden; - .title { - line-height: 34px; - .tableItemBtnBox { - float: right; - padding: 0 10px; - } - } - } - .stateInfoBox { - position: absolute; - bottom: 18px; - left: 60px; - font-size: 12px; - color: #409eff; - } - .itemState { - font-size: 12px; - } - } -} -</style> -- Gitblit v1.9.1