提交 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] ## v7.0.0-alpha.15 [2020-7-23]
### Bug修复 ### Bug修复
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div class="app-actionbar"> <div class="app-actionbar">
<div class="app-actionbar-item" v-for="(item,index) in items" :key="index"> <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"> <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> </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>
</div> </div>
</template> </template>
...@@ -49,6 +49,14 @@ export default class AppActionBar extends Vue { ...@@ -49,6 +49,14 @@ export default class AppActionBar extends Vue {
*/ */
public viewStateEvent: Subscription | undefined; public viewStateEvent: Subscription | undefined;
/**
* 部件数据
*
* @type {*}
* @memberof AppActionBar
*/
public data: any;
/** /**
* 组件初始化 * 组件初始化
* *
...@@ -61,6 +69,7 @@ export default class AppActionBar extends Vue { ...@@ -61,6 +69,7 @@ export default class AppActionBar extends Vue {
return; return;
} }
if(Object.is(action,'loadmodel')){ if(Object.is(action,'loadmodel')){
this.data = data;
this.calcActionItemAuthState(data,this.items,this.uiService); this.calcActionItemAuthState(data,this.items,this.uiService);
} }
}); });
...@@ -72,8 +81,13 @@ export default class AppActionBar extends Vue { ...@@ -72,8 +81,13 @@ export default class AppActionBar extends Vue {
* *
* @memberof AppActionBar * @memberof AppActionBar
*/ */
public handleClick($event:any){ public handleClick(item: any, $event:any){
this.$emit('itemClick',$event); let _data = {
tag : item.viewlogicname,
params : this.data,
event : $event
};
this.$emit('itemClick',_data);
} }
/** /**
......
...@@ -30,6 +30,22 @@ export default class AppColumnLink extends Vue { ...@@ -30,6 +30,22 @@ export default class AppColumnLink extends Vue {
*/ */
@Prop() public linkview?: any; @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 { ...@@ -281,6 +297,15 @@ export default class AppColumnLink extends Vue {
// 合并表单参数 // 合并表单参数
arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {}; arg.param = this.viewparams ? JSON.parse(JSON.stringify(this.viewparams)) : {};
arg.context = this.context ? JSON.parse(JSON.stringify(this.context)) : {}; 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; return true;
} }
......
...@@ -6,12 +6,16 @@ ...@@ -6,12 +6,16 @@
:viewdata="viewdata" :viewdata="viewdata"
:viewparam="viewparam" :viewparam="viewparam"
:viewDefaultUsage="false" :viewDefaultUsage="false"
@viewdataschange="setValue(args)" @viewdataschange="setValue($event)"
style="height:100%;"> style="height:100%;">
</component> </component>
</div> </div>
<template v-if="placeholder"> <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> <div v-else class="app-embed-placeholder">{{placeholder}}</div>
</template> </template>
</div> </div>
...@@ -174,8 +178,8 @@ export default class AppEmbedPicker extends Vue { ...@@ -174,8 +178,8 @@ export default class AppEmbedPicker extends Vue {
} }
let arg: any = {}; let arg: any = {};
// 合并视图上下文参数和视图参数 // 合并视图上下文参数和视图参数
let param: any = JSON.parse(JSON.stringify(this.viewparams)); arg.param = JSON.parse(JSON.stringify(this.viewparams));
let context: any = JSON.parse(JSON.stringify(this.context)); arg.context = JSON.parse(JSON.stringify(this.context));
// 附加参数处理 // 附加参数处理
if (this.localContext && Object.keys(this.localContext).length >0) { if (this.localContext && Object.keys(this.localContext).length >0) {
let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext); let _context = this.$util.computedNavData(this.data,arg.context,arg.param,this.localContext);
...@@ -185,8 +189,8 @@ export default class AppEmbedPicker extends Vue { ...@@ -185,8 +189,8 @@ export default class AppEmbedPicker extends Vue {
let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam); let _param = this.$util.computedNavData(this.data,arg.param,arg.param,this.localParam);
Object.assign(arg.param,_param); Object.assign(arg.param,_param);
} }
this.viewdata = JSON.stringify(context); this.viewdata = JSON.stringify(arg.context);
this.viewparam = JSON.stringify(param); this.viewparam = JSON.stringify(arg.param);
} }
/** /**
...@@ -243,11 +247,21 @@ export default class AppEmbedPicker extends Vue { ...@@ -243,11 +247,21 @@ export default class AppEmbedPicker extends Vue {
* @memberof AppEmbedPicker * @memberof AppEmbedPicker
*/ */
public setValue(item: any) { public setValue(item: any) {
if (this.valueItem) { let selectsrfkey: Array<any> = [];
this.$emit('formitemvaluechange', { name: this.valueItem, value: item[0].srfkey }); let selectsrfmajortext: Array<any> = [];
} if(item && Array.isArray(item)){
if (this.name) { item.forEach((select: any)=>{
this.$emit('formitemvaluechange', { name: this.name, value: item[0].srfmajortext }); selectsrfkey.push(select.srfkey);
selectsrfmajortext.push(select.srfmajortext);
})
if (this.valueItem) {
let value = selectsrfkey.length > 0 ? selectsrfkey : '';
this.$emit('formitemvaluechange', { name: this.valueItem, value: value });
}
if (this.name) {
let value = selectsrfmajortext.length > 0 ? selectsrfmajortext : '';
this.$emit('formitemvaluechange', { name: this.name, value: value });
}
} }
} }
......
...@@ -291,6 +291,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -291,6 +291,7 @@ export default class AppFormDRUIPart extends Vue {
let _param:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localParam); let _param:any = this.$util.computedNavData(formData,tempContext,this.viewparams,this.localParam);
Object.assign(tempParam,_param); Object.assign(tempParam,_param);
} }
if(this.viewparams.hasOwnProperty('copymode')) Object.assign(tempParam,{copymode:this.viewparams.copymode});
this.viewparam = JSON.stringify(tempParam); this.viewparam = JSON.stringify(tempParam);
if (this.isRelationalData) { if (this.isRelationalData) {
// 从数据模式无遮罩层 // 从数据模式无遮罩层
......
<template> <template>
<dropdown trigger='click' @on-click="selectLang"> <dropdown v-if="localList.length > 1" trigger='click' @on-click="selectLang">
<span> <span>
{{title}} {{title}}
<icon size='18' type='md-arrow-dropdown'></icon> <icon size='18' type='md-arrow-dropdown'></icon>
......
...@@ -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 :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 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' />
...@@ -20,21 +20,21 @@ ...@@ -20,21 +20,21 @@
</template> </template>
<template v-else> <template v-else>
<template v-if="item.type =='MENUITEM'"> <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 != ''"> <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> <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>
<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> <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>
<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> <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>
<template slot="title"> <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"> <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>
......
...@@ -65,14 +65,36 @@ export default class AppOrgSector extends Vue { ...@@ -65,14 +65,36 @@ export default class AppOrgSector extends Vue {
* @memberof AppOrgSector * @memberof AppOrgSector
*/ */
public mounted() { public mounted() {
this.getData();
}
/**
* 获取数据
*
* @memberof AppOrgSector
*/
public getData(){
if (this.$store.getters.getAppData()) { 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.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) { if (this.$store.getters.getAppData().srforgsections) {
this.selectedOrgArray = this.$store.getters.getAppData().srforgsections; this.selectedOrgArray = this.$store.getters.getAppData().srforgsections;
} }
} }
} }
......
...@@ -123,6 +123,12 @@ export default class DropDownListDynamic extends Vue { ...@@ -123,6 +123,12 @@ export default class DropDownListDynamic extends Vue {
*/ */
@Prop() public placeholder?: string; @Prop() public placeholder?: string;
/**
* 属性类型
* @type {string}
* @memberof DropDownList
*/
@Prop() public valueType?: string;
/** /**
* 计算属性(当前值) * 计算属性(当前值)
...@@ -199,9 +205,10 @@ export default class DropDownListDynamic extends Vue { ...@@ -199,9 +205,10 @@ export default class DropDownListDynamic extends Vue {
if(this.tag && Object.is(this.codelistType,"STATIC")){ if(this.tag && Object.is(this.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(this.tag); const codelist = this.$store.getters.getCodeList(this.tag);
if (codelist) { if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))]; let items: Array<any> = [...JSON.parse(JSON.stringify(codelist.items))];
this.formatCodeList(items);
} else { } 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")){ }else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理 // 公共参数处理
...@@ -211,9 +218,10 @@ export default class DropDownListDynamic extends Vue { ...@@ -211,9 +218,10 @@ export default class DropDownListDynamic extends Vue {
let _context = data.context; let _context = data.context;
let _param = data.param; let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => { }).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 { ...@@ -234,14 +242,51 @@ export default class DropDownListDynamic extends Vue {
let _context = data.context; let _context = data.context;
let _param = data.param; let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => { }).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> </script>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:filterable="filterable === true ? true : false" :filterable="filterable === true ? true : false"
@on-open-change="onClick" @on-open-change="onClick"
:placeholder="$t('components.dropDownList.placeholder')"> :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> </i-select>
</template> </template>
...@@ -116,7 +116,7 @@ export default class DropDownList extends Vue { ...@@ -116,7 +116,7 @@ export default class DropDownList extends Vue {
* @memberof AppFormDRUIPart * @memberof AppFormDRUIPart
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
/** /**
* 是否禁用 * 是否禁用
* @type {any} * @type {any}
...@@ -139,6 +139,12 @@ export default class DropDownList extends Vue { ...@@ -139,6 +139,12 @@ export default class DropDownList extends Vue {
*/ */
@Prop() public placeholder?: string; @Prop() public placeholder?: string;
/**
* 属性类型
* @type {string}
* @memberof DropDownList
*/
@Prop() public valueType?: string;
/** /**
* 计算属性(当前值) * 计算属性(当前值)
...@@ -157,7 +163,7 @@ export default class DropDownList extends Vue { ...@@ -157,7 +163,7 @@ export default class DropDownList extends Vue {
* @memberof DropDownList * @memberof DropDownList
*/ */
get currentVal() { get currentVal() {
return this.itemValue ? this.itemValue.toString() : undefined; return this.itemValue;
} }
/** /**
...@@ -199,9 +205,10 @@ export default class DropDownList extends Vue { ...@@ -199,9 +205,10 @@ export default class DropDownList extends Vue {
if(this.tag && Object.is(this.codelistType,"STATIC")){ if(this.tag && Object.is(this.codelistType,"STATIC")){
const codelist = this.$store.getters.getCodeList(this.tag); const codelist = this.$store.getters.getCodeList(this.tag);
if (codelist) { if (codelist) {
this.items = [...JSON.parse(JSON.stringify(codelist.items))]; let items: Array<any> = [...JSON.parse(JSON.stringify(codelist.items))];
this.formatCodeList(items);
} else { } 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")){ }else if(this.tag && Object.is(this.codelistType,"DYNAMIC")){
// 公共参数处理 // 公共参数处理
...@@ -211,9 +218,10 @@ export default class DropDownList extends Vue { ...@@ -211,9 +218,10 @@ export default class DropDownList extends Vue {
let _context = data.context; let _context = data.context;
let _param = data.param; let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => { }).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 { ...@@ -234,14 +242,52 @@ export default class DropDownList extends Vue {
let _context = data.context; let _context = data.context;
let _param = data.param; let _param = data.param;
this.codeListService.getItems(this.tag,_context,_param).then((res:any) => { this.codeListService.getItems(this.tag,_context,_param).then((res:any) => {
this.items = res; let items: Array<any> = [...res];
this.formatCodeList(items);
}).catch((error:any) => { }).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> </script>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
width: 100%; width: 100%;
} }
.ivu-input-number-input{ .ivu-input-number-input{
text-align: right; text-align: left;
} }
.ivu-input-number-input:hover{ .ivu-input-number-input:hover{
padding-right:22px; padding-right:22px;
......
...@@ -203,6 +203,7 @@ export default class EntityService { ...@@ -203,6 +203,7 @@ export default class EntityService {
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME),'undefined')){ 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); let tempData:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_'+this.APPDENAME) as any);
data.srffrontuf = "0"; data.srffrontuf = "0";
data[this.APPDEKEY] = null;
tempData.push(data); tempData.push(data);
this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData)); this.tempStorage.setItem(context.srfsessionkey+'_'+this.APPDENAME,JSON.stringify(tempData));
return {"status":200,"data":data}; return {"status":200,"data":data};
......
...@@ -52,9 +52,9 @@ export class UIActionTool { ...@@ -52,9 +52,9 @@ export class UIActionTool {
return; return;
} }
let value: string | null = _params[name]; 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); 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; value = (arg[key] !== null && arg[key] !== undefined) ? arg[key] : null;
} else if(parentContext && parentContext.hasOwnProperty(key)){ } else if(parentContext && parentContext.hasOwnProperty(key)){
value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null; value = (parentContext[key] !== null && parentContext[key] !== undefined) ? parentContext[key] : null;
...@@ -76,7 +76,7 @@ export class UIActionTool { ...@@ -76,7 +76,7 @@ export class UIActionTool {
} }
let value: string | null = _params[name]; let value: string | null = _params[name];
let values: any[] = []; 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); const key = value.substring(1, value.length - 1);
args.forEach((arg: any) => { args.forEach((arg: any) => {
if (arg && arg.hasOwnProperty(key)) { if (arg && arg.hasOwnProperty(key)) {
......
...@@ -276,12 +276,8 @@ export class Verify { ...@@ -276,12 +276,8 @@ 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[value2]?form[value2]:value2;
// if (!_value2Field) { value2 = _value2Field;
// this.errorInfo = `表单项${value2}未配置`;
// return true;
// }
// value2 = _value2Field.getValue();
} }
if (Util.isEmpty(errorInfo)) { if (Util.isEmpty(errorInfo)) {
errorInfo = '内容必须符合值规则'; errorInfo = '内容必须符合值规则';
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册