Browse Source

feat: 1.0版本

Rmengdi 10 months ago
parent
commit
7038e40f54

+ 107 - 0
mock/sLongDemo/experimentalData.mock.ts

@@ -0,0 +1,107 @@
+import { defineMock } from "../base";
+
+export default defineMock([
+  {
+    url: "experimentalData/page",
+    method: ["GET"],
+    body: {
+      code: "00000",
+      data: {
+        list: [
+          {
+            id: 1,
+            fileName: "20240107135920",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 2,
+            fileName: "20240107142012",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 3,
+            fileName: "20240107143530",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 4,
+            fileName: "20240107162418",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 5,
+            fileName: "20240107163443",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 6,
+            fileName: "20240107171418",
+            model: "UCPH205",
+            time: "2024.01.07",
+            source: "实验",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 7,
+            fileName: "20240305105808",
+            model: "UCPH205",
+            time: "2024.03.05",
+            source: "仿真",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 8,
+            fileName: "20240305105912",
+            model: "UCPH205",
+            time: "2024.03.05",
+            source: "仿真",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 9,
+            fileName: "20240305105956",
+            model: "UCPH205",
+            time: "2024.03.05",
+            source: "仿真",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+          {
+            id: 10,
+            fileName: "20240305105912",
+            model: "UCPH205",
+            time: "2024.03.05",
+            source: "仿真",
+            samplingRate: "6000Hz",
+            remark: "",
+          },
+        ],
+        total: 10,
+      },
+      msg: "一切ok",
+    },
+  },
+]);

+ 34 - 0
src/api/sLongDemo/experimentalData.ts

@@ -0,0 +1,34 @@
+import request from "@/utils/request";
+
+const experimentalData_BASE_URL = "/api/v1/experimentalData";
+
+class experimentalDataAPI {
+  /** 获取角色分页数据 */
+  static getPage(queryParams?: experimentalDataPageQuery) {
+    return request<any, PageResult<experimentalDataPageVO[]>>({
+      url: `${experimentalData_BASE_URL}/page`,
+      method: "get",
+      params: queryParams,
+    });
+  }
+}
+export default experimentalDataAPI;
+
+export interface experimentalDataPageQuery extends PageQuery {
+  /** 搜索关键字 */
+  keywords?: string;
+}
+
+/** 分页对象 */
+export interface experimentalDataPageVO {
+  id?: number;
+  siteName?: string;
+  siteNumber?: string;
+  channelNumber?: string;
+  sensorType?: string;
+  sensorCoordinates?: string;
+  time?: string;
+  validValue?: string;
+  maxValue?: string;
+  healthStatus?: number;
+}

+ 6 - 6
src/layout/components/NavBar/components/NavbarAction.vue

@@ -2,7 +2,7 @@
   <div class="flex">
     <template v-if="!isMobile">
       <!-- 搜索 -->
-      <menu-search />
+      <!-- <menu-search /> -->
       <!--全屏 -->
       <div class="nav-action-item" @click="toggle">
         <svg-icon
@@ -11,19 +11,19 @@
       </div>
 
       <!-- 布局大小 -->
-      <el-tooltip
+      <!-- <el-tooltip
         :content="$t('sizeSelect.tooltip')"
         effect="dark"
         placement="bottom"
       >
         <size-select class="nav-action-item" />
-      </el-tooltip>
+      </el-tooltip> -->
 
       <!-- 语言选择 -->
-      <lang-select class="nav-action-item" />
+      <!-- <lang-select class="nav-action-item" /> -->
 
       <!-- 消息通知 -->
-      <el-dropdown class="message nav-action-item" trigger="click">
+      <!-- <el-dropdown class="message nav-action-item" trigger="click">
         <el-badge is-dot>
           <div class="flex-center h100% p10px">
             <i-ep-bell />
@@ -65,7 +65,7 @@
             </div>
           </div>
         </template>
-      </el-dropdown>
+</el-dropdown> -->
     </template>
 
     <!-- 用户头像 -->

+ 96 - 3
src/views/sLongDemo/bearingManage/index.vue

@@ -7,9 +7,11 @@
       <el-col :lg="20" :xs="24">
         <el-card shadow="never">
           <template #header>
-            <div class="flex-x-between">
+            <div class="flex" style="justify-content: space-around">
               <div>
-                <el-button type="success">模型导入</el-button>
+                <el-button type="success" @click="dialog.visible = true">
+                  模型导入
+                </el-button>
               </div>
               <div>
                 <el-button type="primary">模型编辑</el-button>
@@ -21,7 +23,7 @@
           </template>
           <div class="text-center">
             <el-image
-              style="width: 500px; height: 500px"
+              style="width: 500px; height: 500px; margin: 30px 0"
               src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
             />
             <el-descriptions border :column="4">
@@ -50,6 +52,78 @@
         </el-card>
       </el-col>
     </el-row>
+    <el-dialog v-model="dialog.visible" width="60%" append-to-body>
+      <div class="text-center">
+        <div class="img flex h-300px" style="justify-content: space-around">
+          <el-image
+            style="width: 300px; height: 300px"
+            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
+          />
+          <el-image
+            style="width: 300px; height: 300px"
+            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
+          />
+        </div>
+        <el-form
+          :inline="true"
+          :model="params"
+          class="demo-form-inline mt-10"
+          label-width="100px"
+        >
+          <el-form-item label="内环故障">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入内环故障"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item label="外环故障">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入外环故障"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item label="滚珠故障">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入滚珠故障"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item label="转速">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入转速"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item label="采样率">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入采样率"
+              clearable
+            />
+          </el-form-item>
+          <el-form-item label="采样时间">
+            <el-input
+              v-model="params.innerFault"
+              placeholder="请输入采样时间"
+              clearable
+            />
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="dialog.visible = false">
+            开始仿真
+          </el-button>
+          <el-button @click="dialog.visible = false">数据存储</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -58,6 +132,25 @@ defineOptions({
   name: "BearingManage",
   inherititems: false,
 });
+import { reactive } from "vue";
+
+const params = reactive({
+  outerRingFault: "1cm",
+  innerFault: "0.3mm",
+  ballFault: "1.2cm",
+  speed: "7000rpm",
+  samplingRate: "2000Hz",
+  samplingTime: "1min",
+});
+
+const dialog = reactive({
+  visible: false,
+  title: "",
+});
+
+const onSubmit = () => {
+  console.log("submit!");
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 1 - 1
src/views/sLongDemo/dataCollection/index.vue

@@ -322,12 +322,12 @@ onMounted(() => {
   height: 50px;
   padding: 10px;
   padding-left: 13px;
+  margin-top: 10px;
   font-size: 12px;
   color: #fff;
   background-color: rgb(255 1 1 / 80%);
   border-radius: 50%;
   animation: test 1000ms infinite;
-  animation: test 1000ms infinite;
 }
 
 .bottomTable {

+ 109 - 2
src/views/sLongDemo/diagnosticModelManage/index.vue

@@ -1,12 +1,119 @@
 <template>
-  <div>诊断模型管理</div>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :lg="4" :xs="24" class="mb-[12px]">
+        <el-card shadow="never">
+          <el-input placeholder="名称" clearable>
+            <template #prefix>
+              <i-ep-search />
+            </template>
+          </el-input>
+
+          <el-tree
+            ref="sideTreeTreeRef"
+            class="mt-2"
+            :data="treeList"
+            :props="{ children: 'children', label: 'label', disabled: '' }"
+            :expand-on-click-node="false"
+            default-expand-all
+          />
+        </el-card>
+      </el-col>
+      <el-col :lg="20" :xs="24">
+        <el-card shadow="never" class="right">
+          <template #header>
+            <div class="flex" style="justify-content: space-around">
+              <div>
+                <el-button type="success" @click="dialog.visible = true">
+                  模型导入
+                </el-button>
+              </div>
+              <div>
+                <el-button type="warning">模型保存</el-button>
+              </div>
+            </div>
+          </template>
+          <div class="text-center">
+            <el-upload
+              class="upload-demo"
+              drag
+              action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+              multiple
+            >
+              <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+              <div class="el-upload__text">
+                拖拉模型文件到此处 或
+                <em>点击上传模型</em>
+              </div>
+            </el-upload>
+            <el-descriptions
+              size=""
+              class="mt-50"
+              direction="vertical"
+              border
+              :column="5"
+            >
+              <el-descriptions-item label="网络层">
+                网络结构
+              </el-descriptions-item>
+              <el-descriptions-item label="input">1024</el-descriptions-item>
+              <el-descriptions-item label="GCN1">1024*256</el-descriptions-item>
+              <el-descriptions-item label="BN1">256</el-descriptions-item>
+              <el-descriptions-item label="FC1">256*9</el-descriptions-item>
+            </el-descriptions>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script setup lang="ts">
+import { UploadFilled } from "@element-plus/icons-vue";
 defineOptions({
   name: "DiagnosticModelManage",
   inherititems: false,
 });
+import { reactive } from "vue";
+
+const treeList = [
+  {
+    value: 1,
+    label: "图神经网络",
+    children: [
+      {
+        value: 11,
+        label: "DVGNN",
+      },
+      {
+        value: 12,
+        label: "DVGAT",
+      },
+    ],
+  },
+  {
+    value: 2,
+    label: "卷积神经网络",
+    children: [
+      {
+        value: 21,
+        label: "CNN",
+      },
+      {
+        value: 22,
+        label: "K-Means",
+      },
+    ],
+  },
+];
+const dialog = reactive({
+  visible: false,
+  title: "",
+});
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.right {
+  height: calc(100vh - 100px);
+}
+</style>

+ 73 - 1
src/views/sLongDemo/experimentalDataManage/index.vue

@@ -1,5 +1,50 @@
 <template>
-  <div>实验数据管理</div>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :lg="4" :xs="24" class="mb-[12px]">
+        <sideTree />
+      </el-col>
+      <el-col :lg="20" :xs="24">
+        <el-card shadow="never" class="table-container">
+          <template #header>
+            <div class="flex-x-between">
+              <div>
+                <el-button type="primary">
+                  <i-ep-upload />
+                  导入数据
+                </el-button>
+                <el-button type="danger">
+                  <i-ep-delete />
+                  删除数据
+                </el-button>
+              </div>
+            </div>
+          </template>
+
+          <el-table stripe v-loading="loading" :data="pageData">
+            <el-table-column type="selection" width="50" align="center" />
+            <el-table-column label="文件名" align="center" prop="fileName" />
+            <el-table-column label="型号" align="center" prop="model" />
+            <el-table-column label="时间" align="center" prop="time" />
+            <el-table-column label="来源" align="center" prop="source" />
+            <el-table-column
+              label="采样率"
+              align="center"
+              prop="samplingRate"
+            />
+            <el-table-column label="备注" align="center" prop="remark" />
+          </el-table>
+          <pagination
+            v-if="total > 0"
+            v-model:total="total"
+            v-model:page="queryParams.pageNum"
+            v-model:limit="queryParams.pageSize"
+            @pagination="handleQuery"
+          />
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script setup lang="ts">
@@ -7,6 +52,33 @@ defineOptions({
   name: "ExperimentalDataManage",
   inherititems: false,
 });
+import experimentalDataAPI, {
+  experimentalDataPageQuery,
+  experimentalDataPageVO,
+} from "@/api/sLongDemo/experimentalData";
+const pageData = ref<experimentalDataPageVO[]>();
+const total = ref(0);
+const loading = ref(false);
+const queryParams = reactive<experimentalDataPageQuery>({
+  pageNum: 1,
+  pageSize: 20,
+});
+
+function handleQuery() {
+  loading.value = true;
+  experimentalDataAPI
+    .getPage(queryParams)
+    .then((data) => {
+      pageData.value = data.list;
+      total.value = data.total;
+    })
+    .finally(() => {
+      loading.value = false;
+    });
+}
+onMounted(() => {
+  handleQuery();
+});
 </script>
 
 <style lang="scss" scoped></style>

+ 86 - 2
src/views/sLongDemo/faultDiagnosis/index.vue

@@ -1,5 +1,56 @@
 <template>
-  <div>故障诊断</div>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :lg="24" :xs="24">
+        <el-card shadow="never" class="right">
+          <template #header>
+            <div class="flex" style="justify-content: space-around">
+              <el-form :model="selectData" :inline="true" label-width="auto">
+                <el-form-item label="轴承">
+                  <el-select
+                    style="width: 200px"
+                    v-model="selectData.bearing"
+                    placeholder="请选择轴承"
+                  >
+                    <el-option label="UCPH205" value="1" />
+                  </el-select>
+                </el-form-item>
+                <el-form-item label="诊断模型">
+                  <el-select
+                    style="width: 200px"
+                    v-model="selectData.model"
+                    placeholder="请选择诊断模型"
+                  >
+                    <el-option label="UCPH205" value="1" />
+                  </el-select>
+                </el-form-item>
+              </el-form>
+              <div>
+                <el-button type="warning">开始诊断</el-button>
+              </div>
+            </div>
+          </template>
+          <div class="flex content">
+            <div class="circular" style="background-color: red">
+              <span>内环</span>
+            </div>
+            <div class="circular" style="background-color: #c00000">
+              <span>外环</span>
+            </div>
+            <div class="circular" style="background-color: #ffab40">
+              <span>滚珠</span>
+            </div>
+          </div>
+          <div class="result">
+            <p class="font-700" style="font-size: 20px">
+              诊断结果:内环磨损0.3mm + 外环磨损0.5mm
+            </p>
+            <el-button class="mt-10" color="#626aef">保存结果</el-button>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
 </template>
 
 <script setup lang="ts">
@@ -7,6 +58,39 @@ defineOptions({
   name: "FaultDiagnosis",
   inherititems: false,
 });
+
+const selectData = {
+  bearing: "UCPH205",
+  model: "DIGNN",
+};
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.right {
+  height: calc(100vh - 100px);
+}
+
+.content {
+  justify-content: space-around;
+  margin: 100px 0 200px;
+}
+
+.circular {
+  width: 100px;
+  height: 100px;
+  font-size: 24px;
+  line-height: 100px;
+  color: #fff;
+  text-align: center;
+  border: 1px solid #000;
+  border-radius: 50%;
+}
+
+.result {
+  display: flex;
+  justify-content: space-between;
+  width: 800px;
+  height: 200px;
+  margin-left: 400px;
+}
+</style>