提交 1691b89b 编写于 作者: Shine-zwj's avatar Shine-zwj

update:更新

上级 5f5624c5
......@@ -12,23 +12,23 @@
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
if (this.viewType === 'APPLOGINVIEW') {
const length = Object.keys(this.layoutData).length;
if (actionContext.viewType === 'APPLOGINVIEW') {
const length = Object.keys(actionContext.layoutData).length;
for (let i = length - 1; i >= 0; i--) {
const name = Object.keys(this.layoutData)[i];
if (this.layoutData.hasOwnProperty(name) && !Object.is(this.layoutModelDetails[name].itemType, 'CONTAINER')) {
this.handleValueChange({ name, value: null });
const name = Object.keys(actionContext.layoutData)[i];
if (actionContext.layoutData.hasOwnProperty(name) && !Object.is(actionContext.layoutModelDetails[name].itemType, 'CONTAINER')) {
actionContext.handleValueChange({ name, value: null });
}
}
this.$nextTick(() => {
this.$forceUpdate();
actionContext.$nextTick(() => {
actionContext.$forceUpdate();
})
} else {
const parentRef: any = this.$parent;
const parentRef: any = actionContext.$parent;
if (parentRef.closeView && (parentRef.closeView instanceof Function)) {
parentRef.closeView(args);
} else if (this.closeView && (this.closeView instanceof Function)) {
this.closeView(args);
} else if (actionContext.closeView && (actionContext.closeView instanceof Function)) {
actionContext.closeView(args);
}
}
}
......
......@@ -27,15 +27,15 @@
try {
service.Create(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
})
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行建立数据逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '建立数据行未配置实体' });
actionContext.$Notice.error({ title: '错误', desc: '建立数据行未配置实体' });
</#if>
}
</#macro>
\ No newline at end of file
......@@ -32,15 +32,21 @@
try {
service.Remove(tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
}
const parentRef: any = actionContext.$parent;
if (parentRef.closeView && (parentRef.closeView instanceof Function)) {
parentRef.closeView(args);
} else if (actionContext.closeView && (actionContext.closeView instanceof Function)) {
actionContext.closeView(args);
}
})
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行删除数据逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '删除数据行未配置实体' });
actionContext.$Notice.error({ title: '错误', desc: '删除数据行未配置实体' });
</#if>
}
</#macro>
\ No newline at end of file
......@@ -38,18 +38,18 @@
if (service[action] && service[action] instanceof Function) {
service[action](tempContext, data).then((response: any) => {
if (!response.status || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
})
} else {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
} catch (error: any) {
this.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
actionContext.$Notice.error({ title: '错误', desc: '当前环境无法执行保存变更逻辑[执行行为异常]' });
}
}
<#else>
this.$Notice.error({ title: '错误', desc: '保存变更行为未配置实体' });
actionContext.$Notice.error({ title: '错误', desc: '保存变更行为未配置实体' });
</#if>
}
</#macro>
\ No newline at end of file
......@@ -18,7 +18,7 @@
} else if (xData.refreshDataArea && (xData.refreshDataArea instanceof Function)) {
xData.refreshDataArea();
} else {
this.$Notice.error({ title: '错误', desc: '同步数据行为未实现' });
actionContext.$Notice.error({ title: '错误', desc: '同步数据行为未实现' });
}
}
}
......
......@@ -12,17 +12,17 @@
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
if (this.viewType === 'APPLOGINVIEW') {
if (actionContext.viewType === 'APPLOGINVIEW') {
const layoutData = args.length > 0 ? args[0] : {};
const layoutModelDetails: any = this.layoutModelDetails || {};
const layoutModelDetails: any = actionContext.layoutModelDetails || {};
let userNameKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_USERID')) || '';
let passwordKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_PASSWORD')) || '';
let messageKey: string = Object.keys(layoutModelDetails).find((key: string) => Object.is(layoutModelDetails[key].predefinedType, 'AUTH_LOGINMSG')) || '';
if (!userNameKey || !passwordKey) {
if (messageKey) {
this.handleValueChange({ name: messageKey, value: '用户名或密码未配置!' });
actionContext.handleValueChange({ name: messageKey, value: '用户名或密码未配置!' });
} else {
this.$message({ message: '用户名或密码未配置!',type: 'warning'});
actionContext.$message({ message: '用户名或密码未配置!',type: 'warning'});
}
return;
}
......@@ -30,9 +30,9 @@
const password: any = layoutData[passwordKey];
if (!loginname || !password) {
if (messageKey) {
this.handleValueChange({ name: messageKey, value: '请输入用户名与密码' });
actionContext.handleValueChange({ name: messageKey, value: '请输入用户名与密码' });
} else {
this.$message({ message: '请输入用户名与密码',type: 'warning'});
actionContext.$message({ message: '请输入用户名与密码',type: 'warning'});
}
return;
}
......@@ -41,7 +41,7 @@
leftTime.setTime(leftTime.getSeconds() - 1000);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
const data = { loginname, password };
const post: Promise<any> = this.$http.post('/v7/login', data, true);
const post: Promise<any> = actionContext.$http.post('/v7/login', data, true);
post.then((response: any) => {
if (response && response.status === 200) {
const data = response.data;
......@@ -55,20 +55,20 @@
// 设置cookie,保存账号密码7天
Util.setCookie("loginname",loginname, 7);
// 跳转首页
const url: any = this.$route.query.redirect ? this.$route.query.redirect : '*';
this.$router.push({path: url});
const url: any = actionContext.$route.query.redirect ? actionContext.$route.query.redirect : '*';
actionContext.$router.push({path: url});
}
}).catch((error: any) => {
// 登录提示
const data = error.data;
if (data) {
if (messageKey) {
this.handleValueChange({ name: messageKey, value: data.message || this.$t('components.login.loginfailed') });
actionContext.handleValueChange({ name: messageKey, value: data.message || this.$t('components.login.loginfailed') });
}
}
});
} else {
this.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') } });
actionContext.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') } });
}
}
</#macro>
\ No newline at end of file
......@@ -12,13 +12,13 @@
* @param {*} [srfParentDeName] 父实体名称
*/
public ${item.getFullCodeName()}(args: any[], contextJO?:any, params?: any, $event?: any, xData?: any, actionContext?:any, srfParentDeName?:string) {
this.$Modal.confirm({
actionContext.$Modal.confirm({
title: '提示',
content: '确认要退出登录?',
okText: '确认',
cancelText: '取消',
onOk: () => {
this.$http
actionContext.$http
.get("/v7/logout")
.then((response: any) => {
if (response && response.status === 200) {
......@@ -27,7 +27,7 @@
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
this.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') } });
actionContext.$router.push({ path: "/login", query: { redirect: window.location.hash.replace("#", '') } });
}
})
.catch((error: any) => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册