chenjun 1 жил өмнө
parent
commit
2e723c7136

+ 15 - 5
src/components/publicPageForm/index.vue

@@ -2,11 +2,11 @@
   <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="PublicPageForm">
     <el-form ref="ruleForm" :model="tableForm" :label-width="labelWidth">
       <el-row :gutter="20">
-        <el-col v-for="(item, index) in formItemArr" :key=" index" :span="formType == 'horizontal' ? formSpan : 24">
+        <el-col v-for="(item, index) in formItemArr" :key=" index" :span="formType == 'horizontal' ? formSpan : 24"  v-show="isShow(item.isdisplay)">
           <el-form-item :rules="fromDataReq(item)" :prop="item.pagecode" :label="item.pagename">
             <template v-if="fromDataType(item.datatype) == 'SELECT'">
               <el-select class="input-shadow" size="small" filterable default-first-option style="width: 100%" v-model="tableForm[item.pagecode]" @change="changeSelect(item.pagecode, item)" placeholder="请选择" clearable @clear="tableForm[item.pagecode] = ''">
-                <el-option v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistlable']]" :value="itemParams[item['dropdownlistid']]">
+                <el-option v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistlabel']]" :value="itemParams[item['dropdownlistid']]">
                 </el-option>
               </el-select>
             </template>
@@ -27,12 +27,12 @@
             </template>
             <template v-else-if="fromDataType(item.datatype) == 'CHECKBOX'">
               <el-checkbox-group v-model="tableForm[item.pagecode]">
-                <el-checkbox v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlable']] }}</el-checkbox>
+                <el-checkbox v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlabel']] }}</el-checkbox>
               </el-checkbox-group>
             </template>
             <template v-else-if="fromDataType(item.datatype) == 'RADIO'">
               <el-radio-group v-model="tableForm[item.pagecode]">
-                <el-radio v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlable']] }}</el-radio>
+                <el-radio v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlabel']] }}</el-radio>
               </el-radio-group>
             </template>
             <template v-else-if="fromDataType(item.datatype) == 'TIME'">
@@ -155,7 +155,7 @@ export default {
       const formItemCopy = _.cloneDeep(formItem)
       const [allResult, allResultKey] = [[], []]
       formItemCopy.map(({ dropdownlist, pagecode, defaultfilter }) => {
-        if (dropdownlist || dropdownlist == 0) {
+        if (((dropdownlist || dropdownlist == 0)&&dropdownlist!="")) {
           const datacontent = dropdownlist == 19 ? this.formatDefault(defaultfilter) : { filter: { 1: 1 } }
           allResultKey.push(pagecode)
           allResult.push(Query({ serviceid: dropdownlist, datacontent, event: '0' }))
@@ -207,6 +207,16 @@ export default {
         }
       });
       return flag
+    },
+    isShow(isdisplay){
+      let show = false
+      if(eval(isdisplay)){
+        show = true
+      }
+      else{
+        show = false
+      }
+      return show
     }
   }
 }

+ 1 - 1
src/views/tablePage/index.vue

@@ -179,7 +179,7 @@ export default {
     getPageBtnFormSetting (pageAuths, pageAuthForms) {
       const { pageconfigurationid } = [...pageAuthForms][0]
       const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
-      const formItemCopy = tableColumnArrs.filter((item) => item.isdisplay == 1)
+      const formItemCopy = tableColumnArrs.filter((item) => item.isdisplay != 0)
       this.formItem = _.orderBy(formItemCopy, ['displaynumber'], ['asc'])
     },
     //获取表头数据