liujq 4 years ago
parent
commit
3092267a49

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-766bf331.8c975997.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.57416164.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.75205dbb.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-455adc74.d81c2225.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-5aaa625d.81d7e27d.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6d588c2f.68bd7792.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6e91bd64.901f6915.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-766bf331.2971c351.js


+ 9 - 0
src/api/base.js

@@ -38,4 +38,13 @@ export default {
   admuploadpicture: params => { // 楼盘主图上传接口
     return getRequestNoSort('/adm/upload/picture', params, 'loading')
   },
+  admpermissionsadd: params => { // 菜单 - 添加
+    return getRequestNoSort('/adm/permissions/add', params, 'loading')
+  },
+  admpermissionsedit: params => { // 菜单 - 编辑
+    return getRequestNoSort('/adm/permissions/edit', params, 'loading')
+  },
+  admpermissionslist: params => { // 菜单 - 列表
+    return getRequest('/adm/permissions/list', params)
+  },
 }

+ 6 - 0
src/router/index.js

@@ -46,6 +46,12 @@ export let moreRoutes = [
         component: () => import('@/views/base/dict'),
         meta: { title: '系统字典' }
       },
+      {
+        path: 'menu',
+        name: 'Menu',
+        component: () => import('@/views/base/menu'),
+        meta: { title: '菜单配置' }
+      },
       {
         path: 'dictDtl',
         name: 'DictDtl',

+ 73 - 0
src/views/base/components/popup/MenuEdit.vue

@@ -0,0 +1,73 @@
+<template>
+<el-dialog
+  v-loading="loading"
+  :show-close="false"
+  :close-on-click-modal="false"
+  :visible.sync="isShow"
+  :title="this.curObj && this.curObj.id ? '编辑菜单' : '添加菜单'"
+  :fullscreen="false"
+  width="470px"
+  custom-class="xl-dialog"
+  center>
+  <base-form style="width:400px" :data="formData" ref="ruleForm" :isInline="false" labelWidth="120px">
+    <div slot="footer">
+      <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+      <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+    </div>
+  </base-form>
+</el-dialog>
+</template>
+<script>
+export default {
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  mixins,
+  data() {
+    return {
+      formData: [],
+      loading: true
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        let params = {...this.curObj}
+        this.formData = [
+          {label: '菜单名称', key: 'name', rules: 1},
+          {label: '类型', key: 'perm_type', type: 'select', options: this.$dictData.perm_type, rules: 1},
+          {label: '路径', key: 'path', rules: 1},
+          {label: '状态', key: 'perm_status', type: 'select', options: this.$dictData.perm_status, rules: 1},
+        ]
+        this.setDefaultValue(params)
+      }
+    }
+  },
+  methods: {
+    close (str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let params = {...oldform}
+            let str = 'admpermissionsadd'
+            if(this.curObj && this.curObj.id) {
+              params.dict_id = this.curObj.id
+              str = 'admpermissionsedit'
+            }
+            this.$api.base[str](params).then(data => {
+              this.$msgs('保存成功!')
+              this.$emit('close', params)
+              // this.setDefaultValue()
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>

+ 100 - 0
src/views/base/menu.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="app-container">
+    <!-- <el-tree :data="curData" :props="defaultProps"></el-tree> -->
+    <el-tree
+      :data="curData"
+      node-key="id"
+      default-expand-all
+      :expand-on-click-node="false">
+      <span class="custom-tree-node" slot-scope="{ node, data }">
+        <span>{{ node.data.name }}</span>
+        <span>
+          <el-button
+            type="text"
+            size="mini"
+            @click="() => appendMenu(data)">
+            添加
+          </el-button>
+          <el-button
+            type="text"
+            size="mini"
+            @click="() => removeMenu(node, data)">
+            删除
+          </el-button>
+        </span>
+      </span>
+    </el-tree>
+    <popup-edit
+      :isShow="isPopupShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Dict'
+import PopupEdit from './components/popup/MenuEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'basePublicDictSys',
+  components: {
+    SearchForm,
+    PopupEdit
+  },
+  provide () {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  created () {},
+  data () {
+    return {
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      curData: [],
+      isPopupShow: false,
+      curObj: {},
+    }
+  },
+  mounted () {
+    this.$api.base.admpermissionslist().then(res => {
+      this.curData = res || []
+      console.log(res)
+    })
+  },
+  methods: {
+    appendMenu (data) {},
+    removeMenu (node, name) {
+      console.log(node)
+    },
+    delHandle (row) {
+      const msgHtml = `确定要删除此字典吗?`
+      this.$msg(msgHtml, 'confirm', ()=> {
+        this.$api.base.dicttypedel({
+          dict_id: row.id,
+        }).then(data => {
+          this.$msgs(`删除成功!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    linkDtl (row) {
+      this.$router.push(`/base/dictDtl?dict_type=${row.dict_type}&dict_name=${row.dict_name}&id=${row.id}`)
+    },
+    openPopup (row) {
+      this.curObj = row
+      this.isPopupShow = true
+    },
+    closePopup (obj) {
+      this.isPopupShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 15 - 16
src/views/school/components/popup/IndexEdit.vue

@@ -69,26 +69,25 @@ export default {
       const params = { ...this.cObj }
       const disabled = false
       if (!params.pri_image) params.pri_image = 'http://img.honglounews.com/20210429034015-4091.png'
-      const remoteOptionsMachineList = []
-      if (params.machineList) {
-        params.machineList = params.machineList.map(item => {
-          remoteOptionsMachineList.push({ keyRO: item.machineName, valRO: item.machineSn })
-          return item.machineSn
+      let remoteOptionsHouse = []
+      if (params.estate_list && params.estate_list.length > 0) {
+        params.estate_id_list = params.estate_list.map(item => {
+          remoteOptionsHouse.push({ keyRO: item.estate_name, valRO: item.id })
+          return item.id
         })
       } else {
-        params.machineList = []
+        params.estate_list = []
       }
-      // if (params.id) disabled = true
       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: '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: 'estate_id_list', multiple: true, type: 'selectRemote', changeHandle: this.deviceChange,
+          remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+          remoteOptionsHouse
+        },
         { label: '学校地址', key: 'address' },
       ]
       this.setDefaultValue(params)
@@ -100,11 +99,11 @@ export default {
             const oldform = this.$refs.ruleForm.baseForm
             const newForm = { ...oldform }
             if (this.curObj.id) newForm.id = this.curObj.id
-            // if (newForm.machineList && newForm.machineList.length > 0) {
-            //   newForm.machineList = newForm.machineList.join(',')
-            // } else {
-            //   newForm.machineList = ''
-            // }
+            if (newForm.estate_id_list && newForm.estate_id_list.length > 0) {
+              newForm.estate_id_list = newForm.estate_id_list.join(',')
+            } else {
+              newForm.estate_id_list = ''
+            }
             newForm.longitude = this.cObj.longitude
             newForm.latitude = this.cObj.latitude
             if (!newForm.longitude) return this.$msgw('请选择经度!')

Some files were not shown because too many files changed in this diff