|
@@ -15,15 +15,7 @@
|
|
<div class="Layouts" style="width: 100%;">
|
|
<div class="Layouts" style="width: 100%;">
|
|
<div style="width:100%; margin: 0 4%;">
|
|
<div style="width:100%; margin: 0 4%;">
|
|
<el-form-item label="所属任务" prop="taskId">
|
|
<el-form-item label="所属任务" prop="taskId">
|
|
- <el-select
|
|
|
|
- v-model="formInline.taskId"
|
|
|
|
- filterable
|
|
|
|
- :remote="true"
|
|
|
|
- :remote-method="debounceQuery"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- style="width:100%;"
|
|
|
|
- @click.native="bugListSelect"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-select v-model="formInline.taskId" filterable :remote="true" :remote-method="debounceQuery" placeholder="请选择" style="width:100%;" @click.native="bugListSelect">
|
|
<el-option v-for="item in taskEnumList" :key="item.id" :label="item.name" :value="item.id">
|
|
<el-option v-for="item in taskEnumList" :key="item.id" :label="item.name" :value="item.id">
|
|
<div class="belong-task">
|
|
<div class="belong-task">
|
|
<div class="task-id">{{ item.taskId }}</div>
|
|
<div class="task-id">{{ item.taskId }}</div>
|
|
@@ -36,12 +28,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="优先级" prop="priorityLevel" style="white-space: nowrap;">
|
|
<el-form-item label="优先级" prop="priorityLevel" style="white-space: nowrap;">
|
|
- <el-tooltip
|
|
|
|
- class="item"
|
|
|
|
- effect="dark"
|
|
|
|
- content="i. High(阻塞阻塞进程的bug、主流程的严重bug,如app启动失败、接单crash,当天必须立即修复) ii. Medium(功bug,新需求的功能性bug建议放在该等级,可协商修复期限) iv. Low(不影响功能使用的小问题,如界面显示有异常,文案、UI微调,可协商修复期限)"
|
|
|
|
- placement="bottom"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="i. High(阻塞阻塞进程的bug、主流程的严重bug,如app启动失败、接单crash,当天必须立即修复) ii. Medium(功bug,新需求的功能性bug建议放在该等级,可协商修复期限) iv. Low(不影响功能使用的小问题,如界面显示有异常,文案、UI微调,可协商修复期限)" placement="bottom">
|
|
<i style="color: red; margin-left: -31px;" class="el-icon-warning-outline" />
|
|
<i style="color: red; margin-left: -31px;" class="el-icon-warning-outline" />
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
<el-select v-model="formInline.priorityLevel" filterable placeholder="请选择" style="width:100%; margin-left: 16px;">
|
|
<el-select v-model="formInline.priorityLevel" filterable placeholder="请选择" style="width:100%; margin-left: 16px;">
|
|
@@ -59,18 +46,12 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="缺陷类型" prop="theBugType">
|
|
<el-form-item label="缺陷类型" prop="theBugType">
|
|
- <el-cascader
|
|
|
|
- v-model="formInline.theBugType"
|
|
|
|
- :options="theBugTypeEnumList"
|
|
|
|
- :props="{
|
|
|
|
|
|
+ <el-cascader v-model="formInline.theBugType" :options="theBugTypeEnumList" :props="{
|
|
value:'code',
|
|
value:'code',
|
|
label:'name',
|
|
label:'name',
|
|
children: 'childrenEnums',
|
|
children: 'childrenEnums',
|
|
emitPath: false
|
|
emitPath: false
|
|
- }"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- clearable
|
|
|
|
- />
|
|
|
|
|
|
+ }" placeholder="请选择" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="责任人" style="width:100%;" prop="assigner">
|
|
<el-form-item label="责任人" style="width:100%;" prop="assigner">
|
|
@@ -92,13 +73,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="缺陷等级" prop="priority" style="white-space: nowrap;">
|
|
<el-form-item label="缺陷等级" prop="priority" style="white-space: nowrap;">
|
|
- <el-tooltip
|
|
|
|
- class="item"
|
|
|
|
- effect="dark"
|
|
|
|
- style="white-space:pre-line;"
|
|
|
|
- :content="`P0:阻塞进程的bug,如新功能未实现、app启动失败、如接单crash、开单crash P1:主流程功能bug,新需求的功能性bug建议放在该等级 P2:功能bug,不影响主流程 P3:不影响功能使用的小问题,如界面显示有异常,文案、UI微调,建议优化类`"
|
|
|
|
- placement="bottom"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" style="white-space:pre-line;" :content="`P0:阻塞进程的bug,如新功能未实现、app启动失败、如接单crash、开单crash P1:主流程功能bug,新需求的功能性bug建议放在该等级 P2:功能bug,不影响主流程 P3:不影响功能使用的小问题,如界面显示有异常,文案、UI微调,建议优化类`" placement="bottom">
|
|
<i style="color: red; margin-left: -17px;" class="el-icon-warning-outline" />
|
|
<i style="color: red; margin-left: -17px;" class="el-icon-warning-outline" />
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
<el-select v-model="formInline.priority" filterable placeholder="请选择" style="width:100%; margin-left: 3px;">
|
|
<el-select v-model="formInline.priority" filterable placeholder="请选择" style="width:100%; margin-left: 3px;">
|
|
@@ -168,27 +143,10 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="附件" style="width:100%;">
|
|
<el-form-item label="附件" style="width:100%;">
|
|
<section class="upload-main">
|
|
<section class="upload-main">
|
|
- <el-tooltip
|
|
|
|
- class="item"
|
|
|
|
- effect="dark"
|
|
|
|
- content="支持的文件格式有:.zip, .xlsx, .txt, .csv, .xls, .mov, .mp4, .m4a, .avi, .amr, .mp3, .wav, .3gpp, .png, .jpg, .jpeg, .gif"
|
|
|
|
- placement="top-start"
|
|
|
|
- popper-class="tip-style"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-tooltip class="item" effect="dark" content="支持的文件格式有:.zip, .xlsx, .txt, .csv, .xls, .mov, .mp4, .m4a, .avi, .amr, .mp3, .wav, .3gpp, .png, .jpg, .jpeg, .gif" placement="top-start" popper-class="tip-style">
|
|
<div class="upload-info"><i class="el-icon-question" />格式说明</div>
|
|
<div class="upload-info"><i class="el-icon-question" />格式说明</div>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
- <el-upload
|
|
|
|
- class="upload-demo"
|
|
|
|
- action="http://star.xiaojukeji.com/upload/img.node"
|
|
|
|
- :on-remove="handleRemove"
|
|
|
|
- :on-preview="handlePictureCardPreview"
|
|
|
|
- :on-progress="progress"
|
|
|
|
- :on-success="handleChange"
|
|
|
|
- :on-error="errorUpload"
|
|
|
|
- :file-list="fileList"
|
|
|
|
- list-type="picture"
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-upload class="upload-demo" action="http://star.xiaojukeji.com/upload/img.node" :on-remove="handleRemove" :on-preview="handlePictureCardPreview" :on-progress="progress" :on-success="handleChange" :on-error="errorUpload" :file-list="fileList" list-type="picture" :before-upload="beforeUpload">
|
|
<el-button type="primary">上传附件</el-button>
|
|
<el-button type="primary">上传附件</el-button>
|
|
</el-upload>
|
|
</el-upload>
|
|
</section>
|
|
</section>
|
|
@@ -203,15 +161,7 @@
|
|
</el-form>
|
|
</el-form>
|
|
<el-button id="pasteUpload" type="primary" style="display: none" @click.stop="pasteUpload">upload</el-button>
|
|
<el-button id="pasteUpload" type="primary" style="display: none" @click.stop="pasteUpload">upload</el-button>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <normal-dialog
|
|
|
|
- :show-dialog="showCopyFile"
|
|
|
|
- :title="'上传截图'"
|
|
|
|
- :width="'40%'"
|
|
|
|
- :submit-button="'上传'"
|
|
|
|
- :top="'5vh'"
|
|
|
|
- @confirm="confirmUpload()"
|
|
|
|
- @cancel="showCopyFile=false"
|
|
|
|
- >
|
|
|
|
|
|
+ <normal-dialog :show-dialog="showCopyFile" :title="'上传截图'" :width="'40%'" :submit-button="'上传'" :top="'5vh'" @confirm="confirmUpload()" @cancel="showCopyFile=false">
|
|
<div class="file-dialog">
|
|
<div class="file-dialog">
|
|
<el-form ref="imageForm" label-width="20%" :rules="imageRules" :model="imageName">
|
|
<el-form ref="imageForm" label-width="20%" :rules="imageRules" :model="imageName">
|
|
<el-form-item label="图片命名" prop="name">
|
|
<el-form-item label="图片命名" prop="name">
|
|
@@ -235,41 +185,48 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-const _ = require('lodash')
|
|
|
|
-import E from 'wangeditor'
|
|
|
|
-import { bugGetEnum, settingGetBizList, taskListCreate, releaseList, bugCreate, settingQueryBizModuleList } from '@/api/defectManage'
|
|
|
|
-import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
|
|
|
|
-import normalDialog from '@/components/dialog/normalDialog'
|
|
|
|
-import '@/views/projectManage/bugList/css/index.css'
|
|
|
|
-import '@/styles/PublicStyle/index.scss'
|
|
|
|
-import axios from 'axios'
|
|
|
|
|
|
+const _ = require("lodash");
|
|
|
|
+import E from "wangeditor";
|
|
|
|
+import {
|
|
|
|
+ bugGetEnum,
|
|
|
|
+ settingGetBizList,
|
|
|
|
+ taskListCreate,
|
|
|
|
+ releaseList,
|
|
|
|
+ bugCreate,
|
|
|
|
+ settingQueryBizModuleList
|
|
|
|
+} from "@/api/defectManage";
|
|
|
|
+import { memberQueryMemberInfoByIDAPorName } from "@/api/projectIndex";
|
|
|
|
+import normalDialog from "@/components/dialog/normalDialog";
|
|
|
|
+import "@/views/projectManage/bugList/css/index.css";
|
|
|
|
+import "@/styles/PublicStyle/index.scss";
|
|
|
|
+import axios from "axios";
|
|
|
|
|
|
document.body.onpaste = function(event) {
|
|
document.body.onpaste = function(event) {
|
|
- const data = (event.clipboardData || window.clipboardData)
|
|
|
|
- const items = data.items
|
|
|
|
- const fileList = [] // 存储文件数据
|
|
|
|
|
|
+ const data = event.clipboardData || window.clipboardData;
|
|
|
|
+ const items = data.items;
|
|
|
|
+ const fileList = []; // 存储文件数据
|
|
if (items && items.length) {
|
|
if (items && items.length) {
|
|
// 检索剪切板items
|
|
// 检索剪切板items
|
|
for (let i = 0; i < items.length; i++) {
|
|
for (let i = 0; i < items.length; i++) {
|
|
// console.log(items[i].getAsFile()) // <--- 这里打印出来就就是你想要的文件
|
|
// console.log(items[i].getAsFile()) // <--- 这里打印出来就就是你想要的文件
|
|
- fileList.push(items[i].getAsFile())
|
|
|
|
- window.uploadFiles = fileList
|
|
|
|
|
|
+ fileList.push(items[i].getAsFile());
|
|
|
|
+ window.uploadFiles = fileList;
|
|
}
|
|
}
|
|
- document.getElementById('pasteUpload').click()
|
|
|
|
|
|
+ document.getElementById("pasteUpload").click();
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: 'Createdbug',
|
|
|
|
|
|
+ name: "Createdbug",
|
|
components: {
|
|
components: {
|
|
normalDialog
|
|
normalDialog
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
limit(e, limit) {
|
|
limit(e, limit) {
|
|
if (e.length > limit) {
|
|
if (e.length > limit) {
|
|
- return e.substring(0, limit) + '...'
|
|
|
|
|
|
+ return e.substring(0, limit) + "...";
|
|
} else {
|
|
} else {
|
|
- return e
|
|
|
|
|
|
+ return e;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -285,7 +242,7 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- dialogImageUrl: '', // 附件展示图片
|
|
|
|
|
|
+ dialogImageUrl: "", // 附件展示图片
|
|
modalShow: false, // 缺陷新建弹窗
|
|
modalShow: false, // 缺陷新建弹窗
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
show2: false,
|
|
show2: false,
|
|
@@ -295,27 +252,51 @@ export default {
|
|
fileDbList: [], // 附件展示
|
|
fileDbList: [], // 附件展示
|
|
fileList: [],
|
|
fileList: [],
|
|
taskIdStr: [],
|
|
taskIdStr: [],
|
|
- titleName: '',
|
|
|
|
|
|
+ titleName: "",
|
|
loading: false,
|
|
loading: false,
|
|
options: [],
|
|
options: [],
|
|
test: [], // 人员查询
|
|
test: [], // 人员查询
|
|
form: {},
|
|
form: {},
|
|
formInline: {},
|
|
formInline: {},
|
|
- userInformation: localStorage.getItem('username'),
|
|
|
|
- userNames: localStorage.getItem('realname'),
|
|
|
|
|
|
+ userInformation: localStorage.getItem("username"),
|
|
|
|
+ userNames: localStorage.getItem("realname"),
|
|
rules: {
|
|
rules: {
|
|
- bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
|
|
|
|
- bugName: [{ required: true, message: '标题不能为空', trigger: 'change' }],
|
|
|
|
- taskId: [{ required: true, message: '所属任务不能为空', trigger: 'change' }],
|
|
|
|
- priorityLevel: [{ required: true, message: '优先级不能为空', trigger: 'change' }],
|
|
|
|
- moduleIds: [{ required: true, message: '所属模块不能为空', trigger: 'change' }],
|
|
|
|
- discoveryMeth: [{ required: true, message: '发现方式不能为空', trigger: 'change' }],
|
|
|
|
- assigner: [{ required: true, message: '责任人不能为空', trigger: 'change' }],
|
|
|
|
- sysType: [{ required: true, message: '端类型不能为空', trigger: 'change' }],
|
|
|
|
- priority: [{ required: true, message: '缺陷等级不能为空', trigger: 'change' }],
|
|
|
|
- discoveryStage: [{ required: true, message: '发现阶段不能为空', trigger: 'change' }],
|
|
|
|
- creatorList: [{ required: true, message: '提报人不能为空', trigger: 'change' }],
|
|
|
|
- currentHandler: [{ required: true, message: '修复人不能为空', trigger: 'change' }]
|
|
|
|
|
|
+ bizId: [
|
|
|
|
+ { required: true, message: "业务线不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ bugName: [
|
|
|
|
+ { required: true, message: "标题不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ taskId: [
|
|
|
|
+ { required: true, message: "所属任务不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ priorityLevel: [
|
|
|
|
+ { required: true, message: "优先级不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ moduleIds: [
|
|
|
|
+ { required: true, message: "所属模块不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ discoveryMeth: [
|
|
|
|
+ { required: true, message: "发现方式不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ assigner: [
|
|
|
|
+ { required: true, message: "责任人不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ sysType: [
|
|
|
|
+ { required: true, message: "端类型不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ priority: [
|
|
|
|
+ { required: true, message: "缺陷等级不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ discoveryStage: [
|
|
|
|
+ { required: true, message: "发现阶段不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ creatorList: [
|
|
|
|
+ { required: true, message: "提报人不能为空", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ currentHandler: [
|
|
|
|
+ { required: true, message: "修复人不能为空", trigger: "change" }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
bugEnumList: [], // bug状态
|
|
bugEnumList: [], // bug状态
|
|
appClient: [], // 客户端
|
|
appClient: [], // 客户端
|
|
@@ -340,361 +321,462 @@ export default {
|
|
formData1: [],
|
|
formData1: [],
|
|
imageRules: {
|
|
imageRules: {
|
|
name: [
|
|
name: [
|
|
- { required: true, message: '请输入图片名称', trigger: 'blur' },
|
|
|
|
- { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
|
|
|
|
|
+ { required: true, message: "请输入图片名称", trigger: "blur" },
|
|
|
|
+ { min: 1, max: 50, message: "长度在 1 到 50 个字符", trigger: "blur" }
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.bugListSelect()
|
|
|
|
- this.bugDataGet()
|
|
|
|
|
|
+ this.bugListSelect();
|
|
|
|
+ this.bugDataGet();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init(e, ele) {
|
|
init(e, ele) {
|
|
- this.modalShow = true
|
|
|
|
|
|
+ this.modalShow = true;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs['formInline'].clearValidate()
|
|
|
|
- })
|
|
|
|
- this.fileList = []
|
|
|
|
- this.fileDbList = []
|
|
|
|
- this.formInline = {}
|
|
|
|
- this.$set(this.formInline, 'creatorList', localStorage.getItem('realname'))
|
|
|
|
- this.$set(this.formInline, 'bizId', Number(localStorage.getItem('bizId')))
|
|
|
|
|
|
+ this.$refs["formInline"].clearValidate();
|
|
|
|
+ });
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.fileDbList = [];
|
|
|
|
+ this.formInline = {};
|
|
|
|
+ this.$set(
|
|
|
|
+ this.formInline,
|
|
|
|
+ "creatorList",
|
|
|
|
+ localStorage.getItem("realname")
|
|
|
|
+ );
|
|
|
|
+ this.$set(
|
|
|
|
+ this.formInline,
|
|
|
|
+ "bizId",
|
|
|
|
+ Number(localStorage.getItem("bizId"))
|
|
|
|
+ );
|
|
|
|
|
|
if (e === 1) {
|
|
if (e === 1) {
|
|
- this.titleName = '新建缺陷'
|
|
|
|
|
|
+ this.titleName = "新建缺陷";
|
|
if (ele !== undefined) {
|
|
if (ele !== undefined) {
|
|
- this.$set(this.formInline, 'taskId', ele.id)
|
|
|
|
|
|
+ this.$set(this.formInline, "taskId", ele.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (e === 2) {
|
|
if (e === 2) {
|
|
- this.titleName = '复制缺陷'
|
|
|
|
|
|
+ this.titleName = "复制缺陷";
|
|
if (ele !== undefined) {
|
|
if (ele !== undefined) {
|
|
- console.log(ele, this.userInformation, 'cddcs')
|
|
|
|
- this.formInline = ele
|
|
|
|
- this.show2 = true
|
|
|
|
- this.formInline.creatorList = this.userNames
|
|
|
|
- this.$set(this.formInline, 'bugName', '')
|
|
|
|
- this.$set(this.formInline, 'accessory', '')
|
|
|
|
- this.options = []
|
|
|
|
- this.formData = []
|
|
|
|
- this.formData1 = []
|
|
|
|
- this.formData = this.formInline.assigner.concat(this.formInline.currentHandler)
|
|
|
|
- this.formData1 = this.unique6(this.formData)
|
|
|
|
|
|
+ console.log(ele, this.userInformation, "cddcs");
|
|
|
|
+ this.formInline = ele;
|
|
|
|
+ this.show2 = true;
|
|
|
|
+ this.formInline.creatorList = this.userNames;
|
|
|
|
+ this.$set(this.formInline, "bugName", "");
|
|
|
|
+ this.$set(this.formInline, "accessory", "");
|
|
|
|
+ this.options = [];
|
|
|
|
+ this.formData = [];
|
|
|
|
+ this.formData1 = [];
|
|
|
|
+ this.formData = this.formInline.assigner.concat(
|
|
|
|
+ this.formInline.currentHandler
|
|
|
|
+ );
|
|
|
|
+ this.formData1 = this.unique6(this.formData);
|
|
this.formData1.map(item => {
|
|
this.formData1.map(item => {
|
|
this.searchUser(item).then(res => {
|
|
this.searchUser(item).then(res => {
|
|
- this.options.push(res.data[0])
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ this.options.push(res.data[0]);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- document.getElementById('soll').scrollTop = 0
|
|
|
|
- this.editr = true
|
|
|
|
- this.getEcharts()
|
|
|
|
- })
|
|
|
|
|
|
+ document.getElementById("soll").scrollTop = 0;
|
|
|
|
+ this.editr = true;
|
|
|
|
+ this.getEcharts();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
unique6(arr) {
|
|
unique6(arr) {
|
|
- var newArr = []
|
|
|
|
|
|
+ var newArr = [];
|
|
newArr = arr.filter(item => {
|
|
newArr = arr.filter(item => {
|
|
- return newArr.includes(item) ? '' : newArr.push(item)
|
|
|
|
- })
|
|
|
|
- return newArr
|
|
|
|
|
|
+ return newArr.includes(item) ? "" : newArr.push(item);
|
|
|
|
+ });
|
|
|
|
+ return newArr;
|
|
},
|
|
},
|
|
searchUser(query) {
|
|
searchUser(query) {
|
|
- this.loading = true
|
|
|
|
- return memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
|
|
|
|
- this.loading = false
|
|
|
|
- return res
|
|
|
|
- })
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
+ return memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(
|
|
|
|
+ res => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
},
|
|
},
|
|
getEcharts() {
|
|
getEcharts() {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- this.$set(this.formInline, 'bugDescribe', '')
|
|
|
|
- const editorRemark = new E('#wange', '#wange1')
|
|
|
|
- editorRemark.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify', 'table', 'foreColor']
|
|
|
|
- editorRemark.customConfig.onchange = (html) => {
|
|
|
|
- this.formInline.bugDescribe = html
|
|
|
|
- }
|
|
|
|
- editorRemark.create()
|
|
|
|
- }, 100)
|
|
|
|
|
|
+ this.$set(this.formInline, "bugDescribe", "");
|
|
|
|
+ const editorRemark = new E("#wange", "#wange1");
|
|
|
|
+ editorRemark.customConfig.menus = [
|
|
|
|
+ "bold",
|
|
|
|
+ "italic",
|
|
|
|
+ "underline",
|
|
|
|
+ "link",
|
|
|
|
+ "list",
|
|
|
|
+ "justify",
|
|
|
|
+ "table",
|
|
|
|
+ "foreColor"
|
|
|
|
+ ];
|
|
|
|
+ editorRemark.customConfig.onchange = html => {
|
|
|
|
+ this.formInline.bugDescribe = html;
|
|
|
|
+ };
|
|
|
|
+ editorRemark.create();
|
|
|
|
+ }, 100);
|
|
},
|
|
},
|
|
getcurrentHandler(e) {
|
|
getcurrentHandler(e) {
|
|
- this.$set(this.formInline, 'currentHandler', e)
|
|
|
|
|
|
+ this.$set(this.formInline, "currentHandler", e);
|
|
},
|
|
},
|
|
- getClient(e) { // 获取版本号
|
|
|
|
- this.$set(this.formInline, 'appVersion', '')
|
|
|
|
- this.Editionlist = this.appClient.filter(value => value.code === e)[0].childEnumInfos
|
|
|
|
|
|
+ getClient(e) {
|
|
|
|
+ // 获取版本号
|
|
|
|
+ this.$set(this.formInline, "appVersion", "");
|
|
|
|
+ this.Editionlist = this.appClient.filter(
|
|
|
|
+ value => value.code === e
|
|
|
|
+ )[0].childEnumInfos;
|
|
},
|
|
},
|
|
|
|
|
|
modalClose() {
|
|
modalClose() {
|
|
- this.fileList = []
|
|
|
|
- this.fileDbList = []
|
|
|
|
- this.formInline = {}
|
|
|
|
- this.editr = false
|
|
|
|
- this.modalShow = false
|
|
|
|
|
|
+ this.fileList = [];
|
|
|
|
+ this.fileDbList = [];
|
|
|
|
+ this.formInline = {};
|
|
|
|
+ this.editr = false;
|
|
|
|
+ this.modalShow = false;
|
|
},
|
|
},
|
|
// 上传成功回调
|
|
// 上传成功回调
|
|
handleChange(response, file, fileList) {
|
|
handleChange(response, file, fileList) {
|
|
- const item = { 'name': file.name, 'url': 'http:' + file.response.url }
|
|
|
|
- this.fileDbList.push(item)
|
|
|
|
- this.fileList.push(item)
|
|
|
|
- this.formInline.accessory = JSON.stringify(this.fileDbList)
|
|
|
|
- this.dis = false
|
|
|
|
- this.$message({ showClose: true, message: '文件上传成功', type: 'success' })
|
|
|
|
|
|
+ const item = { name: file.name, url: "http:" + file.response.url };
|
|
|
|
+ this.fileDbList.push(item);
|
|
|
|
+ this.fileList.push(item);
|
|
|
|
+ this.formInline.accessory = JSON.stringify(this.fileDbList);
|
|
|
|
+ this.dis = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: "文件上传成功",
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 上传失败回调
|
|
// 上传失败回调
|
|
errorUpload() {
|
|
errorUpload() {
|
|
- this.dis = false
|
|
|
|
- this.$message({ showClose: true, message: '文件上传失败', type: 'error' })
|
|
|
|
|
|
+ this.dis = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: "文件上传失败",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- handlePictureCardPreview(file) { // 点击展示附件
|
|
|
|
- this.dialogImageUrl = file.url
|
|
|
|
- this.dialogVisible = true
|
|
|
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
|
+ // 点击展示附件
|
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
|
+ this.dialogVisible = true;
|
|
},
|
|
},
|
|
|
|
|
|
- progress(event, file, fileList) { // 文件上传时的钩子
|
|
|
|
- this.dis = true
|
|
|
|
|
|
+ progress(event, file, fileList) {
|
|
|
|
+ // 文件上传时的钩子
|
|
|
|
+ this.dis = true;
|
|
},
|
|
},
|
|
|
|
|
|
- bug_created(e) { // 创建(提交)
|
|
|
|
- this.$refs['formInline'].validate((valid) => {
|
|
|
|
|
|
+ bug_created(e) {
|
|
|
|
+ // 创建(提交)
|
|
|
|
+ this.$refs["formInline"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- const data = e
|
|
|
|
- data.currentHandler = e.currentHandler.join()
|
|
|
|
- data.assigner = e.assigner.join()
|
|
|
|
- var user = { name: this.userNames, ename: this.userInformation, id: '' }
|
|
|
|
|
|
+ const data = e;
|
|
|
|
+ data.currentHandler = e.currentHandler.join();
|
|
|
|
+ data.assigner = e.assigner.join();
|
|
|
|
+ var user = {
|
|
|
|
+ name: this.userNames,
|
|
|
|
+ ename: this.userInformation,
|
|
|
|
+ id: ""
|
|
|
|
+ };
|
|
bugCreate({ bugBaseInfo: data, user }).then(res => {
|
|
bugCreate({ bugBaseInfo: data, user }).then(res => {
|
|
- this.bugListSelect()
|
|
|
|
- this.modalShow = false
|
|
|
|
- this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
|
- this.$emit('father')
|
|
|
|
|
|
+ this.bugListSelect();
|
|
|
|
+ this.modalShow = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "success",
|
|
|
|
+ duration: 1000,
|
|
|
|
+ offset: 150
|
|
|
|
+ });
|
|
|
|
+ this.$emit("father");
|
|
if (this.getBugList) {
|
|
if (this.getBugList) {
|
|
- this.getBugList()
|
|
|
|
|
|
+ this.getBugList();
|
|
}
|
|
}
|
|
- this.$emit('getBugList')
|
|
|
|
- })
|
|
|
|
|
|
+ this.$emit("getBugList");
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
- test2(item, e) { // 获取团队人员信息
|
|
|
|
- if (typeof this.test[item.idap] === 'undefined') {
|
|
|
|
- item.role = e
|
|
|
|
- this.test[item.idap] = item
|
|
|
|
|
|
+ test2(item, e) {
|
|
|
|
+ // 获取团队人员信息
|
|
|
|
+ if (typeof this.test[item.idap] === "undefined") {
|
|
|
|
+ item.role = e;
|
|
|
|
+ this.test[item.idap] = item;
|
|
}
|
|
}
|
|
- return item.idap
|
|
|
|
|
|
+ return item.idap;
|
|
},
|
|
},
|
|
remoteMethod(query) {
|
|
remoteMethod(query) {
|
|
// 人员查询
|
|
// 人员查询
|
|
- if (query !== '') {
|
|
|
|
- this.loading = true
|
|
|
|
|
|
+ if (query !== "") {
|
|
|
|
+ this.loading = true;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- this.loading = false
|
|
|
|
|
|
+ this.loading = false;
|
|
memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
|
|
memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
|
|
- const obj = {}
|
|
|
|
|
|
+ const obj = {};
|
|
this.options = res.data.reduce((cur, next) => {
|
|
this.options = res.data.reduce((cur, next) => {
|
|
- obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
|
|
|
|
- return cur
|
|
|
|
- }, [])
|
|
|
|
- })
|
|
|
|
- }, 200)
|
|
|
|
|
|
+ obj[next.idap] ? "" : (obj[next.idap] = true && cur.push(next));
|
|
|
|
+ return cur;
|
|
|
|
+ }, []);
|
|
|
|
+ });
|
|
|
|
+ }, 200);
|
|
} else {
|
|
} else {
|
|
- this.options = []
|
|
|
|
|
|
+ this.options = [];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async getTaskList(val) { // 获取所属任务列表
|
|
|
|
|
|
+ async getTaskList(val) {
|
|
|
|
+ // 获取所属任务列表
|
|
const params = {
|
|
const params = {
|
|
- bizId: Number(localStorage.getItem('bizId'))
|
|
|
|
- }
|
|
|
|
|
|
+ bizId: Number(localStorage.getItem("bizId"))
|
|
|
|
+ };
|
|
switch (this.$route.name) {
|
|
switch (this.$route.name) {
|
|
- case '项目详情':
|
|
|
|
- params.projectId = this.$route.query.id
|
|
|
|
- break
|
|
|
|
- case '需求详情':
|
|
|
|
- params.requireId = this.$route.query.id
|
|
|
|
- break
|
|
|
|
- case '任务详情':
|
|
|
|
- params.id = this.$route.query.id
|
|
|
|
- break
|
|
|
|
|
|
+ case "项目详情":
|
|
|
|
+ params.projectId = this.$route.query.id;
|
|
|
|
+ break;
|
|
|
|
+ case "需求详情":
|
|
|
|
+ params.requireId = this.$route.query.id;
|
|
|
|
+ break;
|
|
|
|
+ case "任务详情":
|
|
|
|
+ params.id = this.$route.query.id;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
if (val) {
|
|
if (val) {
|
|
- params.name = val
|
|
|
|
|
|
+ params.name = val;
|
|
}
|
|
}
|
|
- const res = await taskListCreate(params)
|
|
|
|
|
|
+ const res = await taskListCreate(params);
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.taskEnumList = res.data || []
|
|
|
|
|
|
+ this.taskEnumList = res.data || [];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
debounceQuery: _.debounce(function() {
|
|
debounceQuery: _.debounce(function() {
|
|
- this.getTaskList(...arguments)
|
|
|
|
|
|
+ this.getTaskList(...arguments);
|
|
}, 500),
|
|
}, 500),
|
|
bugListSelect() {
|
|
bugListSelect() {
|
|
- this.$set(this.formInline, 'creatorList', this.userNames)
|
|
|
|
|
|
+ this.$set(this.formInline, "creatorList", this.userNames);
|
|
settingGetBizList({}).then(res => {
|
|
settingGetBizList({}).then(res => {
|
|
- this.bizIdEnumList = res.data // biz
|
|
|
|
- })
|
|
|
|
- this.getTaskList()
|
|
|
|
|
|
+ this.bizIdEnumList = res.data; // biz
|
|
|
|
+ });
|
|
|
|
+ this.getTaskList();
|
|
bugGetEnum().then(res => {
|
|
bugGetEnum().then(res => {
|
|
- this.bugEnumList = res.data.bugEnumList // status
|
|
|
|
- this.bugTypeEnumList = res.data.bugTypeEnumList // bug类型
|
|
|
|
- this.bugStageEnumList = res.data.bugStageEnumList // 发现阶段
|
|
|
|
- this.sysTypeEnumList = res.data.sysTypeEnumList // 端类型
|
|
|
|
- this.discoveryMethEnumList = res.data.discoveryMethEnumList // 发现方式
|
|
|
|
- this.priorityEnumList = res.data.priorityEnumList // 缺陷等级
|
|
|
|
- this.priorityLevelEnumList = res.data.priorityLevelEnumList // 优先级
|
|
|
|
- this.repairResultEnumList = res.data.repairResultEnumList // 修复结果
|
|
|
|
- this.clientTypeEnumList = res.data.clientTypeEnumList // 版本
|
|
|
|
- this.sysTypeEnumList = res.data.sysTypeEnumList // 客户端
|
|
|
|
- this.networkTypeEnumList = res.data.networkTypeEnumList // 网络
|
|
|
|
- this.theBugTypeEnumList = this.deleteChild(res.data.theBugTypeEnumList) // 缺陷类型
|
|
|
|
- })
|
|
|
|
|
|
+ this.bugEnumList = res.data.bugEnumList; // status
|
|
|
|
+ this.bugTypeEnumList = res.data.bugTypeEnumList; // bug类型
|
|
|
|
+ this.bugStageEnumList = res.data.bugStageEnumList; // 发现阶段
|
|
|
|
+ this.sysTypeEnumList = res.data.sysTypeEnumList; // 端类型
|
|
|
|
+ this.discoveryMethEnumList = res.data.discoveryMethEnumList; // 发现方式
|
|
|
|
+ this.priorityEnumList = res.data.priorityEnumList; // 缺陷等级
|
|
|
|
+ this.priorityLevelEnumList = res.data.priorityLevelEnumList; // 优先级
|
|
|
|
+ this.repairResultEnumList = res.data.repairResultEnumList; // 修复结果
|
|
|
|
+ this.clientTypeEnumList = res.data.clientTypeEnumList; // 版本
|
|
|
|
+ this.sysTypeEnumList = res.data.sysTypeEnumList; // 客户端
|
|
|
|
+ this.networkTypeEnumList = res.data.networkTypeEnumList; // 网络
|
|
|
|
+ this.theBugTypeEnumList = this.deleteChild(res.data.theBugTypeEnumList); // 缺陷类型
|
|
|
|
+ });
|
|
releaseList().then(res => {
|
|
releaseList().then(res => {
|
|
- this.appClient = res.data.appClient // 客户端
|
|
|
|
- })
|
|
|
|
|
|
+ this.appClient = res.data.appClient; // 客户端
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- deleteChild(arr) { // 删除无用子属性
|
|
|
|
|
|
+ deleteChild(arr) {
|
|
|
|
+ // 删除无用子属性
|
|
const bfs = arr => {
|
|
const bfs = arr => {
|
|
arr.forEach(item => {
|
|
arr.forEach(item => {
|
|
if (!item.childrenEnums || item.childrenEnums.length === 0) {
|
|
if (!item.childrenEnums || item.childrenEnums.length === 0) {
|
|
- delete item.childrenEnums
|
|
|
|
|
|
+ delete item.childrenEnums;
|
|
} else {
|
|
} else {
|
|
- this.deleteChild(item.childrenEnums)
|
|
|
|
|
|
+ this.deleteChild(item.childrenEnums);
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
- bfs(arr)
|
|
|
|
- return arr
|
|
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ bfs(arr);
|
|
|
|
+ return arr;
|
|
},
|
|
},
|
|
- bugDataGet() { // 所属模块
|
|
|
|
- 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
|
|
|
|
- }))
|
|
|
|
- }))
|
|
|
|
- }))
|
|
|
|
- })
|
|
|
|
|
|
+ bugDataGet() {
|
|
|
|
+ // 所属模块
|
|
|
|
+ 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
|
|
|
|
+ }))
|
|
|
|
+ }))
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ );
|
|
},
|
|
},
|
|
beforeUpload(file) {
|
|
beforeUpload(file) {
|
|
- const reg = new RegExp(/.*(zip|xlsx|text|csv|xls|mov|mp4|m4a|avi|amr|mp3|wav|3gpp|gif|jpeg|png|jpg)/i)
|
|
|
|
- const isUpload = file.type.match(reg)
|
|
|
|
|
|
+ const reg = new RegExp(
|
|
|
|
+ /.*(zip|xlsx|text|csv|xls|mov|mp4|m4a|avi|amr|mp3|wav|3gpp|gif|jpeg|png|jpg)/i
|
|
|
|
+ );
|
|
|
|
+ const isUpload = file.type.match(reg);
|
|
if (!isUpload) {
|
|
if (!isUpload) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '不支持上传此文件格式',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
|
|
+ message: "不支持上传此文件格式",
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- const isLt200M = (file.size / 1024 / 1024) < 200
|
|
|
|
|
|
+ const isLt200M = file.size / 1024 / 1024 < 20;
|
|
if (!isLt200M) {
|
|
if (!isLt200M) {
|
|
this.$message({
|
|
this.$message({
|
|
- message: '上传文件大小不能超过 200MB!',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
|
|
+ message: "上传文件大小不能超过 20MB!",
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handleRemove(file, fileList) {
|
|
handleRemove(file, fileList) {
|
|
this.fileDbList = this.fileDbList.filter(item => {
|
|
this.fileDbList = this.fileDbList.filter(item => {
|
|
- return item.name !== file.name
|
|
|
|
- })
|
|
|
|
|
|
+ return item.name !== file.name;
|
|
|
|
+ });
|
|
this.fileList = this.fileList.filter(item => {
|
|
this.fileList = this.fileList.filter(item => {
|
|
- return item.name !== file.name
|
|
|
|
- })
|
|
|
|
|
|
+ return item.name !== file.name;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
generateMixed(len) {
|
|
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 = ''
|
|
|
|
|
|
+ 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++) {
|
|
for (let i = 0; i < len; i++) {
|
|
- const id = Math.ceil(Math.random() * 35)
|
|
|
|
- res += chars[id]
|
|
|
|
|
|
+ const id = Math.ceil(Math.random() * 35);
|
|
|
|
+ res += chars[id];
|
|
}
|
|
}
|
|
- return res
|
|
|
|
|
|
+ return res;
|
|
},
|
|
},
|
|
pasteUpload() {
|
|
pasteUpload() {
|
|
if (!this.modalShow) {
|
|
if (!this.modalShow) {
|
|
- return false
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
if (window.uploadFiles[0]) {
|
|
if (window.uploadFiles[0]) {
|
|
- const reader = new FileReader()
|
|
|
|
- reader.readAsDataURL(window.uploadFiles[0])
|
|
|
|
|
|
+ const reader = new FileReader();
|
|
|
|
+ reader.readAsDataURL(window.uploadFiles[0]);
|
|
reader.onload = () => {
|
|
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)
|
|
|
|
|
|
+ const reg = new RegExp(/image\/png/);
|
|
|
|
+ this.imageUrl = reader.result;
|
|
|
|
+ if (this.imageUrl.match(reg)) {
|
|
|
|
+ // 判断是否是图片
|
|
|
|
+ this.showCopyFile = true;
|
|
|
|
+ this.imageName.name = this.generateMixed(10);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- this.showCopyFile = true
|
|
|
|
|
|
+ };
|
|
|
|
+ this.showCopyFile = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async confirmUpload() {
|
|
async confirmUpload() {
|
|
- if (this.imageName.name === null || this.imageName.name.replace(/\s+/g, '') === '') {
|
|
|
|
- return false
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.imageName.name === null ||
|
|
|
|
+ this.imageName.name.replace(/\s+/g, "") === ""
|
|
|
|
+ ) {
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
const isExist = this.fileList.some(item => {
|
|
const isExist = this.fileList.some(item => {
|
|
- return this.imageName.name === item.name
|
|
|
|
- })
|
|
|
|
|
|
+ return this.imageName.name === item.name;
|
|
|
|
+ });
|
|
if (isExist) {
|
|
if (isExist) {
|
|
this.$message({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
- message: '图片名称重复',
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- return false
|
|
|
|
|
|
+ message: "图片名称重复",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- this.showCopyFile = false
|
|
|
|
- const res = await this.updateFile(window.uploadFiles[0])
|
|
|
|
- const data = res.data
|
|
|
|
|
|
+ this.showCopyFile = false;
|
|
|
|
+ const res = await this.updateFile(window.uploadFiles[0]);
|
|
|
|
+ const data = res.data;
|
|
const item = {
|
|
const item = {
|
|
name: `${this.imageName.name}.png` || `${this.generateMixed(10)}.png`,
|
|
name: `${this.imageName.name}.png` || `${this.generateMixed(10)}.png`,
|
|
- status: 'success',
|
|
|
|
- url: 'http:' + data.url
|
|
|
|
- }
|
|
|
|
- this.fileList.push(item)
|
|
|
|
- this.fileDbList.push(item)
|
|
|
|
- this.formInline.accessory = JSON.stringify(this.fileDbList)
|
|
|
|
|
|
+ status: "success",
|
|
|
|
+ url: "http:" + data.url
|
|
|
|
+ };
|
|
|
|
+ this.fileList.push(item);
|
|
|
|
+ this.fileDbList.push(item);
|
|
|
|
+ this.formInline.accessory = JSON.stringify(this.fileDbList);
|
|
this.$message({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
- message: '文件上传成功',
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
- this.imageName.name = null
|
|
|
|
- this.imageUrl = null
|
|
|
|
- window.uploadFiles = null
|
|
|
|
|
|
+ message: "文件上传成功",
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ this.imageName.name = null;
|
|
|
|
+ this.imageUrl = null;
|
|
|
|
+ window.uploadFiles = null;
|
|
},
|
|
},
|
|
updateFile(file) {
|
|
updateFile(file) {
|
|
- const param = new FormData() // 创建form对象
|
|
|
|
- param.append('file', file)// 通过append向form对象添加数据
|
|
|
|
|
|
+ const param = new FormData(); // 创建form对象
|
|
|
|
+ param.append("file", file); // 通过append向form对象添加数据
|
|
const config = {
|
|
const config = {
|
|
headers: {
|
|
headers: {
|
|
- 'Content-Type': 'multipart/form-data'
|
|
|
|
|
|
+ "Content-Type": "multipart/form-data"
|
|
},
|
|
},
|
|
withCredentials: false
|
|
withCredentials: false
|
|
- } // 添加请求头
|
|
|
|
|
|
+ }; // 添加请求头
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
- axios.post('http://star.xiaojukeji.com/upload/img.node', param, config)
|
|
|
|
|
|
+ axios
|
|
|
|
+ .post("http://star.xiaojukeji.com/upload/img.node", param, config)
|
|
.then(response => {
|
|
.then(response => {
|
|
- resolve(response)
|
|
|
|
- }).catch(err => {
|
|
|
|
- reject(err)
|
|
|
|
|
|
+ resolve(response);
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ .catch(err => {
|
|
|
|
+ reject(err);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.file-dialog {
|
|
.file-dialog {
|
|
@@ -708,7 +790,7 @@ export default {
|
|
position: relative;
|
|
position: relative;
|
|
width: 61%;
|
|
width: 61%;
|
|
padding-top: 60%;
|
|
padding-top: 60%;
|
|
- border:1px solid #409EFF;
|
|
|
|
|
|
+ border: 1px solid #409eff;
|
|
border-radius: 4px;
|
|
border-radius: 4px;
|
|
.image-center {
|
|
.image-center {
|
|
padding: 1%;
|
|
padding: 1%;
|
|
@@ -734,9 +816,9 @@ export default {
|
|
left: 110px;
|
|
left: 110px;
|
|
top: 50%;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
transform: translateY(-50%);
|
|
- color:#409EFF;
|
|
|
|
|
|
+ color: #409eff;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
- i{
|
|
|
|
|
|
+ i {
|
|
margin-right: 5px;
|
|
margin-right: 5px;
|
|
}
|
|
}
|
|
}
|
|
}
|