|
|
@@ -2,7 +2,7 @@ |
|
|
|
<view class="page"> |
|
|
|
<!-- 主列表页 --> |
|
|
|
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;"> |
|
|
|
<!-- 顶部条目/分页信息栏 --> |
|
|
|
<!-- 顶部条目/分页信息栏 --> |
|
|
|
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner> |
|
|
|
|
|
|
|
<!-- 滚动列表,跨端支持上拉/下拉 --> |
|
|
@@ -13,12 +13,14 @@ |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
|
<text class="customlist-item-field-title">时间:</text> |
|
|
|
{{ displayListItem(item, 'Date') }} |
|
|
|
<!-- {{ displayListItem(item, 'Date') }} --> |
|
|
|
{{ displayListItem(item, 'StartTime') }} - {{ displayListItem(item, 'EndTime') }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
|
<text class="customlist-item-field-title">值班人:</text> |
|
|
|
{{ displayListItem(item, 'Person') }} |
|
|
|
<!-- {{ displayListItem(item, 'Person') }} --> |
|
|
|
{{ displayListItem(item, 'F_RealName') }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="customlist-item-field"> |
|
|
@@ -41,8 +43,20 @@ |
|
|
|
<!-- 侧边栏,用于设置查询条件 --> |
|
|
|
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y> |
|
|
|
<view v-if="ready" class="padding"> |
|
|
|
|
|
|
|
|
|
|
|
<l-customlist-sidepage-datefilter |
|
|
|
v-model="dateRange" |
|
|
|
@change="searchChange" |
|
|
|
title="按时间日期查询: " |
|
|
|
ref="datefilter" |
|
|
|
class="margin-bottom" |
|
|
|
/> |
|
|
|
|
|
|
|
<l-input |
|
|
|
v-model="queryData.keyword" |
|
|
|
@change="searchChange" |
|
|
|
title ="值班人" |
|
|
|
placeholder="按值班人查询" |
|
|
|
/> |
|
|
|
<!-- 重置查询条件按钮 --> |
|
|
|
<view class="padding-tb"> |
|
|
|
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button> |
|
|
@@ -50,7 +64,7 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> --> |
|
|
|
<l-customlist-add v-if="!sideOpen" @click="action('add')" /> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
@@ -84,9 +98,12 @@ export default { |
|
|
|
return { |
|
|
|
// 数据项的数据类型、结构 |
|
|
|
scheme: { |
|
|
|
Date: { type: 'datetime', dateformat: '0' }, |
|
|
|
Person: { type: 'text' }, |
|
|
|
// Date: { type: 'datetime', dateformat: '0' }, |
|
|
|
// Person: { type: 'text' }, |
|
|
|
Remark: { type: 'textarea' }, |
|
|
|
StartTime: { type: 'datetime', dateformat: '1' }, |
|
|
|
EndTime: { type: 'datetime', dateformat: '1' }, |
|
|
|
F_RealName: { type: 'text' }, |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询条件 |
|
|
@@ -108,7 +125,9 @@ export default { |
|
|
|
// 列表与分页信息 |
|
|
|
page: 1, |
|
|
|
total: 2, |
|
|
|
list: [] |
|
|
|
list: [] , |
|
|
|
|
|
|
|
dateRange:null |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@@ -137,7 +156,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 拉取列表 |
|
|
|
async fetchList() { |
|
|
|
async fetchList(isConcat=true) { |
|
|
|
if (this.page > this.total) { return } |
|
|
|
|
|
|
|
const result = await this.HTTP_GET( |
|
|
@@ -155,19 +174,19 @@ export default { |
|
|
|
|
|
|
|
this.total = result.total |
|
|
|
this.page = result.page + 1 |
|
|
|
this.list = this.list.concat(result.rows) |
|
|
|
this.list = isConcat?this.list.concat(result.rows):result.rows |
|
|
|
|
|
|
|
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项` |
|
|
|
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多' |
|
|
|
}, |
|
|
|
|
|
|
|
// 刷新清空列表 |
|
|
|
async refreshList() { |
|
|
|
async refreshList(isConcat=true) { |
|
|
|
this.page = 1 |
|
|
|
this.total = 2 |
|
|
|
this.list = [] |
|
|
|
|
|
|
|
await this.fetchList() |
|
|
|
await this.fetchList(isConcat) |
|
|
|
}, |
|
|
|
|
|
|
|
// 列表下拉 |
|
|
@@ -180,19 +199,26 @@ export default { |
|
|
|
// 设置搜索条件 |
|
|
|
async searchChange() { |
|
|
|
const result = {} |
|
|
|
|
|
|
|
// 时间查询相关参数 |
|
|
|
if (this.dateRange) { |
|
|
|
result.StartTime = this.dateRange.start |
|
|
|
result.EndTime = this.dateRange.end |
|
|
|
} |
|
|
|
|
|
|
|
// 将其他查询项添加到查询 JSON 中 |
|
|
|
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t)) |
|
|
|
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t))) |
|
|
|
|
|
|
|
this.searchData = result |
|
|
|
await this.refreshList() |
|
|
|
await this.refreshList(false) |
|
|
|
}, |
|
|
|
|
|
|
|
// 点击「清空查询条件」按钮 |
|
|
|
reset() { |
|
|
|
this.queryData = this.COPY(this.defaultQueryData) |
|
|
|
this.searchChange() |
|
|
|
this.$refs.datefilter.changeDateRange('all') |
|
|
|
// this.searchChange() |
|
|
|
}, |
|
|
|
|
|
|
|
// 点击「编辑」、「查看」、「添加」、「删除」按钮 |
|
|
|