bihuisong 7 hónapja
szülő
commit
8a2d43a7e2

+ 18 - 3
zhjq-ui/src/views/system/notice/index.vue

@@ -164,8 +164,9 @@
                 style="width: 290px"
                 v-model="form.releaseTime"
                 type="date"
-                placeholder="请选择发布时间">
-              </el-date-picker>
+                placeholder="请选择发布时间"
+                value-format="yyyy-MM-dd"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -240,6 +241,17 @@ export default {
     this.getList();
   },
   methods: {
+    getNowTime() {
+      var now = new Date()
+      var year = now.getFullYear() // 得到年份
+      var month = now.getMonth() // 得到月份
+      var date = now.getDate() // 得到日期
+      month = month + 1
+      month = month.toString().padStart(2, '0')
+      date = date.toString().padStart(2, '0')
+      var defaultDate = `${year}-${month}-${date}`
+      this.$set(this.form, 'releaseTime', defaultDate)
+    },
     /** 查询公告列表 */
     getList() {
       this.loading = true;
@@ -261,9 +273,11 @@ export default {
         noticeTitle: undefined,
         noticeType: undefined,
         noticeContent: undefined,
-        status: "0"
+        releaseTime: undefined,
+        status: "0",
       };
       this.resetForm("form");
+      this.getNowTime()
     },
     /** 搜索按钮操作 */
     handleQuery() {
@@ -296,6 +310,7 @@ export default {
         this.open = true;
         this.title = "修改公告";
       });
+      this.getNowTime()
     },
     /** 提交按钮 */
     submitForm: function () {

+ 14 - 1
zhjq-ui/src/views/system/voice/index.vue

@@ -227,6 +227,17 @@ export default {
     this.localPort = this.getPort()
   },
   methods: {
+    getNowTime() {
+      var now = new Date()
+      var year = now.getFullYear() // 得到年份
+      var month = now.getMonth() // 得到月份
+      var date = now.getDate() // 得到日期
+      month = month + 1
+      month = month.toString().padStart(2, '0')
+      date = date.toString().padStart(2, '0')
+      var defaultDate = `${year}-${month}-${date}`
+      this.$set(this.form, 'releaseTime', defaultDate)
+    },
     getLocalIp() {
       const {hostname} = window.location;
       return hostname === 'localhost' || hostname === '127.0.0.1'
@@ -279,9 +290,11 @@ export default {
         createTime: null,
         updateBy: null,
         updateTime: null,
-        remark: null
+        remark: null,
+        releaseTime: null,
       };
       this.resetForm("form");
+      this.getNowTime()
     },
     /** 搜索按钮操作 */
     handleQuery() {