|
@@ -185,8 +185,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-const _ = require("lodash");
|
|
|
-import E from "wangeditor";
|
|
|
+const _ = require('lodash')
|
|
|
+import E from 'wangeditor'
|
|
|
import {
|
|
|
bugGetEnum,
|
|
|
settingGetBizList,
|
|
@@ -194,39 +194,39 @@ import {
|
|
|
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";
|
|
|
+} 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) {
|
|
|
- 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) {
|
|
|
// 检索剪切板items
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
// 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 {
|
|
|
- name: "Createdbug",
|
|
|
+ name: 'Createdbug',
|
|
|
components: {
|
|
|
normalDialog
|
|
|
},
|
|
|
filters: {
|
|
|
limit(e, limit) {
|
|
|
if (e.length > limit) {
|
|
|
- return e.substring(0, limit) + "...";
|
|
|
+ return e.substring(0, limit) + '...'
|
|
|
} else {
|
|
|
- return e;
|
|
|
+ return e
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -242,7 +242,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogImageUrl: "", // 附件展示图片
|
|
|
+ dialogImageUrl: '', // 附件展示图片
|
|
|
modalShow: false, // 缺陷新建弹窗
|
|
|
dialogVisible: false,
|
|
|
show2: false,
|
|
@@ -252,50 +252,50 @@ export default {
|
|
|
fileDbList: [], // 附件展示
|
|
|
fileList: [],
|
|
|
taskIdStr: [],
|
|
|
- titleName: "",
|
|
|
+ titleName: '',
|
|
|
loading: false,
|
|
|
options: [],
|
|
|
test: [], // 人员查询
|
|
|
form: {},
|
|
|
formInline: {},
|
|
|
- userInformation: localStorage.getItem("username"),
|
|
|
- userNames: localStorage.getItem("realname"),
|
|
|
+ userInformation: localStorage.getItem('username'),
|
|
|
+ userNames: localStorage.getItem('realname'),
|
|
|
rules: {
|
|
|
bizId: [
|
|
|
- { required: true, message: "业务线不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '业务线不能为空', trigger: 'change' }
|
|
|
],
|
|
|
bugName: [
|
|
|
- { required: true, message: "标题不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '标题不能为空', trigger: 'change' }
|
|
|
],
|
|
|
taskId: [
|
|
|
- { required: true, message: "所属任务不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '所属任务不能为空', trigger: 'change' }
|
|
|
],
|
|
|
priorityLevel: [
|
|
|
- { required: true, message: "优先级不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '优先级不能为空', trigger: 'change' }
|
|
|
],
|
|
|
moduleIds: [
|
|
|
- { required: true, message: "所属模块不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '所属模块不能为空', trigger: 'change' }
|
|
|
],
|
|
|
discoveryMeth: [
|
|
|
- { required: true, message: "发现方式不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '发现方式不能为空', trigger: 'change' }
|
|
|
],
|
|
|
assigner: [
|
|
|
- { required: true, message: "责任人不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '责任人不能为空', trigger: 'change' }
|
|
|
],
|
|
|
sysType: [
|
|
|
- { required: true, message: "端类型不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '端类型不能为空', trigger: 'change' }
|
|
|
],
|
|
|
priority: [
|
|
|
- { required: true, message: "缺陷等级不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '缺陷等级不能为空', trigger: 'change' }
|
|
|
],
|
|
|
discoveryStage: [
|
|
|
- { required: true, message: "发现阶段不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '发现阶段不能为空', trigger: 'change' }
|
|
|
],
|
|
|
creatorList: [
|
|
|
- { required: true, message: "提报人不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '提报人不能为空', trigger: 'change' }
|
|
|
],
|
|
|
currentHandler: [
|
|
|
- { required: true, message: "修复人不能为空", trigger: "change" }
|
|
|
+ { required: true, message: '修复人不能为空', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
bugEnumList: [], // bug状态
|
|
@@ -321,283 +321,279 @@ export default {
|
|
|
formData1: [],
|
|
|
imageRules: {
|
|
|
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() {
|
|
|
- this.bugListSelect();
|
|
|
- this.bugDataGet();
|
|
|
+ this.bugListSelect()
|
|
|
+ this.bugDataGet()
|
|
|
},
|
|
|
methods: {
|
|
|
init(e, ele) {
|
|
|
- this.modalShow = true;
|
|
|
+ this.modalShow = true
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs["formInline"].clearValidate();
|
|
|
- });
|
|
|
- this.fileList = [];
|
|
|
- this.fileDbList = [];
|
|
|
- this.formInline = {};
|
|
|
- this.$set(
|
|
|
- this.formInline,
|
|
|
- "creatorList",
|
|
|
- localStorage.getItem("realname")
|
|
|
- );
|
|
|
+ this.$refs['formInline'].clearValidate()
|
|
|
+ })
|
|
|
+ this.fileList = []
|
|
|
+ this.fileDbList = []
|
|
|
+ this.formInline = {}
|
|
|
this.$set(
|
|
|
this.formInline,
|
|
|
- "bizId",
|
|
|
- Number(localStorage.getItem("bizId"))
|
|
|
- );
|
|
|
+ 'creatorList',
|
|
|
+ localStorage.getItem('realname')
|
|
|
+ )
|
|
|
+ this.$set(this.formInline, 'bizId', Number(localStorage.getItem('bizId')))
|
|
|
|
|
|
if (e === 1) {
|
|
|
- this.titleName = "新建缺陷";
|
|
|
+ this.titleName = '新建缺陷'
|
|
|
if (ele !== undefined) {
|
|
|
- this.$set(this.formInline, "taskId", ele.id);
|
|
|
+ this.$set(this.formInline, 'taskId', ele.id)
|
|
|
}
|
|
|
}
|
|
|
if (e === 2) {
|
|
|
- this.titleName = "复制缺陷";
|
|
|
+ this.titleName = '复制缺陷'
|
|
|
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 = [];
|
|
|
+ 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 = this.unique6(this.formData)
|
|
|
this.formData1.map(item => {
|
|
|
this.searchUser(item).then(res => {
|
|
|
- this.options.push(res.data[0]);
|
|
|
- });
|
|
|
- });
|
|
|
+ this.options.push(res.data[0])
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
- document.getElementById("soll").scrollTop = 0;
|
|
|
- this.editr = true;
|
|
|
- this.getEcharts();
|
|
|
- });
|
|
|
+ document.getElementById('soll').scrollTop = 0
|
|
|
+ this.editr = true
|
|
|
+ this.getEcharts()
|
|
|
+ })
|
|
|
},
|
|
|
unique6(arr) {
|
|
|
- var newArr = [];
|
|
|
+ var newArr = []
|
|
|
newArr = arr.filter(item => {
|
|
|
- return newArr.includes(item) ? "" : newArr.push(item);
|
|
|
- });
|
|
|
- return newArr;
|
|
|
+ return newArr.includes(item) ? '' : newArr.push(item)
|
|
|
+ })
|
|
|
+ return newArr
|
|
|
},
|
|
|
searchUser(query) {
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
return memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(
|
|
|
res => {
|
|
|
- this.loading = false;
|
|
|
- return res;
|
|
|
+ this.loading = false
|
|
|
+ return res
|
|
|
}
|
|
|
- );
|
|
|
+ )
|
|
|
},
|
|
|
getEcharts() {
|
|
|
setTimeout(() => {
|
|
|
- this.$set(this.formInline, "bugDescribe", "");
|
|
|
- const editorRemark = new E("#wange", "#wange1");
|
|
|
+ this.$set(this.formInline, 'bugDescribe', '')
|
|
|
+ const editorRemark = new E('#wange', '#wange1')
|
|
|
editorRemark.customConfig.menus = [
|
|
|
- "bold",
|
|
|
- "italic",
|
|
|
- "underline",
|
|
|
- "link",
|
|
|
- "list",
|
|
|
- "justify",
|
|
|
- "table",
|
|
|
- "foreColor"
|
|
|
- ];
|
|
|
+ 'bold',
|
|
|
+ 'italic',
|
|
|
+ 'underline',
|
|
|
+ 'link',
|
|
|
+ 'list',
|
|
|
+ 'justify',
|
|
|
+ 'table',
|
|
|
+ 'foreColor'
|
|
|
+ ]
|
|
|
editorRemark.customConfig.onchange = html => {
|
|
|
- this.formInline.bugDescribe = html;
|
|
|
- };
|
|
|
- editorRemark.create();
|
|
|
- }, 100);
|
|
|
+ this.formInline.bugDescribe = html
|
|
|
+ }
|
|
|
+ editorRemark.create()
|
|
|
+ }, 100)
|
|
|
},
|
|
|
getcurrentHandler(e) {
|
|
|
- this.$set(this.formInline, "currentHandler", e);
|
|
|
+ this.$set(this.formInline, 'currentHandler', e)
|
|
|
},
|
|
|
getClient(e) {
|
|
|
// 获取版本号
|
|
|
- this.$set(this.formInline, "appVersion", "");
|
|
|
+ this.$set(this.formInline, 'appVersion', '')
|
|
|
this.Editionlist = this.appClient.filter(
|
|
|
value => value.code === e
|
|
|
- )[0].childEnumInfos;
|
|
|
+ )[0].childEnumInfos
|
|
|
},
|
|
|
|
|
|
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) {
|
|
|
- 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;
|
|
|
+ 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"
|
|
|
- });
|
|
|
+ message: '文件上传成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
},
|
|
|
// 上传失败回调
|
|
|
errorUpload() {
|
|
|
- this.dis = false;
|
|
|
+ this.dis = false
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
- message: "文件上传失败",
|
|
|
- type: "error"
|
|
|
- });
|
|
|
+ message: '文件上传失败',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
},
|
|
|
handlePictureCardPreview(file) {
|
|
|
// 点击展示附件
|
|
|
- this.dialogImageUrl = file.url;
|
|
|
- this.dialogVisible = true;
|
|
|
+ this.dialogImageUrl = file.url
|
|
|
+ this.dialogVisible = true
|
|
|
},
|
|
|
|
|
|
progress(event, file, fileList) {
|
|
|
// 文件上传时的钩子
|
|
|
- this.dis = true;
|
|
|
+ this.dis = true
|
|
|
},
|
|
|
|
|
|
bug_created(e) {
|
|
|
// 创建(提交)
|
|
|
- this.$refs["formInline"].validate(valid => {
|
|
|
+ this.$refs['formInline'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- const data = e;
|
|
|
- data.currentHandler = e.currentHandler.join();
|
|
|
- data.assigner = e.assigner.join();
|
|
|
+ const data = e
|
|
|
+ data.currentHandler = e.currentHandler.join()
|
|
|
+ data.assigner = e.assigner.join()
|
|
|
var user = {
|
|
|
name: this.userNames,
|
|
|
ename: this.userInformation,
|
|
|
- id: ""
|
|
|
- };
|
|
|
+ id: ''
|
|
|
+ }
|
|
|
bugCreate({ bugBaseInfo: data, user }).then(res => {
|
|
|
- this.bugListSelect();
|
|
|
- this.modalShow = false;
|
|
|
+ this.bugListSelect()
|
|
|
+ this.modalShow = false
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
|
- type: "success",
|
|
|
+ type: 'success',
|
|
|
duration: 1000,
|
|
|
offset: 150
|
|
|
- });
|
|
|
- this.$emit("father");
|
|
|
+ })
|
|
|
+ this.$emit('father')
|
|
|
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;
|
|
|
+ if (typeof this.test[item.idap] === 'undefined') {
|
|
|
+ item.role = e
|
|
|
+ this.test[item.idap] = item
|
|
|
}
|
|
|
- return item.idap;
|
|
|
+ return item.idap
|
|
|
},
|
|
|
remoteMethod(query) {
|
|
|
// 人员查询
|
|
|
- if (query !== "") {
|
|
|
- this.loading = true;
|
|
|
+ if (query !== '') {
|
|
|
+ this.loading = true
|
|
|
setTimeout(() => {
|
|
|
- this.loading = false;
|
|
|
+ this.loading = false
|
|
|
memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
|
|
|
- const obj = {};
|
|
|
+ const obj = {}
|
|
|
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 {
|
|
|
- this.options = [];
|
|
|
+ this.options = []
|
|
|
}
|
|
|
},
|
|
|
async getTaskList(val) {
|
|
|
// 获取所属任务列表
|
|
|
const params = {
|
|
|
- bizId: Number(localStorage.getItem("bizId"))
|
|
|
- };
|
|
|
+ bizId: Number(localStorage.getItem('bizId'))
|
|
|
+ }
|
|
|
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) {
|
|
|
- params.name = val;
|
|
|
+ params.name = val
|
|
|
}
|
|
|
- const res = await taskListCreate(params);
|
|
|
+ const res = await taskListCreate(params)
|
|
|
if (res.code === 200) {
|
|
|
- this.taskEnumList = res.data || [];
|
|
|
+ this.taskEnumList = res.data || []
|
|
|
}
|
|
|
},
|
|
|
debounceQuery: _.debounce(function() {
|
|
|
- this.getTaskList(...arguments);
|
|
|
+ this.getTaskList(...arguments)
|
|
|
}, 500),
|
|
|
bugListSelect() {
|
|
|
- this.$set(this.formInline, "creatorList", this.userNames);
|
|
|
+ this.$set(this.formInline, 'creatorList', this.userNames)
|
|
|
settingGetBizList({}).then(res => {
|
|
|
- this.bizIdEnumList = res.data; // biz
|
|
|
- });
|
|
|
- this.getTaskList();
|
|
|
+ this.bizIdEnumList = res.data // biz
|
|
|
+ })
|
|
|
+ this.getTaskList()
|
|
|
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 => {
|
|
|
- this.appClient = res.data.appClient; // 客户端
|
|
|
- });
|
|
|
+ this.appClient = res.data.appClient // 客户端
|
|
|
+ })
|
|
|
},
|
|
|
deleteChild(arr) {
|
|
|
// 删除无用子属性
|
|
|
const bfs = arr => {
|
|
|
arr.forEach(item => {
|
|
|
if (!item.childrenEnums || item.childrenEnums.length === 0) {
|
|
|
- delete item.childrenEnums;
|
|
|
+ delete item.childrenEnums
|
|
|
} else {
|
|
|
- this.deleteChild(item.childrenEnums);
|
|
|
+ this.deleteChild(item.childrenEnums)
|
|
|
}
|
|
|
- });
|
|
|
- };
|
|
|
- bfs(arr);
|
|
|
- return arr;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ bfs(arr)
|
|
|
+ return arr
|
|
|
},
|
|
|
bugDataGet() {
|
|
|
// 所属模块
|
|
|
- settingQueryBizModuleList(Number(localStorage.getItem("bizId"))).then(
|
|
|
+ settingQueryBizModuleList(Number(localStorage.getItem('bizId'))).then(
|
|
|
res => {
|
|
|
this.business_platform_Modular = res.data.map(item => ({
|
|
|
...item,
|
|
@@ -619,164 +615,164 @@ export default {
|
|
|
label: item2.moduleName
|
|
|
}))
|
|
|
}))
|
|
|
- }));
|
|
|
+ }))
|
|
|
}
|
|
|
- );
|
|
|
+ )
|
|
|
},
|
|
|
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 isUpload = file.type.match(reg)
|
|
|
if (!isUpload) {
|
|
|
this.$message({
|
|
|
- message: "不支持上传此文件格式",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
- return false;
|
|
|
+ message: '不支持上传此文件格式',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
}
|
|
|
- const isLt200M = file.size / 1024 / 1024 < 20;
|
|
|
+ const isLt200M = file.size / 1024 / 1024 < 20
|
|
|
if (!isLt200M) {
|
|
|
this.$message({
|
|
|
- message: "上传文件大小不能超过 20MB!",
|
|
|
- type: "warning"
|
|
|
- });
|
|
|
- return false;
|
|
|
+ message: '上传文件大小不能超过 20MB!',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
}
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
|
this.fileDbList = this.fileDbList.filter(item => {
|
|
|
- return item.name !== file.name;
|
|
|
- });
|
|
|
+ return item.name !== file.name
|
|
|
+ })
|
|
|
this.fileList = this.fileList.filter(item => {
|
|
|
- return item.name !== file.name;
|
|
|
- });
|
|
|
+ return item.name !== file.name
|
|
|
+ })
|
|
|
},
|
|
|
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 = "";
|
|
|
+ '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];
|
|
|
+ const id = Math.ceil(Math.random() * 35)
|
|
|
+ res += chars[id]
|
|
|
}
|
|
|
- return res;
|
|
|
+ return res
|
|
|
},
|
|
|
pasteUpload() {
|
|
|
if (!this.modalShow) {
|
|
|
- return false;
|
|
|
+ return false
|
|
|
}
|
|
|
if (window.uploadFiles[0]) {
|
|
|
- const reader = new FileReader();
|
|
|
- reader.readAsDataURL(window.uploadFiles[0]);
|
|
|
+ const reader = new FileReader()
|
|
|
+ reader.readAsDataURL(window.uploadFiles[0])
|
|
|
reader.onload = () => {
|
|
|
- const reg = new RegExp(/image\/png/);
|
|
|
- this.imageUrl = reader.result;
|
|
|
+ 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.imageName.name = this.generateMixed(10)
|
|
|
}
|
|
|
- };
|
|
|
- this.showCopyFile = true;
|
|
|
+ }
|
|
|
+ this.showCopyFile = true
|
|
|
}
|
|
|
},
|
|
|
async confirmUpload() {
|
|
|
if (
|
|
|
this.imageName.name === null ||
|
|
|
- this.imageName.name.replace(/\s+/g, "") === ""
|
|
|
+ this.imageName.name.replace(/\s+/g, '') === ''
|
|
|
) {
|
|
|
- return false;
|
|
|
+ return false
|
|
|
}
|
|
|
const isExist = this.fileList.some(item => {
|
|
|
- return this.imageName.name === item.name;
|
|
|
- });
|
|
|
+ return this.imageName.name === item.name
|
|
|
+ })
|
|
|
if (isExist) {
|
|
|
this.$message({
|
|
|
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 = {
|
|
|
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({
|
|
|
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) {
|
|
|
- const param = new FormData(); // 创建form对象
|
|
|
- param.append("file", file); // 通过append向form对象添加数据
|
|
|
+ const param = new FormData() // 创建form对象
|
|
|
+ param.append('file', file) // 通过append向form对象添加数据
|
|
|
const config = {
|
|
|
headers: {
|
|
|
- "Content-Type": "multipart/form-data"
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
},
|
|
|
withCredentials: false
|
|
|
- }; // 添加请求头
|
|
|
+ } // 添加请求头
|
|
|
return new Promise((resolve, reject) => {
|
|
|
axios
|
|
|
- .post("http://star.xiaojukeji.com/upload/img.node", param, config)
|
|
|
+ .post('http://star.xiaojukeji.com/upload/img.node', param, config)
|
|
|
.then(response => {
|
|
|
- resolve(response);
|
|
|
+ resolve(response)
|
|
|
})
|
|
|
.catch(err => {
|
|
|
- reject(err);
|
|
|
- });
|
|
|
- });
|
|
|
+ reject(err)
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.file-dialog {
|