|
@@ -1,1477 +0,0 @@
|
|
|
-<template>
|
|
|
- <div v-loading="loading.drawer" class="bug-detail">
|
|
|
- <el-container
|
|
|
- v-loading.fullscreen.lock="loading.fullscreen"
|
|
|
- :style="type=='page'?{'background-color': '#F2F3F6','padding': '1%'}:{'background-color': '#F56C6C','overflow': 'auto','height':height}"
|
|
|
- class="bug_manage_container scop"
|
|
|
- >
|
|
|
- <el-header height="0" />
|
|
|
- <el-container ref="box" :style="type=='page'?{'margin-top':'10px'}:{}" class="bug_manage" :direction="type == 'page'?'horizontal':'vertical'">
|
|
|
- <el-aside :style="type=='page'?{'margin-right':'10px','width':'70%'}:{'width':'100%'}">
|
|
|
- <el-main v-loading="loading.details" class="layout_main bug_manage_bug_details" :style="type=='page'?{'padding': '20px 30px'}:{'padding-left': '30px','padding-right': '30px'}">
|
|
|
- <div class="module_title">
|
|
|
- <div class="module_title__sign" />
|
|
|
- <div class="module_title__caption">问题详情</div>
|
|
|
- <div style="display;margin-left:78%;" @mouseover="iconName = 'float_反馈_icon_close_蓝色'" @mouseleave="iconName = 'float_反馈_icon_close'" @mousedown="closeDrawer();">
|
|
|
- <el-button size="medium" type="text" style="margin-top:-5px;">
|
|
|
- <svg-icon :icon-class="iconName" />
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-divider v-if="type !== 'page'" />
|
|
|
- <div style="font-size:20px;margin-top:3%">
|
|
|
- {{ bug.bizName }}
|
|
|
- </div>
|
|
|
- <div style="margin-left:70%;margin-top:-3%">
|
|
|
- <el-button size="mini">待处理</el-button>
|
|
|
- <el-button type="primary" size="mini">复盘</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-container width="100%" style="margin-top:2%">
|
|
|
- <el-aside width="49%" style="margin-right: 2%">
|
|
|
- <el-form label-width="30%" label-position="left" label-suffix=":">
|
|
|
-
|
|
|
- <el-form-item label="问题来源">
|
|
|
- <el-select v-model="bug.taskId" filterable clearable @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in taskEnumList"
|
|
|
- :key="item.id"
|
|
|
- class="test123"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="紧急程度">
|
|
|
- <el-select v-model="bug.priorityLevel" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.priorityLevelEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.name"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="提报人">
|
|
|
- <div style="padding-left: 15px;color: #666666; font-weight: 500">{{ bug.bizName }}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="责任人">
|
|
|
- <el-select v-model="bug.discoveryStage" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.bugStageEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="问题级别">
|
|
|
- <el-select v-model="bug.theBugType" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.theBugTypeEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-aside>
|
|
|
- <el-aside width="49%">
|
|
|
- <el-form label-width="30%" label-position="left" label-suffix=":">
|
|
|
- <el-form-item label="问题类型">
|
|
|
- <el-select v-model="bug.sysType" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.sysTypeEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属业务">
|
|
|
- <el-select v-model="bug.priority" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.priorityEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="处理人">
|
|
|
- <el-cascader v-model="bug.moduleIds" class="current" collapse-tags :props="props" :options="business_platform_Modular" placeholder="请选择" @change="bugUpdate(bug,'details')" @click.native="getBusinessLinePlatformModule" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="完成时间">
|
|
|
- <el-select v-model="bug.discoveryMeth" @change="bugUpdate(bug,'details')">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.discoveryMethEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </el-form>
|
|
|
- </el-aside>
|
|
|
- </el-container>
|
|
|
- </el-main>
|
|
|
- </el-aside>
|
|
|
- <el-aside :width="type=='page'?'29.2%':'100%'" />
|
|
|
- </el-container>
|
|
|
- <el-container :style="type=='page'?{'width':'70%'}:{'width':'100%'}" direction="vertical">
|
|
|
- <el-main v-loading="loading.describe" :style="type=='page'?{'padding': '20px 30px','margin-top': '10px'}:{'padding-left':'30px'}" class="layout_main">
|
|
|
- <div class="module_title">
|
|
|
- <div class="module_title__sign" />
|
|
|
- <div class="module_title__caption">描述</div>
|
|
|
- </div>
|
|
|
- <el-divider v-if="type !== 'page'" />
|
|
|
- <div
|
|
|
- v-if="bugDescribeNoHtml.length == 0 && describeEditorVisible == false"
|
|
|
- style="width: 100%;height: 300px;text-align: center;line-height: 300px"
|
|
|
- >
|
|
|
- <span class="bug_describe" @click="describeEditorVisible = true;">点击添加描述</span>
|
|
|
- </div>
|
|
|
- <el-tooltip
|
|
|
- v-if="bugDescribeNoHtml.length > 0 && describeEditorVisible == false"
|
|
|
- effect="dark"
|
|
|
- content="点击编辑"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <div class="bug_describe_content" @click="describeEditorVisible = true;">
|
|
|
- <div style="font-size:14px" v-html="bug.bugDescribe" />
|
|
|
- </div>
|
|
|
- </el-tooltip>
|
|
|
- <div v-show="describeEditorVisible" style="margin-top:15px">
|
|
|
- <div id="wage" class="toolbar" />
|
|
|
- <div id="wage1" class="text" style="font-size:14px" @blur="describeConfirm()" />
|
|
|
- <div style="margin-top:40px;float: right">
|
|
|
- <el-button @click="describeCancel()">取 消</el-button>
|
|
|
- <el-button type="primary" @click="describeConfirm()">确 认</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-main>
|
|
|
-
|
|
|
- <el-main :style="type=='page'?{'padding': '20px 30px','margin-top': '10px'}:{'padding-left':'30px'}" class="layout_main">
|
|
|
- <div class="module_title">
|
|
|
- <div class="module_title__sign" />
|
|
|
- <div class="module_title__caption">评论</div>
|
|
|
- </div>
|
|
|
- <el-divider v-if="type !== 'page'" /><br>
|
|
|
- <div>
|
|
|
- <div v-for="(item,index) in comments" :key="index" class="animated bounceInRight">
|
|
|
- <div
|
|
|
- style="font-size:14px;color:#333B4A;display: inline-block;"
|
|
|
- >{{ item.commentInfo.name }}</div>
|
|
|
- <div
|
|
|
- style="margin-left:20px;display: inline-block;color: #9B9B9B;font-size:12px"
|
|
|
- >{{ item.commentInfo.gmtCreater }}</div>
|
|
|
- <p
|
|
|
- style="font-size:14px;color:#333B4A;margin-top: 10px;white-space: pre-line;"
|
|
|
- >{{ item.commentInfo.content }}</p>
|
|
|
- <br>
|
|
|
- </div>
|
|
|
- <el-input
|
|
|
- v-model="commentContent"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入评论内容"
|
|
|
- maxlength="1000"
|
|
|
- show-word-limit
|
|
|
- :autosize="{ minRows: 3, maxRows: 5}"
|
|
|
- style="margin-bottom: 2%"
|
|
|
- />
|
|
|
- <el-button type="primary" size="small" style="float: right" @click="addComment">发表评论</el-button>
|
|
|
- </div>
|
|
|
- </el-main>
|
|
|
-
|
|
|
- <el-main :style="type=='page'?{'padding': '20px 30px','margin-top': '10px'}:{'padding-left':'30px'}" class="layout_main">
|
|
|
- <div class="module_title">
|
|
|
- <div class="module_title__sign" />
|
|
|
- <div class="module_title__caption">记录</div>
|
|
|
- </div>
|
|
|
- <el-divider v-if="type !== 'page'" /><br>
|
|
|
- <div>
|
|
|
- <div v-for="(item,index) in comments" :key="index" class="animated bounceInRight">
|
|
|
-
|
|
|
- <div style="font-size:14px;color:#333B4A;margin-top: 10px;white-space: pre-line;">
|
|
|
- {{ item.commentInfo.gmtCreater }} {{ item.commentInfo.name }} {{ item.commentInfo.name }}
|
|
|
- <br>
|
|
|
- </div>
|
|
|
- <div style="margin-top:5%" />
|
|
|
- </div>
|
|
|
- </div></el-main>
|
|
|
- </el-container>
|
|
|
- <!-- 弹窗 -->
|
|
|
- <el-dialog
|
|
|
- v-if="statusDialogVisible"
|
|
|
- :visible.sync="statusDialogVisible"
|
|
|
- width="33%"
|
|
|
- class="bug_manage_dialog"
|
|
|
- :append-to-body="true"
|
|
|
- :close-on-click-modal="false"
|
|
|
- >
|
|
|
- <template v-slot:title>
|
|
|
- <div style="display:flex;align-items: center;">
|
|
|
- <div style="width:4px;height:15px;background:#409EFF;border-radius:1px;" />
|
|
|
- <div
|
|
|
- style="width:83px;height:18px;font-size:16px;font-family:MicrosoftYaHei;color:rgba(51,59,74,1);margin-left:6px"
|
|
|
- >{{ statusDialogTitle }}</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <el-form
|
|
|
- v-if="statusDialogTitle !== '删除确认'"
|
|
|
- label-width="110px"
|
|
|
- label-position="left"
|
|
|
- :model="statusDialogForm"
|
|
|
- :rules="rules"
|
|
|
- >
|
|
|
- <el-form-item
|
|
|
- v-if="statusDialogTitle === '待测试' || statusDialogTitle === '已完成'"
|
|
|
- label="缺陷原因"
|
|
|
- prop="bugReason"
|
|
|
- >
|
|
|
- <el-select v-model="statusDialogForm.bugReason" style="width: 100%">
|
|
|
- <el-option
|
|
|
- v-for="item in enums.bugReasonEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="statusDialogTitle === '待测试'"
|
|
|
- label="修复方式"
|
|
|
- class="bug_manage_dialog bug_manage_dialog_fixMethod"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="statusDialogForm.reasonOrDesc"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入具体原因和修复方式"
|
|
|
- maxlength="300"
|
|
|
- show-word-limit
|
|
|
- rows="4"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- v-if="statusDialogTitle === '已完成'"
|
|
|
- label="修复结果"
|
|
|
- prop="repairResult"
|
|
|
- class="bug_manage_dialog"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="statusDialogForm.repairResult"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in enums.repairResultEnumList"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="item.code"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="statusDialogTitle === 'Reopen'" label="Reopen原因" prop="reasonOrDesc">
|
|
|
- <el-input
|
|
|
- v-model="statusDialogForm.reasonOrDesc"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入Reopen"
|
|
|
- maxlength="300"
|
|
|
- show-word-limit
|
|
|
- rows="4"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div v-else style="text-align:center;line-height: 150px">是否要删除当前缺陷?</div>
|
|
|
- <template v-slot:footer>
|
|
|
- <el-button @click="statusDialogCancel">取 消</el-button>
|
|
|
- <el-button type="primary" @click="statusDialogConfirm">确 定</el-button>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
- <createdBug v-if="modalShow" ref="createdBug" @father="father" />
|
|
|
- <normal-dialog
|
|
|
- :show-dialog="showCopyFile"
|
|
|
- :title="'上传截图'"
|
|
|
- :width="'40%'"
|
|
|
- :submit-button="'上传'"
|
|
|
- :top="'5vh'"
|
|
|
- @confirm="confirmUpload()"
|
|
|
- @cancel="showCopyFile=false"
|
|
|
- >
|
|
|
- <div class="file-dialog">
|
|
|
- <el-form ref="imageForm" label-width="20%" :rules="imageRules" :model="imageName">
|
|
|
- <el-form-item label="图片命名" prop="name">
|
|
|
- <el-col style="width: 75%">
|
|
|
- <el-input v-model="imageName.name" placeholder="请输入图片名称" />
|
|
|
- </el-col>
|
|
|
- <el-col style="width: 10%">.png</el-col>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div class="image">
|
|
|
- <div class="image-center">
|
|
|
- <img :src="imageUrl" class="image-url">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </normal-dialog>
|
|
|
- </el-container>
|
|
|
- <el-button id="pasteUpload" type="primary" style="display: none" @click.stop="pasteUpload">upload</el-button>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import fackClickOutSide from './fackClickOutSide.js'
|
|
|
-import E from 'wangeditor'
|
|
|
-// import Utils from '../../../../util.js'
|
|
|
-// import { settingGetTypeMap } from '@/api/taskIndex'
|
|
|
-import { getCommentList, addComment, getMemberInfo } from '@/api/requirement.js'
|
|
|
-import {
|
|
|
- bugDetails,
|
|
|
- bugGetEnum,
|
|
|
- bugDelete,
|
|
|
- bugUpdate,
|
|
|
- taskListCreate,
|
|
|
- releaseList,
|
|
|
- settingQueryBizModuleList
|
|
|
-} from '@/api/defectManage.js'
|
|
|
-// import Dropdown from './dropdown.vue'
|
|
|
-import normalDialog from '@/components/dialog/normalDialog'
|
|
|
-import createdBug from '@/views/projectManage/bugList/file/createdBug'
|
|
|
-import axios from 'axios'
|
|
|
-import { deepClone } from '@/utils/global'
|
|
|
-
|
|
|
-document.body.onpaste = function(event) {
|
|
|
- const data = (event.clipboardData || window.clipboardData)
|
|
|
- const items = data.items
|
|
|
- const fileList = [] // 存储文件数据
|
|
|
- if (items && items.length) {
|
|
|
- // 检索剪切板items
|
|
|
- for (let i = 0; i < items.length; i++) {
|
|
|
- // console.log(items[i].getAsFile()) // <--- 这里打印出来就就是你想要的文件
|
|
|
- fileList.push(items[i].getAsFile())
|
|
|
- window.uploadFiles = fileList
|
|
|
- }
|
|
|
- document.getElementById('pasteUpload').click()
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-export default {
|
|
|
- name: 'BugDetails',
|
|
|
- components: {
|
|
|
- createdBug,
|
|
|
- normalDialog
|
|
|
- },
|
|
|
- mixins: [fackClickOutSide],
|
|
|
- props: {
|
|
|
- id: {
|
|
|
- type: String,
|
|
|
- default: '0'
|
|
|
- },
|
|
|
- type: {
|
|
|
- type: String,
|
|
|
- default: 'page'
|
|
|
- },
|
|
|
- drawerShow: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- modalShow: false,
|
|
|
- iconName: 'float_反馈_icon_close',
|
|
|
- bugNameIsFocus: false,
|
|
|
- props: { multiple: true },
|
|
|
- height: '700px',
|
|
|
- bugDescribeNoHtml: '',
|
|
|
- bugDescribe: '',
|
|
|
- bugNameForm: { bugName: '' },
|
|
|
- fileList: [],
|
|
|
- notImageList: [], // 文件非图片数组
|
|
|
- ImageList: [], // 文件图片数组
|
|
|
- accessory: null,
|
|
|
- dialogVisible: false,
|
|
|
- dialogImageUrl: [],
|
|
|
- disabled: false,
|
|
|
- loading: {
|
|
|
- drawer: false,
|
|
|
- fullscreen: false,
|
|
|
- title: false,
|
|
|
- details: false,
|
|
|
- userInfo: false,
|
|
|
- time: false,
|
|
|
- appInfo: false,
|
|
|
- describe: false,
|
|
|
- accessory: false
|
|
|
- },
|
|
|
- userInformation: localStorage.getItem('username'),
|
|
|
- userNames: localStorage.getItem('realname'),
|
|
|
- comments: [],
|
|
|
- commentContent: '',
|
|
|
- uploadDialogVisible: false,
|
|
|
- uploadDialogImageUrl: '',
|
|
|
- test: '测试',
|
|
|
- num: 0,
|
|
|
- formHeight: '',
|
|
|
- formHeight1: '',
|
|
|
- userLoading: false,
|
|
|
- statusDialogVisible: false,
|
|
|
- statusDialogTitle: '',
|
|
|
- statusDialogForm: {},
|
|
|
- options: [
|
|
|
- { name: '测试', code: 1 },
|
|
|
- { name: '测试2', code: 2 }
|
|
|
- ],
|
|
|
- assignerOptions: [],
|
|
|
- currentHandlerOptions: [],
|
|
|
- bug: {},
|
|
|
- bugModel: {},
|
|
|
- editor: null,
|
|
|
- bugRemark: '',
|
|
|
- describeEditorVisible: false,
|
|
|
- enums: {},
|
|
|
- taskEnumList: [],
|
|
|
- appClientList: [],
|
|
|
- versionList: [],
|
|
|
- map: {},
|
|
|
- business_platform_Modular: [], // 业务/平台/模块
|
|
|
- bugNameTextareaStyle: {
|
|
|
- width: '1000px',
|
|
|
- position: 'relative'
|
|
|
- },
|
|
|
- bugNameTextareaWidth: 'auto',
|
|
|
- showWordLimit: false,
|
|
|
- showRule: false,
|
|
|
- rules: {
|
|
|
- assigner: [
|
|
|
- { required: true, message: '责任人不可为空', trigger: 'change' }
|
|
|
- ],
|
|
|
- currentHandler: [
|
|
|
- { required: true, message: '修复人不可为空', trigger: 'change' }
|
|
|
- ],
|
|
|
- bugName: [
|
|
|
- { required: true, message: '标题不可为空', trigger: 'blur' }
|
|
|
- ],
|
|
|
- bugReason: [
|
|
|
- { required: true, message: '请选择缺陷原因', trigger: 'change' }
|
|
|
- ],
|
|
|
- repairResult: [
|
|
|
- { required: true, message: '请选择修复结果', trigger: 'change' }
|
|
|
- ],
|
|
|
- reasonOrDesc: [
|
|
|
- { required: true, message: '请输入Reopen原因', trigger: 'blur' }
|
|
|
- ]
|
|
|
- },
|
|
|
- showCopyFile: false, // 复制文件对话框
|
|
|
- imageName: { name: null },
|
|
|
- imageUrl: null,
|
|
|
- uploadButton: this.drawerShow,
|
|
|
- imageRules: {
|
|
|
- name: [
|
|
|
- { required: true, message: '请输入图片名称', trigger: 'blur' },
|
|
|
- { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- statusDialogVisible(newVal, oldVal) {
|
|
|
- if (!newVal) {
|
|
|
- this.statusDialogForm = null
|
|
|
- }
|
|
|
- },
|
|
|
- id(newVal, oldVal) {
|
|
|
- this.bug = {}
|
|
|
- this.bugModel = {}
|
|
|
- this.bugNameForm = { bugName: '' }
|
|
|
- this.loading.drawer = false
|
|
|
- this.init()
|
|
|
- },
|
|
|
- drawerShow(newV, oldVal) {
|
|
|
- if (newV) {
|
|
|
- this.init()
|
|
|
- this.uploadButton = newV
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- if (this.type !== 'page') {
|
|
|
- var height = window.innerHeight > document.body.clientHeight ? window.innerHeight : document.body.clientHeight
|
|
|
- height -= 130
|
|
|
- this.height = height + 'px'
|
|
|
- }
|
|
|
- if (this.type === 'page' || this.type === 'drawer') {
|
|
|
- this.uploadButton = true
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.bugGetEnum()
|
|
|
- this.$nextTick(() => {
|
|
|
- this.bugGet(this.id, false).then(res => {
|
|
|
- this.PersonnelData()
|
|
|
- this.changeWidthOnBlur()
|
|
|
- releaseList().then(res => {
|
|
|
- this.appClientList = res.data.appClient // 客户端
|
|
|
- this.getVersionList(this.bug.appId)
|
|
|
- })
|
|
|
- this.RichText()
|
|
|
- })
|
|
|
- })
|
|
|
- this.getCommentList()
|
|
|
- this.getBusinessLinePlatformModule()
|
|
|
- taskListCreate({ bizId: Number(localStorage.getItem('bizId')) }).then(res => {
|
|
|
- this.taskEnumList = res.data // 所属任务
|
|
|
- })
|
|
|
- },
|
|
|
- methods: {
|
|
|
- closeDrawer() {
|
|
|
- this.$emit('close', false)
|
|
|
- },
|
|
|
- init() {
|
|
|
- this.formHeight = ''
|
|
|
- this.formHeight1 = ''
|
|
|
- this.bugGet(this.id, false).then(res => {
|
|
|
- this.PersonnelData()
|
|
|
- this.changeWidthOnBlur()
|
|
|
- this.getCommentList()
|
|
|
- releaseList().then(res => {
|
|
|
- this.appClientList = res.data.appClient // 客户端
|
|
|
- this.getVersionList(this.bug.appId)
|
|
|
- })
|
|
|
- this.editor.txt.html(this.bugDescribe === null ? '' : this.bugDescribe)
|
|
|
- })
|
|
|
- },
|
|
|
- PersonnelData() {
|
|
|
- this.assignerOptions = []
|
|
|
- for (const i in this.bug.assignerList.length) {
|
|
|
- this.searchUser(this.bug.assigner[i]).then(res => {
|
|
|
- this.assignerOptions = res.data
|
|
|
- })
|
|
|
- }
|
|
|
- this.currentHandlerOptions = []
|
|
|
- for (const i in this.bug.currentHandlerList.length) {
|
|
|
- this.searchUser(this.bug.currentHandler[i]).then(res => {
|
|
|
- this.currentHandlerOptions = res.data
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- listen(event) {
|
|
|
- event.preventDefault() // 阻止浏览器默认换行操作
|
|
|
- return false
|
|
|
- },
|
|
|
- getToDetails() {
|
|
|
- this.$router.push({ name: '缺陷详情', params: { id: this.id }})
|
|
|
- },
|
|
|
- isImage(arr) {
|
|
|
- const reg = new RegExp(/.*(\.gif|\.jpeg|\.png|\.jpg|\.bmp)/i)
|
|
|
- return arr.filter(item => { return !!item.url.match(reg) })
|
|
|
- },
|
|
|
- isNotImage(arr) {
|
|
|
- const reg = new RegExp(/.*(\.gif|\.jpeg|\.png|\.jpg|\.bmp)/i)
|
|
|
- return arr.filter(item => { return !item.url.match(reg) })
|
|
|
- },
|
|
|
- beforeUpload(file) {
|
|
|
- const reg = new RegExp(/.*(zip|xlsx|txt|csv|xls|mov|mp4|m4a|avi|amr|mp3|wav|3gpp|gif|jpeg|png|jpg)/i)
|
|
|
- const isUpload = file.type.match(reg)
|
|
|
- if (!isUpload) {
|
|
|
- this.$message({
|
|
|
- message: '不支持上传此文件格式',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
- const isLt200M = (file.size / 1024 / 1024) < 200
|
|
|
- if (!isLt200M) {
|
|
|
- this.$message({
|
|
|
- message: '上传文件大小不能超过 200MB!',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
- },
|
|
|
- beforeRemove(file, fileList) {
|
|
|
- let a = true
|
|
|
- if (file && file.status === 'success') {
|
|
|
- a = this.$confirm(`确定删除 ${file.name}吗?`)
|
|
|
- }
|
|
|
- return a
|
|
|
- },
|
|
|
- handleRemoveNotImage(file, fileList) {
|
|
|
- this.notImageList = this.notImageList.filter(item => {
|
|
|
- return item.url !== file.url
|
|
|
- })
|
|
|
- this.bug.accessory = JSON.stringify([...this.notImageList, ...this.ImageList])
|
|
|
- this.bugUpdate(this.bug, 'accessory')
|
|
|
- },
|
|
|
- handleRemoveImage(file, fileList) {
|
|
|
- this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.ImageList = this.ImageList.filter(item => {
|
|
|
- return item.url !== file.url
|
|
|
- })
|
|
|
- this.bug.accessory = JSON.stringify([...this.notImageList, ...this.ImageList])
|
|
|
- this.bugUpdate(this.bug, 'accessory')
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- handlePictureCardPreview(file) {
|
|
|
- this.dialogImageUrl = file.url
|
|
|
- this.dialogVisible = true
|
|
|
- },
|
|
|
- handleChange(response, file, fileList) {
|
|
|
- console.log('response', response)
|
|
|
- const reg = new RegExp(/.*(\.gif|\.jpeg|\.png|\.jpg|\.bmp|\.gif)/i)
|
|
|
- if (!response.success) {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: response.error,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- this.notImageList.pop()
|
|
|
- return false
|
|
|
- }
|
|
|
- const item = {
|
|
|
- name: file.name,
|
|
|
- url: 'http:' + file.response.url
|
|
|
- }
|
|
|
- const arr1 = deepClone(this.ImageList)
|
|
|
- const arr2 = deepClone(this.notImageList)
|
|
|
- item.url.match(reg) ? arr1.push(item) : arr2.push(item)
|
|
|
- this.bug.accessory = JSON.stringify([...arr2, ...arr1])
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '文件上传成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.bugUpdate(this.bug, 'accessory')
|
|
|
- },
|
|
|
- errorChange() {
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '上传失败',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- },
|
|
|
- handleDownload(file) { // 下载图片
|
|
|
- const xhr = new XMLHttpRequest()
|
|
|
- xhr.open('get', file.url, true)
|
|
|
- xhr.responseType = 'blob'
|
|
|
- xhr.onload = () => {
|
|
|
- if (xhr.status === 200) {
|
|
|
- this.saveAs(xhr.response, file.name)
|
|
|
- }
|
|
|
- }
|
|
|
- xhr.send()
|
|
|
- },
|
|
|
- saveAs(data, name) { // 保存图片
|
|
|
- const urlObject = window.URL || window.webkitURL || window
|
|
|
- const file = new Blob([data])
|
|
|
- const a = document.createElement('a')
|
|
|
- a.href = urlObject.createObjectURL(file)
|
|
|
- a.download = name
|
|
|
- a.click()
|
|
|
- },
|
|
|
- getCommentList() {
|
|
|
- getCommentList({ type: 2, joinId: this.id }).then(res => {
|
|
|
- this.comments = res.data
|
|
|
- this.commentContent = ''
|
|
|
- })
|
|
|
- },
|
|
|
- addComment() {
|
|
|
- if (!this.commentContent) {
|
|
|
- this.$message.warning('评论不能为空')
|
|
|
- return
|
|
|
- }
|
|
|
- addComment({
|
|
|
- commentInfo: { joinId: this.id, type: 2, content: this.commentContent },
|
|
|
- user: { ename: this.userInformation }
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getCommentList()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- changeRule() {
|
|
|
- if (this.bugNameForm.bugName) {
|
|
|
- this.rules.bugName[0].trigger = 'blur'
|
|
|
- this.showRule = false
|
|
|
- } else {
|
|
|
- this.rules.bugName[0].trigger = 'change'
|
|
|
- this.showRule = true
|
|
|
- }
|
|
|
- },
|
|
|
- changeWidthOnBlur() {
|
|
|
- if (this.type !== 'page') {
|
|
|
- return
|
|
|
- }
|
|
|
- const colLength = document.getElementById('divLength').offsetWidth
|
|
|
- let bugNameLength = document.getElementById('spanLength').offsetWidth
|
|
|
- const statusButtonLength = document.getElementById('itemLength1').offsetWidth
|
|
|
- const deleteButtonLength = document.getElementById('itemLength2').offsetWidth
|
|
|
- const labelLength = document.getElementsByClassName('el-form-item__label')[0].offsetWidth
|
|
|
- const wholeLength = colLength - statusButtonLength - labelLength - deleteButtonLength - 20
|
|
|
- if (bugNameLength + 40 < wholeLength) {
|
|
|
- bugNameLength += 40
|
|
|
- this.bugNameTextareaStyle.width = bugNameLength + 'px'
|
|
|
- } else {
|
|
|
- this.bugNameTextareaStyle.width = wholeLength + 'px'
|
|
|
- }
|
|
|
- },
|
|
|
- changeWidthOnFocus() {
|
|
|
- const colLength = document.getElementById('divLength').offsetWidth
|
|
|
- const statusButtonLength = document.getElementById('itemLength1').offsetWidth
|
|
|
- const deleteButtonLength = document.getElementById('itemLength2').offsetWidth
|
|
|
- const labelLength = document.getElementsByClassName('el-form-item__label')[0].offsetWidth
|
|
|
- const wholeLength = colLength - statusButtonLength - labelLength - deleteButtonLength - 20
|
|
|
- this.bugNameTextareaStyle.width = wholeLength + 'px'
|
|
|
- },
|
|
|
- changeBugName() {
|
|
|
- if (this.bugNameForm.bugName.length < 1) {
|
|
|
- this.bugNameForm.bugName = this.bug.bugName
|
|
|
- return
|
|
|
- }
|
|
|
- this.bug.bugName = this.bugNameForm.bugName
|
|
|
- this.bugUpdate(this.bug, 'title')
|
|
|
- },
|
|
|
- RichText() {
|
|
|
- this.editor = new E('#wage', '#wage1')
|
|
|
- this.editor.customConfig.zIndex = 0
|
|
|
- this.editor.customConfig.menus = [
|
|
|
- 'bold',
|
|
|
- 'italic',
|
|
|
- 'underline',
|
|
|
- 'link',
|
|
|
- 'list',
|
|
|
- 'justify',
|
|
|
- 'table',
|
|
|
- 'foreColor'
|
|
|
- ]
|
|
|
- this.editor.customConfig.onchange = html => {
|
|
|
- this.bugDescribe = html
|
|
|
- }
|
|
|
- this.editor.customConfig.onblur = html => {
|
|
|
- this.describeEditorVisible = false
|
|
|
- }
|
|
|
- this.editor.create()
|
|
|
- this.editor.txt.html(this.bugDescribe === null ? '' : this.bugDescribe)
|
|
|
- },
|
|
|
- describeCancel() {
|
|
|
- this.bugDescribe = this.bug.bugDescribe
|
|
|
- this.describeEditorVisible = false
|
|
|
- },
|
|
|
- describeConfirm() {
|
|
|
- this.bug.bugDescribe = this.bugDescribe
|
|
|
- if (this.bugDescribe) {
|
|
|
- this.bugDescribeNoHtml = this.bugDescribe
|
|
|
- .replace(/<[^>]+>/g, '')
|
|
|
- .replace(/ /gi, '')
|
|
|
- }
|
|
|
- this.bugUpdate(this.bug, 'describe').then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.describeEditorVisible = false
|
|
|
- this.bugGet(this.bug.id)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getVersionList(e) {
|
|
|
- // 获取版本号
|
|
|
- const list = this.appClientList.filter(value => value.code === e)
|
|
|
- this.versionList = list[0] ? list[0].childEnumInfos : []
|
|
|
- },
|
|
|
- bugGet(id, isLoading) {
|
|
|
- this.loading.fullscreen = isLoading
|
|
|
- return bugDetails({ id: id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (this.num === 0) {
|
|
|
- document.getElementsByClassName('scop')[0].scrollTop = 0
|
|
|
- }
|
|
|
- // if (this.type !== 'page') {
|
|
|
- // if (res.data.bizId !== Number(localStorage.getItem('bizId'))) {
|
|
|
- // Utils.$emit('demo', res.data.bizId)
|
|
|
- // }
|
|
|
- // }
|
|
|
- this.bug = res.data
|
|
|
- this.bug.currentHandler = res.data.currentHandler.split(',')
|
|
|
- this.bug.assigner = res.data.assigner.split(',')
|
|
|
- this.bug.currentHandler.map(item => {
|
|
|
- this.searchUser(item).then(res => {
|
|
|
- this.currentHandlerOptions.push(res.data[0])
|
|
|
- })
|
|
|
- })
|
|
|
- this.bug.assigner.map(item => {
|
|
|
- this.searchUser(item).then(res => {
|
|
|
- this.assignerOptions.push(res.data[0])
|
|
|
- })
|
|
|
- })
|
|
|
- this.bugModel = JSON.parse(JSON.stringify(res.data))
|
|
|
- this.bugDescribe = this.bug.bugDescribe
|
|
|
- if (this.bugDescribe !== null) {
|
|
|
- this.bugDescribeNoHtml = this.bugDescribe
|
|
|
- .replace(/<[^>]+>/g, '')
|
|
|
- .replace(/ /gi, '')
|
|
|
- }
|
|
|
- this.bugNameForm.bugName = this.bug.bugName
|
|
|
- this.bug.networkType = this.bug.networkType
|
|
|
- this.bug.appVersion = this.bug.appVersion
|
|
|
- this.bug.moduleIds = this.bug.moduleIds
|
|
|
- this.fileList = []
|
|
|
- var str = res.data.accessory
|
|
|
- if (str !== '' && str !== null) {
|
|
|
- var obj = JSON.parse(str.split('{}')[0])
|
|
|
- for (var a of obj) {
|
|
|
- this.fileList.push(a)
|
|
|
- }
|
|
|
- }
|
|
|
- this.ImageList = this.isImage(this.fileList)
|
|
|
- this.notImageList = this.isNotImage(this.fileList)
|
|
|
- } else {
|
|
|
- this.loading.drawer = true
|
|
|
- return Promise.reject(res.msg)
|
|
|
- }
|
|
|
- this.loading.fullscreen = false
|
|
|
- return res
|
|
|
- })
|
|
|
- },
|
|
|
- openQueryDialog() {
|
|
|
- this.modalShow = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.createdBug.init(2, this.bug)
|
|
|
- })
|
|
|
- },
|
|
|
- father() {
|
|
|
- this.bugGet(this.bug.id, false)
|
|
|
- this.$emit('update', false)
|
|
|
- },
|
|
|
- bugGetEnum() {
|
|
|
- return bugGetEnum().then(res => {
|
|
|
- this.enums = res.data
|
|
|
- if (this.enums) {
|
|
|
- for (const i in this.enums) {
|
|
|
- this.map[i] = {}
|
|
|
- if (this.enums[i]) {
|
|
|
- for (const j in this.enums[i]) {
|
|
|
- this.map[i][this.enums[i][j].code] = this.enums[i][j].name
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return res
|
|
|
- })
|
|
|
- },
|
|
|
- bugDelete() {
|
|
|
- const userData = {
|
|
|
- id: '',
|
|
|
- ename: this.userInformation,
|
|
|
- name: this.userNames
|
|
|
- }
|
|
|
- return bugDelete(userData, this.bug.id).then(res => {
|
|
|
- return res
|
|
|
- })
|
|
|
- },
|
|
|
- bugUpdate(form, loadingStr) {
|
|
|
- if (form.currentHandler.length > 0) {
|
|
|
- if (form.assigner.length > 0) {
|
|
|
- this.formHeight = ''
|
|
|
- this.formHeight1 = ''
|
|
|
- loadingStr ? this.loading[loadingStr] = true : this.loading.fullscreen = true
|
|
|
- const userData = {
|
|
|
- id: '',
|
|
|
- ename: this.userInformation,
|
|
|
- name: this.userNames
|
|
|
- }
|
|
|
- this.num = 1
|
|
|
- let objData
|
|
|
- if (form) {
|
|
|
- const data = form
|
|
|
- data.currentHandler = form.currentHandler.join(',')
|
|
|
- data.assigner = form.assigner.join(',')
|
|
|
- objData = { bugBaseInfo: data, user: userData }
|
|
|
- } else {
|
|
|
- const data = form
|
|
|
- data.currentHandler = form.currentHandler.join(',')
|
|
|
- data.assigner = form.assigner.join(',')
|
|
|
- objData = { bugBaseInfo: data, user: userData }
|
|
|
- }
|
|
|
- return bugUpdate(objData).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.changeWidthOnBlur()
|
|
|
- this.bugModel = JSON.parse(JSON.stringify(this.bug))
|
|
|
- this.$emit('update', false)
|
|
|
- this.init()
|
|
|
- } else {
|
|
|
- this.bug = JSON.parse(JSON.stringify(this.bugModel))
|
|
|
- }
|
|
|
- loadingStr ? this.loading[loadingStr] = false : this.loading.fullscreen = false
|
|
|
- return res
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.formHeight1 = 'type'
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.formHeight = 'type'
|
|
|
- }
|
|
|
- },
|
|
|
- searchUser(query) {
|
|
|
- this.userLoading = true
|
|
|
- return getMemberInfo({ memberIDAP: query }).then(res => {
|
|
|
- this.userLoading = false
|
|
|
- return res
|
|
|
- })
|
|
|
- },
|
|
|
- getBusinessLinePlatformModule() {
|
|
|
- settingQueryBizModuleList(Number(localStorage.getItem('bizId'))).then(res => {
|
|
|
- this.business_platform_Modular = res.data.map(item => ({
|
|
|
- ...item,
|
|
|
- value: item.id,
|
|
|
- label: item.moduleName,
|
|
|
- children: item.childModules.length === 0 ? null : item.childModules.map(item1 => ({
|
|
|
- ...item1,
|
|
|
- value: item1.id,
|
|
|
- label: item1.moduleName,
|
|
|
- children: item1.childModules.length === 0 ? null : item1.childModules.map(item2 => ({
|
|
|
- ...item2,
|
|
|
- value: item2.id,
|
|
|
- label: item2.moduleName
|
|
|
- }))
|
|
|
- }))
|
|
|
- }))
|
|
|
- })
|
|
|
- },
|
|
|
- searchAssigner(val) {
|
|
|
- this.assignerOptions = []
|
|
|
- this.searchUser(val).then(res => {
|
|
|
- this.assignerOptions = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- searchCurrentHandler(val) {
|
|
|
- this.currentHandlerOptions = []
|
|
|
- this.searchUser(val).then(res => {
|
|
|
- this.currentHandlerOptions = res.data
|
|
|
- })
|
|
|
- },
|
|
|
- bugNameChangeWith(val) {
|
|
|
- if (this.showWordLimit) {
|
|
|
- this.showWordLimit = false
|
|
|
- } else {
|
|
|
- this.showWordLimit = true
|
|
|
- }
|
|
|
- this.bugNameTextareaStyle.width = val
|
|
|
- },
|
|
|
- openDeleteDialog() {
|
|
|
- this.openStatsDialog({ code: null, name: '删除确认' })
|
|
|
- },
|
|
|
- openStatsDialog(item) {
|
|
|
- this.statusDialogForm = JSON.parse(JSON.stringify(this.bug))
|
|
|
- this.statusDialogForm.status = item.code
|
|
|
- if (item.name === '待修复' || item.name === '修复中' || item.name === 'Hold') {
|
|
|
- this.bugUpdate(this.statusDialogForm, 'title')
|
|
|
- .then(res => {
|
|
|
- this.bugGet(this.bug.id, false)
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.statusDialogTitle = item.name
|
|
|
- this.statusDialogVisible = true
|
|
|
- },
|
|
|
- statusDialogCancel() {
|
|
|
- this.statusDialogVisible = false
|
|
|
- },
|
|
|
- statusDialogConfirm() {
|
|
|
- if (this.statusDialogTitle === '删除确认') {
|
|
|
- this.bugDelete().then(res => {
|
|
|
- this.statusDialogVisible = false
|
|
|
- if (res.code === 200) {
|
|
|
- if (this.type === 'page') {
|
|
|
- this.$router.push({ name: '缺陷' })
|
|
|
- } else {
|
|
|
- this.$emit('delete', false)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- } else if (this.statusDialogTitle === '待测试') {
|
|
|
- if (
|
|
|
- typeof this.statusDialogForm.bugReason === 'undefined' ||
|
|
|
- this.statusDialogForm.bugReason === null
|
|
|
- ) {
|
|
|
- this.$message.warning('请选择缺陷原因')
|
|
|
- }
|
|
|
- this.postDialogForm()
|
|
|
- .then(res => {
|
|
|
- this.getCommentList()
|
|
|
- })
|
|
|
- } else if (this.statusDialogTitle === '已完成') {
|
|
|
- if (
|
|
|
- typeof this.statusDialogForm.bugReason === 'undefined' ||
|
|
|
- this.statusDialogForm.bugReason === null
|
|
|
- ) {
|
|
|
- this.$message.warning('请选择缺陷原因')
|
|
|
- return
|
|
|
- }
|
|
|
- if (
|
|
|
- typeof this.statusDialogForm.repairResult === 'undefined' ||
|
|
|
- this.statusDialogForm.repairResult === null
|
|
|
- ) {
|
|
|
- this.$message.warning('请选择修复结果')
|
|
|
- return
|
|
|
- }
|
|
|
- this.postDialogForm()
|
|
|
- } else if (this.statusDialogTitle === 'Reopen') {
|
|
|
- if (!this.statusDialogForm.reasonOrDesc) {
|
|
|
- this.$message.warning('请输入Reopen原因')
|
|
|
- return
|
|
|
- }
|
|
|
- this.postDialogForm()
|
|
|
- .then(res => {
|
|
|
- this.getCommentList()
|
|
|
- })
|
|
|
- // this.addComment()
|
|
|
- this.statusDialogVisible = false
|
|
|
- }
|
|
|
- },
|
|
|
- postDialogForm() {
|
|
|
- this.statusDialogForm.id = this.id
|
|
|
- return this.bugUpdate(this.statusDialogForm).then(res => {
|
|
|
- this.statusDialogVisible = false
|
|
|
- this.statusDialogForm = {}
|
|
|
- this.bugGet(this.bug.id)
|
|
|
- return res
|
|
|
- })
|
|
|
- },
|
|
|
- generateMixed(len) {
|
|
|
- const chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
|
|
|
- let res = ''
|
|
|
- for (let i = 0; i < len; i++) {
|
|
|
- const id = Math.ceil(Math.random() * 35)
|
|
|
- res += chars[id]
|
|
|
- }
|
|
|
- return res
|
|
|
- },
|
|
|
- pasteUpload() {
|
|
|
- if (!this.uploadButton) {
|
|
|
- return false
|
|
|
- }
|
|
|
- if (window.uploadFiles[0]) {
|
|
|
- const reader = new FileReader()
|
|
|
- reader.readAsDataURL(window.uploadFiles[0])
|
|
|
- reader.onload = () => {
|
|
|
- const reg = new RegExp(/image\/png/)
|
|
|
- this.imageUrl = reader.result
|
|
|
- if (this.imageUrl.match(reg)) { // 判断是否是图片
|
|
|
- this.showCopyFile = true
|
|
|
- this.imageName.name = this.generateMixed(10)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- async confirmUpload() {
|
|
|
- if (this.imageName.name === null || this.imageName.name.replace(/\s+/g, '') === '') {
|
|
|
- return false
|
|
|
- }
|
|
|
- // const isExist = this.ImageList.some(item => {
|
|
|
- // return this.imageName.name === item.name
|
|
|
- // })
|
|
|
- // if (isExist) {
|
|
|
- // this.$message({
|
|
|
- // showClose: true,
|
|
|
- // message: '图片名称重复',
|
|
|
- // type: 'error'
|
|
|
- // })
|
|
|
- // return false
|
|
|
- // }
|
|
|
- this.showCopyFile = false
|
|
|
- const res = await this.updateFile(window.uploadFiles[0])
|
|
|
- const data = res.data
|
|
|
- const item = {
|
|
|
- name: `${this.imageName.name}.png` || `${this.generateMixed(10)}.png`,
|
|
|
- status: 'success',
|
|
|
- url: 'http:' + data.url
|
|
|
- }
|
|
|
- this.ImageList.push(item)
|
|
|
- this.bug.accessory = JSON.stringify([...this.notImageList, ...this.ImageList])
|
|
|
- this.$message({
|
|
|
- showClose: true,
|
|
|
- message: '文件上传成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.bugUpdate(this.bug, 'accessory')
|
|
|
- this.imageName.name = null
|
|
|
- this.imageUrl = null
|
|
|
- window.uploadFiles = null
|
|
|
- },
|
|
|
- updateFile(file) {
|
|
|
- const param = new FormData() // 创建form对象
|
|
|
- param.append('file', file)// 通过append向form对象添加数据
|
|
|
- const config = {
|
|
|
- headers: {
|
|
|
- 'Content-Type': 'multipart/form-data'
|
|
|
- },
|
|
|
- withCredentials: false
|
|
|
- } // 添加请求头
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- axios.post('http://star.xiaojukeji.com/upload/img.node', param, config)
|
|
|
- .then(response => {
|
|
|
- resolve(response)
|
|
|
- }).catch(err => {
|
|
|
- reject(err)
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style>
|
|
|
-.el-tooltip__popper.is-dark {
|
|
|
- background-color: rgba(121,132,150, 0.8);
|
|
|
-}
|
|
|
-.bug_manage_container::-webkit-scrollbar {
|
|
|
- display: none;
|
|
|
-}
|
|
|
-.bug_manage_title .button_delete{
|
|
|
- font-size: 20px;
|
|
|
- line-height: 14px;
|
|
|
- padding: 7px 10px;
|
|
|
-}
|
|
|
-.bug_manage_title .button_delete2,.button_status .el-button {
|
|
|
- padding: 7px 10px;
|
|
|
- font-size: 14px;
|
|
|
- font-weight: normal;
|
|
|
-}
|
|
|
-.bug_manage_dialog .el-dialog {
|
|
|
- border-radius:4px;
|
|
|
-}
|
|
|
-.bug_manage_dialog .el-dialog__header {
|
|
|
- padding: 20px 45px;
|
|
|
-}
|
|
|
-.bug_manage_dialog .el-dialog__body {
|
|
|
- padding: 0px 45px;
|
|
|
-}
|
|
|
-.bug_manage_dialog .el-dialog__footer {
|
|
|
- padding: 20px 45px 40px 0;
|
|
|
-}
|
|
|
-.layout_header,
|
|
|
-.layout_aside,
|
|
|
-.layout_main {
|
|
|
- /* border-radius: 4px; */
|
|
|
- background-color: #ffffff;
|
|
|
-}
|
|
|
-.bug_manage_dialog_fixMethod .el-form-item__label {
|
|
|
- padding-left: 10px;
|
|
|
-}
|
|
|
-.bug_manage_dialog .el-form-item__label {
|
|
|
- color: #666666;
|
|
|
- font-weight: 400;
|
|
|
-}
|
|
|
-.bug_manage_title .el-form-item__label {
|
|
|
- color: #333b4a;
|
|
|
- font-size: 18px;
|
|
|
- font-weight: 500;
|
|
|
-}
|
|
|
-#spanLength {
|
|
|
- color: #333b4a;
|
|
|
- font-size: 20px;
|
|
|
- font-weight: 500;
|
|
|
- visibility: hidden;
|
|
|
- position: absolute;
|
|
|
-}
|
|
|
-#divLength,
|
|
|
-#divLength2 {
|
|
|
- padding-top: 30px;
|
|
|
-}
|
|
|
-.bug_manage_title .el-textarea__inner {
|
|
|
- border: transparent;
|
|
|
- resize: none;
|
|
|
- color: #333b4a;
|
|
|
- font-size: 20px;
|
|
|
- font-weight: 500;
|
|
|
- overflow:hidden;
|
|
|
-}
|
|
|
-.bug_manage_title .el-textarea__inner:focus {
|
|
|
- padding-right: 50px;
|
|
|
-}
|
|
|
-.bug_manage_title .el-input__count {
|
|
|
- background-color: transparent;
|
|
|
-}
|
|
|
-.bug_manage_title .bug_manage_bug_name_rule_show .el-textarea__inner{
|
|
|
- border: 1px solid #F56C6C;
|
|
|
-}
|
|
|
-.bug_manage_title .bug_manage_bug_name_focus .el-textarea__inner:focus {
|
|
|
- border: 1px solid #409eff;
|
|
|
-}
|
|
|
-.bug_manage_title .bug_manage_bug_name .el-textarea__inner:hover {
|
|
|
- border: thin solid #DCDFE6;
|
|
|
-}
|
|
|
-.bug_manage .el-form-item__label {
|
|
|
- color: #666666;
|
|
|
- font-weight: 400;
|
|
|
- padding: 0;
|
|
|
-}
|
|
|
-.bug_manage .el-input__inner {
|
|
|
- border: transparent;
|
|
|
- color: #666666;
|
|
|
- font-weight: 500;
|
|
|
-}
|
|
|
-.bug_manage .bug_manage_div {
|
|
|
- border: transparent;
|
|
|
- color: #666666;
|
|
|
- font-weight: 500;
|
|
|
-}
|
|
|
-.bug_manage .el-cascader .el-input__inner:hover {
|
|
|
- border: thin solid #DCDFE6;
|
|
|
-}
|
|
|
-.bug_manage .el-cascader .el-input__inner:focus {
|
|
|
- border: 1px solid #409eff;
|
|
|
-}
|
|
|
-.bug_manage .el-input__inner:hover {
|
|
|
- border: thin solid #DCDFE6;
|
|
|
-}
|
|
|
-.bug_manage .el-input__inner:focus {
|
|
|
- border: 1px solid #409eff;
|
|
|
-}
|
|
|
-.bug_manage .el-select,.el-cascader {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-.bug_manage .el-select .el-input__suffix-inner {
|
|
|
- visibility: hidden;
|
|
|
-}
|
|
|
-.bug_manage .el-select:hover .el-input__suffix-inner {
|
|
|
- visibility: visible;
|
|
|
-}
|
|
|
-.bug_manage .el-cascader .el-input__suffix-inner {
|
|
|
- visibility: hidden;
|
|
|
-}
|
|
|
-.bug_manage .el-cascader:hover .el-input__suffix-inner {
|
|
|
- visibility: visible;
|
|
|
-}
|
|
|
-.layout_main .el-form-item.is-error .el-input__inner {
|
|
|
-border-color: #DCDFE6;
|
|
|
-}
|
|
|
-</style>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.el-aside {
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
-.toolbar {
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- border: 1px solid #DCDFE6;
|
|
|
- border-top-left-radius: 4px;
|
|
|
- border-top-right-radius: 4px;
|
|
|
-}
|
|
|
-.text {
|
|
|
- border: 1px solid #DCDFE6;
|
|
|
- height: 180px;
|
|
|
- border-bottom-left-radius: 4px;
|
|
|
- border-bottom-right-radius: 4px;
|
|
|
-}
|
|
|
-.bug_describe {
|
|
|
- color: #666666;
|
|
|
- font-size: 14px;
|
|
|
-}
|
|
|
-.bug_describe:hover {
|
|
|
- color: #409eff;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-.bug_describe_content {
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid transparent;
|
|
|
-}
|
|
|
-.bug_describe_content:hover {
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid rgba(191, 198, 220);
|
|
|
-}
|
|
|
-</style>
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-.newBtn {
|
|
|
- font-size: 14px;
|
|
|
- color: rgb(51, 59, 74);
|
|
|
- font-weight: 400;
|
|
|
-}
|
|
|
-.newBtn:hover {
|
|
|
- color: #409EFF;
|
|
|
- cursor: pointer;
|
|
|
-}
|
|
|
-.current:hover{
|
|
|
- cursor: pointer;
|
|
|
- border-radius: 4px;
|
|
|
- border: 1px solid #DCDFE6;
|
|
|
-}
|
|
|
-.module_title{
|
|
|
- display:flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 20px
|
|
|
-}
|
|
|
-.module_title__sign {
|
|
|
- width:4px;
|
|
|
- height:15px;
|
|
|
- background:#409EFF;
|
|
|
- border-radius:1px;
|
|
|
-}
|
|
|
-.module_title__caption{
|
|
|
- width:83px;
|
|
|
- height:18px;
|
|
|
- font-size:16px;
|
|
|
- font-family:MicrosoftYaHei;
|
|
|
- color:rgba(51,59,74,1);
|
|
|
- margin-left:6px;
|
|
|
- font-weight: 500;
|
|
|
-}
|
|
|
-.layout_main .el-form-item{
|
|
|
- margin-bottom:0px;
|
|
|
-}
|
|
|
-.layout_main .el-divider--horizontal{
|
|
|
- margin:10px 0 5px 0;
|
|
|
-}
|
|
|
-.tips {
|
|
|
- color:#DCDFE6;
|
|
|
- position: absolute;
|
|
|
-}
|
|
|
-.file-dialog {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- .el-form {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- .image {
|
|
|
- position: relative;
|
|
|
- width: 61%;
|
|
|
- padding-top: 60%;
|
|
|
- border:1px solid #409EFF;
|
|
|
- border-radius: 4px;
|
|
|
- .image-center {
|
|
|
- padding: 1%;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- overflow-x: hidden;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- }
|
|
|
- .image-url {
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-.upload-button {
|
|
|
- position: relative;
|
|
|
- color:#409EFF;
|
|
|
- border: 1px dashed #409EFF;
|
|
|
- background-color: #F7FBFF;
|
|
|
-}
|
|
|
-.upload-main {
|
|
|
- position: relative;
|
|
|
-}
|
|
|
-.upload-info {
|
|
|
- position: absolute;
|
|
|
- left: 130px;
|
|
|
- top: 14px;
|
|
|
- color:#409EFF;
|
|
|
- font-size: 12px;
|
|
|
- i{
|
|
|
- margin-right: 5px;
|
|
|
- }
|
|
|
-}
|
|
|
-.upload-file {
|
|
|
- color: #E6A23C;
|
|
|
- font-size: 12px;
|
|
|
- i{
|
|
|
- margin-right: 5px;
|
|
|
- }
|
|
|
-}
|
|
|
-.upload-title {
|
|
|
- width: 40px;
|
|
|
-}
|
|
|
-.bug-detail >>> .el-upload-dragger {
|
|
|
- width: 248px;
|
|
|
- height: 148px;
|
|
|
-}
|
|
|
-.bug-detail >>> .el-upload--picture-card {
|
|
|
- border: none;
|
|
|
-}
|
|
|
->>> .el-upload--picture-card {
|
|
|
- display: none;
|
|
|
-}
|
|
|
->>>.el-upload-list--picture-card .el-upload-list__item {
|
|
|
- height: 168px;
|
|
|
-}
|
|
|
-.el-upload-list__item-actions {
|
|
|
- height: calc(100%-20px);
|
|
|
- margin-top: 20px;
|
|
|
-}
|
|
|
-.image-detail {
|
|
|
- height: 100%;
|
|
|
- position: relative
|
|
|
-}
|
|
|
-.detail-img {
|
|
|
- padding-top: 20px;
|
|
|
-}
|
|
|
-.image-name {
|
|
|
- box-sizing: border-box;
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- width: 100%;
|
|
|
- height: 20px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- font-size: 12px;
|
|
|
- border-bottom: 1px solid #c0ccda;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
-}
|
|
|
-</style>
|
|
|
-<style lang="scss">
|
|
|
-.item-color {
|
|
|
- /deep/ .el-button {
|
|
|
- color: rgb(106, 180, 255);
|
|
|
- border: 1px solid rgb(106, 180, 255);
|
|
|
- border-color: rgb(106, 180, 255) !important;
|
|
|
- background: #FFF;
|
|
|
- }
|
|
|
-}
|
|
|
-.item{
|
|
|
- /deep/ .el-button {
|
|
|
- color: rgb(126, 211, 33);
|
|
|
- border: 1px solid rgb(126, 211, 33);
|
|
|
- border-color: rgb(126, 211, 33) !important;
|
|
|
- background: #FFF;
|
|
|
- }
|
|
|
-}
|
|
|
-.item1 {
|
|
|
- /deep/ .el-button {
|
|
|
- color: rgb(255, 204, 102);
|
|
|
- border: 1px solid rgb(255, 204, 102);
|
|
|
- border-color: rgb(255, 204, 102) !important;
|
|
|
- background: #FFF;
|
|
|
- }
|
|
|
-}
|
|
|
-.item2 {
|
|
|
- /deep/ .el-button {
|
|
|
- color: rgb(245, 108, 108);
|
|
|
- border: 1px solid rgb(245, 108, 108);
|
|
|
- border-color: rgb(245, 108, 108) !important;
|
|
|
- background: #FFF;
|
|
|
- }
|
|
|
-}
|
|
|
-.item3 {
|
|
|
- /deep/ .el-button {
|
|
|
- color: #D675F0;
|
|
|
- border: 1px solid #D675F0;
|
|
|
- border-color: #D675F0 !important;
|
|
|
- background: #FFF;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|