提交 bc29b0a2 编写于 作者: laowang's avatar laowang

合并分支 'dev' 到 'master'

Dev

查看合并请求 !2
......@@ -6,18 +6,21 @@
<div v-if="show" :class="['calender_box' , activeItem]">
<#-- 日历样式----月 -->
<#if ctrl.getCalendarStyle() == "MONTH" || ctrl.getCalendarStyle() == "MONTH_TIMELINE">
<Calendar
<app-calendar
ref="calendar"
@prev="prev"
@next="next"
:value="value"
:markDate="markDate"
:responsive="true"
:isChangeStyle ="true"
:illustration="illustration"
@select="clickDay"
@selectYear="selectYear"
@selectMonth="selectMonth"
:sign="sign"
:events="eventsDate"
:tileContent="tileContent"/>
:tileContent="tileContent"></app-calendar>
<#-- 日历样式----天 -->
<#elseif ctrl.getCalendarStyle() == "DAY">
<div class="calendar-tools">
......@@ -29,18 +32,20 @@
</div>
<#-- 日历样式----周 -->
<#elseif ctrl.getCalendarStyle() == "WEEK" || ctrl.getCalendarStyle() == "WEEK_TIMELINE">
<Calendar
<app-calendar
ref="calendar"
:weekSwitch="true"
:value="value"
@prev="prev"
@next="next"
:markDate="markDate"
:illustration="illustration"
:responsive="true"
@select="clickDay"
:sign="sign"
@selectYear="selectYear"
@selectMonth="selectMonth"
:tileContent="tileContent"/>
:tileContent="tileContent"></app-calendar>
<#-- 日历样式----时间轴 -->
<#elseif ctrl.getCalendarStyle() == "TIMELINE">
......
......@@ -41,6 +41,13 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected start: any;
/**
* 标志数据
* @type {Array<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public sign: Array<any> = []
/**
* 结束时间
......@@ -80,15 +87,37 @@ import moment from 'moment';
*/
public eventsDate :any = {};
/**
* 日历项集合
* 日历项集合对象
*
* @type {*}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public calendarItems: any = {};
/**
* 日历数据项模型
*
* @type {Map<string, any>}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public calendarItemsModel: Map<string, any> = new Map([
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
[
'${calendarItem.getItemType()?lower_case}', {
<#if calendarItem.getPSAppDataEntity()??>
<#assign _appde = calendarItem.getPSAppDataEntity() />
appde: '${appde.getCodeName()?lower_case}',
keyPSAppDEField: '${appde.getKeyPSAppDEField().getCodeName()?lower_case}',
majorPSAppDEField: '<#if appde.getMajorPSAppDEField()??>${appde.getMajorPSAppDEField().getCodeName()?lower_case}<#else>srfmajortext</#if>',
</#if>
}
],
</#list>
</#if>
]);
/**
* 日历显示状态
*
......@@ -120,7 +149,6 @@ import moment from 'moment';
*/
protected calendarStyle: string = '${ctrl.getCalendarStyle()?lower_case}';
/**
* 获取多项数据
*
......@@ -130,7 +158,6 @@ import moment from 'moment';
public getDatas(): any[] {
return [];
}
/**
* 时间轴加载条数
......@@ -177,6 +204,7 @@ import moment from 'moment';
});
}
}
/**
* 事件绘制数据
*
......@@ -184,6 +212,12 @@ import moment from 'moment';
*/
public evendata :any = {<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem><#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>:[],</#list></#if>}
/**
* 图标信息
*
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public illustration = [<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem>{color:"<#if calendaritem.getBKColor()??>${calendaritem.getBKColor()}</#if>",text:"<#if calendaritem.getName()??>${calendaritem.getName()}</#if>"},</#list></#if>]
/**
* 激活项
*
......@@ -200,15 +234,16 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected ionChange($event:any) {
let { detail: _detail } = $event;
if (!_detail) {
return ;
}
let { value: _value } = _detail;
if (!_value) {
return ;
}
this.activeItem = _value;
let { detail: _detail } = $event;
if (!_detail) {
return ;
}
let { value: _value } = _detail;
if (!_value) {
return ;
}
this.activeItem = _value;
this.formatData(new Date(this.year+'/'+(this.month+1)+'/'+this.day));
}
/**
......@@ -217,7 +252,7 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected selectday(year: any, month: any, weekIndex: any) {
this.value = [year, month, this.day];
this.value = [year, month, this.day];
}
/**
......@@ -226,19 +261,13 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected prev(year: any, month: any, weekIndex: any) {
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month"){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
if(weekIndex == 0){
this.formatData(new Date(year+'/'+month+'/'+'1'));
}else if(weekIndex == 5){
this.formatData(new Date(year+'/'+(month+1)+'/'+'1'));
}else{
this.formatData(new Date(year+'/'+month+'/'+(weekIndex)*7));
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month"){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
}
}
/**
......@@ -247,41 +276,35 @@ import moment from 'moment';
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
protected next(year: any, month: any, weekIndex: any) {
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month" ){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
if(weekIndex == 0){
this.formatData(new Date(year+'/'+month+'/'+'1'));
}else if(weekIndex == 5){
this.formatData(new Date(year+'/'+(month+1)+'/'+'1'));
}else{
this.formatData(new Date(year+'/'+month+'/'+(weekIndex)*7));
if(this.calendarStyle == "month_timeline" || this.calendarStyle == "month" ){
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+month+'/'+'1'));
}
if(this.calendarStyle == "week_timeline" || this.calendarStyle == "week"){
this.countWeeks(year,month,weekIndex);
}
}
}
/**
* 删除
*
* @param {any[]} datas
* @returns {Promise<any>}
* @memberof Mdctrl
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public async remove(datas: any[]): Promise<any> {
const calendarItemModel: any = this.calendarItemsModel.get(this.activeItem);
let { appde, keyPSAppDEField, majorPSAppDEField }: { appde: string, keyPSAppDEField: string, majorPSAppDEField: string } = calendarItemModel;
let arg: any = {};
let keys: Array<string> = [];
let infoStr: string = '';
datas.forEach((data: any, index: number) => {
keys.push(data.id);
keys.push(data[keyPSAppDEField]);
if (index < 5) {
if (!Object.is(infoStr, '')) {
infoStr += '、';
}
infoStr += data.display_name;
infoStr += data[majorPSAppDEField];
}
});
......@@ -292,14 +315,15 @@ import moment from 'moment';
}
return new Promise((resolve, reject) => {
const _remove = async () => {
let _context: any = { mail_activity: keys.join(';') }
const response: any = await this.service.delete('Remove', Object.assign({}, this.context, _context), arg, this.showBusyIndicator);
let _context: any = { [appde]: keys.join(';') }
const response: any = await this.service.delete(this.activeItem, { ...this.context, ..._context }, arg, this.showBusyIndicator);
if (response && response.status === 200) {
this.$notice.success('删除成功');
this.formatData(this.currentDate);
resolve(response);
} else {
this.$notice.error(response.message);
const { error: _data } = response;
this.$notice.error(_data.message);
reject(response);
}
}
......@@ -331,7 +355,7 @@ import moment from 'moment';
*/
protected selectMonth(month: any, year: any) {
this.selectday(year, month, this.day);
this.formatData(new Date(year+'/'+(month)+'/'+this.day));
this.formatData(new Date(year+'/'+month+'/'+this.day));
}
/**
......@@ -426,39 +450,90 @@ import moment from 'moment';
this.evendata = {<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem><#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>:[],</#list></#if>}
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendaritem>
if(this.calendarItems.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>){
this.calendarItems.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>.forEach((item:any) => {
if(item.<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>){
Object.assign(this.eventsDate,{[item.<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>.substring(0,10)]:"——"});
if (this.evendata.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>.length > 0) {
this.evendata.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>.forEach((i: any) => {
if (i.time === item.<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>.substring(0, 10)) {
let ${calendaritem.getItemType()?lower_case}Item :Array<any> = this.parsingData('<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>','<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>');
</#list>
</#if>
this.setSign(<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem><#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}Item</#if>,</#list></#if>);
}
/**
* 格式化标志数据
*
* @param any
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public setSign(<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem><#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}Item: any</#if>,</#list></#if>){
let signData = [<#if ctrl.getPSSysCalendarItems()??><#list ctrl.getPSSysCalendarItems() as calendaritem><#if calendaritem.getItemType()??>...${calendaritem.getItemType()?lower_case}Item</#if>,</#list></#if>];
let obj: any = {}
// 格式化数据
signData.forEach((item:any,index:number) => {
if(item.time.length == 10){
let year = item.time.split('-')[0];
let month = item.time.split('-')[1];
let day = item.time.split('-')[2];
if( month < 10 ){
month = month.replace('0','')
}
if(day < 10){
day = day.replace('0','')
}
item.time = year+'-'+month+'-'+day;
}
if(!obj[item.time]){
Object.assign(obj,{[item.time]:item.evens})
}else{
Object.assign(obj,{[item.time]:[...obj[item.time],...item.evens]})
}
});
for (const key in obj) {
this.sign.push({time:key,evens:obj[key]});
}
}
/**
* 解析日历事件数据
*
* @protected
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public parsingData(tag:string,mark:string) :Array<any>{
let dataItem :any = [];
if(this.calendarItems[tag]){
this.calendarItems[tag].forEach((item:any) => {
if(dataItem.length == 0){
dataItem.push({time:item[mark].substring(0, 10),evens:[item]});
}else{
dataItem.forEach((sig:any)=>{
if(sig.time.substring(0, 10) != item[mark].substring(0, 10)){
dataItem.push({time:item[mark].substring(0, 10),evens:[item]});
}
})}
if(item[mark]){
if (this.evendata[tag].length > 0) {
this.evendata[tag].forEach((i: any) => {
if (i.time === item[mark].substring(0, 10)) {
if (i.evens) {
i.evens.push(item);
}
} else {
this.evendata.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>.push({
time: item.<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>.substring(0, 10),
this.evendata[tag].push({
time: item[mark].substring(0, 10),
evens: [item]
});
}
});
} else {
this.evendata.<#if calendaritem.getItemType()??>${calendaritem.getItemType()?lower_case}</#if>.push({
time: item.<#if calendaritem.getBeginTimePSAppDEField()?? && calendaritem.getBeginTimePSAppDEField().getName()??>${calendaritem.getBeginTimePSAppDEField().getName()?lower_case}<#else>start</#if>.substring(0, 10),
this.evendata[tag].push({
time: item[mark].substring(0, 10),
evens: [item]
});
}
}
});
}
</#list>
</#if>
return dataItem;
}
/**
* 日历部件数据选择日期回调
*
......@@ -568,6 +643,21 @@ import moment from 'moment';
});
}
}
/**
* 根据周下标计算事件
*
* @param {*} $event 事件信息
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public countWeeks(year: any, month: any, week: any) {
let date = new Date(year + '/' + month + '/' + 1);
let weekline = date.getDay();
if(weekline == 0){
this.formatData(new Date(year + '/' + month + '/' + (week*7 +1)));
}else{
this.formatData(new Date(year + '/' + month + '/' + (week*7 - weekline + 1)));
}
}
<#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -20,26 +20,26 @@
let dataItems: any = [
<#-- 关联主实体的主键 -->
<#if ctrl.getPSAppDataEntity()??>
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
<#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
<#if minorAppDERSs.getMajorPSAppDataEntity()??>
<#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
<#assign appDataEntity = ctrl.getPSAppDataEntity() />
<#if appDataEntity.isMajor() == false && appDataEntity.getMinorPSAppDERSs()??>
<#list appDataEntity.getMinorPSAppDERSs() as minorAppDERSs>
<#if minorAppDERSs.getMajorPSAppDataEntity()??>
<#assign majorAppDataEntity = minorAppDERSs.getMajorPSAppDataEntity() />
{
name: '${majorAppDataEntity.getCodeName()?lower_case}',
prop: '${majorAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
</#if>
</#list>
</#if>
</#if>
</#list>
</#if>
</#if>
{
name: 'queryStart',
prop: 'start'
prop: 'n_start_gtandeq'
},
{
name: 'queryEnd',
prop: 'end'
prop: 'n_end_ltandeq'
},
{
name: 'color',
......@@ -54,31 +54,33 @@
switch (this.itemType) {
<#-- 日历项实体映射 -->
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??>
<#assign appDataEntity = calendarItem.getPSAppDataEntity() />
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??>
<#assign appDataEntity = calendarItem.getPSAppDataEntity() />
case "${calendarItem.getItemType()?lower_case}":
dataItems = [...dataItems,
{
name: '${appDataEntity.getCodeName()?lower_case}',
prop: '${appDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
{
name: 'title',
prop: '${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case}'
},
{
name:'start',
prop:'${calendarItem.getBeginTimePSDEField().getCodeName()?lower_case}'
},
{
name:'end',
prop:'${calendarItem.getEndTimePSDEField().getCodeName()?lower_case}'
},
];
dataItems =
[
...dataItems,
{
name: '${appDataEntity.getCodeName()?lower_case}',
prop: '${appDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}'
},
{
name: 'title',
prop: '${appDataEntity.getMajorPSAppDEField().getCodeName()?lower_case}'
},
{
name:'start',
prop:'n_${calendarItem.getBeginTimePSDEField().getCodeName()?lower_case}_gtandeq'
},
{
name:'end',
prop:'n_${calendarItem.getEndTimePSDEField().getCodeName()?lower_case}_ltandeq'
},
];
break;
</#if>
</#list>
</#if>
</#list>
</#if>
}
return dataItems;
......
......@@ -4,40 +4,42 @@
### 一、日历部件样式
#### 1、月
#### 1、月/月(复合时间轴)
##### (1)支持功能:点击日期更新日程
##### (1)支持功能:年/月/日切换、切换日历样式、删除日程、日程展示标识、点击日期更新日程
##### (2)界面UI
![1585735700523](images/README/1585735700523.png)
<div style = "display : flex ; overflow: hidden; ">
<img src="images/README/mounth.png" ></img>
<img src="images/README/mounth_top.png" ></img>
</div>
#### 2、周/周(复合时间轴)
#### 2、周
##### (1)支持功能:年/月/日切换、删除日程、日程展示标识、时间轴日程
##### (1)支持功能:点击日期更新日程
##### (2)界面UI
##### (2)界面UI
![1585735779254](images/README/1585735779254.png)
​ ![week](images/README/week.png)
#### 3、日
#### 3、天
##### (1)支持功能:点击前后日期更新日程
##### (1)支持功能:展示日程
##### (2)界面UI
##### (2)界面UI
![1585735801539](images/README/1585735801539.png)
​ ![day](images/README/day.png)
#### 4、时间轴
#### 4、复合时间轴
##### (1)支持功能:点击更新日程
##### (1)支持功能:时间轴、展示日程、删除日程
##### (2)界面UI
![1585735820084](images/README/1585735820084.png)
​ ![timezhou](images/README/timezhou.png)
### 二、应用场景
### 二、应用场景
用于呈现与日期时间安排相关的信息,比如待办事项安排、日程安排、会议室安排。
\ No newline at end of file
......@@ -37,38 +37,30 @@
*/
public async search(itemType: string, context: any = {}, data: any = {}, isLoading?: boolean): Promise<HttpResponse> {
let item: any = {};
let action: string = '';
this.model.itemType = itemType;
try {
switch (itemType) {
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()?? && calendarItem.getPSDEDataSet()??>
<#assign _appde = calendarItem.getPSAppDataEntity() />
<#assign deDataSet = calendarItem.getPSDEDataSet() />
case "${calendarItem.getItemType()?lower_case}":
action = 'Fetch${deDataSet.getCodeName()}';
data = this.handleRequestData(action, context, data);
await this.onBeforeAction(action, context, data, isLoading);
this.model.itemType = '${calendarItem.getItemType()?lower_case}';
const _${calendarItem.getItemType()?lower_case}_data = this.handleRequestData('', context, data);
await this.onBeforeAction('', context, _${calendarItem.getItemType()?lower_case}_data, isLoading);
<#if _appde.getId() == appde.getId()>
item = {
...{ ${calendarItem.getItemType()?lower_case}: await this.loadDEDataSet(action, context, data, '${calendarItem.getItemType()?lower_case}') },
};
const _${calendarItem.getItemType()?lower_case} = await this.loadDEDataSet('Fetch${deDataSet.getCodeName()}', context, _${calendarItem.getItemType()?lower_case}_data, '${calendarItem.getItemType()?lower_case}');
<#else>
item = {
...{ ${calendarItem.getItemType()?lower_case}: await this.loadDEDataSet(action, context, data, '${calendarItem.getItemType()?lower_case}', '${_appde.getCodeName()?lower_case}') },
};
const _${calendarItem.getItemType()?lower_case} = await this.loadDEDataSet('Fetch${deDataSet.getCodeName()}', context, _${calendarItem.getItemType()?lower_case}_data, '${calendarItem.getItemType()?lower_case}', '${_appde.getCodeName()?lower_case}');
</#if>
break;
Object.assign(item, { ${calendarItem.getItemType()?lower_case}: _${calendarItem.getItemType()?lower_case} });
</#if>
</#list>
</#list>
</#if>
};
} catch (response) {
await this.onAfterAction(action, context, response);
await this.onAfterAction('', context, response);
return new HttpResponse(response.status);
}
await this.onAfterAction(action, context);
await this.onAfterAction('', context);
return new HttpResponse(200, item);
}
......@@ -88,27 +80,78 @@
let response: any;
switch (itemType) {
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()??>
<#assign _appde = calendarItem.getPSAppDataEntity() />
<#if _appde.getId() == appde.getId()>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()?? && calendarItem.getUpdatePSAppDEAction()??>
<#assign _deAction = calendarItem.getUpdatePSAppDEAction() />
<#assign _appde = calendarItem.getPSAppDataEntity() />
<#if _appde.getId() == appde.getId()>
case "${calendarItem.getItemType()}":
response = await this.service.${_deAction.getCodeName()}(context, data);
break;
<#else>
case "${calendarItem.getItemType()}":
const _service: any = await this.getService('${_appde.getCodeName()?lower_case}');
if (_service && _service['${_deAction.getCodeName()}'] && _service['${_deAction.getCodeName()}'] instanceof Function) {
response = await _service['${_deAction.getCodeName()}'](context, data);
}
break;
</#if>
</#if>
</#list>
</#if>
default:
response = new HttpResponse(500, null, { code: 101, message: '未配置更新实体行为' });
}
if (!response.isError()) {
response = this.handleResponse("", response);
}
await this.onAfterAction('', context, response);
return new HttpResponse(response.status, response.data, response.error);
}
/**
* 删除数据
*
* @param {string} action
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isLoading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${ctrl.codeName}')}Service
*/
public async delete(itemType: string, context: any = {}, data: any = {}, isLoading?: boolean): Promise<any> {
await this.onBeforeAction('', context, data, isLoading);
data = this.handleRequestData('', context, data);
let response: any;
switch (itemType) {
<#if ctrl.getPSSysCalendarItems()??>
<#list ctrl.getPSSysCalendarItems() as calendarItem>
<#if calendarItem.getPSAppDataEntity()?? && calendarItem.getRemovePSAppDEAction()??>
<#assign _deAction = calendarItem.getRemovePSAppDEAction() />
<#assign _appde = calendarItem.getPSAppDataEntity() />
<#if _appde.getId() == appde.getId()>
case "${calendarItem.getItemType()}":
response = await this.service.Update(context, data);
response = await this.service.${_deAction.getCodeName()}(context, data);
break;
<#else>
<#else>
case "${calendarItem.getItemType()}":
response = await this.getService('${_appde.getCodeName()?lower_case}').then((s: any) => s.Update(context, data));
const _service: any = await this.getService('${_appde.getCodeName()?lower_case}');
if (_service && _service['${_deAction.getCodeName()}'] && _service['${_deAction.getCodeName()}'] instanceof Function) {
response = await _service['${_deAction.getCodeName()}'](context, data);
}
break;
</#if>
</#if>
</#if>
</#list>
</#list>
</#if>
default:
response = new HttpResponse(500, null, { code: 101, message: '未配置删除实体行为' });
}
if (!response.isError()) {
response = this.handleResponse("", response);
}
await this.onAfterAction('', context, response);
return new HttpResponse(response.status, response.data);
return new HttpResponse(response.status, response.data, response.error);
}
<#ibizinclude>
......
......@@ -5,7 +5,7 @@
<ion-col :size="size" v-for="(item,index) in items" :key="index">
<ion-card :class="[size == '12'? 'ios hydrated ibz-card-12':' ios hydrated ibz-card-6']">
<div :class="{'line':size == '12'}">
<img :style="{width :size == '6' ?'':'30%'}" src="assets/images/card.jpg" />
<img class="cardimg" :style="{width :size == '6' ?'':'30%'}" src="assets/images/card.jpg" />
<div :style="{width :size == '6' ?'':'70%'}">
<ion-card-header class="ibz-header">
<ion-card-title class="ibz-title">{{item.<#if appde.getMajorPSAppDEField()??>${appde.getMajorPSAppDEField().getCodeName()?lower_case}<#else>srfmajortext</#if>}}</ion-card-title>
......
......@@ -37,4 +37,7 @@
display: flex;
justify-content: space-between;
}
.cardimg{
height: auto;
}
}
\ No newline at end of file
......@@ -42,7 +42,7 @@ ${css.getCssStyle()}
</#if>
</#if>
<#list view.getAllPSControls() as ctrl>
<#if ctrl.getControlType() == 'MOBMDCTRL' && ctrl.isNoSort() == false>
<#if ctrl.getControlType() == 'MOBMDCTRL' || ctrl.getControlType() == 'DATAVIEW' && ctrl.isNoSort() == false>
//排序样式
.${srffilepath2(view.getCodeName())}-toolbar{
z-index:10;
......@@ -85,6 +85,8 @@ ${css.getCssStyle()}
&-searchform {
display: flex;
width: 60px;
justify-content: flex-end;
align-items: center;
}
}
}
......
<#if view.hasPSControl('dataview')>
<#assign dataview = view.getPSControl('dataview')>
<#if !dataview.isNoSort()>
<#assign state = false />
<#list dataview.getPSDEDataViewItems() as item>
<#if item.isEnableSort()>
<#assign state = true/>
<#break>
</#if>
</#list>
<#if state>
<#assign view_header_botton>
<ion-toolbar class="mobile-entity1-mob-mdview-toolbar default-sort">
<ion-toolbar class="${srffilepath2(view.getCodeName())}-toolbar default-sort">
<div class="view-tool">
<div class="view-tool-sorts">
后续补充排序功能
<div class="view-tool-sorts">
<#list dataview.getPSDEDataViewItems() as item>
<#if item.isEnableSort() && !item.getPSCodeList()??>
<div class="view-tool-sorts-item">
<span class="text" @click="setSort('<#if item.getName()??>${item.getName()}</#if>')"><#if item.getCaption()??>${item.getCaption()}</#if></span>
<span class="sort-icon" @click="setSort('<#if item.getName()??>${item.getName()}</#if>')">
<ion-icon :class="{'ios' : true ,'hydrated': true ,'sort-select': sort.asc == '<#if item.getName()??>${item.getName()}</#if>'}" name="chevron-up-outline" ></ion-icon>
<ion-icon :class="{'ios' : true ,'hydrated': true ,'sort-select': sort.desc == '<#if item.getName()??>${item.getName()}</#if>'}" name="chevron-down-outline" ></ion-icon>
</span>
</div>
</#if>
</#list>
</div>
<div class="view-tool-searchform">
<!-- <span>过滤<ion-icon name="filter-outline"></ion-icon></span> -->
</div>
</div>
<div class="view-tool-searchform">
<ion-icon @click="changeSize" :name="iconname"></ion-icon>
......@@ -11,6 +36,8 @@
</div>
</ion-toolbar>
</#assign>
</#if>
</#if>
<#assign view_content>
${P.getCtrlCode('dataview', 'CONTROL.html').code}
</#assign>
......
<#ibizinclude>
../@MACRO/DEFAULT.less.ftl
</#ibizinclude>
.teststyle {
text-decoration:none !important;
font-style:normal !important;
}
.demobcalendarview {
ion-toolbar{
--min-height: 0px!important;
--padding-top: 0px;
--padding-bottom: 0px;
ion-buttons{
min-height: 0;
}
}
}
\ No newline at end of file
</#ibizinclude>
\ No newline at end of file
<app-mob-dropdown-list-dynamic v-model="data.${editor.name}" :data="data" :itemParam="<#if item.getEditorParam('PARENTDATA','') != ''>{parentdata:${item.getEditorParam('PARENTDATA','')}}<#else>{}</#if>" :disabled="detailsModel.${editor.name}.disabled" <#if editor.getPSCodeList()??><#assign codelist=editor.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${editor.getEditorCssStyle()}"></app-mob-dropdown-list-dynamic>
\ No newline at end of file
<dropdown-list v-model="row[column.property]" :disabled="row.srfuf === 1 ? (${item.getEnableCond()?c} & 2) !== 2 : (${item.getEnableCond()?c} & 1) !== 1" <#if item.getPSCodeList()??><#assign codelist=item.getPSCodeList()>tag='${codelist.codeName}' codelistType='${codelist.getCodeListType()}'</#if> placeholder=<#if item.getPlaceHolder()??>'${item.getPlaceHolder()}'<#else>'请选择...'</#if> style="${item.getEditorCssStyle()}" @change="($event)=>{gridEditItemChange(row, column.property, $event)}"></dropdown-list>
\ No newline at end of file
......@@ -43,6 +43,36 @@
}
}
/**
* 排序对象
*
* @type {*}
* @memberof ${srfclassname('${view.name}')}Base
*/
public sort: any = { asc: "", desc: "" };
/**
* 排序
*
* @param {*} field
* @memberof ${srfclassname('${view.name}')}Base
*/
public setSort(field: any) {
if (this.sort.desc == field) {
this.sort.desc = "";
this.viewState.next({ tag: 'dataview', action: 'load', data: {} });
return
}
if (this.sort.asc == field) {
this.sort.asc = "";
this.sort.desc = field;
this.viewState.next({ tag: 'dataview', action: 'load', data: { sort: field + ",desc" } });
} else {
this.sort.asc = field;
this.sort.desc = "";
this.viewState.next({ tag: 'dataview', action: 'load', data: { sort: field + ",asc" } });
}
}
<#ibizinclude>
../@MACRO/VIEW_BOTTOM-BASE.vue.ftl
......
......@@ -2,5 +2,5 @@
TARGET=PSSYSAPP
</#ibiztemplate>
NODE_ENV=development
VUE_APP_CURRENTMODE='development'
outputDir='dist'
VUE_APP_CURRENTMODE=development
VUE_APP_OUTPUTDIR=dist
......@@ -2,5 +2,7 @@
TARGET=PSSYSAPP
</#ibiztemplate>
NODE_ENV=production
VUE_APP_CURRENTMODE='nativeapp'
outputDir='www'
VUE_APP_CURRENTMODE=hybridapp
VUE_APP_OUTPUTDIR=www
VUE_APP_PROXY=http://192.168.1.2:8080
......@@ -2,5 +2,5 @@
TARGET=PSSYSAPP
</#ibiztemplate>
NODE_ENV=production
VUE_APP_CURRENTMODE='production'
outputDir='../${pub.getCodeName()?lower_case}-app/${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}/target/classes/META-INF/resources'
\ No newline at end of file
VUE_APP_CURRENTMODE=production
VUE_APP_OUTPUTDIR=../${pub.getCodeName()?lower_case}-app/${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}/target/classes/META-INF/resources
\ No newline at end of file
......@@ -13,7 +13,7 @@ module.exports = {
publicPath: './',
// 去除 map 文件 1
productionSourceMap: false,
outputDir: process.env.outputDir,
outputDir: process.env.VUE_APP_OUTPUTDIR,
devServer: {
host: '0.0.0.0',
port: 8111,
......
## v7.0.0-alpha.2 [2020-5-7]
### 功能新增及优化
#### 模板
日历视图类型完善
Android Studio 打包初始化
## v7.0.0-alpha.1 [2020-4-29]
初始化文件
\ No newline at end of file
MIT License
Copyright (c) 2020 iBiz-R7前端标准模板
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -97,17 +97,17 @@ $ yarn serve
![远程代理地址](./imgs/getting-started/proxy.png)
## 打包
## 编译及打包
### 1.生产打包
### 1.Web App 编译
在工作空间下,执行命令,进行生产编译打包
在工作空间下,执行命令,进行生产编译。
```bash
$ yarn build
```
打包完成,生成最终交付产物,交付产物文件目录配置文件 .env.production 内容如下如下:
编译完成,生成最终交付产物,交付产物文件目录配置文件 .env.production 内容如下如下:
```sh
NODE_ENV=production
......@@ -115,25 +115,52 @@ VUE_APP_CURRENTMODE='production'
outputDir='****'
```
### 2.开发打包
### 2.Android 打包
在工作空间下,执行命令,进行开发编译打包。
Vue_Mobile_R7 解决方案使用 capacitor 作为混合开发工具。 Capacitor 提供调用原生开发,打包等功能。修改刚才目录下 `capacitor.config.json` 服务端地址,再 url 中设置服务器地址以及端口号,修改参数如下:
```json
{
********
"server": {
"url": "#########"
},
*********
}
```
混合打包配置文件内容如下:
```bash
$ yarn dev-build
```
NODE_ENV=production
VUE_APP_CURRENTMODE=hybridapp
VUE_APP_OUTPUTDIR=www
VUE_APP_PROXY=#########
```
打包完成,生成最终交付产物,交付产物文件目录配置文件 .env.development 内容如下如下
修改配置文件 .env.hybridapp 下 VUE_APP_PROXY 参数值,编译前端工程
```sh
NODE_ENV=development
VUE_APP_CURRENTMODE='development'
outputDir='dist'
$ yarn build-hybrid-app
```
该交互产物会加载本地模拟数据,可用于独立演示等。
拷贝编译成果到 andorid 工程目录下:
```bash
$ yarn cap copy
```
更新 android 打包依赖插件
```bash
$ yarn cap update
```
打开 Android Studio,执行打包
```bash
$ yarn cap open android
```
## 成果物结构
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册