123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <template>
- <div>
- <div class="bigBox">
- <!-- 点击开始检测盒子 -->
- <div class="startBox">
- <p class="nowIn">{{ nowRunList.name ? nowRunList.name : "暂无待检测任务" }}</p>
- <p class="createDate">创建日期:{{ nowRunList.ct ? nowRunList.ct : "暂无时间" }}</p>
- <img src="../../../assets/image/start_btn.png" alt="" style="cursor: pointer;" @click="startNow(nowRunList)" />
- <p class="nowModel">
- 当前模型:<em class="nowEm">{{ nowRunList.voltage_name ? nowRunList.voltage_name + '线路保护' : "暂无数据" }}<img
- v-if="nowRunList.voltage_name" src="../../../assets/icon/pencil.png" alt="" /></em>
- </p>
- </div>
- <!-- 待检测任务 -->
- <div class="noReportBox">
- <div>
- <p class="norep">待检测任务</p>
- </div>
- <div style="display: flex;justify-content: flex-start;align-items: center;overflow-x: auto;">
- <div :class="setImg(nowRunList)" v-if="nowRunList.name">
- <div class="intBoxOne">
- <p class="intOne">
- <span style="font-size: 18px;color: white;">{{ nowRunList.name }}</span>
- <span style="font-size: 12px;" @click="editItem(nowRunList)">编辑</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/white_flash.png" alt="" />
- <span style="font-size: 12px;color:white" class="commonSpan">{{ nowRunList.station_name }}</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/white_clock.png" alt="" />
- <span style="font-size: 12px;color:white" class="commonSpan">{{ nowRunList.ct }}</span>
- </p>
- </div>
- <!-- 点击检测 -->
- <div class="setNow">
- <span style="font-size: 16px;color:white" class="setnowspan" @click="startNow(nowRunList)">检测中<em
- v-loading="emLoading"></em></span>
- </div>
- </div>
- <div class="intBox" v-for="(item, index) in misList" :style="setImg(item, index)">
- <div class="intBoxOne">
- <p class="intOne">
- <span style="font-size: 18px;color: #1A2447;">{{ item.name }}</span>
- <span style="font-size: 12px;cursor: pointer;" @click="editItem(item, index)">编辑</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/flash_darkBlue.png" alt="" />
- <span style="font-size: 12px;color:#7484AB" class="commonSpan">{{ item.station_name }}</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/clock_darkBlue.png" alt="" />
- <span style="font-size: 12px;color:#7484AB" class="commonSpan">{{ item.ut }}</span>
- </p>
- </div>
- <!-- 点击检测 -->
- <div class="setNow">
- <span style="font-size: 16px;color:blue" class="setnowspan" @click="startNow(item, index)">立即检测</span>
- </div>
- </div>
- </div>
- </div>
- <!-- 已完成 -->
- <div class="noReportBox">
- <div>
- <p class="norep">最近检测任务-已完成</p>
- </div>
- <div style="display: flex;justify-content: flex-start;align-items: center;overflow-x: auto;">
- <div class="intBox" v-for="(item, index) in passList">
- <div class="intBoxOne">
- <p class="intOne">
- <span>{{ item.name }}</span>
- <span>详情→</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/flash_darkBlue.png" alt="" />
- <span style="font-size: 12px;color:#7484AB" class="commonSpan">{{ item.station_name }}</span>
- </p>
- <p>
- <img style="width: 15px;height: 15px;" src="../../../assets/icon/clock_darkBlue.png" alt="" />
- <span style="font-size: 12px;color:#7484AB" class="commonSpan">{{ item.ct }}</span>
- </p>
- </div>
- <!-- 点击检测 -->
- <div class="setNow">
- <span style="color: #255CE7;" class="setnowspan" @click="goNetStructPicture(item)">scd可视化</span>
- <span style="margin: 0 10px;color: #7484AB;" class="setnowspan">|</span>
- <span style="color: #255CE7;" class="setnowspan">检测结果</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { ref, onMounted, computed, toRefs } from "vue";
- import { useRouter } from "vue-router";
- import task from "@/api/task"
- import imgs from "../jscom/img";
- import { ElLoading, ElMessage } from "element-plus";
- export default {
- setup(props, { emit }) {
- let imgBack = ref("@/assets/image/card_blue.png");
- let router = useRouter();
- let sizeNum = ref(1);
- let misList = ref([])//待检测任务列表
- let nowRunList = ref({})//正在检测任务列表
- let passList = ref([])//已完成检测任务列表
- let emLoading = ref(true)
- function scdLink() {
- router.push("/home/scdMap");
- }
- function startNow(row, num) {
- if (row.name == null || row.name == '' || row.name == undefined) {
- ElMessage({
- message: "暂无检测任务",
- type: "info"
- })
- } else {
- sizeNum.value = 1;
- emit("hmBack", sizeNum.value, row);
- }
- }
- function goNetStructPicture(row) {
- console.log(row, 'push');
- router.push({
- path: "/home/netStructPicture",
- query: {
- id: row.scd_id,
- name: row.name,
- station:row.station_id,
- },
- });
- }
- function getList() {
- const loading = ElLoading.service({
- lock: true,
- text: '正在查询数据',
- background: 'rgba(0, 0, 0, 0.7)',
- })
- // 0为待检测
- task.getTask({ pageno: 1, pagesize: 10, state: 0 }).then(res => {
- if (res.data == null) {
- loading.close()
- misList.value = []
- return
- } else {
- const sortedList = res.data.sort((a, b) => {
- // 将 state 为 0 的对象排在前面
- if (a.state === 1 && b.state !== 1) {
- return -1; // a排在b前面
- } else if (a.state !== 1 && b.state === 1) {
- return 1; // b排在a前面
- } else {
- return 0; // 不需要交换位置
- }
- });
- misList.value = sortedList;
- emit("haveBack", misList.value);
- loading.close()
- }
- })
- // 2为完成检测
- task.getTask({ pageno: 1, pagesize: 10, state: 2 }).then(res => {
- if (res.data == null) {
- passList.value = []
- return
- } else {
- passList.value = res.data
- }
- })
- // 1为正在检测
- task.getTask({ pageno: 1, pagesize: 10, state: 1 }).then(res => {
- if (res.data == null) {
- nowRunList.value = {}
- return
- } else {
- nowRunList.value = res.data[0]
- }
- })
- }
- function editItem(row) {
- emit("haveInCreate", 1, row, 2)
- }
- function setImg(row, num) {
- if (row.state == "1") {
- return "intBoxCopy"
- } else {
- return "intBox"
- }
- }
- onMounted(() => {
- getList()
- })
- return {
- imgBack,
- scdLink,
- startNow,
- sizeNum,
- goNetStructPicture,
- getList,
- misList,//待检测任务列表
- editItem,
- nowRunList,//正在检测任务列表
- setImg,
- passList,//已完成列表
- emLoading,
- };
- },
- components: {
- }
- };
- </script>
- <style scoped>
- @import url('https://fonts.font.im/css?family=Montserrat');
- p {
- margin: 0;
- padding: 0;
- font-family: 'Montserrat', sans-serif;
- }
- .bigBox {
- width: 99%;
- height: 100%;
- /* border: 1px solid saddlebrown; */
- }
- .startBox {
- width: 320px;
- height: 335px;
- margin: 0 auto;
- /* border: 1px solid black; */
- text-align: center;
- line-height: 25px;
- }
- .nowIn {
- /* width: 180px;
- height: 28px; */
- font-size: 20px;
- font-family: Source Han Sans CN-Bold, Source Han Sans CN;
- font-weight: bold;
- color: #1a2447;
- /* line-height: 28px; */
- }
- .createDate {
- /* width: 168px;
- height: 22px; */
- font-size: 16px;
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
- font-weight: 400;
- color: #7484ab;
- /* line-height: 22px; */
- }
- .nowModel {
- font-size: 18px;
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
- font-weight: 400;
- color: #1a2447;
- }
- .nowEm {
- font-style: normal;
- font-size: 18px;
- font-family: Source Han Sans CN-Medium, Source Han Sans CN;
- font-weight: 500;
- color: #255ce7;
- line-height: 24px;
- border-bottom: 1px solid #255ce7;
- }
- .noReportBox {
- width: 99%;
- height: 100%;
- margin-left: 8px;
- /* border: 1px solid salmon; */
- }
- .norep {
- font-size: 16px;
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
- font-weight: 400;
- color: #7484ab;
- }
- .intBox {
- width: 269px;
- height: 116px;
- line-height: 20px;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- margin: 15px 15px;
- /* border: 1px solid #255ce7; */
- background-color: #F6F9FF;
- border-radius: 5px;
- box-shadow: inset 0px -3px 3px 0px #C8D4EC;
- /* border: 1px solid brown; */
- /* background-image: url(../../../assets/image/card_blue.png); */
- }
- .intBoxCopy {
- width: 269px;
- height: 116px;
- line-height: 20px;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- margin: 15px 15px;
- background-color: #F6F9FF;
- border-radius: 5px;
- box-shadow: inset 0px -3px 3px 0px #C8D4EC;
- background-image: url(../../../assets/image/card_blue.png);
- }
- .intBoxOne {
- padding-top: 5px;
- }
- .intOne {
- position: relative;
- }
- .intOne span:nth-child(2) {
- /* margin-left: 70px; */
- font-size: 14px;
- position: absolute;
- top: 0px;
- right: 10px;
- }
- .intOne span:nth-child(1) {
- margin-left: 5px;
- font-size: 18px;
- }
- .commonSpan {
- font-size: 14px;
- }
- .setNow {
- text-align: center;
- margin-top: 10px;
- }
- .setnowspan {
- font-size: 17px;
- cursor: pointer;
- }
- :deep(.el-loading-spinner .circular) {
- width: 16px;
- }
- :deep(.el-loading-spinner .path) {
- stroke: #ffffff;
- }
- </style>
|