zhangzengfei
2022-02-22 9466f8f5d714c8f72dbaff6ac3898b4d43c7c715
delete pickerOptions
2个文件已修改
179 ■■■■■ 已修改文件
src/pages/maintain/index/App.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/maintain/views/systemClean.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/maintain/index/App.vue
@@ -1,97 +1,64 @@
<template>
  <div class="container">
    <div class="container-left">
      <div
        class="left-card"
        v-for="(item, index) in menuArr"
        :key="index"
        @click="openMenu(item, index)"
      >
      <div class="left-card" v-for="(item, index) in menuArr" :key="index" @click="openMenu(item, index)">
        <span class="icon iconfont">&#xe646;</span>
        <span class="card-text">{{ item.name }}</span>
      </div>
    </div>
    <systemClean
      v-if="activePage == '系统清理'"
      style="width: 100%"
    ></systemClean>
    <updateSettings
      v-if="activePage == '更新设置'"
      style="width: 100%"
    ></updateSettings>
    <back-up
      v-if="activePage == '备份还原'"
      style="width: 100%"
    ></back-up>
    <restartSettings
      v-if="activePage == '重启设置'"
      style="width: 100%"
    ></restartSettings>
    <systemClean v-if="activePage == '系统清理'" style="width: 100%"></systemClean>
    <updateSettings v-if="activePage == '更新设置'" style="width: 100%"></updateSettings>
    <back-up v-if="activePage == '备份还原'" style="width: 100%"></back-up>
    <restartSettings v-if="activePage == '重启设置'" style="width: 100%"></restartSettings>
  </div>
</template>
<script>
import {
  getClockInfo,
  saveClockInfo,
  testNTPserver,
} from "@/api/system";
import switchBar from "../components/switchBar";
import ipInput from "@/components/subComponents/IPInput";
import systemClean from "../views/systemClean";
import updateSettings from "../views/updateSettings";
import BackUp from "../views/backUp";
import restartSettings from "../views/restartSettings";
import systemClean from "../views/systemClean"
import updateSettings from "../views/updateSettings"
import BackUp from "../views/backUp"
import restartSettings from "../views/restartSettings"
export default {
  name: "settings",
  components: {
    switchBar,
    ipInput,
    systemClean,
    updateSettings,
    BackUp,
    restartSettings,
    restartSettings
  },
  data() {
    return {
      browserTimer: null,
      menuArr: [
        { name: "更新设置" },
        { name: "备份还原" },
        { name: "系统清理" },
        { name: "重启设置" },
      ],
      menuArr: [{ name: "更新设置" }, { name: "备份还原" }, { name: "系统清理" }, { name: "重启设置" }],
      jpgArr: [{}, {}, {}, {}, {}, {}, {}, {}, {}],
      activePage: "更新设置",
      activeIndex: 0,
      clockTimer: null,
    };
      clockTimer: null
    }
  },
  beforeDestroy() {
    clearTimeout(this.clockTimer);
    clearInterval(this.browserTimer);
    clearTimeout(this.clockTimer)
    clearInterval(this.browserTimer)
  },
  mounted() {
    const s = document.getElementsByClassName("left-card")[0];
    s.style.backgroundColor = "rgba(61, 104, 225, 1)";
    s.style.color = "#fff";
    const s = document.getElementsByClassName("left-card")[0]
    s.style.backgroundColor = "rgba(61, 104, 225, 1)"
    s.style.color = "#fff"
  },
  methods: {
    openMenu(item, i) {
      const old = document.getElementsByClassName("left-card")[
        this.activeIndex
      ];
      old.style.backgroundColor = "initial";
      old.style.color = "rgba(81, 81, 81, 1)";
      const old = document.getElementsByClassName("left-card")[this.activeIndex]
      old.style.backgroundColor = "initial"
      old.style.color = "rgba(81, 81, 81, 1)"
      this.activePage = item.name;
      this.activeIndex = i;
      const s = document.getElementsByClassName("left-card")[i];
      s.style.backgroundColor = "rgba(61, 104, 225, 1)";
      s.style.color = "#fff";
    },
  },
};
      this.activePage = item.name
      this.activeIndex = i
      const s = document.getElementsByClassName("left-card")[i]
      s.style.backgroundColor = "rgba(61, 104, 225, 1)"
      s.style.color = "#fff"
    }
  }
}
</script>
<style lang="scss">
.container {
@@ -140,7 +107,6 @@
    border-right: 5px solid rgba(248, 248, 248, 1);
    box-sizing: border-box;
    .account-left {
      .add-account {
        color: rgba(61, 104, 225, 1);
        margin-top: 50px;
@@ -171,7 +137,6 @@
          font-size: 14px;
        }
      }
    }
    .datetime-left {
      .time-card {
@@ -376,11 +341,8 @@
      }
    }
    .datetime-right {
      .el-form-item.is-required:not(.is-no-asterisk)
        > .el-form-item__label:before,
      .el-form-item.is-required:not(.is-no-asterisk)
        .el-form-item__label-wrap
        > .el-form-item__label:before {
      .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before,
      .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label:before {
        display: none;
      }
      .el-form-item {
@@ -624,5 +586,3 @@
  }
}
</style>
src/pages/maintain/views/systemClean.vue
@@ -1,9 +1,5 @@
<template>
  <div class="clear"
      v-loading="loading"
      :element-loading-text="loadingText"
  >
  <div class="clear" v-loading="loading" :element-loading-text="loadingText">
    <div class="head">
      <span class="t">请选择要清理的数据范围</span>
      <el-date-picker
@@ -34,48 +30,36 @@
      <div class="warm">
        <!-- <span class="icon iconfont" style="margin-right:5px">&#xe690;</span> -->
        <i class="iconfont icontishi-zhuyi"></i>
        <span class="text"
          >请注意,按以上日期范围删除的数据不可恢复,立即生效,请谨慎操作!</span
        >
        <span class="text">请注意,按以上日期范围删除的数据不可恢复,立即生效,请谨慎操作!</span>
      </div>
    </div>
  </div>
</template>
<script>
import { deleteDate } from "@/api/system";
import { deleteDate } from "@/api/system"
export default {
  data() {
    return {
      pickerOptions: {
        disabledDate(time) {
          var day = new Date();
          day.setTime(day.getTime() - 24 * 60 * 60 * 1000);
          return time.getTime() > day;
        },
      },
      loading: false,
      loadingText: '',
      dataRange: [
        this.$moment().format("YYYY-MM-DD HH:mm:ss"),
        this.$moment().format("YYYY-MM-DD HH:mm:ss"),
      ],
      loadingText: "",
      dataRange: [this.$moment().format("YYYY-MM-DD HH:mm:ss"), this.$moment().format("YYYY-MM-DD HH:mm:ss")],
      pickerOptions: {
        disabledDate(time) {
          var day = new Date();
          day.setTime(day.getTime() - 24 * 60 * 60 * 1000);
          return time.getTime() > day;
        },
      },
    };
          var day = new Date()
          day.setTime(day.getTime() - 24 * 60 * 60 * 1000)
          return time.getTime() > day
        }
      }
    }
  },
  mounted() {},
  methods: {
    deleteData() {
      var timeRange = this.format(this.dataRange);
      var showStartTime = timeRange[0];
      var showEndTime = timeRange[1];
      var timeRange = this.format(this.dataRange)
      var showStartTime = timeRange[0]
      var showEndTime = timeRange[1]
      this.$confirm(
        "提示:" +
          showStartTime +
@@ -85,7 +69,7 @@
        {
          center: true,
          cancelButtonClass: "comfirm-class-cancle",
          confirmButtonClass: "comfirm-class-sure",
          confirmButtonClass: "comfirm-class-sure"
        }
      )
        .then(() => {
@@ -93,35 +77,32 @@
          this.loadingText = "正在删除数据,请稍候!"
          deleteDate({
            startTime: showStartTime,
            endTime: showEndTime,
            endTime: showEndTime
          })
            .then((resp) => {
              if (resp.success) {
                this.$message({
                  type: "success",
                  message: "删除数据成功",
                });
                  message: "删除数据成功"
                })
                this.loading = false
              }
            })
            .catch((err) => {
              this.$message({
                type: "error",
                message: "删除数据失败!",
              });
                message: "删除数据失败!"
              })
              this.loading = false
            });
            })
        })
        .catch(() => {});
        .catch(() => {})
    },
    format(array) {
      return [
        this.$moment(array[0]).format("YYYY-MM-DD"),
        this.$moment(array[1]).format("YYYY-MM-DD"),
      ];
    },
  },
};
      return [this.$moment(array[0]).format("YYYY-MM-DD"), this.$moment(array[1]).format("YYYY-MM-DD")]
    }
  }
}
</script>
<style lang="scss">
.all {
@@ -151,8 +132,8 @@
      border: none;
    }
    .el-range-editor--small .el-range-separator {
    line-height: 26px;
}
      line-height: 26px;
    }
  }
  .desc {
    margin-top: 50px;
@@ -200,7 +181,7 @@
      align-items: center;
      justify-content: center;
      .iconfont {
          font-size: 16px;
        font-size: 16px;
        color: #e99038;
        margin-right: 5px;