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

update

上级 d659b528
......@@ -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>
</#if> -->
<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 @click="onReset">重置</i-button>
<i-button @click="onSave"><i class="fa fa-floppy-o" aria-hidden="true"></i></i-button>
......@@ -27,6 +30,7 @@
</template>
<#assign import_block>
import FilterTree from '@components/filter-tree/filter-tree.vue';
import moment from 'moment';
</#assign>
<#assign component_block>
......@@ -106,6 +110,14 @@ FilterTree,
*/
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,
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
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 = {};
Object.assign(param, {
model: this.filterItems,
model: JSON.parse(JSON.stringify(this.historyItems)),
appdeName: this.appdeName,
modelid: this.modelId,
utilServiceName: this.utilServiceName,
......@@ -311,15 +330,25 @@ FilterTree,
let post = this.service.loadModel(this.utilServiceName, this.context, param);
post.then((response: any) => {
if(response.status == 200) {
this.filterItems = response.data;
this.$nextTick(() => {
this.onSearch();
})
this.historyItems = response.data;
}
}).catch((response: any) => {
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>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude>
......
......@@ -2,6 +2,7 @@
height: 32px;
.search-bar-action {
float: right;
display: flex;
> .ivu-btn {
margin-left: 5px;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册