whj 11 달 전
부모
커밋
92ca2e2528

+ 156 - 0
src/api/common/menu-mine.js

@@ -0,0 +1,156 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getCommonMenuMinePage (parameter) {
+  return axios({
+    url: '/common/menu-mine/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getCommonMenuMine (parameter) {
+  return axios({
+    url: '/index/index/getCommonMenuMineVO',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getCommonMenuMineChoosePage (parameter) {
+  return axios({
+    url: '/common/menu/choose/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * delete batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCommonMenuMines (parameter) {
+  return axios({
+    url: '/common/menu-mine',
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * delete single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function exportCommonMenuMine (parameter) {
+  return axios({
+    url: '/common/menu-mine/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}

+ 129 - 0
src/api/common/menu.js

@@ -0,0 +1,129 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getCommonMenuPage (parameter) {
+    return axios({
+        url: '/common/menu/page?' + stringify(parameter),
+        method: 'get',
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        }
+    })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu',
+        method: 'POST',
+        headers: {
+            'Accept': 'application/json',
+            'Content-Type': 'application/json;charset=UTF-8'
+        },
+        data: parameter
+    })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu/' + parameter.id,
+        method: 'PUT',
+        data: parameter
+    })
+}
+
+                                            
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu/' + parameter.id,
+        method: 'get',
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        }
+    })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu?' + stringify(parameter),
+        method: 'get',
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        }
+    })
+}
+
+/**
+ * delete batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCommonMenus (parameter) {
+    return axios({
+        url: '/common/menu',
+        method: 'DELETE',
+        data: parameter
+    })
+}
+
+/**
+ * delete single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu/' + parameter.id,
+        method: 'DELETE',
+        data: parameter
+    })
+}
+
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function exportCommonMenu (parameter) {
+    return axios({
+        url: '/common/menu/export?' + stringify(parameter),
+        method: 'get',
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        },
+        responseType: 'blob'
+    })
+}

+ 43 - 45
src/components/Upload/CUploadFile.vue

@@ -1,13 +1,6 @@
 <template>
   <div class="clearfix">
-    <a-upload
-      :action="action"
-      :fileList="fileList"
-      multiple
-      @change="handleChange"
-      :customRequest="customRequest"
-      :remove="handleRemove"
-      :beforeUpload="beforeUpload">
+    <a-upload :action="action" :fileList="fileList" multiple @change="handleChange" :customRequest="customRequest" :remove="handleRemove" :beforeUpload="beforeUpload">
       <div class="file-btn" v-if="fileList.length < maxSize">
         <a-icon type="paper-clip" />
         <div class="ant-upload-text">点击上传</div>
@@ -22,84 +15,89 @@ export default {
   name: 'Upload',
   model: {
     prop: 'value',
-    event: 'change'
+    event: 'change',
   },
-  data () {
+  data() {
     return {
       previewVisible: false,
       previewImage: '',
       fileList: [],
       isWatch: true,
-      action: process.env.VUE_APP_API_BASE_URL + '/upms/files/upload'
+      action: process.env.VUE_APP_API_BASE_URL + '/upms/files/upload',
     }
   },
   props: {
     maxSize: {
       type: Number,
-      default: 1
+      default: 1,
     },
     value: {
-      type: Array
-    }
+      type: Array,
+    },
   },
   watch: {
     fileList: {
-      handler (newV, oldV) {
+      handler(newV, oldV) {
         this.fileList = newV
         this.$emit('change', newV)
       },
       deep: true,
-      immediate: true
+      immediate: true,
     },
     value: {
       deep: true,
       immediate: true,
       handler: function (newV) {
         // 数据为空的三种情况
+        if (newV === null || newV === '' || newV === undefined) {
+          this.fileList = []
+          this.isWatch = true
+          return
+        }
         if (this.isWatch) {
           this.isWatch = false
-          if (newV === null || newV === '' || newV === undefined) {
-            this.fileList = []
-            return
+          if (newV.length > 0) {
+            this.fileList = this.BaseTool.UPLOAD.transImg(newV)
+          } else {
+            this.isWatch = true
           }
-          this.fileList = this.BaseTool.UPLOAD.transImg(newV)
         }
-      }
-    }
+      },
+    },
   },
   methods: {
-    base (fileList) {
+    base(fileList) {
       this.fileList = fileList
     },
-    handleCancel () {
+    handleCancel() {
       this.previewVisible = false
     },
-    handlePreview (file) {
+    handlePreview(file) {
       this.previewImage = file.url || file.thumbUrl
       this.previewVisible = true
     },
-    handleChange ({ fileList }) {
+    handleChange({ fileList }) {
       // this.fileList = fileList
       // this.$emit('catchFile', fileList)
     },
-    async customRequest (data) {
+    async customRequest(data) {
       const formData = new FormData()
       formData.append('file', data.file)
       data.onProgress()
       this.$loading.show()
-      uploadFile(formData).then(res => {
+      uploadFile(formData).then((res) => {
         this.$loading.hide()
         data.onSuccess()
         this.fileList.push({
           uid: '-1',
           name: res.data.name,
           status: 'done',
-          url: this.BaseTool.Constant.FILE_URL + res.data.url
+          url: this.BaseTool.Constant.FILE_URL + res.data.url,
         })
         this.$emit('catchFile', this.fileList)
       })
     },
-    handleRemove (file) {
+    handleRemove(file) {
       const index = this.fileList.indexOf(file)
       const newFileList = this.fileList.slice()
       newFileList.splice(index, 1)
@@ -107,7 +105,7 @@ export default {
       this.$emit('catchFile', this.fileList)
       return true
     },
-    beforeUpload (file, fileList) {
+    beforeUpload(file, fileList) {
       const reg = /\.(doc|docx|html|pdf|txt|mht|xlsx|xls|jpg|png|zip|png|jpg|gif|jpeg|webp|zip|rar|7z|dxf)(\?.*)?$/
       // if (this.fileType === 1) {
       //   reg = /\.(jpg|png|gif)(\?.*)?$/
@@ -120,24 +118,24 @@ export default {
           reject(new Error('请上传正确的文件格式'))
         }
       })
-    }
-  }
+    },
+  },
 }
 </script>
 <style>
-  /* you can make up upload button and sample style by using stylesheets */
-  .ant-upload-select-picture-card i {
-    font-size: 32px;
-    color: #999;
-  }
+/* you can make up upload button and sample style by using stylesheets */
+.ant-upload-select-picture-card i {
+  font-size: 32px;
+  color: #999;
+}
 
-  .ant-upload-select-picture-card .ant-upload-text {
-    margin-top: 8px;
-    color: #666;
-  }
-  .ant-upload-btn {
-    margin-top: 20px;
-  }
+.ant-upload-select-picture-card .ant-upload-text {
+  margin-top: 8px;
+  color: #666;
+}
+.ant-upload-btn {
+  margin-top: 20px;
+}
 </style>
 <style lang="less" scoped>
 .file-btn {

+ 29 - 32
src/components/Upload/CUploadImg.vue

@@ -1,15 +1,6 @@
 <template>
   <div class="clearfix">
-    <a-upload
-      :action="action"
-      multiple
-      :fileList="fileList"
-      list-type="picture-card"
-      @preview="handlePreview"
-      @change="handleChange"
-      :customRequest="customRequest"
-      :remove="handleRemove"
-      :beforeUpload="beforeUpload">
+    <a-upload :action="action" multiple :fileList="fileList" list-type="picture-card" @preview="handlePreview" @change="handleChange" :customRequest="customRequest" :remove="handleRemove" :beforeUpload="beforeUpload">
       <div v-if="fileList.length < maxSize">
         <a-icon type="upload" style="margin-left: 15px" />
         <div class="ant-upload-text">上传图片</div>
@@ -25,61 +16,67 @@
 import { uploadFile } from '@/api/upms/file'
 export default {
   name: 'UploadImg',
-  data () {
+  data() {
     return {
       previewVisible: false,
       previewImage: '',
       fileList: [],
-      action: process.env.VUE_APP_API_BASE_URL + '/upms/files/upload'
+      action: process.env.VUE_APP_API_BASE_URL + '/upms/files/upload',
     }
   },
   props: {
     maxSize: {
       type: Number,
-      default: 1
+      default: 1,
     },
     value: {
-      type: Array
-    }
+      type: Array,
+    },
   },
   watch: {
     fileList: {
-      handler (newV, oldV) {
+      handler(newV, oldV) {
         this.fileList = newV
         this.$emit('change', newV)
       },
       deep: true,
-      immediate: true
+      immediate: true,
     },
     value: {
       deep: true,
       immediate: true,
       handler: function (newV) {
+        console.log(newV)
         // 数据为空的三种情况
+        if (newV === null || newV === '' || newV === undefined) {
+          this.fileList = []
+          this.isWatch = true
+          return
+        }
         if (this.isWatch) {
           this.isWatch = false
-          if (newV === null || newV === '' || newV === undefined) {
-            this.fileList = []
-            return
+          if (newV.length > 0) {
+            this.fileList = this.BaseTool.UPLOAD.transImg(newV)
+          } else {
+            this.isWatch = true
           }
-          this.fileList = this.BaseTool.UPLOAD.transImg(newV)
         }
-      }
-    }
+      },
+    },
   },
   methods: {
-    handleCancel () {
+    handleCancel() {
       this.previewVisible = false
     },
-    handlePreview (file) {
+    handlePreview(file) {
       this.previewImage = file.url || file.thumbUrl
       this.previewVisible = true
     },
-    handleChange ({ fileList }) {
+    handleChange({ fileList }) {
       // this.fileList = fileList
       // this.$emit('catchFile', fileList)
     },
-    async customRequest (data) {
+    async customRequest(data) {
       const formData = new FormData()
       formData.append('file', data.file)
       data.onProgress()
@@ -95,13 +92,13 @@ export default {
             uid: '-1',
             name: res.data.name,
             status: 'done',
-            url: this.BaseTool.Constant.FILE_URL + res.data.url
+            url: this.BaseTool.Constant.FILE_URL + res.data.url,
           })
         }
         this.$emit('catchFile', this.fileList)
       })
     },
-    handleRemove (file) {
+    handleRemove(file) {
       const index = this.fileList.indexOf(file)
       const newFileList = this.fileList.slice()
       newFileList.splice(index, 1)
@@ -109,7 +106,7 @@ export default {
       this.$emit('catchFile', this.fileList)
       return true
     },
-    beforeUpload (file, fileList) {
+    beforeUpload(file, fileList) {
       const reg = /\.(jpg|png|zip|png|jpg|gif|jpeg|webp)(\?.*)?$/
       // if (this.fileType === 1) {
       //   reg = /\.(jpg|png|gif)(\?.*)?$/
@@ -122,8 +119,8 @@ export default {
           reject(new Error('请上传正确的图片格式'))
         }
       })
-    }
-  }
+    },
+  },
 }
 </script>
 <style>

+ 36 - 0
src/components/viewImg/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <a-modal :visible="visible" :footer="null" @cancel="handleCancel" :width="width">
+    <img style="width: 100%" :src="previewImage" />
+  </a-modal>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      visible: false,
+      previewImage: ''
+    }
+  },
+  props: {
+    width: {
+      type: Number,
+      default: 800
+    }
+  },
+  methods: {
+    base (url) {
+      this.visible = true
+      this.previewImage = url
+    },
+    handleCancel () {
+      this.visible = false
+      this.previewImage = ''
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 1 - 1
src/router/generator-platform-routers.js

@@ -461,7 +461,7 @@ const constantRouterComponents = {
   'WaitPublish': () => import('@/views/workplace/publish/WaitPublish'), 
   'WaitWork': () => import('@/views/workplace/publish/WaitWork'), 
   'Executed': () => import('@/views/workplace/publish/Executed'), 
-
+  'CommonMenu': () => import('@/views/common/menu/CommonMenu'), // 常用菜单库
 }
 
 // 前端未找到页面路由(固定不用改)

+ 267 - 0
src/views/common/menu/CommonMenu.vue

@@ -0,0 +1,267 @@
+<template>
+  <a-card :bordered="false">
+    <div v-show="visible">
+      <div class="table-page-search-wrapper" @keyup.enter="handleEnter">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关键字">
+                <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6 || 24" :sm="24" style="text-align: right">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+
+      <div class="table-operator" style="margin-bottom: 8px;">
+        <a-row>
+          <a-col :md="16">
+            <a-button v-if="$auth('common-menu-add')" type="primary" icon="plus" @click="handleAdd()">新增</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('common-menu-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+            <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('common-menu-del')">
+              <a-menu slot="overlay">
+                <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+                  <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
+                </a-popconfirm>
+              </a-menu>
+              <a-button style="margin-left: 8px">
+                批量操作 <a-icon type="down" />
+              </a-button>
+            </a-dropdown>
+          </a-col>
+        </a-row>
+      </div>
+
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <template #iconPath="text">
+          <img
+            :src="text"
+            alt=""
+            width="100"
+            height="100"
+            @click="$refs.imgView.base(text)"
+            style=" cursor: pointer">
+        </template>
+        <span slot="action" slot-scope="record">
+          <template>
+            <a @click="handleView(record)">查看</a>
+            <operation-button
+              v-if="$auth('common-menu-edit')"
+              @click="handleEdit(record)"
+            >修改</operation-button>
+            <operation-button
+              v-if="$auth('common-menu-del')"
+              :type="2"
+              title="是否要删除该条数据?"
+              @confirm="batchDelete(record.id)">删除</operation-button>
+          </template>
+        </span>
+      </s-table>
+    </div>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+    <ImgView ref="imgView" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import { getCommonMenuPage, deleteCommonMenus, fetchCommonMenu, exportCommonMenu } from '@/api/common/menu'
+import ImgView from '@/components/viewImg'
+export default {
+  name: 'CommonMenuList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    ImgView
+  },
+  data () {
+    return {
+      advanced: false,
+      visible: true,
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '菜单名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '路由地址',
+          dataIndex: 'routerUrl'
+        },
+        {
+          title: '图标地址',
+          dataIndex: 'iconPath',
+          scopedSlots: { customRender: 'iconPath' }
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        },
+        {
+          title: '添加时间',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '创建人',
+          dataIndex: 'createdUserName'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getCommonMenuPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.tableOption()
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteCommonMenus(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleAdd () {
+      this.visible = false
+      const modal = this.$refs.baseModal
+      modal.base()
+    },
+    handleEdit (record) {
+      this.visible = false
+      fetchCommonMenu({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      this.visible = false
+      fetchCommonMenu({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk (values) {
+      this.visible = true
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportCommonMenu(parameter).then(file => {
+        this.BaseTool.Util.downLoadExportExcel(file)
+      })
+    },
+    handleEnter () {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 136 - 0
src/views/common/menu/modules/BaseForm.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+          <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+    <a-form :form="form">
+
+      <a-form-item v-show="false">
+        <a-input v-decorator="['id']" type="hidden" />
+      </a-form-item>
+      <row-list :col="2">
+        <row-item>
+          <a-form-item label="菜单名称" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <a-input v-decorator="['name', {rules: [{required: true, message: '菜单名称不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+
+          <a-form-item label="路由地址" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <a-input v-decorator="['routerUrl', {rules: [{required: true, message: '路由地址不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+
+          <a-form-item label="图标地址" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <Upload v-decorator="['iconPath']" />
+          </a-form-item>
+        </row-item>
+        <row-item>
+
+          <a-form-item label="备注" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
+            <a-input v-decorator="['remark']" />
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+  </a-card>
+</template>
+
+<script>
+import Upload from '@/components/Upload/CUploadImg.vue'
+import pick from 'lodash.pick'
+import { addCommonMenu, updateCommonMenu } from '@/api/common/menu'
+export default {
+  name: 'BaseCommonMenu',
+  components: {
+    Upload,
+  },
+  data() {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      files: [],
+      // 下拉框map
+    }
+  },
+  props: {},
+  created() {
+    // 下拉框map
+  },
+  methods: {
+    base(record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        return
+      }
+      this.modalTitle = '编辑'
+      record.iconPath = [
+        {
+          uid: -1,
+          name: 'icon',
+          status: 'done',
+          url: record.iconPath,
+        },
+      ]
+      const {
+        form: { setFieldsValue },
+      } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, ['id', 'name', 'routerUrl', 'iconPath', 'remark'])))
+      })
+    },
+    save() {
+      const {
+        form: { validateFieldsAndScroll },
+      } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        values.iconPath = values.iconPath[0].url
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addCommonMenu(values)
+            .then(() => {
+              this.handleCancel(values)
+            })
+            .catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateCommonMenu(values)
+            .then(() => {
+              this.handleCancel(values)
+            })
+            .catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel(values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      } else {
+        this.$emit('ok')
+      }
+    },
+  },
+}
+</script>

+ 286 - 0
src/views/common/menu/modules/CommonMenuSelectModal.vue

@@ -0,0 +1,286 @@
+<template>
+    <a-modal
+            :title="modalTitle"
+            :width="1000"
+            :visible="visible"
+            :confirmLoading="confirmLoading"
+            class="ant-modal2"
+            @cancel="handleCancel"
+    >
+        <a-card :bordered="false">
+            <div class="table-page-search-wrapper">
+                <a-form layout="inline">
+                    <a-row :gutter="48">
+                        <a-col :md="6" :sm="24">
+                            <a-form-item label="关键字">
+                                <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称"/>
+                            </a-form-item>
+                        </a-col>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <a-col :md="6 || 24" :sm="24">
+                            <span class="table-page-search-submitButtons">
+                                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+                                <a @click="()=>{ this.advanced = !this.advanced}" style="margin-left: 8px">
+                                  {{ advanced ? '收起' : '展开' }}
+                                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                                </a>
+                            </span>
+                        </a-col>
+                    </a-row>
+                </a-form>
+            </div>
+
+            <div class="table-operator">
+            </div>
+
+            <s-table
+                    ref="table"
+                    size="default"
+                    rowKey="id"
+                    :columns="columns"
+                    :data="loadData"
+                    :alert="options.alert"
+                    :customRow="options.customRow"
+                    :rowSelection="options.rowSelection"
+                    showPagination="auto"
+            >
+                <span slot="action" slot-scope="record1">
+                  <template>
+                    <a @click="handleView(record1)">查看</a>
+                  </template>
+                </span>
+            </s-table>
+            <detail ref="detailModal"/>
+        </a-card>
+        <template slot="footer">
+            <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+            <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
+        </template>
+    </a-modal>
+</template>
+
+<script>
+    import { STable, Ellipsis } from '@/components'
+    import Detail from './Detail'
+    import { getCommonMenuPage, fetchCommonMenu } from '@/api/common/menu'
+
+    export default {
+        name: 'CommonMenuSelectModal',
+        components: {
+            STable,
+            Ellipsis,
+            Detail
+        },
+        props: {
+            type: {
+                type: String,
+                default: 'radio'
+            },
+            selectedRowKey: {
+                type: Array,
+                default: () => {
+                    return []
+                }
+            },
+            selectedRow: {
+                type: Array,
+                default: () => {
+                    return []
+                }
+            }
+        },
+        data () {
+            return {
+                advanced: false,
+                confirmLoading: false,
+                mdl: {},
+                modalTitle: null,
+                visible: false,
+                record: null,
+                // 查询参数
+                queryParam: {
+                },
+                extraQueryParam: {
+                },
+                // 表头
+                columns: [
+                    {
+                        title: '序号',
+                        dataIndex: 'index',
+                        customRender: (text, record, index) => {
+                            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+                        }
+                    },
+                                                                                                                                                {
+                                title: '菜单名称',
+                                dataIndex: 'name'
+                            },
+                                                                                                                                                        {
+                                title: '路由地址',
+                                dataIndex: 'routerUrl'
+                            },
+                                                                                                                                                        {
+                                title: '图标地址',
+                                dataIndex: 'iconPath'
+                            },
+                                                                                                                                                        {
+                                title: '备注',
+                                dataIndex: 'remark'
+                            },
+                                                                                                                                                        {
+                                title: '添加时间',
+                                dataIndex: 'createdTime'
+                            },
+                                                                                                                                                                                                    {
+                                title: '创建人',
+                                dataIndex: 'createdUserName'
+                            },
+                                                                                                                                                                                                                                {
+                        title: '操作',
+                        key: 'action',
+                        width: '200px',
+                        align: 'center',
+                        scopedSlots: { customRender: 'action' }
+                    }
+                ],
+                // 下拉框map
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            // 加载数据方法 必须为 Promise 对象
+                loadData: parameter => {
+                    parameter = {
+                        ...parameter,
+                        ...this.queryParam,
+                        ...this.extraQueryParam,
+                        dataScope: {
+                            sortBy: 'desc',
+                            sortName: 'update_time'
+                        }
+                    }
+                    return getCommonMenuPage(Object.assign(parameter, this.queryParam))
+                            .then(res => {
+                                return res.data
+                            })
+                },
+                selectedRowKeys: [],
+                selectedRows: [],
+
+                options: {
+                    alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+                    rowSelection: {
+                        selectedRowKeys: this.selectedRowKeys,
+                        onChange: this.onSelectChange
+                    }
+                },
+                optionAlertShow: false,
+                isCreated: false
+            }
+        },
+        created () {
+            // 下拉框map
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        },
+        methods: {
+            tableOption () {
+                if (!this.optionAlertShow) {
+                    this.options = {
+                        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+                        rowSelection: {
+                            selectedRowKeys: this.selectedRowKeys,
+                            onChange: this.onSelectChange,
+                            type: this.type,
+                            getCheckboxProps: record => ({
+                                props: {
+                                    disabled: false,
+                                    name: record.id
+                                }
+                            })
+                        },
+                        customRow: (record) => {
+                            return {
+                                on: { // 事件
+                                    click: (event) => { // 点击行
+                                        // 选择对象
+                                        this.mySelect([record.id], [record])
+                                    },
+                                    dblclick: (event) => {
+                                        this.mySelect([record.id], [record])
+                                        this.handleSelect()
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    this.optionAlertShow = true
+                } else {
+                    this.options = {
+                        alert: false,
+                        rowSelection: null
+                    }
+                    this.optionAlertShow = false
+                }
+            },
+            handleView (record) {
+                fetchCommonMenu({ id: record.id }).then(res => {
+                    const modal = this.$refs.detailModal
+                    modal.base(res.data)
+                })
+            },
+            handleOk () {
+                this.$refs.table.refresh()
+            },
+            onSelectChange (selectedRowKeys, selectedRows) {
+                this.selectedRowKeys = selectedRowKeys
+                this.selectedRows = selectedRows
+            },
+            resetSearchForm () {
+                this.queryParam = {
+                }
+                this.$refs.table.refresh(true)
+            },
+            base (record, queryParam = {}) {
+                this.visible = true
+                this.modalTitle = '选择信息'
+                this.extraQueryParam = queryParam
+                this.record = record
+                if (this.isCreated) {
+                    this.$refs.table.clearSelected()
+                    this.options.rowSelection.type = this.type
+                    this.handleOk()
+                } else {
+                    this.tableOption()
+                    this.isCreated = true
+                }
+            },
+            handleCancel () {
+                this.visible = false
+                this.confirmLoading = false
+            },
+            handleSelect () {
+                if (this.selectedRowKeys.length === 0) {
+                    this.$message.warn('请至少选择一项信息')
+                } else {
+                    this.confirmLoading = true
+                    this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
+                    this.confirmLoading = false
+                    this.visible = false
+                }
+            },
+            mySelect(selectedRowKeys, selectedRows) {
+                if (this.type === 'radio') {
+                    this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+                            this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+                } else {
+                    let mySelectedRowKeys
+                    let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
+                    if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
+                        mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
+                    } else {
+                        mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
+                        mySelectedRows = [...mySelectedRows, ...selectedRows]
+                    }
+                    this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
+                            this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
+                }
+
+            }
+        }
+    }
+</script>

+ 68 - 0
src/views/common/menu/modules/Detail.vue

@@ -0,0 +1,68 @@
+<template>
+    <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+        <a-row :gutter="48" slot="extra">
+            <a-col :md="48" :sm="48">
+              <span class="table-page-search-submitButtons" style="float: right">
+                <a-button style="margin-left: 8px" type="default" @click="handleCancel()">返回</a-button>
+              </span>
+            </a-col>
+        </a-row>
+        <detail-list title="" :col="2">
+                                                                                                    <detail-list-item term="菜单名称">{{ model.name }}</detail-list-item>
+                                                                                                            <detail-list-item term="路由地址">{{ model.routerUrl }}</detail-list-item>
+                                                                                                            <detail-list-item term="图标地址">{{ model.iconPath }}</detail-list-item>
+                                                                                                            <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+                                                                                                                                        <detail-list-item term="创建人ID">{{ model.createdUserId }}</detail-list-item>
+                                                                                                                                        <detail-list-item term="入库日期">{{ model.updateTime }}</detail-list-item>
+                                                                                                            <detail-list-item term="更新人ID">{{ model.updateUserId }}</detail-list-item>
+                                                                                                            <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
+                                                        </detail-list>
+    </a-card>
+</template>
+
+<script>
+    import DetailList from '@/components/tools/DetailList'
+    const DetailListItem = DetailList.Item
+
+    export default {
+        name: 'CommonMenuDetail',
+        components: {
+            DetailList,
+            DetailListItem
+        },
+        data () {
+            return {
+                confirmLoading: false,
+                mdl: {},
+                modalTitle: null,
+                visible: false,
+                // 下拉框map
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            model: {
+                                                                                                                    'name': null,
+                                                                                                'routerUrl': null,
+                                                                                                'iconPath': null,
+                                                                                                'remark': null,
+                                                                                                                                            'createdUserId': null,
+                                                                                                                                            'updateTime': null,
+                                                                                                'updateUserId': null,
+                                                                                                'updateUserName': null,
+                                                            }
+            }
+        },
+        created () {
+            // 下拉框map
+            
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        },
+        methods: {
+            base (record) {
+                this.visible = true
+                this.modalTitle = '详情'
+                this.model = record
+            },
+            handleCancel () {
+                this.visible = false
+                this.confirmLoading = false
+            }
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
+    }
+</script>

+ 0 - 1
src/views/custom/form/CustomForm.vue

@@ -52,7 +52,6 @@
             <a @click="handleView(record)">查看</a>
             <!-- <operation-button @click="handleEdit(record)">修改</operation-button> -->
             <operation-button @click="handleSubmit(record)">填报</operation-button>
-            <operation-button @click="handleSubmit(record)">填报</operation-button>
             <operation-button :type="2" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">删除</operation-button>
           </template>
         </span>

+ 12 - 4
src/views/workplace/newWoekplace/Workplace.vue

@@ -13,7 +13,7 @@
             管理
           </a-button>
         </div>
-        <a-row :gutter="[20,40]">
+        <a-row :gutter="[20,40]" v-if="commonMenus.length>0">
           <a-col class="gutter-row" :span="3" v-for="item in commonMenus" :key="item.id" @click="handleClickMenu(item)">
             <a-badge :count="item.waitDoNum">
               <div class="gutter-box">
@@ -25,6 +25,14 @@
             </a-badge>
           </a-col>
         </a-row>
+        <a-empty v-else description="请先配置快捷菜单" image="https://gw.alipayobjects.com/mdn/miniapp_social/afts/img/A*pevERLJC9v0AAAAAAAAAAABjAQAAAQ/original" :image-style="{
+      height: '60px',
+    }">
+          <a-button type="primary" @click="$refs.menusModal.base()">
+            去配置
+          </a-button>
+        </a-empty>
+        <br>
       </div>
       <div class="gutter-example">
         <a-row :gutter="20">
@@ -61,9 +69,9 @@
 
 <script>
 import { STable } from '@/components'
-import { getWaitData } from '@/api/workplace/backlog'
+// import { getWaitData } from '@/api/workplace/backlog'
 import MenusModal from './modules/MenusModal'
-
+import { getCommonMenuMine } from '@/api/common/menu-mine'
 export default {
   name: 'NewWorkplaceBacklog',
   components: {
@@ -82,7 +90,7 @@ export default {
   },
   computed: {},
   created() {
-    this.getData()
+    // this.getData()
     this.getCommonMenuMine()
   },
   methods: {

+ 1 - 0
src/views/workplace/newWoekplace/modules/MenusModal.vue

@@ -27,6 +27,7 @@
 </template>
 
 <script>
+import { getCommonMenuMineChoosePage, addCommonMenuMine, updateCommonMenuMine } from '@/api/common/menu-mine'
 export default {
   data() {
     return {