qinzhipeng_v 5 éve
szülő
commit
ac98e06485

+ 13 - 9
src/views/projectManage/bugList/file/createdBug.vue

@@ -242,7 +242,6 @@ export default {
       dis: false, // 附件上传成功才可以提交
       dis: false, // 附件上传成功才可以提交
       business_platform_Modular: [], // 模块
       business_platform_Modular: [], // 模块
       fileDbList: [], // 附件展示
       fileDbList: [], // 附件展示
-      editorRemark: '',
       fileList: [],
       fileList: [],
       taskIdStr: [],
       taskIdStr: [],
       titleName: '',
       titleName: '',
@@ -296,17 +295,14 @@ export default {
     this.form.remark = 'dd'
     this.form.remark = 'dd'
     setTimeout(() => {
     setTimeout(() => {
       this.$set(this.formInline, 'bugDescribe', '')
       this.$set(this.formInline, 'bugDescribe', '')
-      this.editorRemark = new E('#wange', '#wange1')
-      this.editorRemark.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify', 'table', 'foreColor']
-      this.editorRemark.customConfig.onchange = (html) => {
+      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
         this.formInline.bugDescribe = html
       }
       }
-      this.editorRemark.create()
+      editorRemark.create()
     }, 100)
     }, 100)
   },
   },
-  destroyed() {
-    console.log('离开')
-  },
   methods: {
   methods: {
     init(e, ele) {
     init(e, ele) {
       this.modalShow = true
       this.modalShow = true
@@ -328,6 +324,15 @@ export default {
       this.$nextTick(() => {
       this.$nextTick(() => {
         document.getElementById('soll').scrollTop = 0
         document.getElementById('soll').scrollTop = 0
       })
       })
+      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)
     },
     },
     getcurrentHandler(e) {
     getcurrentHandler(e) {
       this.$set(this.formInline, 'currentHandler', e)
       this.$set(this.formInline, 'currentHandler', e)
@@ -341,7 +346,6 @@ export default {
       this.fileList = []
       this.fileList = []
       this.fileDbList = []
       this.fileDbList = []
       this.formInline = {}
       this.formInline = {}
-      this.editorRemark.txt.clear()
       this.modalShow = false
       this.modalShow = false
     },
     },
     // 上传成功回调
     // 上传成功回调

+ 26 - 30
src/views/projectManage/projectList/projectIndex.vue

@@ -319,27 +319,8 @@ import {
   projectCreate
   projectCreate
 } from '@/api/projectIndex'
 } from '@/api/projectIndex'
 import '@/views/projectManage/publicCss/index.css'
 import '@/views/projectManage/publicCss/index.css'
-export default {
-  // beforeRouteLeave(to, from, next) {
-  //   // this.$nextTick(() => {
-  //   //   // 这里需要elementui的支持,如果使用其他界面组件自行替换即可
-  //   //   this.$confirm('正在离开本页面,本页面内所有未保存数据都会丢失', '警告', {
-  //   //     distinguishCancelAndClose: true,
-  //   //     confirmButtonText: '确定',
-  //   //     cancelButtonText: '取消',
-  //   //     type: 'warning'
-  //   //   }).then(() => {
-  //   //   // 正常跳转
-  //   //     next(true)
-  //   //   }).catch(() => {
-  //   //   // 如果取消跳转地址栏会变化,这时保持地址栏不变
-  //   //     window.history.go(1)
-  //   //   })
-  //   // })
-  //   // next(false)
 
 
-  //   this.$store.state.data.status = false
-  // },
+export default {
   data() {
   data() {
     return {
     return {
       curIndex: 1,
       curIndex: 1,
@@ -354,16 +335,10 @@ export default {
       priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
       priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
       rules_form: {
       rules_form: {
         name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
         name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
-        bizType: [
-          { required: true, message: '项目类型不能为空', trigger: 'blur' }
-        ],
+        bizType: [{ required: true, message: '项目类型不能为空', trigger: 'blur' }],
         bizId: [{ required: true, message: '业务线不能为空', trigger: 'blur' }],
         bizId: [{ required: true, message: '业务线不能为空', trigger: 'blur' }],
-        priority: [
-          { required: true, message: '优先级不能为空', trigger: 'blur' }
-        ],
-        projectOwner: [
-          { required: true, message: '项目负责人不能为空', trigger: 'blur' }
-        ]
+        priority: [{ required: true, message: '优先级不能为空', trigger: 'blur' }],
+        projectOwner: [{ required: true, message: '项目负责人不能为空', trigger: 'blur' }]
       },
       },
       userInformation: localStorage.getItem('username'),
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       userNames: localStorage.getItem('realname'),
@@ -400,9 +375,30 @@ export default {
     this.get_projectList()
     this.get_projectList()
     this.$store.state.data.status = true
     this.$store.state.data.status = true
   },
   },
-  destroyed() {
+  beforeRouteLeave(to, from, next) {
+    this.$nextTick(() => {
+      if (this.form.name !== '') {
+      // 这里需要elementui的支持,如果使用其他界面组件自行替换即可
+        this.$confirm('正在离开本页面,本页面内所有未保存数据都会丢失', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          // 正常跳转
+          next(true)
+        }).catch(() => {
+          // 如果取消跳转地址栏会变化,这时保持地址栏不变
+          window.history.go(1)
+        })
+      }
+    })
+    next(false)
+
     this.$store.state.data.status = false
     this.$store.state.data.status = false
   },
   },
+  // destroyed() {
+  //   this.$store.state.data.status = false
+  // },
   methods: {
   methods: {
     test2(item, e) {
     test2(item, e) {
       // 获取团队人员信息
       // 获取团队人员信息