瀏覽代碼

fix: 数据表格跳转方式 混合表格空内容校验

Karsa 1 年之前
父節點
當前提交
7c89c0da3e

+ 1 - 1
src/views/datasheet_manage/customSheetEdit.vue

@@ -101,7 +101,7 @@ export default {
   methods: {
 
     backHandle() {
-      window.close()
+      this.$router.go(-1)
     },
 
     /* 获取表格详情 */

+ 5 - 1
src/views/datasheet_manage/mixedSheetEdit.vue

@@ -84,7 +84,7 @@ export default {
   methods: {
 
     backHandle() {
-      window.close()
+      this.$router.go(-1)
     },
 
     /* 获取表格详情 */
@@ -119,9 +119,13 @@ export default {
 
     /* 保存表格 */
     saveSheetHandle: _.debounce(async function() {
+
       const { name,classify,sheetType } = this.sheetForm;
       if(!name || !classify) return this.$message.warning(name ? '请选择表格分类' : '请输入表格名称')
 
+      let checkAllEmpty = this.$refs.mixedTableRef.config.data.flat(1).some(_ => _.ShowValue);
+      if(!checkAllEmpty) return this.$message.warning('请输入表格内容')
+
       let canvas = await html2canvas(document.getElementsByClassName('table')[0],{
         scale:2,
         useCORS: true,

+ 8 - 4
src/views/datasheet_manage/sheetList.vue

@@ -481,8 +481,13 @@ export default {
         2: "/addCustomSheet",
         3: "/addMixedSheet",
       };
-      const { href } = this.$router.resolve({ path: path[type] });
-      window.open(href, "_blank");
+
+      if(type === 1) {
+        const { href } = this.$router.resolve({ path: path[type] });
+        window.open(href, "_blank");
+      }else {
+        this.$router.push({ path: path[type] })
+      }
     },
 
     /* 获取表格分类 */
@@ -785,11 +790,10 @@ export default {
         2: "/addCustomSheet",
         3: "addMixedSheet",
       };
-      const { href } = this.$router.resolve({
+      this.$router.push({
         path: path[this.sheetDetailInfo.Source],
         query: { id: this.sheetDetailInfo.ExcelInfoId },
       });
-      window.open(href, "_blank");
     },
 
     /* 刷新表格 */