1. 优化 Dialog 组件,增加 scroll 标识滚动

2. 优化配置管理的 :default-time 设置
This commit is contained in:
YunaiV
2023-03-09 19:36:57 +08:00
parent 0ea6b1b749
commit 74846a11bd
3 changed files with 30 additions and 29 deletions

View File

@ -36,17 +36,16 @@
/>
</el-select>
</el-form-item>
<!-- TODO时间无法设置 已解决 -->
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="createTime"
v-model="queryParams.createTime"
style="width: 240px"
value-format="yyyy-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="defaultTime"
:default-time="[new Date(0, 0, 0, 0, 0, 0), new Date(0, 0, 0, 23, 59, 59)]"
/>
</el-form-item>
<el-form-item>
@ -139,14 +138,13 @@
</content-wrap>
<!-- 表单弹窗添加/修改 -->
<!-- TODO 芋艿可以改成 form 已解决 -->
<Form ref="modalRef" @success="getList" />
<config-form ref="modalRef" @success="getList" />
</template>
<script setup lang="ts" name="Config">
import * as ConfigApi from '@/api/infra/config'
import Form from './form.vue'
import ConfigForm from './form.vue'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { Delete, Edit, Search, Download, Plus, Refresh } from '@element-plus/icons-vue'
// import { Delete, Edit, Search, Download, Plus, Refresh } from '@element-plus/icons-vue'
import dayjs from 'dayjs'
const showSearch = ref(true) // 搜索框的是否展示
const loading = ref(true) // 列表的加载中
@ -157,13 +155,9 @@ const queryParams = reactive({
pageSize: 10,
name: undefined,
key: undefined,
type: undefined
type: undefined,
createTime: []
})
const createTime = ref('')
const defaultTime = ref<[Date, Date]>([
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59)
])
const queryFormRef = ref() // 搜索的表单
/** 搜索按钮操作 */
@ -196,7 +190,7 @@ const openModal = (type: string, id?: number) => {
modalRef.value.openModal(type, id)
}
// ========== 初始化 ==========
/** 初始化 **/
onMounted(() => {
getList()
})