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

update:更新

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