提交 7d26ee18 编写于 作者: ibizdev's avatar ibizdev

zhouweidong@lab.ibiz5.com 发布系统代码

上级 a22a3966
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
"qs": "^6.9.1", "qs": "^6.9.1",
"rxjs": "^6.5.4", "rxjs": "^6.5.4",
"tinymce": "4.8.5", "tinymce": "4.8.5",
"view-design": "^4.1.0", "view-design": "4.2.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-class-component": "^7.0.2", "vue-class-component": "^7.0.2",
"vue-grid-layout": "^2.3.7", "vue-grid-layout": "^2.3.7",
......
<template> <template>
<div class="appAddressSelection"> <div class="appAddressSelection">
<el-cascader <el-cascader
style="width:100%"
:disabled="disabled" :disabled="disabled"
size ="medium" size ="medium"
v-model="CurrentVal" v-model="CurrentVal"
...@@ -14,6 +15,7 @@ import { Component, Vue, Prop, Model, Watch } from 'vue-property-decorator'; ...@@ -14,6 +15,7 @@ import { Component, Vue, Prop, Model, Watch } from 'vue-property-decorator';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import axios from 'axios'; import axios from 'axios';
import { cityCode } from './city_code'
@Component({}) @Component({})
export default class AppAddressSelection extends Vue { export default class AppAddressSelection extends Vue {
...@@ -63,12 +65,7 @@ export default class AppAddressSelection extends Vue { ...@@ -63,12 +65,7 @@ export default class AppAddressSelection extends Vue {
* @memberof AppAddressSelection * @memberof AppAddressSelection
*/ */
public getcity() { public getcity() {
axios.get("../../assets/json/city_code.json").then((response: any) => { this.format(cityCode);
this.format(response.data);
}).catch((response: any) => {
console.log((this.$t('components.appAddressSelection.loadDataFail') as string));
});
} }
/** /**
...@@ -86,11 +83,11 @@ export default class AppAddressSelection extends Vue { ...@@ -86,11 +83,11 @@ export default class AppAddressSelection extends Vue {
* @memberof AppAddressSelection * @memberof AppAddressSelection
*/ */
public format(data :any) { public format(data :any) {
let data1 = JSON.parse(JSON.stringify(data).replace(/city/g, 'children')) let town = JSON.parse(JSON.stringify(data).replace(/city/g, 'children'))
let data2 = JSON.parse(JSON.stringify(data1).replace(/name/g, 'label')) let county = JSON.parse(JSON.stringify(town).replace(/name/g, 'label'))
let data3 = JSON.parse(JSON.stringify(data2).replace(/area/g, 'children')) let city = JSON.parse(JSON.stringify(county).replace(/area/g, 'children'))
let data4 = JSON.parse(JSON.stringify(data3).replace(/code/g, 'value')) let province = JSON.parse(JSON.stringify(city).replace(/code/g, 'value'))
this.city = data4; this.city = province;
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
size='small' size='small'
:trigger-on-focus="true" :trigger-on-focus="true"
:fetch-suggestions="onSearch" :fetch-suggestions="onSearch"
:sort="sort"
@select="onACSelect" @select="onACSelect"
@input="onInput" @input="onInput"
@blur="onBlur" @blur="onBlur"
...@@ -123,6 +124,15 @@ export default class AppAutocomplete extends Vue { ...@@ -123,6 +124,15 @@ export default class AppAutocomplete extends Vue {
*/ */
@Prop() public valueitem?: string; @Prop() public valueitem?: string;
/**
* 排序
*
* @type {string}
* @memberof AppAutocomplete
*/
@Prop() public sort?: string;
/** /**
* 值 * 值
* *
...@@ -196,6 +206,9 @@ export default class AppAutocomplete extends Vue { ...@@ -196,6 +206,9 @@ export default class AppAutocomplete extends Vue {
query = ''; query = '';
} }
this.inputState = false; this.inputState = false;
if(this.sort && !Object.is(this.sort, "")) {
Object.assign(_param, { sort: this.sort });
}
Object.assign(_param, { query: query }); Object.assign(_param, { query: query });
// 错误信息国际化 // 错误信息国际化
let error: string = (this.$t('components.appAutocomplete.error') as any); let error: string = (this.$t('components.appAutocomplete.error') as any);
......
<template> <template>
<div class="app-data-upload-view"> <div class="app-data-upload-view">
<el-row :gutter="20"> <el-row style="margin-top:24px" :gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-button type="primary" @click="handleUpLoad">{{$t('components.appDataUploadView.selectfile')}}</el-button> <el-button type="primary" @click="handleUpLoad">{{$t('components.appDataUploadView.selectfile')}}</el-button>
<input ref="inputUpLoad" type="file" style="display: none" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="importFile"/> <input ref="inputUpLoad" type="file" style="display: none" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" @change="importFile"/>
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<el-row style="height:calc(100% - 128px);padding: 0px 12px;"> <el-row style="height:480px;padding: 0px 12px;">
<div class="data-info-content" > <div class="data-info-content" >
<template v-if="importDataArray.length >0 && isUploading === false"> <template v-if="importDataArray.length >0 && isUploading === false">
<ul> <ul>
<li v-for="(item,index) in importDataArray" :key="index" class="font-class"> <li v-for="(item,index) in importDataArray" :key="index" class="font-class">
{{$t('components.appDataUploadView.dataid')+item[importUniqueItem]+$t('components.appDataUploadView.read')+'......'}} {{item[importUniqueItem]?$t('components.appDataUploadView.dataid')+item[importUniqueItem]+$t('components.appDataUploadView.read')+'......':$t('components.appDataUploadView.read')+'......'}}
</li> </li>
</ul> </ul>
</template> </template>
...@@ -285,7 +285,7 @@ export default class AppDataUploadView extends Vue { ...@@ -285,7 +285,7 @@ export default class AppDataUploadView extends Vue {
this.importDataArray = []; this.importDataArray = [];
try{ try{
this.entityService.getService(this.viewparams.serviceName).then((service:any) =>{ this.entityService.getService(this.viewparams.serviceName).then((service:any) =>{
service.ImportData(this.viewdata,{name:this.importId,data:tempDataArray}).then((res:any) =>{ service.ImportData(this.viewdata,{name:this.importId,importData:tempDataArray}).then((res:any) =>{
const result:any = res.data; const result:any = res.data;
if(result && result.rst !== 0){ if(result && result.rst !== 0){
this.promptInfo = (this.$t('components.appDataUploadView.importfailed') as string); this.promptInfo = (this.$t('components.appDataUploadView.importfailed') as string);
...@@ -295,6 +295,10 @@ export default class AppDataUploadView extends Vue { ...@@ -295,6 +295,10 @@ export default class AppDataUploadView extends Vue {
this.importSuccessData = result.data; this.importSuccessData = result.data;
this.promptInfo = (this.$t('components.appDataUploadView.completed') as string); this.promptInfo = (this.$t('components.appDataUploadView.completed') as string);
this.isUploading = false; this.isUploading = false;
}).catch((error:any) =>{
this.isUploading = false;
this.promptInfo = (this.$t('components.appDataUploadView.importfailed') as string);
console.error(error);
}) })
}).catch((error:any) =>{ }).catch((error:any) =>{
this.isUploading = false; this.isUploading = false;
......
.ivu-dropdown{ .app-department-select{
.ivu-dropdown-rel{ .ivu-dropdown{
.tree-input{ .ivu-dropdown-rel{
.ivu-input-suffix{ .tree-input{
width: auto; .ivu-input-suffix{
text-align: right; width: auto;
.icon-arrow{ text-align: right;
margin-right: 4px; .icon-arrow{
margin-right: 4px;
}
}
.el-icon-circle-close{
display: none;
} }
} }
.el-icon-circle-close{ .tree-input:hover{
display: none; .el-icon-circle-close{
display: inline-block;
}
} }
} }
.tree-input:hover{ .ivu-select-dropdown{
.el-icon-circle-close{ max-height: 200px;
display: inline-block; overflow: scroll;
.tree-contant{
overflow:inherit;
} }
} }
} }
.ivu-select-dropdown{ .el-input__inner{
max-height: 200px; height: 32px;
overflow: scroll; line-height: 32px
.tree-contant{ }
overflow:inherit; .el-input__icon{
} line-height: 32px;
} }
} }
...@@ -332,20 +332,16 @@ export default class AppFormDRUIPart extends Vue { ...@@ -332,20 +332,16 @@ export default class AppFormDRUIPart extends Vue {
} }
// 表单保存之前 // 表单保存之前
if (Object.is($event.type, 'beforesave')) { if (Object.is($event.type, 'beforesave')) {
if(Object.is(this.refviewtype,'DEMEDITVIEW9') || Object.is(this.refviewtype,'DEGRIDVIEW9') || Object.is(this.refviewtype,'DEGRIDVIEW')){ // 支持嵌入视图类型:嵌入视图本身抛drdatasaved的视图,如:DEMEDITVIEW9,DEGRIDVIEW9,DEGRIDVIEW等
// 从数据模式直接通知保存 // 从数据模式直接通知保存
if(this.tempMode && Object.is(this.tempMode,"2")){ if(this.tempMode && Object.is(this.tempMode,"2")){
this.formDruipart.next({action:'save',data:$event.data}); this.formDruipart.next({action:'save',data:$event.data});
}else{ }else{
if($event.data && !Object.is($event.data.srfuf,"0")){ if($event.data && !Object.is($event.data.srfuf,"0")){
this.formDruipart.next({action:'save',data:$event.data}); this.formDruipart.next({action:'save',data:$event.data});
}else{ }else{
this.$emit('drdatasaved',$event); this.$emit('drdatasaved',$event);
} }
}
} else {
// 不需要保存的界面也要抛出事件,供计数器计算
this.$emit('drdatasaved',$event);
} }
} }
// 表单保存完成 // 表单保存完成
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="app-menu-item"> <div class="app-menu-item">
<template v-for="item in menus"> <template v-for="item in menus">
<template v-if="item.items && Array.isArray(item.items) && item.items.length > 0"> <template v-if="item.items && Array.isArray(item.items) && item.items.length > 0">
<el-submenu v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id"> <el-submenu :class="{'isCollpase' : appMenuCollapseFlag}" v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id">
<template slot='title'> <template slot='title'>
<template v-if="item.icon && item.icon != ''"> <template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' /> <img :src="item.icon" class='app-menu-icon' />
...@@ -13,25 +13,28 @@ ...@@ -13,25 +13,28 @@
<template v-else> <template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i> <i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
</template> </template>
<span class='text' :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template> </template>
<app-menu-item :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popperclass="popperClass"></app-menu-item> <app-menu-item :isCollapse="isCollapse" :menus="item.items" :ctrlName="ctrlName" :isFirst="false" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item>
</el-submenu> </el-submenu>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.type =='MENUITEM'"> <template v-if="item.type =='MENUITEM'">
<el-menu-item v-show="!item.hidden" :index="item.name" :key="item.id"> <el-menu-item :class="{'isFirst' : isFirst}" v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.icon != ''"> <template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' /> <img :src="item.icon" class='app-menu-icon' />
<span v-if="isCollapse" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template> </template>
<template v-else-if="item.iconcls && item.iconcls != ''"> <template v-else-if="item.iconcls && item.iconcls != ''">
<i :class="[item.iconcls, 'app-menu-icon']"></i> <i :class="[item.iconcls, 'app-menu-icon']"></i>
<span v-if="isCollapse" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template> </template>
<template v-else> <template v-else>
<i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i> <i v-if="isFirst" class='fa fa-cogs app-menu-icon'></i>
<span v-if="isCollapse" ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
</template> </template>
<template slot="title"> <template slot="title">
<span class="text" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span> <span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0"> <template v-if="counterdata && counterdata[item.counterid] && counterdata[item.counterid] > 0">
<span class="pull-right"> <span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge> <badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
...@@ -94,5 +97,47 @@ export default class AppMenuItem extends Vue { ...@@ -94,5 +97,47 @@ export default class AppMenuItem extends Vue {
*/ */
@Prop() public isFirst!: boolean; @Prop() public isFirst!: boolean;
/**
* 菜单是否缩进
*
* @type {*}
* @memberof AppMenuItem
*/
@Prop() public isCollapse!: boolean;
/**
* 菜单缩进,元素类名标记
*
* @type {*}
* @memberof AppMenuItem
*/
public appMenuCollapseFlag: boolean = false;
/**
* vue 生命周期
*
* @memberof AppIndexViewBase
*/
public mounted() {
this.onCollapsechangeChange();
}
/**
* 根据菜单缩进状态修改菜单项值
*/
onCollapsechangeChange() {
if(this.isCollapse && this.isFirst) {
this.appMenuCollapseFlag = true;
let appMenuCircle: any[] = this.$refs.circleText as any[];
if(appMenuCircle) {
appMenuCircle.forEach((item: any) => {
let text: string = (item.innerText as string).slice(0,1);
item.innerText = text;
})
}
}
}
} }
</script> </script>
\ No newline at end of file
.app-org-select { .app-org-select {
width: 100%; width: 100%;
.el-input__inner{
height: 32px !important;
line-height: 32px !important;
}
.el-input__icon{
line-height: 32px;
}
} }
\ No newline at end of file
...@@ -8,14 +8,17 @@ ...@@ -8,14 +8,17 @@
:trigger-on-focus="true" :fetch-suggestions="(query, callback) => { this.onSearch(query, callback, true) }" @select="onACSelect" :trigger-on-focus="true" :fetch-suggestions="(query, callback) => { this.onSearch(query, callback, true) }" @select="onACSelect"
@input="onInput" @blur="onBlur" style='width:100%;'> @input="onInput" @blur="onBlur" style='width:100%;'>
<template v-slot:default="{item}"> <template v-slot:default="{item}">
<template v-if="item.isNew"> <!-- <template v-if="item.isNew">
<div v-if="linkview" @click="newAndEdit">{{$t('components.appPicker.newAndEdit')}}</div> <div v-if="linkview" @click="newAndEdit">{{$t('components.appPicker.newAndEdit')}}</div>
</template> -->
<template v-if="item.tag">
<div @click="clickAction(item.tag)">{{item.caption}}</div>
</template> </template>
<slot v-else name="default" :item="item"></slot> <slot v-else name="default" :item="item"></slot>
</template> </template>
<template v-slot:suffix> <template v-slot:suffix>
<i v-if="curvalue && !disabled" class='el-icon-circle-close' @click="onClear"></i> <i v-if="curvalue && !disabled" class='el-icon-circle-close' @click="onClear"></i>
<i v-if="!Object.is(editortype, 'ac')" class='el-icon-search' @click="openView"></i> <i v-if="!Object.is(editortype, 'ac') && showButton" class='el-icon-search' @click="openView"></i>
<icon v-if="linkview" type="ios-open-outline" @click="openLinkView"/> <icon v-if="linkview" type="ios-open-outline" @click="openLinkView"/>
</template> </template>
</el-autocomplete> </el-autocomplete>
...@@ -37,7 +40,10 @@ ...@@ -37,7 +40,10 @@
@change="onSelect" :disabled="disabled" style='width:100%;' clearable @change="onSelect" :disabled="disabled" style='width:100%;' clearable
@clear="onClear" @visible-change="onSelectOpen"> @clear="onClear" @visible-change="onSelectOpen">
<template v-if="items"> <template v-if="items">
<el-option v-for="_item in items" :key="_item[deKeyField]" :value="_item[deKeyField]" :label="_item[deMajorField]" :disabled="_item.disabled"></el-option> <template v-for="_item in items">
<el-option v-if="!_item.tag" :key="_item[deKeyField]" :value="_item[deKeyField]" :label="_item[deMajorField]" :disabled="_item.disabled"></el-option>
<el-option v-else :key="_item[deKeyField]" value="action"><span @click="clickAction(_item.tag)" style="float: left; width: 100%;">{{ _item.caption }}</span></el-option>
</template>
</template> </template>
</el-select> </el-select>
<span style='position: absolute;right: 5px;color: #c0c4cc;top:0;font-size: 13px;'> <span style='position: absolute;right: 5px;color: #c0c4cc;top:0;font-size: 13px;'>
...@@ -55,7 +61,6 @@ import { AppModal } from '@/utils'; ...@@ -55,7 +61,6 @@ import { AppModal } from '@/utils';
@Component({ @Component({
}) })
export default class AppPicker extends Vue { export default class AppPicker extends Vue {
/** /**
* 视图上下文 * 视图上下文
* *
...@@ -128,6 +133,14 @@ export default class AppPicker extends Vue { ...@@ -128,6 +133,14 @@ export default class AppPicker extends Vue {
*/ */
@Prop() public disabled?: boolean; @Prop() public disabled?: boolean;
/**
* 是否显示按钮
*
* @type {boolean}
* @memberof AppPicker
*/
@Prop({default:true}) public showButton?: boolean;
/** /**
* 类型 * 类型
* *
...@@ -184,6 +197,14 @@ export default class AppPicker extends Vue { ...@@ -184,6 +197,14 @@ export default class AppPicker extends Vue {
*/ */
@Prop() public sort?: string; @Prop() public sort?: string;
/**
* 行为组
*
* @type {Array<any>}
* @memberof AppPicker
*/
@Prop() public actionDetails?:Array<any>;
/** /**
* 值 * 值
...@@ -350,8 +371,11 @@ export default class AppPicker extends Vue { ...@@ -350,8 +371,11 @@ export default class AppPicker extends Vue {
} else { } else {
this.items = [...response]; this.items = [...response];
} }
if(this.acParams && this.linkview){ // if(this.acParams && this.linkview){
this.items.push({ isNew :true }); // this.items.push({ isNew :true });
// }
if(this.acParams && this.actionDetails && this.actionDetails.length >0){
this.items = [...this.items,...this.actionDetails];
} }
if (callback) { if (callback) {
callback(this.items); callback(this.items);
...@@ -681,6 +705,17 @@ export default class AppPicker extends Vue { ...@@ -681,6 +705,17 @@ export default class AppPicker extends Vue {
return true; return true;
} }
/**
* 触发界面行为
*
* @param {*} arg
* @returns
* @memberof AppPicker
*/
public clickAction(arg:any){
this.$emit('editoractionclick',arg);
}
/** /**
* 创建并编辑 * 创建并编辑
* *
......
...@@ -175,15 +175,18 @@ export default class InputBox extends Vue { ...@@ -175,15 +175,18 @@ export default class InputBox extends Vue {
*/ */
public addEvent(){ public addEvent(){
if(Object.is(this.type, "number")){ if(Object.is(this.type, "number")){
let inputNumber :any = document.getElementById(this.numberId); // 整个页面渲染完之后再去执行
let handlerWrap :any = inputNumber.firstElementChild; this.$nextTick(() => {
handlerWrap.onmouseover=()=>{ let inputNumber :any = document.getElementById(this.numberId);
inputNumber.style.paddingRight="15px"; let handlerWrap :any = inputNumber.firstElementChild;
inputNumber.style.transition="all 0.2s linear"; handlerWrap.onmouseover=()=>{
} inputNumber.style.paddingRight="15px";
handlerWrap.onmouseout=()=>{ inputNumber.style.transition="all 0.2s linear";
inputNumber.style.paddingRight="0px"; }
} handlerWrap.onmouseout=()=>{
inputNumber.style.paddingRight="0px";
}
});
} }
} }
......
...@@ -36,7 +36,15 @@ export default class ChartViewEngine extends SearchViewEngine { ...@@ -36,7 +36,15 @@ export default class ChartViewEngine extends SearchViewEngine {
* @memberof ChartViewEngine * @memberof ChartViewEngine
*/ */
public load(opts: any = {}): void { public load(opts: any = {}): void {
super.load(opts); if (this.getSearchForm()) {
const tag = this.getSearchForm().name;
this.setViewState2({ tag: tag, action: 'loaddraft', viewdata: this.view.viewparams });
}else if(this.getChart() && this.isLoadDefault) {
const tag = this.getChart().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
} else {
this.isLoadDefault = true;
}
} }
/** /**
......
...@@ -70,17 +70,14 @@ export default class DataViewEngine extends MDViewEngine { ...@@ -70,17 +70,14 @@ export default class DataViewEngine extends MDViewEngine {
* @memberof DataViewEngine * @memberof DataViewEngine
*/ */
public doRemove(): void { public doRemove(): void {
let selectedData = this.getMDCtrl() && this.getMDCtrl().getSelection(); let selectedData = this.getMDCtrl() && this.getMDCtrl().getSelection();
if (!selectedData || selectedData == null || selectedData.length === 0) { if (!selectedData || selectedData == null || selectedData.length === 0) {
return; return;
} }
let dataInfo = ''; let dataInfo = '';
selectedData.forEach((record: any, index: number) => { selectedData.forEach((record: any, index: number) => {
let srfmajortext = record.srfmajortext; let srfmajortext = record.srfmajortext;
if (index < 5) { if (index < 5) {
if (!Object.is(dataInfo, '')) { if (!Object.is(dataInfo, '')) {
dataInfo += '、'; dataInfo += '、';
} }
...@@ -88,18 +85,13 @@ export default class DataViewEngine extends MDViewEngine { ...@@ -88,18 +85,13 @@ export default class DataViewEngine extends MDViewEngine {
} else { } else {
return false; return false;
} }
}); });
if (selectedData.length < 5) { if (selectedData.length < 5) {
dataInfo = dataInfo + '共' + selectedData.length + '条数据'; dataInfo = dataInfo + '共' + selectedData.length + '条数据';
} else { } else {
dataInfo = dataInfo + '...' + '共' + selectedData.length + '条数据'; dataInfo = dataInfo + '...' + '共' + selectedData.length + '条数据';
} }
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, ''); dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
// 询问框 // 询问框
this.view.$Modal.confirm({ this.view.$Modal.confirm({
title:'警告', title:'警告',
...@@ -107,9 +99,7 @@ export default class DataViewEngine extends MDViewEngine { ...@@ -107,9 +99,7 @@ export default class DataViewEngine extends MDViewEngine {
onOk:() => { onOk:() => {
this.removeData(null); this.removeData(null);
}, },
onCancel: () => { onCancel: () => {}
}
}); });
} }
...@@ -124,15 +114,6 @@ export default class DataViewEngine extends MDViewEngine { ...@@ -124,15 +114,6 @@ export default class DataViewEngine extends MDViewEngine {
if (!arg) { if (!arg) {
arg = {}; arg = {};
} }
// if (this.getParentMode()) {
// Object.assign(arg, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(arg, this.getParentData());
// }
if (!arg.srfkeys) { if (!arg.srfkeys) {
// 获取要删除的数据集合 // 获取要删除的数据集合
const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection(); const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection();
......
...@@ -198,7 +198,8 @@ export default class EditViewEngine extends ViewEngine { ...@@ -198,7 +198,8 @@ export default class EditViewEngine extends ViewEngine {
if(index !== -1){ if(index !== -1){
viewdata.srfTitle = viewdata.srfTitle.substr(0,index); viewdata.srfTitle = viewdata.srfTitle.substr(0,index);
} }
if(this.view.$tabPageExp){ // 解决表格视图标题问题
if(this.view.$tabPageExp && this.view.viewDefaultUsage){
this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfTitle), this.view.$t(viewdata.srfTitle), info); this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfTitle), this.view.$t(viewdata.srfTitle), info);
} }
if(this.view.$route){ if(this.view.$route){
......
...@@ -123,15 +123,6 @@ export default class ListViewEngine extends MDViewEngine { ...@@ -123,15 +123,6 @@ export default class ListViewEngine extends MDViewEngine {
if (!arg) { if (!arg) {
arg = {}; arg = {};
} }
// if (this.getParentMode()) {
// Object.assign(arg, this.getParentMode());
// }
// if (this.getParentData()) {
// Object.assign(arg, this.getParentData());
// }
if (!arg.srfkeys) { if (!arg.srfkeys) {
// 获取要删除的数据集合 // 获取要删除的数据集合
const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection(); const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection();
......
...@@ -29,6 +29,7 @@ export default { ...@@ -29,6 +29,7 @@ export default {
deleteError: "Failed to delete", deleteError: "Failed to delete",
delDataFail: "Failed to delete data", delDataFail: "Failed to delete data",
noData: "No data", noData: "No data",
startsuccess:"Start successful"
}, },
local:{ local:{
new: "New", new: "New",
......
...@@ -25,10 +25,11 @@ export default { ...@@ -25,10 +25,11 @@ export default {
rulesException: "值规则校验异常", rulesException: "值规则校验异常",
saveSuccess: "保存成功", saveSuccess: "保存成功",
saveFailed: "保存失败", saveFailed: "保存失败",
deleteSuccess: "删除成功", deleteSuccess: "删除成功",
deleteError: "删除失败", deleteError: "删除失败",
delDataFail: "删除数据失败", delDataFail: "删除数据失败",
noData: "暂无数据", noData: "暂无数据",
startsuccess:"启动成功"
}, },
local:{ local:{
new: "新建", new: "新建",
......
...@@ -69,10 +69,10 @@ export default { ...@@ -69,10 +69,10 @@ export default {
columns: { columns: {
sys_roleid: "角色标识", sys_roleid: "角色标识",
sys_rolename: "角色名称", sys_rolename: "角色名称",
prolename: "父角色名称",
memo: "备注", memo: "备注",
updatedate: "更新时间", updatedate: "更新时间",
proleid: "父角色标识", proleid: "父角色标识",
prolename: "父角色名称",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -68,10 +68,10 @@ export default { ...@@ -68,10 +68,10 @@ export default {
columns: { columns: {
sys_roleid: "角色标识", sys_roleid: "角色标识",
sys_rolename: "角色名称", sys_rolename: "角色名称",
prolename: "父角色名称",
memo: "备注", memo: "备注",
updatedate: "更新时间", updatedate: "更新时间",
proleid: "父角色标识", proleid: "父角色标识",
prolename: "父角色名称",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
overflow: hidden; overflow: hidden;
color:#303133; color:#303133;
background-color: #fff; background-color: #fff;
.app-horizontal-layout{
.view-container{
height: calc(100% - 32px);
margin: 12px;
}
}
.index_header{ .index_header{
height:65px; height:65px;
padding:0 20px; padding:0 20px;
......
import { Store } from 'vuex'; import { Store } from 'vuex';
import { Http } from '@/utils'; import { Http } from '@/utils';
import CodeListService from "@service/app/codelist-service";
/** /**
* 实体服务基类 * 实体服务基类
...@@ -115,6 +116,34 @@ export default class EntityService { ...@@ -115,6 +116,34 @@ export default class EntityService {
return this.$store; return this.$store;
} }
/**
* 获取代码表
*
* @memberof EntityService
*/
public getCodeList(tag:string,codelistType:string,context:any = {},param:any ={}){
return new Promise((resolve:any,reject:any) =>{
if(tag && Object.is(codelistType,"STATIC")){
let returnItems:Array<any> = [];
const codelist = (this.getStore() as Store<any>).getters.getCodeList(tag);
if (codelist) {
returnItems = [...JSON.parse(JSON.stringify(codelist.items))];
} else {
console.log(`----${tag}----代码表不存在`);
}
resolve(returnItems);
}else if(tag && Object.is(codelistType,"DYNAMIC")){
let codeListService = new CodeListService({ $store: this.$store });
codeListService.getItems(tag,context,param).then((res:any) => {
resolve(res);
}).catch((error:any) => {
reject(`${tag}代码表不存在`);
console.log(`----${tag}----代码表不存在`);
});
}
})
}
/** /**
* 初始化基础数据 * 初始化基础数据
* *
...@@ -581,7 +610,9 @@ export default class EntityService { ...@@ -581,7 +610,9 @@ export default class EntityService {
* @memberof EntityService * @memberof EntityService
*/ */
public async ImportData(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async ImportData(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
return Http.getInstance().post(`/${this.APPDENAME}/import`,data,isloading); let _data:Array<any> = [];
if (data && data.importData) _data = data.importData;
return Http.getInstance().post(`/${this.APPDENAME}/import?config=${data.name}`,_data,isloading);
} }
/** /**
......
...@@ -116,6 +116,12 @@ export class Verify { ...@@ -116,6 +116,12 @@ export class Verify {
* @memberof Verify * @memberof Verify
*/ */
public static compareNumber(value: number, value2: number): number { public static compareNumber(value: number, value2: number): number {
if(isNaN(value)){
value = 0;
}
if(isNaN(value2)){
value2 = 0;
}
if (value > value2) { if (value > value2) {
return 1; return 1;
} else if (value < value2) { } else if (value < value2) {
...@@ -270,12 +276,12 @@ export class Verify { ...@@ -270,12 +276,12 @@ export class Verify {
} }
if (Object.is(paramType, 'ENTITYFIELD')) { if (Object.is(paramType, 'ENTITYFIELD')) {
value2 = value2 ? value2.toLowerCase() : ''; value2 = value2 ? value2.toLowerCase() : '';
const _value2Field = form.findFormItem(value2); // const _value2Field = form.findFormItem(value2);
if (!_value2Field) { // if (!_value2Field) {
this.errorInfo = `表单项${value2}未配置`; // this.errorInfo = `表单项${value2}未配置`;
return true; // return true;
} // }
value2 = _value2Field.getValue(); // value2 = _value2Field.getValue();
} }
if (Util.isEmpty(errorInfo)) { if (Util.isEmpty(errorInfo)) {
errorInfo = '内容必须符合值规则'; errorInfo = '内容必须符合值规则';
...@@ -284,7 +290,7 @@ export class Verify { ...@@ -284,7 +290,7 @@ export class Verify {
const result = this.testCond(value, op, value2); const result = this.testCond(value, op, value2);
if (!result) { if (!result) {
if (primaryModel) { if (primaryModel) {
throw new Error(this.errorInfo); // throw new Error(this.errorInfo);
} }
} }
return !result; return !result;
......
...@@ -8,7 +8,105 @@ ...@@ -8,7 +8,105 @@
:collapse="isCollapse" :collapse="isCollapse"
@select="select" @select="select"
:default-active="defaultActive"> :default-active="defaultActive">
<app-menu-item :menus="menus" :ctrlName="'main'" :isFirst="true" :counterdata="counterdata" :popperclass="popperClass"></app-menu-item> <template v-if="Object.is(mode,'horizontal')">
<template v-for="item0 in menus">
<template v-if="item0.items && Array.isArray(item0.items) && item0.items.length > 0">
<el-submenu v-show="!item0.hidden" :index="item0.name" :popper-class="popperClass" :key="item0.id">
<template slot='title'>
<template v-if="item0.icon && item0.icon != ''">
<img :src="item0.icon" class='app-menu-icon' />
</template>
<template v-else-if="item0.iconcls && item0.iconcls != ''">
<i :class="[item0.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<span class='text' :title="$t('app.menus.appindexview.' + item0.name)">{{$t('app.menus.appindexview.' + item0.name)}}</span>
</template>
<template v-for="item1 in item0.items">
<template v-if="item1.items && Array.isArray(item1.items) && item1.items.length > 0">
<el-submenu v-show="!item1.hidden" :index="item1.name" :popper-class="popperClass" :key="item1.id">
<template slot='title'>
<template v-if="item1.icon && item1.icon != ''">
<img :src="item1.icon" class='app-menu-icon' />
</template>
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<span class='text' :title="$t('app.menus.appindexview.' + item1.name)">{{$t('app.menus.appindexview.' + item1.name)}}</span>
</template>
<template v-for="item2 in item1.items">
<template v-if="item2.type =='MENUITEM'">
<el-menu-item v-show="!item2.hidden" :index="item2.name" :key="item2.id">
<template v-if="item2.icon && item2.icon != ''">
<img :src="item2.icon" class='app-menu-icon' />
</template>
<template v-else-if="item2.iconcls && item2.iconcls != ''">
<i :class="[item2.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.appindexview.' + item2.name)">{{$t('app.menus.appindexview.' + item2.name)}}</span>
<template v-if="counterdata && counterdata[item2.counterid] && counterdata[item2.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item2.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
</template>
</el-submenu>
</template>
<template v-else>
<template v-if="item1.type =='MENUITEM'">
<el-menu-item v-show="!item1.hidden" :index="item1.name" :key="item1.id">
<template v-if="item1.icon && item1.icon != ''">
<img :src="item1.icon" class='app-menu-icon' />
</template>
<template v-else-if="item1.iconcls && item1.iconcls != ''">
<i :class="[item1.iconcls, 'app-menu-icon']"></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.appindexview.' + item1.name)">{{$t('app.menus.appindexview.' + item1.name)}} </span>
<template v-if="counterdata && counterdata[item1.counterid] && counterdata[item1.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item1.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
</template>
</template>
</el-submenu>
</template>
<template v-else>
<template v-if="item0.type =='MENUITEM'">
<el-menu-item v-show="!item0.hidden" :index="item0.name" :key="item0.id">
<template v-if="item0.icon && item0.icon != ''">
<img :src="item0.icon" class='app-menu-icon' />
</template>
<template v-else-if="item0.iconcls && item0.iconcls != ''">
<i :class="[item0.iconcls, 'app-menu-icon']"></i>
</template>
<template v-else>
<i class='fa fa-cogs app-menu-icon'></i>
</template>
<template slot="title">
<span class="text" :title="$t('app.menus.appindexview.' + item0.name)">{{$t('app.menus.appindexview.' + item0.name)}}</span>
<template v-if="counterdata && counterdata[item0.counterid] && counterdata[item0.counterid] > 0">
<span class="pull-right">
<badge :count="counterdata[item0.counterid]" :overflow-count="9999"></badge>
</span>
</template>
</template>
</el-menu-item>
</template>
</template>
</template>
</template>
<app-menu-item v-else :isCollapse="isCollapse" :menus="menus" :ctrlName="'appindexview'" :isFirst="true" :counterdata="counterdata" :popper-class="popperClass"></app-menu-item>
</el-menu> </el-menu>
</div> </div>
</template> </template>
......
...@@ -24,18 +24,47 @@ ...@@ -24,18 +24,47 @@
font-size: 12px; font-size: 12px;
width: 18px; width: 18px;
} }
.el-submenu__title .app-menu-icon,.el-submenu__title .app-menu-icon{ .el-submenu__title .app-menu-icon,.el-menu-item .app-menu-icon{
width:20px; width:20px;
font-size: 14px; font-size: 14px;
} }
.el-submenu__title .text { .el-submenu__title .text {
font-size: 16px; font-size: 16px;
} }
.el-menu-item, .el-submenu__title { .el-submenu__title .app-menu-circle,.el-menu-item .app-menu-circle {
display: inline-block;
border-radius: 50%;
width: 20px;
height: 20px;
line-height: 36px;
vertical-align:middle;
background: rgb(var(--app-footer-background-color-rgb));
border: 1px solid #fff;
border-color: rgb(var(--app-header-color-rgb));
color: rgb(var(--app-header-color-rgb));;
text-align: center;
font: 12px Arial, sans-serif;
}
.el-submenu__title, .el-menu-item {
height: 50px; height: 50px;
font-size: 14px; font-size: 14px;
line-height: 50px; line-height: 50px;
border-left: 4px !important;
}
.el-menu-item .el-tooltip {
padding-left: 12px !important;
}
.isCollpase .el-submenu__title{
padding-left: 12px !important;
} }
.isFirst > .text {
font-size: 16px !important;
}
.el-menu-item, .el-submenu, .el-menu { .el-menu-item, .el-submenu, .el-menu {
border-top: 1px solid #fff; border-top: 1px solid #fff;
} }
...@@ -73,6 +102,23 @@ ...@@ -73,6 +102,23 @@
overflow: hidden; overflow: hidden;
} }
} }
.el-menu--horizontal{
display: flex;
width: calc(100vw - 1100px);
height: 65px;
flex-wrap: nowrap;
overflow-x:scroll;
padding-top: 3px;
.el-menu-item{
overflow: visible;
}
.el-submenu{
.el-submenu__title{
padding-right: 0px !important;
padding-left: 0px !important;
}
}
}
.ivu-divider-horizontal { .ivu-divider-horizontal {
width: 100%; width: 100%;
min-width: 100%; min-width: 100%;
...@@ -110,5 +156,4 @@ ...@@ -110,5 +156,4 @@
} }
} }
// this is less // this is less
...@@ -584,31 +584,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -584,31 +584,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -1111,6 +1142,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1111,6 +1142,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1583,6 +1625,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1583,6 +1625,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1651,6 +1695,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1651,6 +1695,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</span> </span>
</template> </template>
<template v-slot="{row,column,$index}"> <template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.authtime"></app-format-data> <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.authtime"></app-format-data>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -473,31 +473,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -473,31 +473,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -907,6 +938,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -907,6 +938,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1378,6 +1420,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1378,6 +1420,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1446,6 +1490,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1446,6 +1490,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -549,31 +549,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -549,31 +549,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -1031,6 +1062,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1031,6 +1062,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1502,6 +1544,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1502,6 +1544,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1570,6 +1614,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1570,6 +1614,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</span> </span>
</template> </template>
<template v-slot="{row,column,$index}"> <template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data> <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.updatedate"></app-format-data>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -619,31 +619,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -619,31 +619,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -1116,6 +1147,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1116,6 +1147,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1587,6 +1629,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1587,6 +1629,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1655,6 +1699,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1655,6 +1699,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -45,6 +45,25 @@ ...@@ -45,6 +45,25 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-if="getColumnState('prolename')">
<el-table-column show-overflow-tooltip :prop="'prolename'" :label="$t('entities.sysrole.main_grid.columns.prolename')" :width="350" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.sysrole.main_grid.columns.prolename')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<app-column-link deKeyField='sysrole' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'sys-roleredirect-view', height: 0,width: 0,title: $t('entities.sysrole.views.redirectview.title'),placement: '', isRedirectView: true,deResParameters: [
]
,parameters: [
{ pathName: 'sysroles', parameterName: 'sysrole' },
{ pathName: 'redirectview', parameterName: 'redirectview' }
]}" valueitem="proleid">
<span>{{row.prolename}}</span>
</app-column-link >
</template>
</el-table-column>
</template>
<template v-if="getColumnState('memo')"> <template v-if="getColumnState('memo')">
<el-table-column show-overflow-tooltip :prop="'memo'" :label="$t('entities.sysrole.main_grid.columns.memo')" :width="250" :align="'left'" :sortable="'custom'"> <el-table-column show-overflow-tooltip :prop="'memo'" :label="$t('entities.sysrole.main_grid.columns.memo')" :width="250" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}"> <template v-slot:header="{column}">
...@@ -65,7 +84,7 @@ ...@@ -65,7 +84,7 @@
</span> </span>
</template> </template>
<template v-slot="{row,column,$index}"> <template v-slot="{row,column,$index}">
<app-format-data format="YYYY-MM-DD hh:mm:ss" :data="row.updatedate"></app-format-data> <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.updatedate"></app-format-data>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
...@@ -81,25 +100,6 @@ ...@@ -81,25 +100,6 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-if="getColumnState('prolename')">
<el-table-column show-overflow-tooltip :prop="'prolename'" :label="$t('entities.sysrole.main_grid.columns.prolename')" :width="350" :align="'left'" :sortable="'custom'">
<template v-slot:header="{column}">
<span class="column-header ">
{{$t('entities.sysrole.main_grid.columns.prolename')}}
</span>
</template>
<template v-slot="{row,column,$index}">
<app-column-link deKeyField='sysrole' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'sys-roleredirect-view', height: 0,width: 0,title: $t('entities.sysrole.views.redirectview.title'),placement: '', isRedirectView: true,deResParameters: [
]
,parameters: [
{ pathName: 'sysroles', parameterName: 'sysrole' },
{ pathName: 'redirectview', parameterName: 'redirectview' }
]}" valueitem="proleid">
<span>{{row.prolename}}</span>
</app-column-link >
</template>
</el-table-column>
</template>
<template v-if="adaptiveState"> <template v-if="adaptiveState">
<el-table-column></el-table-column> <el-table-column></el-table-column>
</template> </template>
...@@ -640,6 +640,14 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -640,6 +640,14 @@ export default class MainBase extends Vue implements ControlInterface {
util: 'PX', util: 'PX',
isEnableRowEdit: false, isEnableRowEdit: false,
}, },
{
name: 'prolename',
label: '父角色名称',
langtag: 'entities.sysrole.main_grid.columns.prolename',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
{ {
name: 'memo', name: 'memo',
label: '备注', label: '备注',
...@@ -664,14 +672,6 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -664,14 +672,6 @@ export default class MainBase extends Vue implements ControlInterface {
util: 'PX', util: 'PX',
isEnableRowEdit: false, isEnableRowEdit: false,
}, },
{
name: 'prolename',
label: '父角色名称',
langtag: 'entities.sysrole.main_grid.columns.prolename',
show: true,
util: 'PX',
isEnableRowEdit: false,
},
] ]
/** /**
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -566,31 +566,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -566,31 +566,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -1048,6 +1079,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1048,6 +1079,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1520,6 +1562,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1520,6 +1562,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1588,6 +1632,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1588,6 +1632,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -556,31 +556,62 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -556,31 +556,62 @@ export default class MainBase extends Vue implements ControlInterface {
* @param {{ name: string }} { name } * @param {{ name: string }} { name }
* @memberof MainBase * @memberof MainBase
*/ */
public verifyDeRules(name:string,rule:any = this.deRules) :{isPast:boolean,infoMessage:string}{ public verifyDeRules(name:string,rule:any = this.deRules,op:string = "AND") :{isPast:boolean,infoMessage:string}{
let falg = {isPast:true,infoMessage:""}; let falg:any = {infoMessage:""};
if(!rule[name]){ if(!rule[name]){
return falg; return falg;
} }
let opValue = op == 'AND'? true :false;
let startOp = (val:boolean)=>{
if(falg.isPast){
if(opValue){
falg.isPast = falg && val;
}else{
falg.isPast = falg || val;
}
}else{
falg.isPast = val;
}
}
rule[name].forEach((item:any) => { rule[name].forEach((item:any) => {
if(item.type == 'SIMPLE' && this.data[this.service.getItemNameByDeName(item.deName)] != item.paramValue){ let dataValue = item.deName?this.data[this.service.getItemNameByDeName(item.deName)]:"";
falg.isPast = false; // 常规规则
if(item.type == 'SIMPLE'){
startOp(!this.$verify.checkFieldSimpleRule(dataValue,item.condOP,item.paramValue,item.ruleInfo,item.paramType,{},item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'REGEX' && (item.isNotMode? item.RegExCode.test(this.data[name]) : !item.RegExCode.test(this.data[name]))){ // 数值范围
falg.isPast = false; if(item.type == 'VALUERANGE2'){
startOp( !this.$verify.checkFieldValueRangeRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo; falg.infoMessage = item.ruleInfo;
} }
if(item.type == 'STRINGLENGTH' ){ // 正则式
let valueLength :number = this.data[name]?this.data[name].length:0; if (item.type == "REGEX") {
if(item.isNotMode? valueLength > item.minValue && valueLength < item.maxValue : !(valueLength > item.minValue && valueLength < item.maxValue)){ startOp(!this.$verify.checkFieldRegExRule(dataValue,item.regExCode,item.ruleInfo,item.isKeyCond));
falg.isPast = false; falg.infoMessage = item.ruleInfo;
falg.infoMessage = item.ruleInfo; }
} // 长度
if (item.type == "STRINGLENGTH") {
startOp(!this.$verify.checkFieldStringLengthRule(dataValue,item.minValue,item.isIncludeMinValue,item.maxValue,item.isIncludeMaxValue,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
}
// 系统值规则
if(item.type == "SYSVALUERULE") {
startOp(!this.$verify.checkFieldSysValueRule(dataValue,item.sysRule.regExCode,item.ruleInfo,item.isKeyCond));
falg.infoMessage = item.ruleInfo;
} }
// 分组
if(item.type == 'GROUP'){ if(item.type == 'GROUP'){
falg = this.verifyDeRules('group',item) falg = this.verifyDeRules('group',item)
if(item.isNotMode){
falg.isPast = !falg.isPast;
}
} }
}); });
if(!falg.hasOwnProperty("isPast")){
falg.isPast = true;
}
return falg; return falg;
} }
...@@ -1038,6 +1069,17 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1038,6 +1069,17 @@ export default class MainBase extends Vue implements ControlInterface {
this.data[$event.name] = $event.value; this.data[$event.name] = $event.value;
} }
/**
* 编辑器行为触发
*
* @param {*} arg
* @returns {void}
* @memberof MainBase
*/
public onFormItemActionClick(arg:any){
if(arg && (arg instanceof Function)) arg();
}
/** /**
* 设置数据项值 * 设置数据项值
* *
...@@ -1510,6 +1552,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1510,6 +1552,8 @@ export default class MainBase extends Vue implements ControlInterface {
const post: Promise<any> = _this.save({},false); const post: Promise<any> = _this.save({},false);
post.then((response:any) =>{ post.then((response:any) =>{
const arg:any = response.data; const arg:any = response.data;
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
} }
...@@ -1578,6 +1622,8 @@ export default class MainBase extends Vue implements ControlInterface { ...@@ -1578,6 +1622,8 @@ export default class MainBase extends Vue implements ControlInterface {
this.$nextTick(() => { this.$nextTick(() => {
this.formState.next({ type: 'save', data: arg }); this.formState.next({ type: 'save', data: arg });
}); });
// 准备工作流数据,填充未存库数据
Object.assign(arg,this.getData());
// 准备提交参数 // 准备提交参数
if(this.viewparams){ if(this.viewparams){
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
display: inline; display: inline;
} }
.el-table { .el-table {
.el-table__row{
.grid-uiaction-divider {
padding:0 10px 0 10px;
border-left: 1px #b3b3b3 solid;
}
.grid-first-uiaction {
padding:0 10px 0 10px;
}
}
.quick-toolbar{ .quick-toolbar{
display: inline-block; display: inline-block;
button{ button{
......
...@@ -27,7 +27,6 @@ import java.util.List; ...@@ -27,7 +27,6 @@ import java.util.List;
@MapperScan("cn.ibizlab.*.mapper") @MapperScan("cn.ibizlab.*.mapper")
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
}) })
public class webApplication extends WebMvcConfigurerAdapter{ public class webApplication extends WebMvcConfigurerAdapter{
......
...@@ -21,7 +21,6 @@ import java.util.List; ...@@ -21,7 +21,6 @@ import java.util.List;
@EnableTransactionManagement @EnableTransactionManagement
@EnableFeignClients(basePackages = {"cn.ibizlab" }) @EnableFeignClients(basePackages = {"cn.ibizlab" })
@SpringBootApplication(exclude = { @SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class,
}) })
@ComponentScan(basePackages = {"cn.ibizlab"} @ComponentScan(basePackages = {"cn.ibizlab"}
// ,excludeFilters={ // ,excludeFilters={
......
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysAppSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysAppSearchContext;
import cn.ibizlab.core.uaa.service.ISysAppService; import cn.ibizlab.core.uaa.service.ISysAppService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
/** /**
...@@ -121,3 +122,4 @@ public class SysAppServiceImpl implements ISysAppService { ...@@ -121,3 +122,4 @@ public class SysAppServiceImpl implements ISysAppService {
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysAuthLogSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysAuthLogSearchContext;
import cn.ibizlab.core.uaa.service.ISysAuthLogService; import cn.ibizlab.core.uaa.service.ISysAuthLogService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -185,3 +186,4 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth ...@@ -185,3 +186,4 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysPSSystemSearchContext;
import cn.ibizlab.core.uaa.service.ISysPSSystemService; import cn.ibizlab.core.uaa.service.ISysPSSystemService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -208,3 +209,4 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS ...@@ -208,3 +209,4 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysPermissionSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysPermissionSearchContext;
import cn.ibizlab.core.uaa.service.ISysPermissionService; import cn.ibizlab.core.uaa.service.ISysPermissionService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -188,3 +189,4 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S ...@@ -188,3 +189,4 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysRolePermissionSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysRolePermissionSearchContext;
import cn.ibizlab.core.uaa.service.ISysRolePermissionService; import cn.ibizlab.core.uaa.service.ISysRolePermissionService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -246,3 +247,4 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM ...@@ -246,3 +247,4 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysRoleSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysRoleSearchContext;
import cn.ibizlab.core.uaa.service.ISysRoleService; import cn.ibizlab.core.uaa.service.ISysRoleService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -226,3 +227,4 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -226,3 +227,4 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysUserRoleSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysUserRoleSearchContext;
import cn.ibizlab.core.uaa.service.ISysUserRoleService; import cn.ibizlab.core.uaa.service.ISysUserRoleService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -247,3 +248,4 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs ...@@ -247,3 +248,4 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
} }
...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysUserSearchContext; ...@@ -28,6 +28,7 @@ import cn.ibizlab.core.uaa.filter.SysUserSearchContext;
import cn.ibizlab.core.uaa.service.ISysUserService; import cn.ibizlab.core.uaa.service.ISysUserService;
import cn.ibizlab.util.helper.CachedBeanCopier; import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -207,3 +208,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -207,3 +208,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
} }
<?xml version="1.1" encoding="UTF-8" standalone="no"?> !!!!模版产生代码错误:----
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${dbinst.getUserName()} [in template "CODETEMPL_zh_CN" at line 28, column 24]
<!--输出实体[SYS_AUTHLOG]数据结构 --> ----
<changeSet author="a_A_5d9d78509" id="tab-sys_authlog-40-1"> \ No newline at end of file
<createTable tableName="IBZAUTHLOG">
<column name="LOGID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_AUTHLOG_LOGID"/>
</column>
<column name="USERNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="PERSONNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="DOMAIN" remarks="" type="VARCHAR(100)">
</column>
<column name="AUTHTIME" remarks="" type="DATETIME">
</column>
<column name="IPADDR" remarks="" type="VARCHAR(100)">
</column>
<column name="MACADDR" remarks="" type="VARCHAR(100)">
</column>
<column name="USERAGENT" remarks="" type="VARCHAR(100)">
</column>
<column name="AUTHCODE" remarks="" type="VARCHAR(15)">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-39-2">
<createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
</column>
<column name="PSSYSTEMNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="SYSSTRUCTURE" remarks="" type="TEXT(1048576)">
</column>
<column name="APPS" remarks="" type="TEXT(1048576)">
</column>
<column name="MD5CHECK" remarks="" type="VARCHAR(100)">
</column>
<column name="SHOWORDER" remarks="" type="INT">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-219-3">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
</column>
<column name="SYS_PERMISSIONNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="PERMISSIONTYPE" remarks="" type="VARCHAR(60)">
</column>
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
</column>
<column name="ENABLE" remarks="" type="INT">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role-115-4">
<createTable tableName="IBZROLE">
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_SYS_ROLEID"/>
</column>
<column name="SYS_ROLENAME" remarks="" type="VARCHAR(200)">
</column>
<column name="MEMO" remarks="" type="VARCHAR(100)">
</column>
<column name="PROLEID" remarks="" type="VARCHAR(100)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-98-5">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
</column>
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
</column>
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_user_role-72-6">
<createTable tableName="IBZUSER_ROLE">
<column name="SYS_USER_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_ROLE_SYS_USER_ROLE"/>
</column>
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
</column>
<column name="SYS_USERID" remarks="" type="VARCHAR(100)">
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
</createTable>
</changeSet>
<!--输出实体[SYS_AUTHLOG]外键关系 -->
<!--输出实体[SYS_PSSYSTEM]外键关系 -->
<!--输出实体[SYS_PERMISSION]外键关系 -->
<!--输出实体[SYS_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role-115-7">
<addForeignKeyConstraint baseColumnNames="PROLEID" baseTableName="IBZROLE" constraintName="DER1N_SYS_ROLE_SYS_ROLE_PROLEI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-98-8">
<addForeignKeyConstraint baseColumnNames="SYS_PERMISSIONID" baseTableName="IBZROLE_PERMISSION" constraintName="DER1N_SYS_ROLE_PERMISSION_SYS_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_PERMISSIONID" referencedTableName="IBZPERMISSION" validate="true"/>
</changeSet>
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-72-10">
<addForeignKeyConstraint baseColumnNames="SYS_ROLEID" baseTableName="IBZUSER_ROLE" constraintName="DER1N_SYS_USER_ROLE_SYS_ROLE_S" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SYS_ROLEID" referencedTableName="IBZROLE" validate="true"/>
</changeSet>
</databaseChangeLog>
...@@ -95,9 +95,9 @@ public class DEFieldDefaultValueAspect ...@@ -95,9 +95,9 @@ public class DEFieldDefaultValueAspect
for(Object item:(List)obj) { for(Object item:(List)obj) {
if(item instanceof EntityBase) { if(item instanceof EntityBase) {
if(deFields==null) { if(deFields==null) {
deFields = DEFieldCacheMap.getDEFields(obj.getClass()); deFields = DEFieldCacheMap.getDEFields(item.getClass());
curUser = AuthenticationUser.getAuthenticationUser(); curUser = AuthenticationUser.getAuthenticationUser();
keyField=DEFieldCacheMap.getDEKeyField(obj.getClass()); keyField=DEFieldCacheMap.getDEKeyField(item.getClass());
if(StringUtils.isEmpty(keyField)) if(StringUtils.isEmpty(keyField))
return true; return true;
} }
......
...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component; ...@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Map;
/** /**
* 数据库版本检查 * 数据库版本检查
...@@ -28,6 +29,7 @@ import java.lang.reflect.Field; ...@@ -28,6 +29,7 @@ import java.lang.reflect.Field;
public class VersionCheckAspect public class VersionCheckAspect
{ {
private final ExpressionParser parser = new SpelExpressionParser(); private final ExpressionParser parser = new SpelExpressionParser();
private final String IgnoreField="ignoreversioncheck";
@SneakyThrows @SneakyThrows
@Before("execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)") @Before("execution(* cn.ibizlab.*.rest.*.update(..)) && @annotation(versionCheck)")
...@@ -47,19 +49,26 @@ public class VersionCheckAspect ...@@ -47,19 +49,26 @@ public class VersionCheckAspect
@Before("execution(* cn.ibizlab.*.rest.*.updateBy*(..)) && @annotation(versionCheck)") @Before("execution(* cn.ibizlab.*.rest.*.updateBy*(..)) && @annotation(versionCheck)")
public void BeforeUpdateBy(JoinPoint point, VersionCheck versionCheck){ public void BeforeUpdateBy(JoinPoint point, VersionCheck versionCheck){
Object[] args = point.getArgs(); Object[] args = point.getArgs();
Object id=args[1]; if(args.length>=2){
Object dto=args[2]; Object id=args[args.length-2];
if(ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(dto)) Object dto=args[args.length-1];
return; if(ObjectUtils.isEmpty(id) || ObjectUtils.isEmpty(dto))
String versionField=versionCheck.versionfield(); return;
if(StringUtils.isEmpty(versionField)) String versionField=versionCheck.versionfield();
return; if(StringUtils.isEmpty(versionField))
versionCheck(versionCheck,point.getTarget(),dto,id); return;
versionCheck(versionCheck,point.getTarget(),dto,id);
}
} }
private void versionCheck(VersionCheck versionCheck,Object resource,Object dto,Object id ){ private void versionCheck(VersionCheck versionCheck,Object resource,Object dto,Object id ){
EvaluationContext context = new StandardEvaluationContext(); EvaluationContext context = new StandardEvaluationContext();
context.setVariable("dto",dto); context.setVariable("dto",dto);
//忽略版本检查
Expression dtoParamsExp = parser.parseExpression("#dto.extensionparams");
Map dtoParam=dtoParamsExp.getValue(context, Map.class);
if(!ObjectUtils.isEmpty(dtoParam) && !ObjectUtils.isEmpty(dtoParam.get(IgnoreField)) && dtoParam.get(IgnoreField).equals(1))
return;
Expression newExp = parser.parseExpression(String.format("#dto.%s",versionCheck.versionfield())); Expression newExp = parser.parseExpression(String.format("#dto.%s",versionCheck.versionfield()));
Object newVersion=newExp.getValue(context); Object newVersion=newExp.getValue(context);
if(ObjectUtils.isEmpty(newVersion)) if(ObjectUtils.isEmpty(newVersion))
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册