├── GrowRock ├── GrowFlow │ ├── README.md │ ├── src │ │ ├── styles │ │ │ ├── animate │ │ │ │ └── index.css │ │ │ └── tailwindcss │ │ │ │ └── index.css │ │ ├── packages │ │ │ └── GWorkFlow │ │ │ │ ├── index.ts │ │ │ │ ├── components │ │ │ │ └── StencilComponent │ │ │ │ │ └── index.vue │ │ │ │ └── use │ │ │ │ └── useEvent.ts │ │ ├── vite-env.d.ts │ │ ├── index.d.ts │ │ └── index.ts │ ├── types │ │ └── public.d.ts │ ├── postcss.config.cjs │ ├── shims.d.ts │ ├── tsconfig.json │ ├── package.json │ └── .babelrc ├── GrowEditor │ ├── README.md │ ├── src │ │ ├── styles │ │ │ ├── animate │ │ │ │ └── index.css │ │ │ └── tailwindcss │ │ │ │ └── index.css │ │ ├── packages │ │ │ └── Codemirror │ │ │ │ ├── index.ts │ │ │ │ └── use │ │ │ │ └── useEvent.ts │ │ ├── vite-env.d.ts │ │ ├── index.ts │ │ └── static │ │ │ └── dict.ts │ ├── types │ │ └── public.d.ts │ ├── postcss.config.cjs │ ├── shims.d.ts │ ├── tsconfig.json │ ├── .babelrc │ └── package.json ├── GrowSingleFile │ ├── README.md │ ├── src │ │ ├── styles │ │ │ ├── animate │ │ │ │ └── index.css │ │ │ └── tailwindcss │ │ │ │ └── index.css │ │ ├── vite-env.d.ts │ │ ├── packages │ │ │ ├── GSingleComponent │ │ │ │ ├── index.ts │ │ │ │ ├── use │ │ │ │ │ ├── initView.ts │ │ │ │ │ ├── useDrawer.ts │ │ │ │ │ ├── useEvent.ts │ │ │ │ │ └── useTabsOption.ts │ │ │ │ └── components │ │ │ │ │ ├── FileName.vue │ │ │ │ │ └── ImportMap.vue │ │ │ └── GSingleRenderView │ │ │ │ ├── index.ts │ │ │ │ └── GSingleRenderView.vue │ │ ├── static │ │ │ └── tempalteStr.ts │ │ └── index.ts │ ├── types │ │ └── public.d.ts │ ├── postcss.config.cjs │ ├── shims.d.ts │ ├── package.json │ ├── tsconfig.json │ └── .babelrc ├── GrowDesigner │ ├── README.md │ ├── src │ │ ├── styles │ │ │ ├── animate │ │ │ │ └── index.css │ │ │ └── tailwindcss │ │ │ │ └── index.css │ │ ├── packages │ │ │ ├── GDesigner │ │ │ │ ├── index.ts │ │ │ │ ├── config │ │ │ │ │ └── designation.ts │ │ │ │ ├── static │ │ │ │ │ ├── pageConfig.ts │ │ │ │ │ └── elementInfo │ │ │ │ │ │ ├── imageConfig.ts │ │ │ │ │ │ └── basicTitleConfig.ts │ │ │ │ ├── components │ │ │ │ │ ├── BasicTitle │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── configurationComponent │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── reviewData │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── draggableView │ │ │ │ │ │ ├── use │ │ │ │ │ │ │ └── useEvents.ts │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── pageOptions │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── abstractionComponent │ │ │ │ │ │ └── component │ │ │ │ │ │ │ ├── basicComponent │ │ │ │ │ │ │ └── index.vue │ │ │ │ │ │ │ └── eleModuleComponent │ │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── moduleOptions │ │ │ │ │ │ └── use │ │ │ │ │ │ │ └── useInit.ts │ │ │ │ │ ├── reviewTree │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── apiOutlined │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── dataSource │ │ │ │ │ │ └── index.vue │ │ │ │ └── optionComponent │ │ │ │ │ └── ElementSize │ │ │ │ │ └── use │ │ │ │ │ └── useMargin.ts │ │ │ └── GRenderer │ │ │ │ ├── index.ts │ │ │ │ └── GRenderer.vue │ │ └── index.ts │ ├── types │ │ └── public.d.ts │ ├── postcss.config.cjs │ ├── shims.d.ts │ ├── package.json │ ├── tsconfig.json │ └── .babelrc ├── GrowComponent │ ├── src │ │ ├── packages │ │ │ ├── GDialog │ │ │ │ └── index.ts │ │ │ ├── GCountTo │ │ │ │ └── index.ts │ │ │ ├── GOverFlowList │ │ │ │ └── index.ts │ │ │ ├── GSplitPane │ │ │ │ ├── index.ts │ │ │ │ └── GSplitPane.vue │ │ │ └── GDetail │ │ │ │ ├── index.ts │ │ │ │ └── GDetail.vue │ │ ├── styles │ │ │ └── tailwindcss │ │ │ │ └── index.css │ │ ├── shims.d.ts │ │ └── index.ts │ ├── postcss.config.cjs │ ├── types │ │ └── GSplitPane.d.ts │ ├── tailwind.config.cjs │ ├── package.json │ ├── .babelrc │ ├── tsconfig.json │ └── tests │ │ └── GDetail.spec.ts └── GrowUtils │ ├── types │ ├── index.d.ts │ ├── DOMEventManager.d.ts │ └── Request.d.ts │ ├── src │ ├── packages │ │ ├── AxiosFactory │ │ │ ├── CatchResult.ts │ │ │ └── index.ts │ │ └── ElementResize │ │ │ └── index.ts │ └── index.ts │ ├── package.json │ ├── tsconfig.json │ ├── .babelrc │ └── rollup.config.mjs ├── sample ├── .env.development ├── .env.production ├── src │ ├── styles │ │ ├── base │ │ │ └── _var.scss │ │ └── tailwindcss │ │ │ └── index.scss │ ├── assets │ │ ├── images │ │ │ ├── logo.png │ │ │ └── login_illustration.png │ │ ├── enums │ │ │ ├── systemEnum.ts │ │ │ ├── cacheEnum.ts │ │ │ └── breakpointEnum.ts │ │ ├── state │ │ │ └── data │ │ │ │ └── staticData.ts │ │ └── icon │ │ │ └── index.ts │ ├── utils │ │ ├── helper.ts │ │ ├── index.ts │ │ └── Echarts │ │ │ └── index.ts │ ├── apis │ │ ├── System │ │ │ ├── UserInfo.ts │ │ │ ├── MenuList.ts │ │ │ └── index.ts │ │ ├── Login │ │ │ ├── PhoneLogin.ts │ │ │ ├── Login.ts │ │ │ ├── ForgetPassword.ts │ │ │ └── index.ts │ │ ├── systemMent │ │ │ ├── deptMent.ts │ │ │ ├── menuMent.ts │ │ │ ├── index.ts │ │ │ ├── roleMent.ts │ │ │ └── accountMent.ts │ │ ├── Dictionary │ │ │ ├── index.ts │ │ │ └── DictConfig.ts │ │ └── index.ts │ ├── shims-vue.d.ts │ ├── main.ts │ ├── pages │ │ ├── System │ │ │ ├── Role │ │ │ │ ├── component │ │ │ │ │ └── infoRole │ │ │ │ │ │ ├── DataPermission.vue │ │ │ │ │ │ ├── FunctionalAuthority.vue │ │ │ │ │ │ └── use │ │ │ │ │ │ ├── useAuthority.ts │ │ │ │ │ │ ├── useBasic.ts │ │ │ │ │ │ └── useApply.ts │ │ │ │ ├── use │ │ │ │ │ └── useDict.ts │ │ │ │ └── types │ │ │ │ │ └── index.d.ts │ │ │ ├── Menu │ │ │ │ ├── components │ │ │ │ │ └── createMenu.vue │ │ │ │ ├── types │ │ │ │ │ └── index.d.ts │ │ │ │ └── use │ │ │ │ │ ├── useTableFunc.ts │ │ │ │ │ └── useDict.ts │ │ │ └── Account │ │ │ │ ├── use │ │ │ │ └── useDict.ts │ │ │ │ ├── types │ │ │ │ └── index.d.ts │ │ │ │ └── component │ │ │ │ ├── AccountHistory │ │ │ │ ├── use │ │ │ │ │ └── useInit.ts │ │ │ │ ├── index.vue │ │ │ │ └── HistoryItem.vue │ │ │ │ ├── AccountUseRecord │ │ │ │ ├── use │ │ │ │ │ └── useInit.ts │ │ │ │ ├── index.vue │ │ │ │ └── RecordItem.vue │ │ │ │ └── AccountResetPassword │ │ │ │ ├── index.vue │ │ │ │ └── use │ │ │ │ └── useForm.ts │ │ ├── NotFound │ │ │ └── index.vue │ │ ├── Custom │ │ │ ├── customPage2 │ │ │ │ └── index.vue │ │ │ └── customPage1 │ │ │ │ └── index.vue │ │ ├── AutomatedTool │ │ │ ├── ProcessEngine │ │ │ │ └── index.vue │ │ │ ├── PageDesigner │ │ │ │ └── index.vue │ │ │ ├── OnlineEditor │ │ │ │ └── index.vue │ │ │ └── SingleFileComponent │ │ │ │ ├── index.vue │ │ │ │ └── use │ │ │ │ └── useCodeOption.ts │ │ ├── EmbedPage │ │ │ ├── FramePage.vue │ │ │ ├── index.vue │ │ │ └── RenderIframe.vue │ │ ├── Redirect │ │ │ └── index.vue │ │ ├── Home │ │ │ └── use │ │ │ │ ├── useOption.ts │ │ │ │ └── useVariable.ts │ │ ├── Child1 │ │ │ └── index.vue │ │ ├── Feat │ │ │ ├── OverflowList │ │ │ │ └── index.vue │ │ │ └── SplitPaneTest │ │ │ │ └── index.vue │ │ ├── Login │ │ │ └── use │ │ │ │ └── useEvent.ts │ │ └── Index │ │ │ └── use │ │ │ └── useContainer.ts │ ├── routers │ │ ├── pages │ │ │ ├── index.ts │ │ │ ├── ListPage.ts │ │ │ ├── dashboard.ts │ │ │ ├── ExternalPage.ts │ │ │ └── AutomatedTool.ts │ │ ├── index.ts │ │ ├── authority.ts │ │ ├── permission.ts │ │ └── routers │ │ │ └── index.ts │ ├── components │ │ ├── business │ │ │ ├── Login │ │ │ │ ├── ForgetPassword │ │ │ │ │ └── use │ │ │ │ │ │ └── useBack.ts │ │ │ │ ├── Form │ │ │ │ │ └── use │ │ │ │ │ │ └── useForget.ts │ │ │ │ ├── use │ │ │ │ │ └── useLoginSuccess.ts │ │ │ │ ├── QrCodeLogin │ │ │ │ │ └── index.vue │ │ │ │ ├── ThirdParty │ │ │ │ │ └── index.vue │ │ │ │ └── ChangePassword │ │ │ │ │ └── index.vue │ │ │ ├── Permission │ │ │ │ └── index.vue │ │ │ ├── Dashboard │ │ │ │ ├── workbench │ │ │ │ │ ├── QuickNav │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── Dynamic │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── SayHello │ │ │ │ │ │ └── index.vue │ │ │ │ └── Analysis │ │ │ │ │ └── VisitAnalysisBar │ │ │ │ │ └── index.vue │ │ │ ├── Index │ │ │ │ └── Describe │ │ │ │ │ └── index.vue │ │ │ └── Home │ │ │ │ ├── SettingContent │ │ │ │ └── index.vue │ │ │ │ └── Options │ │ │ │ └── use │ │ │ │ └── useEvent.ts │ │ ├── public │ │ │ ├── IntactTable │ │ │ │ ├── use │ │ │ │ │ ├── useEvent.ts │ │ │ │ │ └── useInitColumns.ts │ │ │ │ └── index.vue │ │ │ ├── RenderView │ │ │ │ ├── use │ │ │ │ │ └── useCatch.ts │ │ │ │ └── index.vue │ │ │ ├── Watermark │ │ │ │ └── index.vue │ │ │ ├── PasswordIntensity │ │ │ │ └── index.vue │ │ │ ├── AbstractEle │ │ │ │ └── index.vue │ │ │ └── PerfectTable │ │ │ │ ├── use │ │ │ │ └── useInitColumns.ts │ │ │ │ └── Column.vue │ │ └── base │ │ │ ├── Menu │ │ │ ├── use │ │ │ │ └── useResizeEle.ts │ │ │ ├── MenuItem.vue │ │ │ └── index.vue │ │ │ ├── GLogo │ │ │ └── index.vue │ │ │ ├── Tabs │ │ │ └── use │ │ │ │ └── useSortTabs.ts │ │ │ └── AppSearch │ │ │ └── index.vue │ ├── stores │ │ ├── index.ts │ │ └── modules │ │ │ ├── systemInfo.ts │ │ │ ├── theme.ts │ │ │ ├── language.ts │ │ │ ├── authority.ts │ │ │ ├── layout.ts │ │ │ ├── LockScreen.ts │ │ │ ├── app.ts │ │ │ └── menu.ts │ ├── vite-env.d.ts │ ├── plugins │ │ ├── script.plugin.ts │ │ ├── public.components.ts │ │ ├── index.ts │ │ └── style.plugin.ts │ ├── hooks │ │ ├── useTable │ │ │ └── index.ts │ │ ├── useGrow │ │ │ └── index.ts │ │ ├── useLoginOut │ │ │ └── index.ts │ │ └── usetabs │ │ │ └── index.ts │ ├── setting.ts │ ├── language │ │ └── index.ts │ └── App.vue ├── public │ ├── logo.ico │ └── favicon.ico ├── types │ ├── Dict.d.ts │ ├── eleOther.d.ts │ ├── Tree.d.ts │ ├── theme.d.ts │ ├── layout.d.ts │ ├── glabol.d.ts │ ├── ButtonGroup.d.ts │ ├── TableColumn.d.ts │ ├── pagination.d.ts │ ├── multipleTab.d.ts │ ├── language.d.ts │ ├── contextMenu.d.ts │ ├── index.d.ts │ └── menu.d.ts ├── postcss.config.js ├── tests │ └── hello.spec.ts ├── vitest.config.ts ├── shims.d.ts ├── mock │ ├── user │ │ └── index.ts │ ├── _createProductionServer.ts │ ├── login │ │ └── index.ts │ └── Dictionary │ │ └── index.ts ├── index.html ├── build │ ├── server.ts │ ├── build.ts │ └── other.ts ├── vite.config.ts ├── package.json └── tsconfig.json ├── pnpm-workspace.yaml ├── prettier.config.js ├── turbo.json ├── .gitignore ├── tsconfig.json └── scripts ├── dev.js ├── build.js └── commitMessage.js /GrowRock/GrowFlow/README.md: -------------------------------------------------------------------------------- 1 | 开发中,暂无相关描述 2 | -------------------------------------------------------------------------------- /sample/.env.development: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL = / -------------------------------------------------------------------------------- /sample/.env.production: -------------------------------------------------------------------------------- 1 | VITE_BASE_URL = / -------------------------------------------------------------------------------- /GrowRock/GrowEditor/README.md: -------------------------------------------------------------------------------- 1 | 开发中,暂无相关描述 2 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/README.md: -------------------------------------------------------------------------------- 1 | 开发中,暂无相关描述 2 | -------------------------------------------------------------------------------- /sample/src/styles/base/_var.scss: -------------------------------------------------------------------------------- 1 | $white: #ffffff; 2 | $light: #ededed; 3 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/README.md: -------------------------------------------------------------------------------- 1 | 1. 现有问题,目前设计器嵌套设置样式时及时效果有问题,宽度和弹性盒模型会出现页面错乱 2 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/styles/animate/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --animate-duration: 0.35s; 3 | } 4 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/styles/animate/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --animate-duration: 0.35s; 3 | } 4 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/styles/animate/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --animate-duration: 0.35s; 3 | } 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/styles/animate/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --animate-duration: 0.35s; 3 | } 4 | -------------------------------------------------------------------------------- /sample/public/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhQuella/grow_admin/HEAD/sample/public/logo.ico -------------------------------------------------------------------------------- /sample/types/Dict.d.ts: -------------------------------------------------------------------------------- 1 | export interface DictItem { 2 | code: string; 3 | label: string; 4 | } 5 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/types/public.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | -------------------------------------------------------------------------------- /sample/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhQuella/grow_admin/HEAD/sample/public/favicon.ico -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/types/public.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/types/public.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/types/public.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | -------------------------------------------------------------------------------- /sample/types/eleOther.d.ts: -------------------------------------------------------------------------------- 1 | export interface scrollEvent { 2 | scrollTop: number; 3 | scrollLeft: number; 4 | } 5 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GDialog/index.ts: -------------------------------------------------------------------------------- 1 | import GDialog from "./GDialog.vue"; 2 | 3 | export { GDialog }; 4 | -------------------------------------------------------------------------------- /sample/src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhQuella/grow_admin/HEAD/sample/src/assets/images/logo.png -------------------------------------------------------------------------------- /sample/types/Tree.d.ts: -------------------------------------------------------------------------------- 1 | export interface Tree { 2 | label: string; 3 | id: string; 4 | children?: Tree[]; 5 | } 6 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GCountTo/index.ts: -------------------------------------------------------------------------------- 1 | import GCountTo from "./GCountTo.vue"; 2 | 3 | export { GCountTo }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/packages/GWorkFlow/index.ts: -------------------------------------------------------------------------------- 1 | import GWorkFlow from "./GWorkFlow.vue"; 2 | 3 | export { GWorkFlow }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "@antv/x6-plugin-stencil"; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/index.ts: -------------------------------------------------------------------------------- 1 | import GDesigner from "./GDesigner.vue"; 2 | 3 | export { GDesigner }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GRenderer/index.ts: -------------------------------------------------------------------------------- 1 | import GRenderer from "./GRenderer.vue"; 2 | 3 | export { GRenderer }; 4 | -------------------------------------------------------------------------------- /sample/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GOverFlowList/index.ts: -------------------------------------------------------------------------------- 1 | import GOverFlowList from "./GOverFlowList"; 2 | export { GOverFlowList }; 3 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GSplitPane/index.ts: -------------------------------------------------------------------------------- 1 | import GSplitPane from "./GSplitPane.vue"; 2 | 3 | export { GSplitPane }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/packages/Codemirror/index.ts: -------------------------------------------------------------------------------- 1 | import GCodemirror from "./GCodemirror.vue"; 2 | 3 | export { GCodemirror }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | // declare module "@codemirror/autocomplete"; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | // declare module "@codemirror/autocomplete"; 4 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "GrowRock/*" 3 | - "GrowCornerstone/*" 4 | - "services/*" 5 | - "libs/*" 6 | - "sample" 7 | -------------------------------------------------------------------------------- /sample/types/theme.d.ts: -------------------------------------------------------------------------------- 1 | export type themeType = "dark" | "light"; 2 | 3 | export interface ThemeState { 4 | theme: themeType; 5 | } 6 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /sample/tests/hello.spec.ts: -------------------------------------------------------------------------------- 1 | import { test, expect } from "vitest"; 2 | 3 | test("1 + 1", () => { 4 | expect(1 + 1).toEqual(2); 5 | }); 6 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /sample/src/utils/helper.ts: -------------------------------------------------------------------------------- 1 | import { DOMEventManager } from "@grow-rock/grow-utils"; 2 | 3 | export const eventManager = new DOMEventManager(); 4 | -------------------------------------------------------------------------------- /sample/types/layout.d.ts: -------------------------------------------------------------------------------- 1 | export type LayoutTypes = "roof" | "side"; 2 | 3 | export interface LayoutState { 4 | layout: LayoutTypes; 5 | } 6 | -------------------------------------------------------------------------------- /sample/src/assets/images/login_illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZhQuella/grow_admin/HEAD/sample/src/assets/images/login_illustration.png -------------------------------------------------------------------------------- /sample/src/apis/System/UserInfo.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getUserInfo", 4 | url: "/user/info", 5 | method: "get" 6 | } 7 | ]; 8 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/styles/tailwindcss/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/index.ts: -------------------------------------------------------------------------------- 1 | import GSingleComponent from "./GSingleComponent.vue"; 2 | 3 | export { GSingleComponent }; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleRenderView/index.ts: -------------------------------------------------------------------------------- 1 | import GSingleRenderView from "./GSingleRenderView.vue"; 2 | 3 | export { GSingleRenderView }; 4 | -------------------------------------------------------------------------------- /sample/src/apis/Login/PhoneLogin.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "phoneLogin", 4 | url: "/modify/phone/login", 5 | method: "post" 6 | } 7 | ]; 8 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/types/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | 5 | export interface Fun { 6 | (...anr: any[]): any; 7 | } 8 | -------------------------------------------------------------------------------- /sample/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineProject } from "vitest/config"; 2 | 3 | export default defineProject({ 4 | test: { 5 | environment: "jsdom" 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /sample/src/apis/systemMent/deptMent.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getDeptStructureList", 4 | url: "/dept/structure/tree", 5 | method: "get" 6 | } 7 | ]; 8 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/types/GSplitPane.d.ts: -------------------------------------------------------------------------------- 1 | export interface SplitPane { 2 | horizontal?: boolean; 3 | size?: number; 4 | slotKey?: string; 5 | child?: SplitPane[]; 6 | } 7 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/config/designation.ts: -------------------------------------------------------------------------------- 1 | export const DRAGGABLE_CONGIG = "__draggableConfig__"; 2 | 3 | export const ACTIVE_UUID = "__activeUUID__"; 4 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/static/tempalteStr.ts: -------------------------------------------------------------------------------- 1 | export const defaultTemplate = `\\n\n\<\/template\>\n\n\ 8 | -------------------------------------------------------------------------------- /sample/src/apis/Dictionary/index.ts: -------------------------------------------------------------------------------- 1 | import axios from "api/index"; 2 | 3 | import DictConfig from "./DictConfig"; 4 | 5 | axios.setConfig("dicts", DictConfig); 6 | 7 | export default axios; 8 | -------------------------------------------------------------------------------- /sample/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | import plugin from "plugin/index"; 4 | 5 | const app = createApp(App); 6 | plugin(app); 7 | app.mount("#app"); 8 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: "jit", 3 | content: ["./src/**/*.{js,jsx,ts,tsx,vue}"], 4 | important: true, 5 | variants: { 6 | extend: {} 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/component/infoRole/DataPermission.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/component/infoRole/FunctionalAuthority.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 100, 3 | tabWidth: 2, 4 | useTabs: false, 5 | semi: true, 6 | singleQuote: false, 7 | quoteProps: "as-needed", 8 | trailingComma: "none", 9 | endOfLine: "auto" 10 | }; 11 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/static/pageConfig.ts: -------------------------------------------------------------------------------- 1 | 2 | export default [ 3 | { 4 | eleType: "ElInput", 5 | name: "123" 6 | }, 7 | { 8 | eleType: "ElSelect", 9 | name: "Select" 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /sample/src/apis/Login/Login.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "accountLogin", 4 | url: "/account/login", 5 | method: "post" 6 | }, 7 | { 8 | key: "accountUnlock", 9 | url: "/account/unlock", 10 | method: "post" 11 | } 12 | ]; 13 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/types/DOMEventManager.d.ts: -------------------------------------------------------------------------------- 1 | export type EventHandler = (event: Event) => void; 2 | 3 | export interface DOMListenerOptions { 4 | passive?: boolean; 5 | capture?: boolean; 6 | once?: boolean; 7 | } 8 | 9 | export type EventType = string | string[]; -------------------------------------------------------------------------------- /sample/src/apis/System/MenuList.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getMenuList", 4 | url: "/menu/list", 5 | method: "get" 6 | }, 7 | { 8 | key: "getRoleSings", 9 | url: "/user/authority/signs", 10 | method: "get" 11 | } 12 | ]; 13 | -------------------------------------------------------------------------------- /sample/src/pages/NotFound/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /sample/src/assets/state/data/staticData.ts: -------------------------------------------------------------------------------- 1 | import { LanguageItem } from "types/language"; 2 | 3 | export const internationOption: LanguageItem[] = [ 4 | { 5 | label: "中文", 6 | key: "ch" 7 | }, 8 | { 9 | label: "English", 10 | key: "en" 11 | } 12 | ]; 13 | -------------------------------------------------------------------------------- /sample/src/routers/pages/index.ts: -------------------------------------------------------------------------------- 1 | import dashboard from "./dashboard"; 2 | import AutomatedTool from "./AutomatedTool"; 3 | import ListPage from "./ListPage"; 4 | import ExternalPage from "./ExternalPage"; 5 | 6 | export default [...dashboard, ...ListPage, ...AutomatedTool, ...ExternalPage]; 7 | -------------------------------------------------------------------------------- /sample/types/glabol.d.ts: -------------------------------------------------------------------------------- 1 | import type { CSSProperties } from "vue"; 2 | 3 | declare global { 4 | declare interface Fn { 5 | (...arg: T[]): T; 6 | } 7 | 8 | declare type Recordable = Record; 9 | } 10 | -------------------------------------------------------------------------------- /sample/src/apis/System/index.ts: -------------------------------------------------------------------------------- 1 | import axios from "api/index"; 2 | 3 | import UserInfoConfig from "./UserInfo"; 4 | import MenuListConfig from "./MenuList"; 5 | 6 | axios.setConfig("userInfo", UserInfoConfig); 7 | axios.setConfig("menuList", MenuListConfig); 8 | 9 | export default axios; 10 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/ForgetPassword/use/useBack.ts: -------------------------------------------------------------------------------- 1 | interface prop { 2 | emit: Fn; 3 | } 4 | 5 | export const useBack = ({ emit }: prop) => { 6 | const onBackClick = () => { 7 | emit("back", "login"); 8 | }; 9 | 10 | return { 11 | onBackClick 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /sample/src/components/business/Permission/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/Form/use/useForget.ts: -------------------------------------------------------------------------------- 1 | interface props { 2 | emit: Fn; 3 | } 4 | 5 | export const useForget = ({ emit }: props) => { 6 | const onForgetPass = () => { 7 | emit("forget", "forgetPassword"); 8 | }; 9 | 10 | return { 11 | onForgetPass 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /sample/src/components/public/IntactTable/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | interface props { 2 | state: any; 3 | } 4 | 5 | export const useEvent = ({ state }: props) => { 6 | const setColumns = (columns: any[]) => { 7 | state.columns = columns; 8 | }; 9 | 10 | return { 11 | setColumns 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "extends": [], 4 | "tasks": { 5 | "build": { 6 | "dependsOn": ["^build"], 7 | "outputs": ["dist/**"] 8 | }, 9 | "dev": { 10 | "cache": false, 11 | "persistent": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/component/infoRole/use/useAuthority.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from "vue"; 2 | import { ref } from "vue"; 3 | 4 | export const useAuthority = () => { 5 | const authorityTabsValue: Ref = ref("FunctionalAuthority"); 6 | 7 | return { 8 | authorityTabsValue 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /sample/types/ButtonGroup.d.ts: -------------------------------------------------------------------------------- 1 | import { Fn } from "types/index"; 2 | const type = "primary" | "success" | "warning" | "danger" | "info"; 3 | 4 | export interface GroupBtn { 5 | func: Fn; 6 | icon: string; 7 | type; 8 | authority: string; 9 | title: string; 10 | disabled?: Fn; 11 | show?: Fn; 12 | } 13 | -------------------------------------------------------------------------------- /sample/src/pages/System/Menu/components/createMenu.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /sample/types/TableColumn.d.ts: -------------------------------------------------------------------------------- 1 | type fixedType = true | "left" | "right"; 2 | 3 | export interface Column { 4 | field: string; 5 | title: string; 6 | fixed?: fixedType; 7 | showOverflowTooltip?: boolean; 8 | formatter?: Fn; 9 | visible?: boolean; 10 | children?: Column[]; 11 | width?: number; 12 | } 13 | -------------------------------------------------------------------------------- /sample/src/stores/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 状态存储 3 | * @Author: Aaron 4 | * @Date: 2022-12-16 15:22:45 5 | * @LastEditors: Please set LastEditors 6 | * @LastEditTime: 2022-12-16 15:22:45 7 | */ 8 | 9 | import { createPinia } from "pinia"; 10 | 11 | const store = createPinia(); 12 | 13 | export default store; 14 | -------------------------------------------------------------------------------- /sample/types/pagination.d.ts: -------------------------------------------------------------------------------- 1 | import { Ref } from "vue"; 2 | 3 | type pageSizes = number[]; 4 | type page = Ref; 5 | type size = Ref; 6 | type layout = string; 7 | type total = Ref; 8 | 9 | export interface PageInfo { 10 | pageSizes; 11 | page; 12 | size; 13 | layout; 14 | total; 15 | } 16 | -------------------------------------------------------------------------------- /sample/src/routers/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from "vue-router"; 2 | 3 | import routes from "./routers/index"; 4 | 5 | const router = createRouter({ 6 | // history: createWebHistory(), 7 | history: createWebHashHistory(), 8 | strict: true, 9 | routes 10 | }); 11 | 12 | export default router; 13 | -------------------------------------------------------------------------------- /sample/src/pages/Custom/customPage2/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 16 | -------------------------------------------------------------------------------- /sample/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "element-plus/dist/locale/zh-cn.mjs"; 4 | declare module "element-plus/dist/locale/en.mjs"; 5 | declare module "sortablejs"; 6 | declare module "vue3-grid-layout"; 7 | declare module "exceljs"; 8 | declare module "nprogress"; 9 | declare module "@grow-rock/grow-utils"; 10 | -------------------------------------------------------------------------------- /sample/src/pages/AutomatedTool/ProcessEngine/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 16 | -------------------------------------------------------------------------------- /sample/types/multipleTab.d.ts: -------------------------------------------------------------------------------- 1 | export interface tabOption { 2 | key: string; 3 | label: string; 4 | closable: boolean; 5 | } 6 | 7 | type contextMenuType = 8 | | "redload" 9 | | "closeTag" 10 | | "closeLeftTag" 11 | | "closeRightTag" 12 | | "closeOtherTag" 13 | | "closeAllTag" 14 | | "addTag"; 15 | 16 | type tabMenuMethod = Record; 17 | -------------------------------------------------------------------------------- /sample/src/pages/System/Menu/types/index.d.ts: -------------------------------------------------------------------------------- 1 | type enumerate = "0" | "1"; 2 | 3 | export interface MenuItem { 4 | label: string; 5 | menuType: enumerate; 6 | menuIcon: string; 7 | sort: number; 8 | path: string; 9 | component: string; 10 | name: string; 11 | hidden: boolean; 12 | state: enumerate; 13 | createTime: string; 14 | children?: MenuItem[]; 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | .turbo 14 | *.local 15 | stats.html 16 | pnpm-lock.yaml 17 | coverage 18 | 19 | # Editor directories and files 20 | .idea 21 | .DS_Store 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | *.sw? 27 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/use/initView.ts: -------------------------------------------------------------------------------- 1 | export const initView = () => { 2 | const treeData = [ 3 | { 4 | size: 50, 5 | horizontal: false, 6 | slotKey: "redact" 7 | }, 8 | { 9 | size: 50, 10 | horizontal: false, 11 | slotKey: "review" 12 | } 13 | ]; 14 | 15 | return { 16 | treeData 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /sample/mock/user/index.ts: -------------------------------------------------------------------------------- 1 | // import { MockMethod } from "vite-plugin-mock"; 2 | 3 | export default [ 4 | { 5 | url: "/user/info", 6 | method: "get", 7 | response: () => { 8 | return { 9 | code: 10000, 10 | message: "成功", 11 | result: { 12 | userName: "李二狗", 13 | dept: "人力资源二部" 14 | } 15 | }; 16 | } 17 | } 18 | ]; 19 | -------------------------------------------------------------------------------- /sample/src/pages/AutomatedTool/PageDesigner/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /sample/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Grow Admin 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/components/public/RenderView/use/useCatch.ts: -------------------------------------------------------------------------------- 1 | import { computed } from "vue"; 2 | import { useMultipleTab } from "store/modules/multipleTab"; 3 | 4 | export const useCatch = () => { 5 | const multipleTab = useMultipleTab(); 6 | 7 | const cachedViews = computed((): string[] => { 8 | return multipleTab.getCachedViews; 9 | }); 10 | 11 | return { 12 | cachedViews 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/src/packages/AxiosFactory/CatchResult.ts: -------------------------------------------------------------------------------- 1 | export default class CatchResult { 2 | public cacheResult: any = {}; 3 | 4 | setCatch(name: string, result: any) { 5 | this.cacheResult[name] = result; 6 | } 7 | 8 | getCache(name: string) { 9 | return this.cacheResult[name]; 10 | } 11 | 12 | isCache(name: string) { 13 | return Boolean(this.cacheResult[name]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample/src/apis/Login/ForgetPassword.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getVerificationCode", 4 | url: "/verification/code", 5 | method: "post" 6 | }, 7 | { 8 | key: "testVerificationCode", 9 | url: "/test/verification/code", 10 | method: "post" 11 | }, 12 | { 13 | key: "modifyPassword", 14 | url: "/modify/account/password", 15 | method: "post" 16 | } 17 | ]; 18 | -------------------------------------------------------------------------------- /sample/src/plugins/script.plugin.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | 3 | import VueTour from "v3-tour"; 4 | import ElementPlus from "element-plus"; 5 | import router from "router/index"; 6 | import store from "store/index"; 7 | 8 | import "router/permission"; 9 | 10 | export default (app: App) => { 11 | app.use(router); 12 | app.use(store); 13 | app.use(ElementPlus); 14 | app.use(VueTour); 15 | }; 16 | -------------------------------------------------------------------------------- /sample/build/server.ts: -------------------------------------------------------------------------------- 1 | export const createServer = () => { 2 | return { 3 | base: "/", 4 | port: 3000, 5 | hmr: { 6 | overlay: false 7 | }, 8 | host: "0.0.0.0", 9 | proxy: { 10 | "/mock": { 11 | target: "http://127.0.0.1:3000", 12 | changeOrigin: true, 13 | rewrite: (path: string) => path.replace(/^\/mock/, "") 14 | } 15 | } 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /sample/src/apis/Login/index.ts: -------------------------------------------------------------------------------- 1 | import axios from "api/index"; 2 | 3 | import LoginMethodConfig from "./Login"; 4 | import ForgetPasswordConfig from "./ForgetPassword"; 5 | import PhoneLoginConfig from "./PhoneLogin"; 6 | 7 | axios.setConfig("LoginMethod", LoginMethodConfig); 8 | axios.setConfig("ForgetPassword", ForgetPasswordConfig); 9 | axios.setConfig("PhoneLogin", PhoneLoginConfig); 10 | 11 | export default axios; 12 | -------------------------------------------------------------------------------- /sample/src/pages/Custom/customPage1/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /sample/src/components/public/Watermark/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /sample/types/language.d.ts: -------------------------------------------------------------------------------- 1 | import { internationOption } from "@/assets/state/data/staticData"; 2 | 3 | declare global { 4 | type Title18n = { 5 | [p.label in internationOption]: string; 6 | }; 7 | } 8 | 9 | export type LanguageType = "ch" | "en"; 10 | 11 | export interface LanguageItem { 12 | key: LanguageType; 13 | label: string; 14 | } 15 | 16 | export interface LanguageState { 17 | locale: LanguageType; 18 | } 19 | -------------------------------------------------------------------------------- /sample/src/components/business/Dashboard/workbench/QuickNav/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare const __DEV__: boolean; 2 | 3 | declare module "*.vue" { 4 | import type { DefineComponent } from "vue"; 5 | const comp: DefineComponent<{}, {}, any>; 6 | export default comp; 7 | } 8 | 9 | declare module "*.scss" { 10 | const classes: string; 11 | export default classes; 12 | } 13 | 14 | declare module "*.module.scss" { 15 | const classes: { readonly [key: string]: string }; 16 | export default classes; 17 | } 18 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare const __DEV__: boolean; 2 | 3 | declare module "*.vue" { 4 | import type { DefineComponent } from "vue"; 5 | const comp: DefineComponent<{}, {}, any>; 6 | export default comp; 7 | } 8 | 9 | declare module "*.scss" { 10 | const classes: string; 11 | export default classes; 12 | } 13 | 14 | declare module "*.module.scss" { 15 | const classes: { readonly [key: string]: string }; 16 | export default classes; 17 | } 18 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare const __DEV__: boolean; 2 | 3 | declare module "*.vue" { 4 | import type { DefineComponent } from "vue"; 5 | const comp: DefineComponent<{}, {}, any>; 6 | export default comp; 7 | } 8 | 9 | declare module "*.scss" { 10 | const classes: string; 11 | export default classes; 12 | } 13 | 14 | declare module "*.module.scss" { 15 | const classes: { readonly [key: string]: string }; 16 | export default classes; 17 | } 18 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare const __DEV__: boolean; 2 | 3 | declare module "*.vue" { 4 | import type { DefineComponent } from "vue"; 5 | const comp: DefineComponent<{}, {}, any>; 6 | export default comp; 7 | } 8 | 9 | declare module "*.scss" { 10 | const classes: string; 11 | export default classes; 12 | } 13 | 14 | declare module "*.module.scss" { 15 | const classes: { readonly [key: string]: string }; 16 | export default classes; 17 | } 18 | -------------------------------------------------------------------------------- /sample/src/apis/Dictionary/DictConfig.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getPublicState", 4 | url: "/system/dict/data/public_state", 5 | method: "get", 6 | isCatch: true 7 | }, 8 | { 9 | key: "getRoleType", 10 | url: "/system/dict/data/role_type", 11 | method: "get", 12 | isCatch: true 13 | }, 14 | { 15 | key: "getMenuType", 16 | url: "/system/dict/data/menu_type", 17 | method: "get", 18 | isCatch: true 19 | } 20 | ]; 21 | -------------------------------------------------------------------------------- /sample/src/hooks/useTable/index.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | import { PageInfo } from "types/pagination"; 3 | 4 | export const useTable = (): PageInfo => { 5 | const pageSizes = [20, 50, 100, 200]; 6 | const page = ref(1); 7 | const size = ref(pageSizes[0]); 8 | const layout = "total, sizes, prev, pager, next, jumper"; 9 | const total = ref(0); 10 | 11 | return { 12 | pageSizes, 13 | page, 14 | size, 15 | layout, 16 | total 17 | }; 18 | }; 19 | -------------------------------------------------------------------------------- /sample/types/contextMenu.d.ts: -------------------------------------------------------------------------------- 1 | type contextMenuType = 2 | | "redload" 3 | | "closeTag" 4 | | "closeLeftTag" 5 | | "closeRightTag" 6 | | "closeOtherTag" 7 | | "closeAllTag" 8 | | "addTag"; 9 | 10 | type tabMenuMethod = Record; 11 | 12 | export type contextMenuSchema = { 13 | disabled?: boolean; 14 | divided?: boolean; 15 | icon?: string; 16 | label: string; 17 | key: string; 18 | command?: (item: contextMenuSchema) => void; 19 | }; 20 | -------------------------------------------------------------------------------- /sample/build/build.ts: -------------------------------------------------------------------------------- 1 | export const createBuild = (): any => { 2 | return { 3 | minify: "terser", 4 | terserOptions: { 5 | compress: { 6 | drop_console: false, 7 | drop_debugger: true 8 | } 9 | }, 10 | rollupOptions: { 11 | output: { 12 | manualChunks: (id: string[]) => { 13 | if (id.includes("node_modules")) { 14 | return "vendor"; 15 | } 16 | } 17 | } 18 | } 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /sample/src/assets/icon/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | import * as antd from "@vicons/antd"; 3 | import * as carbon from "@vicons/carbon"; 4 | 5 | const withe = ["Label"]; 6 | 7 | export default (app: App) => { 8 | const iconMap = { 9 | ...antd, 10 | ...carbon 11 | }; 12 | 13 | for (let name in iconMap) { 14 | if (withe.includes(name)) { 15 | name = `Icon${name}`; 16 | } 17 | app.component(name, Reflect.get(iconMap, name)); 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /sample/src/pages/EmbedPage/FramePage.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 21 | -------------------------------------------------------------------------------- /sample/src/apis/systemMent/index.ts: -------------------------------------------------------------------------------- 1 | import axios from "api/index"; 2 | 3 | import deptMentConfig from "./deptMent"; 4 | import accountMentConfig from "./accountMent"; 5 | import roleMentConfig from "./roleMent"; 6 | import menuMentConfig from "./menuMent"; 7 | 8 | axios.setConfig("deptMent", deptMentConfig); 9 | axios.setConfig("accountMent", accountMentConfig); 10 | axios.setConfig("roleMent", roleMentConfig); 11 | axios.setConfig("menuMent", menuMentConfig); 12 | 13 | export default axios; 14 | -------------------------------------------------------------------------------- /sample/src/pages/AutomatedTool/OnlineEditor/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 17 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare const __DEV__: boolean; 2 | 3 | declare module "*.vue" { 4 | import { ComponentOptions } from "vue"; 5 | const componentOptions: ComponentOptions; 6 | export default componentOptions; 7 | } 8 | 9 | declare module "*.scss" { 10 | const classes: string; 11 | export default classes; 12 | } 13 | 14 | declare module "*.module.scss" { 15 | const classes: { readonly [key: string]: string }; 16 | export default classes; 17 | } 18 | 19 | declare module "splitpanes"; 20 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/BasicTitle/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /sample/types/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface Fn { 2 | (...arg: T[]): R; 3 | } 4 | 5 | export interface Fun { 6 | (...anr: any[]): any; 7 | } 8 | 9 | export interface ViteEnv { 10 | VITE_URL: string; 11 | VITE_BASE_URL: string; 12 | VITE_ZIP_NAME: string; 13 | } 14 | 15 | export interface ExtendedDocument extends Document { 16 | msExitFullscreen?: any; 17 | mozCancelFullScreen?: any; 18 | msFullscreenElement?: any; 19 | mozFullScreenElement?: any; 20 | webkitFullscreenElement?: any; 21 | } 22 | -------------------------------------------------------------------------------- /sample/mock/_createProductionServer.ts: -------------------------------------------------------------------------------- 1 | import { createProdMockServer } from "vite-plugin-mock/es/createProdMockServer"; 2 | 3 | const modules = import.meta.glob("./**/*.ts", { 4 | import: "default", 5 | eager: true 6 | }); 7 | 8 | const mockModules: any[] = []; 9 | Object.keys(modules).forEach(async (key) => { 10 | if (key.includes("_")) { 11 | return; 12 | } 13 | mockModules.push(...(modules[key] as any)); 14 | }); 15 | 16 | export function setupProdMockServer() { 17 | createProdMockServer(mockModules); 18 | } 19 | -------------------------------------------------------------------------------- /sample/vite.config.ts: -------------------------------------------------------------------------------- 1 | import type { ConfigEnv } from "vite"; 2 | 3 | import { createResolve, createCss } from "./build/other"; 4 | import { createPlugin } from "./build/plugin"; 5 | import { createBuild } from "./build/build"; 6 | import { createServer } from "./build/server"; 7 | 8 | export default (env: ConfigEnv) => { 9 | return { 10 | base: "/", 11 | plugins: createPlugin(env), 12 | css: createCss(), 13 | resolve: createResolve(), 14 | build: createBuild(), 15 | server: createServer() 16 | }; 17 | }; 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": ".", 4 | "sourceMap": false, 5 | "target": "esnext", 6 | "module": "esnext", 7 | "jsx": "preserve", 8 | "moduleResolution": "node", 9 | "strictNullChecks": true, 10 | "noUnusedLocals": false, 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true, 13 | "experimentalDecorators": true, 14 | "allowSyntheticDefaultImports": true, 15 | "baseUrl": ".", 16 | "lib": ["esnext", "dom"], 17 | "types": ["jest", "node"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/src/setting.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | // 系统名称 3 | systemName: "Grow Admin", 4 | // 水印 5 | watermark: true, 6 | // 导航方式 side | roof 7 | layoutType: "side", 8 | // logo地址 9 | logUrl: "logo.png", 10 | // 备案公司 11 | companyName: "*******科技有限公司", 12 | // 备案号 13 | recordNum: "*ICP备*****号", 14 | // 备案年份 15 | recordYear: "2023", 16 | // 前端权限 17 | isFrontAuthority: false, 18 | // 自动锁屏 19 | isAutoLocker: true, 20 | // 自动锁屏时间 21 | lockScreenTime: 15 * 60 * 1000, 22 | // 提醒预警时间 23 | warningTimte: 60 * 1000 24 | }; 25 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-designer", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "author": "ZhQuella (Email:827265905@qq.com)", 7 | "type": "module", 8 | "license": "ISC", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "dependencies": { 15 | "@grow-rock/grow-editor": "workspace:^", 16 | "vuedraggable": "^4.1.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sample/types/menu.d.ts: -------------------------------------------------------------------------------- 1 | type _menuType = "JumpTo" | "ScrollTo"; 2 | 3 | export interface MenuItem { 4 | label: string; 5 | addition: string; 6 | key: string; 7 | type: _menuType; 8 | path: string; 9 | } 10 | 11 | export interface MenuType { 12 | label: string; 13 | name: string; 14 | icon: string; 15 | path: string; 16 | component: string; 17 | hidden?: boolean; 18 | default?: boolean; 19 | children?: MenuType[]; 20 | custom?: boolean; 21 | props?: boolean; 22 | cache?: boolean; 23 | } 24 | 25 | export const menuTypes = _menuType; 26 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/packages/GWorkFlow/components/StencilComponent/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 22 | -------------------------------------------------------------------------------- /sample/src/pages/AutomatedTool/SingleFileComponent/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GDetail/GDetail.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 | -------------------------------------------------------------------------------- /scripts/dev.js: -------------------------------------------------------------------------------- 1 | import { execa } from "execa"; 2 | 3 | async function buildAll() { 4 | execa("pnpm", ["run", "grow-component:dev"], { stdio: "inherit" }); 5 | execa("pnpm", ["run", "grow-designer:dev"], { stdio: "inherit" }); 6 | execa("pnpm", ["run", "grow-editor:dev"], { stdio: "inherit" }); 7 | execa("pnpm", ["run", "grow-flow:dev"], { stdio: "inherit" }); 8 | execa("pnpm", ["run", "grow-single-file:dev"], { stdio: "inherit" }); 9 | execa("pnpm", ["run", "grow-utils:dev"], { stdio: "inherit" }); 10 | await execa("pnpm", ["run", "sample:dev"], { stdio: "inherit" }); 11 | } 12 | 13 | buildAll(); 14 | -------------------------------------------------------------------------------- /sample/src/assets/enums/cacheEnum.ts: -------------------------------------------------------------------------------- 1 | /** 国际化 */ 2 | export const LOCALE_KEY = "LOCALE__"; 3 | /** 主题色 */ 4 | export const THEME_KEY = "THEME__"; 5 | /** 布局 */ 6 | export const LAYOUT_KEY = "LAYOUT__"; 7 | /** 标签当前选中 */ 8 | export const TABS_CURRENT_KEY = "TABS_CURRENT__"; 9 | /** 标签当前选中 */ 10 | export const TABS_LIST_KEY = "TABS_LIST__"; 11 | /** 缓存token */ 12 | export const AUTHORITY_TOKEN = "AUTHORITY_TOKEN__"; 13 | /** 账号信息 */ 14 | export const ACCOUNT_INFO = "ACCOUNT_INFO__"; 15 | /** 是否锁屏 */ 16 | export const IS_LOCK_SCREEN = "IS_LOCK_SCREEN__"; 17 | /** 破解次数 */ 18 | export const CRACKING_TIMES = "CRACKING_TIMES__"; 19 | -------------------------------------------------------------------------------- /sample/src/plugins/public.components.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | import { 3 | GDetail, 4 | GDetailItem, 5 | GDialog, 6 | GSplitPane, 7 | GOverFlowList 8 | } from "@grow-rock/grow-component"; 9 | import PageLayout from "components/public/PageLayout/index.vue"; 10 | 11 | export default (app: App) => { 12 | app.component(PageLayout.name, PageLayout); 13 | app.component(GDialog.name, GDialog); 14 | app.component(GDetail.name, GDetail); 15 | app.component(GDetailItem.name, GDetailItem); 16 | app.component(GSplitPane.name, GSplitPane); 17 | app.component(GOverFlowList.name, GOverFlowList); 18 | }; 19 | -------------------------------------------------------------------------------- /sample/src/routers/pages/ListPage.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | label: "列表页面", 4 | name: "ListPage", 5 | icon: "UnorderedListOutlined", 6 | children: [ 7 | { 8 | label: "普通列表", 9 | name: "ElBaseList", 10 | icon: "ListNumbered", 11 | path: "el-base-list", 12 | component: "ListPage/ElBaseList/index.vue" 13 | }, 14 | { 15 | label: "虚拟列表", 16 | name: "ElVirtualList", 17 | icon: "ListDropdown", 18 | path: "el-virtual-list", 19 | component: "ListPage/ElVirtualList/index.vue" 20 | } 21 | ] 22 | } 23 | ]; 24 | -------------------------------------------------------------------------------- /sample/src/stores/modules/systemInfo.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | 3 | export const useSystemStore = defineStore({ 4 | id: "systemInfo", 5 | state: () => ({ 6 | userInfo: {}, 7 | roleSings: [] 8 | }), 9 | getters: { 10 | getUserInfo(): any { 11 | return this.userInfo; 12 | }, 13 | getRoleSings(): string[] { 14 | return this.roleSings; 15 | } 16 | }, 17 | actions: { 18 | setUserInfo(userInfo: any) { 19 | this.userInfo = userInfo; 20 | }, 21 | setRoleSings(roleSings: string[]) { 22 | this.roleSings = roleSings; 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/types/Request.d.ts: -------------------------------------------------------------------------------- 1 | import type { AxiosRequestConfig, AxiosResponse, AxiosError, Method } from "axios"; 2 | 3 | export interface Intercept { 4 | requestIntercept?: (config: AxiosRequestConfig) => AxiosRequestConfig; 5 | requestError?: (error: AxiosError) => AxiosError; 6 | responseIntercept?: (config: AxiosResponse) => AxiosResponse; 7 | responseError?: (error: AxiosError) => AxiosError; 8 | } 9 | 10 | export interface RequestItem extends AxiosRequestConfig { 11 | key?: string; 12 | url?: string; 13 | method?: Method; 14 | data?: any; 15 | query?: any; 16 | params?: any; 17 | onlyIn?: boolean; 18 | } 19 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-utils", 3 | "version": "1.0.0", 4 | "private": true, 5 | "author": "ZhQuella (Email:827265905@qq.com)", 6 | "type": "module", 7 | "license": "ISC", 8 | "description": "", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "keywords": [], 15 | "devDependencies": { 16 | "rollup-plugin-copy": "^3.4.0" 17 | }, 18 | "dependencies": { 19 | "exceljs": "^4.3.0", 20 | "resize-observer-polyfill": "^1.5.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sample/src/plugins/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | 3 | import "plugin/style.plugin"; 4 | 5 | import scriptPlugin from "plugin/script.plugin"; 6 | import publicComponents from "plugin/public.components"; 7 | import language from "language/index"; 8 | import enrollIcon from "@/assets/icon"; 9 | 10 | const styleConflict = () => { 11 | const meta = document.createElement("meta"); 12 | meta.name = "naive-ui-style"; 13 | document.head.appendChild(meta); 14 | }; 15 | 16 | export default (app: App) => { 17 | styleConflict(); 18 | scriptPlugin(app); 19 | publicComponents(app); 20 | language(app); 21 | enrollIcon(app); 22 | }; 23 | -------------------------------------------------------------------------------- /sample/src/plugins/style.plugin.ts: -------------------------------------------------------------------------------- 1 | import "style/tailwindcss/index.scss"; 2 | import "@grow-rock/grow-component/dist/index.css"; 3 | import "@grow-rock/grow-designer/dist/index.css"; 4 | import "@grow-rock/grow-flow/dist/index.css"; 5 | import "@grow-rock/grow-editor/dist/index.css"; 6 | import "@grow-rock/grow-single-file/dist/index.css"; 7 | import "animate.css"; 8 | import "hover.css"; 9 | import "nprogress/nprogress.css"; 10 | import "style/public/resetUI.scss"; 11 | import "element-plus/dist/index.css"; 12 | import "element-plus/theme-chalk/dark/css-vars.css"; 13 | import "v3-tour/dist/vue-tour.css"; 14 | import "splitpanes/dist/splitpanes.css"; 15 | -------------------------------------------------------------------------------- /sample/src/routers/pages/dashboard.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | label: "Dashboard", 4 | name: "dashboard", 5 | icon: "AreaCustom", 6 | children: [ 7 | { 8 | label: "分析页面", 9 | name: "analysis", 10 | icon: "Bot", 11 | path: "analysis", 12 | component: "Dashboard/analysis/index.vue" 13 | }, 14 | { 15 | label: "工作台", 16 | name: "workbench", 17 | icon: "Carbon3DMprToggle", 18 | path: "workbench", 19 | component: "Dashboard/workbench/index.vue", 20 | hidden: true, 21 | default: true 22 | } 23 | ] 24 | } 25 | ]; 26 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/use/useLoginSuccess.ts: -------------------------------------------------------------------------------- 1 | import { AUTHORITY_TOKEN } from "@/assets/enums/cacheEnum"; 2 | import { createStorage } from "@grow-rock/grow-utils"; 3 | import { useRouter } from "vue-router"; 4 | 5 | export const useLoginSuccess = () => { 6 | const storage = createStorage({ prefixKey: "", storage: sessionStorage }); 7 | const router = useRouter(); 8 | 9 | const loginSuccess = (result: any) => { 10 | const { token } = result as { token: string }; 11 | storage.set(AUTHORITY_TOKEN, token); 12 | router.push({ 13 | name: "Home" 14 | }); 15 | }; 16 | 17 | return { 18 | loginSuccess 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /sample/src/pages/Redirect/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 21 | 22 | 28 | -------------------------------------------------------------------------------- /scripts/build.js: -------------------------------------------------------------------------------- 1 | import { execa } from "execa"; 2 | 3 | async function buildAll() { 4 | await execa("pnpm", ["run", "grow-component:build"], { stdio: "inherit" }); 5 | await execa("pnpm", ["run", "grow-designer:build"], { stdio: "inherit" }); 6 | await execa("pnpm", ["run", "grow-editor:build"], { stdio: "inherit" }); 7 | await execa("pnpm", ["run", "grow-flow:build"], { stdio: "inherit" }); 8 | await execa("pnpm", ["run", "grow-single-file:build"], { stdio: "inherit" }); 9 | await execa("pnpm", ["run", "grow-utils:build"], { stdio: "inherit" }); 10 | await execa("pnpm", ["run", "sample:build"], { stdio: "inherit" }); 11 | } 12 | 13 | buildAll(); 14 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleRenderView/GSingleRenderView.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 24 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/use/useDict.ts: -------------------------------------------------------------------------------- 1 | import { onMounted, reactive, toRefs, computed } from "vue"; 2 | import axios from "api/Dictionary"; 3 | 4 | export const useDict = () => { 5 | const dictMethods = axios.create("dicts", ["getPublicState"]); 6 | const state: any = reactive({ 7 | accountStates: [] 8 | }); 9 | 10 | const getAccountState = async () => { 11 | const { dictList } = await dictMethods.getPublicState(); 12 | state.accountStates = dictList; 13 | }; 14 | 15 | const dictMap = computed(() => state); 16 | 17 | onMounted(() => { 18 | getAccountState(); 19 | }); 20 | 21 | return { 22 | ...toRefs(dictMap.value) 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-single-file", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "author": "ZhQuella (Email:827265905@qq.com)", 7 | "type": "module", 8 | "license": "ISC", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "dependencies": { 15 | "vue": "^3.3.0", 16 | "@vicons/carbon": "^0.12.0", 17 | "@grow-rock/grow-component": "workspace:*", 18 | "@grow-rock/grow-editor": "workspace:*", 19 | "vue-sfc-component": "^0.0.12" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sample/src/stores/modules/theme.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { THEME_KEY } from "@/assets/enums/cacheEnum"; 3 | import { storageExample } from "@grow-rock/grow-utils"; 4 | import type { ThemeState, themeType } from "types/theme"; 5 | 6 | export const useThemeStore = defineStore({ 7 | id: "theme", 8 | state: (): ThemeState => ({ 9 | theme: storageExample.get(THEME_KEY, "light") 10 | }), 11 | getters: { 12 | getTheme(): themeType { 13 | return this.theme ?? "light"; 14 | } 15 | }, 16 | actions: { 17 | setTheme(theme: themeType) { 18 | this.theme = theme; 19 | storageExample.set(THEME_KEY, theme); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { App } from "vue"; 2 | import { version } from "../package.json"; 3 | declare const GrowConponent: { 4 | version: string; 5 | install: (app: App) => void; 6 | GButton: import("vue").DefineComponent< 7 | {}, 8 | {}, 9 | {}, 10 | {}, 11 | {}, 12 | import("vue").ComponentOptionsMixin, 13 | import("vue").ComponentOptionsMixin, 14 | {}, 15 | string, 16 | import("vue").VNodeProps & 17 | import("vue").AllowedComponentProps & 18 | import("vue").ComponentCustomProps, 19 | Readonly>, 20 | {} 21 | >; 22 | }; 23 | export { version }; 24 | export default GrowConponent; 25 | -------------------------------------------------------------------------------- /sample/src/assets/enums/breakpointEnum.ts: -------------------------------------------------------------------------------- 1 | export enum sizeEnum { 2 | XS = "XS", 3 | SM = "SM", 4 | MD = "MD", 5 | LG = "LG", 6 | XL = "XL", 7 | XXL = "XXL" 8 | } 9 | 10 | export enum screenEnum { 11 | XS = 480, 12 | SM = 576, 13 | MD = 768, 14 | LG = 992, 15 | XL = 1200, 16 | XXL = 1600 17 | } 18 | 19 | const screenMap = new Map(); 20 | 21 | screenMap.set(sizeEnum.XS, screenEnum.XS); 22 | screenMap.set(sizeEnum.SM, screenEnum.SM); 23 | screenMap.set(sizeEnum.MD, screenEnum.MD); 24 | screenMap.set(sizeEnum.LG, screenEnum.LG); 25 | screenMap.set(sizeEnum.XL, screenEnum.XL); 26 | screenMap.set(sizeEnum.XXL, screenEnum.XXL); 27 | 28 | export { screenMap }; 29 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-component", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "author": "ZhQuella (Email:827265905@qq.com)", 7 | "type": "module", 8 | "license": "ISC", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "devDependencies": { 15 | "@vicons/antd": "^0.12.0", 16 | "@vicons/carbon": "^0.12.0", 17 | "@vue/compiler-sfc": "^3.2.47" 18 | }, 19 | "dependencies": { 20 | "splitpanes": "^3.1.5", 21 | "@grow-rock/grow-utils": "workspace:*" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/use/useDrawer.ts: -------------------------------------------------------------------------------- 1 | import { ref, nextTick } from "vue"; 2 | 3 | export const useDrawer = () => { 4 | const drawerRef = ref(false); 5 | const importMapRef = ref(); 6 | const catchImportRef = ref({}); 7 | 8 | const onShowImportMap = async () => { 9 | drawerRef.value = true; 10 | await nextTick(); 11 | importMapRef.value.setCode(catchImportRef.value); 12 | }; 13 | 14 | const onImportSubmit = (data) => { 15 | catchImportRef.value = data; 16 | drawerRef.value = false; 17 | }; 18 | 19 | return { 20 | drawerRef, 21 | importMapRef, 22 | catchImportRef, 23 | onImportSubmit, 24 | onShowImportMap 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /sample/src/stores/modules/language.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import type { LanguageState, LanguageType } from "types/language"; 3 | import { LOCALE_KEY } from "@/assets/enums/cacheEnum"; 4 | import { storageExample } from "@grow-rock/grow-utils"; 5 | 6 | export const useLanguageStore = defineStore({ 7 | id: "locale", 8 | state: (): LanguageState => ({ 9 | locale: storageExample.get(LOCALE_KEY, "ch") 10 | }), 11 | getters: { 12 | getLocale(): LanguageType { 13 | return this.locale ?? "ch"; 14 | } 15 | }, 16 | actions: { 17 | setLocale(locale: LanguageType) { 18 | this.locale = locale; 19 | storageExample.set(LOCALE_KEY, locale); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/src/index.ts: -------------------------------------------------------------------------------- 1 | import DownExcel from "./packages/DownExcel"; 2 | import EventEmiter from "./packages//Emit"; 3 | import Storage, { createStorage, storageExample } from "./packages/Storage"; 4 | import { addEventResize, removeResizeListener } from "./packages/ElementResize"; 5 | import Request from "./packages/AxiosFactory"; 6 | import DOMEventManager from "./packages/DOMEventManager"; 7 | 8 | export { 9 | DownExcel, 10 | EventEmiter, 11 | createStorage, 12 | storageExample, 13 | addEventResize, 14 | removeResizeListener, 15 | Request, 16 | DOMEventManager 17 | }; 18 | 19 | export default { 20 | DownExcel, 21 | EventEmiter, 22 | Storage, 23 | Request, 24 | DOMEventManager 25 | }; 26 | -------------------------------------------------------------------------------- /sample/src/components/base/Menu/use/useResizeEle.ts: -------------------------------------------------------------------------------- 1 | import { computed } from "vue"; 2 | import { useMenuStore } from "store/modules/menu"; 3 | import { useLayoutStore } from "store/modules/layout"; 4 | 5 | export const useResizeEle = () => { 6 | const menuStore = useMenuStore(); 7 | const collapsed = computed(() => { 8 | return menuStore.getCollapsed; 9 | }); 10 | 11 | const layoutStore = useLayoutStore(); 12 | const menuMode = computed(() => { 13 | return isRoof.value ? "horizontal" : "vertical"; 14 | }); 15 | 16 | const isRoof = computed(() => { 17 | return layoutStore.layout === "roof"; 18 | }); 19 | 20 | return { 21 | collapsed, 22 | menuMode, 23 | isRoof 24 | }; 25 | }; 26 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": false, 4 | "target": "esnext", 5 | "module": "esnext", 6 | "jsx": "preserve", 7 | "moduleResolution": "node", 8 | "strictNullChecks": true, 9 | "declaration": true, 10 | "noUnusedLocals": true, 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true, 13 | "experimentalDecorators": true, 14 | "allowSyntheticDefaultImports": true, 15 | "rootDir": ".", 16 | "baseUrl": ".", 17 | "lib": ["esnext", "dom"], 18 | "types": ["node"], 19 | "paths": { 20 | "@/*": ["src/*"] 21 | } 22 | }, 23 | "include": ["./shims.d.ts", "src/**/*"], 24 | "exclude": ["node_modules", "dist"] 25 | } 26 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": false, 4 | "target": "esnext", 5 | "module": "esnext", 6 | "jsx": "preserve", 7 | "moduleResolution": "node", 8 | "strictNullChecks": true, 9 | "declaration": true, 10 | "noUnusedLocals": true, 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true, 13 | "experimentalDecorators": true, 14 | "allowSyntheticDefaultImports": true, 15 | "rootDir": ".", 16 | "baseUrl": ".", 17 | "lib": ["esnext", "dom"], 18 | "types": ["node"], 19 | "paths": { 20 | "@/*": ["src/*"] 21 | } 22 | }, 23 | "include": ["./shims.d.ts", "src/**/*"], 24 | "exclude": ["node_modules", "dist"] 25 | } 26 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": false, 4 | "target": "esnext", 5 | "module": "esnext", 6 | "jsx": "preserve", 7 | "moduleResolution": "node", 8 | "strictNullChecks": true, 9 | "declaration": true, 10 | "noUnusedLocals": true, 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true, 13 | "experimentalDecorators": true, 14 | "allowSyntheticDefaultImports": true, 15 | "rootDir": ".", 16 | "baseUrl": ".", 17 | "lib": ["esnext", "dom"], 18 | "types": ["node"], 19 | "paths": { 20 | "@/*": ["src/*"] 21 | } 22 | }, 23 | "include": ["./shims.d.ts", "src/**/*"], 24 | "exclude": ["node_modules", "dist"] 25 | } 26 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "sourceMap": false, 4 | "target": "esnext", 5 | "module": "esnext", 6 | "jsx": "preserve", 7 | "moduleResolution": "node", 8 | "strictNullChecks": true, 9 | "declaration": true, 10 | "noUnusedLocals": true, 11 | "resolveJsonModule": true, 12 | "esModuleInterop": true, 13 | "experimentalDecorators": true, 14 | "allowSyntheticDefaultImports": true, 15 | "rootDir": ".", 16 | "baseUrl": ".", 17 | "lib": ["esnext", "dom"], 18 | "types": ["node"], 19 | "paths": { 20 | "@/*": ["src/*"] 21 | } 22 | }, 23 | "include": ["./shims.d.ts", "src/**/*"], 24 | "exclude": ["node_modules", "dist"] 25 | } 26 | -------------------------------------------------------------------------------- /sample/src/stores/modules/authority.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { GroupBtn } from "types/ButtonGroup"; 3 | 4 | interface AuthorityState { 5 | authorityList: string[]; 6 | } 7 | 8 | export const useAuthorityStore = defineStore({ 9 | id: "authority", 10 | state: (): AuthorityState => ({ 11 | authorityList: [ 12 | "LIST_PAGE:EL_BASE_LIST:VIEW", 13 | "LIST_PAGE:EL_BASE_LIST:DELETE", 14 | "LIST_PAGE:EL_BASE_LIST:REPORT" 15 | ] 16 | }), 17 | getters: { 18 | getAuthorityType(): string[] { 19 | return this.authorityList; 20 | } 21 | }, 22 | actions: { 23 | setAuthority(authorityList: string[]) { 24 | this.authorityList = authorityList; 25 | } 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/configurationComponent/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sample/src/components/business/Index/Describe/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 22 | 23 | 29 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "skipLibCheck": true, 4 | "target": "es2022", 5 | "module": "esnext", 6 | "useDefineForClassFields": true, 7 | "moduleResolution": "Node", 8 | "strict": true, 9 | "jsx": "preserve", 10 | "sourceMap": false, 11 | "noImplicitAny": true, 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | "strictNullChecks": false, 15 | "noEmit": true, 16 | "lib": ["esnext", "dom"], 17 | "types": ["vite/client"], 18 | "baseUrl": ".", 19 | "paths": { 20 | "@/*": ["src/*"] 21 | } 22 | }, 23 | "include": ["src/**/*.ts", "src/**/*.d.ts", "types/**/*.d.ts", "types/**/*.ts"], 24 | "exclude": ["node_modules", "dist", "**/*.js"] 25 | } 26 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/reviewData/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 28 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/static/elementInfo/imageConfig.ts: -------------------------------------------------------------------------------- 1 | 2 | export default { 3 | props: [ 4 | { 5 | eleType: "ElInput", 6 | name: "src", 7 | describe: "图片的路径,用于制定图片的来源地址", 8 | modelKey: "src", 9 | props: { 10 | placeholder: "请输入URL" 11 | } 12 | }, 13 | { 14 | eleType: "ElInput", 15 | name: "alt", 16 | describe: "替代文本,当图片无法家在时显示的文字,提高可访问性", 17 | modelKey: "alt", 18 | props: { 19 | placeholder: "请输入alt" 20 | } 21 | } 22 | ], 23 | styles: { 24 | 25 | }, 26 | events: { 27 | 28 | }, 29 | renderArgument: { 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/draggableView/use/useEvents.ts: -------------------------------------------------------------------------------- 1 | import { Fn } from "types/public"; 2 | 3 | interface props { 4 | emits: Fn; 5 | } 6 | 7 | export const useEvents = ({ emits }: props) => { 8 | const onDraggableAdd = (event) => { 9 | emits("add", event); 10 | }; 11 | 12 | const onSpecialAdd = (event) => { 13 | emits("special", event); 14 | }; 15 | 16 | const onActive = (event) => { 17 | emits("active", event); 18 | }; 19 | 20 | const onDeleteItem = (event) => { 21 | emits("delete", event); 22 | }; 23 | 24 | const onCopyItem = (event) => { 25 | emits("copy", event); 26 | }; 27 | 28 | return { 29 | onDraggableAdd, 30 | onSpecialAdd, 31 | onActive, 32 | onDeleteItem, 33 | onCopyItem 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /sample/src/components/public/IntactTable/use/useInitColumns.ts: -------------------------------------------------------------------------------- 1 | import { watch, reactive, computed } from "vue"; 2 | import { deepCopy } from "util/index"; 3 | 4 | interface props { 5 | columns: any[]; 6 | } 7 | 8 | export const useInitColumns = ({ columns }: props) => { 9 | const state = reactive({ 10 | columns: [] 11 | }); 12 | 13 | watch( 14 | () => columns, 15 | (newValue) => { 16 | state.columns = deepCopy(newValue); 17 | }, 18 | { 19 | immediate: true 20 | } 21 | ); 22 | 23 | const allColumns = computed(() => { 24 | return state.columns.map((el) => { 25 | return { 26 | ...el, 27 | hidden: el.visible === false 28 | }; 29 | }); 30 | }); 31 | 32 | return { 33 | state, 34 | allColumns 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /sample/src/pages/Home/use/useOption.ts: -------------------------------------------------------------------------------- 1 | import { computed } from "vue"; 2 | import { useAppStore } from "store/modules/app"; 3 | 4 | export const useOption = () => { 5 | const appStore = useAppStore(); 6 | 7 | const settingActive = computed({ 8 | get() { 9 | return appStore.settingActive; 10 | }, 11 | set() { 12 | return appStore.setSettingActive(false); 13 | } 14 | }); 15 | 16 | const searchActive = computed({ 17 | get() { 18 | return appStore.searchActive; 19 | }, 20 | set() { 21 | return appStore.setSearchActive(false); 22 | } 23 | }); 24 | 25 | const onAppSearchSelect = () => { 26 | appStore.setSearchActive(false); 27 | }; 28 | 29 | return { 30 | settingActive, 31 | searchActive, 32 | onAppSearchSelect 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/QrCodeLogin/index.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | 25 | 31 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | import { defaultTemplate } from "../../../static/tempalteStr"; 3 | 4 | export const useEvent = ({ codeOptions, tabsActive, codemirrorRef }) => { 5 | const dialogVisible = ref(false); 6 | 7 | const onHandleTabsAdd = () => { 8 | dialogVisible.value = true; 9 | }; 10 | 11 | const onSubmit = ({ fileName }) => { 12 | codeOptions.value.files[fileName] = defaultTemplate; 13 | tabsActive.value = fileName; 14 | codemirrorRef.value.setDoc(codeOptions.value.files[fileName]); 15 | onClose(); 16 | }; 17 | 18 | const onClose = () => { 19 | dialogVisible.value = false; 20 | }; 21 | 22 | return { 23 | onHandleTabsAdd, 24 | dialogVisible, 25 | onSubmit, 26 | onClose 27 | }; 28 | }; 29 | -------------------------------------------------------------------------------- /sample/src/stores/modules/layout.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { LAYOUT_KEY } from "@/assets/enums/cacheEnum"; 3 | import { storageExample } from "@grow-rock/grow-utils"; 4 | import type { LayoutState, LayoutTypes } from "types/layout"; 5 | import setting from "@/setting"; 6 | 7 | const defaultValue = setting.layoutType; 8 | 9 | export const useLayoutStore = defineStore({ 10 | id: "layout", 11 | state: (): LayoutState => ({ 12 | layout: storageExample.get(LAYOUT_KEY, defaultValue) 13 | }), 14 | getters: { 15 | getLayoutType(): LayoutTypes { 16 | return (this.layout ?? defaultValue) as LayoutTypes; 17 | } 18 | }, 19 | actions: { 20 | setLayout(layout: LayoutTypes) { 21 | this.layout = layout; 22 | storageExample.set(LAYOUT_KEY, layout); 23 | } 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /sample/src/language/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | import type { I18n } from "vue-i18n"; 3 | import { createI18n } from "vue-i18n"; 4 | import ElementPlus from "element-plus"; 5 | import elzhCn from "element-plus/dist/locale/zh-cn.mjs"; 6 | import elEn from "element-plus/dist/locale/en.mjs"; 7 | 8 | import { LOCALE_KEY } from "@/assets/enums/cacheEnum"; 9 | import { storageExample } from "@grow-rock/grow-utils"; 10 | 11 | import ch from "./ch"; 12 | import en from "./en"; 13 | 14 | const i18n: I18n = createI18n({ 15 | locale: storageExample.get(LOCALE_KEY, "ch"), 16 | legacy: false, 17 | messages: { ch, en } 18 | }); 19 | 20 | export default (app: App) => { 21 | app.use(i18n); 22 | app.use(ElementPlus, { 23 | locale: elzhCn 24 | }); 25 | app.use(ElementPlus, { 26 | locale: elEn 27 | }); 28 | }; 29 | 30 | export { i18n }; 31 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/index.ts: -------------------------------------------------------------------------------- 1 | import { App, Component } from "vue"; 2 | import { version } from "../package.json"; 3 | import { GWorkFlow } from "./packages/GWorkFlow"; 4 | 5 | import "animate.css"; 6 | import "./styles/tailwindcss/index.css"; 7 | import "./styles/animate/index.css"; 8 | 9 | const components: Component[] = [GWorkFlow]; 10 | 11 | const install = (app: App) => { 12 | const useComponent = (component: Component) => { 13 | if (component.name) { 14 | app.component(component.name, component); 15 | } else { 16 | throw "component need name"; 17 | } 18 | }; 19 | components.forEach((component: Component) => { 20 | useComponent(component); 21 | }); 22 | }; 23 | 24 | const GrowConponent = { 25 | version, 26 | install, 27 | GWorkFlow 28 | }; 29 | 30 | export { version, GWorkFlow }; 31 | 32 | export default GrowConponent; 33 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-flow", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "author": "ZhQuella (Email:827265905@qq.com)", 7 | "type": "module", 8 | "license": "ISC", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "dependencies": { 15 | "@antv/x6": "^2.18.1", 16 | "@antv/x6-plugin-clipboard": "^2.1.6", 17 | "@antv/x6-plugin-export": "^2.1.6", 18 | "@antv/x6-plugin-history": "^2.2.4", 19 | "@antv/x6-plugin-keyboard": "^2.2.3", 20 | "@antv/x6-plugin-selection": "^2.2.2", 21 | "@antv/x6-plugin-snapline": "^2.1.7", 22 | "@antv/x6-plugin-stencil": "^2.1.5", 23 | "@antv/x6-plugin-transform": "^2.1.8" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/use/useDict.ts: -------------------------------------------------------------------------------- 1 | import { onMounted, reactive, toRefs, computed } from "vue"; 2 | import axios from "api/Dictionary"; 3 | 4 | export const useDict = () => { 5 | const dictMethods = axios.create("dicts", ["getPublicState", "getRoleType"]); 6 | const state: any = reactive({ 7 | roleStates: [], 8 | roleTypes: [] 9 | }); 10 | 11 | const getRoleState = async () => { 12 | const { dictList } = await dictMethods.getPublicState(); 13 | state.roleStates = dictList; 14 | }; 15 | 16 | const getRoleType = async () => { 17 | const { dictList } = await dictMethods.getRoleType(); 18 | state.roleTypes = dictList; 19 | }; 20 | 21 | const dictMap = computed(() => state); 22 | 23 | onMounted(() => { 24 | getRoleState(); 25 | getRoleType(); 26 | }); 27 | 28 | return { 29 | ...toRefs(dictMap.value) 30 | }; 31 | }; 32 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/index.ts: -------------------------------------------------------------------------------- 1 | import { App, Component } from "vue"; 2 | import { version } from "../package.json"; 3 | 4 | import { GCodemirror } from "./packages/Codemirror"; 5 | 6 | import "animate.css"; 7 | import "./styles/tailwindcss/index.css"; 8 | import "./styles/animate/index.css"; 9 | 10 | const components: Component[] = [GCodemirror]; 11 | 12 | const install = (app: App) => { 13 | const useComponent = (component: Component) => { 14 | if (component.name) { 15 | app.component(component.name, component); 16 | } else { 17 | throw "component need name"; 18 | } 19 | }; 20 | components.forEach((component: Component) => { 21 | useComponent(component); 22 | }); 23 | }; 24 | 25 | const GrowConponent = { 26 | version, 27 | install, 28 | GCodemirror 29 | }; 30 | 31 | export { version, GCodemirror }; 32 | 33 | export default GrowConponent; 34 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/component/infoRole/use/useBasic.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from "vue"; 2 | import type { RolePersonItem } from "../../../types/index"; 3 | import { ref } from "vue"; 4 | import roleAxios from "api/systemMent"; 5 | 6 | interface roleMethod { 7 | getRoleInfo: Fn; 8 | } 9 | 10 | export const useBasic = () => { 11 | const roleRequest: roleMethod = roleAxios.create("roleMent", ["getRoleInfo"]); 12 | 13 | const roleInfo: Ref = ref({ 14 | id: "", 15 | account: "", 16 | personName: "", 17 | roles: [], 18 | department: "", 19 | boundDate: "", 20 | operator: "" 21 | }); 22 | 23 | const getRoleInfo = async (id: string) => { 24 | const { data } = await roleRequest.getRoleInfo({ params: { id } }); 25 | roleInfo.value = data; 26 | }; 27 | 28 | return { 29 | roleInfo, 30 | getRoleInfo 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/static/dict.ts: -------------------------------------------------------------------------------- 1 | import { javascript } from "@codemirror/lang-javascript"; 2 | import { vue } from "@codemirror/lang-vue"; 3 | import { css } from "@codemirror/lang-css"; 4 | import { json } from "@codemirror/lang-json"; 5 | import { html } from "@codemirror/lang-html"; 6 | import { sql } from "@codemirror/lang-sql"; 7 | 8 | export const selectMap = [ 9 | { 10 | label: "JavaScript", 11 | value: "javascript", 12 | method: javascript 13 | }, 14 | { 15 | label: "Css", 16 | value: "css", 17 | method: css 18 | }, 19 | { 20 | label: "Vue", 21 | value: "vue", 22 | method: vue 23 | }, 24 | { 25 | label: "HTML", 26 | value: "html", 27 | method: html 28 | }, 29 | { 30 | label: "SQL", 31 | value: "sql", 32 | method: sql 33 | }, 34 | { 35 | label: "Json", 36 | value: "json", 37 | method: json 38 | } 39 | ]; 40 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/pageOptions/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 28 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/components/base/GLogo/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 30 | 31 | 37 | -------------------------------------------------------------------------------- /sample/src/pages/Child1/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 32 | 33 | 39 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]], 3 | "plugins": [ 4 | "syntax-dynamic-import", 5 | ["@vue/babel-plugin-jsx"], 6 | "@babel/plugin-proposal-optional-chaining", 7 | "@babel/plugin-proposal-nullish-coalescing-operator" 8 | ], 9 | "env": { 10 | "utils": { 11 | "presets": [ 12 | [ 13 | "env", 14 | { 15 | "loose": true, 16 | "modules": "commonjs", 17 | "targets": { 18 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 19 | } 20 | } 21 | ] 22 | ] 23 | }, 24 | "test": { 25 | "plugins": ["istanbul"], 26 | "presets": [["env", { "targets": { "node": "current" } }]] 27 | }, 28 | "esm": { 29 | "presets": [["@babel/preset-env", { "modules": false }]] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/pages/System/Menu/use/useTableFunc.ts: -------------------------------------------------------------------------------- 1 | import { computed, reactive } from "vue"; 2 | import createMenu from "pages/System/Menu/components/createMenu.vue"; 3 | 4 | export const useTableFunc = () => { 5 | const dialogConfig = reactive({ 6 | visible: false, 7 | conmponetName: "", 8 | title: "", 9 | data: {} 10 | }); 11 | 12 | const buttonGroup = computed(() => []); 13 | 14 | const optionGroup = computed(() => [ 15 | { 16 | title: "新增", 17 | type: "success", 18 | icon: "Add", 19 | authority: "LIST_PAGE:EL_BASE_LIST:VIEW", 20 | func: (): void => { 21 | dialogConfig.visible = true; 22 | dialogConfig.title = `新增菜单`; 23 | dialogConfig.conmponetName = "createMenu"; 24 | dialogConfig.data = {}; 25 | } 26 | } 27 | ]); 28 | 29 | return { 30 | dialogConfig, 31 | buttonGroup, 32 | optionGroup 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /sample/src/pages/Feat/OverflowList/index.vue: -------------------------------------------------------------------------------- 1 | 20 | 26 | 27 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@grow-rock/grow-editor", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "author": "ZhQuella (Email:827265905@qq.com)", 7 | "type": "module", 8 | "license": "ISC", 9 | "main": "./src/index.ts", 10 | "scripts": { 11 | "build": "rollup -c --environment NODE_ENV:production", 12 | "dev": "rollup -c -w --environment NODE_ENV:development" 13 | }, 14 | "dependencies": { 15 | "@codemirror/commands": "^6.5.0", 16 | "@codemirror/lang-css": "^6.2.1", 17 | "@codemirror/lang-html": "^6.4.9", 18 | "@codemirror/lang-javascript": "^6.2.2", 19 | "@codemirror/lang-json": "^6.0.1", 20 | "@codemirror/lang-sql": "^6.6.4", 21 | "@codemirror/lang-vue": "^0.1.3", 22 | "@codemirror/state": "^6.4.1", 23 | "@codemirror/theme-one-dark": "^6.1.2", 24 | "@codemirror/view": "^6.26.3", 25 | "codemirror": "^6.0.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/packages/Codemirror/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | export const useEvent = ({ editorView, codeEditor, resetEditor, editorValue, emit }) => { 2 | const onModelChange = (value) => { 3 | codeEditor.value.innerHTML = ""; 4 | resetEditor(codeEditor.value, value.method); 5 | emit("lang-change", value); 6 | }; 7 | 8 | const onCleanEditor = () => { 9 | codeEditor.value.innerHTML = ""; 10 | resetEditor(codeEditor.value, editorValue.value.method); 11 | }; 12 | 13 | const toJSON = () => { 14 | return editorView.value.state.toJSON(); 15 | }; 16 | 17 | const setDoc = (doc, isRunChange = false) => { 18 | codeEditor.value.innerHTML = ""; 19 | resetEditor(codeEditor.value, editorValue.value.method, doc); 20 | isRunChange && emit("change", editorView.value.state.toJSON()); 21 | }; 22 | 23 | return { 24 | onCleanEditor, 25 | onModelChange, 26 | toJSON, 27 | setDoc 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/types/index.d.ts: -------------------------------------------------------------------------------- 1 | type stateType = "0" | "1"; 2 | 3 | interface Belong { 4 | department: string; 5 | person: string; 6 | post: string; 7 | } 8 | 9 | export interface AccountItem { 10 | account: string; 11 | belong: Belong; 12 | createDate: string; 13 | createType: string; 14 | id: string; 15 | roleNames: string[]; 16 | state: stateType; 17 | } 18 | 19 | export interface AccontForm { 20 | account: string; 21 | password: string; 22 | personnel: string; 23 | state: stateType; 24 | } 25 | 26 | type historyType = "1" | "2" | "3" | "4" | "5" | "6" | "7"; 27 | 28 | export interface HistoryItem { 29 | date: string; 30 | operator: string; 31 | remark: string; 32 | tagInfo: string; 33 | type: historyType; 34 | } 35 | 36 | export interface RecordItem { 37 | date: string; 38 | loginResult: string; 39 | loginType: string; 40 | personnel: string; 41 | errorMessage?: string; 42 | } 43 | -------------------------------------------------------------------------------- /sample/src/routers/pages/ExternalPage.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | label: "外部页面", 4 | name: "ExternalPage", 5 | icon: "UvIndexAlt", 6 | children: [ 7 | { 8 | label: "组件文档(内嵌)", 9 | name: "elementPlusDoc", 10 | icon: "RadioCombat", 11 | path: "element-plus-doc", 12 | component: "EmbedPage/index.vue", 13 | iframeSrc: "https://element-plus.org/zh-CN/", 14 | custom: true 15 | }, 16 | { 17 | label: "框架文档(内嵌)", 18 | name: "GrowAdminDoc", 19 | icon: "RadioCombat", 20 | path: "grow-admin-doc", 21 | component: "EmbedPage/index.vue", 22 | iframeSrc: "https://gadmin.top", 23 | custom: true 24 | }, 25 | { 26 | label: "组件文档(外链)", 27 | name: "ComponentDocument", 28 | icon: "ComposerEdit", 29 | path: "https://element-plus.gitee.io/zh-CN/" 30 | } 31 | ] 32 | } 33 | ]; 34 | -------------------------------------------------------------------------------- /sample/src/hooks/useGrow/index.ts: -------------------------------------------------------------------------------- 1 | import type { MenuType } from "types/menu"; 2 | import { h, Component, unref, ComputedRef, getCurrentInstance } from "vue"; 3 | import { ElIcon } from "element-plus"; 4 | import { computed } from "vue"; 5 | import { sizeEnum, screenEnum } from "@/assets/enums/breakpointEnum"; 6 | 7 | let globalScreenRef: ComputedRef; 8 | let globalWidthRef: ComputedRef; 9 | let globalRealWidthRef: ComputedRef; 10 | 11 | export const useNaiveUI = () => { 12 | const renderIcon = (icon: Component) => { 13 | return () => h(ElIcon, null, { default: () => h(icon) }); 14 | }; 15 | 16 | const useBreakpoint = () => { 17 | return { 18 | screenRef: computed(() => unref(globalScreenRef)), 19 | widthRef: globalWidthRef, 20 | screenEnum, 21 | realWidthRef: globalRealWidthRef 22 | }; 23 | }; 24 | 25 | return { 26 | renderIcon, 27 | useBreakpoint 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /sample/src/components/base/Tabs/use/useSortTabs.ts: -------------------------------------------------------------------------------- 1 | import { onMounted } from "vue"; 2 | import { useMultipleTab } from "store/modules/multipleTab"; 3 | import Sortable from "sortablejs"; 4 | 5 | export const useSortTabs = () => { 6 | const tabsViewStore = useMultipleTab(); 7 | 8 | const addDrag = () => { 9 | const wrap = document.querySelector(".syetem-tabs-warp .el-tabs__nav"); 10 | new Sortable(wrap, { 11 | animation: 350, 12 | filter: ".el-tabs__active-bar", 13 | onEnd(event: any) { 14 | const { newIndex, oldIndex } = event; 15 | const { visitedViews } = tabsViewStore; 16 | const _visitedViews = [...visitedViews]; 17 | const currRow = _visitedViews.splice(oldIndex - 1, 1)[0]; 18 | _visitedViews.splice(newIndex - 1, 0, currRow); 19 | tabsViewStore.saveVisitedViews(_visitedViews); 20 | } 21 | }); 22 | }; 23 | 24 | onMounted(() => { 25 | addDrag(); 26 | }); 27 | }; 28 | -------------------------------------------------------------------------------- /sample/src/pages/EmbedPage/index.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 25 | 26 | 32 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountHistory/use/useInit.ts: -------------------------------------------------------------------------------- 1 | import { ref, onMounted } from "vue"; 2 | import { ElMessage } from "element-plus"; 3 | import to from "await-to-js"; 4 | import axios from "api/systemMent"; 5 | 6 | interface prop { 7 | id: string; 8 | emit: Fn; 9 | } 10 | 11 | export const useInit = ({ id, emit }: prop) => { 12 | const accountMethod = axios.create("accountMent"); 13 | const historyList = ref([]); 14 | 15 | const getAccountHistoryList = async () => { 16 | const [error, { historyList: result }]: any[] = await to( 17 | accountMethod.accountHistory({ params: { id } }) 18 | ); 19 | if (error) { 20 | const { message } = error; 21 | ElMessage.error(message); 22 | emit("close"); 23 | return; 24 | } 25 | historyList.value = result; 26 | }; 27 | 28 | onMounted(() => { 29 | getAccountHistoryList(); 30 | }); 31 | 32 | return { 33 | historyList 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /sample/src/stores/modules/LockScreen.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { storageExample } from "@grow-rock/grow-utils"; 3 | import { IS_LOCK_SCREEN, CRACKING_TIMES } from "@/assets/enums/cacheEnum"; 4 | 5 | export const useLockScreen = defineStore({ 6 | id: "LockScreen", 7 | state: () => ({ 8 | isLockScreen: storageExample.get(IS_LOCK_SCREEN, false), 9 | crackingTimes: storageExample.get(CRACKING_TIMES, 0) 10 | }), 11 | getters: { 12 | getLocale(): boolean { 13 | return this.isLockScreen; 14 | }, 15 | getCrackingTimes(): number { 16 | return this.crackingTimes; 17 | } 18 | }, 19 | actions: { 20 | setIsLockScreen(value: boolean): void { 21 | this.isLockScreen = value; 22 | storageExample.set(IS_LOCK_SCREEN, value); 23 | }, 24 | setCrackingTimes(value: number): void { 25 | this.crackingTimes = value; 26 | storageExample.set(CRACKING_TIMES, value); 27 | } 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /sample/src/components/public/RenderView/index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 25 | 35 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountUseRecord/use/useInit.ts: -------------------------------------------------------------------------------- 1 | import { ref, onMounted } from "vue"; 2 | import { ElMessage } from "element-plus"; 3 | import to from "await-to-js"; 4 | import axios from "api/systemMent"; 5 | 6 | interface prop { 7 | id: string; 8 | emit: Fn; 9 | } 10 | 11 | export const useInit = ({ id, emit }: prop) => { 12 | const accountMethod = axios.create("accountMent"); 13 | const usedRecordList = ref([]); 14 | 15 | const getAccountUsedRecordList = async () => { 16 | const [error, { recordList }]: any[] = await to( 17 | accountMethod.usedRecordList({ params: { id } }) 18 | ); 19 | if (error) { 20 | const { message } = error; 21 | ElMessage.error(message); 22 | emit("close"); 23 | return; 24 | } 25 | usedRecordList.value = recordList; 26 | }; 27 | 28 | onMounted(() => { 29 | getAccountUsedRecordList(); 30 | }); 31 | 32 | return { 33 | usedRecordList 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/abstractionComponent/component/basicComponent/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 30 | 31 | 40 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountHistory/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 34 | 35 | 41 | -------------------------------------------------------------------------------- /sample/src/styles/tailwindcss/index.scss: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | @layer base { 6 | .theme-public { 7 | --public-main-color: 64, 158, 255; 8 | --public-main-dark-color: 51, 126, 204; 9 | } 10 | .theme-light { 11 | --bg-color: 250, 250, 252; 12 | --bg-color2: 245, 245, 246; 13 | --bg-color3: 255, 255, 255; 14 | --bg-card: 255, 255, 255; 15 | --main-text: 51, 51, 51; 16 | --text-light-1: 69, 68, 74; 17 | --text-light-2: 140, 140, 140; 18 | --border-color: 220, 223, 230; 19 | --border-color2: 238, 238, 238; 20 | } 21 | .theme-dark { 22 | --bg-color: 17, 24, 39; 23 | --bg-color2: 22, 31, 50; 24 | --bg-color3: 33, 33, 33; 25 | --bg-card: 21, 21, 21; 26 | --main-text: 217, 230, 235; 27 | --text-light-1: 217, 230, 235; 28 | --text-light-2: 196, 221, 230; 29 | --border-color: 76, 77, 79; 30 | --border-color2: 48, 48, 48; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "skipLibCheck": true, 4 | "target": "esnext", 5 | "module": "esnext", 6 | "useDefineForClassFields": true, 7 | "moduleResolution": "node", 8 | "strict": false, 9 | "jsx": "preserve", 10 | "sourceMap": false, 11 | "noImplicitAny": false, 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | "strictNullChecks": false, 15 | "noEmit": true, 16 | "lib": ["esnext", "dom"], 17 | "types": ["vite/client"], 18 | "baseUrl": ".", 19 | "paths": { 20 | "@/*": ["src/*"], 21 | "types/*": ["types/*"] 22 | } 23 | }, 24 | "include": [ 25 | "src/**/*.ts", 26 | "src/**/*.d.ts", 27 | "src/**/*.tsx", 28 | "src/**/*.vue", 29 | "types/**/*.d.ts", 30 | "types/**/*.ts", 31 | "build/**/*.ts", 32 | "build/**/*.d.ts", 33 | "tests/**/*.ts", 34 | "tests/**/*.d.ts" 35 | ], 36 | "exclude": ["node_modules", "dist", "**/*.js"] 37 | } 38 | -------------------------------------------------------------------------------- /GrowRock/GrowEditor/src/styles/tailwindcss/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | @layer base { 6 | .theme-public { 7 | --public-main-color: 64, 158, 255; 8 | --public-main-dark-color: 51, 126, 204; 9 | } 10 | .theme-light { 11 | --bg-color: 250, 250, 252; 12 | --bg-color2: 245, 245, 246; 13 | --bg-color3: 255, 255, 255; 14 | --bg-card: 255, 255, 255; 15 | --main-text: 51, 51, 51; 16 | --text-light-1: 69, 68, 74; 17 | --text-light-2: 140, 140, 140; 18 | --border-color: 220, 223, 230; 19 | --border-color2: 238, 238, 238; 20 | } 21 | .theme-dark { 22 | --bg-color: 17, 24, 39; 23 | --bg-color2: 22, 31, 50; 24 | --bg-color3: 33, 33, 33; 25 | --bg-card: 21, 21, 21; 26 | --main-text: 217, 230, 235; 27 | --text-light-1: 217, 230, 235; 28 | --text-light-2: 196, 221, 230; 29 | --border-color: 76, 77, 79; 30 | --border-color2: 48, 48, 48; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/styles/tailwindcss/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | @layer base { 6 | .theme-public { 7 | --public-main-color: 64, 158, 255; 8 | --public-main-dark-color: 51, 126, 204; 9 | } 10 | .theme-light { 11 | --bg-color: 250, 250, 252; 12 | --bg-color2: 245, 245, 246; 13 | --bg-color3: 255, 255, 255; 14 | --bg-card: 255, 255, 255; 15 | --main-text: 51, 51, 51; 16 | --text-light-1: 69, 68, 74; 17 | --text-light-2: 140, 140, 140; 18 | --border-color: 220, 223, 230; 19 | --border-color2: 238, 238, 238; 20 | } 21 | .theme-dark { 22 | --bg-color: 17, 24, 39; 23 | --bg-color2: 22, 31, 50; 24 | --bg-color3: 33, 33, 33; 25 | --bg-card: 21, 21, 21; 26 | --main-text: 217, 230, 235; 27 | --text-light-1: 217, 230, 235; 28 | --text-light-2: 196, 221, 230; 29 | --border-color: 76, 77, 79; 30 | --border-color2: 48, 48, 48; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/apis/systemMent/roleMent.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getRoleList", 4 | url: "/role/list/{page}/{size}", 5 | method: "post" 6 | }, 7 | { 8 | key: "createRole", 9 | url: "/role/info", 10 | method: "post" 11 | }, 12 | { 13 | key: "getRoleInfo", 14 | url: "/role/info/{id}", 15 | method: "get" 16 | }, 17 | { 18 | key: "modifyRoleInfo", 19 | url: "/role/info", 20 | method: "put" 21 | }, 22 | { 23 | key: "deleteRoleIds", 24 | url: "/role/info", 25 | method: "delete" 26 | }, 27 | { 28 | key: "roleChangeState", 29 | url: "/role/seate/{id}", 30 | method: "put" 31 | }, 32 | { 33 | key: "roleUntieAll", 34 | url: `/role/untie/all/{roleId}`, 35 | method: "put" 36 | }, 37 | { 38 | key: "roleBoundPersons", 39 | url: "/role/persons/{roleId}", 40 | method: "get" 41 | }, 42 | { 43 | key: "roleUntieById", 44 | url: "/role/untie/{roleId}", 45 | method: "put" 46 | } 47 | ]; 48 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/styles/tailwindcss/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | @layer base { 6 | .theme-public { 7 | --public-main-color: 64, 158, 255; 8 | --public-main-dark-color: 51, 126, 204; 9 | } 10 | .theme-light { 11 | --bg-color: 250, 250, 252; 12 | --bg-color2: 245, 245, 246; 13 | --bg-color3: 255, 255, 255; 14 | --bg-card: 255, 255, 255; 15 | --main-text: 51, 51, 51; 16 | --text-light-1: 69, 68, 74; 17 | --text-light-2: 140, 140, 140; 18 | --border-color: 220, 223, 230; 19 | --border-color2: 238, 238, 238; 20 | } 21 | .theme-dark { 22 | --bg-color: 17, 24, 39; 23 | --bg-color2: 22, 31, 50; 24 | --bg-color3: 33, 33, 33; 25 | --bg-card: 21, 21, 21; 26 | --main-text: 217, 230, 235; 27 | --text-light-1: 217, 230, 235; 28 | --text-light-2: 196, 221, 230; 29 | --border-color: 76, 77, 79; 30 | --border-color2: 48, 48, 48; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/index.ts: -------------------------------------------------------------------------------- 1 | import { App, Component } from "vue"; 2 | import { version } from "../package.json"; 3 | import { GRenderer } from "./packages/GRenderer"; 4 | import { GDesigner } from "./packages/GDesigner"; 5 | 6 | import "animate.css"; 7 | import "@grow-rock/grow-editor/dist/index.css"; 8 | import "./styles/tailwindcss/index.css"; 9 | import "./styles/animate/index.css"; 10 | 11 | const components: Component[] = [GRenderer, GDesigner]; 12 | 13 | const install = (app: App) => { 14 | const useComponent = (component: Component) => { 15 | if (component.name) { 16 | app.component(component.name, component); 17 | } else { 18 | throw "component need name"; 19 | } 20 | }; 21 | components.forEach((component: Component) => { 22 | useComponent(component); 23 | }); 24 | }; 25 | 26 | const GrowConponent = { 27 | version, 28 | install, 29 | GDesigner, 30 | GRenderer 31 | }; 32 | 33 | export { version, GRenderer, GDesigner }; 34 | 35 | export default GrowConponent; 36 | -------------------------------------------------------------------------------- /sample/src/components/base/AppSearch/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 30 | 31 | 37 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/moduleOptions/use/useInit.ts: -------------------------------------------------------------------------------- 1 | import { Ref } from "vue"; 2 | import { ref, computed, onMounted } from "vue"; 3 | import { AtomicComponent, BaseComponent, BusinessComponent } from "../../../static/moduleMap"; 4 | 5 | export const useInit = () => { 6 | const list: Ref = ref(); 7 | const currentUse = ref({}); 8 | const activeName = ref("BaseComponent"); 9 | const collapseModel: Ref = ref([]); 10 | 11 | const drageMap = computed(() => { 12 | const drageConfig = { 13 | BaseComponent, 14 | AtomicComponent, 15 | BusinessComponent 16 | }; 17 | return drageConfig[activeName.value] || new Map(); 18 | }); 19 | 20 | const onTableChange = () => { 21 | collapseModel.value = [...drageMap.value.keys()]; 22 | }; 23 | 24 | onMounted(() => { 25 | onTableChange(); 26 | }); 27 | 28 | return { 29 | list, 30 | currentUse, 31 | activeName, 32 | drageMap, 33 | collapseModel, 34 | onTableChange 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /sample/src/pages/System/Menu/use/useDict.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from "vue"; 2 | import type { DictItem } from "types/Dict"; 3 | import { ref, onMounted } from "vue"; 4 | import dictAxios from "api/Dictionary"; 5 | 6 | interface DictRequest { 7 | getMenuType: Fn; 8 | getPublicState: Fn; 9 | } 10 | 11 | export const useDict = () => { 12 | const dictRequest = dictAxios.create("dicts", ["getMenuType", "getPublicState"]); 13 | const menuTypeDicts: Ref = ref([]); 14 | const stateList: Ref = ref([]); 15 | 16 | const getMenuType = async () => { 17 | const { dictList = [] } = await dictRequest.getMenuType(); 18 | menuTypeDicts.value = [...dictList]; 19 | }; 20 | 21 | const getStates = async () => { 22 | const { dictList } = await dictRequest.getPublicState(); 23 | stateList.value = [...dictList]; 24 | }; 25 | 26 | onMounted(async () => { 27 | await getMenuType(); 28 | await getStates(); 29 | }); 30 | 31 | return { 32 | menuTypeDicts, 33 | stateList 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /sample/src/components/business/Dashboard/workbench/Dynamic/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 33 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/types/index.d.ts: -------------------------------------------------------------------------------- 1 | import { stateType } from "pages/System/Account/types"; 2 | 3 | type roleState = "0" | "1"; 4 | 5 | export interface RoleItem { 6 | id: string; 7 | roleName: string; 8 | state: roleState; 9 | authorityChart: string; 10 | roleType: string; 11 | roleCode: string; 12 | memberNum: string; 13 | roleMark: string; 14 | createTime: string; 15 | updataTime: string; 16 | } 17 | 18 | export interface RoleForm { 19 | roleName: string; 20 | roleCode: string; 21 | authorityChart: string; 22 | roleType: string; 23 | state: roleState; 24 | roleMark?: string; 25 | id?: string; 26 | } 27 | 28 | export interface OutServiceData { 29 | id: string; 30 | state: stateType; 31 | } 32 | 33 | export interface RolePersonItem { 34 | id: string; 35 | account: string; 36 | personName: string; 37 | roles: string[]; 38 | department: string; 39 | boundDate: string; 40 | operator: string; 41 | } 42 | 43 | export interface UntieRoleData { 44 | personIds: string[]; 45 | roleId: string; 46 | } 47 | -------------------------------------------------------------------------------- /sample/src/components/base/Menu/MenuItem.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 29 | 30 | 38 | -------------------------------------------------------------------------------- /sample/src/stores/modules/app.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | 3 | export const useAppStore = defineStore({ 4 | id: "app", 5 | state: () => ({ 6 | webFullScreen: false, 7 | settingActive: false, 8 | searchActive: false, 9 | isPutAway: false 10 | }), 11 | getters: { 12 | getWebFullScreen(): boolean { 13 | return this.webFullScreen; 14 | }, 15 | getSettingActive(): boolean { 16 | return this.settingActive; 17 | }, 18 | getSearchActive(): boolean { 19 | return this.searchActive; 20 | }, 21 | getIsPutAway(): boolean { 22 | return this.isPutAway; 23 | } 24 | }, 25 | actions: { 26 | setWebFullScreen(isFullScreen: boolean) { 27 | this.webFullScreen = isFullScreen; 28 | }, 29 | setSettingActive(isActive: boolean) { 30 | this.settingActive = isActive; 31 | }, 32 | setSearchActive(isActive: boolean) { 33 | this.searchActive = isActive; 34 | }, 35 | setIsPutAway(isPutAway: boolean) { 36 | this.isPutAway = isPutAway; 37 | } 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountUseRecord/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 36 | 37 | 43 | -------------------------------------------------------------------------------- /sample/src/routers/pages/AutomatedTool.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | label: "自动化工具", 4 | name: "AutomatedTool", 5 | icon: "Calibrate", 6 | children: [ 7 | { 8 | label: "页面设计器", 9 | name: "PageDesigner", 10 | icon: "Departure", 11 | path: "page-designer", 12 | component: "AutomatedTool/PageDesigner/index.vue" 13 | }, 14 | { 15 | label: "流程引擎", 16 | name: "ProcessEngine", 17 | icon: "FlowModeler", 18 | path: "process-engine", 19 | component: "AutomatedTool/ProcessEngine/index.vue" 20 | }, 21 | { 22 | label: "在线编辑器", 23 | name: "OnlineEditor", 24 | icon: "Code", 25 | path: "online-editor", 26 | component: "AutomatedTool/OnlineEditor/index.vue" 27 | }, 28 | { 29 | label: "单文件组件", 30 | name: "SingleFileComponent", 31 | icon: "VolumeFileStorage", 32 | path: "single-file-component", 33 | component: "AutomatedTool/SingleFileComponent/index.vue" 34 | } 35 | ] 36 | } 37 | ]; 38 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/styles/tailwindcss/index.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss/base"; 2 | @import "tailwindcss/components"; 3 | @import "tailwindcss/utilities"; 4 | 5 | @layer base { 6 | .theme-public { 7 | --public-main-color: 64, 158, 255; 8 | --public-main-dark-color: 51, 126, 204; 9 | } 10 | .theme-light { 11 | --bg-color: 250, 250, 252; 12 | --bg-color2: 245, 245, 246; 13 | --bg-color3: 255, 255, 255; 14 | --bg-card: 255, 255, 255; 15 | --main-text: 51, 51, 51; 16 | --text-light-1: 69, 68, 74; 17 | --text-light-2: 140, 140, 140; 18 | --border-color: 220, 223, 230; 19 | --border-color2: 238, 238, 238; 20 | } 21 | .theme-dark { 22 | --bg-color: 17, 24, 39; 23 | --bg-color2: 22, 31, 50; 24 | --bg-color3: 33, 33, 33; 25 | --bg-card: 21, 21, 21; 26 | --main-text: 217, 230, 235; 27 | --text-light-1: 217, 230, 235; 28 | --text-light-2: 196, 221, 230; 29 | --border-color: 76, 77, 79; 30 | --border-color2: 48, 48, 48; 31 | } 32 | } 33 | 34 | .el-collapse-item__content { 35 | padding-bottom: 0px !important; 36 | } 37 | -------------------------------------------------------------------------------- /sample/src/pages/Login/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | import { useRouter } from "vue-router"; 3 | 4 | export const useEvent = () => { 5 | const router = useRouter(); 6 | 7 | const formType = ref("login"); 8 | const tagCode = ref(""); 9 | 10 | const onGoToIndex = () => { 11 | router.push({ 12 | name: "Index" 13 | }); 14 | }; 15 | 16 | const onChangeFormType = (type: string) => { 17 | formType.value = type; 18 | }; 19 | 20 | const onForgetPasswordSuccess = (identifying: string) => { 21 | tagCode.value = identifying; 22 | formType.value = "changePassword"; 23 | }; 24 | 25 | const onChangePasswordBack = () => { 26 | tagCode.value = ""; 27 | formType.value = "forgetPassword"; 28 | }; 29 | 30 | const onChangePasswordSuccess = () => { 31 | tagCode.value = ""; 32 | formType.value = "login"; 33 | }; 34 | 35 | return { 36 | onChangePasswordSuccess, 37 | onChangePasswordBack, 38 | onForgetPasswordSuccess, 39 | onChangeFormType, 40 | onGoToIndex, 41 | formType, 42 | tagCode 43 | }; 44 | }; 45 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/reviewTree/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 43 | -------------------------------------------------------------------------------- /sample/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export const debounce = (wait: number, immediate = false) => { 2 | let timeout: any = null; 3 | const debounced: any = function (...args: any[]) { 4 | return new Promise((resolve: any) => { 5 | if (timeout) clearTimeout(timeout); 6 | if (immediate) { 7 | const callNow = !timeout; 8 | timeout = setTimeout(() => { 9 | timeout = null; 10 | }, wait); 11 | if (callNow) { 12 | resolve(); 13 | } 14 | } else { 15 | timeout = setTimeout(() => { 16 | resolve(); 17 | }, wait); 18 | } 19 | }); 20 | }; 21 | debounced.cancel = function () { 22 | clearTimeout(timeout); 23 | timeout = null; 24 | }; 25 | return debounced; 26 | }; 27 | 28 | export const deepCopy = (source: any) => { 29 | if (typeof source != "object") { 30 | return source; 31 | } 32 | if (source == null) { 33 | return source; 34 | } 35 | const newObj = Array.isArray(source) ? [] : {}; 36 | for (const i in source) { 37 | Reflect.set(newObj, i, deepCopy(source[i])); 38 | } 39 | return newObj; 40 | }; 41 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/index.ts: -------------------------------------------------------------------------------- 1 | import { App, Component } from "vue"; 2 | import { version } from "../package.json"; 3 | 4 | import { GSingleComponent } from "./packages/GSingleComponent"; 5 | import { GSingleRenderView } from "./packages/GSingleRenderView"; 6 | 7 | import "animate.css"; 8 | import "@grow-rock/grow-editor/dist/index.css"; 9 | import "@grow-rock/grow-component/dist/index.css"; 10 | import "./styles/tailwindcss/index.css"; 11 | import "./styles/animate/index.css"; 12 | 13 | const components: Component[] = [GSingleComponent, GSingleRenderView]; 14 | 15 | const install = (app: App) => { 16 | const useComponent = (component: Component) => { 17 | if (component.name) { 18 | app.component(component.name, component); 19 | } else { 20 | throw "component need name"; 21 | } 22 | }; 23 | components.forEach((component: Component) => { 24 | useComponent(component); 25 | }); 26 | }; 27 | 28 | const GrowConponent = { 29 | version, 30 | install, 31 | GSingleComponent, 32 | GSingleRenderView 33 | }; 34 | 35 | export { version, GSingleComponent, GSingleRenderView }; 36 | 37 | export default GrowConponent; 38 | -------------------------------------------------------------------------------- /sample/src/apis/systemMent/accountMent.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | key: "getAccountList", 4 | url: "/account/list/{page}/{size}", 5 | method: "post" 6 | }, 7 | { 8 | key: "createAccount", 9 | url: "/account/info", 10 | method: "post" 11 | }, 12 | { 13 | key: "modifyAccount", 14 | url: "/account/info", 15 | method: "put" 16 | }, 17 | { 18 | key: "getAccountInfo", 19 | url: "/account/info/{id}", 20 | method: "get" 21 | }, 22 | { 23 | key: "deleteAccount", 24 | url: "/account/info", 25 | method: "delete" 26 | }, 27 | { 28 | key: "accountChangeState", 29 | url: "/account/change/state", 30 | method: "put" 31 | }, 32 | { 33 | key: "accountResetPassword", 34 | url: "/account/reset/password", 35 | method: "put" 36 | }, 37 | { 38 | key: "accountUnbind", 39 | url: "/account/unbind", 40 | method: "put" 41 | }, 42 | { 43 | key: "accountHistory", 44 | url: "/account/history/{id}", 45 | method: "get" 46 | }, 47 | { 48 | key: "usedRecordList", 49 | url: "/account/use/record/{id}", 50 | method: "get" 51 | } 52 | ]; 53 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/use/useTabsOption.ts: -------------------------------------------------------------------------------- 1 | import { computed, ref } from "vue"; 2 | 3 | export const useTabsOption = ({ options, codeOptions, codemirrorRef }) => { 4 | const tabsActive = ref("App.vue"); 5 | 6 | const tabsOptions = computed(() => { 7 | if (!options.value.files) return []; 8 | return Object.keys(options.value.files) 9 | .filter((key) => { 10 | const [, type]: any = key.match(/\.([^.]+)$/); 11 | return type === "vue"; 12 | }) 13 | .map((el) => { 14 | return { 15 | label: el, 16 | name: el 17 | }; 18 | }); 19 | }); 20 | 21 | const onTabChange = () => { 22 | codemirrorRef.value.setDoc(codeOptions.value.files[tabsActive.value]); 23 | }; 24 | 25 | const onTabsRemove = (key: string) => { 26 | const index = Math.max(tabsOptions.value.findIndex((el) => el.name === key) - 1, 0); 27 | tabsActive.value = tabsOptions.value[index].name; 28 | Reflect.deleteProperty(codeOptions.value.files, key); 29 | }; 30 | 31 | return { 32 | tabsActive, 33 | tabsOptions, 34 | onTabChange, 35 | onTabsRemove 36 | }; 37 | }; 38 | -------------------------------------------------------------------------------- /sample/mock/login/index.ts: -------------------------------------------------------------------------------- 1 | // import { MockMethod } from "vite-plugin-mock"; 2 | import { customAlphabet } from "nanoid"; 3 | 4 | export default [ 5 | { 6 | url: "/account/login", 7 | method: "post", 8 | response: ({ body }: any) => { 9 | const { account, password } = body; 10 | if (account === "admin" && password === "123789456") { 11 | const token = customAlphabet("1234567890abcdef", 50)(); 12 | return { 13 | code: 10000, 14 | message: "登录成功", 15 | result: { 16 | token 17 | } 18 | }; 19 | } else { 20 | return { 21 | code: 50001, 22 | message: "账号或密码错误" 23 | }; 24 | } 25 | } 26 | }, 27 | { 28 | url: "/account/unlock", 29 | method: "post", 30 | response: ({ body }: any) => { 31 | const { password } = body; 32 | if (password === "123789456") { 33 | return { 34 | code: 10000, 35 | message: "解锁成功" 36 | }; 37 | } else { 38 | return { 39 | code: 50005, 40 | message: "解锁密码错误" 41 | }; 42 | } 43 | } 44 | } 45 | ]; 46 | -------------------------------------------------------------------------------- /sample/src/components/business/Home/SettingContent/index.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 31 | 32 | 38 | -------------------------------------------------------------------------------- /sample/src/pages/AutomatedTool/SingleFileComponent/use/useCodeOption.ts: -------------------------------------------------------------------------------- 1 | import { reactive } from "vue"; 2 | import * as vue from "vue"; 3 | import * as ELEMENT from "element-plus"; 4 | 5 | export const useCodeOption = () => { 6 | let options = reactive({ 7 | files: { 8 | "App.vue": 9 | '\n\n\n\n', 10 | "CeShi.vue": 11 | '\n\n\n\n', 12 | "CeShi1.vue": "", 13 | "CeShi2.vue": "", 14 | "CeShi3.vue": "", 15 | "CeShi4.vue": "", 16 | "CeShi5.vue": "", 17 | "CeShi6.vue": "", 18 | "CeShi7.vue": "", 19 | "CeShi8.vue": "" 20 | }, 21 | imports: { 22 | vue: vue, 23 | "element-plus": ELEMENT 24 | } 25 | }); 26 | 27 | return { 28 | options 29 | }; 30 | }; 31 | -------------------------------------------------------------------------------- /sample/src/routers/authority.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | Calibrate: ["admin"], 3 | AutomatedTool: ["admin"], 4 | PageDesigner: ["admin"], 5 | ProcessEngine: ["admin"], 6 | OnlineEditor: ["admin"], 7 | SingleFileComponent: ["admin"], 8 | dashboard: ["admin"], 9 | analysis: ["admin"], 10 | workbench: ["admin"], 11 | ExternalPage: ["admin"], 12 | elementPlusDoc: ["admin"], 13 | GrowAdminDoc: ["admin"], 14 | ComponentDocument: ["admin"], 15 | ElementListPage: ["admin"], 16 | ListPage: ["minor"], 17 | ElBaseList: ["minor"], 18 | ElVirtualList: ["minor"], 19 | VxeVirtualList: ["admin"], 20 | dataReport: ["admin"], 21 | boot: ["admin"], 22 | customPage: ["admin", "minor", "role"], 23 | customPage1: ["admin"], 24 | customPage2: ["admin"], 25 | Feat: ["admin"], 26 | DownExcel: ["admin"], 27 | OpenSubpage: ["admin"], 28 | MessagePrompt: ["admin"], 29 | SystemManagement: ["admin"], 30 | AccountManagement: ["admin"], 31 | RoleManagement: ["admin"], 32 | MenuManagement: ["admin"], 33 | CountToExample: ["admin"], 34 | SplitPaneTest: ["admin"], 35 | "customPage1-1": ["minor"], 36 | "customPage2-2": ["role"], 37 | OverflowList: ["admin"] 38 | }; 39 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/src/packages/ElementResize/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 元素更改 3 | * @Author: Aaron 4 | * @Date: 2022-01-06 22:35:04 5 | * @LastEditors: Please set LastEditors 6 | * @LastEditTime: 2023-04-23 14:31:14 7 | */ 8 | 9 | import ResizeObserver from "resize-observer-polyfill"; 10 | import { Fn } from "types/index"; 11 | 12 | const resizeHandler = function (entries: any) { 13 | for (const entry of entries) { 14 | const listeners = entry.target.__resizeListeners__ || []; 15 | if (listeners.length) { 16 | listeners.forEach((fn: Fn) => { 17 | fn(); 18 | }); 19 | } 20 | } 21 | }; 22 | 23 | export const addEventResize = (node: any, fun: Fn) => { 24 | if (!node.__resizeListeners__) { 25 | node.__resizeListeners__ = []; 26 | } 27 | node.__ro__ = new ResizeObserver(resizeHandler); 28 | node.__ro__.observe(node); 29 | node.__resizeListeners__.push(fun); 30 | }; 31 | 32 | export const removeResizeListener = (node: any, fun: Fn) => { 33 | if (!node || !node.__resizeListeners__) return; 34 | node.__resizeListeners__.splice(node.__resizeListeners__.indexOf(fun), 1); 35 | if (!node.__resizeListeners__.length) { 36 | node.__ro__.disconnect(); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/abstractionComponent/component/eleModuleComponent/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 36 | -------------------------------------------------------------------------------- /sample/src/components/public/PasswordIntensity/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 32 | 33 | 39 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/draggableView/index.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 33 | 34 | 46 | -------------------------------------------------------------------------------- /sample/src/routers/permission.ts: -------------------------------------------------------------------------------- 1 | import router from "router/index"; 2 | import NProgress from "nprogress"; 3 | import { createStorage } from "@grow-rock/grow-utils"; 4 | import { AUTHORITY_TOKEN } from "@/assets/enums/cacheEnum"; 5 | import { ROUTER_WHITELIST } from "@/assets/enums/systemEnum"; 6 | import { useLockScreen } from "store/modules/LockScreen"; 7 | 8 | const storage = createStorage({ prefixKey: "", storage: sessionStorage }); 9 | 10 | NProgress.configure({ showSpinner: false }); 11 | 12 | router.beforeEach((to, from, next) => { 13 | NProgress.start(); 14 | const { name } = to; 15 | const { path: fromPath } = from; 16 | const token = storage.get(AUTHORITY_TOKEN); 17 | const lockScreenStore = useLockScreen(); 18 | 19 | if (!token && ROUTER_WHITELIST.includes(name as string)) { 20 | next(); 21 | return; 22 | } 23 | if (!token && !ROUTER_WHITELIST.includes(name as string)) { 24 | next({ path: fromPath }); 25 | lockScreenStore.setIsLockScreen(false); 26 | return; 27 | } 28 | if (token && ROUTER_WHITELIST.includes(name as string)) { 29 | storage.remove(AUTHORITY_TOKEN); 30 | lockScreenStore.setIsLockScreen(false); 31 | } 32 | next(); 33 | }); 34 | 35 | router.afterEach(() => { 36 | NProgress.done(); 37 | }); 38 | -------------------------------------------------------------------------------- /GrowRock/GrowFlow/src/packages/GWorkFlow/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | import { unref } from "vue"; 2 | import { DataUri } from "@antv/x6"; 3 | 4 | export const useEvent = ({ graphExample }) => { 5 | const onHandleCenter = () => { 6 | const graph = unref(graphExample); 7 | graph.centerContent(); 8 | }; 9 | 10 | const onHandleClean = () => { 11 | const graph = unref(graphExample); 12 | graph.clearCells(); 13 | }; 14 | 15 | const onHandleUndo = () => { 16 | const graph = unref(graphExample); 17 | graph.undo(); 18 | }; 19 | 20 | const onHandleRedo = () => { 21 | const graph = unref(graphExample); 22 | graph.redo(); 23 | }; 24 | 25 | const onHandleSaveImage = () => { 26 | const graph = unref(graphExample); 27 | graph.toJPEG( 28 | (dataUri: string) => { 29 | DataUri.downloadDataUri(dataUri, "chartx.jpeg"); 30 | }, 31 | { 32 | backgroundColor: "white", 33 | padding: { 34 | top: 20, 35 | right: 20, 36 | bottom: 20, 37 | left: 20 38 | }, 39 | quality: 1 40 | } 41 | ); 42 | }; 43 | 44 | return { 45 | onHandleCenter, 46 | onHandleClean, 47 | onHandleUndo, 48 | onHandleRedo, 49 | onHandleSaveImage 50 | }; 51 | }; 52 | -------------------------------------------------------------------------------- /sample/src/pages/EmbedPage/RenderIframe.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 34 | 35 | 45 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/index.ts: -------------------------------------------------------------------------------- 1 | import type { App, Component } from "vue"; 2 | import { version } from "../package.json"; 3 | import { GCountTo } from "./packages/GCountTo"; 4 | import { GDetail, GDetailItem } from "./packages/GDetail"; 5 | import { GDialog } from "./packages/GDialog"; 6 | import { GSplitPane } from "./packages/GSplitPane"; 7 | import { GOverFlowList } from "./packages/GOverFlowList"; 8 | 9 | import "./styles/tailwindcss/index.css"; 10 | 11 | declare type PluginInstallFunction = (app: App, ...options: any[]) => any; 12 | 13 | const components: Component[] = [GCountTo, GDetail, GDetailItem, GDialog, GSplitPane]; 14 | 15 | const install: PluginInstallFunction = (app: App) => { 16 | const useComponent = (component: Component) => { 17 | if (component.name) { 18 | app.component(component.name, component); 19 | } else { 20 | throw "component need name"; 21 | } 22 | }; 23 | components.forEach((component: Component) => { 24 | useComponent(component); 25 | }); 26 | }; 27 | 28 | const GrowConponent = { 29 | version, 30 | install, 31 | GCountTo, 32 | GDetail, 33 | GDetailItem, 34 | GDialog, 35 | GSplitPane, 36 | GOverFlowList 37 | }; 38 | 39 | export { version, GCountTo, GDetail, GDetailItem, GDialog, GSplitPane, GOverFlowList }; 40 | 41 | export default GrowConponent; 42 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountResetPassword/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 35 | 36 | 42 | -------------------------------------------------------------------------------- /sample/src/components/public/AbstractEle/index.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 49 | 50 | 56 | -------------------------------------------------------------------------------- /scripts/commitMessage.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: git提交验证 3 | * @Author: Aaron 4 | * @Date: 2022-12-16 14:48:02 5 | * @LastEditors: Please set LastEditors 6 | * @LastEditTime: 2023-03-15 21:47:16 7 | */ 8 | 9 | // const chalk = require('chalk'); 10 | import chalk from "chalk"; 11 | const msgPath = process.env.GIT_PARAMS; 12 | import fs from "fs"; 13 | const msg = fs.readFileSync(msgPath, "utf-8").trim(); 14 | 15 | const commitRE = 16 | /^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\(.+\))?(.{1,10})?: .{1,50}/; 17 | const mergeRe = /^(Merge pull request|Merge branch)/; 18 | 19 | if (!commitRE.test(msg)) { 20 | if (!mergeRe.test(msg)) { 21 | console.log(msg); 22 | console.error( 23 | ` ${chalk.bgRed.white(" ERROR ")} ${chalk.red(`invalid commit message format.`)}\n\n` + 24 | chalk.red( 25 | ` Proper commit message format is required for automated changelog generation. Examples:\n\n` 26 | ) + 27 | ` ${chalk.green(`feat(compiler): add 'comments' option`)}\n` + 28 | ` ${chalk.green(`fix(v-model): handle events on blur (close #28)`)}\n\n` + 29 | chalk.red( 30 | ` See https://github.com/vuejs/vue-next/blob/master/.github/commit-convention.md for more details.\n` 31 | ) 32 | ); 33 | process.exit(1); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/apiOutlined/index.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 45 | -------------------------------------------------------------------------------- /sample/src/components/public/IntactTable/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 59 | 60 | 66 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/components/FileName.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "rollup"; 2 | import { terser } from "rollup-plugin-terser"; 3 | import json from "@rollup/plugin-json"; 4 | import resolve from "@rollup/plugin-node-resolve"; 5 | import esbuild from "rollup-plugin-esbuild"; 6 | import commonjs from "@rollup/plugin-commonjs"; 7 | import babel from "@rollup/plugin-babel"; 8 | 9 | import pkg from "./package.json" assert { type: "json" }; 10 | 11 | const createBanner = () => { 12 | return `/*! 13 | * ${pkg.name} v${pkg.version} 14 | * (c) ${new Date().getFullYear()} ${pkg.author} 15 | * @license ${pkg.license} 16 | */`; 17 | }; 18 | 19 | export default defineConfig({ 20 | input: "./src/index.ts", 21 | output: [ 22 | { 23 | banner: createBanner(), 24 | file: "dist/index.js", 25 | format: "cjs" 26 | }, 27 | { 28 | banner: createBanner(), 29 | file: "dist/index.esm.js", 30 | format: "esm", 31 | exports: "named" 32 | }, 33 | { 34 | banner: createBanner(), 35 | file: "dist/index.umd.js", 36 | format: "umd", 37 | name: "w" 38 | } 39 | ], 40 | plugins: [ 41 | resolve({ 42 | preferBuiltins: true 43 | }), 44 | commonjs(), 45 | json(), 46 | esbuild(), 47 | babel({ 48 | exclude: "node_modules/**", 49 | babelHelpers: "bundled" 50 | }), 51 | terser() 52 | ] 53 | }); 54 | -------------------------------------------------------------------------------- /sample/src/utils/Echarts/index.ts: -------------------------------------------------------------------------------- 1 | import * as echarts from "echarts/core"; 2 | 3 | import { 4 | BarChart, 5 | LineChart, 6 | PieChart, 7 | MapChart, 8 | PictorialBarChart, 9 | RadarChart, 10 | ScatterChart, 11 | ThemeRiverChart, 12 | EffectScatterChart 13 | } from "echarts/charts"; 14 | 15 | import { 16 | TitleComponent, 17 | TooltipComponent, 18 | GridComponent, 19 | PolarComponent, 20 | AriaComponent, 21 | ParallelComponent, 22 | LegendComponent, 23 | RadarComponent, 24 | ToolboxComponent, 25 | DataZoomComponent, 26 | VisualMapComponent, 27 | TimelineComponent, 28 | CalendarComponent, 29 | GraphicComponent, 30 | SingleAxisComponent 31 | } from "echarts/components"; 32 | 33 | import { SVGRenderer } from "echarts/renderers"; 34 | 35 | echarts.use([ 36 | LegendComponent, 37 | TitleComponent, 38 | TooltipComponent, 39 | GridComponent, 40 | PolarComponent, 41 | AriaComponent, 42 | ParallelComponent, 43 | BarChart, 44 | LineChart, 45 | PieChart, 46 | MapChart, 47 | RadarChart, 48 | SVGRenderer, 49 | PictorialBarChart, 50 | RadarComponent, 51 | ToolboxComponent, 52 | DataZoomComponent, 53 | VisualMapComponent, 54 | TimelineComponent, 55 | CalendarComponent, 56 | GraphicComponent, 57 | ScatterChart, 58 | ThemeRiverChart, 59 | SingleAxisComponent, 60 | EffectScatterChart 61 | ]); 62 | 63 | export default echarts; 64 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/components/dataSource/index.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 48 | -------------------------------------------------------------------------------- /sample/src/pages/Home/use/useVariable.ts: -------------------------------------------------------------------------------- 1 | import { ref, onMounted, onUnmounted, nextTick } from "vue"; 2 | import { useMenuStore } from "store/modules/menu"; 3 | import { useLayoutStore } from "store/modules/layout"; 4 | import { addEventResize, removeResizeListener } from "@grow-rock/grow-utils"; 5 | import { useAppStore } from "store/modules/app"; 6 | import { debounce } from "util/index"; 7 | 8 | export const useVariable = () => { 9 | const layoutStore = useLayoutStore(); 10 | const menuStore = useMenuStore(); 11 | const appStore = useAppStore(); 12 | const systemLoading = ref(false); 13 | const debounceFn = debounce(200); 14 | 15 | const resizeFn = async () => { 16 | await debounceFn(); 17 | const docDOM = document.documentElement; 18 | if (layoutStore.layout === "roof") { 19 | menuStore.setCollapsed(false); 20 | return; 21 | } 22 | if (docDOM.clientWidth < 1024) { 23 | menuStore.setCollapsed(true); 24 | appStore.setIsPutAway(false); 25 | } else { 26 | menuStore.setCollapsed(false); 27 | appStore.setIsPutAway(true); 28 | } 29 | }; 30 | 31 | onMounted(async () => { 32 | await nextTick(); 33 | addEventResize(document.querySelector("#app"), resizeFn); 34 | resizeFn(); 35 | }); 36 | 37 | onUnmounted(() => { 38 | removeResizeListener(document.querySelector("#app"), resizeFn); 39 | }); 40 | 41 | return { 42 | systemLoading 43 | }; 44 | }; 45 | -------------------------------------------------------------------------------- /sample/src/hooks/useLoginOut/index.ts: -------------------------------------------------------------------------------- 1 | import { ElMessage, ElMessageBox } from "element-plus"; 2 | import { AUTHORITY_TOKEN, TABS_CURRENT_KEY, TABS_LIST_KEY } from "@/assets/enums/cacheEnum"; 3 | import { createStorage } from "@grow-rock/grow-utils"; 4 | import { useRouter } from "vue-router"; 5 | import { useLockScreen } from "store/modules/LockScreen"; 6 | 7 | export const useLoginOut = ({ t }: { t: Fn }): any => { 8 | const storage = createStorage({ prefixKey: "", storage: sessionStorage }); 9 | const lockScreenStore = useLockScreen(); 10 | const { push } = useRouter(); 11 | 12 | const loginOut = async () => { 13 | try { 14 | await ElMessageBox.confirm(t("APP_OTHER.LOGIN_OUT_PROMPT"), t("APP_OTHER.LOGIN_OUT_TITLE"), { 15 | confirmButtonText: t("PUBLIC.CONFIRM_TEXT"), 16 | cancelButtonText: t("PUBLIC.CANCEL_TEXT"), 17 | type: "warning", 18 | appendTo: "body", 19 | customStyle: { 20 | zIndex: "40000" 21 | } 22 | }); 23 | storage.remove(AUTHORITY_TOKEN); 24 | storage.remove(TABS_LIST_KEY); 25 | storage.remove(TABS_CURRENT_KEY); 26 | lockScreenStore.setCrackingTimes(0); 27 | lockScreenStore.setIsLockScreen(false); 28 | push({ path: "/" }); 29 | } catch { 30 | ElMessage({ 31 | type: "info", 32 | message: t("APP_OTHER.LOGIN_OUT_CANCEL_PROMPT") 33 | }); 34 | } 35 | }; 36 | 37 | return { 38 | loginOut 39 | }; 40 | }; 41 | -------------------------------------------------------------------------------- /sample/src/components/business/Dashboard/workbench/SayHello/index.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 35 | 36 | 42 | -------------------------------------------------------------------------------- /sample/src/stores/modules/menu.ts: -------------------------------------------------------------------------------- 1 | import type { MenuType } from "types/menu"; 2 | import { defineStore } from "pinia"; 3 | import { treeIterator, filterBinaryTree } from "util/System/index"; 4 | 5 | interface PermissionState { 6 | collapsed: boolean; 7 | showMenu: boolean; 8 | backMenuList: MenuType[]; 9 | frontMenuList: MenuType[]; 10 | } 11 | 12 | export const useMenuStore = defineStore({ 13 | id: "menu", 14 | state: (): PermissionState => ({ 15 | collapsed: true, 16 | showMenu: true, 17 | // 后台菜单列表 18 | backMenuList: [], 19 | // 前台菜单列表 20 | frontMenuList: [] 21 | }), 22 | getters: { 23 | getCollapsed(): boolean { 24 | return this.collapsed ?? false; 25 | }, 26 | allMenuList(): MenuType[] { 27 | const { backMenuList, frontMenuList } = this; 28 | return treeIterator(backMenuList, frontMenuList); 29 | }, 30 | menuList(): MenuType[] { 31 | const { allMenuList } = this; 32 | const menuList = filterBinaryTree(allMenuList); 33 | return menuList; 34 | } 35 | }, 36 | actions: { 37 | setCollapsed(collapsed: boolean) { 38 | this.collapsed = collapsed; 39 | }, 40 | setShowMenu(show: boolean) { 41 | this.showMenu = true; 42 | }, 43 | setFrontMenuList(frontMenuList: MenuType[]) { 44 | this.frontMenuList = frontMenuList; 45 | }, 46 | setBackMenuList(backMenuList: MenuType[]) { 47 | this.backMenuList = backMenuList; 48 | } 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/optionComponent/ElementSize/use/useMargin.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | 3 | export const useMargin = ({ styleOption, emits }) => { 4 | const unitYMap = ["margin-top", "margin-bottom", "padding-top", "padding-bottom"]; 5 | const unitXMap = ["margin-right", "margin-left", "padding-right", "padding-left"]; 6 | 7 | const marginUnit = ref("px"); 8 | 9 | const onMarginUnitChange = (data: string) => { 10 | const result = { ...styleOption.value }; 11 | for (let i = 0, item: string; (item = unitYMap[i++]); ) { 12 | const value = result[item]; 13 | const unit = data === "vw/vh" ? "vh" : data; 14 | value && (result[item] = `${parseFloat(value)}${unit}`); 15 | } 16 | for (let i = 0, item: string; (item = unitXMap[i++]); ) { 17 | const value = result[item]; 18 | const unit = data === "vw/vh" ? "vw" : data; 19 | value && (result[item] = `${parseFloat(value)}${unit}`); 20 | } 21 | emits("update:styleOption", result); 22 | }; 23 | 24 | const onMarginChange = (type: string, event: any) => { 25 | const result = { ...styleOption.value }; 26 | if (event.target.value) { 27 | result[type] = `${event.target.value}${marginUnit.value}`; 28 | } else { 29 | Reflect.deleteProperty(result, type); 30 | } 31 | emits("update:styleOption", result); 32 | }; 33 | 34 | return { 35 | marginUnit, 36 | onMarginUnitChange, 37 | onMarginChange 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /sample/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 46 | 47 | 53 | -------------------------------------------------------------------------------- /sample/src/hooks/usetabs/index.ts: -------------------------------------------------------------------------------- 1 | import { useRouter } from "vue-router"; 2 | import { unref } from "vue"; 3 | import { useMultipleTab } from "store/modules/multipleTab"; 4 | import { useTabDropdown } from "components/base/Tabs/use/useTabDropdown"; 5 | 6 | export const useTabs = () => { 7 | const multipleTableStore = useMultipleTab(); 8 | const { currentRoute } = useRouter(); 9 | const { closeAllTags, closeLeftTags, closeRightTags, closeOthersTags, closeTag, redload } = 10 | useTabDropdown(); 11 | 12 | const setTab = (name: string) => { 13 | const visitedViews = multipleTableStore.getVisitedViews; 14 | const views = visitedViews.find((el) => el.fullPath === unref(currentRoute).fullPath); 15 | if (views) { 16 | views.meta.label = name; 17 | } 18 | }; 19 | 20 | const closeAll = () => { 21 | closeAllTags(); 22 | }; 23 | 24 | const closeLeft = () => { 25 | closeLeftTags(unref(currentRoute)); 26 | }; 27 | 28 | const closeRight = () => { 29 | closeRightTags(unref(currentRoute)); 30 | }; 31 | 32 | const closeOther = () => { 33 | closeOthersTags(unref(currentRoute)); 34 | }; 35 | 36 | const closeCurrent = () => { 37 | closeTag(unref(currentRoute)); 38 | }; 39 | 40 | const reloadCurrent = () => { 41 | redload(unref(currentRoute)); 42 | }; 43 | 44 | return { 45 | setTab, 46 | closeAll, 47 | closeLeft, 48 | closeRight, 49 | closeOther, 50 | closeCurrent, 51 | reloadCurrent 52 | }; 53 | }; 54 | -------------------------------------------------------------------------------- /sample/src/pages/System/Role/component/infoRole/use/useApply.ts: -------------------------------------------------------------------------------- 1 | import type { ComputedRef } from "vue"; 2 | import { computed, ref } from "vue"; 3 | import { Column } from "types/TableColumn"; 4 | import roleAxios from "api/systemMent"; 5 | 6 | interface roleMethod { 7 | roleBoundPersons: Fn; 8 | } 9 | 10 | export const useApply = () => { 11 | const personList = ref([]); 12 | const roleRequest: roleMethod = roleAxios.create("roleMent", ["roleBoundPersons"]); 13 | 14 | const tableColumns: ComputedRef = computed(() => [ 15 | { 16 | field: "serial", 17 | title: "序号" 18 | }, 19 | { 20 | field: "account", 21 | title: "账号", 22 | showOverflowTooltip: true 23 | }, 24 | { 25 | field: "personName", 26 | title: "所属人员" 27 | }, 28 | { 29 | field: "roles", 30 | title: "所有角色", 31 | showOverflowTooltip: true 32 | }, 33 | { 34 | field: "department", 35 | title: "人员部门" 36 | }, 37 | { 38 | field: "boundDate", 39 | title: "绑定时间", 40 | showOverflowTooltip: true 41 | }, 42 | { 43 | field: "operator", 44 | title: "最近操作人" 45 | } 46 | ]); 47 | 48 | const getRoleBoundPersonList = async (roleId: string) => { 49 | const { data } = await roleRequest.roleBoundPersons({ params: { roleId } }); 50 | personList.value = data; 51 | }; 52 | 53 | return { 54 | getRoleBoundPersonList, 55 | personList, 56 | tableColumns 57 | }; 58 | }; 59 | -------------------------------------------------------------------------------- /GrowRock/GrowDesigner/src/packages/GDesigner/static/elementInfo/basicTitleConfig.ts: -------------------------------------------------------------------------------- 1 | 2 | export default { 3 | props: [ 4 | { 5 | eleType: "ElSelect", 6 | name: "级别", 7 | describe: "标题级别", 8 | modelKey: "level", 9 | props: { 10 | placeholder: "请选择标题级别", 11 | options: [ 12 | { 13 | label: "H1", 14 | value: "H1" 15 | }, 16 | { 17 | label: "H2", 18 | value: "H2" 19 | }, 20 | { 21 | label: "H3", 22 | value: "H3" 23 | }, 24 | { 25 | label: "H4", 26 | value: "H4" 27 | }, 28 | { 29 | label: "H5", 30 | value: "H5" 31 | } 32 | 33 | ] 34 | } 35 | }, 36 | { 37 | eleType: "ElInput", 38 | name: "展示内容", 39 | describe: "展示在标签中的文字内容", 40 | modelKey: "context", 41 | props: { 42 | placeholder: "请输入展示内容" 43 | } 44 | } 45 | ], 46 | styles: { 47 | 48 | }, 49 | events: { 50 | 51 | }, 52 | renderArgument: { 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountResetPassword/use/useForm.ts: -------------------------------------------------------------------------------- 1 | import { reactive, computed, ref } from "vue"; 2 | import to from "await-to-js"; 3 | import axios from "api/systemMent"; 4 | import { ElMessage } from "element-plus"; 5 | 6 | interface Prop { 7 | emit: Fn; 8 | } 9 | 10 | export const useForm = ({ emit }: Prop) => { 11 | const accoutMethods = axios.create("accountMent"); 12 | const buttonLoading = ref(false); 13 | const formRef = ref(); 14 | 15 | const formData = reactive({ 16 | password: "" 17 | }); 18 | 19 | const rules = computed(() => ({ 20 | password: [ 21 | { 22 | required: true, 23 | message: "请输入初始密码", 24 | trigger: "change" 25 | } 26 | ] 27 | })); 28 | 29 | const onReset = async () => { 30 | buttonLoading.value = true; 31 | try { 32 | await formRef.value.validate(); 33 | const [error] = await to(accoutMethods.accountResetPassword({ data: formData })); 34 | if (error) { 35 | const { message } = error; 36 | ElMessage.error(message); 37 | buttonLoading.value = false; 38 | return; 39 | } 40 | buttonLoading.value = false; 41 | emit("success", "密码重置成功"); 42 | } catch { 43 | buttonLoading.value = false; 44 | } 45 | }; 46 | 47 | const onClean = () => { 48 | emit("close"); 49 | }; 50 | 51 | return { 52 | buttonLoading, 53 | formRef, 54 | rules, 55 | formData, 56 | onClean, 57 | onReset 58 | }; 59 | }; 60 | -------------------------------------------------------------------------------- /sample/src/components/public/PerfectTable/use/useInitColumns.ts: -------------------------------------------------------------------------------- 1 | import { computed, reactive, watch } from "vue"; 2 | import { deepCopy } from "util/index"; 3 | 4 | interface argProp { 5 | props: any; 6 | } 7 | 8 | export const useInitColumns = ({ props }: argProp) => { 9 | const state = reactive({ 10 | columns: [] 11 | }); 12 | 13 | watch( 14 | () => props.columns, 15 | (newValue) => { 16 | state.columns = deepCopy(newValue); 17 | }, 18 | { 19 | immediate: true 20 | } 21 | ); 22 | 23 | const currentColumns = computed(() => { 24 | return state.columns; 25 | }); 26 | 27 | const isSerial = computed(() => { 28 | return state.columns.map((el) => el.field).includes("serial"); 29 | }); 30 | 31 | const isOperate = computed(() => { 32 | return state.columns.map((el) => el.field).includes("operate"); 33 | }); 34 | 35 | const serialColumn = computed(() => { 36 | return state.columns.find((el) => el.field === "serial") || {}; 37 | }); 38 | 39 | const operateColumn = computed(() => { 40 | return state.columns.find((el) => el.field === "operate") || {}; 41 | }); 42 | 43 | const allColumns = computed(() => { 44 | return state.columns.filter((el) => { 45 | return !["serial", "operate"].includes(el.field) && el.visible !== false; 46 | }); 47 | }); 48 | 49 | return { 50 | isSerial, 51 | allColumns, 52 | serialColumn, 53 | isOperate, 54 | operateColumn, 55 | currentColumns, 56 | state 57 | }; 58 | }; 59 | -------------------------------------------------------------------------------- /sample/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grow_sample", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "dev": "vite", 9 | "build": "vite build", 10 | "preview": "vite preview" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "@types/mockjs": "^1.0.7", 17 | "@vue/runtime-core": "^3.2.47", 18 | "mockjs": "^1.1.0", 19 | "rollup-plugin-visualizer": "^5.9.0", 20 | "typescript": "^5.0.4", 21 | "vite-plugin-compression": "^0.5.1", 22 | "vite-plugin-imagemin": "^0.6.1", 23 | "vite-plugin-mock": "^2.9.8" 24 | }, 25 | "dependencies": { 26 | "@vicons/antd": "^0.12.0", 27 | "@vicons/carbon": "^0.12.0", 28 | "@vueuse/core": "^10.0.2", 29 | "animate.css": "^4.1.1", 30 | "await-to-js": "^3.0.0", 31 | "dayjs": "^1.11.13", 32 | "echarts": "^5.4.2", 33 | "@grow-rock/grow-component": "workspace:*", 34 | "@grow-rock/grow-designer": "workspace:*", 35 | "@grow-rock/grow-editor": "workspace:*", 36 | "@grow-rock/grow-flow": "workspace:*", 37 | "@grow-rock/grow-single-file": "workspace:*", 38 | "@grow-rock/grow-utils": "workspace:*", 39 | "hover.css": "^2.3.2", 40 | "nanoid": "^4.0.2", 41 | "nprogress": "^0.2.0", 42 | "pinia": "^2.0.34", 43 | "sortablejs": "^1.15.0", 44 | "v3-tour": "^3.1.2", 45 | "vue-i18n": "^9.2.2", 46 | "vue-router": "^4.1.6", 47 | "vue3-grid-layout": "^1.0.0" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sample/mock/Dictionary/index.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | { 3 | url: "/system/dict/data/public_state", 4 | method: "get", 5 | response: ({ body }: any) => { 6 | return { 7 | code: 10000, 8 | message: "成功", 9 | result: { 10 | dictList: [ 11 | { 12 | code: "1", 13 | label: "启用" 14 | }, 15 | { 16 | code: "0", 17 | label: "禁用" 18 | } 19 | ] 20 | } 21 | }; 22 | } 23 | }, 24 | { 25 | url: "/system/dict/data/role_type", 26 | method: "get", 27 | response: ({ body }: any) => { 28 | return { 29 | code: 10000, 30 | message: "成功", 31 | result: { 32 | dictList: [ 33 | { 34 | code: "0", 35 | label: "普通角色" 36 | }, 37 | { 38 | code: "1", 39 | label: "超级管理员" 40 | } 41 | ] 42 | } 43 | }; 44 | } 45 | }, 46 | { 47 | url: "/system/dict/data/menu_type", 48 | method: "get", 49 | response: ({ body }: any) => { 50 | return { 51 | code: 10000, 52 | message: "成功", 53 | result: { 54 | dictList: [ 55 | { 56 | code: "0", 57 | label: "目录" 58 | }, 59 | { 60 | code: "1", 61 | label: "菜单" 62 | } 63 | ] 64 | } 65 | }; 66 | } 67 | } 68 | ]; 69 | -------------------------------------------------------------------------------- /sample/src/components/public/PerfectTable/Column.vue: -------------------------------------------------------------------------------- 1 | 57 | -------------------------------------------------------------------------------- /GrowRock/GrowUtils/src/packages/AxiosFactory/index.ts: -------------------------------------------------------------------------------- 1 | import type { RawAxiosRequestConfig } from "axios"; 2 | import type { RequestItem } from "types/Request"; 3 | import Request from "./Request"; 4 | 5 | export default class AxiosFactory extends Request { 6 | private RequestConfigMap: any = {}; 7 | static instance: AxiosFactory; 8 | 9 | constructor(config: RawAxiosRequestConfig) { 10 | super(config); 11 | if (AxiosFactory.instance === undefined) { 12 | AxiosFactory.instance = this; 13 | } 14 | return AxiosFactory.instance; 15 | } 16 | 17 | public setConfig(name: string, requestConfigs: RequestItem[]): void { 18 | this.RequestConfigMap[name] = requestConfigs; 19 | } 20 | 21 | public create(name: string, filters: string[] = []): any { 22 | const { RequestConfigMap } = this; 23 | const requestConfigs = RequestConfigMap[name]; 24 | const methodsMap: any = {}; 25 | if (!RequestConfigMap) { 26 | console.error("未找到对应集合,请使用新建setConfig添加"); 27 | return methodsMap; 28 | } 29 | let createConfig = []; 30 | if (filters.length) { 31 | createConfig = requestConfigs.filter((el: RequestItem) => filters.includes(el.key || "")); 32 | } else { 33 | createConfig = requestConfigs; 34 | } 35 | for (let i = 0; i < createConfig.length; i++) { 36 | const requestItem: RequestItem = createConfig[i]; 37 | const { key = "" } = requestItem; 38 | const fn = this.createMethod(requestItem); 39 | methodsMap[key] = fn; 40 | } 41 | return methodsMap; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sample/src/apis/index.ts: -------------------------------------------------------------------------------- 1 | import type { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios"; 2 | import { Request } from "@grow-rock/grow-utils"; 3 | import { createStorage } from "@grow-rock/grow-utils"; 4 | import { AUTHORITY_TOKEN } from "@/assets/enums/cacheEnum"; 5 | import { ElMessage } from "element-plus"; 6 | 7 | const storage = createStorage({ prefixKey: "", storage: sessionStorage }); 8 | 9 | const request = new Request({ 10 | baseURL: import.meta.env.VITE_BASE_URL 11 | }); 12 | 13 | const requestIntercept = (config: AxiosRequestConfig): AxiosRequestConfig => { 14 | const token = storage.get(AUTHORITY_TOKEN); 15 | const isToken = (config.headers || {}).isToken === false; 16 | if (token && !isToken) { 17 | config.headers["Authorization"] = "Bearer " + token; 18 | } 19 | return config; 20 | }; 21 | 22 | const responseIntercept = (response: AxiosResponse): AxiosResponse => { 23 | const { data, status } = response; 24 | if (status === 200) { 25 | if (data.code === 10000) { 26 | return data.result; 27 | } else { 28 | throw new Error(data.message); 29 | } 30 | } else { 31 | ElMessage.error(response.statusText); 32 | return response; 33 | } 34 | }; 35 | 36 | const processingError = (error: AxiosError): AxiosError => { 37 | return error; 38 | }; 39 | 40 | request.interceptors({ 41 | requestIntercept, 42 | requestError: processingError, 43 | responseIntercept, 44 | responseError: processingError 45 | }); 46 | 47 | export default request; 48 | 49 | export const axios = request.axiosInstance; 50 | -------------------------------------------------------------------------------- /sample/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "skipLibCheck": true, 4 | "target": "es2022", 5 | "module": "esnext", 6 | "useDefineForClassFields": true, 7 | "moduleResolution": "Node", 8 | "strict": true, 9 | "jsx": "preserve", 10 | "sourceMap": false, 11 | "noImplicitAny": true, 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | "strictNullChecks": false, 15 | "noEmit": true, 16 | "lib": ["esnext", "dom"], 17 | "types": ["vite/client"], 18 | "baseUrl": ".", 19 | "paths": { 20 | "@/*": ["src/*"], 21 | "components/*": ["src/components/*"], 22 | "api/*": ["src/apis/*"], 23 | "api": ["src/apis/index"], 24 | "util/*": ["src/utils/*"], 25 | "pages/*": ["src/pages/*"], 26 | "hooks/*": ["src/hooks/*"], 27 | "router/*": ["src/routers/*"], 28 | "language/*": ["src/language/*"], 29 | "types/*": ["types/*"], 30 | "plugin/*": ["src/plugins/*"], 31 | "plugin": ["src/plugins/index"], 32 | "store/*": ["src/stores/*"], 33 | "store": ["src/stores/index"], 34 | "style/*": ["src/style/*"], 35 | "setting/*": ["src/settings/*"], 36 | "image/*": ["src/assets/images/*"] 37 | } 38 | }, 39 | "include": [ 40 | "src/**/*.ts", 41 | "src/**/*.d.ts", 42 | "src/**/*.tsx", 43 | "src/**/*.vue", 44 | "mock/**/*.ts", 45 | "types/**/*.d.ts", 46 | "types/**/*.ts", 47 | "build/**/*.ts", 48 | "build/**/*.d.ts" 49 | ], 50 | "exclude": ["node_modules", "dist", "**/*.js"] 51 | } 52 | -------------------------------------------------------------------------------- /sample/src/components/base/Menu/index.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 45 | 46 | 52 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/src/packages/GSplitPane/GSplitPane.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 47 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountUseRecord/RecordItem.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 47 | 48 | 54 | -------------------------------------------------------------------------------- /GrowRock/GrowSingleFile/src/packages/GSingleComponent/components/ImportMap.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 55 | -------------------------------------------------------------------------------- /sample/src/routers/routers/index.ts: -------------------------------------------------------------------------------- 1 | import type { RouteRecordRaw } from "vue-router"; 2 | import { createStorage } from "@grow-rock/grow-utils"; 3 | import { AUTHORITY_TOKEN } from "@/assets/enums/cacheEnum"; 4 | import { ROUTER_WHITELIST } from "@/assets/enums/systemEnum"; 5 | 6 | const storage = createStorage({ prefixKey: "", storage: sessionStorage }); 7 | 8 | export default [ 9 | { 10 | path: "/", 11 | name: "Login", 12 | component: () => import("pages/Login/index.vue") 13 | }, 14 | { 15 | path: "/home", 16 | name: "Home", 17 | component: () => import("pages/Home/index.vue"), 18 | children: [ 19 | { 20 | path: "404", 21 | name: "NotFound", 22 | component: () => import("pages/NotFound/index.vue") 23 | }, 24 | { 25 | path: "redirect/:path(.*)", 26 | name: "Redirect", 27 | component: () => import("pages/Redirect/index.vue") 28 | }, 29 | { 30 | path: "child/:id", 31 | name: "Child", 32 | component: () => import("pages/Child1/index.vue"), 33 | meta: { componentName: "Child1Page" } 34 | } 35 | ] 36 | }, 37 | { 38 | path: "/404", 39 | name: "404", 40 | component: () => import("pages/NotFound/index.vue") 41 | }, 42 | { 43 | path: "/:pathMatch(.*)", 44 | name: "pathMatch", 45 | redirect: () => { 46 | const token = storage.get(AUTHORITY_TOKEN); 47 | if (token) { 48 | // ! 这里最好可以判断一下权限,跳转到没有权限页面 49 | return "/home/404"; 50 | } else { 51 | return "/404"; 52 | } 53 | } 54 | } 55 | ] as RouteRecordRaw[]; 56 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/ThirdParty/index.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 52 | 53 | 59 | -------------------------------------------------------------------------------- /sample/src/components/business/Home/Options/use/useEvent.ts: -------------------------------------------------------------------------------- 1 | import { ExtendedDocument } from "types/index"; 2 | import { ref } from "vue"; 3 | import { useAppStore } from "store/modules/app"; 4 | import { useFullscreen } from "@vueuse/core"; 5 | import { useLockScreen } from "store/modules/LockScreen"; 6 | import { useLoginOut } from "hooks/useLoginOut"; 7 | 8 | type userMenuType = "profile" | "logout"; 9 | 10 | export const useEvent = ({ t }: { t: Fn }) => { 11 | const appStore = useAppStore(); 12 | const lockScreenStore = useLockScreen(); 13 | const { toggle, isFullscreen } = useFullscreen(); 14 | const settingActive = ref(false); 15 | const messageActive = ref(false); 16 | const { loginOut } = useLoginOut({ t }); 17 | 18 | const onSettingHadnler = () => { 19 | appStore.setSettingActive(true); 20 | }; 21 | 22 | const onSearchHeadler = () => { 23 | appStore.setSearchActive(true); 24 | }; 25 | 26 | const domc: ExtendedDocument = document; 27 | isFullscreen.value = !!( 28 | domc.fullscreenElement || 29 | domc.webkitFullscreenElement || 30 | domc.mozFullScreenElement || 31 | domc.msFullscreenElement 32 | ); 33 | 34 | const onLoginOut = async () => { 35 | loginOut(); 36 | }; 37 | 38 | const onDropdownClick = (value: userMenuType) => { 39 | if (value === "logout") onLoginOut(); 40 | }; 41 | 42 | const onLockScreenHeadler = () => { 43 | lockScreenStore.setIsLockScreen(true); 44 | }; 45 | 46 | return { 47 | settingActive, 48 | isFullscreen, 49 | messageActive, 50 | toggle, 51 | onLockScreenHeadler, 52 | onSettingHadnler, 53 | onSearchHeadler, 54 | onDropdownClick 55 | }; 56 | }; 57 | -------------------------------------------------------------------------------- /sample/src/components/business/Dashboard/Analysis/VisitAnalysisBar/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 60 | 61 | 67 | -------------------------------------------------------------------------------- /sample/src/pages/System/Account/component/AccountHistory/HistoryItem.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 59 | 60 | 66 | -------------------------------------------------------------------------------- /sample/src/components/business/Login/ChangePassword/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 51 | 52 | 58 | -------------------------------------------------------------------------------- /GrowRock/GrowComponent/tests/GDetail.spec.ts: -------------------------------------------------------------------------------- 1 | import type { Ref } from "vue"; 2 | import { GDetail, GDetailItem } from "@/packages/GDetail"; 3 | import { describe, expect, it } from "vitest"; 4 | import { reactive, ref } from "vue"; 5 | import { mount } from "@vue/test-utils"; 6 | 7 | interface mockData { 8 | name: string; 9 | } 10 | 11 | describe("GDetail 功能测试", () => { 12 | const model: Ref = ref({ 13 | name: "张三" 14 | }); 15 | const label = "姓名"; 16 | const prop = "name"; 17 | 18 | it("render provide/inject", () => { 19 | const wrapper = mount(GDetailItem, { 20 | global: { 21 | provide: { 22 | "g-detail": reactive({ 23 | model, 24 | align: "left", 25 | labelWidth: "100px" 26 | }) 27 | } 28 | }, 29 | props: { 30 | label, 31 | prop, 32 | align: "left", 33 | labelWidth: "100px" 34 | } 35 | }); 36 | console.log(wrapper.find(".g-detail-label").attributes().hasOwnProperty("text-align")); 37 | expect(label).toBe(wrapper.find(".g-detail-label").text()); 38 | expect(model.value[prop]).toBe(wrapper.find(".g-detail-value").text()); 39 | }); 40 | 41 | it("render slots", () => { 42 | const wrapper = mount(GDetailItem, { 43 | global: { 44 | provide: { 45 | "g-detail": reactive({ 46 | model, 47 | align: "left", 48 | labelWidth: "100px" 49 | }) 50 | } 51 | }, 52 | slots: { 53 | default: (item) => `${item.value}` 54 | }, 55 | props: { 56 | label, 57 | prop, 58 | align: "left", 59 | labelWidth: "100px" 60 | } 61 | }); 62 | expect(`${model.value[prop]}`).toBe(wrapper.find(".w-full").text()); 63 | }); 64 | }); 65 | -------------------------------------------------------------------------------- /sample/build/other.ts: -------------------------------------------------------------------------------- 1 | export const createCss = () => { 2 | return { 3 | preprocessorOptions: { 4 | scss: { 5 | additionalData: '@import "style/base/_var.scss";' 6 | } 7 | } 8 | }; 9 | }; 10 | 11 | export const createResolve = () => { 12 | return { 13 | alias: [ 14 | { 15 | find: "@", 16 | replacement: "/src" 17 | }, 18 | { 19 | find: "pages", 20 | replacement: "/src/pages" 21 | }, 22 | { 23 | find: "components", 24 | replacement: "/src/components" 25 | }, 26 | { 27 | find: "api", 28 | replacement: "/src/apis" 29 | }, 30 | { 31 | find: "util", 32 | replacement: "/src/utils" 33 | }, 34 | { 35 | find: "hooks", 36 | replacement: "/src/hooks" 37 | }, 38 | { 39 | find: "types", 40 | replacement: "/types" 41 | }, 42 | { 43 | find: "plugin", 44 | replacement: "/src/plugins" 45 | }, 46 | { 47 | find: "style", 48 | replacement: "/src/styles" 49 | }, 50 | { 51 | find: "store", 52 | replacement: "/src/stores" 53 | }, 54 | { 55 | find: "setting", 56 | replacement: "/src/settings" 57 | }, 58 | { 59 | find: "router", 60 | replacement: "/src/routers" 61 | }, 62 | { 63 | find: "language", 64 | replacement: "/src/language" 65 | }, 66 | { 67 | find: "/image", 68 | replacement: "/src/assets/images" 69 | }, 70 | { 71 | find: "image", 72 | replacement: "/src/assets/images" 73 | }, 74 | { 75 | find: "vue", 76 | replacement: "vue/dist/vue.esm-bundler.js" 77 | } 78 | ] 79 | }; 80 | }; 81 | -------------------------------------------------------------------------------- /sample/src/pages/Index/use/useContainer.ts: -------------------------------------------------------------------------------- 1 | import { scrollEvent } from "types/eleOther"; 2 | import { ref, computed } from "vue"; 3 | import { useI18n } from "vue-i18n"; 4 | 5 | export const useContainer = () => { 6 | const opacityNum = ref(0); 7 | const { t } = useI18n(); 8 | 9 | const isShowBorder = computed(() => { 10 | return opacityNum.value >= 0.8; 11 | }); 12 | 13 | const onPageContentScroll = (event: scrollEvent) => { 14 | const top = event.scrollTop; 15 | const opacity = Math.min(4, top / 100); 16 | opacityNum.value = opacity; 17 | }; 18 | 19 | const traitIntroduces = computed(() => { 20 | return [ 21 | { 22 | emjo: "💡", 23 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.0.TITLE"), 24 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.0.DESCRIBE") 25 | }, 26 | { 27 | emjo: "⚡️", 28 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.1.TITLE"), 29 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.1.DESCRIBE") 30 | }, 31 | { 32 | emjo: "🔧", 33 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.2.TITLE"), 34 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.2.DESCRIBE") 35 | }, 36 | { 37 | emjo: "📦", 38 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.3.TITLE"), 39 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.3.DESCRIBE") 40 | }, 41 | { 42 | emjo: "🏭", 43 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.4.TITLE"), 44 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.4.DESCRIBE") 45 | }, 46 | { 47 | emjo: "🔩", 48 | title: t("INDEX_SYETEM_DESCRIBE.TRAIT.5.TITLE"), 49 | detail: t("INDEX_SYETEM_DESCRIBE.TRAIT.5.DESCRIBE") 50 | } 51 | ]; 52 | }); 53 | 54 | return { 55 | onPageContentScroll, 56 | isShowBorder, 57 | opacityNum, 58 | traitIntroduces 59 | }; 60 | }; 61 | -------------------------------------------------------------------------------- /sample/src/pages/Feat/SplitPaneTest/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 64 | 71 | --------------------------------------------------------------------------------