提交 473d7239 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 发布系统代码 [TrainSys,网页端]

上级 d7dfff35
......@@ -238,24 +238,26 @@ export default class AppDrawerCompponent extends Vue {
public onVisibleChange($event: any) {
const component: any = this.$refs[this.viewname];
if (component) {
// todo viewDataChange确认提示
// if (this.isViewdatachange) {
// this.isShow = true;
// const title: any = this.$t('app.tabpage.sureclosetip.title');
// const contant: any = this.$t('app.tabpage.sureclosetip.content');
// this.$Modal.confirm({
// title: title,
// content: contant,
// onOk: () => {
// this.isShow = false;
// },
// onCancel: () => {
// this.isShow = true;
// }
// });
// } else {
this.handleShowState($event);
// }
const viewInstance = component.$children[0];
const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](viewInstance?.viewtag);
if (viewDataChange) {
this.isShow = true;
const title: any = this.$t('app.tabpage.sureclosetip.title');
const contant: any = this.$t('app.tabpage.sureclosetip.content');
this.$Modal.confirm({
title: title,
content: contant,
onOk: () => {
this.$store.commit('viewAction/removeView', viewInstance.viewtag);
this.isShow = false;
},
onCancel: () => {
this.isShow = true;
}
});
} else {
this.handleShowState($event);
}
}
}
......
......@@ -265,24 +265,26 @@ export default class AppModalCompponent extends Vue {
public onVisibleChange($event: any) {
const component: any = this.$refs[this.viewname];
if (component) {
// todo viewDataChange确认提示
// if (this.viewdatachange) {
// this.isShow = true;
// const title: any = this.$t('app.tabpage.sureclosetip.title');
// const contant: any = this.$t('app.tabpage.sureclosetip.content');
// this.$Modal.confirm({
// title: title,
// content: contant,
// onOk: () => {
// this.isShow = false;
// },
// onCancel: () => {
// this.isShow = true;
// }
// });
// } else {
this.handleShowState($event);
// }
const viewInstance = component.$children[0];
const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](viewInstance?.viewtag);
if (viewDataChange) {
this.isShow = true;
const title: any = this.$t('app.tabpage.sureclosetip.title');
const contant: any = this.$t('app.tabpage.sureclosetip.content');
this.$Modal.confirm({
title: title,
content: contant,
onOk: () => {
this.$store.commit('viewAction/removeView', viewInstance.viewtag);
this.isShow = false;
},
onCancel: () => {
this.isShow = true;
}
});
} else {
this.handleShowState($event);
}
}
}
......
......@@ -91,7 +91,7 @@ export class WFActionViewBase extends MainViewBase implements WFActionViewInterf
if (!response || response.status !== 200) {
return;
}
this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.$store.commit('viewAction/setViewDataChange', { viewTag: this.viewtag, viewDataChange: false });
this.$emit('view-event', { viewName: this.viewInstance.name, action: 'viewdataschange', data: [{ ...response.data }] });
this.$emit('view-event', { viewName: this.viewInstance.name, action: 'close', data: null });
})
......
......@@ -289,6 +289,16 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont
}
});
}
if (this.controlInstance.infoFormMode && AppCenterService.getMessageCenter()) {
this.appStateEvent = AppCenterService.getMessageCenter().subscribe(({ name, action, data }: { name: string, action: string, data: any }) => {
if (!this.appDeCodeName || !Object.is(name, this.appDeCodeName)) {
return;
}
if (Object.is(action, 'appRefresh')) {
this.refresh(data);
}
})
}
if (this.dataChang) {
this.dataChang.pipe(debounceTime(300), distinctUntilChanged()).subscribe((data: any) => {
this.handleDataChange();
......@@ -306,7 +316,7 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont
this.autoSave();
}
const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
// this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
this.$store.commit('viewAction/setViewDataChange', { viewTag: this.viewtag, viewDataChange: state });
}
/**
......@@ -1083,7 +1093,7 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont
this.fillForm(data, action);
this.oldData = {};
Object.assign(this.oldData, Util.deepCopy(this.data));
// this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
this.$store.commit('viewAction/setViewDataChange', { viewTag: this.viewtag, viewDataChange: false });
this.formLogic({ name: '' });
}
......
......@@ -172,23 +172,26 @@ export default class TabPageExp extends Vue {
* @memberof TabPageExp
*/
public onClose(name: any) {
// todo viewDataChange确认提示
// if (appview && appview.viewdatachange) {
// const title: any = this.$t("app.tabpage.sureclosetip.title");
// const content: any = this.$t("app.tabpage.sureclosetip.content");
// this.$Modal.confirm({
// title: title,
// content: content,
// onOk: () => {
// this.$store.commit("deletePage", name);
// this.gotoPage();
// },
// onCancel: () => {}
// });
// } else {
const navHistory: any = AppServiceBase.getInstance().getAppNavDataService();
const item: any = navHistory.historyList[navHistory.findHistoryIndex(this.$route)];
const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](item.tag);
if (viewDataChange) {
const title: any = this.$t("app.tabpage.sureclosetip.title");
const content: any = this.$t("app.tabpage.sureclosetip.content");
this.$Modal.confirm({
title: title,
content: content,
onOk: () => {
this.$store.commit('viewAction/removeView', item.tag);
this.$store.commit("deletePage", name);
this.gotoPage();
},
onCancel: () => {}
});
} else {
this.$store.commit('deletePage', name);
this.gotoPage();
// }
}
}
/**
......@@ -274,12 +277,6 @@ export default class TabPageExp extends Vue {
}, 1);
}
/**
* 移动至指定页面标签
*
* @param {*} to
* @memberof TabPageExp
*/
/**
* 移动至指定页面标签
*
......
......@@ -9,6 +9,7 @@ import * as getters from './getters';
import authresource from './modules/auth-resource'
import loadingService from './modules/loading-service'
import dataareastate from './modules/data-area-state';
import viewAction from './modules/view-action';
const state = {
...rootstate
......@@ -24,7 +25,8 @@ const store = new Vuex.Store({
modules: {
authresource,
loadingService,
dataareastate
dataareastate,
viewAction
},
});
......
/**
* 获取视图数据变化状态
*
* @param state
*/
export const getViewDataChangeState = (state:any) => (viewTag: string) => {
const appView = state.appViews.find((appView: any) => Object.is(appView.viewTag, viewTag));
if (appView) {
return appView.viewDataChange;
} else {
return false;
}
}
\ No newline at end of file
import { viewAction } from './state';
import * as mutations from './mutations';
import * as getters from './getters';
const state = {
...viewAction
}
export default {
namespaced: true,
state,
getters,
mutations
}
\ No newline at end of file
/**
* 删除视图
*
* @param state
* @param viewTag 视图viewTag
*/
export const removeView = (state: any, viewTag: string) => {
const index = state.appViews.findIndex((appView: any) => Object.is(appView.viewTag, viewTag));
if (index !== -1) {
state.appViews.splice(index, 1);
}
}
/**
* 设置视图数据变化状态
*
* @param state
* @param param { viewTag, viewDataChange } (视图viewTag, 视图数据改变)
*/
export const setViewDataChange = (state: any, { viewTag, viewDataChange }: { viewTag: string, viewDataChange: boolean }) => {
const appView = state.appViews.find((appView: any) => Object.is(appView.viewTag, viewTag));
if (appView) {
appView.viewDataChange = viewDataChange;
} else {
state.appViews.push({ viewTag, viewDataChange })
}
}
/**
* 视图状态
*/
export const viewAction: any = {
// 应用视图
appViews: [],
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-30-1">
<changeSet author="root" id="tab-book-32-1">
<createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column>
......
......@@ -259,7 +259,7 @@
"detailType" : "TABPANEL",
"name" : "tabpanel1",
"getPSDEFormTabPages" : [ {
"caption" : "分页面板",
"caption" : "分页面板1",
"codeName" : "tabpage1",
"detailStyle" : "DEFAULT",
"detailType" : "TABPAGE",
......@@ -328,7 +328,7 @@
"infoGroupMode" : false,
"showCaption" : true
}, {
"caption" : "分页面板",
"caption" : "分页面板2",
"codeName" : "tabpage2",
"detailStyle" : "DEFAULT",
"detailType" : "TABPAGE",
......
......@@ -1245,7 +1245,7 @@
"detailType" : "TABPANEL",
"name" : "tabpanel1",
"getPSDEFormTabPages" : [ {
"caption" : "分页面板",
"caption" : "分页面板1",
"codeName" : "tabpage1",
"detailStyle" : "DEFAULT",
"detailType" : "TABPAGE",
......@@ -1314,7 +1314,7 @@
"infoGroupMode" : false,
"showCaption" : true
}, {
"caption" : "分页面板",
"caption" : "分页面板2",
"codeName" : "tabpage2",
"detailStyle" : "DEFAULT",
"detailType" : "TABPAGE",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册