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

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

上级 d7dfff35
...@@ -238,24 +238,26 @@ export default class AppDrawerCompponent extends Vue { ...@@ -238,24 +238,26 @@ export default class AppDrawerCompponent extends Vue {
public onVisibleChange($event: any) { public onVisibleChange($event: any) {
const component: any = this.$refs[this.viewname]; const component: any = this.$refs[this.viewname];
if (component) { if (component) {
// todo viewDataChange确认提示 const viewInstance = component.$children[0];
// if (this.isViewdatachange) { const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](viewInstance?.viewtag);
// this.isShow = true; if (viewDataChange) {
// const title: any = this.$t('app.tabpage.sureclosetip.title'); this.isShow = true;
// const contant: any = this.$t('app.tabpage.sureclosetip.content'); const title: any = this.$t('app.tabpage.sureclosetip.title');
// this.$Modal.confirm({ const contant: any = this.$t('app.tabpage.sureclosetip.content');
// title: title, this.$Modal.confirm({
// content: contant, title: title,
// onOk: () => { content: contant,
// this.isShow = false; onOk: () => {
// }, this.$store.commit('viewAction/removeView', viewInstance.viewtag);
// onCancel: () => { this.isShow = false;
// this.isShow = true; },
// } onCancel: () => {
// }); this.isShow = true;
// } else { }
this.handleShowState($event); });
// } } else {
this.handleShowState($event);
}
} }
} }
......
...@@ -265,24 +265,26 @@ export default class AppModalCompponent extends Vue { ...@@ -265,24 +265,26 @@ export default class AppModalCompponent extends Vue {
public onVisibleChange($event: any) { public onVisibleChange($event: any) {
const component: any = this.$refs[this.viewname]; const component: any = this.$refs[this.viewname];
if (component) { if (component) {
// todo viewDataChange确认提示 const viewInstance = component.$children[0];
// if (this.viewdatachange) { const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](viewInstance?.viewtag);
// this.isShow = true; if (viewDataChange) {
// const title: any = this.$t('app.tabpage.sureclosetip.title'); this.isShow = true;
// const contant: any = this.$t('app.tabpage.sureclosetip.content'); const title: any = this.$t('app.tabpage.sureclosetip.title');
// this.$Modal.confirm({ const contant: any = this.$t('app.tabpage.sureclosetip.content');
// title: title, this.$Modal.confirm({
// content: contant, title: title,
// onOk: () => { content: contant,
// this.isShow = false; onOk: () => {
// }, this.$store.commit('viewAction/removeView', viewInstance.viewtag);
// onCancel: () => { this.isShow = false;
// this.isShow = true; },
// } onCancel: () => {
// }); this.isShow = true;
// } else { }
this.handleShowState($event); });
// } } else {
this.handleShowState($event);
}
} }
} }
......
...@@ -91,7 +91,7 @@ export class WFActionViewBase extends MainViewBase implements WFActionViewInterf ...@@ -91,7 +91,7 @@ export class WFActionViewBase extends MainViewBase implements WFActionViewInterf
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
return; 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: 'viewdataschange', data: [{ ...response.data }] });
this.$emit('view-event', { viewName: this.viewInstance.name, action: 'close', data: null }); this.$emit('view-event', { viewName: this.viewInstance.name, action: 'close', data: null });
}) })
......
...@@ -289,6 +289,16 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont ...@@ -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) { if (this.dataChang) {
this.dataChang.pipe(debounceTime(300), distinctUntilChanged()).subscribe((data: any) => { this.dataChang.pipe(debounceTime(300), distinctUntilChanged()).subscribe((data: any) => {
this.handleDataChange(); this.handleDataChange();
...@@ -306,7 +316,7 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont ...@@ -306,7 +316,7 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont
this.autoSave(); this.autoSave();
} }
const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false; 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 ...@@ -1083,7 +1093,7 @@ export class EditFormControlBase extends FormControlBase implements EditFormCont
this.fillForm(data, action); this.fillForm(data, action);
this.oldData = {}; this.oldData = {};
Object.assign(this.oldData, Util.deepCopy(this.data)); 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: '' }); this.formLogic({ name: '' });
} }
......
...@@ -172,23 +172,26 @@ export default class TabPageExp extends Vue { ...@@ -172,23 +172,26 @@ export default class TabPageExp extends Vue {
* @memberof TabPageExp * @memberof TabPageExp
*/ */
public onClose(name: any) { public onClose(name: any) {
// todo viewDataChange确认提示 const navHistory: any = AppServiceBase.getInstance().getAppNavDataService();
// if (appview && appview.viewdatachange) { const item: any = navHistory.historyList[navHistory.findHistoryIndex(this.$route)];
// const title: any = this.$t("app.tabpage.sureclosetip.title"); const viewDataChange = this.$store.getters["viewAction/getViewDataChangeState"](item.tag);
// const content: any = this.$t("app.tabpage.sureclosetip.content"); if (viewDataChange) {
// this.$Modal.confirm({ const title: any = this.$t("app.tabpage.sureclosetip.title");
// title: title, const content: any = this.$t("app.tabpage.sureclosetip.content");
// content: content, this.$Modal.confirm({
// onOk: () => { title: title,
// this.$store.commit("deletePage", name); content: content,
// this.gotoPage(); onOk: () => {
// }, this.$store.commit('viewAction/removeView', item.tag);
// onCancel: () => {} this.$store.commit("deletePage", name);
// }); this.gotoPage();
// } else { },
onCancel: () => {}
});
} else {
this.$store.commit('deletePage', name); this.$store.commit('deletePage', name);
this.gotoPage(); this.gotoPage();
// } }
} }
/** /**
...@@ -274,12 +277,6 @@ export default class TabPageExp extends Vue { ...@@ -274,12 +277,6 @@ export default class TabPageExp extends Vue {
}, 1); }, 1);
} }
/**
* 移动至指定页面标签
*
* @param {*} to
* @memberof TabPageExp
*/
/** /**
* 移动至指定页面标签 * 移动至指定页面标签
* *
......
...@@ -9,6 +9,7 @@ import * as getters from './getters'; ...@@ -9,6 +9,7 @@ import * as getters from './getters';
import authresource from './modules/auth-resource' import authresource from './modules/auth-resource'
import loadingService from './modules/loading-service' import loadingService from './modules/loading-service'
import dataareastate from './modules/data-area-state'; import dataareastate from './modules/data-area-state';
import viewAction from './modules/view-action';
const state = { const state = {
...rootstate ...rootstate
...@@ -24,7 +25,8 @@ const store = new Vuex.Store({ ...@@ -24,7 +25,8 @@ const store = new Vuex.Store({
modules: { modules: {
authresource, authresource,
loadingService, 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 @@ ...@@ -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"> <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]数据结构 --> <!--输出实体[BOOK]数据结构 -->
<changeSet author="root" id="tab-book-30-1"> <changeSet author="root" id="tab-book-32-1">
<createTable tableName="T_BOOK"> <createTable tableName="T_BOOK">
<column name="BOOKNAME" remarks="" type="VARCHAR(200)"> <column name="BOOKNAME" remarks="" type="VARCHAR(200)">
</column> </column>
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
"detailType" : "TABPANEL", "detailType" : "TABPANEL",
"name" : "tabpanel1", "name" : "tabpanel1",
"getPSDEFormTabPages" : [ { "getPSDEFormTabPages" : [ {
"caption" : "分页面板", "caption" : "分页面板1",
"codeName" : "tabpage1", "codeName" : "tabpage1",
"detailStyle" : "DEFAULT", "detailStyle" : "DEFAULT",
"detailType" : "TABPAGE", "detailType" : "TABPAGE",
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
"infoGroupMode" : false, "infoGroupMode" : false,
"showCaption" : true "showCaption" : true
}, { }, {
"caption" : "分页面板", "caption" : "分页面板2",
"codeName" : "tabpage2", "codeName" : "tabpage2",
"detailStyle" : "DEFAULT", "detailStyle" : "DEFAULT",
"detailType" : "TABPAGE", "detailType" : "TABPAGE",
......
...@@ -1245,7 +1245,7 @@ ...@@ -1245,7 +1245,7 @@
"detailType" : "TABPANEL", "detailType" : "TABPANEL",
"name" : "tabpanel1", "name" : "tabpanel1",
"getPSDEFormTabPages" : [ { "getPSDEFormTabPages" : [ {
"caption" : "分页面板", "caption" : "分页面板1",
"codeName" : "tabpage1", "codeName" : "tabpage1",
"detailStyle" : "DEFAULT", "detailStyle" : "DEFAULT",
"detailType" : "TABPAGE", "detailType" : "TABPAGE",
...@@ -1314,7 +1314,7 @@ ...@@ -1314,7 +1314,7 @@
"infoGroupMode" : false, "infoGroupMode" : false,
"showCaption" : true "showCaption" : true
}, { }, {
"caption" : "分页面板", "caption" : "分页面板2",
"codeName" : "tabpage2", "codeName" : "tabpage2",
"detailStyle" : "DEFAULT", "detailStyle" : "DEFAULT",
"detailType" : "TABPAGE", "detailType" : "TABPAGE",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册