Forráskód Böngészése

修改动态表格查询组件(超级搜索框)

韩帛霖 1 éve
szülő
commit
37153071fa

+ 4 - 18
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -79,8 +79,6 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="pageList"></right-toolbar>
     </el-row>
-
-
     <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <span v-for="(key,val) in columns">
@@ -115,23 +113,8 @@
     <!-- 添加或修改销售出库单:- 过磅记录生成数据对话框 -->
     <el-dialog :title="title" :visible.sync="open" append-to-body>
       <iframe :src="iframeUrl" width="100%" height="600px" style="border: none;" scrolling="no">
-
       </iframe>
     </el-dialog>
-
-    <!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="客户编号关联客户表" prop="customerno">
-          <el-input v-model="form.customerno" placeholder="请输入客户编号关联客户表"/>
-        </el-form-item>
-
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog> -->
-
   </div>
 </template>
 <script>
@@ -197,6 +180,8 @@ export default {
         // 当前表字段筛选参数
         queryMap: {                   // 当前查询基本参数
           // ... key : value         当前页面的筛选条件
+          // 超级查询的唯一值
+          queryCriteriaValue: ""
         }
       },
       // 列信息
@@ -228,6 +213,7 @@ export default {
       dragTableInfo({queryMap: {sqlkey: this.sqlkey}}).then(res => {
         // 得到当前模版信息 --- sql columns queryWhere
         this.templateInfo = res.data.resultMap;
+        console.log(this.templateInfo);
         this.tableName = this.templateInfo.template.dtTableName;
         // 得到查询条件
         this.queryFromWhere = res.data.resultMap.where;
@@ -242,7 +228,7 @@ export default {
           this.tableList = [];
           res.rows.forEach(item => {
             this.tableList.push(item.resultMap)
-          })
+          });
           this.total = res.total;
           this.loading = false;
         });

+ 28 - 12
ruoyi-ui/src/views/tablelist/commonTable/queryfrom.vue

@@ -1,8 +1,25 @@
 <template>
   <div>
     <el-form :model="queryParams.queryMap" ref="queryForm" size="small" :inline="true" label-width="68px">
-      <!--      条件循环-->
-      <span v-for="(item,index) in formVals">
+
+      <el-form-item label="超级查询">
+        <el-input
+          v-model="queryParams.queryMap.queryCriteriaValue"
+          placeholder="请输入"
+          @keyup.enter.native="handleQuery"
+          clearable
+        />
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+
+      <!--   不加载初始数据   -->
+      <div v-if="false">
+        <!--      条件循环-->
+        <span v-for="(item,index) in formVals">
        <!--      input框循环-->
       <span v-if="item.conditionType=='input'" style="width: 500px;height: 500px">
       <el-form-item :label="item.conditionName" :prop="item.conditionField">
@@ -14,10 +31,11 @@
         />
       </el-form-item>
       </span>
-        <!--      select下拉框循环-->
+          <!--      select下拉框循环-->
       <span v-if="item.conditionType == 'select'" style="width: 500px;height: 500px">
       <el-form-item :label="item.conditionName" :prop="item.conditionField">
-        <el-select v-model="queryParams.queryMap[item.conditionField]" :placeholder="item.conditionNotes == null?'请选择':item.conditionNotes" clearable
+        <el-select v-model="queryParams.queryMap[item.conditionField]"
+                   :placeholder="item.conditionNotes == null?'请选择':item.conditionNotes" clearable
                    filterable>
           <el-option
             v-for="(i,index) in item.dropDownList"
@@ -35,14 +53,14 @@
           </el-option> -->
       </el-form-item>
     </span>
-        <!--      radio单选框循环-->
+          <!--      radio单选框循环-->
       <span v-if="item.conditionType == 'radio'" style="width: 500px;height: 500px">
           <el-form-item :prop="item.conditionField">
            <el-button :type="item.componentType" :icon="item.componentIcon" :size="item.componentSize"
                       @click="buttonClick(item)"> {{ item.conditionName }}</el-button>
           </el-form-item>
       </span>
-        <!--      time时间范围  -->
+          <!--      time时间范围  -->
       <span v-if="item.conditionType == 'between'" style="width: 500px;height: 500px">
       <el-form-item :label="item.conditionName" :prop="item.conditionField">
         <!--  item.componentType 使用某种组件
@@ -60,14 +78,10 @@
       </el-form-item>
       </span>
     </span>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
 
+      </div>
 
+    </el-form>
 
   </div>
 </template>
@@ -99,6 +113,8 @@ export default {
         // 当前表字段筛选参数
         queryMap: {                   // 当前查询基本参数
           // ... key : value         当前页面的筛选条件
+          // 超级查询的唯一值
+          queryCriteriaValue: ""
         }
       },
       inputType: {},