Răsfoiți Sursa

Merge branch 'insist' into http_test

qinzhipeng_v@didiglobal.com 4 ani în urmă
părinte
comite
8e14a416c2

+ 57 - 42
src/views/monthly/components/createdMonthly.vue

@@ -1,23 +1,27 @@
 <template>
   <el-dialog :show="show" :title="title" :visible.sync="monthly_show" width="60%" class="public_task" @close="$emit('update:show', false)">
     <div class="blueStripe" />
-    <el-form ref="monthly_form" :model="monthly_form" :rules="rules" label-position="left" label-width="80px">
-      <el-form-item label="标题" prop="title">
-        <el-input v-model="monthly_form.title" placeholder="请输入" />
-      </el-form-item>
-      <el-form-item label="缩略图" prop="thumb">
-        <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-success="handlePictureCardPreview" :on-remove="handleRemove">
-          <i class="el-icon-plus" />
-          <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5MB</div>
-        </el-upload>
-      </el-form-item>
-      <el-form-item label="素材" prop="content">
-        <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-success="handlePictureCardPreviewTow" :on-remove="handleRemoveTow">
-          <i class="el-icon-plus" />
-          <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5MB</div>
-        </el-upload>
-      </el-form-item>
-    </el-form>
+    <div class="monthly-justify">
+      <div class="monthly-thumb"><span style="color: #F56C6C;">*</span> 标题</div>
+      <el-input v-model="monthly_form.title" placeholder="请输入" @input="getInput(monthly_form.title)" />
+    </div>
+    <div v-show="titles" class="monthly-tip"> 标题不能为空</div>
+    <div class="monthly-justify">
+      <div class="monthly-thumb"><span style="color: #F56C6C;">*</span> 缩略图</div>
+      <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-success="handlePictureCardPreview">
+        <i class="el-icon-plus" />
+        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5MB</div>
+      </el-upload>
+    </div>
+    <div v-show="thumb" class="monthly-tip"> 缩略图不能为空</div>
+    <div class="monthly-justify">
+      <div class="monthly-thumb"><span style="color: #F56C6C;">*</span> 素材</div>
+      <el-upload action="http://star.xiaojukeji.com/upload/img.node" list-type="picture-card" :limit="1" :multiple="false" :on-success="handlePictureCardPreviewTow">
+        <i class="el-icon-plus" />
+        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过5MB</div>
+      </el-upload>
+    </div>
+    <div v-show="content" class="monthly-tip"> 素材不能为空</div>
     <span slot="footer" class="dialog-footer">
       <el-button @click="monthly_show = false">取 消</el-button>
       <el-button type="primary" @click="monthly_dialog">创 建</el-button>
@@ -35,11 +39,9 @@ export default {
     return {
       monthly_show: this.show,
       monthly_form: {},
-      rules: {
-        title: [{ required: true, message: '标题不能为空', trigger: 'change' }],
-        thumb: [{ required: true, message: '缩略图不能为空', trigger: 'change' }],
-        content: [{ required: true, message: '素材不能为空', trigger: 'change' }]
-      }
+      content: false,
+      thumb: false,
+      titles: false
     }
   },
   watch: {
@@ -52,33 +54,25 @@ export default {
   },
   methods: {
     monthly_dialog() {
-      this.$refs.monthly_form.validate((valid) => {
-        if (valid) {
-          this.$emit('monthly_created', this.monthly_form)
-          this.$emit('update:show', false)
-        }
-      })
-    },
-    handleClose(done) {
-      this.monthly_show = false
-    },
-    handleRemoveTow(file, fileList) {
-      if (fileList.length === 0) {
-        this.kfFormRules.content = [{ required: true, message: '素材不能为空', trigger: 'change' }]
+      !this.monthly_form.title ? this.titles = true : ''
+      !this.monthly_form.thumb ? this.thumb = true : ''
+      !this.monthly_form.content ? this.content = true : ''
+      if (!this.monthly_form.content || !this.monthly_form.thumb || !this.monthly_form.title) {
+        return false
       }
+      this.$emit('monthly_created', this.monthly_form)
+      this.$emit('update:show', false)
+    },
+    getInput(one) {
+      one ? this.titles = false : this.titles = true
     },
     handlePictureCardPreviewTow(file) {
       this.monthly_form.content = 'http:' + file.url
-      this.$refs.monthly_form.clearValidate('content')
-    },
-    handleRemove(file, fileList) {
-      if (fileList.length === 0) {
-        this.kfFormRules.thumb = [{ required: true, message: '缩略图不能为空', trigger: 'change' }]
-      }
+      this.content = false
     },
     handlePictureCardPreview(file) {
       this.monthly_form.thumb = 'http:' + file.url
-      this.$refs.monthly_form.clearValidate('thumb')
+      this.thumb = false
     }
   }
 }
@@ -92,6 +86,27 @@ export default {
     color: #303133;
     padding-left: 10px;
 }
+.monthly-justify {
+  display: flex;
+  justify-content: flex-start;
+  margin-bottom: 20px;
+}
+.monthly-tip {
+  color: #F56C6C;
+  font-size: 12px;
+  line-height: 1;
+  padding-bottom: 20px;
+  margin-left: 80px;
+}
+.monthly-thumb {
+  width: 80px;
+  font-size: 14px;
+  color: #606266;
+  font-weight: 700;
+  line-height: 40px;
+  padding: 0 12px 0 0;
+  box-sizing: border-box;
+}
 
 .blueStripe {
   width:4px;

+ 7 - 13
src/views/monthly/index.vue

@@ -16,17 +16,17 @@
         </div>
         <div v-for="item in monthly_nav_list" :key="item.id">
           <div class="monthly-nav-center">
-            <i class="el-icon-document monthly-hover" @click="monthlyGetData(item)"> {{ item.title }}</i>
-            <i class="el-icon-close monthly-hover" @click="monthlyDelete(item.id)" />
+            <el-tooltip v-if="item.title && item.title.length > 12" class="item" effect="dark" :content="item.title" placement="top">
+              <i class="el-icon-document monthly-hover" @click="monthlyGetData(item)"> {{ item.title | ellipsis }}</i>
+            </el-tooltip>
+            <div v-else class="el-icon-document monthly-hover" @click="monthlyGetData(item)"> {{ item.title | ellipsis }}</div>
+            <i v-show="monthly_show" class="el-icon-close monthly-hover" @click="monthlyDelete(item.id)" />
           </div>
         </div>
       </el-aside>
       <el-main class="monthly-main">
         <div class="monthly-main-title">
-          <el-tooltip v-if="monthly_main_image.title && monthly_main_image.title.length > 12" class="item" effect="dark" :content="monthly_main_image.title" placement="top">
-            <div>{{ monthly_main_image.title | ellipsis }}</div>
-          </el-tooltip>
-          <div v-else>{{ monthly_main_image.title | ellipsis }}</div>
+          <div>{{ monthly_main_image.title }}</div>
           <div class="monthly-main-date">{{ monthly_main_image.gmtCreate }}</div>
         </div>
         <div class="demo-image__placeholder" style="padding: 20px 0;">
@@ -103,11 +103,7 @@ export default {
           this.$router.push({ name: 'env' })
           break
         case '4' :
-          if (!this.bizId || this.bizId === -1) {
-            this.$router.push({ name: '业务线选择' })
-          } else {
-            this.$router.push({ name: '项目' })
-          }
+          this.$router.push({ name: '项目' })
           break
         case '9':
           this.$router.push({ name: 'Interface' })
@@ -130,7 +126,6 @@ export default {
       })
     },
     async monthly_created(data) {
-      console.log(data, 'cdbjksbkj')
       const res = await materialAddMaterial(data)
       if (res.code === 200) {
         this.materialGetMaterialList()
@@ -140,7 +135,6 @@ export default {
     addMonthly() {
       this.title = '新建'
       this.show = true
-      console.log(this.show)
     }
   }
 }

+ 7 - 0
src/views/quality/components/requireDrawer.vue

@@ -9,6 +9,9 @@
       </el-table-column>
       <el-table-column :label="Statistics.typeStr + '名称'" min-width="250">
         <template slot-scope="scope">
+          <div v-if="Statistics.typeStr === '缺陷'" class="drawer-id">{{ scope.row.bugId }}</div>
+          <div v-if="Statistics.typeStr === '任务'" class="drawer-id">{{ scope.row.taskIdSting }}</div>
+          <div v-if="Statistics.typeStr === '需求'" class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
           <div v-if="Statistics.typeStr === '需求' || Statistics.typeStr === '任务'" class="drawer-name" @click="jumper(scope.row)">{{ scope.row.name }}</div>
           <div v-if="Statistics.typeStr === '缺陷'" class="drawer-name" @click="jumper(scope.row)">{{ scope.row.bugName }}</div>
         </template>
@@ -165,6 +168,10 @@ export default {
   border-radius: 4px;
   margin-left: 4px;
 }
+.drawer-id {
+  color: rgb(167, 174, 188);
+  font-size: 10px;
+}
 ._font {
   font-size: 16px;
   color: #409eff;