vue3 手撕日历控件

news2024/9/28 5:27:41

vue制作日历控件

效果如下:

在这里插入图片描述

<template>
  <div class="cal_con" style="margin-left:200px">
    <div class="cal_header">
      <!-- 顶部左侧 -->
      <div class="cal_header_left">
        <div class="cal_header_left_top">
          <span class="cal_h_time">{{ year }}</span>
        </div>
        <div class="cal_header_left_bottom">
          <div class="cal_h_left">
            <div class="cal_h_btn" @click="preYear">
              <svg class="cal_h_l_icon">
                <!-- 画线条 -->
                <polyline
                    points="6,0 2,4 6,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
                <!-- 画线条 -->
                <polyline
                    points="10,0 6,4 10,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
              </svg>
            </div>
            <div class="cal_h_btn" @click="preMonth">
              <svg class="cal_h_l_icon">
                <polyline
                    points="6,0 2,4 6,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
              </svg>
            </div>
          </div>
          <div class="cal_h_center">
            <span class="cal_h_time">{{ month }}</span>
          </div>
          <div class="cal_h_right">
            <div class="cal_h_btn" @click="nextMonth">
              <svg class="cal_h_l_icon">
                <polyline
                    points="2,0 8,4 2,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
              </svg>
            </div>
            <div class="cal_h_btn" @click="nextYear">
              <svg class="cal_h_l_icon">
                <polyline
                    points="2,0 8,4 2,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
                <polyline
                    points="6,0 12,4 6,8"
                    style="fill: none; stroke: #ffffff; stroke-width: 2"
                />
              </svg>
            </div>
          </div>
        </div>
      </div>
      <!-- 顶部右侧 -->
      <div class="cal_header_right">
        <div class="nameText">姓名:张三</div>
        <div class="QingjiaText">请假:{{jobTime["请假"]}}h</div>
        <div class="JiaBanText">加班:{{jobTime["加班"]}}h</div>
        <div class="ChuCaiText">出差:{{jobTime["出差"]}}h</div>
        <div class="YiChangText">异常考勤:{{jobTime["异常卡"]}}次</div>
      </div>
    </div>

    <div class="cal_month">
      <!--日历表头  周一 周二 周三 周四 周五 周六 周日-->
      <div class="cal_m_weeks">
        <div v-for="w in weeks" :key="w" class="cal_m_weeks_cell">
          {{ w }}
        </div>
      </div>
      <!--日历表内容 -->
      <div class="cal_m_days">
        <!-- 第几行 -->
        <div
            v-for="(ds, index) in monthData"
            :key="index"
            class="cal_m_day_line"
        >
          <!-- 每行内容 -->
          <div
              v-for="d in ds"
              :key="d.day"
              class="cal_m_day_cell"
              :style="{ color: getCellColor(d) }"
              @mouseenter="mouseenter(d, $event)"
              @mouseleave="mouseleave(d, $event)"
          >
            <div class="itemDay">{{ d.day }}</div>
            <!-- {{ ds[index].date.Format("yyyy-MM-dd") }} -->
            <!-- {{ d.date.Format("yyyy-MM-dd") }} -->
            <slot :name="d.fullYear + '-' + d.month + '-' + d.day"></slot>
            <!-- 正常卡 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '正常卡'
              "
                class="ZhengChang"
            >
              <div class="ZhengChangTitle">正常卡:{{setDataList(d.date).jobTime}}次</div>
              <div class="ZhengChangDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>
            <!-- 请假 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '请假'
              "
                class="Qingjia"
            >
              <div class="QingjiaTitle">请假:事假{{setDataList(d.date).jobTime}}</div>
              <div class="QingjiaDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>
            <!-- 加班 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '加班'
              "
                class="JiaBan"
            >
              <div class="JiaBanTitle">加班:{{setDataList(d.date).jobTime}}h</div>
              <div class="JiaBanDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>
            <!-- 出差 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '出差'
              "
                class="ChuChai"
                @click="ss(index)"
            >
              <div class="ChuChaiTitle">出差{{setDataList(d.date).jobTime}}</div>
              <div class="ChuChaiDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>
            <!-- 异常卡 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '异常卡'
              "
                class="YiChang"
                @click="ss(index)"
            >
              <div class="YiChangTitle">异常卡{{setDataList(d.date).jobTime}}</div>
              <div class="YiChangDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>

            <!-- 假期 -->
            <div
                v-if="
                d.type == 0 &&
                setDataList(d.date).typeName == '假期'
              "
                class="JiaQi"
            >
              <div class="JiaQiTitle">假期{{setDataList(d.date).jobTime}}</div>
              <div class="JiaQiDian">
                <div></div>
                <div></div>
                <div></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import {ref, reactive, toRefs, onMounted, defineEmits} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {Solar, Lunar} from "lunar-javascript";

const $emit = defineEmits(["enter", "leave", "changeMonth"])
const dataList = reactive({
  datas: [
    {
      time: "2023-01-29",
      typeName: "正常卡",
      jobTime: 8
    },
    {
      time: "2023-01-10",
      typeName: "请假",
      jobTime: 8
    },
    {
      time: "2023-01-10",
      typeName: "请假",
      jobTime: 8
    },
    {
      time: "2023-01-22",
      typeName: "加班",
      jobTime: 4
    },
    {
      time: "2023-01-11",
      typeName: "出差",
      jobTime: 14
    },
    {
      time: "2023-01-14",
      typeName: "异常卡",
      jobTime: 8
    },
    {
      time: "2023-01-02",
      typeName: "假期",
      jobTime: 11
    },
  ],
})

let now = ref(new Date()) //当前时间:Fri Jul 29 2022 09:57:33 GMT+0800 (中国标准时间)
let year = ref(0)
let month = ref(0)
let jobTime = ref([])
const weeks = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
let monthData = ref([]) //月数据容器
let currentYear = ref(new Date().getFullYear()) //当前年:2022
let currentMonth = ref(new Date().getMonth() + 1) //当前月:7
let currentDay = ref(new Date().getDate()) //当前天:29
onMounted(() => {
  setYearMonth(now.value);
  generateMonth(now.value);
  getJobTime()
})

function getJobTime(){
  dataList.datas.forEach((item) => {
    console.log("223",jobTime)

    // check if animal type has already been added to newObj
    if(!jobTime.value[item.typeName]){
      // If it is the first time seeing this animal type
      // we need to add title and points to prevent errors
      jobTime.value[item.typeName] = {};
      jobTime.value[item.typeName] = 0;
    }
    // add animal points to newObj for that animal type.
    jobTime.value[item.typeName] += item.jobTime
  })
  console.log("22",JSON.stringify(jobTime.value["请假"]))
}

// 通过输入日期,匹配当天的所有数据
// 入参格式 value:'2022-07-09'
function setDataList(value) {
  let object = {};
  const date = dateFormat("YYYY-mm-dd", value)
  dataList.datas.forEach((element) => {
    if (element.time == date) {
      object = element;
    }
  });
  return object;
}

function setYearMonth(now) {
  year.value = now.getFullYear();
  month.value = now.getMonth() + 1;
}

function preYear() {
  let n = now.value;
  let date = new Date(
      n.getFullYear() - 1,
      n.getMonth(),
      n.getDate(),
      n.getHours(),
      n.getMinutes(),
      n.getSeconds(),
      n.getMilliseconds()
  );

  setYearMonthInfos(date);
}

function preMonth() {
  let n = now.value;
  let date = new Date(
      n.getFullYear(),
      n.getMonth() - 1,
      n.getDate(),
      n.getHours(),
      n.getMinutes(),
      n.getSeconds(),
      n.getMilliseconds()
  );

  setYearMonthInfos(date);
}

function nextYear() {
  let n = now.value;
  let date = new Date(
      n.getFullYear() + 1,
      n.getMonth(),
      n.getDate(),
      n.getHours(),
      n.getMinutes(),
      n.getSeconds(),
      n.getMilliseconds()
  );

  setYearMonthInfos(date);
}

function nextMonth() {
  let n = now.value;
  let date = new Date(
      n.getFullYear(),
      n.getMonth() + 1,
      n.getDate(),
      n.getHours(),
      n.getMinutes(),
      n.getSeconds(),
      n.getMilliseconds()
  );

  setYearMonthInfos(date);
}

function setYearMonthInfos(date) {

  setYearMonth(date);
  generateMonth(date);
  now.value = date;
  dateChange();
}

function generateMonth(date) {
  date.setDate(1);
  // 星期 0 - 6, 星期天 - 星期6
  let weekStart = date.getDay();

  let endDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
  let dayEnd = endDate.getDate();
  // 星期 0 - 6, 星期天 - 星期6
  let weeEnd = endDate.getDay();

  let milsStart = date.getTime();
  let dayMils = 24 * 60 * 60 * 1000;
  let milsEnd = endDate.getTime() + dayMils;

  let monthDatas = [];
  let current;
  // 上个月的几天
  for (let i = 1; i < weekStart; i++) {
    current = new Date(milsStart - (weekStart - i) * dayMils);
    monthDatas.push({
      type: -1,
      date: current,
      fullYear: current.getFullYear(),
      month: current.getMonth() + 1,
      day: current.getDate(),
    });
  }
  // 当前月
  for (let i = 0; i < dayEnd; i++) {
    current = new Date(milsStart + i * dayMils);
    monthDatas.push({
      type: 0,
      date: current,
      fullYear: current.getFullYear(),
      month: current.getMonth() + 1,
      day: current.getDate(),
    });
  }
  // 下个月的几天
  for (let i = 0; i < 6 - weeEnd + 1; i++) {
    current = new Date(milsEnd + i * dayMils);
    monthDatas.push({
      type: 1,
      date: current,
      fullYear: current.getFullYear(),
      month: current.getMonth() + 1,
      day: current.getDate(),
    });
  }

  monthData.value = [];
  for (let i = 0; i < monthDatas.length; i++) {
    let mi = i % 7;
    if (mi == 0) {
      monthData.value.push([]);
    }
    monthData.value[Math.floor(i / 7)].push(monthDatas[i]);
  }

  // 少于6行,补足6行
  if (monthData.value.length <= 5) {
    milsStart = current.getTime();
    let lastLine = [];
    for (let i = 1; i <= 7; i++) {
      current = new Date(milsStart + i * dayMils);
      lastLine.push({
        type: 1,
        date: current,
        fullYear: current.getFullYear(),
        month: current.getMonth() + 1,
        day: current.getDate(),
      });
    }
    monthData.value.push(lastLine);
  }
  console.log("//", JSON.parse(JSON.stringify(monthData.value)))
}

function getCellColor(d) {
  if (
      d.fullYear == currentYear.value &&
      d.month == currentMonth.value &&
      d.day == currentDay.value
  ) {
    return "#409eff";
  }
  let color = d.type == -1 ? "#c0c4cc" : d.type == 1 ? "#c0c4cc  " : "";

  return color;
}

function mouseenter(d, event) {
  $emit("enter", event, d);
  // document.getElementsByClassName('cal_m_day_cell').style('background-color','#000000')
}

function mouseleave(d, event) {
  $emit("leave", event, d);
}

function dateChange() {
  let fullYear = now.value.getFullYear();

  let month = now.value.getMonth();
  let startDay = new Date(fullYear, month, 1);
  let endDay = new Date(fullYear, month + 1, 0, 23, 59, 59);
  $emit("changeMonth", startDay, endDay);
}

function dateFormat(fmt, date) {
  let ret;
  const opt = {
    "Y+": date.getFullYear().toString(),        // 年
    "m+": (date.getMonth() + 1).toString(),     // 月
    "d+": date.getDate().toString(),            // 日
    "H+": date.getHours().toString(),           // 时
    "M+": date.getMinutes().toString(),         // 分
    "S+": date.getSeconds().toString()          // 秒
    // 有其他格式化字符需求可以继续添加,必须转化成字符串
  };
  for (let k in opt) {
    ret = new RegExp("(" + k + ")").exec(fmt);
    if (ret) {
      fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
    }
    ;
  }
  ;
  return fmt;
}


</script>

<style scoped lang="scss">
.cal_con {
  box-sizing: border-box;
  width: 1020px; //下方单元格*7+左右内边距 140*7+20+20
  padding: 10px 20px 20px 20px;
  -webkit-user-select: none; //取消鼠标点快了文字会被选中。
  -moz-user-select: none; //取消鼠标点快了文字会被选中。
  -ms-user-select: none; //取消鼠标点快了文字会被选中。
  user-select: none; //取消鼠标点快了文字会被选中。
  color: #000000;
  box-shadow: 0 2px 12px 0 #0000006e;
  background: #ffffff;
  border-radius: 20px;

  .cal_header {
    width: 980px; //下方单元格*7 140*7
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .cal_header_left {
      display: flex;
      flex-direction: column;
      align-items: center;

      .cal_header_left_top {
        width: 122px;
        height: 30px;
        background: #109af9;
        display: flex;
        align-items: center;
        justify-content: center;

        .cal_h_time {
          font-family: "Microsoft YaHei";
          font-style: normal;
          font-weight: 400;
          font-size: 20px;
          color: #ffffff;
        }
      }

      .cal_header_left_bottom {
        width: 122px;
        height: 30px;
        background: rgba(16, 154, 249, 0.6);
        display: flex;
        align-items: center;
        justify-content: space-between;

        .cal_h_left {
          height: 100%;
          display: flex;

          .cal_h_btn {
            height: 100%;
            width: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
          }

          .cal_h_btn:hover {
            background-color: #109af9;
          }

          .cal_h_l_icon {
            height: 8px;
            width: 12px;
            margin: auto;
          }
        }

        .cal_h_center {
          .cal_h_time {
            font-family: "Microsoft YaHei";
            font-style: normal;
            font-weight: 400;
            font-size: 20px;
            color: #ffffff;
          }
        }

        .cal_h_right {
          height: 100%;
          display: flex;

          .cal_h_btn {
            height: 100%;
            width: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
          }

          .cal_h_btn:hover {
            background-color: #109af9;
          }

          .cal_h_l_icon {
            height: 8px;
            width: 12px;
            margin: auto;
          }
        }
      }
    }

    .cal_header_right {
      //   width: 1125px;
      height: 43px;
      font-family: "Microsoft YaHei";
      font-style: normal;
      font-weight: 400;
      font-size: 20px;
      line-height: 26px;
      display: flex;
      align-items: center;
      justify-content: center;

      .QingjiaText {
        color: rgba(255, 199, 0, 1);
        margin-left: 80px;
      }

      .JiaBanText {
        color: rgba(36, 0, 255, 1);
        margin-left: 80px;
      }

      .ChuCaiText {
        color: rgba(255, 167, 40, 1);
        margin-left: 80px;
      }

      .YiChangText {
        color: rgba(240, 92, 39, 1);
        margin-left: 80px;
      }
    }
  }

  .cal_month {
    // 日历表头 周日 周一 周二 周三 周四 周五 周六
    .cal_m_weeks {
      display: flex;

      .cal_m_weeks_cell {
        box-sizing: border-box;
        width: 140px;
        height: 30px;
        font-weight: 400;
        font-size: 16px;
        border: 1px solid #e4e7ed;
        display: flex;
        align-items: center;
        justify-content: center;
        color: rgba(0, 0, 0, 0.45);
      }
    }

    // 日历表内容
    .cal_m_days {
      // 第几行
      .cal_m_day_line {
        display: flex;
        // 每行内容
        .cal_m_day_cell {
          box-sizing: border-box;
          width: 140px;
          height: 120px;
          border: 1px solid #e4e7ed;

          .itemDay {
            width: 100%;
            height: 30px;
            font-style: normal;
            font-weight: 400;
            font-size: 24px;
            text-align: right;
            box-sizing: border-box;
            padding-right: 10px;
          }
        }

        // 每行内容-浮动效果
        .cal_m_day_cell:hover {
          color: #409eff;
        }
      }
    }
  }
}

// 正常卡
.ZhengChang {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(16, 154, 249, 0.2);
  color: rgba(16, 154, 249, 1);

  .ZhengChangTitle {
  }

  .ZhengChangDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: rgba(16, 154, 249, 1);
    }
  }
}

.ZhengChang:hover {
  transform: scale(1.1);
}

// 请假
.Qingjia {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(255, 199, 0, 0.2);
  color: rgba(255, 199, 0, 1);

  .QingjiaTitle {
  }

  .QingjiaDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: rgba(255, 199, 0, 1);
    }
  }
}

.Qingjia:hover {
  transform: scale(1.1);
}

// 加班
.JiaBan {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(36, 0, 255, 0.2);
  color: rgba(36, 0, 255, 1);

  .JiaBanTitle {
  }

  .JiaBanDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: rgba(36, 0, 255, 1);
    }
  }
}

.JiaBan:hover {
  transform: scale(1.1);
}

// 出差
.ChuChai {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(255, 167, 40, 0.2);
  color: #ffa728;

  .ChuChaiTitle {
  }

  .ChuChaiDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: #ffa728;
    }
  }
}

.ChuChai:hover {
  transform: scale(1.1);
}

// 异常卡
.YiChang {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(240, 92, 39, 0.2);
  color: rgba(240, 92, 39, 1);

  .YiChangTitle {
  }

  .YiChangDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: rgba(240, 92, 39, 1);
    }
  }
}

.YiChang:hover {
  transform: scale(1.1);
}

// 假期
.JiaQi {
  margin: 0px 0px 0px 8px;
  width: 120px;
  height: 35px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 10px;
  background: rgba(29, 209, 155, 0.2);
  color: rgba(29, 209, 155, 1);

  .JiaQiTitle {
  }

  .JiaQiDian {
    div {
      width: 4px;
      height: 4px;
      margin-bottom: 2px;
      border-radius: 4px;
      background: rgba(29, 209, 155, 1);
    }
  }
}

.JiaQi:hover {
  transform: scale(1.1);
}
</style>


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/186745.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

STL分析(十 hash、function type_traits、cout、move )

hash function 假定存在一个Customer类 class Customer{ public:string fname, lname;int no; };其哈希函数存在三种方式 //方式一&#xff1a;创建可调用类型 class CustomerHash { public:std::size_t operator()(const Customer& c) const{return ......} };unordere…

Android 签名基础知识

目录Android 为什么要签名keystore的生成&#xff1a;keystore信息的查看参数说明&#xff1a;Android 怎么签名使用 jarsigner 签名如何查找 jdk 位置签名时遇到的问题查看 apk 是否签名查看 Apk 的MD5值以及MD5不显示时的解决办法缺少 xx.RSA 文件的原因V1 vs V2Android 为什…

Coolify系列-解决局域网主机突然连不了虚拟机

开始之前&#xff0c;我们需要确保配置一切正常&#xff0c;原始配置参考下文 Coolify系列-手把手教学解决局域网局域网中的其他主机访问虚拟机以及docker服务 如果是之前已经配置好的&#xff0c;突然无法访问了&#xff0c;采取以下方式进行排查操作 在虚拟机执行 ifconf…

【GD32F427开发板试用】基于蓝牙的远程步进电机控制

本篇文章来自极术社区与兆易创新组织的GD32F427开发板评测活动&#xff0c;更多开发板试用活动请关注极术社区网站。作者&#xff1a;寒冰1988 一、前言 接上篇文章【GD32F427开发板试用】基于蓝牙模块的远程点灯演示&#xff0c;本篇是第二篇&#xff0c;基于调通的蓝牙模块添…

Pytest-Allure测试报告

Allure 模块下载 pip install allure-pytest包下载 https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/此处我选择下载最新的&#xff0c;版本上可以选择不是最新的&#xff0c;2.9.0的。下载zip或者tgz后缀格式的都可以。 配置环境变量 找到解压…

RPA自动办公01——Uibot的安装和基础用法

本期开始RPA的学习流程。 RPA是机器人自动化流程的简写&#xff0c;目的在于减少重复性的劳动&#xff0c;而且上手很简单&#xff0c;无需编程就能用。 本系列使用Uibot 软件&#xff0c;其下载地址在&#xff1a;来也科技流程创造者&#xff08;UiBot Creator&#xff09; …

searchableSelect 插件使用

<script type"text/javascript" src"//searchableSelect.js"></script> <script>function getUserServer() {var _this 自定义封装接口请求、弹窗等方法;_this.getAjax("get","//xxxxx/server", {}, function(res)…

前端异常监控平台Sentry安装配置使用及问题

前言&#xff1a;Sentry是一款开源的异常监控平台,支持各种语言的SDK&#xff0c;通过对应SDK可以收集错误信息和性能数据&#xff0c;并可以再后台web页面中查看相关信息。官方地址&#xff1a;安装说明&#xff1a;https://develop.sentry.dev/self-hosted/后台使用说明&…

1.1计算机组成结构:CPU组成、冯·诺依曼结构与哈佛结构、嵌入式芯片术语

1.1计算机组成结构&#xff1a;CPU组成、冯诺依曼结构与哈佛结构、嵌入式芯片术语计算机组成结构CPU组成运算器控制器冯诺依曼结构与哈佛结构冯诺依曼结构哈佛结构嵌入式——芯片术语计算机组成结构 CPU组成 CPU分成两个部分&#xff0c;包括运算器和控制器。 CPU是计算机中核…

Linux之环境搭建

目录 一、VMware 二、centos7的安装 三、Mysql安装 四、 前端项目部署 1.确保前台项目能用 2.将前台项目打包npm run build 3.做ip/host主机映射 4.完成Nginx动静分离的default.conf的相关配置 5.将前端构件号的dist项目&#xff0c;上传到云服务器/usr/local/... …

[Swift]SDK开发

本文主要介绍使用swift语言制作framework Demo:https://github.com/Gamin-fzym/CMSDK 一、创建工程 1.创建目录 这里我创建了一个“CMSDK”目录 2.打开Xcode新建workspace放入CMSDK目录 这里命名为“CMSDK” 3.打开CMSDK.xcworkspace新建SDK工程放入CMSDK目录 这里还是命…

06 CSS-盒子模型【尚硅谷JavaWeb教程】

06 CSS-盒子模型【尚硅谷JavaWeb教程】 JAVAWEB的学习笔记 学习视频来自&#xff1a;https://www.bilibili.com/video/BV1AS4y177xJ/?vd_source75dce036dc8244310435eaf03de4e330 不同的浏览器导致前端展示页面不一样&#xff0c;盒子的大小的不同。&#xff08;所以前端要考虑…

奇迹mu开服教程

奇迹mu开服教程&#xff1a;开服服务端的架设及开服注意事项服务器推荐奇迹开服需要准备什么&#xff1f;开服大概成本分析奇迹MU商业服务端版本&#xff1a;1.02W、1.03H、1.03K、S6EP3、S7EP2、S9EP2&#xff1b;HE网站系统&#xff1a;绑定域名授权&#xff0c;功能可定制&a…

Jenkins部署项目一(物理机器部署SpringBoot项目)

一、Jenkins部署SpringBoot项目 设备&#xff1a;MacOS 准备工作 1.已安装java开发工具包JDK 2.已安装依赖管理工具Maven 3.已安装代码版本控制工具Git 4.已安装Jenkins learn-moon代码地址&#xff1a;https://github.com/BillDavidup/learn-moon SSH: gitgithub.com:Bil…

【学Vue就跟玩一样】如何使用集中式状态管理的Vuex以及如何模块化编码+命名空间

1.vuex是什么一个专门在Vue中实现集中式状态管理的一个Vue插件,可以对vue应用中多个组件的共享状态进行集中式的管理(读取/写入)&#xff0c;也是一种组件间通信的方式&#xff0c;并且适用于任意组件间通信2.什么时候使用Vuex1.多个组件依赖于同一状态2.来自不同组件的行为需要…

Goland入门指南(使用Goland创建并运行项目)

在文章《Goland下载和安装》详细介绍了 Goland 的安装和破解&#xff0c;本节我们来介绍一下怎么使用 Goland 来创建并运行一个项目。 创建项目 首先&#xff0c;在“文件”菜单中找到“New”&#xff0c;并在下一级菜单中选择“Project”来创建一个新项目。 为项目选择一个…

【vim】C语言代码提示

前言 常见的C语言提示插件是YouCompleteMe&#xff0c;这个插件安装比较麻烦&#xff0c;在这推荐一款coc.nvim这个插件&#xff0c;github仓库地址&#xff1a;https://github.com/neoclide/coc.nvim/ 下面是安装步骤。 一、安装 nodejs 1、终端命令安装 curl -sL instal…

SpringMVC DispatcherServlet源码(2) 扫描Controller创建HandlerMapping流程

Spring MVC向容器注册一个RequestMappingInfoHandlerMapping组件&#xff0c;他会扫描容器中的Controller组件&#xff0c;创建RequestMappingInfo并注册HandlerMethod映射关系。 本文将阅读Spring MVC源码分析上述流程。 RequestMappingHandlerMapping组件 Creates Request…

java ssm校园兼职发布与互动平台的设计与实现

该系统基于B/S即所谓浏览器/服务器模式&#xff0c;应用JSP技术&#xff0c;选择MySQL作为后台数据库。系统主要包括个人中心、用户管理、企业管理、企业信息管理、兼职信息管理、职位申请管理、职位类型管理、交流中心、留言反馈、系统管理等功能模块。 使用校园兼职发布与互动…

JavaWeb:会话技术之Session

Cookie已经能完成一次会话多次请求之间的数据共享&#xff0c;之前我们还提到过Session也可以实现&#xff0c;那么&#xff1a; 什么是Session&#xff1f;Session如何来使用&#xff1f;Session是如何实现的&#xff1f;Session的使用注意事项有哪些&#xff1f; 1. Sessio…