mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-22 12:58:55 +08:00
Merge branch 'dev'
Some checks failed
build / task (18.x, npm, macOS-latest) (push) Has been cancelled
build / task (18.x, npm, ubuntu-latest) (push) Has been cancelled
build / task (18.x, npm, windows-latest) (push) Has been cancelled
build / task (18.x, pnpm, macOS-latest) (push) Has been cancelled
build / task (18.x, pnpm, ubuntu-latest) (push) Has been cancelled
build / task (18.x, pnpm, windows-latest) (push) Has been cancelled
build / task (18.x, yarn, macOS-latest) (push) Has been cancelled
build / task (18.x, yarn, ubuntu-latest) (push) Has been cancelled
build / task (18.x, yarn, windows-latest) (push) Has been cancelled
同步代码 / gitcode (push) Has been cancelled
同步代码 / gitlink (push) Has been cancelled
同步代码 / gitee (push) Has been cancelled
Some checks failed
build / task (18.x, npm, macOS-latest) (push) Has been cancelled
build / task (18.x, npm, ubuntu-latest) (push) Has been cancelled
build / task (18.x, npm, windows-latest) (push) Has been cancelled
build / task (18.x, pnpm, macOS-latest) (push) Has been cancelled
build / task (18.x, pnpm, ubuntu-latest) (push) Has been cancelled
build / task (18.x, pnpm, windows-latest) (push) Has been cancelled
build / task (18.x, yarn, macOS-latest) (push) Has been cancelled
build / task (18.x, yarn, ubuntu-latest) (push) Has been cancelled
build / task (18.x, yarn, windows-latest) (push) Has been cancelled
同步代码 / gitcode (push) Has been cancelled
同步代码 / gitlink (push) Has been cancelled
同步代码 / gitee (push) Has been cancelled
This commit is contained in:
commit
28c258c3f0
51
.github/workflows/image.yml
vendored
51
.github/workflows/image.yml
vendored
@ -1,51 +0,0 @@
|
|||||||
# This workflow will build a Java project with Maven
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
||||||
|
|
||||||
name: PIG 镜像 action
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
task:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
node-version: [18.x]
|
|
||||||
npm-client: [npm]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
if: matrix.npm-client == 'pnpm'
|
|
||||||
name: Install pnpm
|
|
||||||
with:
|
|
||||||
version: 7
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Set up Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: ${{ matrix.npm-client }} install
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: ${{ matrix.npm-client }} run build:docker
|
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
|
||||||
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} registry.cn-hangzhou.aliyuncs.com
|
|
||||||
|
|
||||||
- name: Build and push Docker images
|
|
||||||
run: |
|
|
||||||
docker-compose -f ./docker/docker-compose.yaml build
|
|
||||||
registry="registry.cn-hangzhou.aliyuncs.com/pigx/"
|
|
||||||
for service in $(docker-compose -f ./docker/docker-compose.yaml config --services); do
|
|
||||||
docker tag ${service}:latest ${registry}${service}:latest
|
|
||||||
docker push ${registry}${service}:latest
|
|
||||||
done
|
|
26
.github/workflows/mirror.yml
vendored
26
.github/workflows/mirror.yml
vendored
@ -2,13 +2,33 @@ name: 同步代码
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master,jdk17 ]
|
branches: [ master,dev ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master,jdk17 ]
|
branches: [ master,dev ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sync:
|
gitcode:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: wearerequired/git-mirror-action@master #同步至 gitcode
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
with:
|
||||||
|
source-repo: "git@github.com:pig-mesh/pig-ui.git"
|
||||||
|
destination-repo: "git@gitcode.com:pig-mesh/pig-ui.git"
|
||||||
|
gitlink:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: wearerequired/git-mirror-action@master #同步至 gitlink
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
with:
|
||||||
|
source-repo: "git@github.com:pig-mesh/pig-ui.git"
|
||||||
|
destination-repo: "git@code.gitlink.org.cn:lengleng/pig-ui.git"
|
||||||
|
gitee:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: "centos:8"
|
||||||
steps:
|
steps:
|
||||||
- uses: wearerequired/git-mirror-action@master #同步至 gitee
|
- uses: wearerequired/git-mirror-action@master #同步至 gitee
|
||||||
env:
|
env:
|
||||||
|
20
package.json
20
package.json
@ -16,30 +16,30 @@
|
|||||||
"@element-plus/icons-vue": "2.3.1",
|
"@element-plus/icons-vue": "2.3.1",
|
||||||
"@wangeditor/editor": "5.1.23",
|
"@wangeditor/editor": "5.1.23",
|
||||||
"@wangeditor/editor-for-vue": "5.1.12",
|
"@wangeditor/editor-for-vue": "5.1.12",
|
||||||
"autoprefixer": "10.4.19",
|
"autoprefixer": "10.4.20",
|
||||||
"axios": "1.7.4",
|
"axios": "1.7.7",
|
||||||
"china-area-data": "^5.0.1",
|
"china-area-data": "^5.0.1",
|
||||||
"codemirror": "5.65.17",
|
"codemirror": "5.65.17",
|
||||||
"crypto-js": "4.2.0",
|
"crypto-js": "4.2.0",
|
||||||
"driver.js": "1.3.1",
|
"driver.js": "1.3.1",
|
||||||
"echarts": "5.5.1",
|
"echarts": "5.5.1",
|
||||||
"element-plus": "2.7.8",
|
"element-plus": "2.8.3",
|
||||||
"js-cookie": "3.0.5",
|
"js-cookie": "3.0.5",
|
||||||
"mitt": "3.0.1",
|
"mitt": "3.0.1",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"pinia": "2.2.2",
|
"pinia": "2.2.2",
|
||||||
"postcss": "8.4.40",
|
"postcss": "8.4.47",
|
||||||
"qs": "6.13.0",
|
"qs": "6.13.0",
|
||||||
"screenfull": "6.0.2",
|
"screenfull": "6.0.2",
|
||||||
"sm-crypto": "0.3.13",
|
"sm-crypto": "0.3.13",
|
||||||
"sortablejs": "1.15.2",
|
"sortablejs": "1.15.3",
|
||||||
"splitpanes": "3.1.5",
|
"splitpanes": "3.1.5",
|
||||||
"tailwindcss": "3.4.10",
|
"tailwindcss": "3.4.11",
|
||||||
"vue": "3.4.37",
|
"vue": "3.5.6",
|
||||||
"vue-clipboard3": "2.0.0",
|
"vue-clipboard3": "2.0.0",
|
||||||
"vue-echarts": "6.7.3",
|
"vue-echarts": "7.0.3",
|
||||||
"vue-i18n": "9.13.1",
|
"vue-i18n": "9.14.0",
|
||||||
"vue-router": "4.4.3",
|
"vue-router": "4.4.5",
|
||||||
"vuedraggable": "4.1.0"
|
"vuedraggable": "4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -553,8 +553,14 @@ const onAddFilterChange = (attr: string) => {
|
|||||||
// 4、界面显示 --> 深色模式
|
// 4、界面显示 --> 深色模式
|
||||||
const onAddDarkChange = () => {
|
const onAddDarkChange = () => {
|
||||||
const body = document.documentElement as HTMLElement;
|
const body = document.documentElement as HTMLElement;
|
||||||
if (getThemeConfig.value.isIsDark) body.setAttribute('data-theme', 'dark');
|
if (getThemeConfig.value.isIsDark) {
|
||||||
else body.setAttribute('data-theme', '');
|
body.setAttribute('data-theme', 'dark');
|
||||||
|
// body 再增加一个 dark : true 的class ,用于tailwindcss 判断是否是深色
|
||||||
|
body.classList.add('dark');
|
||||||
|
} else {
|
||||||
|
body.classList.remove('dark');
|
||||||
|
body.setAttribute('data-theme', '');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// 4、界面显示 --> 开启水印
|
// 4、界面显示 --> 开启水印
|
||||||
const onWartermarkChange = () => {
|
const onWartermarkChange = () => {
|
||||||
@ -653,6 +659,10 @@ onMounted(() => {
|
|||||||
initLayoutChangeFun();
|
initLayoutChangeFun();
|
||||||
state.isMobile = other.isMobile();
|
state.isMobile = other.isMobile();
|
||||||
});
|
});
|
||||||
|
// 监听登录成功后重新加载水印
|
||||||
|
mittBus.on('updateWartermark', () => {
|
||||||
|
onWartermarkChange();
|
||||||
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 默认样式
|
// 默认样式
|
||||||
onColorPickerChange();
|
onColorPickerChange();
|
||||||
@ -673,6 +683,7 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
mittBus.off('layoutMobileResize', () => {});
|
mittBus.off('layoutMobileResize', () => {});
|
||||||
|
mittBus.off('updateWartermark', () => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 暴露变量
|
// 暴露变量
|
||||||
|
@ -3,6 +3,7 @@ import { Session } from '/@/utils/storage';
|
|||||||
import { getUserInfo, login, loginByMobile, loginBySocial, refreshTokenApi } from '/@/api/login/index';
|
import { getUserInfo, login, loginByMobile, loginBySocial, refreshTokenApi } from '/@/api/login/index';
|
||||||
import other from '/@/utils/other';
|
import other from '/@/utils/other';
|
||||||
import { useMessage } from '/@/hooks/message';
|
import { useMessage } from '/@/hooks/message';
|
||||||
|
import mittBus from '/@/utils/mitt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function useUserInfo
|
* @function useUserInfo
|
||||||
@ -130,6 +131,8 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
authBtnList: res.data.permissions,
|
authBtnList: res.data.permissions,
|
||||||
};
|
};
|
||||||
this.userInfos = userInfo;
|
this.userInfos = userInfo;
|
||||||
|
// 重新加载水印
|
||||||
|
mittBus.emit('updateWartermark');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
2
src/types/mitt.d.ts
vendored
2
src/types/mitt.d.ts
vendored
@ -11,6 +11,7 @@
|
|||||||
* @method openShareTagsView 布局设置弹窗,开启 TagsView 共用
|
* @method openShareTagsView 布局设置弹窗,开启 TagsView 共用
|
||||||
* @method onTagsViewRefreshRouterView tagsview 刷新界面
|
* @method onTagsViewRefreshRouterView tagsview 刷新界面
|
||||||
* @method onCurrentContextmenuClick tagsview 右键菜单每项点击时
|
* @method onCurrentContextmenuClick tagsview 右键菜单每项点击时
|
||||||
|
* @method updateWartermark 更新水印显示内容
|
||||||
*/
|
*/
|
||||||
declare type MittType<T = any> = {
|
declare type MittType<T = any> = {
|
||||||
openSetingsDrawer?: string;
|
openSetingsDrawer?: string;
|
||||||
@ -23,6 +24,7 @@ declare type MittType<T = any> = {
|
|||||||
openShareTagsView?: string;
|
openShareTagsView?: string;
|
||||||
onTagsViewRefreshRouterView?: T;
|
onTagsViewRefreshRouterView?: T;
|
||||||
onCurrentContextmenuClick?: T;
|
onCurrentContextmenuClick?: T;
|
||||||
|
updateWartermark?: T;
|
||||||
};
|
};
|
||||||
|
|
||||||
// mitt 参数类型定义
|
// mitt 参数类型定义
|
||||||
|
@ -100,6 +100,7 @@ const form = reactive({
|
|||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
clientId: [
|
clientId: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '编号不能为空', trigger: 'blur'},
|
{required: true, message: '编号不能为空', trigger: 'blur'},
|
||||||
{validator: rule.validatorLowercase, trigger: 'blur'},
|
{validator: rule.validatorLowercase, trigger: 'blur'},
|
||||||
{
|
{
|
||||||
@ -110,21 +111,25 @@ const dataRules = ref({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
clientSecret: [
|
clientSecret: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '密钥不能为空', trigger: 'blur'},
|
{required: true, message: '密钥不能为空', trigger: 'blur'},
|
||||||
{validator: rule.validatorLower, trigger: 'blur'},
|
{validator: rule.validatorLower, trigger: 'blur'},
|
||||||
],
|
],
|
||||||
scope: [{required: true, message: '域不能为空', trigger: 'blur'}],
|
scope: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '域不能为空', trigger: 'blur'}],
|
||||||
authorizedGrantTypes: [{required: true, message: '授权模式不能为空', trigger: 'blur'}],
|
authorizedGrantTypes: [{required: true, message: '授权模式不能为空', trigger: 'blur'}],
|
||||||
accessTokenValidity: [
|
accessTokenValidity: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '令牌时效不能为空', trigger: 'blur'},
|
{required: true, message: '令牌时效不能为空', trigger: 'blur'},
|
||||||
{type: 'number', min: 1, message: '令牌时效不能小于一小时', trigger: 'blur'},
|
{type: 'number', min: 1, message: '令牌时效不能小于一小时', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
refreshTokenValidity: [
|
refreshTokenValidity: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '刷新时效不能为空', trigger: 'blur'},
|
{required: true, message: '刷新时效不能为空', trigger: 'blur'},
|
||||||
{type: 'number', min: 1, message: '刷新时效不能小于两小时', trigger: 'blur'},
|
{type: 'number', min: 1, message: '刷新时效不能小于两小时', trigger: 'blur'},
|
||||||
],
|
],
|
||||||
autoapprove: [{required: true, message: '自动放行不能为空', trigger: 'blur'}],
|
autoapprove: [{required: true, message: '自动放行不能为空', trigger: 'blur'}],
|
||||||
webServerRedirectUri: [{required: true, message: '回调地址不能为空', trigger: 'blur'}],
|
webServerRedirectUri: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '回调地址不能为空', trigger: 'blur'}],
|
||||||
|
authorities: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
import {getObj, deptTree, addObj, putObj} from '/@/api/admin/dept';
|
import {getObj, deptTree, addObj, putObj} from '/@/api/admin/dept';
|
||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
@ -55,8 +55,8 @@ const loading = ref(false);
|
|||||||
|
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
parentId: [{required: true, message: '上级部门不能为空', trigger: 'blur'}],
|
parentId: [{required: true, message: '上级部门不能为空', trigger: 'blur'}],
|
||||||
name: [{required: true, message: '部门名称不能为空', trigger: 'blur'}],
|
name: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '部门名称不能为空', trigger: 'blur'}],
|
||||||
sortOrder: [{required: true, message: '排序不能为空', trigger: 'blur'}],
|
sortOrder: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '排序不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
import {getItemObj, addItemObj, putItemObj, validateDictItemLabel} from '/@/api/admin/dict';
|
import {getItemObj, addItemObj, putItemObj, validateDictItemLabel} from '/@/api/admin/dict';
|
||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
@ -64,8 +64,9 @@ const dataForm = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const dataRules = reactive({
|
const dataRules = reactive({
|
||||||
value: [{required: true, message: '数据值不能为空', trigger: 'blur'}],
|
value: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '数据值不能为空', trigger: 'blur'}],
|
||||||
label: [
|
label: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '标签不能为空', trigger: 'blur'},
|
{required: true, message: '标签不能为空', trigger: 'blur'},
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
@ -74,8 +75,8 @@ const dataRules = reactive({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
description: [{required: true, message: '描述不能为空', trigger: 'blur'}],
|
description: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '描述不能为空', trigger: 'blur'}],
|
||||||
sortOrder: [{required: true, message: '排序不能为空', trigger: 'blur'}],
|
sortOrder: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '排序不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -60,6 +60,7 @@ const dataForm = reactive({
|
|||||||
|
|
||||||
const dataRules = reactive({
|
const dataRules = reactive({
|
||||||
dictType: [
|
dictType: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '类型不能为空', trigger: 'blur'},
|
{required: true, message: '类型不能为空', trigger: 'blur'},
|
||||||
{validator: rule.validatorNameCn, trigger: 'blur'},
|
{validator: rule.validatorNameCn, trigger: 'blur'},
|
||||||
{
|
{
|
||||||
@ -70,7 +71,7 @@ const dataRules = reactive({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
systemFlag: [{required: true, message: '字典类型不能为空', trigger: 'blur'}],
|
systemFlag: [{required: true, message: '字典类型不能为空', trigger: 'blur'}],
|
||||||
description: [{required: true, message: '描述不能为空', trigger: 'blur'}],
|
description: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '描述不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
import {info, pageList, putObj, addObj} from '/@/api/admin/menu';
|
import {info, pageList, putObj, addObj} from '/@/api/admin/menu';
|
||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
@ -104,13 +104,14 @@ const state = reactive({
|
|||||||
|
|
||||||
// 表单校验规则
|
// 表单校验规则
|
||||||
const dataRules = reactive({
|
const dataRules = reactive({
|
||||||
menType: [{required: true, message: '菜单类型不能为空', trigger: 'blur'}],
|
menuType: [{required: true, message: '菜单类型不能为空', trigger: 'blur'}],
|
||||||
parentId: [{required: true, message: '上级菜单不能为空', trigger: 'blur'}],
|
parentId: [{required: true, message: '上级菜单不能为空', trigger: 'blur'}],
|
||||||
name: [{required: true, message: '菜单不能为空', trigger: 'blur'}],
|
name: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '菜单不能为空', trigger: 'blur'}],
|
||||||
path: [{required: true, message: '路径不能为空', trigger: 'blur'}],
|
path: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '路径不能为空', trigger: 'blur'}],
|
||||||
icon: [{required: true, message: '图标不能为空', trigger: 'blur'}],
|
icon: [{required: true, message: '图标不能为空', trigger: 'blur'}],
|
||||||
permission: [{required: true, message: '权限代码不能为空', trigger: 'blur'}],
|
permission: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '权限代码不能为空', trigger: 'blur'}],
|
||||||
sortOrder: [{required: true, message: '排序不能为空', trigger: 'blur'}],
|
sortOrder: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '排序不能为空', trigger: 'blur'}],
|
||||||
|
enName: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -81,6 +81,7 @@ const form = reactive({
|
|||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = reactive({
|
const dataRules = reactive({
|
||||||
publicName: [
|
publicName: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '名称不能为空', trigger: 'blur'},
|
{required: true, message: '名称不能为空', trigger: 'blur'},
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
@ -90,6 +91,7 @@ const dataRules = reactive({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
publicKey: [
|
publicKey: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '参数键不能为空', trigger: 'blur'},
|
{required: true, message: '参数键不能为空', trigger: 'blur'},
|
||||||
{validator: rule.validatorCapital, trigger: 'blur'},
|
{validator: rule.validatorCapital, trigger: 'blur'},
|
||||||
{
|
{
|
||||||
@ -99,10 +101,11 @@ const dataRules = reactive({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
publicValue: [{required: true, message: '参数值不能为空', trigger: 'blur'}],
|
publicValue: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '参数值不能为空', trigger: 'blur'}],
|
||||||
status: [{required: true, message: '状态不能为空', trigger: 'blur'}],
|
status: [{required: true, message: '状态不能为空', trigger: 'blur'}],
|
||||||
publicType: [{required: true, message: '类型不能为空', trigger: 'blur'}],
|
publicType: [{required: true, message: '类型不能为空', trigger: 'blur'}],
|
||||||
systemFlag: [{required: true, message: '类型不能为空', trigger: 'blur'}],
|
systemFlag: [{required: true, message: '类型不能为空', trigger: 'blur'}],
|
||||||
|
validateCode: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
import {getObj, addObj, putObj, validatePostCode, validatePostName} from '/@/api/admin/post';
|
import {getObj, addObj, putObj, validatePostCode, validatePostName} from '/@/api/admin/post';
|
||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
@ -56,6 +56,7 @@ const form = reactive({
|
|||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
postCode: [
|
postCode: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '岗位编码不能为空', trigger: 'blur'},
|
{required: true, message: '岗位编码不能为空', trigger: 'blur'},
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
@ -65,6 +66,7 @@ const dataRules = ref({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
postName: [
|
postName: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{required: true, message: '岗位名称不能为空', trigger: 'blur'},
|
{required: true, message: '岗位名称不能为空', trigger: 'blur'},
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
@ -73,8 +75,8 @@ const dataRules = ref({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
postSort: [{required: true, message: '岗位排序不能为空', trigger: 'blur'}],
|
postSort: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '岗位排序不能为空', trigger: 'blur'}],
|
||||||
remark: [{required: true, message: '岗位描述不能为空', trigger: 'blur'}],
|
remark: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '岗位描述不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -128,6 +128,7 @@ const dataForm = reactive({
|
|||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
// 用户名校验,不能为空 、长度 5-20、不能和已有数据重复
|
// 用户名校验,不能为空 、长度 5-20、不能和已有数据重复
|
||||||
username: [
|
username: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{ required: true, message: '用户名不能为空', trigger: 'blur' },
|
{ required: true, message: '用户名不能为空', trigger: 'blur' },
|
||||||
{ min: 5, max: 20, message: '用户名称长度必须介于 5 和 20 之间', trigger: 'blur' },
|
{ min: 5, max: 20, message: '用户名称长度必须介于 5 和 20 之间', trigger: 'blur' },
|
||||||
{
|
{
|
||||||
@ -138,6 +139,7 @@ const dataRules = ref({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{ required: true, message: '密码不能为空', trigger: 'blur' },
|
{ required: true, message: '密码不能为空', trigger: 'blur' },
|
||||||
{
|
{
|
||||||
min: 6,
|
min: 6,
|
||||||
@ -149,6 +151,7 @@ const dataRules = ref({
|
|||||||
// 姓名校验,不能为空、只能是中文
|
// 姓名校验,不能为空、只能是中文
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{ validator: rule.chinese, trigger: 'blur' },
|
{ validator: rule.chinese, trigger: 'blur' },
|
||||||
],
|
],
|
||||||
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
|
deptId: [{ required: true, message: '部门不能为空', trigger: 'blur' }],
|
||||||
@ -157,6 +160,7 @@ const dataRules = ref({
|
|||||||
// 手机号校验,不能为空、新增的时不能重复校验
|
// 手机号校验,不能为空、新增的时不能重复校验
|
||||||
phone: [
|
phone: [
|
||||||
{ required: true, message: '手机号不能为空', trigger: 'blur' },
|
{ required: true, message: '手机号不能为空', trigger: 'blur' },
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{ validator: rule.validatePhone, trigger: 'blur' },
|
{ validator: rule.validatePhone, trigger: 'blur' },
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
@ -165,8 +169,9 @@ const dataRules = ref({
|
|||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
|
email: [{validator: rule.overLength, trigger: 'blur'},{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
|
||||||
lockFlag: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
lockFlag: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||||
|
nickname: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -131,9 +131,9 @@ const ruleForm = reactive({
|
|||||||
{required: true, message: '手机号不能为空', trigger: 'blur'},
|
{required: true, message: '手机号不能为空', trigger: 'blur'},
|
||||||
{validator: rule.validatePhone, trigger: 'blur'},
|
{validator: rule.validatePhone, trigger: 'blur'},
|
||||||
],
|
],
|
||||||
nickname: [{required: true, message: '昵称不能为空', trigger: 'blur'}],
|
nickname: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '昵称不能为空', trigger: 'blur'}],
|
||||||
email: [{required: true, message: '邮箱不能为空', trigger: 'blur'}],
|
email: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '邮箱不能为空', trigger: 'blur'}],
|
||||||
name: [{required: true, message: '姓名不能为空', trigger: 'blur'}],
|
name: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '姓名不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
const validatorPassword2 = (rule: any, value: any, callback: any) => {
|
const validatorPassword2 = (rule: any, value: any, callback: any) => {
|
||||||
if (value !== passwordFormData.newpassword1) {
|
if (value !== passwordFormData.newpassword1) {
|
||||||
@ -151,7 +151,7 @@ const validatorScore = (rule: any, value: any, callback: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const passwordRuleForm = reactive({
|
const passwordRuleForm = reactive({
|
||||||
password: [{required: true, message: '密码不能为空', trigger: 'blur'}],
|
password: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '密码不能为空', trigger: 'blur'}],
|
||||||
newpassword1: [
|
newpassword1: [
|
||||||
{
|
{
|
||||||
min: 6,
|
min: 6,
|
||||||
|
@ -84,7 +84,7 @@ import {useDict} from '/@/hooks/dict';
|
|||||||
import {useMessage} from '/@/hooks/message';
|
import {useMessage} from '/@/hooks/message';
|
||||||
import {addObj, getObj, putObj} from '/@/api/daemon/job';
|
import {addObj, getObj, putObj} from '/@/api/daemon/job';
|
||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const Crontab = defineAsyncComponent(() => import('/@/components/Crontab/index.vue'));
|
const Crontab = defineAsyncComponent(() => import('/@/components/Crontab/index.vue'));
|
||||||
|
|
||||||
@ -122,14 +122,15 @@ const popoverVis = (bol: boolean) => {
|
|||||||
const popoverVisible = ref(false);
|
const popoverVisible = ref(false);
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = reactive({
|
const dataRules = reactive({
|
||||||
jobName: [{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
jobName: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '任务名称不能为空', trigger: 'blur'}],
|
||||||
jobGroup: [{required: true, message: '任务组名不能为空', trigger: 'blur'}],
|
jobGroup: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '任务组名不能为空', trigger: 'blur'}],
|
||||||
jobType: [{required: true, message: '任务类型不能为空', trigger: 'blur'}],
|
jobType: [{required: true, message: '任务类型不能为空', trigger: 'blur'}],
|
||||||
cronExpression: [{required: true, message: 'cron不能为空', trigger: 'blur'}],
|
cronExpression: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: 'cron不能为空', trigger: 'blur'}],
|
||||||
misfirePolicy: [{required: true, message: '策略不能为空', trigger: 'blur'}],
|
misfirePolicy: [{required: true, message: '策略不能为空', trigger: 'blur'}],
|
||||||
executePath: [{required: true, message: '执行路径不能为空', trigger: 'blur'}],
|
executePath: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '执行路径不能为空', trigger: 'blur'}],
|
||||||
className: [{required: true, message: '执行文件不能为空', trigger: 'blur'}],
|
className: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '执行文件不能为空', trigger: 'blur'}],
|
||||||
methodName: [{required: true, message: '执行方法不能为空', trigger: 'blur'}],
|
methodName: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '执行方法不能为空', trigger: 'blur'}],
|
||||||
|
methodParamsValue: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -125,6 +125,7 @@ const validateDsName = (_rule, value, callback) => {
|
|||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '别名不能为空', trigger: 'blur'},
|
{required: true, message: '别名不能为空', trigger: 'blur'},
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{validator: validateDsName, trigger: 'blur'},
|
{validator: validateDsName, trigger: 'blur'},
|
||||||
],
|
],
|
||||||
url: [{required: true, message: 'jdbcurl不能为空', trigger: 'blur'}, {
|
url: [{required: true, message: 'jdbcurl不能为空', trigger: 'blur'}, {
|
||||||
@ -139,7 +140,7 @@ const dataRules = ref({
|
|||||||
confType: [{required: true, message: '配置类型不能为空', trigger: 'blur'}],
|
confType: [{required: true, message: '配置类型不能为空', trigger: 'blur'}],
|
||||||
dsName: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '数据库名称不能为空', trigger: 'blur'}],
|
dsName: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '数据库名称不能为空', trigger: 'blur'}],
|
||||||
instance: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '实例不能为空', trigger: 'blur'}],
|
instance: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '实例不能为空', trigger: 'blur'}],
|
||||||
port: [{required: true, message: '端口不能为空', trigger: 'blur'}],
|
port: [{validator: rule.overLength, trigger: 'blur'},{required: true, message: '端口不能为空', trigger: 'blur'}],
|
||||||
host: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '主机不能为空', trigger: 'blur'}],
|
host: [{ validator: rule.overLength, trigger: 'blur' },{required: true, message: '主机不能为空', trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
import { useMessage } from '/@/hooks/message';
|
import { useMessage } from '/@/hooks/message';
|
||||||
import { getObj, addObj, putObj, validateColumnType } from '/@/api/gen/fieldtype';
|
import { getObj, addObj, putObj, validateColumnType } from '/@/api/gen/fieldtype';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -46,13 +47,15 @@ const form = reactive({
|
|||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
columnType: [
|
columnType: [
|
||||||
{ required: true, message: '字段类型不能为空', trigger: 'blur' },
|
{ required: true, message: '字段类型不能为空', trigger: 'blur' },
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{
|
{
|
||||||
validator: (rule: any, value: any, callback: any) => {
|
validator: (rule: any, value: any, callback: any) => {
|
||||||
validateColumnType(rule, value, callback, form.id !== '');
|
validateColumnType(rule, value, callback, form.id !== '');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
attrType: [{ required: true, message: '属性类型不能为空', trigger: 'blur' }],
|
attrType: [{validator: rule.overLength, trigger: 'blur'},{ required: true, message: '属性类型不能为空', trigger: 'blur' }],
|
||||||
|
packageName: [{validator: rule.overLength, trigger: 'blur'}],
|
||||||
});
|
});
|
||||||
|
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
|
@ -27,6 +27,7 @@ import { useMessage } from '/@/hooks/message';
|
|||||||
import { addObj, getObj, putObj } from '/@/api/gen/group';
|
import { addObj, getObj, putObj } from '/@/api/gen/group';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { list as templateList } from '/@/api/gen/template';
|
import { list as templateList } from '/@/api/gen/template';
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 定义子组件向父组件传值/事件
|
// 定义子组件向父组件传值/事件
|
||||||
const emit = defineEmits(['refresh']);
|
const emit = defineEmits(['refresh']);
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -49,7 +50,7 @@ const form = reactive({
|
|||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const dataRules = ref({
|
const dataRules = ref({
|
||||||
groupName: [{ required: true, message: '分组名称不能为空', trigger: 'blur' }],
|
groupName: [{validator: rule.overLength, trigger: 'blur'},{ required: true, message: '分组名称不能为空', trigger: 'blur' }],
|
||||||
templateId: [{ required: true, message: '模板不能为空', trigger: 'blur' }],
|
templateId: [{ required: true, message: '模板不能为空', trigger: 'blur' }],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -52,8 +52,9 @@ const loginForm = reactive({
|
|||||||
|
|
||||||
// 定义校验规则
|
// 定义校验规则
|
||||||
const loginRules = reactive({
|
const loginRules = reactive({
|
||||||
mobile: [{ required: true, trigger: 'blur', validator: rule.validatePhone }],
|
mobile: [{validator: rule.overLength, trigger: 'blur'},{ required: true, trigger: 'blur', validator: rule.validatePhone }],
|
||||||
code: [
|
code: [
|
||||||
|
{validator: rule.overLength, trigger: 'blur'},
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
|
@ -63,7 +63,7 @@ import {reactive, ref, defineEmits} from 'vue';
|
|||||||
import {useUserInfo} from '/@/stores/userInfo';
|
import {useUserInfo} from '/@/stores/userInfo';
|
||||||
import {useI18n} from 'vue-i18n';
|
import {useI18n} from 'vue-i18n';
|
||||||
import {generateUUID} from "/@/utils/other";
|
import {generateUUID} from "/@/utils/other";
|
||||||
|
import {rule} from '/@/utils/validate';
|
||||||
// 使用国际化插件
|
// 使用国际化插件
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
|
|
||||||
@ -83,9 +83,9 @@ const state = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const loginRules = reactive({
|
const loginRules = reactive({
|
||||||
username: [{required: true, trigger: 'blur', message: t('password.accountPlaceholder1')}], // 用户名校验规则
|
username: [{validator: rule.overLength, trigger: 'blur'},{required: true, trigger: 'blur', message: t('password.accountPlaceholder1')}], // 用户名校验规则
|
||||||
password: [{required: true, trigger: 'blur', message: t('password.accountPlaceholder2')}], // 密码校验规则
|
password: [{validator: rule.overLength, trigger: 'blur'},{required: true, trigger: 'blur', message: t('password.accountPlaceholder2')}], // 密码校验规则
|
||||||
code: [{required: true, trigger: 'blur', message: t('password.accountPlaceholder3')}], // 验证码校验规则
|
code: [{validator: rule.overLength, trigger: 'blur'},{required: true, trigger: 'blur', message: t('password.accountPlaceholder3')}], // 验证码校验规则
|
||||||
});
|
});
|
||||||
|
|
||||||
// 是否开启验证码
|
// 是否开启验证码
|
||||||
|
@ -116,4 +116,5 @@ module.exports = {
|
|||||||
10: '40px',
|
10: '40px',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
darkMode: 'class', // 启用基于 class 的暗模式
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user