<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      父組件代碼:

      <template>
        <!-- 創(chuàng)建 -->
        <div class="resource-warp-box">
          <div class="center-box">
            <div class="used-source">
              <pageTitle title="已用資源" />
              <div class="progress-box">
                <div
                  v-for="(item, index) in quotaList"
                  :key="index"
                  class="progress-content"
                >
                  <circle-progress :percent="item.proportionNum" :strokeStyle="item.color" :id="index" />
                  <div class="title">{{ item.title }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </template>
      <script>
      import CircleProgress from './components/circleProgress.vue';
      export default {
        components: {
          CircleProgress
        },
        data() {
          return {
            quotaList: [
              {
                title: "CPU",
                color: "#1161E4",
                proportionNum: 33
              },
              {
                title: "GPU",
                color: "#5860F0",
                proportionNum: 50
              },
              {
                title: "內(nèi)存",
                color: "#09D99F",
                proportionNum: 80
              }
            ],
          };
        },
        mounted() {
         
        },
        methods: {
         
        }
      };
      </script>
      <style lang="scss" scoped>
      .center-box {
          display: flex;
          margin-top: 12px;
          .used-source {
            background-color: #ffffff;
            width: 50%;
            height: 294px;
            border-radius: 6px;
            .progress-box {
              display: flex;
              margin-top: 45px;
              .progress-content {
                width: 33.3333%;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                .title {
                  margin-top: 28px;
                  font-weight: 400;
                  font-size: 16px;
                  color: #333333;
                }
              }
            }
          }
      }
      </style>
       
      子組件CircleProgress 代碼:
       
      <template>
        <div class="canvas">
          <canvas :id="id" width="220" height="220" style="width:110px;height:110px;"></canvas>
        </div>
      </template>

      <script>
      export default {
        data () {
          return {
            num:0,
            canvas: '',
            context: '',
            cirX: '',
            cirY: '',
            rad: '',
            n: 0,
            speed: 450,
            r: 49
          }
        },
        props:[
          'percent', // 進(jìn)度條值
          'strokeStyle', // 進(jìn)度條值背景顏色
          'id'
        ],
        mounted () {
          this.canvas = document.getElementById(this.id)
          this.context = this.canvas.getContext("2d")
          this.context.scale(2,2);
          this.cirX = 55,//this.canvas.width/ 2
          this.cirY = 55,//this.canvas.height/ 2
          this.rad = Math.PI * 2 / 100
          this.DreamLoading()
        },
        created () {
        },
        methods:{
          //繪制最外層細(xì)圈
          writeCircle(){
              this.context.save(); //save和restore可以保證樣式屬性只運(yùn)用于該段canvas元素
              this.context.beginPath(); //開始路徑
              this.context.strokeStyle = '#f5f8fc'; //設(shè)置邊線的顏色
              this.context.lineWidth = 12;
              this.context.arc(this.cirX, this.cirY, this.r, 0, Math.PI * 2, false); //畫一個圓的路徑
              this.context.stroke(); //繪制邊線
              this.context.closePath();
          },
          //繪制文本
          writeText(n){
              this.context.save();
              this.context.font = "14px MicrosoftYaHei";
              this.context.fillStyle="#333333"; //字體顏色       
              this.context.fillText(n.toFixed(0) + "%", Number(n.toFixed(0)) === 100 ? this.cirX - 16 : this.cirX - 10, this.cirY + 6); //繪制實心
              //context.strokeStyle = "#49f";
              // context.strokeText(n.toFixed(0)+"%",cirX - 30 ,cirY +10); //繪制空心
              this.context.stroke();
              this.context.restore();
          },
          //繪制藍(lán)色外圈
          writeBlue(n){
              this.context.save();
              this.context.strokeStyle = this.strokeStyle;
              this.context.lineWidth = 12;
              this.context.lineCap = 'round';
              this.context.beginPath();
              this.context.arc(this.cirX, this.cirY, this.r, -Math.PI/2,-Math.PI/2+ this.rad * n, false);
              this.context.stroke();
              this.context.restore();
          },
          DreamLoading(){
              //清除所有,重新繪制
              this.context.clearRect(0,0,this.canvas.width,this.canvas.height)
              this.writeCircle();
              this.writeText(this.n);
              this.writeBlue(this.n)
              if(this.n <= this.percent){
                  this.n = this.n + 0.4;
              }else {
                return this.n = 0;
              }
              requestAnimationFrame(this.DreamLoading);
          }
        }
      }
      </script>
      <style scoped>
      .canvas {
          width: 110px;
          height: 110px;
      }
      </style>
      posted on 2024-07-03 11:13  Nymph_Zhu  閱讀(163)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 最新亚洲av日韩av二区| 亚洲午夜福利精品一二飞| 99热精国产这里只有精品| 亚洲色欲在线播放一区二区三区 | 久久久久青草线蕉亚洲| 无码日韩人妻精品久久| 99久久免费精品色老| 亚洲午夜精品国产电影在线观看| 亚洲精品中文字幕无码蜜桃 | 久久婷婷大香萑太香蕉AV人| 亚洲AV日韩精品久久久久| 欧美日韩中文字幕视频不卡一二区 | 二区中文字幕在线观看| 好日子在线观看视频大全免费动漫| 国产美女直播亚洲一区色| 精品国产乱来一区二区三区| 国内精品视频一区二区三区八戒| 精品国偷自产在线视频99| 国内久久人妻风流av免费| 国产精品女人毛片在线看| 搡老熟女老女人一区二区| 囯产精品久久久久久久久久妞妞| 97色成人综合网站| 国产成人综合久久精品下载| 99热这里只有精品免费播放| 亚洲18禁一区二区三区| 国产精品线在线精品国语| 中国女人内谢69xxxx| 欧美成年黄网站色视频| 爱性久久久久久久久 | 国产精品激情| 欧美亚洲综合久久偷偷人人| 亚洲愉拍一区二区三区| 四虎国产精品永久在线| 一级国产在线观看高清| 在线A级毛片无码免费真人| 久久国产乱子伦免费精品无码| 亚洲av尤物一区二区| 国产乱码精品一区二区三| 人妻无码中文专区久久app| 亚洲无人区一区二区三区|