zhaoke 2 年之前
父節點
當前提交
1c8784640d
共有 3 個文件被更改,包括 50 次插入108 次删除
  1. 30 27
      src/components/table/index.vue
  2. 4 0
      src/theme/index.scss
  3. 16 81
      src/views/systemSettings/queryTemplate/queryTemplateAdd.vue

+ 30 - 27
src/components/table/index.vue

@@ -42,33 +42,35 @@
     </div>
     <!--新增/编辑-->
     <Dialog :flag="editFlag" width="650px" :msgTitle="editTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
-      <el-form ref="ruleFormRef" :model="tableForm" :label-width="labelWidth" class="demo-ruleForm">
-        <el-row :gutter="20">
-          <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
-            <el-form-item :label="item.columnLabel">
-              <template v-if="item.listqueryTemplateID || item.listqueryTemplateID == 0">
-                <el-select class="input-shadow" size="default" filterable default-first-option style="width: 100%" v-model="tableForm[item.columnName]" placeholder="请选择" clearable>
-                  <el-option v-for="citem in tableOptions[item.columnName]" :key="citem.v ? citem.v : citem.planDepartureApt" :label="citem.k ? citem.k : citem.planDepartureApt" :value="citem.setlabel === 'positionDescribe' ? citem.v : citem.v != undefined ? citem.v : citem.planDepartureApt">
-                  </el-option>
-                </el-select>
-              </template>
-              <template v-else-if="item.dataType == 'longtext'">
-                <el-input size="default" :rows="1" type="textarea" v-model="tableForm[item.columnName]"></el-input>
-              </template>
-              <template v-else-if="item.dataType == 'datetime'">
-                <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="tableForm[item.columnName]" :rows="1" type="datetime" placeholder="选择日期时间">
-                </el-date-picker>
-              </template>
-              <template v-else-if="item.dataType == 'number'">
-                <el-input size="default" v-model.number="tableForm[item.columnName]" onkeyup="value=value.replace(/[^1-9]/g,'')"></el-input>
-              </template>
-              <template v-else>
-                <el-input size="default" v-model="tableForm[item.columnName]"></el-input>
-              </template>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+      <el-scrollbar height="400px">
+        <el-form ref="ruleFormRef" :model="tableForm" :label-width="labelWidth" class="demo-ruleForm">
+          <el-row :gutter="20">
+            <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
+              <el-form-item :label="item.columnLabel">
+                <template v-if="item.listqueryTemplateID || item.listqueryTemplateID == 0">
+                  <el-select class="input-shadow" size="default" filterable default-first-option style="width: 100%" v-model="tableForm[item.columnName]" placeholder="请选择" clearable>
+                    <el-option v-for="citem in tableOptions[item.columnName]" :key="citem.v ? citem.v : citem.planDepartureApt" :label="citem.k ? citem.k : citem.planDepartureApt" :value="citem.setlabel === 'positionDescribe' ? citem.v : citem.v != undefined ? citem.v : citem.planDepartureApt">
+                    </el-option>
+                  </el-select>
+                </template>
+                <template v-else-if="item.dataType == 'longtext'">
+                  <el-input size="default" :rows="1" type="textarea" v-model="tableForm[item.columnName]"></el-input>
+                </template>
+                <template v-else-if="item.dataType == 'datetime'">
+                  <el-date-picker size="default" value-format="YYYY-MM-DD HH:mm:ss" v-model="tableForm[item.columnName]" :rows="1" type="datetime" placeholder="选择日期时间">
+                  </el-date-picker>
+                </template>
+                <template v-else-if="item.dataType == 'number'">
+                  <el-input size="default" v-model.number="tableForm[item.columnName]" onkeyup="value=value.replace(/[^1-9]/g,'')"></el-input>
+                </template>
+                <template v-else>
+                  <el-input size="default" v-model="tableForm[item.columnName]"></el-input>
+                </template>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-scrollbar>
     </Dialog>
     <!---删除-->
     <Dialog type="del" :flag="delFlag" msgTitle="删除" :delName="delTitle" @delRest="delRest" @delRemove="delRemove" />
@@ -163,6 +165,7 @@ const getQuery = async (id) => {
       tableData.value.push(...returnData.listValues);
       tableCols.value = returnData.columnSet;
       serviceId.value = returnData.submitID;
+      loading.value = false;
       setTimeout(() => {
         initTableData();
       }, 100);

+ 4 - 0
src/theme/index.scss

@@ -40,6 +40,10 @@
   color: #303133;
   font-weight: 400;
 }
+.el-date-editor.el-input,
+.el-date-editor.el-input__wrapper {
+  width: 100%;
+}
 .manageTitle {
   position: relative;
   padding-left: 12px;

+ 16 - 81
src/views/systemSettings/queryTemplate/queryTemplateAdd.vue

@@ -1,112 +1,47 @@
 <template>
   <div class="airportInfo scroll-y">
-    <Minheader
-      :is-statuser="true"
-      :is-Preser="true"
-      :is-Measure="true"
-      @preserForm="preserForm"
-    >
+    <Minheader :is-statuser="true" :is-Preser="true" :is-Measure="true" @preserForm="preserForm">
       <template #header>
         <div class="status flex-wrap">
           <div class="manageTitle">新增查询模板</div>
         </div>
-      </template></Minheader
-    >
+      </template>
+    </Minheader>
     <div class="app-container">
       <el-form :model="ruleForm" :rules="formRules" ref="queryTemplateAddForm">
         <el-row :gutter="24">
           <el-col :span="6">
-            <el-form-item
-              label="查询模板名称"
-              size="default"
-              prop="queryTemplateName"
-              :rules="formRules.isNotNull"
-            >
-              <el-input
-                v-model="ruleForm.queryTemplateName"
-                placeholder="请输入查询模板名称"
-              />
+            <el-form-item label="查询模板名称" size="default" prop="queryTemplateName" :rules="formRules.isNotNull">
+              <el-input v-model="ruleForm.queryTemplateName" placeholder="请输入查询模板名称" />
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item
-              label="数据源"
-              prop="dataSourceID"
-              size="default"
-              :rules="formRules.isNotNull"
-            >
-              <el-select
-                v-model="ruleForm.dataSourceID"
-                placeholder="请选择"
-                clearable
-              >
-                <el-option
-                  v-for="item in dataSourceList"
-                  :key="item.dataSourceID"
-                  :label="item.dataSourceName"
-                  :value="item.dataSourceID"
-                />
+            <el-form-item label="数据源" prop="dataSourceID" size="default" :rules="formRules.isNotNull">
+              <el-select v-model="ruleForm.dataSourceID" placeholder="请选择" clearable>
+                <el-option v-for="item in dataSourceList" :key="item.dataSourceID" :label="item.dataSourceName" :value="item.dataSourceID" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item
-              label="服务名称"
-              prop="serviceID"
-              size="default"
-              :rules="formRules.isNotNull"
-            >
-              <el-select
-                v-model="ruleForm.serviceID"
-                placeholder="请选择"
-                clearable
-              >
-                <el-option
-                  v-for="item in serviceList"
-                  :key="item.serviceID"
-                  :label="item.serviceName"
-                  :value="item.serviceID"
-                />
+            <el-form-item label="服务名称" prop="serviceID" size="default">
+              <el-select v-model="ruleForm.serviceID" placeholder="请选择" clearable>
+                <el-option v-for="item in serviceList" :key="item.serviceID" :label="item.serviceName" :value="item.serviceID" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item
-              label="每页显示"
-              prop="pageRows"
-              size="default"
-              :rules="formRules.isNotNull"
-            >
-              <el-input
-                v-model="ruleForm.pageRows"
-                size="medium"
-                placeholder="请输入每页显示行数"
-                type="number"
-                clearable
-              />
+            <el-form-item label="每页显示" prop="pageRows" size="default" :rules="formRules.isNotNull">
+              <el-input v-model="ruleForm.pageRows" size="medium" placeholder="请输入每页显示行数" type="number" clearable />
             </el-form-item>
           </el-col>
           <el-col>
             <el-form-item label="查询模板描述" size="default">
-              <el-input
-                v-model="ruleForm.queryTemplateDescribe"
-                placeholder="请输入查询模板描述"
-              />
+              <el-input v-model="ruleForm.queryTemplateDescribe" placeholder="请输入查询模板描述" />
             </el-form-item>
           </el-col>
           <el-col>
-            <el-form-item
-              label="查询语句"
-              size="default"
-              prop="queryTemplate"
-              :rules="formRules.isNotNull"
-            >
-              <el-input
-                :autosize="{ minRows: 24, maxRows: 24 }"
-                type="textarea"
-                v-model="ruleForm.queryTemplate"
-                placeholder="请输入查询语句"
-              />
+            <el-form-item label="查询语句" size="default" prop="queryTemplate" :rules="formRules.isNotNull">
+              <el-input :autosize="{ minRows: 24, maxRows: 24 }" type="textarea" v-model="ruleForm.queryTemplate" placeholder="请输入查询语句" />
             </el-form-item>
           </el-col>
         </el-row>