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

update

上级 d659b528
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
<i-input v-model="query" placeholder="<#if ctrl.getPSSearchBarQuickSearchs()??><#list ctrl.getPSSearchBarQuickSearchs() as search><#if search_index gt 0>,</#if><#if search.getPSDEField()??>${search.getPSDEField().getLogicName()}</#if></#list></#if>" style="<#if ctrl.getQuickSearchWidth() gt 0>width: ${ctrl.getQuickSearchWidth()?c}px;</#if>"></i-input> <i-input v-model="query" placeholder="<#if ctrl.getPSSearchBarQuickSearchs()??><#list ctrl.getPSSearchBarQuickSearchs() as search><#if search_index gt 0>,</#if><#if search.getPSDEField()??>${search.getPSDEField().getLogicName()}</#if></#list></#if>" style="<#if ctrl.getQuickSearchWidth() gt 0>width: ${ctrl.getQuickSearchWidth()?c}px;</#if>"></i-input>
</#if> --> </#if> -->
<div class="search-bar-action"> <div class="search-bar-action">
<el-select size="small" v-if="historyItems.length > 0" @change="onFilterChange">
<el-option v-for="item in historyItems" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
<i-button type="primary" @click="onSearch">搜索</i-button> <i-button type="primary" @click="onSearch">搜索</i-button>
<i-button @click="onReset">重置</i-button> <i-button @click="onReset">重置</i-button>
<i-button @click="onSave"><i class="fa fa-floppy-o" aria-hidden="true"></i></i-button> <i-button @click="onSave"><i class="fa fa-floppy-o" aria-hidden="true"></i></i-button>
...@@ -27,6 +30,7 @@ ...@@ -27,6 +30,7 @@
</template> </template>
<#assign import_block> <#assign import_block>
import FilterTree from '@components/filter-tree/filter-tree.vue'; import FilterTree from '@components/filter-tree/filter-tree.vue';
import moment from 'moment';
</#assign> </#assign>
<#assign component_block> <#assign component_block>
...@@ -106,6 +110,14 @@ FilterTree, ...@@ -106,6 +110,14 @@ FilterTree,
*/ */
public utilServiceName: string = "<#if app.getPSAppFilterStorageUtil?? && app.getPSAppFilterStorageUtil()??>${app.getPSAppFilterStorageUtil().getCodeName()?lower_case}</#if>"; public utilServiceName: string = "<#if app.getPSAppFilterStorageUtil?? && app.getPSAppFilterStorageUtil()??>${app.getPSAppFilterStorageUtil().getCodeName()?lower_case}</#if>";
/**
* 历史记录
*
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
protected historyItems: any[] = [];
/** /**
* 获取多项数据 * 获取多项数据
* *
...@@ -267,9 +279,16 @@ FilterTree, ...@@ -267,9 +279,16 @@ FilterTree,
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public onSave() { public onSave() {
let time = moment();
this.historyItems.push({
name: time.format('YYYY-MM-DD HH:mm:ss'),
value: time.unix(),
data: JSON.parse(JSON.stringify(this.filterItems))
})
let param: any = {}; let param: any = {};
Object.assign(param, { Object.assign(param, {
model: this.filterItems, model: JSON.parse(JSON.stringify(this.historyItems)),
appdeName: this.appdeName, appdeName: this.appdeName,
modelid: this.modelId, modelid: this.modelId,
utilServiceName: this.utilServiceName, utilServiceName: this.utilServiceName,
...@@ -311,15 +330,25 @@ FilterTree, ...@@ -311,15 +330,25 @@ FilterTree,
let post = this.service.loadModel(this.utilServiceName, this.context, param); let post = this.service.loadModel(this.utilServiceName, this.context, param);
post.then((response: any) => { post.then((response: any) => {
if(response.status == 200) { if(response.status == 200) {
this.filterItems = response.data; this.historyItems = response.data;
this.$nextTick(() => {
this.onSearch();
})
} }
}).catch((response: any) => { }).catch((response: any) => {
console.log(response); console.log(response);
}); });
} }
/**
* 改变过滤条件
*
* @return {*}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public onFilterChange(evt: any) {
let item: any = this.historyItems.find((item: any) => Object.is(evt, item.value));
if(item) {
this.filterItems = JSON.parse(JSON.stringify(item.data));
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
height: 32px; height: 32px;
.search-bar-action { .search-bar-action {
float: right; float: right;
display: flex;
> .ivu-btn { > .ivu-btn {
margin-left: 5px; margin-left: 5px;
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册