diff --git a/package.json b/package.json index dc3bd55033ffada05e77abd011f95dc8b23b65e0..d58bfb7f5ab5305c2f229395705c9b38dfe12036 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "@element-plus/icons-vue": "2.3.2", "@highlightjs/vue-plugin": "2.1.2", "@vueup/vue-quill": "1.2.0", - "@vueuse/core": "13.9.0", + "@vueuse/core": "13.1.0", + "@vitejs/plugin-vue-jsx": "^4.1.2", "animate.css": "4.1.1", "await-to-js": "3.0.0", "axios": "1.13.1", diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index 952601784349d31b6b52f3006caf6a97974cdace..a836e3cb7532bf1042fa8f9a2f0deb22bdfec658 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -193,6 +193,7 @@ h6 { } .el-card__body { + height: 100%; padding: 15px 20px 20px 20px !important; } diff --git a/src/components/FormTable/index.vue b/src/components/FormTable/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..3593e920ef6aec3d278e16acbdfdfda960e49dc4 --- /dev/null +++ b/src/components/FormTable/index.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/src/components/SearchForm/exSlot.tsx b/src/components/SearchForm/exSlot.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e5467c01ac38259816d35d8b69f62c75ba1bad63 --- /dev/null +++ b/src/components/SearchForm/exSlot.tsx @@ -0,0 +1,34 @@ +import { defineComponent } from 'vue'; + +export default defineComponent({ + name: 'ex-slot', + props: { + value: [String, Number], + row: Object, + render: Function, + rowIndex: Number, + column: Object, + columnIndex: Number, + class: [String, Array, Object], + style: [String, Array, Object], + dict: [Array] + }, + render() { + const value = this.render({ + value: this.value, + row: this.row, + column: this.column, + rowIndex: this.rowIndex, + columnIndex: this.columnIndex, + dict: this.dict + }); + if (this.style || this.class) { + return ( +
+ {value} +
+ ); + } + return value; + } +}); diff --git a/src/components/SearchForm/formElem.vue b/src/components/SearchForm/formElem.vue new file mode 100644 index 0000000000000000000000000000000000000000..ed20440839cb28a6ee3b1df110399766f02ebd8f --- /dev/null +++ b/src/components/SearchForm/formElem.vue @@ -0,0 +1,215 @@ + + + + + diff --git a/src/components/SearchForm/index.vue b/src/components/SearchForm/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..ae9860dfe8279d97a783d6a5c0b2f89d23f67d6a --- /dev/null +++ b/src/components/SearchForm/index.vue @@ -0,0 +1,185 @@ + + + + + + diff --git a/src/components/SearchPanel/index.vue b/src/components/SearchPanel/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..e16ecdedbc9dfe4cdf3c2c46ed8f595bf715ba22 --- /dev/null +++ b/src/components/SearchPanel/index.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/components/ToolbarButton/index.vue b/src/components/ToolbarButton/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..2969a696506274f76c9abae77d4b2e927df5a2f0 --- /dev/null +++ b/src/components/ToolbarButton/index.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index b6c7b61c3ead68d26967b0d5fd5c38f2284b5dd6..6fe4ff4db7416b93883c9e85246ac1190aafa9c4 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -55,9 +55,10 @@ function addIframe() { .app-main { /* 50= navbar 50 */ min-height: calc(100vh - 50px); + height: calc(100vh - 50px); width: 100%; position: relative; - overflow: hidden; + overflow: auto; } .fixed-header + .app-main { @@ -68,6 +69,7 @@ function addIframe() { .app-main { /* 84 = navbar + tags-view = 50 + 34 */ min-height: calc(100vh - 84px); + height: calc(100vh - 84px); } .fixed-header + .app-main { diff --git a/src/plugins/auth.ts b/src/plugins/auth.ts index a5aaef94389149aae446917d54453b4dcd9284d7..464d08c95acabe68d8db4a0efd7e7eff6103a33e 100644 --- a/src/plugins/auth.ts +++ b/src/plugins/auth.ts @@ -24,6 +24,11 @@ const authRole = (role: string): boolean => { } }; +export const havePermi = (permission: string): boolean => { + // 你的权限校验逻辑 + return authPermission(permission); +}; + export default { // 验证用户是否具备某权限 hasPermi(permission: string): boolean { diff --git a/src/utils/index.ts b/src/utils/index.ts index 2b0aad5fac4d72d7c7698fc6ab08a20f187bbfe1..aecc49ac25789599380378c5c019b01c52520405 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -316,3 +316,21 @@ export const removeClass = (ele: HTMLElement, cls: string) => { export const isExternal = (path: string) => { return /^(https?:|http?:|mailto:|tel:)/.test(path); }; + +/** + * Check if a variable is a string + * @param str + * @returns {boolean} + */ +export const isString = (str: any): str is string => { + return typeof str === 'string' || str instanceof String; +}; + +/** + * Check if a variable is a function + * @param func + * @returns {boolean} + */ +export const isFunction = (func: any): func is Function => { + return typeof func === 'function' || func instanceof Function; +}; diff --git a/src/utils/validate.ts b/src/utils/validate.ts index e2886e45077172f91ca91e124d24fd86d8cb3437..8f9bdb9f44e1aa1f243c7d086c00ecf8a79a1580 100644 --- a/src/utils/validate.ts +++ b/src/utils/validate.ts @@ -106,3 +106,26 @@ export const isArray = (arg: string | string[]) => { } return Array.isArray(arg); }; + +/** + * 判断是否为空 + */ +export function validatenull(val) { + if (typeof val == 'boolean') { + return false; + } + if (typeof val == 'number') { + return false; + } + if (val instanceof Array) { + if (val.length == 0) return true; + } else if (val instanceof Object) { + if (JSON.stringify(val) === '{}') return true; + } else { + if (val == 'null' || val == null || val == 'undefined' || val == undefined || val == ''){ + return true; + } + return false; + } + return false; +} diff --git a/src/views/test/index.vue b/src/views/test/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..57b60ccb4b30ca53529d21192e17ada35a0d6876 --- /dev/null +++ b/src/views/test/index.vue @@ -0,0 +1,310 @@ + + + + diff --git a/vite/plugins/index.ts b/vite/plugins/index.ts index 9ef8faf131203d8b9ce69c4029c7c1c5c063aa71..ffc93ddab74e51e63d753b2b6e5e77e04fc84f47 100644 --- a/vite/plugins/index.ts +++ b/vite/plugins/index.ts @@ -1,4 +1,5 @@ import vue from '@vitejs/plugin-vue'; +import vueJsx from '@vitejs/plugin-vue-jsx'; import vueDevTools from 'vite-plugin-vue-devtools'; import createUnoCss from './unocss'; @@ -11,8 +12,14 @@ import createSetupExtend from './setup-extend'; import path from 'path'; export default (viteEnv: any, isBuild = false): [] => { - const vitePlugins: any = []; - vitePlugins.push(vue()); + const vitePlugins: any = [ + vue({ + script: { + defineModel: true + } + }), + vueJsx() + ]; vitePlugins.push(vueDevTools()); vitePlugins.push(createUnoCss()); vitePlugins.push(createAutoImport(path));