From ff9b1b8d5538212495ad528906a09037c6e1fac9 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Wed, 11 May 2022 16:36:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/cool/temp/eps.json | 2 +- build/cool/temp/service.d.ts | 278 ++++++++++++++++++ package.json | 9 +- src/assets/icon/logo/silder-simple.png | Bin 1403 -> 0 bytes src/assets/icon/logo/silder.png | Bin 3072 -> 0 bytes src/cool/module/index.ts | 3 +- src/cool/service/base.ts | 2 +- src/cool/service/eps.ts | 33 +-- src/cool/utils/index.ts | 97 +----- src/mock/chat.ts | 79 ----- src/modules/base/common/permission.ts | 2 +- src/modules/base/components/avatar/index.vue | 2 +- .../base/components/editor-quill/index.vue | 2 +- src/modules/base/components/icon/svg.vue | 2 +- src/modules/base/components/image/index.vue | 2 +- src/modules/base/components/link/index.vue | 2 +- src/modules/base/components/switch/index.tsx | 2 +- .../base/pages/layout/components/process.vue | 2 +- src/modules/base/pages/login/index.vue | 35 ++- src/modules/base/store/menu.ts | 10 +- src/modules/base/utils/index.ts | 26 +- .../base/views/components/dept-tree.vue | 5 +- .../base/views/components/menu-create.vue | 4 +- .../base/views/components/menu-perms.vue | 2 +- src/modules/base/views/info.vue | 2 +- src/modules/base/views/menu.vue | 5 +- src/modules/base/views/user.vue | 2 +- src/modules/upload/components/index.vue | 8 +- src/modules/upload/components/space.vue | 3 +- .../upload/components/space/category.vue | 2 +- yarn.lock | 127 +++++--- 31 files changed, 442 insertions(+), 308 deletions(-) delete mode 100644 src/assets/icon/logo/silder-simple.png delete mode 100644 src/assets/icon/logo/silder.png delete mode 100644 src/mock/chat.ts diff --git a/build/cool/temp/eps.json b/build/cool/temp/eps.json index 5c3df59..3e7c589 100644 --- a/build/cool/temp/eps.json +++ b/build/cool/temp/eps.json @@ -1 +1 @@ -[["/admin/base/comm",[["post","/personUpdate",""],["get","/uploadMode",""],["get","/permmenu",""],["get","/person",""],["post","/upload",""],["post","/logout",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/open",[["get","/refreshToken",""],["get","/captcha",""],["post","/login",""],["get","/html",""],["get","/eps",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/department",[["post","/delete",""],["post","/update",""],["post","/order",""],["post","/list",""],["post","/add",""],["","/page",""],["","/info",""]]],["/admin/base/sys/log",[["post","/setKeep",""],["get","/getKeep",""],["post","/clear",""],["post","/page",""],["","/list",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/menu",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/param",[["post","/delete",""],["post","/update",""],["get","/html",""],["get","/info",""],["post","/page",""],["post","/add",""],["","/list",""]]],["/admin/base/sys/role",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/user",[["post","/delete",""],["post","/update",""],["post","/move",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/demo/goods",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/page",""],["post","/list",""],["post","/add",""]]],["/admin/space/info",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/space/type",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/task/info",[["post","/delete",""],["post","/update",""],["post","/start",""],["post","/once",""],["post","/stop",""],["get","/info",""],["post","/page",""],["get","/log",""],["post","/add",""],["","/list",""]]]] \ No newline at end of file +[["/admin/base/comm",[["post","/personUpdate",""],["get","/uploadMode",""],["get","/permmenu",""],["get","/person",""],["post","/upload",""],["post","/logout",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/open",[["get","/refreshToken",""],["get","/captcha",""],["post","/login",""],["get","/html",""],["get","/eps",""],["","/list",""],["","/page",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/department",[["post","/delete",""],["post","/update",""],["post","/order",""],["post","/list",""],["post","/add",""],["","/page",""],["","/info",""]]],["/admin/base/sys/log",[["post","/setKeep",""],["get","/getKeep",""],["post","/clear",""],["post","/page",""],["","/list",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/base/sys/menu",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/param",[["post","/delete",""],["post","/update",""],["get","/html",""],["get","/info",""],["post","/page",""],["post","/add",""],["","/list",""]]],["/admin/base/sys/role",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/base/sys/user",[["post","/delete",""],["post","/update",""],["post","/move",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/demo/goods",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/page",""],["post","/list",""],["post","/add",""]]],["/admin/space/info",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/space/type",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/study/finish",[["post","/page",""],["","/list",""],["","/info",""],["","/update",""],["","/delete",""],["","/add",""]]],["/admin/study/learn",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/study/music",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/study/topic",[["get","/provinceCount",""],["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/study/works",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]],["/admin/task/info",[["post","/delete",""],["post","/update",""],["post","/start",""],["post","/once",""],["post","/stop",""],["get","/info",""],["post","/page",""],["get","/log",""],["post","/add",""],["","/list",""]]],["/admin/user/info",[["post","/delete",""],["post","/update",""],["get","/info",""],["post","/list",""],["post","/page",""],["post","/add",""]]]] \ No newline at end of file diff --git a/build/cool/temp/service.d.ts b/build/cool/temp/service.d.ts index b690274..4a2c359 100644 --- a/build/cool/temp/service.d.ts +++ b/build/cool/temp/service.d.ts @@ -635,6 +635,232 @@ declare interface SpaceType { }; } +declare interface StudyFinish { + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * list + * @returns Promise + */ + list(data?: any): Promise; + /** + * info + * @returns Promise + */ + info(data?: any): Promise; + /** + * update + * @returns Promise + */ + update(data?: any): Promise; + /** + * delete + * @returns Promise + */ + delete(data?: any): Promise; + /** + * add + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + page: string; + list: string; + info: string; + update: string; + delete: string; + add: string; + }; +} + +declare interface StudyLearn { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface StudyMusic { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface StudyTopic { + /** + * 省份统计 + * @returns Promise + */ + provinceCount(data?: any): Promise; + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + provinceCount: string; + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + +declare interface StudyWorks { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + declare interface TaskInfo { /** * 删除 @@ -703,6 +929,50 @@ declare interface TaskInfo { }; } +declare interface UserInfo { + /** + * 删除 + * @returns Promise + */ + delete(data?: any): Promise; + /** + * 修改 + * @returns Promise + */ + update(data?: any): Promise; + /** + * 单个信息 + * @returns Promise + */ + info(data?: any): Promise; + /** + * 列表查询 + * @returns Promise + */ + list(data?: any): Promise; + /** + * 分页查询 + * @returns Promise + */ + page(data?: any): Promise; + /** + * 新增 + * @returns Promise + */ + add(data?: any): Promise; + /** + * 权限 + */ + permission: { + delete: string; + update: string; + info: string; + list: string; + page: string; + add: string; + }; +} + declare type Service = { request(data: RequestOptions): Promise; base: { @@ -719,5 +989,13 @@ declare type Service = { }; demo: { goods: DemoGoods }; space: { info: SpaceInfo; type: SpaceType }; + study: { + finish: StudyFinish; + learn: StudyLearn; + music: StudyMusic; + topic: StudyTopic; + works: StudyWorks; + }; task: { info: TaskInfo }; + user: { info: UserInfo }; }; diff --git a/package.json b/package.json index e3ac40a..36f17b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.1.3", + "version": "5.1.4", "scripts": { "dev": "vite --host", "build": "vite build", @@ -9,14 +9,14 @@ "lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix" }, "dependencies": { - "@cool-vue/crud": "^5.0.6", + "@cool-vue/crud": "^5.0.7", "@element-plus/icons-vue": "^1.1.3", "@vueuse/core": "^8.2.5", "axios": "^0.26.1", "codemirror": "^5.62.0", "core-js": "^3.6.5", "echarts": "^5.0.2", - "element-plus": "^2.1.7", + "element-plus": "^2.2.0", "file-saver": "^2.0.5", "js-beautify": "^1.13.5", "lodash": "^4.17.21", @@ -27,7 +27,6 @@ "quill": "^1.3.7", "store": "^2.0.12", "unocss": "^0.31.0", - "uuid": "^8.3.2", "vue": "^3.2.32", "vue-echarts": "^6.0.2", "vue-router": "^4.0.14", @@ -61,7 +60,7 @@ "svg-sprite-loader": "^6.0.2", "typescript": "^4.6.2", "unplugin-vue-components": "^0.17.21", - "vite": "^2.9.6", + "vite": "^2.9.8", "vite-plugin-compression": "^0.5.1", "vite-plugin-dts": "^0.9.9", "vite-plugin-mock": "^2.9.6", diff --git a/src/assets/icon/logo/silder-simple.png b/src/assets/icon/logo/silder-simple.png deleted file mode 100644 index a75c6187a4c8ebd40815ca264db6518574605f21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1403 zcmV->1%&#EP)bj)RKO&~I*-$z3=m5uWmUjk#0#4K0Jg3WuML(1*!q{U zD_{p-+^FL;~80cYPKP5N~vF zp9hTkyPe-KNGj5{%Eq#!{wf>&?z)AoMdD5fQ33mm@*fg!aME0H*UR*qO@T~~7)MQ# zhB9mo<*+r9H}-_06<}SSeonlxsmD3@eVP92lQWACN?I|F*ybiSHyiD(xH$fk3fPP7 zyzdNfqKV82Y2=@?k8W@f;=EYxL18`xF~*#T1CJFF@W0t{Zi(J3R~g z$omk+khv|!QMoN?opJP&w$ABW*iv={SWjd=11=bK5-vD>3;9lrJhL`z91Tg@m}BJA zZDS6f!#=hXEEQl~aC`}zGU`-w%Gt4CUl@60Y^|h4{=e#cz^Ukg> zeZ+A$rC9>nfISAs0Pg`ejXKrz0*|Ktzv=8+*n{sBZ}kl*qqR#Km2^nbUy@E$eIN8j z?3;i^qrHkIb%GFS$=&IP}(9y@n&b2;!$qIbd_GP#h6b57L1OL zXV}RqaUU)_y|kU<#<&*h#nUVSAvYq8O5BHMtLz2YkTpxdexsAKlA@HpZ;AVGq$;+^ z`LnQJh6Ln2jL1{sJ}gV>tBP^lXrty(CZXQ%;DxGd z9|M;SHo9r_^g5N9F6E!AWpY}z)AS9ajU~nXYghr>fB{2hTg3)y-#oLfI0uOPw~Fcn zgnQr^jwRr2YWD(p_8j&5=gPwRSgK6^l=P9}nA()Rw#fZ>u3iF;1q!|hCndcksYm`x z=}(M4jwzLZZ<|&;2+yfWUvps@lbemK225vAbvjILwvkkWTEoE<{yyJ+^F}Tg2Dg*002ov JPDHLkV1f{#oVEY} diff --git a/src/assets/icon/logo/silder.png b/src/assets/icon/logo/silder.png deleted file mode 100644 index ebf6856daa0636a61b17865301b0d1ab051ff264..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmV+b4FB_qP) zd$bi*8Nh${a-rmP0eM;mB7!L(mWpd-2~mMW`64TP1bHzcLO}9S>3DpkEFK|Zpv6P6 z(kxk}0b#mAphcyK+ASUy2F9y+8IW*=+aKSV&YnGc&+M6V4&KF`-&$wgvuF0~nKQG$ zy}#G&TTx$MPYQ+s<A93iM0UU}Ghh%N2FJ=XoW%l8pBP|M^#@JpLxj_H%$iDcj7* zXtbme#E$?2BKA*8cPSYejh8fnXqydvh5{c>(QZaYqa~>zeh|3Ip!5sZf&1W64ki-*J!25l#f4KG z>Qo~4cp}pA??LXVjZVt0x6Z|b5EOomm-)*ybYl40K4&dVv=U3b5XJ%VWVW=m2k>2_6S*=RxsMH< zcE~KE(*pQnnaM@-B^ru2uf>&&B51R8M;@k$slZ7}`5>Z#_6JTwk{4zn>XJ`4WW+Pk#c-}# zU}XLpdjVG>>a@xj&+{&{wAoO&8nJCmT%WSdDaiBlKjVQ%2-|Dl0?tj)?hNeO(rF|c zDAUpd_?}Be7eTbe1dky$6^LE+xTW3z#F;N2TJ}vR_>9WQc%n1WfOtXd0oa@g zPXn8k^7M#yN;NAE)5>E3n+Nfyh!FU+MP?+G&uHZb5F60M65uJN+#Jysbo4gAj#*nc zhB&|uD%%Dd>NOP3L)3hqC4|+*ua@w9yAhRLeZE6U=5x4%u-!KR@hu!LDu4wPyxvCQ ze$)i)MzSt=>yd|J;ws?Om~*+Hj<{Qa*JJ8WMI0t8fZq^yD)rRLrZ-Ad^xxOZP)FUi z8JPub>;qOSV>S6$Pv6M1ev?U3v)SE><5k53ca966}^P;FV+Mhzc4**x=UF_w>=*IQnUnBjG`%B@)s(C+1^|yPW}iLMg8% z*vUcSWj+pXwa%WOjtcL@d)BNZeiFrnP34It5j|9Wx zyp1mywp9UN(YD<~*w)hN27D69sV$Z>wX%x?%x5CfpH;hZGw}UlFDfCoBF;kJqaI50 zGYO(C=2wRVTV2?P*bydA=>WQY@#5Drz1CCSLJ+K6O2Xf&gF7@BF>+dX(^8zisaa)p@!lGu>--l>>iT6RkH!< zv#N%76ZR~ya`6t5S+yFArl4=^jXkLR1kuy^$%upJzI=HmcK2}FH~62`%0IwvD_%+P zx9mj{yH%buT$fE77)&sq@-X2vHB*~&FlTX8AoobMJC|F|{a#UwbM11X^Ks*7gJ@2w zR<(rW&aK-J;maYJSy7J0a`MjMhS>%RINg$+>yZN5PiN5@eKLi)!~NYE<>_* z-Z1QoViA%D>d!bAA#Y(!K|EmZBD2t!3BQ8%Xnw!S1|-;jalYINiIGl4Qm=L)D)1FZ z`k89;EyQfk{RmM-e069bGRsZ_UP1<^-bnh@0PWbhhW1R1@H{WhmV6z#H)-iiPy_fI z@ha&c;F|pRX8G@N0rVk=D(lk%S@Y;i1Y@!g(UBuKlJdB6a64iyg;D`kLF`O8Khx)V zyqkAnf-RnZ=Gcx~o4bsU? zj3S-tvH%fAR~6+o#LlqUUauf(?0+2F+lIVjxFe#@orHtAQ9MKG1L3xJAYG^+m^b<^ zqK(9{m7sdv2gy+_hI&Nfxw*)88VWCANO$uEu{n}SW5SPx>_A51^DXsM&ZUr6WK#>8 zBMH%In1+n@i?O@2HzLlO{)k!?#S%naco=(j%?@OiJe#0)V4@yTJqIGHuWitH8BwDz zjamM}X-N%@-6@XosV3-^UPOHQpU+H!p^)C%ewVO8Jz_S@M%2_>i4Mc4*H%X`kvEKxWNK#FN;hq|VXspH0F z$G8OTRn#?Wk_aNmv#Fr8Yt}&gJ!?WC52K+XT3PK<=eO#_ywZA{wZZ!85t)OzK3Tn;yt=w*>?OhMermmTu?PX+~5d06J{(4>rIv$k( O0000 { - const isLoaded: boolean = storage.get("eps"); - storage.set("eps", res); + if (!isEmpty(res)) { + const isLoaded: boolean = storage.get("eps"); + storage.set("eps", res); - if (!isLoaded) { - location.reload(); - } else { - set(res, true); - console.log("[Eps] 初始化成功。"); + if (!isLoaded) { + location.reload(); + } else { + set(res, true); + console.log("[Eps] 初始化成功。"); + } } }) .catch((err) => { @@ -190,23 +193,17 @@ export function useEps(service: Service) { getEps(); } } else { - const eps: any[] = []; - - JSON.parse(__EPS__).forEach((e: any) => { - const [prefix, api] = e; - - eps.push({ + const eps = JSON.parse(__EPS__).map(([prefix, api]: any[]) => { + return { prefix, - api: api.map((e: string[]) => { - const [method, path, name] = e; - + api: api.map(([method, path, name]: string[]) => { return { method, path, name }; }) - }); + }; }); // 文件数据 diff --git a/src/cool/utils/index.ts b/src/cool/utils/index.ts index c095517..8d45c81 100644 --- a/src/cool/utils/index.ts +++ b/src/cool/utils/index.ts @@ -1,75 +1,8 @@ +import { isArray, orderBy } from "lodash"; import { app } from "../config"; import storage from "./storage"; import module from "./module"; -// 是否Array类型 -export function isArray(value: any): boolean { - if (typeof Array.isArray === "function") { - return Array.isArray(value); - } else { - return Object.prototype.toString.call(value) === "[object Array]"; - } -} - -// 是否Object类型 -export function isObject(value: any): boolean { - return Object.prototype.toString.call(value) === "[object Object]"; -} - -// 是否Function类型 -export function isFunction(value: any): boolean { - return typeof value === "function"; -} - -// 是否String类型 -export function isString(value: any): boolean { - return typeof value === "string"; -} - -// 是否Boolean类型 -export function isBoolean(value: any): boolean { - return typeof value === "boolean"; -} - -// 是否数字类型 -export function isNumber(value: any): boolean { - return typeof value === "number" && !isNaN(value); -} - -// 是否Promise类型 -export function isPromise(value: any): boolean { - return ( - value !== null && - (typeof value === "object" || typeof value === "function") && - typeof value.then === "function" - ); -} - -// 是否为空 -export function isEmpty(value: any): boolean { - if (isArray(value)) { - return value.length === 0; - } - - if (isObject(value)) { - return Object.keys(value).length === 0; - } - - return value === "" || value === undefined || value === null; -} - -// 比较值 -export function compareValue(a: any, b: any) { - return String(a) === String(b); -} - -// 取最后一个值 -export function last(data: string | any[]) { - if (isArray(data) || isString(data)) { - return data[data.length - 1]; - } -} - // 首字母大写 export function firstUpperCase(value: string): string { return value.replace(/\b(\w)(\w*)/g, function ($0, $1, $2) { @@ -82,29 +15,6 @@ export function getNames(value: any) { return Object.getOwnPropertyNames(value.constructor.prototype); } -// 深拷贝 -export function cloneDeep(v: any) { - if (isObject(v)) { - const d: any = {}; - - for (const k in v) { - if (v.hasOwnProperty && v.hasOwnProperty(k)) { - if (v[k] && typeof v[k] === "object") { - d[k] = cloneDeep(v[k]); - } else { - d[k] = v[k]; - } - } - } - - return d; - } else if (isArray(v)) { - return v.map(cloneDeep); - } else { - return v; - } -} - // 深度合并 export function deepMerge(a: any, b: any) { let k; @@ -123,11 +33,6 @@ export function getUrlParam(name: string): string | null { return null; } -// 根据某个字段排序 -export function orderBy(list: any[], key: string): any[] { - return list.sort((a, b) => b[key] - a[key]); -} - // 文件路径转对象 export function deepFiles(list: any[]) { const modules: any = {}; diff --git a/src/mock/chat.ts b/src/mock/chat.ts deleted file mode 100644 index c42d226..0000000 --- a/src/mock/chat.ts +++ /dev/null @@ -1,79 +0,0 @@ -import Mock from "mockjs"; - -Mock.mock("/im/session/page", "post", (options: any) => { - const { keyWord = "" } = JSON.parse(options.body); - - const data = Mock.mock({ - "list|20": [ - { - id: "@id", - nickname: "@name", - createTime: "@datetime(yy-MM-dd HH:mm:ss)", - text: "@cparagraph(5)", - content() { - return JSON.stringify({ text: this.text }); - }, - "contentType|0-3": 0, - "serviceUnreadCount|0-10": 0, - headimgurl() { - return Mock.Random.image( - "40x40", - Mock.Random.color(), - "#FFF", - "png", - this.nickname[0] - ); - } - } - ] - }); - - return { - code: 1000, - data: { - list: data.list.filter((e: any) => e.nickname.includes(keyWord)), - pagination: {} - } - }; -}); - -Mock.mock("/im/session/unreadCount", "get", () => { - const data = Mock.mock({ - "count|1-50": 1 - }); - - return { - code: 1000, - data: data.count - }; -}); - -Mock.setup({ - timeout: "500-1000" -}); - -Mock.mock("/im/message/page", "post", () => { - const data = Mock.mock({ - "list|20": [ - { - id: "@id", - nickname: "@name", - createTime: "@datetime", - text: "@cparagraph(1, 4)", - content() { - return JSON.stringify({ text: this.text }); - }, - contentType: 0, - "type|0-1": 1 - } - ] - }); - - return { - code: 1000, - data: { - list: data.list, - pagination: {} - } - }; -}); diff --git a/src/modules/base/common/permission.ts b/src/modules/base/common/permission.ts index 0912ad0..899c8cb 100644 --- a/src/modules/base/common/permission.ts +++ b/src/modules/base/common/permission.ts @@ -1,5 +1,5 @@ import { useBaseStore } from "../store"; -import { isObject } from "/@/cool/utils"; +import { isObject } from "lodash"; function parse(value: any) { const { menu } = useBaseStore(); diff --git a/src/modules/base/components/avatar/index.vue b/src/modules/base/components/avatar/index.vue index d51ed87..4541f8f 100644 --- a/src/modules/base/components/avatar/index.vue +++ b/src/modules/base/components/avatar/index.vue @@ -12,7 +12,7 @@