|
@@ -90,6 +90,18 @@
|
|
|
<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-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>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="dialogDevice=false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="dialogConfirm">确 定</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -99,6 +111,7 @@ import {
|
|
|
dataArrayList,
|
|
|
deleteCSSJ,
|
|
|
startCSSJTesting,
|
|
|
+ getDeviceList
|
|
|
} from "@/api/prosteps/ceshishuju";
|
|
|
import { useProcessStore } from "@/store";
|
|
|
import { emitter, EventsNames } from "@/utils/common";
|
|
@@ -109,6 +122,11 @@ const csObj = ref<any>(null);
|
|
|
|
|
|
const tableData = ref<any[]>([]);
|
|
|
|
|
|
+const currentRow = ref<any>(null);
|
|
|
+const handleCurrentChange = (val: any) => {
|
|
|
+ currentRow.value = val
|
|
|
+}
|
|
|
+const deviceList = ref<any[]>([]);
|
|
|
const getList = () => {
|
|
|
dataArrayList(store.scanInfo.id).then((res: any) => {
|
|
|
csObj.value = res.data;
|
|
@@ -116,20 +134,46 @@ const getList = () => {
|
|
|
console.log(tableData.value, "返回的列表数据");
|
|
|
});
|
|
|
};
|
|
|
+const deviceSearch = ref<any>({});
|
|
|
|
|
|
+const dialogConfirm = () => {
|
|
|
+ console.log(currentRow);
|
|
|
+ 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();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
+ deviceSearch.value.deviceType="DDS";
|
|
|
+ getDeviceList(deviceSearch.value).then(
|
|
|
+ (res: any)=>{
|
|
|
+ deviceList.value=res.data;
|
|
|
+ }
|
|
|
+ )
|
|
|
});
|
|
|
|
|
|
const startTesting = () => {
|
|
|
- startCSSJTesting(store.scanInfo.id).then(() => {
|
|
|
+ /*startCSSJTesting(store.scanInfo.id).then(() => {
|
|
|
if (!emitter.all.has(EventsNames.TEST_DATA)) {
|
|
|
emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
|
|
|
console.log("测试数据获取成功");
|
|
|
getList();
|
|
|
});
|
|
|
}
|
|
|
- });
|
|
|
+ });*/
|
|
|
+ dialogDevice.value=true;
|
|
|
};
|
|
|
|
|
|
onUnmounted(() => {
|
|
@@ -147,6 +191,7 @@ const handleDelete = (row: any) => {
|
|
|
|
|
|
// 编辑相关代码
|
|
|
const dialogVisible = ref(false);
|
|
|
+const dialogDevice = ref(false);
|
|
|
const editRow = ref<any>(null);
|
|
|
const handleEdit = (row: any) => {
|
|
|
editRow.value = row;
|