diff --git a/package.json b/package.json index ea4dd3b6..f66a2945 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "sonic-client-web", - "version": "1.0.0", + "version": "1.3.0-beta2", + "author": "SonicCloudOrg", "scripts": { "dev": "vite", "build": "vite build", diff --git a/src/assets/img/BBK.jpg b/src/assets/img/BBK.jpg new file mode 100644 index 00000000..04a268bb Binary files /dev/null and b/src/assets/img/BBK.jpg differ diff --git a/src/assets/img/nubia.jpg b/src/assets/img/nubia.jpg new file mode 100644 index 00000000..cebe2911 Binary files /dev/null and b/src/assets/img/nubia.jpg differ diff --git a/src/assets/img/realme.jpg b/src/assets/img/realme.jpg new file mode 100644 index 00000000..51619182 Binary files /dev/null and b/src/assets/img/realme.jpg differ diff --git a/src/components/ElementUpdate.vue b/src/components/ElementUpdate.vue index 1c4ed9aa..886b924d 100644 --- a/src/components/ElementUpdate.vue +++ b/src/components/ElementUpdate.vue @@ -99,19 +99,19 @@ onMounted(() => { v-model="element.eleType" placeholder="请选择定位类型" > - + - - + - - + + + diff --git a/src/components/StepUpdate.vue b/src/components/StepUpdate.vue index 8e61fb3c..c942a91e 100644 --- a/src/components/StepUpdate.vue +++ b/src/components/StepUpdate.vue @@ -86,10 +86,6 @@ const monkey = ref({ name: "isOpenNetworkListener", value: true, }, - { - name: "isOpenImageListener", - value: true, - }, ], }) const monkeyOptions = { @@ -137,10 +133,6 @@ const monkeyOptions = { label: "网络状态监听器", des: "检测设备是否处于飞行模式和WIFI网络", }, - isOpenImageListener: { - label: "图像静止监听器", - des: "检测当前图像是否长期处于静止", - }, } const stepForm = ref(null) const changeType = (e) => { @@ -153,8 +145,7 @@ const isShowInputNumber = (data) => { if (data === "isOpenH5Listener" || data === "isOpenPackageListener" || data === "isOpenActivityListener" - || data === "isOpenNetworkListener" - || data === "isOpenImageListener") { + || data === "isOpenNetworkListener") { return false; } else { return true; @@ -417,7 +408,8 @@ const androidOptions = ref([ }, { value: "readText", - label: "图像文字识别", + label: "图像文字识别(暂时关闭)", + disabled: true }, ], }, @@ -614,7 +606,8 @@ const iOSOptions = ref([ }, { value: "readText", - label: "图像文字识别", + label: "图像文字识别(暂时关闭)", + disabled: true }, ], }, diff --git a/src/components/TestCaseList.vue b/src/components/TestCaseList.vue index c6c75d63..67507f7e 100644 --- a/src/components/TestCaseList.vue +++ b/src/components/TestCaseList.vue @@ -17,7 +17,9 @@ const pageSize = ref(15); const name = ref("") const caseId = ref(0) const dialogVisible = ref(false) +const tableLoading = ref(false) const getTestCaseList = (pageNum, pSize) => { + tableLoading.value = true axios.get("/controller/testCases/list", { params: { projectId: props.projectId, @@ -28,6 +30,7 @@ const getTestCaseList = (pageNum, pSize) => { } }).then(resp => { pageData.value = resp.data + tableLoading.value = false }) } const deleteCase = (id) => { @@ -58,6 +61,11 @@ watch(dialogVisible, (newValue, oldValue) => { caseId.value = 0 } }) +watch( + () => props.projectId, + () => { + getTestCaseList(); +}) const editCase = async (id) => { caseId.value = id await open() @@ -78,7 +86,7 @@ defineExpose({open}) :case-id="caseId" :platform="platform" @flush="flush"/> - diff --git a/src/components/TestSuiteUpdate.vue b/src/components/TestSuiteUpdate.vue index 99cc6936..d3c26fe3 100644 --- a/src/components/TestSuiteUpdate.vue +++ b/src/components/TestSuiteUpdate.vue @@ -3,6 +3,8 @@ import {onMounted, ref} from "vue"; import axios from "../http/axios"; import {ElMessage} from "element-plus"; import {useRoute} from "vue-router"; +import RenderDeviceName from "./RenderDeviceName.vue"; +import RenderStatus from "./RenderStatus.vue"; const route = useRoute() const props = defineProps({ @@ -43,12 +45,14 @@ const testSuite = ref({ testCases: [] }) const deviceData = ref([]) +const deviceDataBack = ref([]) const getDevice = (platform) => { axios .get("/controller/devices/listAll", {params: {platform}}) .then((resp) => { if (resp['code'] === 2000) { deviceData.value = resp.data; + deviceDataBack.value = resp.data; } }); } @@ -91,6 +95,20 @@ const getSuiteInfo = (id) => { } }) } +const filterDevice = (name) => { + if (name) { + deviceData.value = deviceDataBack.value.filter((item) => { + if ((item['model'] && item['model'].indexOf(name) !== -1) + || (item['nickName'] && item['nickName'].indexOf(name) !== -1) + || (item['chiName'] && item['chiName'].indexOf(name) !== -1) + || (item['udId'] && item['udId'].indexOf(name) !== -1)) { + return true + } + }) + } else { + deviceData.value = deviceDataBack.value + } +} onMounted(() => { if (props.suiteId !== 0) { getSuiteInfo(props.suiteId) @@ -173,13 +191,16 @@ onMounted(() => { - - + + { > - {{ item.model }} + + {{ item['udId'] }} + + - - + + { clearInterval(timer.value); }); }; +// 根据接口返回页数处理 +const handleFindAll = (pageNum, pageSize) => { + if (pageNum) { + currDevicesPage.value = pageNum + } + findAll(currDevicesPage.value, pageSize) +} const findAgentById = (id) => { let result = '未知' for (let i in agentList.value) { @@ -414,7 +425,7 @@ const findTemper = () => { const refresh = () => { refreshTime.value++; getFilterOption(); - findAll(); + handleFindAll(); getAllAgents(); findTemper(); if (refreshTime.value === 2) { @@ -843,7 +854,7 @@ onUnmounted(() => { :total="pageData['totalElements']" :current-page="pageData['number']+1" :page-size="pageData['size']" - @change="findAll" + @change="handleFindAll" > diff --git a/src/views/Elements.vue b/src/views/Elements.vue index 7c596790..e8b67987 100644 --- a/src/views/Elements.vue +++ b/src/views/Elements.vue @@ -9,16 +9,25 @@ import {ElMessage} from "element-plus"; const route = useRoute() const dialogElement = ref(false) const elementId = ref(0) +const deleteId = ref(0) const pageData = ref({}); const pageSize = ref(15); const name = ref("") const types = ref([]) +const stepList = ref([]) +const checkDialog = ref(false) watch(dialogElement, (newValue, oldValue) => { if (!newValue) { elementId.value = 0 } }) +watch(checkDialog, (newValue, oldValue) => { + if (!newValue) { + deleteId.value = 0; + stepList.value = []; + } +}) const editElement = async (id) => { elementId.value = id await open() @@ -44,6 +53,23 @@ const getElementList = (pageNum, pSize) => { }) } const deleteEle = (id) => { + axios.get("/controller/elements/deleteCheck", { + params: { + id + } + }).then(resp => { + if (resp['code'] === 2000) { + stepList.value = resp['data']; + if (stepList.value.length === 0) { + deleteReal(id); + } else { + deleteId.value = id; + checkDialog.value = true; + } + } + }) +} +const deleteReal = (id) => { axios.delete("/controller/elements", { params: { id @@ -53,6 +79,7 @@ const deleteEle = (id) => { ElMessage.success({ message: resp['message'], }); + checkDialog.value = false; getElementList(); } }) @@ -70,6 +97,28 @@ onMounted(() => { + + + + + + + + + + + +
+ 确认删除 +
+
添加控件元素 -import {onMounted} from "vue"; -import {useStore} from "vuex"; -import {useRoute} from "vue-router"; import Header from "../components/Header.vue" - -const store = useStore(); -const route = useRoute(); -onMounted(() => { -})
- + { > - +