Browse Source

公共配置晚8点剧场

CzRger 1 year ago
parent
commit
4258d6bf75

+ 1 - 6
src/views/staging/zby/center/index.vue

@@ -162,17 +162,12 @@ export default defineComponent({
       const b = new Date(`${that.$util.YMD(now)} ${time}`).getTime() - 1000 * 60 * Number(diff)
       return a >= b
     }
-    const ratherTimeDaily = (now, time, diff) => {
-      const a = new Date(now).getTime()
-      const b = new Date(`${that.$util.YMD(now)} ${time}`).getTime() + oneDayTime - 1000 * 60 * Number(diff)
-      return a >= b
-    }
     const tipsCpt = computed(() => {
       let str: Array<string> = []
       if (!store.state.app.signInfo?.id && ratherTime(store.state.app.timestamp, store.state.app.publicConfig['sign.begin.time'], store.state.app.publicConfig['sign.remind.time'])) {
         str.push('未签到')
       }
-      if (!store.state.app.dailyInfo?.id && ratherTimeDaily(store.state.app.timestamp, store.state.app.publicConfig['log.submit.time'], store.state.app.publicConfig['log.remind.time'])) {
+      if (!store.state.app.dailyInfo?.id && ratherTime(store.state.app.timestamp, store.state.app.publicConfig['log.submit.time'], store.state.app.publicConfig['log.remind.time'])) {
         str.push('未提交日志')
       }
       if (store.getters['app/isWeeklyDay'] && !store.state.app.weeklyInfo?.id && ratherTime(store.state.app.timestamp, store.state.app.publicConfig['week.submit.time'], store.state.app.publicConfig['week.remind.time'])) {

+ 13 - 1
src/views/system/public-configuration/index.vue

@@ -15,6 +15,8 @@
                   link="time"
                   v-model:param="form['sign.begin.time']"
                   :clearable="false"
+                  :disabled="isDisabled"
+                  :title="isDisabled ? '每日20:00:00后可修改' : ''"
                   @change="editKey('sign.begin.time')"/>
             </div>
           </div>
@@ -38,6 +40,8 @@
                   link="time"
                   v-model:param="form['sign.end.time']"
                   :clearable="false"
+                  :disabled="isDisabled"
+                  :title="isDisabled ? '每日20:00:00后可修改' : ''"
                   @change="editKey('sign.end.time')"/>
             </div>
           </div>
@@ -57,6 +61,8 @@
                   link="time"
                   v-model:param="form['log.submit.time']"
                   :clearable="false"
+                  :disabled="isDisabled"
+                  :title="isDisabled ? '每日20:00:00后可修改' : ''"
                   @change="editKey('log.submit.time')"/>
             </div>
           </div>
@@ -99,6 +105,8 @@
                    link="time"
                    v-model:param="form['week.submit.time']"
                    :clearable="false"
+                   :disabled="isDisabled"
+                   :title="isDisabled ? '每日20:00:00后可修改' : ''"
                    @change="editKey('week.submit.time')"/>
              </div>
             </div>
@@ -193,13 +201,17 @@ export default defineComponent({
         })
       }, 100)
     }
+    const isDisabled = computed(() => {
+      return new Date(store.state.app.timestamp).getHours() < 20
+    })
     onMounted(() => {
       initDictionary()
       state.form = JSON.parse(JSON.stringify(store.state.app.publicConfig))
     })
     return {
       ...toRefs(state),
-      editKey
+      editKey,
+      isDisabled
     }
   },
 })