Browse Source

table组件增加日期范围查询条件

lxf 1 year ago
parent
commit
a770c8102b
1 changed files with 24 additions and 1 deletions
  1. 24 1
      src/components/byTable/index.vue

+ 24 - 1
src/components/byTable/index.vue

@@ -26,13 +26,36 @@
             <el-date-picker
               v-model="pagination[item.propList[1]]"
               type="datetime"
-              placeholder="请选择起始时间"
+              placeholder="请选择结束时间"
               value-format="YYYY-MM-DD HH:mm:ss"
               style="width: 100%"
               @change="searchFn" />
           </el-col>
         </el-row>
       </template>
+      <template v-else-if="item.type === 'date'">
+        <el-row>
+          <el-col :span="11">
+            <el-date-picker
+              v-model="pagination[item.propList[0]]"
+              type="date"
+              placeholder="请选择起始日期"
+              value-format="YYYY-MM-DD"
+              style="width: 100%"
+              @change="searchFn" />
+          </el-col>
+          <el-col :span="2" style="text-align: center">-</el-col>
+          <el-col :span="11">
+            <el-date-picker
+              v-model="pagination[item.propList[1]]"
+              type="datetime"
+              placeholder="请选择结束日期"
+              value-format="YYYY-MM-DD"
+              style="width: 100%"
+              @change="searchFn" />
+          </el-col>
+        </el-row>
+      </template>
     </el-form-item>
     <el-form-item>
       <el-button @click="searchFn" class="searchBtn">搜索</el-button>