mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-23 20:17:54 +00:00
fix: 修改datetimerange component
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
"axios": "0.18.1",
|
||||
"deepmerge": "^4.2.2",
|
||||
"echarts": "^4.7.0",
|
||||
"element-ui": "2.13.0",
|
||||
"element-ui": "2.13.2",
|
||||
"eslint-plugin-html": "^6.0.0",
|
||||
"jquery": "^3.5.0",
|
||||
"js-cookie": "2.2.0",
|
||||
|
@@ -9,7 +9,6 @@
|
||||
:clearable="false"
|
||||
class="datepicker"
|
||||
:picker-options="pickerOptions"
|
||||
:value-format="valueFormatter"
|
||||
:default-time="['00:00:01', '23:59:59']"
|
||||
v-bind="$attrs"
|
||||
@change="handleDateChange"
|
||||
@@ -18,17 +17,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatDate } from '@/utils/common'
|
||||
export default {
|
||||
name: 'DatetimeRangePicker',
|
||||
components: {},
|
||||
props: {
|
||||
startValue: {
|
||||
type: Number,
|
||||
type: [Number, String],
|
||||
default: null
|
||||
},
|
||||
endValue: {
|
||||
type: Number,
|
||||
type: [Number, String, Date],
|
||||
default: null
|
||||
}
|
||||
},
|
||||
@@ -38,8 +36,7 @@ export default {
|
||||
const dateStart = new Date(startValue)
|
||||
const dateTo = new Date(endValue)
|
||||
return {
|
||||
valueFormatter: 'yyyy-MM-ddTHH:mm:ss',
|
||||
value: [startValue ? formatDate(dateStart) : '', endValue ? formatDate(dateTo) : ''],
|
||||
value: [dateStart, dateTo],
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
@@ -79,12 +76,6 @@ export default {
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleDateChange(val) {
|
||||
@@ -96,7 +87,7 @@ export default {
|
||||
|
||||
<style lang='less' scoped>
|
||||
.datepicker{
|
||||
width: 235px;
|
||||
width: 240px;
|
||||
}
|
||||
.el-input__inner{
|
||||
border: 1px solid #dcdee2;
|
||||
|
@@ -62,12 +62,12 @@ export default {
|
||||
},
|
||||
handleDateChange(attrs) {
|
||||
this.iTableConfig.extraQuery = {
|
||||
date_from: attrs[0],
|
||||
date_to: attrs[1]
|
||||
date_from: attrs[0].toISOString(),
|
||||
date_to: attrs[1].toISOString()
|
||||
}
|
||||
return this.dataTable.searchDate({
|
||||
date_from: attrs[0],
|
||||
date_to: attrs[1]
|
||||
date_from: attrs[0].toISOString(),
|
||||
date_to: attrs[1].toISOString()
|
||||
})
|
||||
},
|
||||
toggleRowSelection(row, isSelected) {
|
||||
|
@@ -10,6 +10,9 @@ export default {
|
||||
GenericListPage
|
||||
},
|
||||
data() {
|
||||
const now = new Date()
|
||||
const oneDayAgo = (new Date(now.getTime() - 3600 * 1000 * 24)).toISOString()
|
||||
const dateTo = now.toISOString()
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/audits/login-logs/',
|
||||
@@ -35,6 +38,10 @@ export default {
|
||||
datetime: {
|
||||
width: '160px'
|
||||
}
|
||||
},
|
||||
extraQuery: {
|
||||
date_to: dateTo,
|
||||
date_from: oneDayAgo
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
|
@@ -3373,9 +3373,10 @@ element-theme-chalk@^2.13.1:
|
||||
resolved "https://registry.npm.taobao.org/element-theme-chalk/download/element-theme-chalk-2.13.1.tgz?cache=0&sync_timestamp=1586760865928&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-theme-chalk%2Fdownload%2Felement-theme-chalk-2.13.1.tgz#9a022717a154ef0ca46f54665b485444b45c0671"
|
||||
integrity sha1-mgInF6FU7wykb1RmW0hURLRcBnE=
|
||||
|
||||
element-ui@2.13.0:
|
||||
version "2.13.0"
|
||||
resolved "https://registry.yarnpkg.com/element-ui/-/element-ui-2.13.0.tgz#f6bb04e5b0a76ea5f62466044b774407ba4ebd2d"
|
||||
element-ui@2.13.2:
|
||||
version "2.13.2"
|
||||
resolved "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.2.tgz?cache=0&sync_timestamp=1589795164194&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felement-ui%2Fdownload%2Felement-ui-2.13.2.tgz#582bf47aaaaaafe23ea1958fae217a687ad06447"
|
||||
integrity sha1-WCv0eqqqr+I+oZWPriF6aHrQZEc=
|
||||
dependencies:
|
||||
async-validator "~1.8.1"
|
||||
babel-helper-vue-jsx-merge-props "^2.0.0"
|
||||
|
Reference in New Issue
Block a user