فهرست منبع

feat: 时间选择器配置面板,时间格式化配置添加说明

wu.jian2 1 سال پیش
والد
کامیت
d564f71fa1
2فایلهای تغییر یافته به همراه29 افزوده شده و 10 حذف شده
  1. 29 7
      data-room-ui/packages/BasicComponents/TimePicker/setting.vue
  2. 0 3
      data-room-ui/packages/SettingTitle/index.vue

+ 29 - 7
data-room-ui/packages/BasicComponents/TimePicker/setting.vue

@@ -89,6 +89,7 @@
                 v-model="config.customize.formatType"
                 class="bs-el-select"
                 popper-class="bs-el-select"
+                clearable
                 @change="selectFormatType"
               >
                 <el-option
@@ -103,10 +104,22 @@
               v-if="config.customize.formatType === 'custom'"
               label="自定义时间格式"
             >
-              <el-input
-                v-model="config.customize.valueFormat"
-                placeholder="例如:HH:mm:ss"
-              />
+              <div class="time-format-description">
+                <el-input
+                  v-model="config.customize.valueFormat"
+                  placeholder="例如:HH:mm:ss"
+                  clearable
+                />
+                <el-tooltip
+                  content="时间格式示例:HH表示小时(24小时制),mm表示分钟,ss表示秒"
+                  placement="top"
+                >
+                  <span
+                    class="el-icon-question"
+                    style="color:#9e9e9e"
+                  />
+                </el-tooltip>
+              </div>
             </el-form-item>
           </div>
         </el-form>
@@ -175,13 +188,15 @@ export default {
   watch: {},
   mounted () {},
   methods: {
-    selectFormatType (val) {
-      if (val === 'default') {
+    selectFormatType (type) {
+      if (type === 'default') {
         this.config.customize.value = ''
         this.config.customize.valueFormat = ''
-      } else if (val === 'timestamp') {
+      } else if (type === 'timestamp') {
         this.config.customize.value = 0
         this.config.customize.valueFormat = 'timestamp'
+      } else if (type === 'custom') {
+        this.config.customize.valueFormat = 'HH:mm:ss'
       }
     }
   }
@@ -193,4 +208,11 @@ export default {
     width: 97%;
     padding: 16px;
   }
+  .time-format-description{
+    display: flex;
+    align-items: center;
+    .el-tooltip{
+      margin-left: 5px;
+    }
+  }
   </style>

+ 0 - 3
data-room-ui/packages/SettingTitle/index.vue

@@ -9,8 +9,6 @@
 <style lang="scss" scoped>
 .lc-field-head {
     height: 30px;
-    // margin-bottom: 12px;
-
     .lc-field-title {
       width: 308px;
         // 文字溢出隐藏
@@ -21,7 +19,6 @@
         padding-left: 12px;
         line-height: 30px;
         height: 30px;
-
         &:after {
             position: absolute;
             left: 0;