提交 196e7185 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 66117a28
...@@ -8,4 +8,7 @@ ...@@ -8,4 +8,7 @@
.ivu-input-number-input{ .ivu-input-number-input{
text-align: right; text-align: right;
} }
.ivu-input-number-input:hover{
padding-right:22px;
}
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
viewtag="ouindex-view" viewtag="ouindex-view"
:selectTheme="selectTheme" :selectTheme="selectTheme"
:isDefaultPage="isDefaultPage" :isDefaultPage="isDefaultPage"
:isBlankMode="isBlankMode"
:defPSAppView="defPSAppView" :defPSAppView="defPSAppView"
name="appmenu" name="appmenu"
ref='appmenu' ref='appmenu'
...@@ -626,6 +627,14 @@ export default class OUIndexViewBase extends Vue { ...@@ -626,6 +627,14 @@ export default class OUIndexViewBase extends Vue {
*/ */
public isDefaultPage: boolean = true; public isDefaultPage: boolean = true;
/**
* 空白视图模式
*
* @type {boolean}
* @memberof OUIndexViewBase
*/
public isBlankMode:boolean = false;
/** /**
* 获取样式 * 获取样式
* *
......
...@@ -114,6 +114,12 @@ export class Interceptors { ...@@ -114,6 +114,12 @@ export class Interceptors {
if (res.status === 401) { if (res.status === 401) {
this.doNoLogin(_data.data); this.doNoLogin(_data.data);
} }
if(res.status === 403){
if(res.data && res.data.status && Object.is(res.data.status,"FORBIDDEN")){
let alertMessage:string ="非常抱歉,您无权操作此数据,如需操作请联系管理员!";
Object.assign(res.data,{localizedMessage:alertMessage,message:alertMessage});
}
}
// if (res.status === 404) { // if (res.status === 404) {
// this.router.push({ path: '/404' }); // this.router.push({ path: '/404' });
// } else if (res.status === 500) { // } else if (res.status === 500) {
......
...@@ -323,13 +323,21 @@ export default class OUIndexViewBase extends Vue implements ControlInterface { ...@@ -323,13 +323,21 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
@Prop() mode: any; @Prop() mode: any;
/** /**
* 当前菜单是否在默认视图上 * 应用起始页面
* *
* @type {*} * @type {boolean}
* @memberof OUIndexViewBase * @memberof OUIndexViewBase
*/ */
@Prop({ default: false }) isDefaultPage?: boolean; @Prop({ default: false }) isDefaultPage?: boolean;
/**
* 空白视图模式
*
* @type {boolean}
* @memberof OUIndexViewBase
*/
@Prop({ default: false }) isBlankMode?:boolean;
/** /**
* 默认打开视图 * 默认打开视图
* *
...@@ -441,7 +449,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface { ...@@ -441,7 +449,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
* @memberof OUIndexViewBase * @memberof OUIndexViewBase
*/ */
public doMenuSelect(): void { public doMenuSelect(): void {
if (!this.isDefaultPage) { if (!this.isDefaultPage || this.isBlankMode) {
return; return;
} }
const appFuncs: any[] = this.menuMode.getAppFuncs(); const appFuncs: any[] = this.menuMode.getAppFuncs();
...@@ -485,7 +493,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface { ...@@ -485,7 +493,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
public computeMenuSelect(items: any[], appfunctag: string): boolean { public computeMenuSelect(items: any[], appfunctag: string): boolean {
const appFuncs: any[] = this.menuMode.getAppFuncs(); const appFuncs: any[] = this.menuMode.getAppFuncs();
return items.some((item: any) => { return items.some((item: any) => {
if (Object.is(appfunctag, '') && !Object.is(item.appfunctag, '')) { if (Object.is(appfunctag, '') && !Object.is(item.appfunctag, '') && item.opendefault) {
const appfunc = appFuncs.find((_appfunc: any) => Object.is(_appfunc.appfunctag, item.appfunctag)); const appfunc = appFuncs.find((_appfunc: any) => Object.is(_appfunc.appfunctag, item.appfunctag));
if (appfunc.routepath) { if (appfunc.routepath) {
this.defaultActive = item.name; this.defaultActive = item.name;
...@@ -493,7 +501,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface { ...@@ -493,7 +501,7 @@ export default class OUIndexViewBase extends Vue implements ControlInterface {
return true; return true;
} }
} }
if (Object.is(item.appfunctag, appfunctag)) { if (Object.is(item.appfunctag, appfunctag) && item.opendefault) {
this.setHideSideBar(item); this.setHideSideBar(item);
this.defaultActive = item.name; this.defaultActive = item.name;
return true; return true;
......
...@@ -105,6 +105,7 @@ import MainService from './main-form-service'; ...@@ -105,6 +105,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -993,7 +994,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -993,7 +994,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -1025,23 +1026,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1025,23 +1026,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -54,6 +54,7 @@ import NewFormService from './new-form-form-service'; ...@@ -54,6 +54,7 @@ import NewFormService from './new-form-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -796,7 +797,7 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -796,7 +797,7 @@ export default class NewFormBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -822,23 +823,19 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -822,23 +823,19 @@ export default class NewFormBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -84,6 +84,7 @@ import MainService from './main-form-service'; ...@@ -84,6 +84,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -735,7 +736,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -735,7 +736,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -757,23 +758,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -757,23 +758,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -216,6 +216,7 @@ import MainService from './main-form-service'; ...@@ -216,6 +216,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -1381,7 +1382,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1381,7 +1382,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -1438,23 +1439,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1438,23 +1439,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -60,6 +60,7 @@ import NewFormService from './new-form-form-service'; ...@@ -60,6 +60,7 @@ import NewFormService from './new-form-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -883,7 +884,7 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -883,7 +884,7 @@ export default class NewFormBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -913,23 +914,19 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -913,23 +914,19 @@ export default class NewFormBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -72,6 +72,7 @@ import MainService from './main-form-service'; ...@@ -72,6 +72,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -847,7 +848,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -847,7 +848,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -874,23 +875,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -874,23 +875,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -48,6 +48,7 @@ import NewFormService from './new-form-form-service'; ...@@ -48,6 +48,7 @@ import NewFormService from './new-form-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -741,7 +742,7 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -741,7 +742,7 @@ export default class NewFormBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -765,23 +766,19 @@ export default class NewFormBase extends Vue implements ControlInterface { ...@@ -765,23 +766,19 @@ export default class NewFormBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof NewFormBase * @memberof NewFormBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -49,6 +49,7 @@ import MainService from './main-form-service'; ...@@ -49,6 +49,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -700,7 +701,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -700,7 +701,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -722,23 +723,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -722,23 +723,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -84,6 +84,7 @@ import MainService from './main-form-service'; ...@@ -84,6 +84,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -777,7 +778,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -777,7 +778,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -801,23 +802,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -801,23 +802,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -76,6 +76,7 @@ import MainService from './main-form-service'; ...@@ -76,6 +76,7 @@ import MainService from './main-form-service';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail'; import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import schema from 'async-validator';
@Component({ @Component({
...@@ -710,7 +711,7 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -710,7 +711,7 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
* @memberof MainBase * @memberof MainBase
*/ */
public formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void { public async formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }){
...@@ -733,23 +734,19 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -733,23 +734,19 @@ export default class MainBase extends Vue implements ControlInterface {
* 表单项检查逻辑 * 表单项检查逻辑
* *
* @public * @public
* @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal } * @param name 属性名
* @memberof MainBase * @memberof MainBase
*/ */
public checkItem(name:string):boolean{ public checkItem(name:string):Promise<any> {
let regular :any = null; return new Promise((resolve, reject) => {
let isRight :boolean = false; var validator = new schema({[name]:this.rules[name]});
this.rules[name].forEach((item:any)=>{ validator.validate({[name]:this.data[name]}).then(()=>{
Object.keys(item).forEach((name:string)=>{ resolve(true);
if(name == 'pattern'){ })
regular = item[name]; .catch(() => {
} resolve(false);
}); });;
}); })
if(regular){
isRight = regular.test(this.data[name]);
}
return isRight;
} }
/** /**
......
...@@ -39,6 +39,10 @@ zuul: ...@@ -39,6 +39,10 @@ zuul:
path: /v7/login path: /v7/login
serviceId: ibzuaa-api serviceId: ibzuaa-api
stripPrefix: false stripPrefix: false
changepwd:
path: /v7/changepwd
serviceId: ibzuaa-api
stripPrefix: false
uaa: uaa:
path: /uaa/** path: /uaa/**
serviceId: ibzuaa-api serviceId: ibzuaa-api
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册