update: proSearch添加class

This commit is contained in:
xieyonghong 2023-03-14 16:57:31 +08:00
parent ce9ce6ff4a
commit 67739f0714
7 changed files with 26 additions and 14 deletions

View File

@ -1,8 +1,13 @@
<template>
<router-view />
<ConfigProvider :locale='zhCN'>
<router-view />
</ConfigProvider>
</template>
<script setup lang="ts">
import { ConfigProvider } from 'jetlinks-ui-components'
import zhCN from 'jetlinks-ui-components/es/locale/zh_CN';
</script>
<style scoped>

View File

@ -5,6 +5,7 @@
:request='saveSearchHistory'
:historyRequest='getSearchHistory'
:columns='columns'
:class='props.class'
@search='searchSubmit'
/>
</template>

View File

@ -5,6 +5,10 @@ import components from './components'
import router from './router'
import './style.less'
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('zh-cn');
const app = createApp(App)
app.use(store)

View File

@ -1,12 +1,11 @@
<template>
<div class='dropdown-time-picker'>
<j-time-picker
v-if='type === "time"'
v-if='!_type'
open
class='manual-time-picker'
v-model:value='myValue'
class='manual-time-picker'
:format='myFormat'
:valueFormat='myFormat'
:getPopupContainer='getPopupContainer'
popupClassName='manual-time-picker-popup'
@change='change'
@ -17,7 +16,6 @@
class='manual-time-picker'
v-model:value='myValue'
:format='myFormat'
:valueFormat='myFormat'
:getPopupContainer='getPopupContainer'
popupClassName='manual-time-picker-popup'
@change='change'
@ -26,7 +24,7 @@
</template>
<script setup lang='ts' name='DropdownTime'>
import dayjs from 'dayjs'
import dayjs, { Dayjs } from 'dayjs'
type Emit = {
(e: 'update:value', value: string) : void
@ -44,23 +42,26 @@ const props = defineProps({
},
format: {
type: String,
default: ''
default: undefined
}
})
const emit = defineEmits<Emit>()
const myFormat = props.format || ( props.type === 'time' ? 'HH:mm:ss' : 'YYYY-MM-DD HH:mm:ss')
const myValue = ref(props.value || dayjs(new Date()).format(myFormat))
const myValue = ref<Dayjs>(dayjs(props.value || new Date(), myFormat))
const getPopupContainer = (trigger: HTMLElement) => {
return trigger?.parentNode || document.body
}
const change = (e: string) => {
myValue.value = e
emit('update:value', e)
emit('change', e)
const change = (e: Dayjs) => {
emit('update:value', e.format(myFormat))
emit('change', e.format(myFormat))
}
const _type = computed(() => {
return props.value?.includes('-')
})
</script>
<style lang='less'>

View File

@ -28,7 +28,7 @@
@change='timeChange'
/>
<DropdownMenus
v-if='["select","enum", "boolean"].includes(item.component)'
v-else-if='["select","enum", "boolean"].includes(item.component)'
:options='["metric", "upper"].includes(item.key) ? metricOption : options'
@click='onSelect'
/>

View File

@ -21,6 +21,7 @@
"layouts/*": ["./src/layouts/*"],
"store/*": ["./src/store/*"],
"style/*": ["./src/style/*"],
"jetlinks-ui-components/es": ["./node_modules/jetlinks-ui-components/es/*"]
},
"types": ["ant-design-vue/typings/global", "vite/client"],
"suppressImplicitAnyIndexErrors": true

View File

@ -114,7 +114,7 @@ export default defineConfig(({ mode}) => {
}
},
optimizeDeps: {
include: ['pinia', 'vue-router', 'axios', 'lodash-es', '@vueuse/core', 'echarts'],
include: ['pinia', 'vue-router', 'axios', 'lodash-es', '@vueuse/core', 'echarts', 'dayjs'],
}
}
})