瀏覽代碼

temp save

liujq 4 年之前
父節點
當前提交
bb61e48c2e

+ 2 - 0
src/api/index.js

@@ -1,6 +1,8 @@
 import base from './base'
 import house from './house'
+import user from './user'
 export default {
   base,
   house,
+  user,
 }

+ 17 - 22
src/api/user.js

@@ -1,24 +1,19 @@
-import request from '@/utils/request'
+/**
+  * 用户
+*/
+import { getRequest, getRequestNoSort } from '@/utils/request'
 
-export function login(data) {
-  return request({
-    url: '/vue-admin-template/user/login',
-    method: 'post',
-    data
-  })
-}
-
-export function getInfo(token) {
-  return request({
-    url: '/vue-admin-template/user/info',
-    method: 'get',
-    params: { token }
-  })
-}
-
-export function logout() {
-  return request({
-    url: '/vue-admin-template/user/logout',
-    method: 'post'
-  })
+export default {
+  admadminlist: params => { // 用户列表
+    return getRequest('/adm/admin/list', params)
+  },
+  admadminedit: params => { // 用户编辑
+    return getRequestNoSort('/adm/admin/edit', params, 'loading')
+  },
+  admadminadd: params => { // 用户添加
+    return getRequestNoSort('/adm/admin/add', params, 'loading')
+  },
+  admadmindel: params => { // 用户删除
+    return getRequestNoSort('/adm/admin/del', params, 'loading')
+  },
 }

+ 1 - 1
src/components/Common/BaseForm.vue

@@ -440,7 +440,7 @@ export default {
     uploadSuccess(res, file) {
       const data = res.data || {}
       const uploadItem = this.curData[this.curFormIndex]
-      this.baseForm[uploadItem.key] = `${data.url}?id=${data.file_id}`
+      this.baseForm[uploadItem.key] = `${data.domain}${data.url}?url=${data.url}&id=${data.file_id}`
       // this.baseForm[uploadItem.key] = uploadItem.uploadData.domain + res.key
       // this.imageUrl = URL.createObjectURL(file.raw)
       this.changeHandle(file)

+ 2 - 1
src/components/Common/Map.vue

@@ -67,7 +67,8 @@ export default {
         city: '全国',
         citylimit: true
       },
-      center: [114.13245, 22.649001],
+      // center: [114.13245, 22.649001],
+      center: [115.852386, 28.684076],
       zoom: 17,
       loaded: false,
       pointObj: {},

+ 5 - 2
src/components/Common/TableList.vue

@@ -145,7 +145,7 @@
         >
           <template slot-scope="scope">
             <div v-if="noEmpty(scope.row[column.prop])" class="img-box" @click="bigImgHandle(scope.row[column.prop])">
-              <img :src="scope.row[column.prop]" class="s-img">
+              <img :src="`${sysDomain}${scope.row[column.prop]}`" class="s-img">
             </div>
             <span v-else>-</span>
           </template>
@@ -347,7 +347,7 @@
         @size-change="sizeChange"
       />
     </div>
-    <popup-big-img :is-show="bigImgShow" :src="bigImgSrc" @close="closebigImg" />
+    <popup-big-img :is-show="bigImgShow" :src="`${sysDomain}${bigImgSrc}`" @close="closebigImg" />
   </div>
 </template>
 <script>
@@ -402,6 +402,9 @@ export default {
     }
   },
   computed: {
+    sysDomain() {
+      return this.$store.state.user.sysDomain
+    },
     tableData() {
       const data = this.data || []
       data.map(item => {

+ 2 - 0
src/store/getters.js

@@ -4,5 +4,7 @@ const getters = {
   sidebar: state => state.app.sidebar,
   device: state => state.app.device,
   token: state => state.user.token,
+  sysDomain: state => state.user.sysDomain,
+  sysUser: state => state.user.sysUser,
 }
 export default getters

+ 12 - 1
src/store/modules/user.js

@@ -1,9 +1,11 @@
 import Vue from 'vue'
-import { getToken, setToken, getStorageDict, setStorageDict } from '@/utils/auth'
+import { getToken, setToken, getStorageDict, setStorageDict, getStorageUser, setStorageUser } from '@/utils/auth'
 
 const getDefaultState = () => {
   return {
     token: getToken(),
+    sysDomain: getStorageUser().domain,
+    sysUser: getStorageUser(),
     dictData: getStorageDict(),
   }
 }
@@ -17,6 +19,12 @@ const mutations = {
   SET_TOKEN: (state, token) => {
     state.token = token
   },
+  SYS_DOMAIN: (state, data) => {
+    state.sysDomain = data
+  },
+  SYS_USER: (state, data) => {
+    state.sysUser = data
+  },
   DICT_DATA: (state, data) => {
     state.dictData = data
   }
@@ -31,6 +39,9 @@ const actions = {
         if (res.token) {
           setToken(res.token)
           commit('SET_TOKEN', res.token)
+          commit('SYS_USER', res.data)
+          setStorageUser(res.data)
+          commit('SYS_DOMAIN', res.data.domain)
           dispatch('getDict')
           resolve()
         } else {

+ 8 - 1
src/utils/auth.js

@@ -11,8 +11,15 @@ export function removeToken() {
 }
 
 export function getStorageDict() {
-  return window.sessionStorage.getItem('fp_dictData')
+  return window.sessionStorage.getItem('fp_dictData') ? JSON.parse(window.sessionStorage.getItem('fp_dictData')) : {}
 }
 export function setStorageDict(data) {
   return window.sessionStorage.setItem('fp_dictData', JSON.stringify(data))
 }
+
+export function getStorageUser(data) {
+  return window.sessionStorage.getItem('fp_user') ? JSON.parse(window.sessionStorage.getItem('fp_user')) : {}
+}
+export function setStorageUser(data) {
+  return window.sessionStorage.setItem('fp_user', JSON.stringify(data))
+}

+ 1 - 1
src/utils/request.js

@@ -111,7 +111,7 @@ service.interceptors.response.use(
 
 function getRequest(url, data, otherParams, method) {
   const token = window.sessionStorage.getItem('fp_token')
-  const params = Object.assign({ token, pageSize: 10, sortOrder: 'DESC', sortField: 'createTime' }, data)
+  const params = Object.assign({ token, page_size: 10}, data)
   // const params = Object.assign({}, data)
   if (otherParams) params[otherParams] = otherParams
   const newUrl = url.toLowerCase()

+ 38 - 0
src/views/base/components/searchForm/Dict.vue

@@ -0,0 +1,38 @@
+<template>
+  <header-collapse>
+    <base-form slot="content" :data="searchData" ref="ruleForm">
+      <div slot="footer">
+        <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+        <el-button :loading="listLoading" class="xl-form-btn t4" @click="updateCash">更新缓存</el-button>
+      </div>
+    </base-form>
+  </header-collapse>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data () {
+    return {
+      searchData: [
+        {label: '类型名称', key: 'dict_name'},
+        {label: '编号', key: 'dict_type'},
+      ]
+    }
+  },
+  methods: {
+    searchHandle () {
+      const oldform = this.$refs.ruleForm.baseForm
+      let newForm = {...oldform}
+      this.$emit('change', newForm)
+    },
+    updateCash () {
+      this.$store.dispatch('user/getDict').then().then(res => {
+        this.$msg('更新成功~')
+      })
+    }
+  }
+}
+</script>

+ 1 - 1
src/views/base/components/searchForm/DictDtl.vue

@@ -12,8 +12,8 @@ export default {
   data () {
     return {
       searchData: [
-        {label: '类型代号', disabled: true, key: 'dict_type'},
         {label: '类型名称', disabled: true, key: 'dict_name'},
+        {label: '类型代号', disabled: true, key: 'dict_type'},
       ]
     }
   },

+ 1 - 1
src/views/base/dict.vue

@@ -26,7 +26,7 @@
 </template>
 <script>
 import { arrToObj } from '@/utils'
-import SearchForm from './components/searchForm/DictSys'
+import SearchForm from './components/searchForm/Dict'
 import DictEdit from './components/popup/DictEdit'
 import baseTable from '_m/baseTable.js'
 export default {

+ 107 - 96
src/views/house/components/popup/IndexEdit.vue

@@ -14,13 +14,16 @@
       <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px" :insertSlotArr="[17,21]">
         <div slot="OI17" class="scoped-product">
           <div class="sp-item" v-for="(product, one) in productData" :key="one">
-            <div class="sp-title">{{product.label}}</div>
+            <div class="sp-title">{{product.product_type_name}}</div>
             <div class="sp-content">
-              <el-form-item label="产品类型均价">
-                <el-input v-model="product.price" placeholder="请输入产品类型均价范围"></el-input>
+              <el-form-item label="产品最低均价">
+                <el-input v-model="product.price_min" placeholder="请输入产品类型最低均价"></el-input>
+              </el-form-item>
+              <el-form-item label="产品最高均价">
+                <el-input v-model="product.price_max" placeholder="请输入产品类型最大高价"></el-input>
               </el-form-item>
               <el-form-item label="户型">
-                <el-select v-model="product.type" placeholder="请选择" :multiple="true" @change="roomTypeChange(one)">
+                <el-select v-model="product.house_type_list_val" placeholder="请选择" :multiple="true" @change="houseTypeChange(one)">
                   <el-option
                     v-for="item in $dictData.house_type"
                     :key="item.val"
@@ -30,12 +33,12 @@
                 </el-select>
               </el-form-item>
               <div class="room-box">
-                <div class="room-item" v-for="(room, two) in product.room" :key="two">
-                  <div class="ri-title">{{room.label}}
+                <div class="room-item" v-for="(room, two) in product.house_type_list" :key="two">
+                  <div class="ri-title">{{room.house_type_name}}
                     <el-button type="small" icon="el-icon-plus" class="xl-form-btn xs t3" @click="roomAreaAdd(one, two)">添加</el-button>
                   </div>
                   <div class="ri-content">
-                    <div class="ri-op" v-for="(area, three) in room.arr" :key="three">
+                    <div class="ri-op" v-for="(area, three) in room.area_list" :key="three">
                       <el-upload
                         class="ri-img"
                         :action="`http://api.kaolanet.com/adm/upload/picture`"
@@ -46,8 +49,8 @@
                         :on-error="roomAreaUploadError"
                         :before-upload="roomAreaUploadBefore"
                       >
-                        <img v-if="area.imgUrl" :src="area.imgUrl" class="img" @click="roomAreaUploadImg(one, two, three)">
-                        <i v-else class="el-icon-plus icon" />
+                        <img v-if="area.img_url" :src="area.img_url" class="img" @click="roomAreaUploadImg(one, two, three)">
+                        <i v-else class="el-icon-plus icon" @click="roomAreaUploadImg(one, two, three)"/>
                       </el-upload>
                       <div class="ri-deal">
                         <input class="ri-input" v-model="area.area" type="text" placeholder="输面积">
@@ -79,6 +82,7 @@
   </div>
 </template>
 <script>
+import { arrToObj } from '@/utils'
 import handleMap from '@/components/Common/Map'
 export default {
   components: { handleMap },
@@ -96,46 +100,8 @@ export default {
       formData: [],
       cObj: {},
       isShowMap: false,
-      productData: [
-        {
-          label: '高层',
-          type: ['322'],
-          price: '12000-15000',
-          room: [
-            {
-              label: '三室两厅两卫',
-              value: '322',
-              arr: [
-                {imgUrl: 'http://dwz.date/etYc', area: '100'},
-                {imgUrl: '', area: '100'},
-              ]
-            },
-            {
-              label: '一室一厅一卫',
-              value: '322',
-              arr: [
-                {imgUrl: 'http://dwz.date/etYc', area: '100'},
-                {imgUrl: '', area: '100'},
-              ]
-            },
-          ]
-        },
-        {
-          label: '洋房',
-          type: ['322'],
-          price: '12000-15000',
-          room: [
-            {
-              label: '三室两厅两卫',
-              value: '322',
-              arr: [
-                {imgUrl: 'http://dwz.date/etYc', area: '100'},
-                {imgUrl: '', area: '100'},
-              ]
-            }
-          ]
-        }
-      ],
+      productData: [],
+      tempImgIndex: [0, 0, 0],
     }
   },
   watch: {
@@ -145,7 +111,6 @@ export default {
           this.loading = true
           this.$api.house.admestatedetail({id: this.curObj.id}).then(res => {
             let curData = res || {}
-            curData.pri_image = `${curData.pri_image_path}?id=${curData.pri_image}`
             if (curData.house_type) curData.house_type = curData.house_type.split(',')
             if (curData.product_type) curData.product_type = curData.product_type.split(',')
             if (curData.hospital_type) curData.hospital_type = curData.hospital_type.split(',')
@@ -153,7 +118,23 @@ export default {
             if (curData.park_type) curData.park_type = curData.park_type.split(',')
             if (curData.metro_line) curData.metro_line = curData.metro_line.split(',')
             if (curData.metro_type) curData.metro_type = curData.metro_type.split(',')
+            curData.pri_image = `${curData.domain}${curData.pri_image}?url=${curData.pri_image}`
             this.cObj = curData || {}
+            let productData = curData.area_data || []
+            productData.map(one =>{
+              one.product_type_name = arrToObj(this.$dictData.product_type)[one.product_type_val]
+              let houseTypeList = one.house_type_list || []
+              one.house_type_list_val = []
+              houseTypeList.map(two => {
+                two.house_type_name = arrToObj(this.$dictData.house_type)[two.house_type_val]
+                one.house_type_list_val.push(String(two.house_type_val))
+                const areaList = two.area_list || []
+                areaList.map(three =>{
+                  three.img_url = `${curData.domain}${three.img_url}?url=${three.img_url}`
+                })
+              })
+            })
+            this.productData = [...productData]
             this.getDef()
             this.loading = false
           })
@@ -165,42 +146,45 @@ export default {
     },
   },
   methods: {
-    roomTypeChange (one, val) {
-      let curRoom = []
-      let typeArr = this.productData[one].type || []
-      this.$dictData.house_type.forEach(houseItem => {
-        typeArr.forEach(typeItem => {
-          if (houseItem.val === typeItem) {
-            curRoom.push({
-              label: houseItem.key,
-              value: houseItem.val,
-              arr: [{imgUrl: '', area: ''}]
-            })
+    houseTypeChange (one) {
+      let productData = [...this.productData]
+      let tempList = []
+      let houseTypeList = productData[one].house_type_list || []
+      const curVal = productData[one].house_type_list_val ||[]
+      curVal.forEach(v =>{
+        let cObj = {
+          house_type_name: arrToObj(this.$dictData.house_type)[v],
+          house_type_val: v,
+          area_list: [{img_url: '', area: ''}]
+        }
+        houseTypeList.forEach((h, hIndex) =>{
+          if (v === String(h.house_type_val)) {
+            cObj.area_list = houseTypeList[hIndex].area_list || []
           }
         })
+        tempList.push(cObj)
       })
-      this.productData[one].room = curRoom
+      productData[one].house_type_list = tempList
+      this.productData = [...productData]
     },
     roomAreaDel (one, two, three) {
       let productData = [...this.productData]
-      productData[one].room[two].arr.splice(three, 1)
+      productData[one].house_type_list[two].area_list.splice(three, 1)
       this.productData = [...productData]
     },
     roomAreaAdd (one, two) {
       let productData = [...this.productData]
-      productData[one].room[two].arr.push({imgUrl: '', area: ''})
+      productData[one].house_type_list[two].area_list.push({img_url: '', area: ''})
       this.productData = [...productData]
     },
     roomAreaUploadImg (one, two, three) {
-      console.log(one, two, three)
+      this.tempImgIndex = [one, two, three]
     },
     roomAreaUploadSuccess(res, file) {
-      // const data = res.data || {}
-      // const uploadItem = this.curData[this.curFormIndex]
-      // this.baseForm[uploadItem.key] = `${data.url}?id=${data.file_id}`
-      // // this.baseForm[uploadItem.key] = uploadItem.uploadData.domain + res.key
-      // // this.imageUrl = URL.createObjectURL(file.raw)
-      // this.changeHandle(file)
+      const data = res.data || {}
+      let productData = [...this.productData]
+      productData[this.tempImgIndex[0]].house_type_list[this.tempImgIndex[1]].area_list[this.tempImgIndex[2]].img_url =  `${data.domain}${data.url}?url=${data.url}&id=${data.file_id}`
+      this.productData = [...productData]
     },
     roomAreaUploadError(file) {
       // this.changeHandle(file)
@@ -221,16 +205,27 @@ export default {
       this.getDef('change', 'metro_line')
     },
     productTypeChange (val, op, item) {
-      const itemArr = item || []
-      let productData = []
-      productData = itemArr.map(item => {
-        return {
-          label: item.key,
-          val: item.val,
+      let itemArr = item || []
+      let productData = [...this.productData]
+      let newArr = []
+      productData.forEach((one, o) => {
+        itemArr.forEach((two, t) => {
+          if (String(one.product_type_val) === String(two.val)) {
+            itemArr[t].edIndex = String(o)
+          }
+        })
+      })
+      itemArr.forEach(cItem => {
+        if (cItem.edIndex) {
+          newArr.push(productData[Number(cItem.edIndex)])
+        } else {
+          newArr.push({
+            product_type_name: cItem.key,
+            product_type_val: cItem.val,
+          })
         }
       })
-      this.productData = productData
-      // this.getDef('change', 'product_type', item)
+      this.productData = [...newArr]
     },
     getDef (str, strKey, strParams) {
       let params = {}
@@ -253,20 +248,13 @@ export default {
       let disabled = false
       if (params.id) disabled = true
       const remoteOptionsSchoolList = []
-      // if (params.schoolList) {
-      //   params.school_id_list = params.schoolList.map(item => {
-      //     remoteOptionsSchoolList.push({ keyRO: item.machineName, valRO: item.machineSn })
-      //     return item.machineSn
-      //   })
-      // } else {
-      //   params.schoolList = []
-      // }
-      let productTypeForm = []
-      if (str === 'change' && strKey === 'product_type') {
-        strParams.forEach(p => {
-          productTypeForm.push({ label: `${p.key}房型`, key: `house_type-${p.val}`, type: 'select', options: this.$dictData.house_type, multiple: true})
-          productTypeForm.push({ label: `${p.key}均价范围`, key: `price-${p.val}`})
+      if (params.school_list) {
+        params.school_id_list = params.school_list.map(item => {
+          remoteOptionsSchoolList.push({ keyRO: item.school_name, valRO: item.id })
+          return item.id
         })
+      } else {
+        params.school_id_list = []
       }
       this.formData = [
         { label: '楼盘名称', key: 'estate_name' },
@@ -319,10 +307,13 @@ export default {
             else if (!newForm.latitude) return this.$msgw('请选择纬度!')
             if (newForm.pri_image && newForm.pri_image.indexOf('?') > -1) {
               const imgArr = newForm.pri_image.split('?')
-              const curPArr = imgArr[1].split('=')
-              if (curPArr[0] === 'id') {
-                newForm.pri_image = curPArr[1]
-              }
+              const queryArr = imgArr[1].split('&')
+              queryArr.forEach(q =>{
+                const curQArr = q.split('=')
+                if (curQArr[0] === 'url') {
+                  newForm.pri_image = curQArr[1]
+                }
+              })
             }
             if (newForm.house_type) newForm.house_type = newForm.house_type.join(',')
             if (newForm.product_type) newForm.product_type = newForm.product_type.join(',')
@@ -331,6 +322,26 @@ export default {
             if (newForm.park_type) newForm.park_type = newForm.park_type.join(',')
             if (newForm.metro_line) newForm.metro_line = newForm.metro_line.join(',')
             if (newForm.metro_type) newForm.metro_type = newForm.metro_type.join(',')
+            let productData = this.productData || []
+            productData.map(one => {
+              const houseTypeList = one.house_type_list || []
+              houseTypeList.map(two => {
+                const areaList = two.area_list || []
+                areaList.map(three =>{
+                  if (three.img_url && three.img_url.indexOf('?') > -1) {
+                    const imgArr = three.img_url.split('?')
+                    const queryArr = imgArr[1].split('&')
+                    queryArr.forEach(q =>{
+                      const curQArr = q.split('=')
+                      if (curQArr[0] === 'url') {
+                        three.img_url = curQArr[1]
+                      }
+                    })
+                  }
+                })
+              })
+            })
+            newForm.area_data = JSON.stringify([...productData])
             let apiStr = 'admestateadd'
             if (this.curObj.id) apiStr = 'admestateedit'
             this.$api.house[apiStr](newForm).then(data => {

+ 15 - 15
src/views/house/components/searchForm/Index.vue

@@ -42,26 +42,26 @@ export default {
         this.searchData = [
           { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
           { label: '楼盘名称', key: 'estate_name' },
-          { label: '就读学校', key: 'search_EQ_companyId', type: 'selectRemote',
-            remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
-          },
-          { label: '地铁线路', key: 'metro_line', type: 'select', options: this.$dictData.metro_line, changeHandle: this.subwayLineChange},
-          { label: '地铁站名', key: 'metro_type', type: 'select', class: 'c-3', options: subwayNameDD},
-          { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type },
-          { label: '周边商圈', key: 'high_street', type: 'select', class: 'c-3', options: this.$dictData.high_street },
-          { label: '周边公园', key: 'park_type', type: 'select', class: 'c-3', options: this.$dictData.park_type },
+          // { label: '就读学校', key: 'search_EQ_companyId', type: 'selectRemote',
+          //   remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
+          // },
+          // { label: '地铁线路', key: 'metro_line', type: 'select', options: this.$dictData.metro_line, changeHandle: this.subwayLineChange},
+          // { label: '地铁站名', key: 'metro_type', type: 'select', class: 'c-3', options: subwayNameDD},
+          // { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type },
+          // { label: '周边商圈', key: 'high_street', type: 'select', class: 'c-3', options: this.$dictData.high_street },
+          // { label: '周边公园', key: 'park_type', type: 'select', class: 'c-3', options: this.$dictData.park_type },
         ]
       } else {
         this.searchData = [
           { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
           { label: '楼盘名称', key: 'estate_name' },
-          { label: '就读学校', key: 'search_EQ_companyId', type: 'selectRemote',
-            remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
-          },
-          { label: '地铁线路', key: 'metro_line', type: 'select', options: this.$dictData.metro_line, changeHandle: this.subwayLineChange},
-          { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type },
-          { label: '周边商圈', key: 'high_street', type: 'select', class: 'c-3', options: this.$dictData.high_street },
-          { label: '周边公园', key: 'park_type', type: 'select', class: 'c-3', options: this.$dictData.park_type },
+          // { label: '就读学校', key: 'search_EQ_companyId', type: 'selectRemote',
+          //   remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
+          // },
+          // { label: '地铁线路', key: 'metro_line', type: 'select', options: this.$dictData.metro_line, changeHandle: this.subwayLineChange},
+          // { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type },
+          // { label: '周边商圈', key: 'high_street', type: 'select', class: 'c-3', options: this.$dictData.high_street },
+          // { label: '周边公园', key: 'park_type', type: 'select', class: 'c-3', options: this.$dictData.park_type },
         ]
       }
       this.setDefaultValue(params, 'searchData')

+ 45 - 0
src/views/house/mixin.js

@@ -4,3 +4,48 @@ export default {
     { key: '禁用', val: '2' }
   ],
 }
+
+
+
+[
+  {
+    product_type_name: '高层',
+    price_min: '12000',
+    price_max: '15000',
+    product_type_val: '322',
+    house_type_list: [
+      {
+        house_type_name: '三室两厅两卫',
+        house_type_val: '322',
+        area_list: [
+          {img_url: 'http://dwz.date/etYc', area: '100'},
+          {img_url: '', area: '100'},
+        ]
+      },
+      {
+        house_type_name: '一室一厅一卫',
+        house_type_val: '322',
+        arr: [
+          {img_url: 'http://dwz.date/etYc', area: '100'},
+          {img_url: '', area: '100'},
+        ]
+      },
+    ]
+  },
+  {
+    product_type_name: '洋房',
+    product_type_val: ['322'],
+    price_min: '12000',
+    price_max: '15000',
+    house_type_list: [
+      {
+        house_type_name: '三室两厅两卫',
+        house_type_val: '322',
+        area_list: [
+          {img_url: 'http://dwz.date/etYc', area: '100'},
+          {img_url: '', area: '100'},
+        ]
+      }
+    ]
+  }
+]

+ 14 - 11
src/views/school/components/popup/IndexEdit.vue

@@ -53,7 +53,7 @@ export default {
           if (this.curObj.id) {
             this.$api.house.admschooldetail({id: this.curObj.id}).then(res => {
               let curData = res || {}
-              curData.pri_image = `${curData.pri_image_path}?id=${curData.pri_image}`
+              curData.pri_image = `${curData.domain}${curData.pri_image}?url=${curData.pri_image}`
               this.cObj = curData || {}
               this.getDef()
             })
@@ -82,13 +82,13 @@ export default {
       this.formData = [
         { label: '学校名称', key: 'school_name', class: 'c-2' },
         { label: '所属区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
-        { label: '学校属性', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
-        { label: '学校类型', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
+        { label: '学校属性', key: 'school_attrib', type: 'select', class: 'c-2', options: this.$dictData.school_attrib },
+        { label: '学校类型', key: 'school_type', type: 'select', class: 'c-2', options: this.$dictData.school_type },
         { label: '图片', key: 'pri_image', type: 'upload' },
-        { label: '周边楼盘', key: 'machineList', type: 'selectRemote', multiple: true, changeHandle: this.deviceChange,
-          remoteParams: { skey: 'search_LIKE_machineName', api: `base.machinelist?search_EQ_status=1`, opKey: 'machineName', opVal: 'machineSn' },
-          remoteOptions: remoteOptionsMachineList
-        },
+        // { label: '周边楼盘', key: 'machineList', type: 'selectRemote', multiple: true, changeHandle: this.deviceChange,
+        //   remoteParams: { skey: 'search_LIKE_machineName', api: `base.machinelist?search_EQ_status=1`, opKey: 'machineName', opVal: 'machineSn' },
+        //   remoteOptions: remoteOptionsMachineList
+        // },
         { label: '学校地址', key: 'address' },
       ]
       this.setDefaultValue(params)
@@ -111,10 +111,13 @@ export default {
             else if (!newForm.latitude) return this.$msgw('请选择纬度!')
             if (newForm.pri_image && newForm.pri_image.indexOf('?') > -1) {
               const imgArr = newForm.pri_image.split('?')
-              const curPArr = imgArr[1].split('=')
-              if (curPArr[0] === 'id') {
-                newForm.pri_image = curPArr[1]
-              }
+              const queryArr = imgArr[1].split('&')
+              queryArr.forEach(q =>{
+                const curQArr = q.split('=')
+                if (curQArr[0] === 'url') {
+                  newForm.pri_image = curQArr[1]
+                }
+              })
             }
             let apiStr = 'admschooladd'
             if (newForm.id) apiStr = 'admschooledit'

+ 3 - 3
src/views/school/components/searchForm/Index.vue

@@ -19,9 +19,9 @@ export default {
       searchData: [
         { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
         { label: '学校名称', key: 'school_name' },
-        { label: '周边楼盘', key: 'search_EQ_companyId', type: 'selectRemote',
-          remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
-        },
+        // { label: '周边楼盘', key: 'search_EQ_companyId', type: 'selectRemote',
+        //   remoteParams: { skey: 'search_LIKE_companyName', api: `config.merchantlist?search_EQ_orgType=90&search_EQ_status=1`, opKey: 'companyName', opVal: 'id' }
+        // },
       ]
     }
   },

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

@@ -69,7 +69,7 @@ export default {
       rows: [
         { label: '所属区域', prop: 'area_type', type: 'flag', flags: arrToObj(this.$dictData.area_type) }, 
         { label: '学校名称', prop: 'school_name', fullShow: true, minWidth: 200 },
-        { label: '图片', prop: 'pri_image_path', type: 'img' },
+        { label: '图片', prop: 'pri_image', type: 'img' },
         { label: '学校地址', prop: 'address' },
         { label: '更新人', prop: 'update_by' },
         { label: '更新时间', prop: 'update_at' },

+ 16 - 3
src/views/user/components/popup/IndexEdit.vue

@@ -47,11 +47,14 @@ export default {
   methods: {
     getDef() {
       const params = { ...this.curObj }
+      console.log(params)
+      params.avatar = `${params.domain}${params.avatar}?url=${params.avatar}`
       const disabled = false
       this.formData = [
-        { label: '姓名', key: 'aa', rules: 1 },
-        { label: '账号', key: 'bb', rules: 1 },
-        { label: '描述', key: 'cc', rules: 1 },
+        { label: '账号', key: 'username', rules: 1 },
+        { label: '昵称', key: 'nickname', rules: 1 },
+        { label: '邮箱', key: 'email' },
+        { label: '头像', key: 'avatar', type: 'upload' },
       ]
       this.setDefaultValue(params)
     },
@@ -61,6 +64,16 @@ export default {
           if (valid) {
             const oldform = this.$refs.ruleForm.baseForm
             const newForm = { ...oldform }
+            if (newForm.avatar && newForm.avatar.indexOf('?') > -1) {
+              const imgArr = newForm.avatar.split('?')
+              const queryArr = imgArr[1].split('&')
+              queryArr.forEach(q =>{
+                const curQArr = q.split('=')
+                if (curQArr[0] === 'url') {
+                  newForm.avatar = curQArr[1]
+                }
+              })
+            }
             if (this.curObj.id) newForm.id = this.curObj.id
             this.$emit('close', newForm)
           }

+ 2 - 2
src/views/user/components/searchForm/Index.vue

@@ -18,8 +18,8 @@ export default {
   data() {
     return {
       searchData: [
-        { label: '姓名', key: 'xxxx' },
-        { label: '账号', key: 'xxxx' },
+        { label: '账号', key: 'username' },
+        { label: '昵称', key: 'nickname' },
       ]
     }
   },

+ 15 - 27
src/views/user/index.vue

@@ -12,6 +12,8 @@
       :page-size="pageSize"
       :total-records="totalRecords"
       @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
     />
     <popup-edit
       :isShow="isDtlShow"
@@ -40,26 +42,16 @@ export default {
   mixins: [baseTable],
   data() {
     return {
-      apiStr: 'base.merchantpointlist',
+      apiStr: 'user.admadminlist',
       searchForm: null,
       isDtlShow: false,
-      noCreated: true,
       curObj: {},
       ...xData
     }
   },
   computed: {
     tableData2() {
-      const arr = [...this.tableData,
-        {id: 1, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 2, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 3, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 4, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 5, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 6, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 7, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-        {id: 8, aa: '张三', bb: 'zhangsan', cc: '这是张三的账号', createByName: 'liujq', createTime: '2021-01-13 10:25', updateByName: 'liujq', updateTime: '2021-01-13 10:25'},
-      ]
+      const arr = [...this.tableData]
       arr.map(item => {
       })
       return arr
@@ -69,13 +61,12 @@ export default {
   mounted() {
     this.listConfig = {
       rows: [
-        { label: '姓名', prop: 'aa' },
-        { label: '账号', prop: 'bb' },
-        { label: '描述', prop: 'cc' },
-        { label: '创建人', prop: 'createByName' },
-        { label: '创建时间', prop: 'createTime' },
-        { label: '更新人', prop: 'updateByName' },
-        { label: '更新时间', prop: 'updateTime' },
+        { label: '昵称', prop: 'nickname' },
+        { label: '账号', prop: 'username' },
+        { label: '头像', prop: 'avatar', type: 'img' },
+        { label: '邮箱', prop: 'email' },
+        { label: '更新人', prop: 'update_by' },
+        { label: '更新时间', prop: 'update_at' },
         { label: '操作', width: 200, type: 'handle2', operations:
           [
             { label: '编辑', func: this.openPopup, btnType: 'primary' },
@@ -88,9 +79,8 @@ export default {
   methods: {
     delHandle(row) {
       this.$msg(`您确定要删除该用户吗?`, 'confirm', () => {
-        this.$api.base.merchantpointstatusupdate({
-          id: row.id,
-          status: 2
+        this.$api.user.admadmindel({
+          id: row.id
         }).then(data => {
           this.$msgs(`已删除!`)
           this.fetchData()
@@ -108,11 +98,9 @@ export default {
     closePopup(obj) {
       if (obj) {
         const params = obj
-        params.machineSn = this.curObj.machineSn
-        params.companyId = this.curObj.companyId
-        let apiStr = 'merchantpointcreate'
-        if (obj.id) apiStr = 'merchantpointupdate'
-        this.$api.base[apiStr]({
+        let apiStr = 'admadminadd'
+        if (obj.id) apiStr = 'admadminedit'
+        this.$api.user[apiStr]({
           ...params
         }).then(data => {
           this.$msgs(obj.id ? '编辑成功' : '新增成功')