Browse Source

引入avue。测试数据修改。

jxq 4 months ago
parent
commit
9ba8669244

+ 1 - 1
.prettierrc.cjs

@@ -14,7 +14,7 @@ module.exports = {
   // 在 JSX 中使用单引号替代双引号,默认false
   jsxSingleQuote: false,
   // 每行最多字符数量,超出换行(默认80)
-  printWidth: 80,
+  printWidth: 120,
   // 超出打印宽度 (always | never | preserve )
   proseWrap: "preserve",
   // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;)

+ 1 - 1
package.json

@@ -43,7 +43,7 @@
   "dependencies": {
     "@element-plus/icons-vue": "^2.3.1",
     "@kjgl77/datav-vue3": "^1.7.4",
-    "@smallwei/avue": "^3.6.0",
+    "@smallwei/avue": "^3.6.2",
     "@stomp/stompjs": "^7.0.0",
     "@vitejs/plugin-legacy": "^6.0.0",
     "@vitejs/plugin-vue-jsx": "^4.1.1",

+ 18 - 1
pnpm-lock.yaml

@@ -15,7 +15,7 @@ importers:
         specifier: ^1.7.4
         version: 1.7.4(vue@3.5.13(typescript@5.5.4))
       '@smallwei/avue':
-        specifier: ^3.6.0
+        specifier: ^3.6.2
         version: 3.6.2(element-plus@2.9.5(vue@3.5.13(typescript@5.5.4)))(vue@3.5.13(typescript@5.5.4))
       '@stomp/stompjs':
         specifier: ^7.0.0
@@ -1423,36 +1423,42 @@ packages:
     engines: {node: '>= 10.0.0'}
     cpu: [arm]
     os: [linux]
+    libc: [glibc]
 
   '@parcel/watcher-linux-arm-musl@2.5.1':
     resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==}
     engines: {node: '>= 10.0.0'}
     cpu: [arm]
     os: [linux]
+    libc: [musl]
 
   '@parcel/watcher-linux-arm64-glibc@2.5.1':
     resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==}
     engines: {node: '>= 10.0.0'}
     cpu: [arm64]
     os: [linux]
+    libc: [glibc]
 
   '@parcel/watcher-linux-arm64-musl@2.5.1':
     resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==}
     engines: {node: '>= 10.0.0'}
     cpu: [arm64]
     os: [linux]
+    libc: [musl]
 
   '@parcel/watcher-linux-x64-glibc@2.5.1':
     resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==}
     engines: {node: '>= 10.0.0'}
     cpu: [x64]
     os: [linux]
+    libc: [glibc]
 
   '@parcel/watcher-linux-x64-musl@2.5.1':
     resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==}
     engines: {node: '>= 10.0.0'}
     cpu: [x64]
     os: [linux]
+    libc: [musl]
 
   '@parcel/watcher-win32-arm64@2.5.1':
     resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==}
@@ -1529,51 +1535,61 @@ packages:
     resolution: {integrity: sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==}
     cpu: [arm]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-arm-musleabihf@4.34.8':
     resolution: {integrity: sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==}
     cpu: [arm]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-linux-arm64-gnu@4.34.8':
     resolution: {integrity: sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==}
     cpu: [arm64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-arm64-musl@4.34.8':
     resolution: {integrity: sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==}
     cpu: [arm64]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-linux-loongarch64-gnu@4.34.8':
     resolution: {integrity: sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==}
     cpu: [loong64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-powerpc64le-gnu@4.34.8':
     resolution: {integrity: sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==}
     cpu: [ppc64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-riscv64-gnu@4.34.8':
     resolution: {integrity: sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==}
     cpu: [riscv64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-s390x-gnu@4.34.8':
     resolution: {integrity: sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==}
     cpu: [s390x]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-x64-gnu@4.34.8':
     resolution: {integrity: sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==}
     cpu: [x64]
     os: [linux]
+    libc: [glibc]
 
   '@rollup/rollup-linux-x64-musl@4.34.8':
     resolution: {integrity: sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==}
     cpu: [x64]
     os: [linux]
+    libc: [musl]
 
   '@rollup/rollup-win32-arm64-msvc@4.34.8':
     resolution: {integrity: sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==}
@@ -6163,6 +6179,7 @@ packages:
   yaeti@0.0.6:
     resolution: {integrity: sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==}
     engines: {node: '>=0.10.32'}
+    deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
 
   yallist@3.1.1:
     resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}

+ 9 - 1
src/api/prosteps/ceshishuju.ts

@@ -8,7 +8,7 @@ export function dataArrayList(processId: string) {
   });
 }
 
-export function startCSSJTesting(processId: string,deviceNo: string) {
+export function startCSSJTesting(processId: string, deviceNo: string) {
   return request({
     url: `/api/v1/testData/startTest/${processId}/${deviceNo}`,
     method: "get",
@@ -40,3 +40,11 @@ export function getDeviceList(data: any) {
     data: data,
   });
 }
+
+export function getDeviceListPage(data: any) {
+  return request({
+    url: `/api/v1/device/page`,
+    method: "post",
+    data: data,
+  });
+}

+ 146 - 19
src/hooks/userCrud.ts

@@ -3,10 +3,18 @@ import { PageOption } from "@smallwei/avue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { useUserStoreHook } from "@/store/modules/user";
 import { checkPerm } from "@/directive/permission";
+import { configs } from "@typescript-eslint/eslint-plugin";
 
 interface UseCrudConfig {
   // 模块的url,用来进行增删改查
   src?: string;
+
+  dataListUrl?: string;
+
+  afterDataList?: Function;
+
+  afterAdd?: Function;
+
   // 需要操作的数据
   row?: any;
   // done用于结束操作
@@ -15,23 +23,29 @@ interface UseCrudConfig {
   index?: number;
   // 用于中断操作
   loading?: () => void;
-  // 查询参数 一般用search的值就可以了
+  // 额外查询参数 一般用search的值就可以了
   params?: object;
   // 是否是编辑,如果是编辑调用更新,否则调用新增
   isEdit?: boolean;
+  //   用于多选选中后添加进入,toDeleteIds中的key值。
+  multipleSelectKey?: string;
 }
 
 export const useCrud = (config?: UseCrudConfig) => {
   const url = ref(config?.src);
-
+  const commonConfig = ref(config);
   /** 表格配置属性 */
   const option = ref({
     searchIcon: true,
+    // searchSpan: 4,
     searchIndex: 3, //searchIcon是否启用功能按钮, searchIndex配置收缩展示的个数,默认为2个
     index: true, //是否显示第几项
+    indexLabel: "序号",
+    indexWidth: "55px",
     refreshBtn: false,
     border: true,
     viewBtn: true,
+    tip: false, //选中的提示
   });
   const data = ref<any>([]); //表格数据
   const form = ref({}); //新增或者编辑弹出的表单绑定值
@@ -40,35 +54,38 @@ export const useCrud = (config?: UseCrudConfig) => {
 
   /** 表格的分页数据 v-model */
   const page = ref<PageOption>({
-    total: 12220,
+    total: 0,
     currentPage: 1,
     pageSize: 10,
   });
   /** 配置项结构 v-model */
   // defaults ?: AvueCrudDefaults;
-
+  // 多选返回的数组,命名是因为后来增加了很多功能,现在这个数组里面的值是根据multipleSelectKey来决定
   const toDeleteIds = ref<Array<string>>([]);
-
+  // 多选返回的数组,返回每一行的row数据
+  const selectedRows = ref<any[]>([]);
   const save = async (config?: UseCrudConfig) => {
-    const path = config?.isEdit ? "/update" : "/add";
     try {
-      const res = await request({
+      const path = config?.isEdit ? "/update" : "/add";
+
+      const res = (await request({
         url: `${url.value}${path}`,
         method: "post",
         data: form.value,
-      });
-      if (res?.data?.code == 200) {
+      })) as any;
+      if (res?.code == 200) {
         Methords.dataList();
         config?.done && config?.done();
+        ElMessage.success(res?.msg ?? "");
+        if (commonConfig.value?.afterAdd) {
+          commonConfig.value?.afterAdd(res?.data);
+        }
       } else {
-        ElMessage.error(res?.data?.msg ?? "");
+        config?.loading && config?.loading();
+        ElMessage.error(res?.msg ?? "");
       }
     } catch (err) {
-      ElMessage.error("Oops, this is a error message.");
-      // config?.loading && config?.loading();
-    } finally {
-      ElMessage.error("Oops, this is a error message.");
-      // config?.done && config?.done();
+      config?.loading && config?.loading();
     }
   };
 
@@ -95,17 +112,67 @@ export const useCrud = (config?: UseCrudConfig) => {
       handleSearchData();
       try {
         const res = await request({
+          url: commonConfig.value?.dataListUrl ?? `${url.value}/page`,
+          method: "post",
+          data: {
+            pageNo: page.value.currentPage,
+            pageSize: page.value.pageSize,
+            ...(commonConfig.value?.params ?? {}),
+            ...search.value,
+          },
+        });
+        if (res?.data) {
+          if (res?.data instanceof Array) {
+            data.value = res?.data || [];
+            page.value.total = res?.data?.length || 0;
+          } else {
+            data.value = res?.data?.records || [];
+            page.value.total = res?.data?.totalCount || 0;
+          }
+          if (commonConfig.value?.afterDataList) {
+            commonConfig.value?.afterDataList();
+          }
+        }
+        config?.done && config?.done();
+      } catch (err) {
+        config?.loading && config?.loading();
+      } finally {
+        config?.done && config?.done();
+      }
+    },
+    dataEditList: async (config?: UseCrudConfig) => {
+      handleSearchData();
+      try {
+        const res = await request({
           url: `${url.value}/page`,
           method: "post",
           data: {
             pageNo: page.value.currentPage,
             pageSize: page.value.pageSize,
             ...search.value,
+            ...(commonConfig.value?.params ?? {}),
           },
         });
         if (res?.data) {
-          data.value = res?.data?.records || [];
-          page.value.total = res?.data?.totalCount || 0;
+          if (res?.data instanceof Array) {
+            data.value = res?.data || [];
+            page.value.total = res?.data?.length || 0;
+          } else {
+            data.value = res?.data?.records || [];
+            for (let i = 0; i < data.value.length; i++) {
+              data.value[i].$cellEdit = true;
+              if (
+                data.value[i].children != undefined &&
+                data.value[i].children != null &&
+                data.value[i].children.length > 0
+              ) {
+                for (let j = 0; j < data.value[i].children.length; j++) {
+                  data.value[i].children[j].$cellEdit = true;
+                }
+              }
+            }
+            page.value.total = res?.data?.totalCount || 0;
+          }
         }
         config?.done && config?.done();
       } catch (err) {
@@ -114,7 +181,27 @@ export const useCrud = (config?: UseCrudConfig) => {
         config?.done && config?.done();
       }
     },
+    dataNoPageList: async (config?: UseCrudConfig) => {
+      handleSearchData();
+      try {
+        const res = await request({
+          url: `${url.value}/list`,
+          method: "post",
+          data: {
+            ...search.value,
+          },
+        });
 
+        if (res?.data) {
+          data.value = res?.data || [];
+        }
+        config?.done && config?.done();
+      } catch (err) {
+        config?.loading && config?.loading();
+      } finally {
+        config?.done && config?.done();
+      }
+    },
     createRow: (row: any, done: () => void, loading: () => void) => {
       save({ row: row, done: done, loading: loading });
     },
@@ -140,11 +227,15 @@ export const useCrud = (config?: UseCrudConfig) => {
         cancelButtonText: "取消",
         type: "warning",
       }).then(async () => {
+        if (row.children && row.children.length > 0) {
+          ElMessage.error("请先解绑下级关系");
+          return;
+        }
         try {
           const res = await request({
             url: `${url.value}/del`,
             method: "post",
-            data: { id: row.id ?? "" },
+            data: row,
           });
           Methords.dataList();
           config?.done && config?.done();
@@ -159,8 +250,12 @@ export const useCrud = (config?: UseCrudConfig) => {
     // 设置selection: true,后监听选中改变事件,将Id存入数组
     selectionChange: (rows?: any[]) => {
       toDeleteIds.value = [];
+      selectedRows.value = [];
       rows?.forEach((element) => {
-        toDeleteIds.value.push(element.id);
+        toDeleteIds.value.push(
+          element[commonConfig.value?.multipleSelectKey ?? "id"]
+        );
+        selectedRows.value.push(element);
       });
     },
 
@@ -190,6 +285,35 @@ export const useCrud = (config?: UseCrudConfig) => {
     },
 
     /**
+     *  表格拖拽后批量保存
+     * */
+    multipleUpdate: async () => {
+      try {
+        // 由于数据带有$开头的属性,所以需要处理下,改为只传id和sortNum。
+        const dtosArray: { id: string; sortNum: number }[] = [];
+        for (let i = 0; i < data.value.length; i++) {
+          let cur = page.value.currentPage ?? 1;
+          cur = cur - 1;
+          const size = page.value.pageSize ?? 10;
+          let sortNum = cur * size;
+          sortNum = sortNum + i;
+
+          dtosArray.push({ id: data.value[i].id, sortNum: sortNum });
+        }
+        const res = await request({
+          url: `${url.value}/batch-update`,
+          method: "post",
+          data: dtosArray,
+        });
+        Methords.dataList();
+        config?.done && config?.done();
+      } catch (err) {
+        config?.loading && config?.loading();
+      } finally {
+        config?.done && config?.done();
+      }
+    },
+    /**
      * 点击搜索按钮触发
      */
     searchChange: async (params: any, done: () => void) => {
@@ -261,6 +385,7 @@ export const useCrud = (config?: UseCrudConfig) => {
      * 根据搜索项导出数据
      */
     exportData: async (urlStr: string) => {
+      handleSearchData();
       const response = await request({
         url: urlStr,
         method: "post",
@@ -281,5 +406,7 @@ export const useCrud = (config?: UseCrudConfig) => {
     toDeleteIds,
     Methords,
     Utils,
+    selectedRows,
+    commonConfig,
   };
 };

+ 18 - 0
src/styles/index.scss

@@ -288,3 +288,21 @@
 .hiddenCanvasElement {
   display: none;
 }
+
+
+.el-dialog {
+  display: flex;
+  flex-direction: column;
+  margin: 0 !important;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  /*height:600px;*/
+  max-height: calc(100vh - 100px);
+  max-width: calc(100% - 30px);
+}
+.el-dialog .el-dialog__body {
+  flex: 1;
+  overflow: auto;
+}

+ 225 - 93
src/views/pro-steps/components/ceshishuju.vue

@@ -1,73 +1,114 @@
 <template>
   <div>
     <div class="csTitle-header">
-      <el-button type="primary" @click="startTesting">开始测试</el-button>
+      <el-button type="primary" @click="startTesting">选择设备</el-button>
       <span>产品编码: {{ csObj?.materialName }}</span>
       <span>产品名称: {{ csObj?.materialCode }}</span>
       <span>测试人员: {{ csObj?.creator }}</span>
       <span>测试时间: {{ csObj?.created }}</span>
     </div>
 
-    <el-table :data="tableData" class="tableView-cssj">
-      <el-table-column
-        fixed
-        prop="parameterName"
-        label="测试项目"
-        align="center"
-      />
-      <el-table-column
-        fixed
-        prop="deviceCode"
-        label="测试设备"
-        align="center"
-      />
-      <el-table-column fixed prop="value" label="测试值" align="center" />
-      <el-table-column prop="flag" align="center" label="是否合格">
-        <template #default="scope">
-          <span
-            :class="{
-              'red-text': scope.row.flag == 0,
-              'green-text': scope.row.writeData == 1,
-            }"
-          >
-            {{ scope.row.flag == 1 ? "合格" : "不合格" }}
-          </span>
-        </template>
-      </el-table-column>
-
-      <!--      <el-table-column label="操作" fixed="right" width="200">-->
-      <!--        <template #default="scope">-->
-      <!--                    <el-button-->
-      <!--                      link-->
-      <!--                      class="btnText"-->
-      <!--                      type="primary"-->
-      <!--                      @click="handleEdit(scope.row)"-->
-      <!--                    >-->
-      <!--                      编辑-->
-      <!--                    </el-button>-->
-
-      <!--                    <el-popconfirm-->
-      <!--                      :visible="scope.row.dialogVisible"-->
-      <!--                      title="您确认删除吗?(此操作不可逆)"-->
-      <!--                      width="300"-->
-      <!--                      @cancel="scope.row.dialogVisible = false"-->
-      <!--                      @confirm="handleDelete(scope.row)"-->
-      <!--                    >-->
-      <!--                      <el-button> 取消 </el-button>-->
-      <!--                      <el-button type="primary"> 确认 </el-button>-->
-      <!--                      <template #reference>-->
-      <!--                        <el-button-->
-      <!--                          link-->
-      <!--                          class="btnText"-->
-      <!--                          type="primary"-->
-      <!--                          @click="scope.row.dialogVisible = true"-->
-      <!--                          >删除</el-button-->
-      <!--                        >-->
-      <!--                      </template>-->
-      <!--                    </el-popconfirm>-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
-    </el-table>
+    <div class="bottom-box">
+      <el-scrollbar style="height: calc(100vh - 300px); margin-top: 10px">
+        <el-table :data="selectedDeviceList" class="left-selected-devs">
+          <el-table-column
+            fixed
+            prop="deviceNo"
+            label="设备编号"
+            align="center"
+          />
+          <el-table-column
+            fixed
+            prop="deviceName"
+            label="设备名称"
+            align="center"
+          />
+
+          <el-table-column label="操作">
+            <template #default="scope">
+              <el-button
+                link
+                class="btnText"
+                type="primary"
+                @click="preToStart(scope.row)"
+              >
+                开始
+              </el-button>
+
+              <el-button
+                link
+                class="btnText"
+                type="primary"
+                @click="preToLook(scope.row)"
+              >
+                查看
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-scrollbar>
+
+      <el-table :data="tableData" class="tableView-cssj">
+        <el-table-column
+          fixed
+          prop="parameterName"
+          label="测试项目"
+          align="center"
+        />
+        <el-table-column
+          fixed
+          prop="deviceCode"
+          label="测试设备"
+          align="center"
+        />
+        <el-table-column fixed prop="value" label="测试值" align="center" />
+        <el-table-column prop="flag" align="center" label="是否合格">
+          <template #default="scope">
+            <span
+              :class="{
+                'red-text': scope.row.flag == 0,
+                'green-text': scope.row.writeData == 1,
+              }"
+            >
+              {{ scope.row.flag == 1 ? "合格" : "不合格" }}
+            </span>
+          </template>
+        </el-table-column>
+
+        <!--      <el-table-column label="操作" fixed="right" width="200">-->
+        <!--        <template #default="scope">-->
+        <!--                    <el-button-->
+        <!--                      link-->
+        <!--                      class="btnText"-->
+        <!--                      type="primary"-->
+        <!--                      @click="handleEdit(scope.row)"-->
+        <!--                    >-->
+        <!--                      编辑-->
+        <!--                    </el-button>-->
+
+        <!--                    <el-popconfirm-->
+        <!--                      :visible="scope.row.dialogVisible"-->
+        <!--                      title="您确认删除吗?(此操作不可逆)"-->
+        <!--                      width="300"-->
+        <!--                      @cancel="scope.row.dialogVisible = false"-->
+        <!--                      @confirm="handleDelete(scope.row)"-->
+        <!--                    >-->
+        <!--                      <el-button> 取消 </el-button>-->
+        <!--                      <el-button type="primary"> 确认 </el-button>-->
+        <!--                      <template #reference>-->
+        <!--                        <el-button-->
+        <!--                          link-->
+        <!--                          class="btnText"-->
+        <!--                          type="primary"-->
+        <!--                          @click="scope.row.dialogVisible = true"-->
+        <!--                          >删除</el-button-->
+        <!--                        >-->
+        <!--                      </template>-->
+        <!--                    </el-popconfirm>-->
+        <!--        </template>-->
+        <!--      </el-table-column>-->
+      </el-table>
+    </div>
 
     <el-dialog title="编辑测试项" v-model="dialogVisible">
       <el-form ref="form" :model="editRow" label-width="100px">
@@ -90,16 +131,50 @@
         <el-button type="primary" @click="handleDialogConfirm">确 定</el-button>
       </template>
     </el-dialog>
-    <el-dialog title="设备列表" v-model="dialogDevice">
-      <el-table :data="deviceList" style="width: 100%" ref="singleTableRef" highlight-current-row @current-change="handleCurrentChange">
-        <el-table-column type="index" width="50" />
+    <el-dialog title="设备列表" v-model="dialogDevice" append-to-body>
+      <el-table
+        :data="deviceList"
+        style="width: 100%; height: calc(100vh - 400px); margin-bottom: 10px"
+        ref="singleTableRef"
+        row-key="id"
+        highlight-current-row
+        @current-change="handleCurrentChange"
+        @selection-change="handleSelectionAllChange"
+      >
+        <el-table-column type="selection" width="50" />
         <el-table-column prop="id" label="id" width="180" v-if="false" />
-        <el-table-column prop="deviceNo" label="设备编号"  />
-        <el-table-column prop="deviceName" label="设备名称"  />
+        <el-table-column prop="deviceNo" label="设备编号" />
+        <el-table-column prop="deviceName" label="设备名称" />
       </el-table>
+      <el-pagination
+        v-model:current-page="currentPageAll"
+        v-model:page-size="pageSizeAll"
+        layout="total, prev, pager, next"
+        :total="totalAll"
+        background
+        @size-change="sizeChangeAll"
+        @current-change="currentChangeAll"
+      />
       <template #footer>
-        <el-button @click="dialogDevice=false">取 消</el-button>
-        <el-button type="primary" @click="dialogConfirm">确 定</el-button>
+        <el-button @click="dialogDevice = false">取 消</el-button>
+        <el-button type="primary" @click="dialogDevice = false"
+          >确 定</el-button
+        >
+      </template>
+    </el-dialog>
+
+    <el-dialog title="设置时间" v-model="startSettingVisible" append-to-body>
+      <el-date-picker
+        v-model="startSettingTime"
+        type="datetimerange"
+        start-placeholder="请选择开始时间"
+        end-placeholder="请选择结束时间"
+        value-format="YYYY-MM-DD HH:mm:ss"
+      />
+
+      <template #footer>
+        <el-button @click="afterTimeCancel">取 消</el-button>
+        <el-button type="primary" @click="afterTimeStart">开始</el-button>
       </template>
     </el-dialog>
   </div>
@@ -111,7 +186,8 @@ import {
   dataArrayList,
   deleteCSSJ,
   startCSSJTesting,
-  getDeviceList
+  getDeviceList,
+  getDeviceListPage,
 } from "@/api/prosteps/ceshishuju";
 import { useProcessStore } from "@/store";
 import { emitter, EventsNames } from "@/utils/common";
@@ -124,8 +200,8 @@ const tableData = ref<any[]>([]);
 
 const currentRow = ref<any>(null);
 const handleCurrentChange = (val: any) => {
-  currentRow.value = val
-}
+  currentRow.value = val;
+};
 const deviceList = ref<any[]>([]);
 const getList = () => {
   dataArrayList(store.scanInfo.id).then((res: any) => {
@@ -135,35 +211,57 @@ const getList = () => {
   });
 };
 const deviceSearch = ref<any>({});
+const currentPageAll = ref(1);
+const pageSizeAll = ref(12);
+const totalAll = ref(0);
+const sizeChangeAll = (val: number) => {};
+const currentChangeAll = (val: number) => {
+  getDeviceListPageAll();
+};
+const selectedDeviceList = ref<any[]>([]);
+const handleSelectionAllChange = (vals: any[]) => {
+  console.log("handleSelectionAllChange", vals);
+  selectedDeviceList.value = JSON.parse(JSON.stringify(vals));
+};
 
 const dialogConfirm = () => {
   console.log(currentRow);
-  if(!currentRow||!currentRow.value||!currentRow.value.deviceNo){
-     ElMessage.error("未选择设备!");
-     return;
+  if (!currentRow || !currentRow.value || !currentRow.value.deviceNo) {
+    ElMessage.error("未选择设备!");
+    return;
   }
-  startCSSJTesting(store.scanInfo.id,currentRow.value.deviceNo).then((data) => {
-    if(data.code==='200'){
-      dialogDevice.value=false;
-    }
-    if (!emitter.all.has(EventsNames.TEST_DATA)) {
-      emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
-        console.log("测试数据获取成功");
-        getList();
-      });
+  startCSSJTesting(store.scanInfo.id, currentRow.value.deviceNo).then(
+    (data) => {
+      if (data.code === "200") {
+        dialogDevice.value = false;
+      }
+      if (!emitter.all.has(EventsNames.TEST_DATA)) {
+        emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
+          console.log("测试数据获取成功");
+          getList();
+        });
+      }
     }
-  });
-}
+  );
+};
 onMounted(() => {
   getList();
-  deviceSearch.value.deviceType="DDS";
-  getDeviceList(deviceSearch.value).then(
-    (res: any)=>{
-      deviceList.value=res.data;
-    }
-  )
+  deviceSearch.value.deviceType = "DDS";
+  getDeviceListPageAll();
 });
 
+const getDeviceListPageAll = () => {
+  let p = {
+    deviceType: "DDS",
+    pageSize: pageSizeAll.value,
+    pageNo: currentPageAll.value,
+  };
+  getDeviceListPage(p).then((res: any) => {
+    deviceList.value = res.data.records;
+    totalAll.value = res.data.totalCount;
+  });
+};
+
 const startTesting = () => {
   /*startCSSJTesting(store.scanInfo.id).then(() => {
     if (!emitter.all.has(EventsNames.TEST_DATA)) {
@@ -173,7 +271,7 @@ const startTesting = () => {
       });
     }
   });*/
-  dialogDevice.value=true;
+  dialogDevice.value = true;
 };
 
 onUnmounted(() => {
@@ -214,6 +312,26 @@ const handleDialogConfirm = () => {
 const handleDialogCancel = () => {
   dialogVisible.value = false;
 };
+
+// 开始测试后选择时间
+let currentToStartRow = null;
+const preToStart = (row) => {
+  currentToStartRow = JSON.parse(JSON.stringify(row));
+  startSettingVisible.value = true;
+};
+const preToLook = (row) => {
+  // currentToStartRow = JSON.parse(JSON.stringify(row));
+  // startSettingVisible.value = true;
+};
+
+const startSettingVisible = ref(false);
+const startSettingTime = ref<any>(null);
+const afterTimeStart = () => {
+  console.log(startSettingTime.value);
+};
+const afterTimeCancel = () => {
+  startSettingVisible.value = false;
+};
 </script>
 
 <style scoped lang="scss">
@@ -225,8 +343,22 @@ const handleDialogCancel = () => {
   font-weight: bold;
 }
 
-.tableView-cssj {
+.bottom-box {
   width: 100%;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.left-selected-devs {
+  width: 400px;
+  background-color: #fff;
+  border-radius: 16px;
+  height: calc(100vh - 300px);
+  margin-right: 10px;
+}
+.tableView-cssj {
+  flex: 1;
   height: calc(100vh - 300px);
   padding: 20px 0px;
   border-radius: 16px;

+ 4 - 4
src/views/pro-steps/components/wuliaocaiji.vue

@@ -34,7 +34,7 @@
       </div>
       <div class="rightMsg">
         <div class="showSeq" @click.stop="showSeq(item.batchNoList)">
-          <el-button type="text"> 查看已绑批次号 </el-button>
+          <el-button link> 查看已绑批次号 </el-button>
         </div>
         <div v-if="!flStatus" class="info">
           <div class="describe">可采集数量:</div>
@@ -55,7 +55,7 @@
     v-else
     v-model="showXQ"
     :showInfo="seqInfoList"
-    :isShow = "isShowButton"
+    :isShow="isShowButton"
     @data-list="getOpCompentData"
   />
   <seqPopUp v-model="showSEQ" :showInfoData="showSeqData" />
@@ -80,7 +80,7 @@ import { useProcessStore } from "@/store";
 defineOptions({
   name: "Wuliaocaiji",
 });
-const isShowButton=ref(true);
+const isShowButton = ref(true);
 const flStatus = ref(false);
 const caijiRef = ref(null);
 const store = useProcessStore();
@@ -125,7 +125,7 @@ const showInfo = ref({});
 const scanData = ref([]);
 provide("scanData", scanData);
 const enterfnc = async () => {
-  isShowButton.value=true;
+  isShowButton.value = true;
   let str = scanCode.value;
   if (str.length < 1) {
     ElMessage.error("请扫码采集物料");

+ 1 - 1
tsconfig.json

@@ -12,7 +12,7 @@
     "lib": ["esnext", "dom"],
     "baseUrl": ".",
     "allowJs": true,
-    "noImplicitAny": true,
+    "noImplicitAny": false,
     "paths": {
       "@/*": ["src/*"]
     },