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

2020.5.21 更新

上级 8ec30e8e
## v7.0.0-alpha.5 [2020-5-21]
### Bug修复
修复表格视图搜索placeholder显示为搜索字段
修复表单嵌表单分页异常
修复门户视图操作栏标题
修复看板部件高度自动撑
修复表单分组,界面行为组不显示
修复表格操作列数据异常
### 功能新增及优化
#### 模板
支持拷贝功能
支持实体甘特图视图
支持面板项隐藏表单项
支持表格列最小宽度和操作列样式支持
支持列表项、面板代码表转化
#### 基础文件
支持列表项、面板代码表转化
修复表单分组,界面行为组不显示
## v7.0.0-alpha.4 [2020-5-14] ## v7.0.0-alpha.4 [2020-5-14]
### Bug修复 ### Bug修复
......
...@@ -263,7 +263,9 @@ export default class AppFormDRUIPart extends Vue { ...@@ -263,7 +263,9 @@ export default class AppFormDRUIPart extends Vue {
} }
} }
if(!this.isForbidLoad){ if(!this.isForbidLoad){
this.$nextTick(() => {
this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}}); this.formDruipart.next({action:'load',data:{srfparentdename:this.parentName,srfparentkey:_paramitem}});
});
} }
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
} }
>.ivu-card-extra { >.ivu-card-extra {
.item-extract-mode { .item-extract-mode {
display: flex;
.item { .item {
margin-left: 12px; margin-left: 12px;
} }
......
...@@ -81,10 +81,17 @@ export default class AppUser extends Vue { ...@@ -81,10 +81,17 @@ export default class AppUser extends Vue {
* @memberof AppUser * @memberof AppUser
*/ */
public logout() { public logout() {
const get: Promise<any> = this.$http.get('v7/logout');
get.then((response:any) =>{
if (response && response.status === 200) {
localStorage.removeItem('user'); localStorage.removeItem('user');
localStorage.removeItem('token'); localStorage.removeItem('token');
this.$router.push({ name: 'login' }); this.$router.push({ name: 'login' });
} }
}).catch((error: any) =>{
console.error(error);
})
}
} }
</script> </script>
......
...@@ -76,3 +76,16 @@ export const getZIndex = (state: any) => () => { ...@@ -76,3 +76,16 @@ export const getZIndex = (state: any) => () => {
export const getViewSplit = (state: any) => (viewUID: string) => { export const getViewSplit = (state: any) => (viewUID: string) => {
return state.viewSplit[viewUID]; return state.viewSplit[viewUID];
} }
/**
* 获取拷贝数据
*
* @param state
*/
export const getCopyData = (state: any) => (srfkey: string) => {
let copyData = state.copyDataMap[srfkey];
if(copyData){
delete state.copyDataMap[srfkey];
}
return copyData;
}
\ No newline at end of file
...@@ -254,3 +254,15 @@ export const updateZIndex = (state: any, zIndex: number) => { ...@@ -254,3 +254,15 @@ export const updateZIndex = (state: any, zIndex: number) => {
export const setViewSplit = (state: any, args: {viewSplit: number,viewUID:string}) => { export const setViewSplit = (state: any, args: {viewSplit: number,viewUID:string}) => {
state.viewSplit[args.viewUID] = args.viewSplit; state.viewSplit[args.viewUID] = args.viewSplit;
} }
/**
* 添加拷贝数据
*
* @param state
* @param localdata
*/
export const addCopyData = (state: any, args: {srfkey: string,copyData: any}) => {
if(args && args.srfkey && args.copyData){
state.copyDataMap[args.srfkey] = JSON.parse(JSON.stringify(args.copyData));
}
}
\ No newline at end of file
...@@ -13,4 +13,5 @@ export const rootstate: any = { ...@@ -13,4 +13,5 @@ export const rootstate: any = {
localdata: {}, localdata: {},
zIndex: 300, zIndex: 300,
viewSplit: {}, viewSplit: {},
copyDataMap:{},
} }
\ No newline at end of file
import { Store } from 'vuex'; import { Store } from 'vuex';
import { Util } from '@/utils/util/util'; import { Util } from '@/utils/util/util';
import CodeListService from "@service/app/codelist-service";
/** /**
* 部件服务基类 * 部件服务基类
...@@ -26,6 +27,14 @@ export default class ControlService { ...@@ -26,6 +27,14 @@ export default class ControlService {
*/ */
public model: any | null = null; public model: any | null = null;
/**
* 代码表服务对象
*
* @type {any}
* @memberof ControlService
*/
public codeListService:any;
/** /**
* 是否为从数据模式 * 是否为从数据模式
* *
...@@ -43,6 +52,7 @@ export default class ControlService { ...@@ -43,6 +52,7 @@ export default class ControlService {
constructor(opts: any = {}) { constructor(opts: any = {}) {
this.$store = opts.$store; this.$store = opts.$store;
this.setTempMode(); this.setTempMode();
this.codeListService = new CodeListService({ $store:opts.$store });
} }
/** /**
...@@ -118,17 +128,19 @@ export default class ControlService { ...@@ -118,17 +128,19 @@ export default class ControlService {
* @param {*} response * @param {*} response
* @memberof ControlService * @memberof ControlService
*/ */
public handleResponse(action: string, response: any,isCreate:boolean = false){ public async handleResponse(action: string, response: any,isCreate:boolean = false){
let result = null; let result = null;
if (!response.data) { if (!response.data) {
return return
} else if (response.data instanceof Array) { }
const handleResult:any = (action: string, response: any,isCreate:boolean,codelistArray?:any) =>{
if (response.data instanceof Array) {
result = []; result = [];
response.data.forEach((item:any) =>{ response.data.forEach((item:any) =>{
result.push(this.handleResponseData(action, item, isCreate)); result.push(this.handleResponseData(action, item, isCreate,codelistArray));
}); });
}else{ }else{
result = this.handleResponseData(action, response.data, isCreate); result = this.handleResponseData(action, response.data, isCreate,codelistArray);
} }
// response状态,头文件 // response状态,头文件
if(response.headers){ if(response.headers){
...@@ -144,6 +156,14 @@ export default class ControlService { ...@@ -144,6 +156,14 @@ export default class ControlService {
} }
response.data = result; response.data = result;
} }
let codelistModel:Array<any> = this.handleCodelist();
if(codelistModel.length >0){
let res:any = await this.getAllCodeList(codelistModel);
handleResult(action, response,isCreate,res);
}else{
handleResult(action, response,isCreate);
}
}
/** /**
* 处理返回数据 * 处理返回数据
...@@ -152,7 +172,7 @@ export default class ControlService { ...@@ -152,7 +172,7 @@ export default class ControlService {
* @param {*} response * @param {*} response
* @memberof ControlService * @memberof ControlService
*/ */
public handleResponseData(action: string, data: any = {},isCreate?:boolean){ public handleResponseData(action: string, data: any = {},isCreate?:boolean,codelistArray?:any){
let model: any = this.getMode(); let model: any = this.getMode();
if (!model && model.getDataItems instanceof Function) { if (!model && model.getDataItems instanceof Function) {
return data; return data;
...@@ -167,10 +187,13 @@ export default class ControlService { ...@@ -167,10 +187,13 @@ export default class ControlService {
if((isCreate === undefined || isCreate === null ) && Object.is(dataitem.dataType, 'GUID') && Object.is(dataitem.name, 'srfkey') && (val && !Object.is(val, ''))){ if((isCreate === undefined || isCreate === null ) && Object.is(dataitem.dataType, 'GUID') && Object.is(dataitem.name, 'srfkey') && (val && !Object.is(val, ''))){
isCreate = true; isCreate = true;
} }
// if((Object.is(dataitem.dataType,'DATE') || Object.is(dataitem.dataType,'DATETIME')) && !Object.is(Date.parse(val),NaN)){
// val = Util.dateFormat(new Date(val));
// }
item[dataitem.name] = val; item[dataitem.name] = val;
// 转化代码表
if(codelistArray && dataitem.codelist){
if(codelistArray.get(dataitem.codelist.tag) && codelistArray.get(dataitem.codelist.tag).get(val)){
item[dataitem.name] = codelistArray.get(dataitem.codelist.tag).get(val);
}
}
}); });
item.srfuf = data.srfuf ? data.srfuf : (isCreate ? "0" : "1"); item.srfuf = data.srfuf ? data.srfuf : (isCreate ? "0" : "1");
return item; return item;
...@@ -199,4 +222,88 @@ export default class ControlService { ...@@ -199,4 +222,88 @@ export default class ControlService {
return requestData; return requestData;
} }
/**
* 处理代码表
*
* @memberof ControlService
*/
public handleCodelist(){
let model: any = this.getMode();
if (!model) {
return [];
}
let dataItems: any[] = model.getDataItems();
let codelistMap:Map<string,any> = new Map();
if(dataItems && dataItems.length >0){
dataItems.forEach((item:any) =>{
if(item.codelist){
codelistMap.set(item.name,item.codelist);
}
})
}
if(codelistMap.size >0){
return Array.from(codelistMap).map(item => item[1]);
}else{
return [];
}
}
/**
* 获取所有代码表
*
* @param codelistArray 代码表模型数组
* @memberof ControlService
*/
public getAllCodeList(codelistArray:Array<any>):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
let codeListMap:Map<string,any> = new Map();
let promiseArray:Array<any> = [];
codelistArray.forEach((item:any) =>{
if(!codeListMap.get(item.tag)){
promiseArray.push(this.getCodeList(item));
Promise.all(promiseArray).then((result:any) =>{
if(result && result.length >0){
result.forEach((codeList:any) =>{
let tempCodeListMap:Map<number,any> = new Map();
if(codeList.length >0){
codeList.forEach((codeListItem:any) =>{
tempCodeListMap.set(codeListItem.value,codeListItem.text);
})
}
codeListMap.set(item.tag,tempCodeListMap);
})
resolve(codeListMap);
}
})
}
})
})
}
/**
* 获取代码表
*
* @param codeListObject 传入代码表对象
* @memberof ControlService
*/
public getCodeList(codeListObject:any):Promise<any>{
return new Promise((resolve:any,reject:any) =>{
if(codeListObject.tag && Object.is(codeListObject.codelistType,"STATIC")){
const codelist = (this.getStore() as Store<any>).getters.getCodeList(codeListObject.tag);
if (codelist) {
resolve([...JSON.parse(JSON.stringify(codelist.items))]);
} else {
resolve([]);
console.log(`----${codeListObject.tag}----代码表不存在`);
}
}else if(codeListObject.tag && Object.is(codeListObject.codelistType,"DYNAMIC")){
this.codeListService.getItems(codeListObject.tag).then((res:any) => {
resolve(res);
}).catch((error:any) => {
resolve([]);
console.log(`----${codeListObject.tag}----代码表不存在`);
});
}
})
}
} }
\ No newline at end of file
...@@ -3626,6 +3626,11 @@ date-fns@^1.27.2: ...@@ -3626,6 +3626,11 @@ date-fns@^1.27.2:
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
dayjs@^1.8.16:
version "1.8.27"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.27.tgz#a8ae63ee990af28c05c430f0e160ae835a0fbbf8"
integrity sha512-Jpa2acjWIeOkg8KURUHICk0EqnEFSSF5eMEscsOgyJ92ZukXwmpmRkPSUka7KHSfbj5eKH30ieosYip+ky9emQ==
de-indent@^1.0.2: de-indent@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
...@@ -5204,6 +5209,17 @@ human-signals@^1.1.1: ...@@ -5204,6 +5209,17 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
ibiz-gantt-elastic@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/ibiz-gantt-elastic/-/ibiz-gantt-elastic-1.0.8.tgz#d7c40b6b0068a9303772594608375d42b8dbcb61"
integrity sha512-vlawRcYGiNv6N8N9Wx2ZO7oorV3R6dZWYT7Yvb2lxWfdWYX+cK1KZP0p+2S/Is1/A7+eDFhu60iZ2nf7LExaFQ==
dependencies:
dayjs "^1.8.16"
resize-observer-polyfill "^1.5.1"
vue "^2.6.10"
vue-slider-component "^3.0.40"
vue-switches "^2.0.1"
iconv-lite@0.4.24: iconv-lite@0.4.24:
version "0.4.24" version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
...@@ -8623,7 +8639,7 @@ requires-port@^1.0.0: ...@@ -8623,7 +8639,7 @@ requires-port@^1.0.0:
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
resize-observer-polyfill@^1.5.0: resize-observer-polyfill@^1.5.0, resize-observer-polyfill@^1.5.1:
version "1.5.1" version "1.5.1"
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
...@@ -10115,6 +10131,13 @@ vue-loader@^15.7.2: ...@@ -10115,6 +10131,13 @@ vue-loader@^15.7.2:
vue-hot-reload-api "^2.3.0" vue-hot-reload-api "^2.3.0"
vue-style-loader "^4.1.0" vue-style-loader "^4.1.0"
vue-property-decorator@^8.0.0:
version "8.4.2"
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-8.4.2.tgz#016e17f259f73bc547e77a50ce282ba18db4ee41"
integrity sha512-IqbARlvgPE2pzKfbecKxsu2yEH0Wv7hfHR6m4eZA3LTnNw9hveAX77vDfLFyTeMISS5N7Kucp/xRSHjcQ6bAfQ==
dependencies:
vue-class-component "^7.1.0"
vue-property-decorator@^8.3.0: vue-property-decorator@^8.3.0:
version "8.3.0" version "8.3.0"
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-8.3.0.tgz#536f027dc7d626f37c8d85a2dc02f0a6cb979440" resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-8.3.0.tgz#536f027dc7d626f37c8d85a2dc02f0a6cb979440"
...@@ -10127,6 +10150,13 @@ vue-router@^3.1.3: ...@@ -10127,6 +10150,13 @@ vue-router@^3.1.3:
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.4.tgz#98a6a4dd38fca0db3b9f3c04bfbd008a3b6d958d" resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.1.4.tgz#98a6a4dd38fca0db3b9f3c04bfbd008a3b6d958d"
integrity sha512-pX2BGvZg5/MOXbJoYsRppoZM+0B4LSszvIXQvLPZ7govbgbBorYQ4JHx99lDTjzEBkbTyKfRG+ru1VCnMuVcUg== integrity sha512-pX2BGvZg5/MOXbJoYsRppoZM+0B4LSszvIXQvLPZ7govbgbBorYQ4JHx99lDTjzEBkbTyKfRG+ru1VCnMuVcUg==
vue-slider-component@^3.0.40:
version "3.1.3"
resolved "https://registry.yarnpkg.com/vue-slider-component/-/vue-slider-component-3.1.3.tgz#f5e61cdbd7b677840f7286ee590c6450469f71fb"
integrity sha512-SPFb1I3G2a4thIwghvVNhcvPGCUz6PIZR1ClwtvN4MT44ZUzvqCMDS7osdKz0hdKu4kfanxET8qZn826A/XPxA==
dependencies:
vue-property-decorator "^8.0.0"
vue-style-loader@^4.1.0: vue-style-loader@^4.1.0:
version "4.1.2" version "4.1.2"
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8" resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"
...@@ -10135,6 +10165,13 @@ vue-style-loader@^4.1.0: ...@@ -10135,6 +10165,13 @@ vue-style-loader@^4.1.0:
hash-sum "^1.0.2" hash-sum "^1.0.2"
loader-utils "^1.0.2" loader-utils "^1.0.2"
vue-switches@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/vue-switches/-/vue-switches-2.0.1.tgz#f23436259c7fe4ffca9c4a6df49ac78941e20a20"
integrity sha512-rDqBtK3TKy1pEvyZeWmnSHVeXqAcn+ozch7LiNThBzr1QMjg5rhvqBY7uWeli/baDDslf6CXmBJbHPwASJLqoA==
dependencies:
vue "^2.2.6"
vue-template-compiler@^2.6.10: vue-template-compiler@^2.6.10:
version "2.6.11" version "2.6.11"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz#c04704ef8f498b153130018993e56309d4698080" resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz#c04704ef8f498b153130018993e56309d4698080"
...@@ -10148,7 +10185,7 @@ vue-template-es2015-compiler@^1.6.0, vue-template-es2015-compiler@^1.9.0: ...@@ -10148,7 +10185,7 @@ vue-template-es2015-compiler@^1.6.0, vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==
vue@^2.6.10: vue@^2.2.6, vue@^2.6.10:
version "2.6.11" version "2.6.11"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5" resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5"
integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ== integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册