提交 21395083 编写于 作者: tony001's avatar tony001

Merge branch 'master' into 2020.07.12

上级 7db7820a
## v7.0.0-alpha.16 [2020-8-2]
### Bug修复
修复表格聚合异常
修复文本框精度问题
修复属性值规则常规规则异常
修复应用菜单标题重复问题
修复界面行为异常问题
修复下拉选组件代码表类型和属性进行不匹配问题
### 功能新增及优化
#### 模板
新增应用数据看板视图(卡片样式)、实体数据看板视图(卡片样式)
优化拷贝功能
优化临时模式新建置空父键
优化实体行为执行后逻辑
优化操作栏触发界面行为逻辑
优化实体主状态
#### 基础文件
优化数值框数值位置
优化应用语言选择组件和应用组织部门信息呈现组件
优化无数据主键界面行为逻辑
## v7.0.0-alpha.15 [2020-7-23]
### Bug修复
......
......@@ -2,9 +2,9 @@
<div class="app-actionbar">
<div class="app-actionbar-item" v-for="(item,index) in items" :key="index">
<Badge v-if="item.counterService&&item.counterService.counterData" v-show="item.visabled" :count="item.counterService.counterData[item.counterId]" type="primary">
<i-button :style="{'pointer-events':item.disabled?'none':'auto'}" @click="handleClick(item.viewlogicname)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
<i-button :style="{'pointer-events':item.disabled?'none':'auto'}" @click="handleClick(item, $event)"><i v-if="item.icon" style="margin-right: 5px;" :class="item.icon"></i>{{item.actionName}}</i-button>
</Badge>
<i-button v-show="item.visabled" :style="{'pointer-events':item.disabled?'none':'auto'}" v-else @click="handleClick(item.viewlogicname)">{{item.actionName}}</i-button>
<i-button v-show="item.visabled" :style="{'pointer-events':item.disabled?'none':'auto'}" v-else @click="handleClick(item, $event)">{{item.actionName}}</i-button>
</div>
</div>
</template>
......@@ -49,6 +49,14 @@ export default class AppActionBar extends Vue {
*/
public viewStateEvent: Subscription | undefined;
/**
* 部件数据
*
* @type {*}
* @memberof AppActionBar
*/
public data: any;
/**
* 组件初始化
*
......@@ -61,6 +69,7 @@ export default class AppActionBar extends Vue {
return;
}
if(Object.is(action,'loadmodel')){
this.data = data;
this.calcActionItemAuthState(data,this.items,this.uiService);
}
});
......@@ -72,8 +81,13 @@ export default class AppActionBar extends Vue {
*
* @memberof AppActionBar
*/
public handleClick($event:any){
this.$emit('itemClick',$event);
public handleClick(item: any, $event:any){
let _data = {
tag : item.viewlogicname,
params : this.data,
event : $event
};
this.$emit('itemClick',_data);
}
/**
......
......@@ -30,6 +30,22 @@ export default class AppColumnLink extends Vue {
*/
@Prop() public linkview?: any;
/**
* 局部上下文导航参数
*
* @type {any}
* @memberof AppColumnLink
*/
@Prop() public localContext!:any;
/**
* 局部导航参数
*
* @type {any}
* @memberof AppColumnLink
*/
@Prop() public localParam!:any;
/**
* 值项名称
*
......@@ -281,6 +297,15 @@ export default class AppColumnLink extends Vue {
// 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {};
// 附加参数处理
if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
Object.assign(arg.context,_context);
}
if (this.localParam && Object.keys(this.localParam).length >0) {
let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param);
}
return true;
}
......
......@@ -6,12 +6,16 @@
:viewdata="viewdata"
:viewparam="viewparam"
:viewDefaultUsage="false"
@viewdataschange="setValue(args)"
@viewdataschange="setValue($event)"
style="height:100%;">
</component>
</div>
<template v-if="placeholder">
<div v-if="value" class="app-embed-value">{{value}}</div>
<div v-if="value" class="app-embed-value">
<span v-for="(item,index) in value" :key="index">
{{item}}
</span>
</div>
<div v-else class="app-embed-placeholder">{{placeholder}}</div>
</template>
</div>
......@@ -174,8 +178,8 @@ export default class AppEmbedPicker extends Vue {
}
let arg: any = {};
// 合并视图上下文参数和视图参数
let param: any = JSON.parse(JSON.stringify(this.viewparams));
let context: any = JSON.parse(JSON.stringify(this.context));
arg.param = JSON.parse(JSON.stringify(this.viewparams));
arg.context = JSON.parse(JSON.stringify(this.context));
// 附加参数处理
if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
......@@ -185,8 +189,8 @@ export default class AppEmbedPicker extends Vue {
let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param);
}
this.viewdata = JSON.stringify(context);
this.viewparam = JSON.stringify(param);
this.viewdata = JSON.stringify(arg.context);
this.viewparam = JSON.stringify(arg.param);
}
/**
......@@ -243,11 +247,21 @@ export default class AppEmbedPicker extends Vue {
* @memberof AppEmbedPicker
*/
public setValue(item: any) {
let selectsrfkey: Array<any> = [];
let selectsrfmajortext: Array<any> = [];
if(item && Array.isArray(item)){
item.forEach((select: any)=>{
selectsrfkey.push(select.srfkey);
selectsrfmajortext.push(select.srfmajortext);
})
if (this.valueItem) {
this.$emit('formitemvaluechange', { name: this.valueItem, value: item[0].srfkey });
let value = selectsrfkey.length > 0 ? selectsrfkey : '';
this.$emit('formitemvaluechange', { name: this.valueItem, value: value });
}
if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item[0].srfmajortext });
let value = selectsrfmajortext.length > 0 ? selectsrfmajortext : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
}
}
......
......@@ -291,6 +291,7 @@ export default class AppFormDRUIPart extends Vue {
let _param:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localParam);
Object.assign(tempParam,_param);
}
if(this.viewparams.hasOwnProperty('copymode')) Object.assign(tempParam,{copymode:this.viewparams.copymode});
this.viewparam = JSON.stringify(tempParam);
if (this.isRelationalData) {
// 从数据模式无遮罩层
......
<template>
<dropdown trigger='click' @on-click="selectLang">
<dropdown v-if="localList.length > 1" trigger='click' @on-click="selectLang">
<span>
{{title}}
<icon size='18' type='md-arrow-dropdown'></icon>
......
......@@ -2,7 +2,7 @@
<div class="app-menu-item">
<template v-for="item in menus">
<template v-if="item.items && Array.isArray(item.items) && item.items.length > 0">
<el-submenu :class="{'isCollpase' : appMenuCollapseFlag}" v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id">
<el-submenu :class="[{'isCollpase' : appMenuCollapseFlag},item.textcls]" v-show="!item.hidden" :index="item.name" :popper-class="popperClass" :key="item.id">
<template slot='title'>
<template v-if="item.icon && item.icon != ''">
<img :src="item.icon" class='app-menu-icon' />
......@@ -20,21 +20,21 @@
</template>
<template v-else>
<template v-if="item.type =='MENUITEM'">
<el-menu-item :class="{'isFirst' : isFirst}" v-show="!item.hidden" :index="item.name" :key="item.id">
<el-menu-item :class="[{'isFirst' : isFirst},item.textcls]" v-show="!item.hidden" :index="item.name" :key="item.id">
<template v-if="item.icon && item.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>
<span v-if="(isFirst && isCollapse) ? true : false" 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 v-else-if="item.iconcls && item.iconcls != ''">
<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>
<span v-if="(isFirst && isCollapse) ? true : false" 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 v-else>
<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>
<span v-if="(isFirst && isCollapse) ? true : false" 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 slot="title">
<span ref="circleText" :class="{'app-menu-circle' : appMenuCollapseFlag, 'text' : true}" :title="$t(`app.menus.${ctrlName}.${item.name}`)">{{$t(`app.menus.${ctrlName}.${item.name}`)}}</span>
<span :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">
<span class="pull-right">
<badge :count="counterdata[item.counterid]" :overflow-count="9999"></badge>
......
......@@ -65,14 +65,36 @@ export default class AppOrgSector extends Vue {
* @memberof AppOrgSector
*/
public mounted() {
this.getData();
}
/**
* 获取数据
*
* @memberof AppOrgSector
*/
public getData(){
if (this.$store.getters.getAppData()) {
if (this.$store.getters.getAppData().context && this.$store.getters.getAppData().context.srforgsectorid && this.$store.getters.getAppData().context.srforgsectorname) {
let _context = this.$store.getters.getAppData().context;
let _srforgname = this.$store.getters.getAppData().context.srforgname;
let _srforgsectorname = this.$store.getters.getAppData().context.srforgsectorname;
if (_context && this.$store.getters.getAppData().context.srforgsectorid ){
this.selectedOrgId = this.$store.getters.getAppData().context.srforgsectorid;
this.selectedOrgName = this.$store.getters.getAppData().context.srforgsectorname;
} else {
return false;
}
if(_context && _srforgname && _srforgsectorname){
this.selectedOrgName = _srforgname + '-' + _srforgsectorname;
} else if (_context && _srforgname) {
this.selectedOrgName = _srforgname;
} else if (_context && _srforgsectorname) {
this.selectedOrgName = _srforgsectorname;
}
if (this.$store.getters.getAppData().srforgsections) {
this.selectedOrgArray = this.$store.getters.getAppData().srforgsections;
}
}
}
......
......@@ -123,6 +123,12 @@ export default class DropDownListDynamic extends Vue {
*/
@Prop() public placeholder?: string;
/**
* 属性类型
* @type {string}
* @memberof DropDownList
*/
@Prop() public valueType?: string;
/**
* 计算属性(当前值)
......@@ -199,9 +205,10 @@ export default class DropDownListDynamic extends Vue {
if(this.tag && Object.is(this.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(this.tag);
if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))];
let items: Array<any> = [...JSON.parse(JSON.stringify(codelist.items))];
this.formatCodeList(items);
} else {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
}
}else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理
......@@ -211,9 +218,10 @@ export default class DropDownListDynamic extends Vue {
let _context = data.context;
let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
});
}
}
......@@ -234,14 +242,51 @@ export default class DropDownListDynamic extends Vue {
let _context = data.context;
let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
});
}
}
}
/**
* 代码表类型和属性匹配
*
* @param {*} items
* @memberof DropDownList
*/
public formatCodeList(items: Array<any>){
let matching: boolean = true;
this.items = [];
try{
if(this.valueType){
items.forEach((item: any)=>{
const type = this.$util.typeOf(item.value);
if(type != this.valueType){
matching = false;
if(type == 'number'){
item.value = item.value.toString();
}else{
if(item.value.indexOf('.') == -1){
item.value = parseInt(item.value);
}else{
item.value = parseFloat(item.value);
}
}
}
this.items.push(item);
});
if(!matching){
console.warn(`代码表 ${ this.tag } 值类型和属性类型不匹配,已自动强制转换,请修正代码表值类型和属性类型匹配`);
}
}else{
this.items = items;
}
}catch(error){
console.warn('代码表值类型和属性类型不匹配,自动强制转换异常,请修正代码表值类型和属性类型匹配');
}
}
}
</script>
......
......@@ -8,7 +8,7 @@
:filterable="filterable === true ? true : false"
@on-open-change="onClick"
:placeholder="$t('components.dropDownList.placeholder')">
<i-option v-for="(item, index) in items" :key="index" :value="item.value.toString()">{{($t('codelist.'+tag+'.'+item.value)!== ('codelist.'+tag+'.'+item.value))?$t('codelist.'+tag+'.'+item.value) : item.text}}</i-option>
<i-option v-for="(item, index) in items" :key="index" :value="item.value">{{($t('codelist.'+tag+'.'+item.value)!== ('codelist.'+tag+'.'+item.value))?$t('codelist.'+tag+'.'+item.value) : item.text}}</i-option>
</i-select>
</template>
......@@ -139,6 +139,12 @@ export default class DropDownList extends Vue {
*/
@Prop() public placeholder?: string;
/**
* 属性类型
* @type {string}
* @memberof DropDownList
*/
@Prop() public valueType?: string;
/**
* 计算属性(当前值)
......@@ -157,7 +163,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList
*/
get currentVal() {
return this.itemValue ? this.itemValue.toString() : undefined;
return this.itemValue;
}
/**
......@@ -199,9 +205,10 @@ export default class DropDownList extends Vue {
if(this.tag && Object.is(this.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(this.tag);
if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))];
let items: Array<any> = [...JSON.parse(JSON.stringify(codelist.items))];
this.formatCodeList(items);
} else {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
}
}else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理
......@@ -211,9 +218,10 @@ export default class DropDownList extends Vue {
let _context = data.context;
let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
});
}
}
......@@ -234,14 +242,52 @@ export default class DropDownList extends Vue {
let _context = data.context;
let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res;
let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => {
console.log(`----${this.tag}----${(this.$t('app.commonWords.codeNotExist') as string)}`);
console.log(`----${this.tag}----代码表不存在`);
});
}
}
}
/**
* 代码表类型和属性匹配
*
* @param {*} items
* @memberof DropDownList
*/
public formatCodeList(items: Array<any>){
let matching: boolean = true;
this.items = [];
try{
if(this.valueType){
items.forEach((item: any)=>{
const type = this.$util.typeOf(item.value);
if(type != this.valueType){
matching = false;
if(type == 'number'){
item.value = item.value.toString();
}else{
if(item.value.indexOf('.') == -1){
item.value = parseInt(item.value);
}else{
item.value = parseFloat(item.value);
}
}
}
this.items.push(item);
});
if(!matching){
console.warn(`代码表 ${ this.tag } 值类型和属性类型不匹配,已自动强制转换,请修正代码表值类型和属性类型匹配`);
}
}else{
this.items = items;
}
}catch(error){
console.warn('代码表值类型和属性类型不匹配,自动强制转换异常,请修正代码表值类型和属性类型匹配');
}
}
}
</script>
......
......@@ -9,7 +9,7 @@
width: 100%;
}
.ivu-input-number-input{
text-align: right;
text-align: left;
}
.ivu-input-number-input:hover{
padding-right:22px;
......
......@@ -203,6 +203,7 @@ export default class EntityService {
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME),'undefined')){
let tempData:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME) as any);
data.srffrontuf = "0";
data[this.APPDEKEY] = null;
tempData.push(data);
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData));
return {"status":200,"data":data};
......
......@@ -52,9 +52,9 @@ export class UIActionTool {
return;
}
let value: string | null = _params[name];
if (value && value.startsWith('%') && value.endsWith('%')) {
if (value && typeof(value) === 'string' && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
if (arg && arg.hasOwnProperty(key)) {
if (arg && arg.hasOwnProperty(key) && Object.is(actionTarget, 'SINGLEKEY')) {
value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
......@@ -76,7 +76,7 @@ export class UIActionTool {
}
let value: string | null = _params[name];
let values: any[] = [];
if (value && value.startsWith('%') && value.endsWith('%')) {
if (value && typeof(value) === 'string' && value.startsWith('%') && value.endsWith('%')) {
const key = value.substring(1, value.length - 1);
args.forEach((arg: any) => {
if (arg && arg.hasOwnProperty(key)) {
......
......@@ -276,12 +276,8 @@ export class Verify {
}
if (Object.is(paramType, 'ENTITYFIELD')) {
value2 = value2 ? value2.toLowerCase() : '';
// const _value2Field = form.findFormItem(value2);
// if (!_value2Field) {
// this.errorInfo = `表单项${value2}未配置`;
// return true;
// }
// value2 = _value2Field.getValue();
const _value2Field = form[value2]?form[value2]:value2;
value2 = _value2Field;
}
if (Util.isEmpty(errorInfo)) {
errorInfo = '内容必须符合值规则';
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册