用户列表时间格式化

uat_us
caiyiling 2024-06-19 16:36:16 +08:00
parent c6092358d8
commit 7e54379ad3
2 changed files with 14 additions and 7 deletions

View File

@ -111,6 +111,7 @@
v-model="searchData[item.prop]" v-model="searchData[item.prop]"
:placeholder="item.placeholder" :placeholder="item.placeholder"
type="datetime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
:disabled="item.disable && item.disable(searchData[item.prop])" :disabled="item.disable && item.disable(searchData[item.prop])"
:style="{ width: item.width }" :style="{ width: item.width }"
/> />
@ -122,6 +123,8 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
:style="{ width: item.width }" :style="{ width: item.width }"
clearable clearable
/> />

View File

@ -11,12 +11,6 @@
@reset="handleReset" @reset="handleReset"
@new="handleAddUser" @new="handleAddUser"
/> />
<!-- <el-button-->
<!-- type="primary"-->
<!-- size="mini"-->
<!-- style="margin-left:auto;height: 28px;position: absolute;bottom: 0;right: 10px"-->
<!-- @click="handleAddUser"-->
<!-- >{{$t('common:button:new')}}</el-button>-->
</div> </div>
<base-table <base-table
v-loading="loading" v-loading="loading"
@ -70,6 +64,9 @@ const searchDataDefault = () => {
PageSize: 20, PageSize: 20,
Asc: false, Asc: false,
RealName: '', RealName: '',
BeginCreateTime: '',
EndCreateTime: '',
CreateTimeArr: [],
SortField: 'CreateTime' SortField: 'CreateTime'
} }
} }
@ -335,7 +332,14 @@ export default {
handleReset() { handleReset() {
this.searchData = searchDataDefault() this.searchData = searchDataDefault()
this.getList() this.getList()
},
handleSearch() {
if (this.searchData.CreateTimeArr.length > 0) {
this.searchData.BeginCreateTime = this.searchData.CreateTimeArr[0]
this.searchData.EndCreateTime = this.searchData.CreateTimeArr[1]
} }
this.getList()
},
} }
} }
</script> </script>