pengwei
2025-03-27 1288a7890deb3b180b1e8df7015b1036514c4e71
ÏîÄ¿´úÂë/client/src/views/tts/DataLogging/Datalogging.vue
@@ -1,7 +1,10 @@
<template>
  <div class="Datalogging">
    <div class="content">
      <div class="checkbox">
      <div
        class="checkbox"
        :style="{ width: roleINFO == 1 ? '16rem' : '11rem' }"
      >
        <div
          :class="['item', isactive == 1 ? 'isactive' : '']"
          @click="changeactive(1)"
@@ -15,6 +18,7 @@
          ä½œä¸šå•记录
        </div>
        <div
          v-if="roleINFO == 1"
          :class="['item', isactive == 3 ? 'isactive' : '']"
          @click="changeactive(3)"
        >
@@ -59,7 +63,7 @@
            size="small"
          />
        </div>
        <!-- <div class="serch_box">
        <div class="serch_box">
          <div class="serchb">
            <el-select
              v-model="queryForm.selectType"
@@ -80,7 +84,7 @@
            placeholder="请输入关键词搜索"
            style="border-left: 0.06rem solid #e2e2e2"
          />
        </div> -->
        </div>
        <el-button
          @click="handleQuery"
          type="primary"
@@ -105,6 +109,7 @@
      <div style="margin-top: 1rem; height: 100%">
        <!-- ä»»åŠ¡è®°å½• -->
        <el-table
          empty-text="暂无数据"
          v-if="isactive == 1"
          :data="tableData"
          height="450"
@@ -170,6 +175,7 @@
        <!-- ä½œä¸šå•记录 -->
        <el-table
          empty-text="暂无数据"
          v-if="isactive == 2"
          :data="tableData"
          height="450"
@@ -228,6 +234,7 @@
        <!-- ç™»å½•记录 -->
        <el-table
          empty-text="暂无数据"
          v-if="isactive == 3"
          :data="tableData"
          height="450"
@@ -249,7 +256,7 @@
          <el-table-column prop="account" label="登录账号" align="center" />
          <el-table-column prop="trurName" label="真实姓名" align="center" />
          <el-table-column prop="logIP" label="登录IP" align="center" />
          <el-table-column prop="createdate" label="登录时间" align="center" />
          <el-table-column prop="createDate" label="登录时间" align="center" />
        </el-table>
      </div>
      <div
@@ -846,7 +853,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >任务名称:</span
              ><span>{{ pesonData[0].takename }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].takename : ""
              }}</span>
            </div>
            <div
              style="
@@ -858,7 +867,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >技术员:</span
              ><span>{{ pesonData[0].jishuyuan }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].jishuyuan : ""
              }}</span>
            </div>
            <div
              style="
@@ -870,7 +881,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >检修工长:</span
              ><span>{{ pesonData[0].gonzhang }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].gonzhang : ""
              }}</span>
            </div>
            <div
              style="
@@ -882,7 +895,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >质检员:</span
              ><span>{{ pesonData[0].zhijianyuan }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].zhijianyuan : ""
              }}</span>
            </div>
            <div
              style="
@@ -894,7 +909,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >力矩作业员:</span
              ><span>{{ pesonData[0].lijuzouyeyuan }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].lijuzouyeyuan : ""
              }}</span>
            </div>
            <div
              style="
@@ -906,7 +923,9 @@
            >
              <span style="width: 6rem; text-align: right; display: block"
                >辅助员:</span
              ><span>{{ pesonData[0].fuzyuan }}</span>
              ><span>{{
                pesonData.length != 0 ? pesonData[0].fuzyuan : ""
              }}</span>
            </div>
            <div
              style="
@@ -985,7 +1004,7 @@
  </div>
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, toRef } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { formatTime } from "@/utils/index.js";
import {
@@ -1000,6 +1019,7 @@
  ExportApi2,
  ExportApi3,
} from "@/api/newapi/Datalogging";
import { login } from "@/api/login";
const obj = {
  selectName: "",
  selectTime: [], // æ—¶é—´èŒƒå›´
@@ -1007,13 +1027,7 @@
  selectInput: "",
  value: "",
};
const queryForm = ref({
  selectName: "",
  selectTime: [], // æ—¶é—´èŒƒå›´
  selectType: "",
  selectInput: "",
  value: "",
});
const queryForm = toRef({ ...obj });
const tableData = ref([]);
const options = ref([
@@ -1028,7 +1042,6 @@
]);
const props = { multiple: true };
const table = ref(false);
const form = reactive({});
const isactive = ref(1);
const claimdialogVisible = ref(false);
@@ -1042,7 +1055,7 @@
  page: 1, //当前页面
  rows: 10, //每页显示条数
  order: "desc", //排序方式
  sort: "createTime", //排序字段
  sort: "", //排序字段
  wheres: "", //条件查询
});
const datildata = ref({});
@@ -1092,17 +1105,6 @@
  },
];
const selectoptions = ref([]);
// æŸ¥è¯¢
const query = () => {
  if (isactive.value == 1) {
    initData();
  } else if (isactive.value == 2) {
    WorkinitData();
  } else {
    LogininitData();
  }
};
selectoptions.value = tasklogging;
const changeactive = (index) => {
@@ -1172,6 +1174,8 @@
    ],
  }).then((res) => {
    pesonData.value = res.rows;
    console.log(res.rows);
    TorquedialogVisible.value = true;
  });
};
@@ -1331,6 +1335,7 @@
  } else if (isactive.value == 2) {
    WorkinitData();
  } else {
    LogininitData();
  }
};
@@ -1342,6 +1347,7 @@
  } else if (isactive.value == 2) {
    WorkinitData();
  } else {
    LogininitData();
  }
};
//任务记录
@@ -1358,7 +1364,7 @@
    {
      name: queryForm.value.selectType,
      value: queryForm.value.selectInput,
      displayType: "String",
      displayType: "like",
    },
    { name: "createTime", value: startTime, displayType: "ThanOrEqual" },
    { name: "createTime", value: endTime, displayType: "LessOrEqual" },
@@ -1428,13 +1434,19 @@
    LogininitData();
  }
};
//重置方法
const resetQuery = () => {
  queryForm.value = { selectName: "", selectTime: [] };
  queryForm.value = Object.assign({}, obj);
  pageQuery.value.page = 1;
  initData();
  if (isactive.value == 1) {
    initData();
  } else if (isactive.value == 2) {
    WorkinitData();
  } else {
    LogininitData();
  }
};
//打印方法
const printExcel = () => {
  // æŸ¥è¯¢æ¡ä»¶
  const startTime = formatTime(queryForm.value.selectTime[0]);
@@ -1472,9 +1484,11 @@
    });
  }
};
const roleINFO = ref();
onMounted(() => {
  initData();
  roleINFO.value = JSON.parse(localStorage.getItem("user")).roleId;
  console.log(roleINFO.value);
});
</script>
<style lang="scss" scoped>