提交 a8a2ebf7 编写于 作者: JunZai's avatar JunZai

update

上级 b5f0fa07
......@@ -51,48 +51,6 @@
*/
public controlClass: string = "${ctrl.name}";
/**
* 配置参数
*
* @public
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public options: any = {
taskList: {
columns: [
<#if ctrl.getPSDETreeColumns()??>
<#list ctrl.getPSDETreeColumns() as column>
{
label: '${column.getCaption()}',
value: '<#if column.getName() == "begin">start<#else>${column.getName()}</#if>',
render: (task: any) => {
<#if column.render??>
${column.render.code}
<#else>
return this.getColumnValue(task, '<#if column.getName() == "begin">start<#else>${column.getName()}</#if>')
</#if>
},
<#if column.getName() == "text">
expander: true,
</#if>
width: <#if column.getWidth() gt 0>${column.getWidth()}<#else>100</#if>,
<#if column.isHideDefault()>
hidden: true,
</#if>
<#if column.getHeaderPSSysCss()??>
headerCls: '${column.getHeaderPSSysCss().getCssName()}',
</#if>
<#if column.getCellPSSysCss()??>
cellCls: '${column.getCellPSSysCss().getCssName()}',
</#if>
},
</#list>
</#if>
]
}
};
/**
* 数据集合
*
......
......@@ -5,7 +5,10 @@
<#else>
<template v-for="(group, index) of groups">
<draggable :key="group + index" :list="group.items" group="${ctrl.name}" class="dataview-group-content" style="<#if ctrl.getGroupWidth() gt 0>width: ${ctrl.getGroupWidth()?c}px;<#else>flex-grow: 1;</#if>" @change="onDragChange($event, group.name)">
<div slot="header" class="dataview-group-header">
<#if ctrl.groupRender??>
${ctrl.groupRender.code}
<#else>
<div slot="header" class="dataview-group-header<#if ctrl.getGroupPSSysCss()??> ${ctrl.getGroupPSSysCss().getCssName()}</#if>">
{{ getGroupText(group.name) }}
<#if ctrl.getGroupPSUIActionGroup()??>
<Poptip trigger="hover" content="content" placement="bottom-end" style="float: right;">
......@@ -41,6 +44,7 @@
{{ item.srfmajortext }}
</#if>
</div>
</#if>
</draggable>
</template>
</#if>
......@@ -526,17 +530,24 @@ draggable,
*/
public updateData(opt: any) {
const arg: any = { ...opt };
Object.assign(arg, this.context);
Object.assign(arg, { viewparams: this.viewparams });
const post: Promise<any> = this.service.update(this.updateGroupAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
let _context = JSON.parse(JSON.stringify(this.context));
<#if ctrl.getPSAppDataEntity()??>
Object.assign(_context, { ${ctrl.getPSAppDataEntity().getCodeName()?lower_case}: opt.task });
</#if>
const post: Promise<any> = this.service.update(this.updateGroupAction, _context, arg, this.showBusyIndicator);
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
}
this.setGroups();
return;
}
this.$emit('update');
let item = this.items.find((item: any) => Object.is(item.srfkey, response.data.srfkey));
Object.assign(item, response.data);
this.setGroups();
this.$emit('update', this.items);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
......@@ -692,8 +703,9 @@ draggable,
*/
public onDragChange(evt: any, name: string) {
if(evt && evt.added && evt.added.element) {
evt.added.element[this.groupField] = name;
this.updateData(evt.added.element)
let item: any = JSON.parse(JSON.stringify(evt.added.element))
item[this.groupField] = name;
this.updateData(item)
}
}
......
.app-data-view-group {
height: 100%;
display: flex;
overflow: auto;
.dataview-group-content {
border: 1px solid #ddd;
border-left: 0;
flex-shrink: 0;
.dataview-group-header {
height: 36px;
line-height: 36px;
......@@ -19,6 +21,7 @@
margin: 8px 8px 0 8px;
border: 1px solid #ddd;
padding: 8px;
overflow: hidden;
}
.dataview-group-item.is-select {
border-color: #108cee;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册