Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
22
议题
22
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7
提交
4a8a8a83
提交
4a8a8a83
编写于
11月 10, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
9319a667
变更
7
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
91 行增加
和
23 行删除
+91
-23
control-logic.ftl
@CONTROL/@MACRO/CONTROL/@MACRO/control-logic.ftl
+1
-1
CONTROL_HEADER-BASE.vue.ftl
@CONTROL/@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
+20
-1
DEFAULT.html.ftl
@CONTROL/@MACRO/HTML/DEFAULT.html.ftl
+1
-1
CONTROL-BASE.vue.ftl
@CONTROL/数据视图/CONTROL-BASE.vue.ftl
+58
-16
CONTROL-BASE.vue.ftl
@CONTROL/表格/CONTROL-BASE.vue.ftl
+2
-2
LOGIC.vue.ftl
@LOGIC/@VIEWLOGIC/实体界面逻辑/LOGIC.vue.ftl
+8
-1
VIEW_CONTENT-BASE.vue.ftl
@VIEW/@MACRO/VIEW_CONTENT-BASE.vue.ftl
+1
-1
未找到文件。
@CONTROL/@MACRO/CONTROL/@MACRO/control-logic.ftl
浏览文件 @
4a8a8a83
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
viewparams,
viewparams,
actionData.event ? actionData.event : {},
actionData.event ? actionData.event : {},
this,
this,
this
.viewCtx && this.viewCtx.view ? this.viewCtx.view : {}
,
this,
context.srfparentdename ? context.srfparentdename : ''
context.srfparentdename ? context.srfparentdename : ''
);
);
if (result && result.hasOwnProperty('srfret') && (result.srfret === 'false' || result.srfret === false)) {
if (result && result.hasOwnProperty('srfret') && (result.srfret === 'false' || result.srfret === false)) {
...
...
@CONTROL/@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
浏览文件 @
4a8a8a83
...
@@ -77,13 +77,32 @@ export default class ${srfclassname('${ctrl.codeName}')}Base extends Vue impleme
...
@@ -77,13 +77,32 @@ export default class ${srfclassname('${ctrl.codeName}')}Base extends Vue impleme
*/
*/
@Prop() public viewparams!: any;
@Prop() public viewparams!: any;
/**
* 视图操作参数(父级)
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Prop() public pViewCtx!: any;
/**
/**
* 视图操作参数
* 视图操作参数
*
*
* @type {*}
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
*/
@Prop() public viewCtx!: any;
public viewCtx: any = {};
/**
* 监听视图操作参数变化
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
@Watch('pViewCtx', { immediate: true, deep: true })
public onViewCtxChange(newVal: any, oldVal: any) {
Object.assign(this.viewCtx, newVal, { xData: this, ctrl: this });
}
/**
/**
* 视图状态事件
* 视图状态事件
...
...
@CONTROL/@MACRO/HTML/DEFAULT.html.ftl
浏览文件 @
4a8a8a83
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
:viewState="viewState"
:viewState="viewState"
:viewparams="viewparams"
:viewparams="viewparams"
:context="context"
:context="context"
:
v
iewCtx="viewCtx"
:
pV
iewCtx="viewCtx"
<#if content??>
<#if content??>
${content}<#t>
${content}<#t>
</#if>
</#if>
...
...
@CONTROL/数据视图/CONTROL-BASE.vue.ftl
浏览文件 @
4a8a8a83
...
@@ -806,7 +806,7 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -806,7 +806,7 @@ import CodeListService from "@/codelist/codelist-service";
* @param {boolean} [isReset=false] 是否重置items
* @param {boolean} [isReset=false] 是否重置items
* @memberof ${srfclassname('${ctrl.codeName}')}Base
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
*/
public
load(opt: any = {}, isReset: boolean = false): void
{
public
async load(opt: any = {}, isReset: boolean = false): Promise<any>
{
if(!this.fetchAction){
if(!this.fetchAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.fetchAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.fetchAction') as string) });
return;
return;
...
@@ -828,14 +828,25 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -828,14 +828,25 @@ import CodeListService from "@/codelist/codelist-service";
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
let tempViewParams:any = parentdata.viewparams?parentdata.viewparams:{};
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(tempViewParams,JSON.parse(JSON.stringify(this.viewparams)));
Object.assign(arg,{viewparams:tempViewParams});
Object.assign(arg,{viewparams:tempViewParams});
const post: Promise<any> = this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!(await this.handleCtrlEvents('onbeforeload', { data: arg }))) {
post.then((response: any) => {
return;
}
try {
const response = await this.service.search(this.fetchAction,JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
if (!response || response.status !== 200) {
if (!response || response.status !== 200) {
// 加载失败
if (!(await this.handleCtrlEvents('onloaderror', { data: response.data ? response.data : [] }))) {
return;
}
if (response.data && response.data.message) {
if (response.data && response.data.message) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data.message });
}
}
return;
return;
}
}
// 加载成功
if (!(await this.handleCtrlEvents('onloadsuccess', { data: response.data }))) {
return;
}
const data: any = response.data;
const data: any = response.data;
if(!this.isAddBehind){
if(!this.isAddBehind){
this.items = [];
this.items = [];
...
@@ -873,6 +884,19 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -873,6 +884,19 @@ import CodeListService from "@/codelist/codelist-service";
<#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
<#if ctrl.isEnableGroup?? && ctrl.isEnableGroup()>
this.group();
this.group();
</#if>
</#if>
} catch (response: any) {
// 加载失败
if (!(await this.handleCtrlEvents('onloaderror', { data: response && response.data ? response.data : [] }))) {
return;
}
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.data && response.data.message ? response.data.message : "" });
}
const post: Promise<any> =
post.then((response: any) => {
}, (response: any) => {
}, (response: any) => {
if (response && response.status === 401) {
if (response && response.status === 401) {
return;
return;
...
@@ -935,15 +959,22 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -935,15 +959,22 @@ import CodeListService from "@/codelist/codelist-service";
});
});
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
let _removeAction = keys.length > 1 ? 'removeBatch' : this.removeAction ;
const context:any = JSON.parse(JSON.stringify(this.context));
const context:any = JSON.parse(JSON.stringify(this.context));
const post: Promise<any> = this.service.delete(_removeAction,Object.assign(context,{ ${ctrl.getPSAppDataEntity().codeName?lower_case}: keys.join(';') }),Object.assign({ ${ctrl.getPSAppDataEntity().codeName?lower_case}: keys.join(';') },{viewparams:this.viewparams}), this.showBusyIndicator);
try {
return new Promise((resolve: any, reject: any) => {
if (!(await this.handleCtrlEvents('onbeforeremove', { data: _keys }))) {
post.then((response: any) => {
return;
}
const response: any = this.service.delete(_removeAction,Object.assign(context,{ ${ctrl.getPSAppDataEntity().codeName?lower_case}: keys.join(';') }),Object.assign({ ${ctrl.getPSAppDataEntity().codeName?lower_case}: keys.join(';') },{viewparams:this.viewparams}), this.showBusyIndicator);
if (!response || response.status !== 200) {
if (!response || response.status !== 200) {
if (!(await this.handleCtrlEvents('onremoveerror', { data: _keys }))) {
return;
}
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return;
return;
} else {
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
}
}
if (!(await this.handleCtrlEvents('onremovesuccess', { data: response.data }))) {
return;
}
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
//删除items中已删除的项
//删除items中已删除的项
_datas.forEach((data: any) => {
_datas.forEach((data: any) => {
this.items.some((item:any,index:number)=>{
this.items.some((item:any,index:number)=>{
...
@@ -958,19 +989,16 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -958,19 +989,16 @@ import CodeListService from "@/codelist/codelist-service";
});
});
this.$emit('remove', null);
this.$emit('remove', null);
this.selections = [];
this.selections = [];
resolve(response)
;
return response
;
}).catch((response: any) =>
{
} catch (response: any)
{
if (response && response.status === 401) {
if (response && response.status === 401) {
return;
return;
}
}
if (!response || !response.status || !response.data) {
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response);
return;
}
}
reject(response);
return response;
});
}
});
}
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
...
@@ -998,6 +1026,9 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -998,6 +1026,9 @@ import CodeListService from "@/codelist/codelist-service";
let successItems:any = [];
let successItems:any = [];
let errorItems:any = [];
let errorItems:any = [];
let errorMessage:any = [];
let errorMessage:any = [];
if (!(await this.handleCtrlEvents('onbeforesave', { data: _this.items }))) {
return;
}
for (const item of _this.items) {
for (const item of _this.items) {
try {
try {
if(Object.is(item.rowDataState, 'create')){
if(Object.is(item.rowDataState, 'create')){
...
@@ -1030,8 +1061,14 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -1030,8 +1061,14 @@ import CodeListService from "@/codelist/codelist-service";
this.$emit('save', successItems);
this.$emit('save', successItems);
this.refresh();
this.refresh();
if(errorItems.length === 0){
if(errorItems.length === 0){
if (!(await this.handleCtrlEvents('onsavesuccess', { data: successItems }))) {
return;
}
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{
} else {
if (!(await this.handleCtrlEvents('onsaveerror', { data: errorItems }))) {
return;
}
errorItems.forEach((item:any,index:number)=>{
errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname + (this.$t('app.commonWords.saveFailed') as string) + '!' });
this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname + (this.$t('app.commonWords.saveFailed') as string) + '!' });
console.error(errorMessage[index]);
console.error(errorMessage[index]);
...
@@ -1083,6 +1120,10 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -1083,6 +1120,10 @@ import CodeListService from "@/codelist/codelist-service";
*
*
*/
*/
public selectchange() {
public selectchange() {
this.handleCtrlEvents('onselectionchange').then((res: boolean) => {
if (!res) {
return;
}
this.selections = [];
this.selections = [];
this.items.map((item: any) => {
this.items.map((item: any) => {
if (item.isselected) {
if (item.isselected) {
...
@@ -1090,6 +1131,7 @@ import CodeListService from "@/codelist/codelist-service";
...
@@ -1090,6 +1131,7 @@ import CodeListService from "@/codelist/codelist-service";
}
}
});
});
this.$emit('selectionchange', this.selections);
this.$emit('selectionchange', this.selections);
})
}
}
/**
/**
...
...
@CONTROL/表格/CONTROL-BASE.vue.ftl
浏览文件 @
4a8a8a83
...
@@ -842,7 +842,7 @@ ${gridColumn.getName()}
...
@@ -842,7 +842,7 @@ ${gridColumn.getName()}
);
);
if (!response.status || response.status !== 200) {
if (!response.status || response.status !== 200) {
// 加载失败
// 加载失败
if (!(await this.handleCtrlEvents('onloaderror', { data: response.data ? response.data : []
, context: tempContext, viewparams: arg
}))) {
if (!(await this.handleCtrlEvents('onloaderror', { data: response.data ? response.data : [] }))) {
return;
return;
}
}
if (response.data && response.data.message) {
if (response.data && response.data.message) {
...
@@ -910,7 +910,7 @@ ${gridColumn.getName()}
...
@@ -910,7 +910,7 @@ ${gridColumn.getName()}
return response;
return response;
} catch (response: any) {
} catch (response: any) {
// 加载失败
// 加载失败
if (!(await this.handleCtrlEvents('onloaderror', { data: response
.data, context: tempContext, viewparams: tempViewParams
}))) {
if (!(await this.handleCtrlEvents('onloaderror', { data: response
&& response.data ? response.data : []
}))) {
return;
return;
}
}
if (response && response.status === 401) {
if (response && response.status === 401) {
...
...
@LOGIC/@VIEWLOGIC/实体界面逻辑/LOGIC.vue.ftl
浏览文件 @
4a8a8a83
...
@@ -5,6 +5,10 @@
...
@@ -5,6 +5,10 @@
*/
*/
public ${item.name}(params: any = {}, tag?: any, $event?: any) {
public ${item.name}(params: any = {}, tag?: any, $event?: any) {
const { data, context, viewparams, xData, event } = params;
const { data, context, viewparams, xData, event } = params;
// 合并当前激活部件
if (xData) {
Object.assign(this.viewCtx, { ctrl: xData, xData });
}
<#if item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()?? && item.getPSAppDEUILogic().getPSAppDataEntity()??>
<#if item.getPSAppDEUILogic?? && item.getPSAppDEUILogic()?? && item.getPSAppDEUILogic().getPSAppDataEntity()??>
window.uiServiceRegister.getService('${item.getPSAppDEUILogic().getPSAppDataEntity().codeName?lower_case}').then((uiService: any) => {
window.uiServiceRegister.getService('${item.getPSAppDEUILogic().getPSAppDataEntity().codeName?lower_case}').then((uiService: any) => {
if (uiService) {
if (uiService) {
...
@@ -17,7 +21,10 @@
...
@@ -17,7 +21,10 @@
xData,
xData,
this,
this,
context && context.srfparentdename ? context.srfparentdename : ''
context && context.srfparentdename ? context.srfparentdename : ''
);
).then(() => {
delete this.viewCtx['ctrl'];
delete this.viewCtx['xData'];
});
}
}
});
});
</#if>
</#if>
...
...
@VIEW/@MACRO/VIEW_CONTENT-BASE.vue.ftl
浏览文件 @
4a8a8a83
...
@@ -380,7 +380,7 @@
...
@@ -380,7 +380,7 @@
*/
*/
initViewCtx() {
initViewCtx() {
Object.assign(this.viewCtx, {
Object.assign(this.viewCtx, {
app: this.$ro
uter
,
app: this.$ro
ot
,
view: this,
view: this,
viewGlobal: {},
viewGlobal: {},
viewNavData: {},
viewNavData: {},
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录