Browse Source

fix:bug修复

韩帛霖 1 year ago
parent
commit
a1e28deeb4
1 changed files with 26 additions and 38 deletions
  1. 26 38
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

+ 26 - 38
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -40,7 +40,7 @@
             :underline="false"
             style="font-size: 12px; vertical-align: baseline"
             @click="importTemplate"
-            >下载模板
+          >下载模板
           </el-link>
         </div>
       </el-upload>
@@ -62,7 +62,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          >新增
+        >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -73,7 +73,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          >修改
+        >修改
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -84,7 +84,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          >删除
+        >删除
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -93,7 +93,7 @@
           icon="el-icon-upload2"
           size="mini"
           @click="upload.open = true"
-          >导入
+        >导入
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -103,7 +103,7 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          >导出
+        >导出
         </el-button>
       </el-col>
       <right-toolbar
@@ -116,7 +116,7 @@
       :data="tableList"
       @selection-change="handleSelectionChange"
     >
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="selection" width="55" align="center"/>
       <!-- <span v-for="(key, val) in columns" :key="key">
         <el-table-column :label="key" align="center" :prop="val" />
       </span> -->
@@ -144,7 +144,7 @@
                   type="text"
                   icon="el-icon-edit"
                   @click="handleUpdate(scope.row)"
-                  >修改
+                >修改
                 </el-button>
               </el-dropdown-item>
               <el-dropdown-item>
@@ -153,7 +153,7 @@
                   type="text"
                   icon="el-icon-delete"
                   @click="handleDelete(scope.row)"
-                  >删除
+                >删除
                 </el-button>
               </el-dropdown-item>
             </el-dropdown-menu>
@@ -202,13 +202,13 @@ import {
   addTableData,
   batchEdit,
 } from "@/api/tablelist/commonTable";
-import { getToken } from "@/utils/auth";
+import {getToken} from "@/utils/auth";
 import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
-import { camelCase } from "@/utils";
+import {camelCase} from "@/utils";
 
 export default {
   name: "listInfo",
-  components: { Queryfrom },
+  components: {Queryfrom},
   data() {
     return {
       // 遮罩层
@@ -245,7 +245,7 @@ export default {
         // 是否更新已经存在的数据
         updateSupport: 0,
         // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
+        headers: {Authorization: "Bearer " + getToken()},
         // 上传的地址
         url: process.env.VUE_APP_BASE_API3 + "common/uploadData",
       },
@@ -355,7 +355,7 @@ export default {
       // 序列化当前查询参数列表
       queryParams && (this.queryParams.queryMap = queryParams.queryMap);
       // 获取当前表单结构信息
-      dragTableInfo({ queryMap: { sqlkey: this.sqlkey } })
+      dragTableInfo({queryMap: {sqlkey: this.sqlkey}})
         .then((res) => {
           // 得到当前模版信息 --- sql columns queryWhere
           this.templateInfo = res.data.resultMap;
@@ -403,16 +403,10 @@ export default {
     },
     // 分页查询
     pageList(row) {
-      console.log(row);
       // 调用子组件-》携带子组件参数请求后台
-      this.$refs.mychild.pageList(
-        row == undefined
-          ? {
-              limit: this.queryParams.pageSize,
-              page: this.queryParams.pageNum,
-            }
-          : row
-      );
+      this.$refs.mychild.pageList(row == undefined ? {
+        limit: this.queryParams.pageSize, page: this.queryParams.pageNum,
+      } : row);
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -440,9 +434,7 @@ export default {
     handleAdd(row) {
       // this.reset();
       this.defaultValue = {};
-      getInfoBySqlKey(this.sqlkey).then(({ data }) => {
-        // const htmlCode = data.dfHtmlTemplate;
-        // this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
+      getInfoBySqlKey(this.sqlkey).then(({data}) => {
         if (!data || !data.dfVueTemplate) {
           this.$message.error("当前表格未绑定表单!");
           return;
@@ -458,9 +450,7 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      getInfoBySqlKey(this.sqlkey).then(({ data }) => {
-        // const htmlCode = data.dfHtmlTemplate;
-        // this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
+      getInfoBySqlKey(this.sqlkey).then(({data}) => {
         if (!data || !data.dfVueTemplate) {
           this.$message.error("当前表格未绑定表单!");
           return;
@@ -514,7 +504,6 @@ export default {
      * 删除提示信息语句(标识)
      * */
     handleDelete(row) {
-      console.log(this.ids);
       let delIds = this.ids;
       let primary = camelCase(this.templateInfo.template?.primaryKey);
       if (row[primary] != undefined && row[primary] != null) {
@@ -540,7 +529,8 @@ export default {
           this.$refs.mychild.pageList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {});
+        .catch(() => {
+        });
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -555,7 +545,6 @@ export default {
         });
       }
       this.queryParams.execlMap = JSON.stringify(this.queryParams.execlMap);
-      console.log(this.queryParams);
       this.download(
         process.env.VUE_APP_BASE_API3 + "dragform/common/export",
         {
@@ -573,7 +562,7 @@ export default {
     importTemplate() {
       this.download(
         process.env.VUE_APP_BASE_API3 +
-          `dragform/common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
+        `dragform/common/exportTemplate?tableName=${this.tableName}&sqlkey=${this.sqlkey}`,
         {},
         `下载模版名称${new Date().getTime()}.xlsx`
       );
@@ -589,10 +578,10 @@ export default {
       this.$refs.upload.clearFiles();
       this.$alert(
         "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
-          response.msg +
-          "</div>",
+        response.msg +
+        "</div>",
         "导入结果",
-        { dangerouslyUseHTMLString: true }
+        {dangerouslyUseHTMLString: true}
       );
       this.$refs.mychild.pageList({
         limit: this.queryParams.pageSize,
@@ -640,7 +629,7 @@ export default {
             updateData.conditionMap[this.templateInfo.template?.primaryKey] =
               this.defaultValue[
                 camelCase(this.templateInfo.template?.primaryKey)
-              ];
+                ];
             Object.keys(values).map((k) => {
               updateData.commMap[k] = values[k];
             });
@@ -656,7 +645,6 @@ export default {
           this.open = false;
         })
         .catch((res) => {
-          console.log(res);
           console.log("验证未通过,获取失败");
         });
     },