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

Merge branch 'dev'

{
"name": "app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service serve --mode test",
"dev-serve": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service serve --mode development",
"build": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service build",
"dev-build": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service build --mode development",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fullcalendar/core": "^4.4.0",
"@fullcalendar/daygrid": "^4.4.0",
"@fullcalendar/interaction": "^4.4.0",
"@fullcalendar/list": "^4.4.0",
"@fullcalendar/timegrid": "^4.4.0",
"@fullcalendar/vue": "^4.4.0",
"vuedraggable": "^2.23.2",
"async-validator": "^3.3.0",
"@popperjs/core": "^2.4.3",
"axios": "^0.19.1",
"core-js": "^3.4.4",
"echarts": "^4.6.0",
"element-ui": "^2.13.0",
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
"ibiz-gantt-elastic": "^1.0.17",
"ibiz-vue-lib": "^0.1.13",
"interactjs": "^1.9.4",
"moment": "^2.24.0",
"path-to-regexp": "^6.1.0",
"qs": "^6.9.1",
"rxjs": "^6.5.4",
"tinymce": "4.8.5",
"view-design": "4.2.0",
"vue": "^2.6.10",
"vue-class-component": "^7.0.2",
"vue-grid-layout": "^2.3.7",
"vue-i18n": "^8.15.3",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
"xlsx": "^0.15.6"
},
"devDependencies": {
"@types/echarts": "^4.4.3",
"@types/jest": "^24.0.19",
"@types/mockjs": "^1.0.2",
"@types/qs": "^6.9.0",
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-e2e-cypress": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-typescript": "^4.1.0",
"@vue/cli-plugin-unit-jest": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/test-utils": "1.0.0-beta.29",
"axios-mock-adapter": "^1.17.0",
"compression-webpack-plugin": "^4.0.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"mockjs": "^1.1.0",
"script-loader": "^0.7.2",
"typescript": "~3.5.3",
"vue-template-compiler": "^2.6.10"
}
}
...@@ -65,7 +65,7 @@ export default class AppPicker extends Vue { ...@@ -65,7 +65,7 @@ export default class AppPicker extends Vue {
* 视图上下文 * 视图上下文
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public context!: any; @Prop() public context!: any;
...@@ -73,7 +73,7 @@ export default class AppPicker extends Vue { ...@@ -73,7 +73,7 @@ export default class AppPicker extends Vue {
* 视图参数 * 视图参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public viewparams!: any; @Prop() public viewparams!: any;
...@@ -81,15 +81,23 @@ export default class AppPicker extends Vue { ...@@ -81,15 +81,23 @@ export default class AppPicker extends Vue {
* AC参数 * AC参数
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop({default: () => {}}) public acParams?: any; @Prop({default: () => {}}) public acParams?: any;
/**
* 外键值附加数据
*
* @type {*}
* @memberof AppPicker
*/
@Prop() public pickUpData?: string;
/** /**
* 表单服务 * 表单服务
* *
* @type {*} * @type {*}
* @memberof AppFormDRUIPart * @memberof AppPicker
*/ */
@Prop() public service?: any; @Prop() public service?: any;
...@@ -97,7 +105,7 @@ export default class AppPicker extends Vue { ...@@ -97,7 +105,7 @@ export default class AppPicker extends Vue {
* 应用实体主信息属性名称 * 应用实体主信息属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
@Prop({default: 'srfmajortext'}) public deMajorField!: string; @Prop({default: 'srfmajortext'}) public deMajorField!: string;
...@@ -105,7 +113,7 @@ export default class AppPicker extends Vue { ...@@ -105,7 +113,7 @@ export default class AppPicker extends Vue {
* 应用实体主键属性名称 * 应用实体主键属性名称
* *
* @type {string} * @type {string}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
@Prop({default: 'srfkey'}) public deKeyField!: string; @Prop({default: 'srfkey'}) public deKeyField!: string;
...@@ -240,7 +248,7 @@ export default class AppPicker extends Vue { ...@@ -240,7 +248,7 @@ export default class AppPicker extends Vue {
* 输入状态 * 输入状态
* *
* @type {boolean} * @type {boolean}
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
public inputState: boolean = false; public inputState: boolean = false;
...@@ -397,6 +405,7 @@ export default class AppPicker extends Vue { ...@@ -397,6 +405,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField] }); this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField] });
} }
this.fillPickUpData(item);
} }
/** /**
...@@ -430,6 +439,7 @@ export default class AppPicker extends Vue { ...@@ -430,6 +439,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: '' }); this.$emit('formitemvaluechange', { name: this.name, value: '' });
} }
this.fillPickUpData();
this.$forceUpdate(); this.$forceUpdate();
} }
...@@ -672,6 +682,7 @@ export default class AppPicker extends Vue { ...@@ -672,6 +682,7 @@ export default class AppPicker extends Vue {
if (this.name) { if (this.name) {
this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField]?item[this.deMajorField]:item["srfmajortext"] }); this.$emit('formitemvaluechange', { name: this.name, value: item[this.deMajorField]?item[this.deMajorField]:item["srfmajortext"] });
} }
this.fillPickUpData(item);
} }
} }
...@@ -752,7 +763,7 @@ export default class AppPicker extends Vue { ...@@ -752,7 +763,7 @@ export default class AppPicker extends Vue {
/** /**
* 输入过程中 * 输入过程中
* *
* @memberof AppAutocomplete * @memberof AppPicker
*/ */
public onInput($event: any) { public onInput($event: any) {
if (Object.is($event, this.value)) { if (Object.is($event, this.value)) {
...@@ -784,6 +795,34 @@ export default class AppPicker extends Vue { ...@@ -784,6 +795,34 @@ export default class AppPicker extends Vue {
} }
} }
/**
* 填充外键值附加数据
*
* @param {item} 数据集
* @memberof AppPicker
*/
public fillPickUpData(item?:any){
if(this.pickUpData){
let pickUpDataArray:Array<any> = this.pickUpData.split(";")
if(pickUpDataArray && pickUpDataArray.length >0){
for(let i=0;i<pickUpDataArray.length;i++){
if(item){
this.$emit("formitemvaluechange", {
name: pickUpDataArray[i],
value: item[pickUpDataArray[i]],
});
}else{
this.$emit("formitemvaluechange", {
name: pickUpDataArray[i],
value: "",
});
}
}
}
}
}
} }
</script> </script>
......
...@@ -20,10 +20,10 @@ export default class AvueCustomForm extends Vue { ...@@ -20,10 +20,10 @@ export default class AvueCustomForm extends Vue {
/** /**
* 编辑器参数传入组件配置 * 编辑器参数传入组件配置
* *
* @type {any} * @type {*}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
@Prop() public options?: any; public options: any;
/** /**
* 是否需要转换为string类型 * 是否需要转换为string类型
...@@ -47,7 +47,7 @@ export default class AvueCustomForm extends Vue { ...@@ -47,7 +47,7 @@ export default class AvueCustomForm extends Vue {
* @type {any} * @type {any}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
@Model('change') public value: any; @Model("change") public value: any;
/** /**
* 是否将表单数据通过组件配置带入组件中 * 是否将表单数据通过组件配置带入组件中
...@@ -57,13 +57,22 @@ export default class AvueCustomForm extends Vue { ...@@ -57,13 +57,22 @@ export default class AvueCustomForm extends Vue {
*/ */
@Prop() public isFormData?: boolean; @Prop() public isFormData?: boolean;
/**
* 是否为子表单
*
* @type {boolean}
* @memberof AvueCustomForm
*/
@Prop() public isSubForm?: boolean;
/** /**
* 表单数据 * 表单数据
* *
* @type {any} * @type {*}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
@Prop() public formData: any; @Prop()
public formData?: any;
/** /**
* 表单状态 * 表单状态
...@@ -84,6 +93,8 @@ export default class AvueCustomForm extends Vue { ...@@ -84,6 +93,8 @@ export default class AvueCustomForm extends Vue {
if (this.value) { if (this.value) {
if (this.isParseString) obj = JSON.parse(this.value); if (this.isParseString) obj = JSON.parse(this.value);
else obj = this.value; else obj = this.value;
if (this.isSubForm && obj instanceof Array)
obj = this.loadSubFormData(obj);
} }
return obj; return obj;
} }
...@@ -110,7 +121,7 @@ export default class AvueCustomForm extends Vue { ...@@ -110,7 +121,7 @@ export default class AvueCustomForm extends Vue {
/** /**
* 当前组件配置设置属性 * 当前组件配置设置属性
* *
* @type {any} * @type {*}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
public formOption: any = null; public formOption: any = null;
...@@ -118,7 +129,7 @@ export default class AvueCustomForm extends Vue { ...@@ -118,7 +129,7 @@ export default class AvueCustomForm extends Vue {
/** /**
* avue-form默认配置 * avue-form默认配置
* *
* @type {any} * @type {*}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
public defaultOptions: any = { public defaultOptions: any = {
...@@ -185,22 +196,26 @@ export default class AvueCustomForm extends Vue { ...@@ -185,22 +196,26 @@ export default class AvueCustomForm extends Vue {
* *
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
public load() { public async load() {
let that: any = this; let that: any = this;
if (!this.options && this.options == null) { if (!this.options && this.options == null) {
if (this.url && this.options == null) { if (this.url && this.options == null) {
const get: Promise<any> = this.$http.get(this.url); const get: Promise<any> = this.$http.get(this.url);
get.then((response: any) => { await get.then((response: any) => {
if (response && response.data) { if (response && response.data) {
that.formOption = response.data; let options: any = response.data;
if (this.isFormData) that.getFormData(); this.transitionDicUrlCondition(options);
that.formOption = options;
if (that.isFormData) that.getFormData();
} }
}); });
} else { } else {
this.transitionDicUrlCondition(this.defaultOptions);
this.formOption = this.defaultOptions; this.formOption = this.defaultOptions;
if (this.isFormData) that.getFormData(); if (this.isFormData) that.getFormData();
} }
} else { } else {
this.transitionDicUrlCondition(this.options);
this.formOption = this.options; this.formOption = this.options;
if (this.isFormData) that.getFormData(); if (this.isFormData) that.getFormData();
} }
...@@ -239,18 +254,77 @@ export default class AvueCustomForm extends Vue { ...@@ -239,18 +254,77 @@ export default class AvueCustomForm extends Vue {
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
public setValue(value: any) { public setValue(value: any) {
if (this.isSubForm) value = this.getSubFormData(value);
if (this.isParseString) this.$emit("change", JSON.stringify(value)); if (this.isParseString) this.$emit("change", JSON.stringify(value));
else this.$emit("change", value); else this.$emit("change", value);
} }
/**
* 提取第一个属性值
*
* @memberof AvueCustomForm
* @return {Array<any>}
*/
public getSubFormData(value: any): Array<any> {
let arr: Array<any> = [];
for (let val in value) {
arr = value[val];
break;
}
return arr;
}
/**
* 加载子表单值
*
* @memberof AvueCustomForm
* @return {*}
*/
public loadSubFormData(arr: Array<any>): any {
let value: any = {};
value[this.formOption.column[0].prop] = arr;
return value;
}
/**
* 配置的下拉列表转换符号支持动态配置
*
* @memberof AvueCustomForm
* @param {*}
*/
public transitionDicUrlCondition(options: any) {
let that: any = this;
let recursive: any = function (obj: any) {
if (obj.column && obj.column.length > 0) {
obj.column.forEach((col: any) => {
if (col.dicUrl && col.dicUrl.indexOf("$") > 0) {
let g = /\${[^+]+}/;
let dicGroup = col.dicUrl.match(g);
dicGroup.forEach((dic: any) => {
col.dicUrl = col.dicUrl.replace(
dic,
that.formData[dic.substring(2, dic.length - 1)]
);
});
}
if (col.children) recursive(col.children);
if (col.group) recursive(col.group);
});
}
if (obj.children) recursive(obj.children);
if (obj.group) recursive(obj.group);
};
recursive(options);
}
/** /**
* 销毁组件(vue生命周期) * 销毁组件(vue生命周期)
* *
* @type {Subject<any>} * @type {Subject<any>}
* @memberof AvueCustomForm * @memberof AvueCustomForm
*/ */
public destroy(){ public destroy() {
if(this.formStateEvent){ if (this.formStateEvent) {
this.formStateEvent.unsubscribe(); this.formStateEvent.unsubscribe();
} }
} }
......
...@@ -81,6 +81,9 @@ export default class CalendarExpViewEngine extends ViewEngine { ...@@ -81,6 +81,9 @@ export default class CalendarExpViewEngine extends ViewEngine {
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
if(this.calendarExpBar && this.calendarExpBar.calcNavigationToolbarState && this.calendarExpBar.calcNavigationToolbarState instanceof Function){
this.calendarExpBar.calcNavigationToolbarState();
}
this.view.$emit('viewdataschange', args); this.view.$emit('viewdataschange', args);
} }
if (Object.is(eventName, 'activated')) { if (Object.is(eventName, 'activated')) {
......
...@@ -78,6 +78,9 @@ export default class DataViewExpViewEngine extends ViewEngine { ...@@ -78,6 +78,9 @@ export default class DataViewExpViewEngine extends ViewEngine {
*/ */
public dataviewExpBarEvent(eventName: string, args: any): void { public dataviewExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) { if (Object.is(eventName, 'load')) {
if(this.dataviewExpBar && this.dataviewExpBar.calcNavigationToolbarState && this.dataviewExpBar.calcNavigationToolbarState instanceof Function){
this.dataviewExpBar.calcNavigationToolbarState();
}
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
......
...@@ -78,6 +78,9 @@ export default class GridExpViewEngine extends ViewEngine { ...@@ -78,6 +78,9 @@ export default class GridExpViewEngine extends ViewEngine {
*/ */
public gridExpBarEvent(eventName: string, args: any): void { public gridExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) { if (Object.is(eventName, 'load')) {
if(this.gridExpBar && this.gridExpBar.calcNavigationToolbarState && this.gridExpBar.calcNavigationToolbarState instanceof Function){
this.gridExpBar.calcNavigationToolbarState();
}
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
......
...@@ -78,6 +78,9 @@ export default class ListExpViewEngine extends ViewEngine { ...@@ -78,6 +78,9 @@ export default class ListExpViewEngine extends ViewEngine {
*/ */
public listExpBarEvent(eventName: string, args: any): void { public listExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) { if (Object.is(eventName, 'load')) {
if(this.listExpBar && this.listExpBar.calcNavigationToolbarState && this.listExpBar.calcNavigationToolbarState instanceof Function){
this.listExpBar.calcNavigationToolbarState();
}
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
......
...@@ -401,10 +401,10 @@ export default class MDViewEngine extends ViewEngine { ...@@ -401,10 +401,10 @@ export default class MDViewEngine extends ViewEngine {
if (this.view.viewparams && Object.keys(this.view.viewparams).length > 0) { if (this.view.viewparams && Object.keys(this.view.viewparams).length > 0) {
Object.assign(arg, this.view.viewparams); Object.assign(arg, this.view.viewparams);
} }
if (this.getSearchForm() && this.view.isExpandSearchForm) { if (this.getSearchForm()) {
Object.assign(arg, this.getSearchForm().getData()); Object.assign(arg, this.getSearchForm().getData());
} }
if (this.view && this.view.$refs.searchbar && this.view.isExpandSearchForm) { if (this.view && this.view.$refs.searchbar) {
Object.assign(arg, this.view.$refs.searchbar.getData()); Object.assign(arg, this.view.$refs.searchbar.getData());
} }
if (this.view && !this.view.isExpandSearchForm) { if (this.view && !this.view.isExpandSearchForm) {
......
...@@ -79,6 +79,9 @@ export default class TreeExpView extends ViewEngine { ...@@ -79,6 +79,9 @@ export default class TreeExpView extends ViewEngine {
*/ */
public treeExpBarEvent(eventName: string, args: any): void { public treeExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) { if (Object.is(eventName, 'load')) {
if(this.treeExpBar && this.treeExpBar.calcNavigationToolbarState && this.treeExpBar.calcNavigationToolbarState instanceof Function){
this.treeExpBar.calcNavigationToolbarState();
}
this.view.$emit('viewload', args); this.view.$emit('viewload', args);
} }
if (Object.is(eventName, 'selectionchange')) { if (Object.is(eventName, 'selectionchange')) {
......
...@@ -47,12 +47,21 @@ export const getLocalData = (state: any) => () => { ...@@ -47,12 +47,21 @@ export const getLocalData = (state: any) => () => {
* @param state * @param state
*/ */
export const getAppData = (state: any) => () => { export const getAppData = (state: any) => () => {
if(!state.appdata){
state.appdata = {};
}
let result:any = JSON.parse(JSON.stringify(state.appdata)); let result:any = JSON.parse(JSON.stringify(state.appdata));
if(state.localdata && Object.keys(state.localdata).length >0){
let copyContext:any = result.context?result.context:{}; let copyContext:any = result.context?result.context:{};
if(state.localdata && Object.keys(state.localdata).length >0){
Object.assign(copyContext,state.localdata); Object.assign(copyContext,state.localdata);
result.context = copyContext; }else if(localStorage.getItem('localdata')){
try{
Object.assign(copyContext,JSON.parse(localStorage.getItem('localdata') as string));
}catch(error){
console.warn(error);
}
} }
result.context = copyContext;
return result; return result;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册