Bladeren bron

系统配置优化。。

wangwei 3 jaren geleden
bovenliggende
commit
e05719560d

+ 3 - 3
src/views/general/config/customComponents/DatePicker.vue

@@ -2,7 +2,7 @@
   <div class="wrap">
     <DatePicker
       class="date-picker"
-      :value="moment(value, 'YYYY-MM-DD')"
+      :value="value"
       @focus="onFocus"
       @change="onChange"
       @blur="onBlur"
@@ -16,7 +16,7 @@
   import moment from 'moment';
 
   const props = {
-    value: { type: String, default: '' },
+    value: { type: Object, default: null },
     tip: { type: String, default: '' },
   };
 
@@ -36,7 +36,7 @@
       }
 
       function onChange(val) {
-        emit('change', val);
+        emit('change', String(val));
       }
       return {
         onFocus,

+ 3 - 3
src/views/general/config/customComponents/TimePicker.vue

@@ -16,7 +16,7 @@
   import moment from 'moment';
 
   const props = {
-    value: { type: Object, default: {} },
+    value: { type: Object, default: null },
     tip: { type: String, default: '' },
   };
 
@@ -36,8 +36,8 @@
       }
 
       function onChange(val) {
-        console.log(`val`, val);
-        emit('change', val);
+        const time = String(val);
+        emit('change', time);
       }
       return {
         onFocus,

+ 6 - 2
src/views/general/config/data.ts

@@ -89,6 +89,9 @@ export const columns: BasicColumn[] = [
           const onDatePickerChange = (val) => {
             record.value = val;
           };
+          if (record.value !== '') {
+            record.value = moment(record.value).format('YYYY-MM-DD');
+          }
           return h(DatePicker, {
             placeholder: '没有选择日期',
             value: record.value,
@@ -97,11 +100,12 @@ export const columns: BasicColumn[] = [
           });
         case 'time':
           const onTimePickerChange = (val) => {
-            record.value = moment(val).format('HH:mm:ss');
+            console.log(`val`, val);
+            record.value = val;
           };
           return h(TimePicker, {
             placeholder: '没有选择时间',
-            value: moment(record.value, 'HH:mm:ss'),
+            value: record.value,
             tip: record.tip,
             onChange: onTimePickerChange,
           });

+ 3 - 0
src/views/general/config/index.vue

@@ -139,6 +139,7 @@
         if (state.group === 'basic' && res[1].title === 'Logo') {
           appStore.setAppLogo(res[1].value);
         }
+        console.log(`res`, res);
         return res;
       }
       getGroupList();
@@ -177,6 +178,7 @@
 
       async function handleTableSubmit() {
         const data = getTableAction().getDataSource();
+        console.log(`data`, data);
         let flag = true;
         data.map((item) => {
           if (item.rule && item.type !== 'array') {
@@ -293,6 +295,7 @@
     display: flex;
     justify-content: center;
   }
+
   ::v-deep .upload-btn {
     bottom: 0 !important;
   }

+ 4 - 0
src/views/member/member/index.vue

@@ -405,15 +405,19 @@
     color: #3785cc;
     border: 1px solid #3785cc;
   }
+
   .ant-calendar-picker {
     width: 100%;
   }
+
   .vben-basic-table-header__toolbar {
     justify-content: space-between;
   }
+
   .tool-btn-wrap {
     flex: 1;
   }
+
   .tool-btn-wrap button {
     margin-right: 5px;
   }