123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455 |
- <template>
- <van-nav-bar title="标题" left-arrow />
- <van-pull-refresh v-model="loading" @refresh="onRefresh">
- <div class="warpKnitting">
- <div class="stat">
- <div class="title">
- <span>设备状态</span>
- <div class="type">运行</div>
- </div>
- <ul>
- <li>
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text">EBC</div>
- <div class="btn">运行</div>
- </li>
- <li>
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text">EBC</div>
- <div class="btn">运行</div>
- </li>
- <li>
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text">EBC</div>
- <div class="btn">运行</div>
- </li>
- </ul>
- </div>
- <div class="speed">
- <div style="display: flex">
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text">主轴转速</div>
- </div>
- <div class="num">400 RPM</div>
- </div>
- <div class="commons-title">产量数据</div>
- <div class="chart-warp">
- <div class="chart-box" id="myCharts" ref="myCharts"></div>
- <div class="label-box">
-
- </div>
- </div>
- <div class="commons-title">EBC</div>
- <ul class="buchang">
- <li>
- <div class="icon">
- <van-icon size="20px" name="location-o" />
- </div>
- <div class="text">当前布长</div>
- <div class="btn">200M</div>
- </li>
- <li>
- <div class="icon">
- <van-icon size="20px" name="location-o" />
- </div>
- <div class="text">设定布长</div>
- <div class="btn">300M</div>
- </li>
- <li>
- <div class="icon">
- <van-icon size="20px" name="location-o" />
- </div>
- <div class="text">密度</div>
- <div class="btn">50</div>
- </li>
- </ul>
- <ul class="qianla">
- <li>
- <div class="icon">
- <van-icon size="20px" name="location-o" />
- </div>
- <div class="text">牵拉</div>
- </li>
- <li>
- <div class="icon">
- <van-icon size="20px" name="location-o" />
- </div>
- <div class="text">卷曲</div>
- </li>
- </ul>
- <ul class="songjin">
- <li>
- <div style="display: flex">
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text" style="margin-left: 8px">
- 主轴转速
- </div>
- </div>
- <div class="num">
- <p>剩余圈数: <span>35 N</span></p>
- <p>剩余圈数: <span>35 N</span></p>
- </div>
- </li>
- <li>
- <div style="display: flex">
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text" style="margin-left: 8px">
- 主轴转速
- </div>
- </div>
- <div class="num">
- <p>剩余圈数: <span>35 N</span></p>
- <p>剩余圈数: <span>35 N</span></p>
- </div>
- </li>
- <li>
- <div style="display: flex">
- <div class="icon">
- <van-icon name="location-o" />
- </div>
- <div class="text" style="margin-left: 8px">
- 主轴转速
- </div>
- </div>
- <div class="num">
- <p>剩余圈数: <span>35 N</span></p>
- <p>剩余圈数: <span>35 N</span></p>
- </div>
- </li>
- </ul>
- </div>
- </van-pull-refresh>
- </template>
- <script setup>
- import * as echarts from 'echarts'
- import { ref, onMounted,getCurrentInstance } from 'vue'
- import { useRouter } from 'vue-router'
- const proxy = getCurrentInstance().proxy
- const loading = ref(false)
- const onRefresh = () => {
- setTimeout(() => {
- loading.value = false
- }, 500)
- }
- const router = useRouter()
- const getDtl = () => {
- proxy.post('/tdaDevice/data', { deviceId: router.currentRoute.value.params.id }).then(
- (res) => {
- console.log(res)
- }
- )
-
- }
- getDtl()
- onMounted(() => {
- const myChart = echarts.init(document.getElementById('myCharts'))
- const option = {
- grid: {
- top: '8%',
- left: '4%',
- right: '8%',
- bottom: '8%',
- containLabel: true,
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- label: {
- backgroundColor: '#6a7985',
- },
-
- },
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: ['0', '1', '2', '3', '4', '5', '6'],
- },
- yAxis: {
- type: 'value',
- },
- series: [
- {
- data: [135, 135, 122, 211, 345, 567, 654],
- type: 'line',
-
- symbolSize: 10,
- showSymbol: false,
- areaStyle: {
- opacity: 0,
- },
- stack: 'Total',
- smooth: true,
- lineStyle: {
- normal: {
- color: '#0084FF',
- width: 4,
- },
- },
- },
- {
- data: [150, 150, 150, 150, 150, 150, 150],
- type: 'line',
-
- symbolSize: 10,
- showSymbol: false,
- areaStyle: {
- opacity: 0,
- },
- lineStyle: {
- normal: {
- color: '#FF8C33',
- width: 4,
- },
- },
- },
- ],
- }
- myChart.setOption(option)
- })
- </script>
- <style lang="scss" scoped>
- .warpKnitting {
- padding: 0 12px 80px;
- .chart-warp{
- background: #fff;
- .chart-box {
- height: 250px;
-
- }
- }
-
- .songjin {
- li {
- height: 74px;
- background: #ffffff;
- border-radius: 5px 5px 5px 5px;
- line-height: 50px;
- display: flex;
- justify-content: space-between;
- margin-top: 12px;
- padding: 12px;
- box-sizing: border-box;
- font-size: 14px;
- .icon {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- background: #eeeeee;
- text-align: center;
- .van-icon {
- color: #0084ff;
- }
- }
- .num {
- margin-left: 8px;
- font-size: 14px;
- font-weight: 500;
- color: #333;
- p {
- margin: 0;
- line-height: 25px;
- color: #999999;
- }
- span {
- color: #333333;
- }
- }
- }
- }
- .qianla {
- display: flex;
- justify-content: space-between;
- margin-top: 12px;
- li {
- display: flex;
- width: 49%;
- line-height: 50px;
- padding: 12px;
- box-sizing: border-box;
- font-size: 14px;
- background: #ffffff;
- border-radius: 5px 5px 5px 5px;
- .icon {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- background: #eeeeee;
- text-align: center;
- .van-icon {
- color: #0084ff;
- }
- }
- .text {
- margin-left: 8px;
- font-size: 14px;
- font-weight: 500;
- color: #333;
- }
- }
- }
- .buchang {
- display: flex;
- justify-content: space-between;
- text-align: center;
- li {
- width: 32%;
- background: #ffffff;
- border-radius: 5px 5px 5px 5px;
- line-height: 50px;
- padding: 12px;
- box-sizing: border-box;
- font-size: 14px;
- .icon {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- background: #eeeeee;
- display: flex;
- justify-content: center;
- align-items: center;
- margin: 0 auto;
- .van-icon {
- color: #0084ff;
- }
- }
- .btn {
- font-size: 16px;
- font-weight: bold;
- line-height: 20px;
- }
- .text {
- line-height: 20px;
- margin: 12px 0 8px;
- }
- }
- }
- .speed {
- height: 74px;
- background: #ffffff;
- border-radius: 5px 5px 5px 5px;
- line-height: 50px;
- display: flex;
- justify-content: space-between;
- margin-top: 12px;
- padding: 12px;
- box-sizing: border-box;
- font-size: 14px;
- .icon {
- width: 50px;
- height: 50px;
- border-radius: 15px;
- background: #00b0ff;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-right: 12px;
- .van-icon {
- color: #fff;
- }
- }
- .num {
- font-size: 16px;
- font-weight: bold;
- }
- }
- .stat {
- background: #ffffff;
- border-radius: 5px 5px 5px 5px;
- margin-top: 12px;
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 48px;
- line-height: 48px;
- padding: 0 12px;
- border-bottom: 1px solid #dddddd;
- .type {
- color: #00b0ff;
- font-size: 14px;
- width: 60px;
- height: 24px;
- background: #f1f1f1;
- color: #3fbf31;
- line-height: 24px;
- position: relative;
- border-radius: 12px 12px 12px 12px;
- padding-left: 20px;
- box-sizing: border-box;
- }
- .type:before {
- content: '';
- position: absolute;
- left: 6px;
- top: 6px;
- width: 12px;
- height: 12px;
- background: #3fbf31;
- border-radius: 50%;
- }
- }
- ul {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20px 30px 22px;
- box-sizing: border-box;
- li {
- display: flex;
- flex-direction: column;
- align-items: center;
- .icon {
- width: 50px;
- height: 50px;
- border-radius: 15px;
- background: #00b0ff;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-bottom: 12px;
- .van-icon {
- color: #fff;
- }
- }
- .text {
- color: #333;
- font-size: 14px;
- }
- .btn {
- width: 60px;
- height: 24px;
- background: #f1f1f1;
- border-radius: 12px 12px 12px 12px;
- margin-top: 8px;
- text-align: center;
- line-height: 24px;
- font-weight: 500;
- font-size: 14px;
- color: #3fbf31;
- }
- }
- }
- }
- }
- </style>
|