Browse Source

优化

master
陈裕财 3 years ago
parent
commit
b93f8675c1
  1. 21
      src/components/MDinput/index.vue
  2. 6
      src/views/xm/core/xmQuestion/XmQuestionEdit.vue

21
src/components/MDinput/index.vue

@ -2,22 +2,22 @@
<div class="material-input__component" :class="computedClasses">
<div :class="{iconClass:icon}">
<i class="el-input__icon material-input__icon" :class="['el-icon-' + icon]" v-if="icon"></i>
<input v-if="type === 'email'" type="email" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'email'" type="email" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :required="required" @focus="handleMdFocus"
@blur="handleMdBlur" @input="handleModelInput">
<input v-if="type === 'url'" type="url" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'url'" type="url" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :required="required" @focus="handleMdFocus"
@blur="handleMdBlur" @input="handleModelInput">
<input v-if="type === 'number'" type="number" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'number'" type="number" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:step="step" :readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :max="max" :min="min" :minlength="minlength"
:maxlength="maxlength" :required="required" @focus="handleMdFocus" @blur="handleMdBlur" @input="handleModelInput">
<input v-if="type === 'password'" type="password" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'password'" type="password" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :max="max" :min="min" :required="required" @focus="handleMdFocus"
@blur="handleMdBlur" @input="handleModelInput">
<input v-if="type === 'tel'" type="tel" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'tel'" type="tel" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :required="required" @focus="handleMdFocus"
@blur="handleMdBlur" @input="handleModelInput">
<input v-if="type === 'text'" type="text" class="material-input" :name="name" :placeholder="fillPlaceHolder" v-model="currentValue"
<input v-if="type === 'text'" type="text" class="material-input" :name="name" :placeholder="placeholder" v-model="currentValue"
:readonly="readonly" :disabled="disabled" :autoComplete="autoComplete" :minlength="minlength" :maxlength="maxlength"
:required="required" @focus="handleMdFocus" @blur="handleMdBlur" @input="handleModelInput">
<span class="material-input-bar"></span>
@ -79,8 +79,7 @@ export default {
data() {
return {
currentValue: this.value,
focus: false,
fillPlaceHolder: null
focus: false,
}
},
methods: {
@ -97,14 +96,12 @@ export default {
handleMdFocus(event) {
this.focus = true
this.$emit('focus', event)
if (this.placeholder && this.placeholder !== '') {
this.fillPlaceHolder = this.placeholder
if (this.placeholder && this.placeholder !== '') {
}
},
handleMdBlur(event) {
this.focus = false
this.$emit('blur', event)
this.fillPlaceHolder = null
this.$emit('blur', event)
if (this.$parent.$options.componentName === 'ElFormItem') {
if (this.validateEvent) {
this.$parent.$emit('el.form.blur', [this.currentValue])

6
src/views/xm/core/xmQuestion/XmQuestionEdit.vue

@ -6,10 +6,10 @@
<el-col :span="18" class="border padding">
<el-form-item label="" prop="name" label-width="0px">
<el-row>
<span><span v-if="opType!='add'" class="label-font-color">用例编号:</span>&nbsp;&nbsp;{{editForm.caseId}} &nbsp;&nbsp;</span><span class="label-font-color"><i class="el-icon-s-operation"></i>模块:</span><span>{{editForm.funcName}} <el-button type="text" @click="funcVisible=true">选择模块</el-button></span>
<span><span v-if="opType!=='add'" class="label-font-color">用例编号:</span>&nbsp;&nbsp;{{editForm.caseId}} &nbsp;&nbsp;</span><span class="label-font-color"><i class="el-icon-s-operation"></i>模块:</span><span>{{editForm.funcName}} <el-button type="text" @click="funcVisible=true">选择模块</el-button></span>
</el-row>
<my-input v-model="editForm.name"></my-input>
<span v-if="opType!='add'">
<my-input v-model="editForm.name" placeholder="缺陷标题"></my-input>
<span v-if="opType!=='add'">
<el-tag>{{editForm.createUsername}} {{editForm.createTime}} 创建 </el-tag>
<el-divider direction="vertical"></el-divider>
<el-tag v-if="editForm.tagNames">{{editForm.tagNames?editForm.tagNames:''}} </el-tag>

Loading…
Cancel
Save