Browse Source

优化对话框和编辑器组件样式,调整日期格式及表单布局

master
parent
commit
149a074b28
  1. 6
      src/components/Dialog/src/Dialog.vue
  2. 2
      src/components/Editor/src/Editor.vue
  3. 14
      src/utils/formatTime.ts
  4. 6
      src/views/system/jobinfo/JobInfoForm.vue

6
src/components/Dialog/src/Dialog.vue

@ -68,12 +68,12 @@ const dialogStyle = computed(() => {
:top="top"
>
<template #header="{ close }">
<div class="relative h-54px flex items-center justify-between pl-15px pr-15px">
<div class="relative flex items-center justify-between text-18px">
<slot name="title">
{{ title }}
</slot>
<div
class="absolute right-15px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between"
class="absolute right-0px top-[50%] h-54px flex translate-y-[-50%] items-center justify-between"
>
<Icon
class="is-hover cursor-pointer"
@ -108,9 +108,9 @@ const dialogStyle = computed(() => {
margin: 0 !important;
&__header {
height: 54px;
padding: 0;
margin-right: 0 !important;
margin-bottom: 20px;
}
&__body {

2
src/components/Editor/src/Editor.vue

@ -256,11 +256,11 @@ defineExpose({
<style scoped>
.wgEdit >>> .w-e-scroll::-webkit-scrollbar {
width: 4px !important;
//height: 8px !important;
}
.wgEdit >>> .w-e-scroll::-webkit-scrollbar-thumb {
background-color: #dcdfe6 !important;
border-radius: 10px !important;
box-shadow: none !important;
}
</style>

14
src/utils/formatTime.ts

@ -70,7 +70,7 @@ export function formatDate(date: Date, format?: string): string {
return ''
}
// 日期存在,则进行格式化
return date ? dayjs(date).locale('zh-cn').format(format ?? 'YYYY-MM-DD HH:mm:ss') : ''
return date ? dayjs(date).locale('zh-cn').format(format ?? 'YYYY年M月D日 H时m分s秒') : ''
}
/**
@ -111,7 +111,7 @@ export function getWeek(dateTime: Date): number {
* @description param 3 60 * 60* 24 * 1000 * 3
* @returns
*/
export function formatPast(param: string | Date, format = 'YYYY-MM-DD HH:mm:ss'): string {
export function formatPast(param: string | Date, format = 'YYYY年M月D日 H时m分s秒'): string {
// 传入格式处理、存储转换值
let t: any, s: number
// 获取js 时间戳
@ -199,7 +199,7 @@ export function formatPast2(ms: number): string {
* @param cellValue
*/
export function dateFormatter(_row: any, _column: TableColumnCtx<any>, cellValue: any): string {
return cellValue ? formatDate(cellValue, 'YYYY年MMDD日 AHHmm分') : ''
return cellValue ? formatDate(cellValue, 'YYYY年M月D日 AH时m分') : ''
}
/**
@ -210,7 +210,7 @@ export function dateFormatter(_row: any, _column: TableColumnCtx<any>, cellValue
* @param cellValue
*/
export function dateFormatter2(_row: any, _column: TableColumnCtx<any>, cellValue: any): string {
return cellValue ? formatDate(cellValue, 'YYYY年MMDD日') : ''
return cellValue ? formatDate(cellValue, 'YYYY年M月D日') : ''
}
/**
@ -221,7 +221,7 @@ export function dateFormatter2(_row: any, _column: TableColumnCtx<any>, cellValu
* @param cellValue
*/
export function dateFormatter3(_row: any, _column: TableColumnCtx<any>, cellValue: any): string {
return cellValue ? formatDate(cellValue, 'YYYY年MMDD日') : ''
return cellValue ? formatDate(cellValue, 'YYYY年M月D日') : ''
}
/**
@ -338,7 +338,7 @@ export function getDateRange(
endDate: dayjs.ConfigType
): [string, string] {
return [
dayjs(beginDate).startOf('d').format('YYYY-MM-DD HH:mm:ss'),
dayjs(endDate).endOf('d').format('YYYY-MM-DD HH:mm:ss')
dayjs(beginDate).startOf('d').format('YYYY年M月D日 H时m分s秒'),
dayjs(endDate).endOf('d').format('YYYY年M月D日 H时m分s秒')
]
}

6
src/views/system/jobinfo/JobInfoForm.vue

@ -1,11 +1,10 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" top="5vh">
<Dialog :title="dialogTitle" v-model="dialogVisible" top="5vh" width="64vw">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
v-loading="formLoading"
width="600px"
class="reportForm"
>
<section class="flex flex-wrap gap-20px">
@ -26,7 +25,7 @@
<el-input v-model="formData.jobName" placeholder="请输入汇报人姓名" />
</el-form-item>
<el-form-item label="汇报内容" prop="content" class="!w100%">
<Editor v-model="formData.content" height="350px" />
<Editor v-model="formData.content" height="400px" class="w100%"/>
</el-form-item>
</section>
</el-form>
@ -162,6 +161,7 @@ const deleteReport = () => {
.reportForm {
::v-deep(.el-form-item) {
width: calc(50% - 10px);
margin-bottom: 0;
}
}
</style>

Loading…
Cancel
Save