提交 af76c27c 编写于 作者: H Hao Sun

* optimize style for forms.

上级 748ee657
<template> <template>
<div class="tab-page-exec-unit"> <div class="tab-page-exec-unit">
<Form labelCol="6" wrapperCol="26"> <Form labelCol="6" wrapperCol="26">
<FormItem name="cmd" :label="t('test_cmd')" :info="validateInfos.cmd"> <FormItem labelWidth="100px" name="cmd" :label="t('test_cmd')" :info="validateInfos.cmd">
<input v-model="modelRef.cmd" @keydown="keydown"/> <input v-model="modelRef.cmd" @keydown="keydown"/>
</FormItem> </FormItem>
<FormItem v-if="currProduct.id" name="submitResult" :label="t('submit_result_to_zentao')"> <FormItem labelWidth="100px" v-if="currProduct.id" name="submitResult" :label="t('submit_result_to_zentao')">
<input v-model="modelRef.submitResult" type="checkbox"> <input v-model="modelRef.submitResult" type="checkbox">
</FormItem> </FormItem>
<FormItem> <FormItem labelWidth="100px">
<Button :disabled="isRunning === 'true' || !modelRef.cmd" @click="start" class="rounded"> <Button :disabled="isRunning === 'true' || !modelRef.cmd" @click="start" class="rounded">
{{ t('exec') }} {{ t('exec') }}
</Button> </Button>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</Button> </Button>
</FormItem> </FormItem>
<FormItem> <FormItem labelWidth="100px">
<span class="t-tips">{{ t('cmd_nav') }}</span> <span class="t-tips">{{ t('cmd_nav') }}</span>
</FormItem> </FormItem>
</Form> </Form>
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
:showModal="showModalRef" :showModal="showModalRef"
@onCancel="cancel" @onCancel="cancel"
@onOk="submit" @onOk="submit"
:title="info == undefined ? t('create_interpreter') : t('edit_interpreter')" :title="info == undefined ? t('create_interpreter') : t('edit_interpreter')"
:contentStyle="{width: '600px'}" :contentStyle="{width: '500px'}"
> >
<Form class="form-interpreter" labelCol="6" wrapperCol="16"> <Form class="form-interpreter" labelCol="6" wrapperCol="16">
<FormItem <FormItem
labelWidth="100px"
name="lang" name="lang"
:label="t('script_lang')" :label="t('script_lang')"
:info="validateInfos.lang" :info="validateInfos.lang"
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
</select> </select>
</FormItem> </FormItem>
<FormItem <FormItem
labelWidth="100px"
v-if="isElectron" v-if="isElectron"
name="path" name="path"
:label="t('interpreter_path')" :label="t('interpreter_path')"
...@@ -34,6 +36,7 @@ ...@@ -34,6 +36,7 @@
<Button v-if="isElectron" @click="selectFile" class="state secondary select-dir-btn">{{t('select')}}</Button> <Button v-if="isElectron" @click="selectFile" class="state secondary select-dir-btn">{{t('select')}}</Button>
</FormItem> </FormItem>
<FormItem <FormItem
labelWidth="100px"
v-if="!isElectron" v-if="!isElectron"
name="path" name="path"
:label="t('interpreter_path')" :label="t('interpreter_path')"
...@@ -42,6 +45,7 @@ ...@@ -42,6 +45,7 @@
<input v-model="modelRef.path" /> <input v-model="modelRef.path" />
</FormItem> </FormItem>
<FormItem <FormItem
labelWidth="100px"
name="lang" name="lang"
v-if="interpreterInfos.length > 0" v-if="interpreterInfos.length > 0"
:label="t('script_lang')" :label="t('script_lang')"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
@onCancel="close" @onCancel="close"
@onOk="submit" @onOk="submit"
:title="t('submit_result_to_zentao')" :title="t('submit_result_to_zentao')"
:contentStyle="{width: '500px'}"
> >
<Form labelCol="6" wrapperCol="16"> <Form labelCol="6" wrapperCol="16">
<FormItem name="title" :label="t('title')" :info="validateInfos.title"> <FormItem name="title" :label="t('title')" :info="validateInfos.title">
...@@ -11,50 +12,60 @@ ...@@ -11,50 +12,60 @@
</FormItem> </FormItem>
<FormItem name="module" :label="t('module')"> <FormItem name="module" :label="t('module')">
<select name="module" v-model="modelRef.module"> <div class="select">
<option value=""></option> <select name="module" v-model="modelRef.module">
<option v-for="item in modules" :key="item.code" :value="item.code+''"> <option value=""></option>
{{ item.name }} <option v-for="item in modules" :key="item.code" :value="item.code+''">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem name="type" :label="t('category')"> <FormItem name="type" :label="t('category')">
<select name="type" v-model="modelRef.type"> <div class="select">
<option value=""></option> <select name="type" v-model="modelRef.type">
<option v-for="item in types" :key="item.code" :value="item.code+''"> <option value=""></option>
{{ item.name }} <option v-for="item in types" :key="item.code" :value="item.code+''">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem name="openedBuild" :label="t('version')"> <FormItem name="openedBuild" :label="t('version')">
<select name="openedBuild" v-model="modelRef.openedBuild"> <div class="select">
<option value=""></option> <select name="openedBuild" v-model="modelRef.openedBuild">
<option v-for="item in builds" :key="item.code" :value="item.code+''"> <option value=""></option>
{{ item.name }} <option v-for="item in builds" :key="item.code" :value="item.code+''">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem name="severity" :label="t('severity')"> <FormItem name="severity" :label="t('severity')">
<select name="severity" v-model="modelRef.severity"> <div class="select">
<option v-for="item in severities" :key="item.code" :value="item.code+''"> <select name="severity" v-model="modelRef.severity">
{{ item.name }} <option v-for="item in severities" :key="item.code" :value="item.code+''">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem name="priority" :label="t('priority')"> <FormItem name="priority" :label="t('priority')">
<select name="priority" v-model="modelRef.pri"> <div class="select">
<option v-for="item in priorities" :key="item.code" :value="item.code+''"> <select name="priority" v-model="modelRef.pri">
{{ item.name }} <option v-for="item in priorities" :key="item.code" :value="item.code+''">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem name="type" :label="t('step')"> <FormItem name="type" :label="t('step')">
<textarea v-model="modelRef.steps" rows="3" /> <textarea v-model="modelRef.steps" rows="6" />
</FormItem> </FormItem>
</Form> </Form>
</ZModal> </ZModal>
...@@ -177,4 +188,4 @@ defineExpose({ ...@@ -177,4 +188,4 @@ defineExpose({
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
...@@ -4,15 +4,18 @@ ...@@ -4,15 +4,18 @@
@onCancel="close" @onCancel="close"
@onOk="submit" @onOk="submit"
:title="t('submit_result_to_zentao')" :title="t('submit_result_to_zentao')"
:contentStyle="{width: '300px'}"
> >
<Form labelCol="6" wrapperCol="16"> <Form labelCol="6" wrapperCol="16">
<FormItem name="taskId" :label="t('task')"> <FormItem name="taskId" :label="t('task')">
<select name="taskId" v-model="modelRef.taskId"> <div class="select">
<option value="0"></option> <select name="taskId" v-model="modelRef.taskId">
<option v-for="item in tasks" :key="item.id" :value="item.id"> <option value="0"></option>
{{ item.name }} <option v-for="item in tasks" :key="item.id" :value="item.id">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
</Form> </Form>
</ZModal> </ZModal>
...@@ -116,4 +119,4 @@ defineExpose({ ...@@ -116,4 +119,4 @@ defineExpose({
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
...@@ -10,23 +10,23 @@ ...@@ -10,23 +10,23 @@
<FormItem name="name" :label="t('name')" :info="validateInfos.name"> <FormItem name="name" :label="t('name')" :info="validateInfos.name">
<input v-model="modelRef.name" /> <input v-model="modelRef.name" />
</FormItem> </FormItem>
<FormItem name="path" :label="t('path')" :info="validateInfos.path"> <FormItem name="path" :label="t('path')" :info="validateInfos.path">
<input v-if="isElectron" v-model="modelRef.path" <input v-if="isElectron" v-model="modelRef.path" />
/> <Button v-if="isElectron" @click="selectDir" class="state secondary flex-none rounded">{{t('select')}}</Button>
<Button v-if="isElectron" @click="selectDir" class="state secondary select-dir-btn">{{t('select')}}</Button>
<input v-if="!isElectron" v-model="modelRef.path" /> <input v-if="!isElectron" v-model="modelRef.path" />
</FormItem> </FormItem>
<FormItem name="type" :label="t('type')" :info="validateInfos.type"> <FormItem name="type" :label="t('type')" :info="validateInfos.type">
<select name="type" @change="selectType" v-model="modelRef.type"> <div class="select">
<option <select name="type" @change="selectType" v-model="modelRef.type">
v-for="item in testTypes" <option
:key="item.value" v-for="item in testTypes"
:value="item.value" :key="item.value"
> :value="item.value"
{{ item.label }} >
</option> {{ item.label }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem <FormItem
v-if="modelRef.type === 'ztf'" v-if="modelRef.type === 'ztf'"
...@@ -34,17 +34,16 @@ ...@@ -34,17 +34,16 @@
:label="t('default_lang')" :label="t('default_lang')"
:info="validateInfos.lang" :info="validateInfos.lang"
> >
<select name="type" v-model="modelRef.lang"> <div class="select">
<option v-for="item in langs" :key="item.code" :value="item.code"> <select name="type" v-model="modelRef.lang">
{{ item.name }} <option v-for="item in langs" :key="item.code" :value="item.code">
</option> {{ item.name }}
</select> </option>
</select>
</div>
</FormItem> </FormItem>
<FormItem v-if="showCmd" name="cmd" :label="t('cmd')" :info="validateInfos.cmd"> <FormItem v-if="showCmd" name="cmd" :label="t('cmd')" :info="validateInfos.cmd" :helpText="t('tips_test_cmd', {cmd: cmdSample})">
<textarea v-model="modelRef.cmd" /> <textarea v-model="modelRef.cmd" />
<div class="t-tips" style="margin-top: 5px;">
<div>{{ t('tips_test_cmd', {cmd: cmdSample}) }}</div>
</div>
</FormItem> </FormItem>
</Form> </Form>
</ZModal> </ZModal>
...@@ -168,10 +167,3 @@ defineExpose({ ...@@ -168,10 +167,3 @@ defineExpose({
clearFormData, clearFormData,
}); });
</script> </script>
<style>
.select-dir-btn{
position: absolute;
right: 20px;
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册