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

Merge branch 'dev'

## v7.0.0-alpha.11 [2020-6-21]
### Bug修复
修复标题工具栏样式遮挡bug
修复表格行编辑字段格式对齐
修复日历部件初始化压缩成一行问题
修复下拉多选组件最后一项数据无法删除
### 功能新增及优化
#### 模板
新增支持表单、表格新建默认值(当前时间)
新增行编辑浮点数精度格式化
新增首页面包屑导航模式
新增编辑视图第一条记录、上一条记录、下一条记录、最后一条记录界面行为
优化面板和多数据部件数据流向
优化表单在模态打开模式中padding样式
优化嵌入视图中工具栏消息数量提示样式
优化动态导航视图树样式
#### 基础文件
新增行编辑浮点数精度格式化
## v7.0.0-alpha.10 [2020-6-18]
### Bug修复
......
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<template v-if="Object.is(this.navModel,'route')">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.id">
<span v-if="index === breadcrumbs.length-1" class="no-redirect">{{ item.title }}
<span v-if="item.isselected === true">
......@@ -18,6 +19,13 @@
</span>
<a v-else @click.prevent="handleLink(item)">{{ item.title }}</a>
</el-breadcrumb-item>
</template>
<template v-if="!Object.is(this.navModel,'route')">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
<span v-if="index === breadcrumbs.length-1" class="no-redirect" >{{ $t(item.meta.caption)}}</span>
<a v-else @click.prevent="handleLink(item)" >{{ $t(item.meta.caption) }}</a>
</el-breadcrumb-item>
</template>
</transition-group>
</el-breadcrumb>
</template>
......@@ -54,6 +62,24 @@ export default class Breadcrumb extends Vue {
*/
@Prop() public indexViewTag!: string;
/**
* 导航模式
*
* @memberof Breadcrumb
*/
@Prop({default:'tab'}) public navModel?:string;
/**
* 监听路由
*
* @memberof Breadcrumb
*/
@Watch('$route')
private onRouteChange(route: Route) {
this.getBreadcrumb()
}
/**
* 导航服务事件
*
......@@ -70,12 +96,14 @@ export default class Breadcrumb extends Vue {
*/
created() {
this.getBreadcrumb();
if(Object.is(this.navModel,"route")){
this.serviceStateEvent = this.navDataService.serviceState.subscribe(({ action,name, data }:{ action:string,name:any,data:any }) => {
if (Object.is(action, 'datarefresh')) {
this.getBreadcrumb();
}
});
}
}
/**
* 获取面包屑数据
......@@ -83,8 +111,14 @@ export default class Breadcrumb extends Vue {
* @memberof Breadcrumb
*/
private getBreadcrumb() {
if(Object.is(this.navModel,"route")){
this.breadcrumbs = this.navDataService.getNavData();
this.$forceUpdate();
}else{
this.breadcrumbs = this.$route.matched.filter((item) => {
return item.meta && item.meta.caption
})
}
}
/**
......@@ -112,6 +146,7 @@ export default class Breadcrumb extends Vue {
* @memberof Breadcrumb
*/
private handleLink(item: any) {
if(Object.is(this.navModel,"route")){
// 首页
if(Object.is(item.id,this.indexViewTag)){
this.$router.push((window.sessionStorage.getItem(Environment.AppName))as string);
......@@ -122,6 +157,20 @@ export default class Breadcrumb extends Vue {
});
}
this.navDataService.removeNavData(item.id);
}else{
if(item && item.meta && item.meta.viewType && Object.is(item.meta.viewType,"APPINDEX")){
let path: string | null = window.sessionStorage.getItem(Environment.AppName);
if (path) {
this.$router.push({ path: path });
} else {
this.$router.push("/");
}
}else{
this.$router.push(item).catch(err => {
console.warn(err);
});
}
}
}
/**
......
......@@ -5,4 +5,7 @@
top: 0;
right: 20px;
}
.ivu-input-number-input{
text-align: right;
}
}
\ No newline at end of file
<template>
<div class="input-unit">
<i-input
<InputNumber v-if="type === 'number'"
:placeholder="placeholder"
:size="size"
:precision="precision"
v-model="CurrentVal"
:disabled="disabled ? true : false"
></InputNumber>
<i-input v-else
:placeholder="placeholder"
:size="size"
:type="type"
......@@ -63,6 +70,14 @@ export default class InputBox extends Vue {
*/
@Prop() public type?: string;
/**
* 精度
*
* @type {number}
* @memberof InputBox
*/
@Prop({default: 0}) public precision?: number;
/**
* 多行文本行数
*
......@@ -77,8 +92,12 @@ export default class InputBox extends Vue {
* @memberof InputBox
*/
get CurrentVal() {
if(Object.is(this.type, 'number') && this.itemValue && !isNaN(this.itemValue)){
return Number(Number(this.itemValue).toFixed(this.precision));
}else{
return this.itemValue;
}
}
/**
* 值变化
......
......@@ -227,7 +227,7 @@ export default class TabPageExp extends Vue {
* @memberof TabPageExp
*/
public setCurPageCaption(caption: string, title: any, info: string) {
if (this.$route.meta && !Object.is(this.$route.meta.caption, caption)) {
if (this.$route.meta && !Object.is(this.$t(this.$route.meta.caption), caption)) {
return;
}
this.$store.commit("setCurPageCaption", {
......
......@@ -253,13 +253,13 @@ export default class EditViewEngine extends ViewEngine {
viewdata.srfTitle = viewdata.srfTitle.substr(0,index);
}
if(this.view.$tabPageExp){
this.view.$tabPageExp.setCurPageCaption(viewdata.srfTitle, viewdata.srfTitle, info);
this.view.$tabPageExp.setCurPageCaption(this.view.$t(viewdata.srfTitle), this.view.$t(viewdata.srfTitle), info);
}
if(this.view.$route){
this.view.$route.meta.info = info;
}
this.view.model.srfTitle = `${this.view.$t(viewdata.srfTitle)}-${viewdata.dataInfo}`;
this.view.initNavData();
this.view.initNavDataWithRoute();
}
}
......
......@@ -373,7 +373,9 @@ export default class MDViewEngine extends ViewEngine {
cacheArray.push({srfkey:item.srfkey,srfmajortext:item.srfmajortext});
})
}
this.view.initNavData(cacheArray);
this.view.viewCacheData = cacheArray;
this.view.initNavDataWithRoute(cacheArray);
this.view.initNavDataWithTab(cacheArray,false);
if (this.view) {
this.view.$emit('viewload', args);
}
......@@ -398,11 +400,11 @@ export default class MDViewEngine extends ViewEngine {
}
// 快速分组和快速搜索栏
let otherQueryParam:any = {};
if(this.view && this.view.qucikGroupData){
Object.assign(otherQueryParam,this.view.qucikGroupData);
if(this.view && this.view.quickGroupData){
Object.assign(otherQueryParam,this.view.quickGroupData);
}
if(this.view && this.view.qucikFormData){
Object.assign(otherQueryParam,this.view.qucikFormData);
if(this.view && this.view.quickFormData){
Object.assign(otherQueryParam,this.view.quickFormData);
}
Object.assign(arg,{viewparams:otherQueryParam});
}
......
......@@ -49,6 +49,13 @@ export interface NavDataElement {
*/
srfkey:string|null;
/**
* 视图标识
*
* @memberof NavDataElement
*/
tag:string|null;
}
export interface ServiceState {
......@@ -228,6 +235,24 @@ export default class NavDataService {
}
}
/**
* 从导航数据栈中删除指定数据上层数据(不清除页面缓存)
*
* @memberof NavDataService
*/
public removeNavDataWithoutCache(id:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.id,id);
})
let removeNavData = this.navDataStack.splice(tempIndex+1);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return removeNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中获取指定数据
*
......@@ -287,4 +312,76 @@ export default class NavDataService {
return [];
}
}
/**
* 从导航数据栈中直接添加数据
*
* @memberof NavDataService
*/
public addNavDataByOnly(curNavData:NavDataElement,isOnlyAdd:boolean){
if(isOnlyAdd){
this.navDataStack.push(curNavData);
}else{
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,curNavData.tag);
})
if(tempIndex === -1){
this.navDataStack.push(curNavData);
}else{
this.navDataStack[tempIndex] = curNavData;
}
}else{
this.navDataStack.push(curNavData);
}
}
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return curNavData;
}
/**
* 从导航数据栈中直接删除数据
*
* @memberof NavDataService
*/
public removeNavDataByTag(viewtag:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,viewtag);
})
let removeNavData = this.navDataStack.splice(tempIndex,1);
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
return removeNavData;
}else{
return null;
}
}
/**
* 从导航数据栈中获取指定元素前一个元素
*
* @memberof NavDataService
*/
public getPreNavDataByTag(viewtag:string){
if(this.navDataStack.length >0){
let tempIndex:number = this.navDataStack.findIndex((element:NavDataElement) =>{
return Object.is(element.tag,viewtag);
})
return this.navDataStack[tempIndex - 1]?this.navDataStack[tempIndex - 1]:null;
}else{
return null;
}
}
/**
* 从导航数据栈中删除所有数据
*
* @memberof NavDataService
*/
public removeAllNavData(){
if(this.navDataStack.length >0){
this.navDataStack = [];
this.sessionStore.setItem('srfnavdata',JSON.stringify(this.navDataStack));
}
}
}
\ No newline at end of file
......@@ -87,18 +87,29 @@
// display: flex;
// flex-direction: column;
> .ivu-card-head{
height: 50px;
min-height: 42px;
border-color: rgb(221, 221, 221);
border-style: solid;
border-width: 0px 0px 1px;
margin: 0px 0px 11px;
padding: 6px 0px;
> p{
height: 50px;
padding: 6px 0px 2px;
> .header-container{
min-height: 42px;
display: flex;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: space-between;
> .caption-info{
line-height: 50px;
line-height: 42px;
font-size: 18px;
color: #1890ff;
flex-shrink: 0;
}
> .toolbar-container{
display: inline-block;
display: flex;
flex-wrap: wrap;
align-items: center;
}
}
}
......
......@@ -99,6 +99,9 @@ export default class ControlService {
}
let dataItems: any[] = model.getDataItems();
let requestData:any = {};
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
dataItems.forEach((item:any) =>{
if(item && item.dataType && Object.is(item.dataType,'FONTKEY')){
if(item && item.prop && item.name ){
......@@ -110,9 +113,6 @@ export default class ControlService {
}
}
});
if(isMerge && (data && data.viewparams)){
Object.assign(requestData,data.viewparams);
}
let tempContext:any = JSON.parse(JSON.stringify(context));
if(tempContext && tempContext.srfsessionid){
tempContext.srfsessionkey = tempContext.srfsessionid;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册