Selaa lähdekoodia

供应商文章列表修改

喻文俊 3 vuotta sitten
vanhempi
commit
f43c746f3e

+ 2 - 7
src/main/resources/static/js/supplier-center/encyclopedia/instrument-edit.js

@@ -27,13 +27,10 @@ const app = new Vue({
         }
 
         return {
-
             productId: 0,
             commodityType: 2, // 商品类型 1: 产品  2: 仪器
             shopId: GLOBAL_SHOP_ID,
-
             action: $('#coreServer').val() + '/tools/image/upload/multi',
-
             formData: {
                 // 仪器名称
                 name: '',
@@ -136,10 +133,8 @@ const app = new Vue({
                 // // 仪器状态
                 // status: [{required: true, message: '请选择仪器状态', trigger: 'change'}],
             },
-
             // 仪器类别列表
             typeList: [],
-
             // 仪器参数
             // paramList: [],
             paramEmptyList: [], // 占位
@@ -155,7 +150,7 @@ const app = new Vue({
             dialogImageUrl: '',
             // 日期选择格式
             marketTimeType: 'year',
-            nmpaTimeType: 'year'
+            nmpaTimeType: 'year',
         }
     },
     computed: {
@@ -170,7 +165,7 @@ const app = new Vue({
             const filter = this.questionEmptyList.filter(item => item.question !== '' && item.answer !== '')
             if (filter.length > 0) return filter.map(item => ({question: item.question, answer: item.answer}))
             return []
-        },
+        }
     },
 
     mounted: function mounted() {

+ 37 - 0
src/main/resources/static/js/utils.js

@@ -304,3 +304,40 @@ CAIMEI.returnedTarget = function(){//对象合并 IE 兼容方法
     }
 };
 
+/**
+ * @description: 根据年份月份计算当月天数
+ * @param year 年份
+ * @param month 月份
+ * @return 返回日期格式
+ */
+function fetchDaysByYear(year, month) {
+  // 该函数没有对参数进行校验  必须确保传入年份月份为正确的数字
+  year = parseInt(year, 10);
+  month = parseInt(month, 10);
+  let days;
+  switch (month) {
+    case 1:
+    case 3:
+    case 5:
+    case 7:
+    case 8:
+    case 10:
+    case 12:
+      days = 31;
+      break;
+    case 4:
+    case 6:
+    case 9:
+    case 11:
+      days = 30;
+      break;
+    case 2:
+      // 判断是否闰年
+      if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
+        days = 29;
+      } else {
+        days = 28;
+      }
+  }
+  return days;
+}

+ 6 - 0
src/main/resources/templates/supplier-center/article/article-list.html

@@ -81,6 +81,7 @@
                             <th>点赞数</th>
                             <th>阅读量</th>
                             <th>审核状态</th>
+                            <th>上线状态</th>
                             <th>发布时间</th>
                             <th>发布人</th>
                             <th>添加时间</th>
@@ -104,6 +105,11 @@
                                     <span class="state danger" v-else>审核失败</span>
                                     <span class="reason" v-if="articleInfo.auditStatus === 3" :title="'审核失败:' + articleInfo.failReason">?</span>
                                 </td>
+                                <td>
+                                    <span class="state default" v-if="true">待上线</span>
+                                    <span class="state success" v-if="false">已上线</span>
+                                    <span class="state danger" v-if="false">已下线</span>
+                                </td>
                                 <td class="time">
                                     <div class="time">{{ articleInfo.publishDate | formatDate }}</div>
                                 </td>