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 a75c618..0000000 Binary files a/src/assets/icon/logo/silder-simple.png and /dev/null differ diff --git a/src/assets/icon/logo/silder.png b/src/assets/icon/logo/silder.png deleted file mode 100644 index ebf6856..0000000 Binary files a/src/assets/icon/logo/silder.png and /dev/null differ diff --git a/src/cool/module/index.ts b/src/cool/module/index.ts index 8c0c3ca..5570f9c 100644 --- a/src/cool/module/index.ts +++ b/src/cool/module/index.ts @@ -1,6 +1,7 @@ import modules from "/@/modules"; import { router, addViews } from "../router"; -import { isFunction, isObject, filename } from "../utils"; +import { filename } from "../utils"; +import { isFunction, isObject } from "lodash"; import { App } from "vue"; import module from "../utils/module"; diff --git a/src/cool/service/base.ts b/src/cool/service/base.ts index 6d74e58..040c3ad 100644 --- a/src/cool/service/base.ts +++ b/src/cool/service/base.ts @@ -1,6 +1,6 @@ // @ts-nocheck import { baseUrl, isDev, test } from "../config"; -import { isObject } from "../utils"; +import { isObject } from "lodash"; import request from "./request"; export function Service( diff --git a/src/cool/service/eps.ts b/src/cool/service/eps.ts index a143cd9..4deff12 100644 --- a/src/cool/service/eps.ts +++ b/src/cool/service/eps.ts @@ -1,6 +1,7 @@ import { isDev, test } from "../config"; import { BaseService } from "./base"; -import { storage, toCamel, isArray } from "../utils"; +import { storage, toCamel } from "../utils"; +import { isArray, isEmpty } from "lodash"; // 获取标签名 function getNames(v: any) { @@ -71,14 +72,16 @@ export function useEps(service: Service) { url: "/admin/base/open/eps" }) .then(async (res) => { - 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 @@