lilei 2 éve
szülő
commit
0d7241370a

+ 3 - 3
package-lock.json

@@ -11523,9 +11523,9 @@
       }
     },
     "moment": {
-      "version": "2.24.0",
-      "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
-      "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
+      "version": "2.29.4",
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
+      "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
     },
     "move-concurrently": {
       "version": "1.0.1",

+ 4 - 2
package.json

@@ -24,7 +24,7 @@
     "lodash.pick": "^4.4.0",
     "md5": "^2.2.1",
     "mockjs2": "1.0.7",
-    "moment": "^2.24.0",
+    "moment": "^2.29.1",
     "nprogress": "^0.2.0",
     "screenfull": "^5.1.0",
     "v-runtime-template": "^1.10.0",
@@ -87,7 +87,9 @@
       "parser": "babel-eslint"
     },
     "rules": {
-       "eqeqeq":["off"],
+      "eqeqeq": [
+        "off"
+      ],
       "generator-star-spacing": "off",
       "no-mixed-operators": 0,
       "vue/max-attributes-per-line": [

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1673934601359
+  "version": 1674012487353
 }

+ 1 - 1
src/App.vue

@@ -12,7 +12,7 @@ import zhCN from 'ant-design-vue/es/locale/zh_CN';
 import { AppDeviceEnquire } from '@/utils/mixin'
 import moment from 'moment';//引入moment 
 import 'moment/locale/zh-cn';
-moment.locale('zh-cn');//配置moment中文环境
+moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn'); 
 export default {
   mixins: [AppDeviceEnquire],
   data () {

+ 1 - 1
src/libs/getDate.js

@@ -1,6 +1,6 @@
 // 引入 moment 时间插件
 import moment from 'moment'
-moment.updateLocale('en', { week: {
+moment.updateLocale('zh-cn', { week: {
   dow: 1, // 星期的第一天是星期一
   doy: 7 // 年份的第一周必须包含1月1日 (7 + 1 - 1)
 } })

+ 0 - 6
src/main.js

@@ -11,12 +11,6 @@ import 'viewerjs/dist/viewer.css'
 import { ConfigProvider } from 'ant-design-vue'
 Vue.use(ConfigProvider)
 
-// moment
-import moment from 'moment'; 
-import 'moment/locale/zh-cn';
-moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn'); 
-Vue.prototype.$moment = moment;//挂载到当前vue实例对象
-
 // mock
 // import './mock'
 

+ 2 - 2
src/views/allocationManagement/chainTransferOut/list.vue

@@ -12,12 +12,12 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <rangeDate ref="auditRangeDate" :value="auditTime" @change="auditDateChange" />
+                <rangeDate ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="出库时间">
-                <rangeDate ref="outWareRangeDate" :value="outWareTime" @change="outWareDateChange" />
+                <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
             <template v-if="advanced">

+ 9 - 11
src/views/common/rangeDate.vue

@@ -51,9 +51,7 @@
 </template>
 <script>
 import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
-import moment from 'moment'
-import 'moment/locale/zh-cn';
-moment.locale('zh-cn');//配置moment中文环境
+import moment from 'moment';//引入moment 
 export default {
   props: {
     value: {
@@ -78,8 +76,8 @@ export default {
   data () {
     return {
       locale,
-      startValue: this.value[0]||undefined,
-      endValue: this.value[1]||undefined,
+      startValue: null,
+      endValue: null,
       endOpen: false,
       startOpen: false,
       ranges: {
@@ -96,19 +94,19 @@ export default {
   watch: {
     startValue (val,old) {
       if(old&&!val){
-        this.endValue = undefined
+        this.endValue = null
       }
       if(val && !this.endValue){
         this.endOpen = true
       }
-      this.startValue = val
+      this.startValue = val || null
       this.changeInput()
     },
     endValue (val,old) {
       if(old&&!val){
-        this.startValue = undefined
+        this.startValue = null
       }
-      this.endValue = val
+      this.endValue = val || null
       this.changeInput()
     }
   },
@@ -194,8 +192,8 @@ export default {
       this.$emit('change', dateStrings)
     },
     resetDate (val) {
-      this.startValue = val && val[0] || undefined
-      this.endValue = val && val[1] || undefined
+      this.startValue = val && val[0] ? val[0] : null
+      this.endValue = val && val[1] ? val[1] : null
       this.$emit('change', [])
     }
   }