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

Merge branch 'master' into 2020.07.12

上级 e0e91352
## v7.0.0-alpha.15 [2020-7-23]
### Bug修复
修复修复数值框错误问题
修复表单通知关系界面上下文、表单数据先后顺序
修复实体行为执行前、后逻辑增加行为逻辑者判断
修复表单loadDraft清空表单临时主键
修复数据图表月份显示问题
修复首页横向菜单呈现
修复树视图部件国际化问题
### 功能新增及优化
#### 模板
新增表单属性值规则(正则式规则、数值范围规则、字符长度规则、常规规则、系统值规则、规则组)支持
新增数据选择、自动填充编辑器自填模式排序
新增表单传入关系界面临时模式
新增数据选择编辑器自填模式界面行为组(662)
新增向导添加数据
优化向导面板成功提示、忽略版本检查
优化导航类部件选中事件
优化表格操作列分隔符问题
优化表单准备工作流数据,填充未存库数据
#### 基础文件
修复数值框firstElementChild异常问题
修复图表视图无搜索表单加载数据问题
修复表格视图标题问题
更新view-design组件库的版本,修复面板分割组件
优化关系界面内嵌表格视图先行通知,再保存表单逻辑
优化部门选择、组织选择编辑器的样式
优化导入文件逻辑
新增关系界面增加无临时数据模式判断
新增数据选择、自动填充编辑器自填模式排序
新增数据选择编辑器自填模式界面行为组(662)
## v7.0.0-alpha.14 [2020-7-18] ## v7.0.0-alpha.14 [2020-7-18]
### Bug修复 ### Bug修复
......
<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;
} }
} }
......
因为 它太大了无法显示 源差异 。您可以改为 查看blob
...@@ -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{
.ivu-dropdown-rel{ .ivu-dropdown-rel{
.tree-input{ .tree-input{
.ivu-input-suffix{ .ivu-input-suffix{
...@@ -25,5 +26,14 @@ ...@@ -25,5 +26,14 @@
overflow:inherit; overflow:inherit;
} }
} }
}
.el-input__inner{
height: 32px;
line-height: 32px
}
.el-input__icon{
line-height: 32px;
}
} }
...@@ -40,6 +40,14 @@ export default class AppFormDRUIPart extends Vue { ...@@ -40,6 +40,14 @@ export default class AppFormDRUIPart extends Vue {
*/ */
@Prop() public viewname?: string; @Prop() public viewname?: string;
/**
* 临时数据模式:从数据模式:"2"、主数据模式:"1"、无临时数据模式:"0"
*
* @type {string}
* @memberof AppFormDRUIPart
*/
@Prop({default:"0"}) public tempMode?:string;
/** /**
* 刷新关系项 * 刷新关系项
* *
...@@ -285,6 +293,10 @@ export default class AppFormDRUIPart extends Vue { ...@@ -285,6 +293,10 @@ export default class AppFormDRUIPart extends Vue {
} }
this.viewparam = JSON.stringify(tempParam); this.viewparam = JSON.stringify(tempParam);
if (this.isRelationalData) { if (this.isRelationalData) {
// 从数据模式无遮罩层
if(this.tempMode && Object.is(this.tempMode,"2")){
this.blockUIStop();
}else{
if (!_paramitem || _paramitem == null || Object.is(_paramitem, '')) { if (!_paramitem || _paramitem == null || Object.is(_paramitem, '')) {
this.blockUIStart(); this.blockUIStart();
return; return;
...@@ -292,6 +304,7 @@ export default class AppFormDRUIPart extends Vue { ...@@ -292,6 +304,7 @@ export default class AppFormDRUIPart extends Vue {
this.blockUIStop(); this.blockUIStop();
} }
} }
}
if(!this.isForbidLoad){ if(!this.isForbidLoad){
setTimeout(() => { setTimeout(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}}); this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
...@@ -319,10 +332,20 @@ export default class AppFormDRUIPart extends Vue { ...@@ -319,10 +332,20 @@ 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')){ // 支持嵌入视图类型:嵌入视图本身抛drdatasaved的视图,如:DEMEDITVIEW9,DEGRIDVIEW9,DEGRIDVIEW等
// 从数据模式直接通知保存
// 临时补充,todo
if(Object.is(this.refviewtype,'DEMEDITVIEW9') || Object.is(this.refviewtype,'DEGRIDVIEW9') || Object.is(this.refviewtype,'DEGRIDVIEW')){
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")){
this.formDruipart.next({action:'save',data:$event.data});
}else{
this.$emit('drdatasaved',$event);
}
}
}else{
this.$emit('drdatasaved',$event); 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;
/** /**
* 类型 * 类型
* *
...@@ -176,6 +189,23 @@ export default class AppPicker extends Vue { ...@@ -176,6 +189,23 @@ export default class AppPicker extends Vue {
*/ */
@Prop() public valueitem!: string; @Prop() public valueitem!: string;
/**
* 排序
*
* @type {string}
* @memberof AppPicker
*/
@Prop() public sort?: string;
/**
* 行为组
*
* @type {Array<any>}
* @memberof AppPicker
*/
@Prop() public actionDetails?:Array<any>;
/** /**
* 值 * 值
* *
...@@ -265,9 +295,6 @@ export default class AppPicker extends Vue { ...@@ -265,9 +295,6 @@ export default class AppPicker extends Vue {
* @memberof AppPicker * @memberof AppPicker
*/ */
public created() { public created() {
if(Object.is(this.editortype, 'dropdown')){
this.onSearch("", null, true);
}
if(!Object.is(this.editortype, 'pickup-no-ac') && !Object.is(this.editortype, 'dropdown')){ if(!Object.is(this.editortype, 'pickup-no-ac') && !Object.is(this.editortype, 'dropdown')){
this.curvalue = this.value; this.curvalue = this.value;
} }
...@@ -320,6 +347,9 @@ export default class AppPicker extends Vue { ...@@ -320,6 +347,9 @@ export default class AppPicker 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.appPicker.error') as any); let error: string = (this.$t('components.appPicker.error') as any);
...@@ -338,8 +368,11 @@ export default class AppPicker extends Vue { ...@@ -338,8 +368,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);
...@@ -669,6 +702,17 @@ export default class AppPicker extends Vue { ...@@ -669,6 +702,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,6 +175,8 @@ export default class InputBox extends Vue { ...@@ -175,6 +175,8 @@ export default class InputBox extends Vue {
*/ */
public addEvent(){ public addEvent(){
if(Object.is(this.type, "number")){ if(Object.is(this.type, "number")){
// 整个页面渲染完之后再去执行
this.$nextTick(() => {
let inputNumber :any = document.getElementById(this.numberId); let inputNumber :any = document.getElementById(this.numberId);
let handlerWrap :any = inputNumber.firstElementChild; let handlerWrap :any = inputNumber.firstElementChild;
handlerWrap.onmouseover=()=>{ handlerWrap.onmouseover=()=>{
...@@ -184,6 +186,7 @@ export default class InputBox extends Vue { ...@@ -184,6 +186,7 @@ export default class InputBox extends Vue {
handlerWrap.onmouseout=()=>{ handlerWrap.onmouseout=()=>{
inputNumber.style.paddingRight="0px"; 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,14 +70,11 @@ export default class DataViewEngine extends MDViewEngine { ...@@ -70,14 +70,11 @@ 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) {
...@@ -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();
......
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;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册