Преглед изворни кода

驾驶舱组件页面中template和script位置更换

wyn пре 2 месеци
родитељ
комит
070954bc10

+ 5 - 5
src/views/UiCom/chartView.vue

@@ -1,9 +1,5 @@
-<template>
-  <Echart :options="chartOptions" />
-</template>
-
 <script setup lang="ts">
-import { ref, onMounted, watch } from 'vue'
+import { ref, onMounted } from 'vue'
 import * as Home from '@/api/home'
 import type { Ref } from 'vue'
 
@@ -100,3 +96,7 @@ onMounted(() => {
   fetchChartData()
 })
 </script>
+
+<template>
+  <Echart :options="chartOptions" />
+</template>

+ 16 - 16
src/views/UiCom/doingJob.vue

@@ -1,19 +1,3 @@
-<template>
-  <div class="content">
-    <el-table :data="tableData" border style="width: 100%">
-      <el-table-column prop="ticketName" label="作业名称" min-width="400" />
-      <el-table-column prop="workstationName" label="岗位" min-width="150" />
-      <el-table-column prop="machineryName" label="设备工艺" min-width="200" />
-      <el-table-column label="作业类型" prop="ticketType" min-width="150">
-        <template #default="scope">
-          <dict-tag :type="DICT_TYPE.TICKET_TYPE" :value="scope.row.ticketType" />
-        </template>
-      </el-table-column>
-      <el-table-column prop="ticketStartTime" label="作业开始时间" width="290" />
-    </el-table>
-  </div>
-</template>
-
 <script setup lang="ts">
 import {DICT_TYPE} from "@/utils/dict";
 import * as Home from "@/api/home";
@@ -31,6 +15,22 @@ const getJobDate = async () => {
 }
 </script>
 
+<template>
+  <div class="content">
+    <el-table :data="tableData" border style="width: 100%">
+      <el-table-column prop="ticketName" label="作业名称" min-width="400" />
+      <el-table-column prop="workstationName" label="岗位" min-width="150" />
+      <el-table-column prop="machineryName" label="设备工艺" min-width="200" />
+      <el-table-column label="作业类型" prop="ticketType" min-width="150">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.TICKET_TYPE" :value="scope.row.ticketType" />
+        </template>
+      </el-table-column>
+      <el-table-column prop="ticketStartTime" label="作业开始时间" width="290" />
+    </el-table>
+  </div>
+</template>
+
 <style scoped lang="scss">
 
 .content {

+ 12 - 12
src/views/UiCom/myTodo.vue

@@ -1,15 +1,3 @@
-<template>
-  <div class="container" @click="handleNewPageJump">
-    <section class="lefticon">
-      <img src="../../assets/images/topTodo.png" alt=""/>
-    </section>
-    <section class="righticon">
-      <p>{{ t('workplace.todoMessage') }}</p>
-      <span>{{documentTodos}}</span>
-    </section>
-  </div>
-</template>
-
 <script setup lang="ts">
 import * as Agent from '@/api/system/notify/agent'
 
@@ -42,6 +30,18 @@ const handleNewPageJump = () => {
 
 </script>
 
+<template>
+  <div class="container" @click="handleNewPageJump">
+    <section class="lefticon">
+      <img src="../../assets/images/topTodo.png" alt=""/>
+    </section>
+    <section class="righticon">
+      <p>{{ t('workplace.todoMessage') }}</p>
+      <span>{{documentTodos}}</span>
+    </section>
+  </div>
+</template>
+
 <style scoped lang="scss">
 .container{
   width: 320px;

+ 15 - 15
src/views/UiCom/unreadMessage.vue

@@ -1,18 +1,3 @@
-<template>
-  <div class="container" @click="handleNewPageJump">
-    <section class="lefticon">
-      <el-icon class="iconmessage">
-        <Message />
-      </el-icon>
-<!--      <img src="../../assets/images/topTodo.png" alt=""/>-->
-    </section>
-    <section class="righticon">
-      <p>{{ t('workplace.unreadMessage') }}</p>
-      <span>{{documentTodos}}</span>
-    </section>
-  </div>
-</template>
-
 <script setup lang="ts">
 import * as Agent from '@/api/system/notify/agent'
 import { Message} from '@element-plus/icons-vue'
@@ -46,6 +31,21 @@ const handleNewPageJump = () => {
 
 </script>
 
+<template>
+  <div class="container" @click="handleNewPageJump">
+    <section class="lefticon">
+      <el-icon class="iconmessage">
+        <Message />
+      </el-icon>
+    </section>
+    <section class="righticon">
+      <p>{{ t('workplace.unreadMessage') }}</p>
+      <span>{{documentTodos}}</span>
+    </section>
+  </div>
+</template>
+
+
 <style scoped lang="scss">
 .container{
   width: 320px;

+ 16 - 17
src/views/UiCom/welcomeBar.vue

@@ -1,20 +1,3 @@
-<template>
-<!--  <div>呼呼呼呼</div>-->
-  <div class="flex items-center">
-    <el-avatar :src="avatar" :size="70" class="mr-16px">
-      <img src="../../assets/imgs/avatar.gif" alt="" />
-    </el-avatar>
-    <div>
-      <div class="text-20px">
-        {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
-      </div>
-      <div class="mt-10px text-14px text-gray-500">
-        {{ todayStr }}
-      </div>
-    </div>
-  </div>
-</template>
-
 <script setup lang="ts">
 import {useUserStore} from "@/store/modules/user";
 import { ref } from "vue"
@@ -39,8 +22,24 @@ const getToday = () => {
 }
 
 const todayStr = ref(getToday())
+
 </script>
 
+<template>
+  <div class="flex items-center">
+    <el-avatar :src="avatar" :size="70" class="mr-16px">
+      <img src="../../assets/imgs/avatar.gif" alt="" />
+    </el-avatar>
+    <div>
+      <div class="text-20px">
+        {{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }}
+      </div>
+      <div class="mt-10px text-14px text-gray-500">
+        {{ todayStr }}
+      </div>
+    </div>
+  </div>
+</template>
 
 <style scoped lang="scss">
 .items-center{