提交 cb2b71b3 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

hide tabs for unit test

上级 2bf9cba5
......@@ -89,7 +89,7 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st
isTerminal := false
reader1 := bufio.NewReader(stdout)
for {
line, err2 := reader1.ReadString('\n')
line, err3 := reader1.ReadString('\n')
if line != "" {
sendOutputMsg(line, "", wsMsg)
logUtils.ExecConsole(1, line)
......@@ -98,7 +98,7 @@ func RunUnitTest(ch chan int, sendOutputMsg, sendExecMsg func(info, isRunning st
isTerminal = true
}
if err2 != nil || io.EOF == err2 {
if err3 != nil || io.EOF == err3 {
break
}
......
......@@ -3,6 +3,9 @@
@import './variables.less';
@import './mixin.less';
.t-hidden {
display: none !important;
}
.t-icon {
cursor: pointer;
}
......
......@@ -12,6 +12,7 @@
v-if="!item.hidden"
:to="item.path"
:class="{'active': belongTopMenu === item.path }"
:id="pathToId(item.path)"
class="indexlayout-top-menu-li"
>
{{t(item.title)}}
......@@ -40,6 +41,7 @@ import RightTopProject from './RightTopProject.vue';
interface RightTopSetupData {
t: (key: string | number) => string;
topMenuCon: Ref;
pathToId: (val) => void
}
export default defineComponent({
......@@ -87,10 +89,14 @@ export default defineComponent({
const { topNavEnable } = toRefs(props);
const { topMenuCon } = useTopMenuWidth(topNavEnable);
const pathToId = (path) => {
return path.replaceAll('/', 'menu-')
}
return {
t,
topMenuCon,
pathToId,
}
}
})
......
......@@ -20,12 +20,13 @@
</template>
<script lang="ts">
import {computed, ComputedRef, defineComponent, onMounted, Ref, ref} from "vue";
import {computed, ComputedRef, defineComponent, onMounted, Ref, ref, watch} from "vue";
import {useStore} from "vuex";
import {ProjectData} from "@/store/project";
import ProjectCreateForm from "@/views/component/project/create.vue";
import {createProject} from "@/services/project";
import {addClass, removeClass} from "@/utils/dom";
interface RightTopProject {
projects: ComputedRef<any[]>;
......@@ -48,8 +49,24 @@ export default defineComponent({
const currProject = computed<any>(() => store.state.project.currProject);
store.dispatch('project/fetchProject', '');
const hideMenu = () => {
const scriptMenu = document.getElementById('menu-script')
if (currProject.value.type === 'unit') addClass(scriptMenu, 't-hidden')
else removeClass(scriptMenu,'t-hidden')
const scriptSync = document.getElementById('menu-sync')
if (currProject.value.type === 'unit') addClass(scriptSync,'t-hidden')
else removeClass(scriptSync,'t-hidden')
}
watch(currProject,()=> {
console.log('watch currProject', currProject)
hideMenu()
}, {deep: true})
onMounted(() => {
console.log('onMounted')
hideMenu()
})
const selectProject = (value): void => {
......
......@@ -58,4 +58,23 @@ export function scroll(id: string): void {
elem.scrollTop = elem.scrollHeight + 100;
},300);
}
}
export function hasClass( elements, cName ){
if (!elements) return false
return !!elements.className.match( new RegExp( "(\\s|^)" + cName + "(\\s|$)") )
}
export function addClass( elements, cName ){
console.log(elements)
if (!elements) return
if( !hasClass( elements,cName ) ){
elements.className += " " + cName
}
}
export function removeClass( elements, cName ){
if (!elements) return
if( hasClass( elements,cName ) ){
elements.className = elements.className.replace( new RegExp( "(\\s|^)" + cName + "(\\s|$)" ), " " )
}
}
\ No newline at end of file
......@@ -58,7 +58,7 @@
</template>
<script lang="ts">
import {ComputedRef, defineComponent, ref, Ref, reactive, computed, onMounted} from "vue";
import {ComputedRef, defineComponent, ref, Ref, reactive, computed, onMounted, watch} from "vue";
import {Execution} from '../data.d';
import {useStore} from "vuex";
......@@ -155,6 +155,12 @@ export default defineComponent({
await store.dispatch('History/list', {});
loading.value = false;
}
list();
watch(currProject,()=> {
console.log('watch currProject', currProject)
list()
}, {deep: true})
// 查看
const viewResult = (item) => {
......@@ -182,10 +188,6 @@ export default defineComponent({
});
}
onMounted(()=> {
list();
})
const execCase = () => {
console.log("execCase")
router.push(`/exec/run/case/-/-`)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册