Browse Source

temp save

liujq 4 years ago
parent
commit
e8fd8d17c9
2 changed files with 20 additions and 14 deletions
  1. 8 10
      src/views/house/components/searchForm/Theme.vue
  2. 12 4
      src/views/house/theme.vue

+ 8 - 10
src/views/house/components/searchForm/Theme.vue

@@ -1,12 +1,10 @@
 <template>
-  <header-collapse>
-    <base-form slot="content" ref="ruleForm" :data="searchData">
-      <div slot="footer">
-        <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
-        <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
-      </div>
-    </base-form>
-  </header-collapse>
+  <base-form slot="content" ref="ruleForm" :data="searchData">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+      <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
+    </div>
+  </base-form>
 </template>
 <script>
 export default {
@@ -26,18 +24,18 @@ export default {
   methods: {
     getDef (str) {
       let params = { ...this.$refs.ruleForm.baseForm }
-      if (this.parentData.searchForm || this.parentData.searchForm.module_type) params.module_type = this.parentData.searchForm.module_type
       this.searchData = [
         { label: '所属楼盘', key: 'estate_id', type: 'selectRemote',
           remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' }
         },
-        { label: '所属模块', key: 'module_type', type: 'select', options: this.$dictData.module_type},
+        // { label: '所属模块', key: 'module_type', type: 'select', options: this.$dictData.module_type},
       ]
       this.setDefaultValue(params, 'searchData')
     },
     searchHandle() {
       const oldform = this.$refs.ruleForm.baseForm
       const newForm = { ...oldform }
+      newForm.module_type = this.parentData.curNavVal
       this.$emit('change', newForm)
     }
   }

+ 12 - 4
src/views/house/theme.vue

@@ -4,6 +4,9 @@
       :list-loading="listLoading"
       @change="searchHandle"
     />
+    <el-tabs v-model="curNavVal" @tab-click="navHandle">
+      <el-tab-pane :label="item.key" :name="item.val" v-for="(item, index) in mtArr" :key="index"></el-tab-pane>
+    </el-tabs>
     <table-list
       :list-loading="listLoading"
       :data="tableData2"
@@ -27,7 +30,6 @@ import { arrToObj } from '@/utils'
 import SearchForm from './components/searchForm/Theme'
 import PopupEdit from './components/popup/ThemeEdit'
 import baseTable from '_m/baseTable.js'
-import xData from './mixin'
 export default {
   name: 'old',
   components: {
@@ -41,13 +43,16 @@ export default {
   },
   mixins: [baseTable],
   data() {
+    const mtArr = this.$dictData.module_type || []
+    const curNavVal = mtArr.length > 0 ? mtArr[0].val : ''
     return {
       apiStr: 'house.admestatemodulelist',
       searchForm: {},
       isDtlShow: false,
       // noCreated: true,
       curObj: {},
-      ...xData
+      mtArr,
+      curNavVal,
     }
   },
   computed: {
@@ -59,9 +64,8 @@ export default {
     }
   },
   created() {
-    const mtArr = this.$dictData.module_type || []
     this.searchForm = {
-      module_type: mtArr[0].val
+      module_type: this.curNavVal
     }
   },
   mounted() {
@@ -82,6 +86,10 @@ export default {
     }
   },
   methods: {
+    navHandle () {
+      this.searchForm.module_type = this.curNavVal
+      this.fetchData()
+    },
     delHandle(row) {
       this.$msg(`您确定要删除该模块主题吗?`, 'confirm', () => {
         this.$api.house.admestatemoduledel({