zhaoke 1 год назад
Родитель
Сommit
23d1a42720

+ 0 - 1
src/components/AuthButton/index.vue

@@ -17,7 +17,6 @@ export default {
     const { auth, row } = context.props
     const vnodes = []
 
-
     if (auth && Object.keys(auth).length) {
       //获取按钮配置项
       const { servicetype, pagename, pageicon } = auth

+ 3 - 9
src/components/Hamburger/index.vue

@@ -1,13 +1,6 @@
 <template>
   <div style="padding: 0 15px;" @click="toggleClick">
-    <svg
-      :class="{'is-active':isActive}"
-      class="hamburger"
-      viewBox="0 0 1024 1024"
-      xmlns="http://www.w3.org/2000/svg"
-      width="64"
-      height="64"
-    >
+    <svg :class="{'is-active':isActive}" class="hamburger" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="64" height="64">
       <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
     </svg>
   </div>
@@ -23,7 +16,7 @@ export default {
     }
   },
   methods: {
-    toggleClick() {
+    toggleClick () {
       this.$emit('toggleClick')
     }
   }
@@ -36,6 +29,7 @@ export default {
   vertical-align: middle;
   width: 20px;
   height: 20px;
+  background-color: #fff;
 }
 
 .hamburger.is-active {

+ 6 - 6
src/components/SimpleTable/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="table-wrapper">
     <el-table ref="table" v-el-table-infinite-scroll="load" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="rowClass" :cell-class-name="cellClass" :span-method="tableSpanMethod" :show-summary="showSummary" :summary-method="tableSummaryMethod" :height="height" stripe fit border @cell-click="cellClickHandler">
-      <el-table-column v-for="col in filteredTableCols" :key="col.columncode" :prop="col.columncode" :label="col.columnname" :width="col.displaywidth" :show-overflow-tooltip="showOverflowTooltip" :formatter="tableFormatter">
+      <el-table-column v-for="col in filteredTableCols" :key="col.pagecode" :prop="col.pagecode" :label="col.pagename" :width="col.displaywidth" :show-overflow-tooltip="showOverflowTooltip" :formatter="tableFormatter">
         <template #header>
-          <el-tooltip :content="col.columndescribe || col.columnname" placement="top">
-            <TableHeaderCell :label="col.columnname" :filter-options="tableDataFilters[col.columncode]" :filter-values.sync="filterValues[col.columncode]" filter-style="arrow" :sortable="!!col.enablesort" :sort-rule.sync="tableDataSortRules[col.columncode]" />
+          <el-tooltip :content="col.pagedescribe || col.pagename" placement="top">
+            <TableHeaderCell :label="col.pagename" :filter-options="tableDataFilters[col.pagecode]" :filter-values.sync="filterValues[col.pagecode]" filter-style="arrow" :sortable="!!col.enablesort" :sort-rule.sync="tableDataSortRules[col.pagecode]" />
           </el-tooltip>
         </template>
       </el-table-column>
@@ -253,7 +253,7 @@ export default {
       const sums = []
       columns.forEach((column, index) => {
         this.tableCols.forEach(p => {
-          if (column.property === p.columncode && p.enablecount) {
+          if (column.property === p.pagecode && p.enablecount) {
             const values = data.map(item => Number(item[column.property]))
             if (!values.every(value => isNaN(value))) {
               sums[index] = values.reduce((prev, curr) => {
@@ -281,10 +281,10 @@ export default {
       this.tableDataFilters = {}
       this.filteredTableCols.forEach(col => {
         if (col.enablefilter) {
-          this.tableDataFilters[col.columncode] = []
+          this.tableDataFilters[col.pagecode] = []
         }
         if (col.enablegroup) {
-          this.tableGroups.push(col.columncode)
+          this.tableGroups.push(col.pagecode)
         }
       })
       setTableFilters(this.tableData, this.tableDataFilters)

+ 48 - 20
src/components/publicPageForm/index.vue

@@ -3,29 +3,55 @@
     <el-form ref="ruleForm" :model="tableForm" :label-width="labelWidth">
       <el-row :gutter="20">
         <el-col v-for="(item, index) in formItemArr" :key=" index" :span="formType == 'horizontal' ? formSpan : 24">
-          <el-form-item :rules="fromDataReq(item)" :prop="item.columncode" :label="item.columnname">
-            <template v-if="item.dropdownlist ||item.dropdownlist == 0">
-              <el-select class="input-shadow" size="small" filterable default-first-option style="width: 100%" v-model="tableForm[item.columncode]" @change="changeSelect(item.columncode, item)" placeholder="请选择" clearable @clear="tableForm[item.columncode] = ''">
-                <el-option v-for="itemParams in tableOptions[item.columncode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistlable']]" :value="itemParams[item['dropdownlistid']]">
+          <el-form-item :rules="fromDataReq(item)" :prop="item.pagecode" :label="item.pagename">
+            <template v-if="fromDataType(item.datatype) == 'SELECT'">
+              <el-select class="input-shadow" size="small" filterable default-first-option style="width: 100%" v-model="tableForm[item.pagecode]" @change="changeSelect(item.pagecode, item)" placeholder="请选择" clearable @clear="tableForm[item.pagecode] = ''">
+                <el-option v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistlable']]" :value="itemParams[item['dropdownlistid']]">
                 </el-option>
               </el-select>
             </template>
-            <template v-else-if="fromDataType(item.datatype) == 'text'||fromDataType(item.datatype) == 'VARCHAR'">
-              <el-input size="small" @change="inputChangeHandler(item.columncode)" v-model="tableForm[item.columncode]"></el-input>
+            <template v-else-if="fromDataType(item.datatype) == 'TEXT' || fromDataType(item.datatype) == 'VARCHAR'">
+              <el-input size="small" @change="inputChangeHandler(item.pagecode)" v-model="tableForm[item.pagecode]"></el-input>
             </template>
-            <template v-else-if="fromDataType(item.datatype) == 'date'">
-              <el-date-picker class="datetimes" value-format="yyyy-MM-dd" v-model="tableForm[item.columncode]" type="date" placeholder="选择日期" @change="inputChangeHandler(item.columncode)">
+            <template v-else-if="fromDataType(item.datatype) == 'TEXTAREA'">
+              <el-input type="textarea" v-model="tableForm[item.pagecode]"></el-input>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'UPLOAD'">
+              <upload ref="upload" />
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'SWITCH'">
+              <el-switch v-model="tableForm[item.pagecode]"></el-switch>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'CASCADER'">
+              <el-cascader v-model="tableForm[item.pagecode]" :options="tableOptions[item.pagecode]"></el-cascader>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'CHECKBOX'">
+              <el-checkbox-group v-model="tableForm[item.pagecode]">
+                <el-checkbox v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlable']] }}</el-checkbox>
+              </el-checkbox-group>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'RADIO'">
+              <el-radio-group v-model="tableForm[item.pagecode]">
+                <el-radio v-for="itemParams in tableOptions[item.pagecode]" :key="itemParams[item['dropdownlistid']]" :label="itemParams[item['dropdownlistid']]" name="type">{{ [item['dropdownlistlable']] }}</el-radio>
+              </el-radio-group>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'TIME'">
+              <el-time-picker :picker-options="{selectableRange: '00:00:00 - 23:59:59'}" v-model="tableForm[item.pagecode]" placeholder="选择任意时间段" @change="inputChangeHandler(item.pagecode)">
+              </el-time-picker>
+            </template>
+            <template v-else-if="fromDataType(item.datatype) == 'DATE'">
+              <el-date-picker class="datetimes" value-format="yyyy-MM-dd" v-model="tableForm[item.pagecode]" type="date" placeholder="选择日期" @change="inputChangeHandler(item.pagecode)">
               </el-date-picker>
             </template>
-            <template v-else-if="fromDataType(item.datatype) == 'datetime'">
-              <el-date-picker class="datetimes" value-format="yyyy-MM-dd HH:mm:ss" v-model="tableForm[item.columncode]" type="datetime" placeholder="选择日期时间" @change="inputChangeHandler(item.columncode)">
+            <template v-else-if="fromDataType(item.datatype) == 'DATETIME'">
+              <el-date-picker class="datetimes" value-format="yyyy-MM-dd HH:mm:ss" v-model="tableForm[item.pagecode]" type="datetime" placeholder="选择日期时间" @change="inputChangeHandler(item.pagecode)">
               </el-date-picker>
             </template>
-            <template v-else-if="fromDataType(item.datatype) == 'INT' || fromDataType(item.datatype) == 'tinyint'">
-              <el-input size="small" v-model.number="tableForm[item.columncode]" onkeyup="value=value.replace(/[^1-9]/g,'')" @change="inputChangeHandler(item.columncode)"></el-input>
+            <template v-else-if="fromDataType(item.datatype) == 'INT' || fromDataType(item.datatype) == 'tinyint' || fromDataType(item.datatype) == 'NUMBER'">
+              <el-input size="small" v-model.number="tableForm[item.pagecode]" onkeyup="value=value.replace(/[^1-9]/g,'')" @change="inputChangeHandler(item.pagecode)"></el-input>
             </template>
             <template v-else>
-              <el-input size="small" v-model="tableForm[item.columncode]" @change="inputChangeHandler(item.columncode)"></el-input>
+              <el-input size="small" v-model="tableForm[item.pagecode]" @change="inputChangeHandler(item.pagecode)"></el-input>
             </template>
           </el-form-item>
         </el-col>
@@ -36,8 +62,10 @@
 
 <script>
 import { Query } from "@/api/webApi"
+import Upload from './upload.vue'
 export default {
   name: 'PublicPageForm',
+  components: { Upload },
   props: {
     formType: {
       type: String,
@@ -96,15 +124,15 @@ export default {
     //设置新增修改表单必填类型
     fromDataReq () {
       return function (item) {
-        const { dropdownlist, datatype, columnname, isrequired, formatrule } = item
+        const { dropdownlist, datatype, pagename, isrequired, formatrule } = item
         const itemType = datatype.replace(/\([^\)]*\)/g, "")
         const itemReq = isrequired ? true : false
         const itemRule = formatrule ? true : false
-        if (dropdownlist || dropdownlist == 0) return [{ required: itemReq, message: `${columnname}不能为空`, trigger: 'change' }]
-        else if (itemType == 'date' || itemType == 'datetime') return [{ required: itemReq, type: 'date', message: `${columnname}不能为空`, trigger: 'change' }]
+        if (dropdownlist || dropdownlist == 0) return [{ required: itemReq, message: `${pagename}不能为空`, trigger: 'change' }]
+        else if (itemType == 'date' || itemType == 'datetime') return [{ required: itemReq, type: 'date', message: `${pagename}不能为空`, trigger: 'change' }]
         else
-          if (itemReq && itemRule) return [{ required: itemReq, message: `${columnname}不能为空`, trigger: 'blur' }, { pattern: new RegExp(formatrule), message: `请输入合法的${columnname}规则`, trigger: 'blur' }]
-        return [{ required: itemReq, message: `${columnname}不能为空`, trigger: 'blur' }]
+          if (itemReq && itemRule) return [{ required: itemReq, message: `${pagename}不能为空`, trigger: 'blur' }, { pattern: new RegExp(formatrule), message: `请输入合法的${pagename}规则`, trigger: 'blur' }]
+        return [{ required: itemReq, message: `${pagename}不能为空`, trigger: 'blur' }]
       }
     },
   },
@@ -115,10 +143,10 @@ export default {
       if (!formItem.length || !Array.isArray(formItem)) return
       const formItemCopy = _.cloneDeep(formItem)
       const [allResult, allResultKey] = [[], []]
-      formItemCopy.map(({ dropdownlist, columncode }) => {
+      formItemCopy.map(({ dropdownlist, pagecode }) => {
         if (dropdownlist || dropdownlist == 0) {
           const datacontent = { filter: { 1: 1 } }
-          allResultKey.push(columncode)
+          allResultKey.push(pagecode)
           allResult.push(Query({ serviceid: dropdownlist, datacontent, event: '0' }))
         }
       })

+ 62 - 0
src/components/publicPageForm/upload.vue

@@ -0,0 +1,62 @@
+<template>
+  <div class="form-upload">
+    <el-upload class="avatar-uploader" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
+      <img v-if="imageUrl" :src="imageUrl" class="avatar">
+      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+    </el-upload>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'Formupload',
+  data () {
+    return {
+      imageUrl: ''
+    };
+  },
+  methods: {
+    handleAvatarSuccess (res, file) {
+      this.imageUrl = URL.createObjectURL(file.raw);
+    },
+    beforeAvatarUpload (file) {
+      const isJPG = file.type === 'image/jpeg';
+      const isLt2M = file.size / 1024 / 1024 < 2;
+
+      if (!isJPG) {
+        this.$message.error('上传头像图片只能是 JPG 格式!');
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!');
+      }
+      return isJPG && isLt2M;
+    }
+  }
+}
+</script>
+
+<style>
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+</style>

+ 6 - 21
src/getMenu.js

@@ -94,7 +94,7 @@ function parseMenuItem (data) {
   //pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗
   const menus = []
   data.map(item => {
-    if (item.pagetype == 1) {
+    if (item.pagetype == 'module') {
       menus.push({
         auth_id: item.pageconfigurationid,
         up_auth_id: item.superiorid,
@@ -102,14 +102,14 @@ function parseMenuItem (data) {
         name: item.pagename,
         meta: {
           title: item.pagename,
-          elSvgIcon: item.pageicon ?? 'Fold',
+          elSvgIcon: item.pageicon || 'el-icon-s-order',
           show_index: item.displayorder,
           qid: item.serviceid,
         },
         component: Layout,
-        hidden: item.isdisplay==1?false:true,
+        hidden: item.isdisplay == 1 ? false : true,
       })
-    } else if (item.pagetype == 2) {
+    } else if (item.pagetype == 'page') {
       menus.push({
         auth_id: item.pageconfigurationid,
         up_auth_id: item.superiorid,
@@ -117,7 +117,7 @@ function parseMenuItem (data) {
         name: item.pagename,
         meta: {
           title: item.pagename,
-          elSvgIcon: item.pageicon ?? 'Fold',
+          elSvgIcon: item.pageicon || 'el-icon-s-order',
           show_index: item.displayorder,
           qid: item.serviceid,
           auth_id: item.pageconfigurationid,
@@ -127,7 +127,7 @@ function parseMenuItem (data) {
         },
         component: resolve => require(['@/views' + item.pageaddress], resolve),
         // component: () => import('./views/table/index.vue'),
-        hidden: item.isdisplay==1?false:true,
+        hidden: item.isdisplay == 1 ? false : true,
       })
     }
   })
@@ -135,21 +135,6 @@ function parseMenuItem (data) {
   return menus
 }
 
-function setType (arr, parentKey, key) {
-  const datas = []
-  for (let i = 0; i < arr.length; i++) {
-    for (let j = 0; j < arr.length; j++) {
-      if (arr[i][key] == arr[j][parentKey]) {
-        if (arr[j].auth_type == 3) {
-          datas.push(arr[j])
-          arr[i].other = datas
-        }
-      }
-    }
-  }
-  return arr
-}
-
 function parseMenu (arr) {
   const menus = arr
   const newMenus = menus.flat()

+ 12 - 8
src/layout/components/Navbar.vue

@@ -25,7 +25,7 @@
         </el-dropdown>
       </div>
     </div>
-    <div class="navbar_lower" id="navbar_lowers">
+    <div class="navbar_lower" :class="isSidebar ? 'hide_navbar_lower' : ''" id="navbar_lowers">
       <!-- <el-breadcrumb separator-class="el-icon-arrow-right">
         <el-breadcrumb-item v-for="(item, index) in breadList" :key="index" :to="index < breadList.length -1 ? item.path : undefined">
           <span>{{ item.meta.title }}</span>
@@ -38,15 +38,12 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import Breadcrumb from '@/components/Breadcrumb'
-import Hamburger from '@/components/Hamburger'
-// import { Format } from "../../config/util";
 import { timeInZone } from '@/utils/table'
 import { userHealth } from "@/api/login";
 import TagsView from "./TagsView";
 
 export default {
-  props: ['logstart'],
+  name: 'Navbar',
   data () {
     return {
       newData: '',
@@ -59,8 +56,6 @@ export default {
     }
   },
   components: {
-    Breadcrumb,
-    Hamburger,
     TagsView,
   },
   watch: {
@@ -69,7 +64,13 @@ export default {
     }
   },
   computed: {
-    ...mapGetters(['sidebar', 'avatar', 'timeZone'])
+    ...mapGetters(['avatar', 'timeZone']),
+    sidebar () {
+      return this.$store.state.app.sidebar
+    },
+    isSidebar () {
+      return !this.sidebar.opened
+    }
   },
   mounted () {
     this.getTimeInterval = setInterval(() => {
@@ -441,5 +442,8 @@ export default {
       }
     }
   }
+  .hide_navbar_lower {
+    padding-left: 48px;
+  }
 }
 </style>

+ 0 - 26
src/router/index.js

@@ -67,32 +67,6 @@ export const constantRoutes = [
       },
     ],
   },
-  {
-    path: '/permission',
-    component: Layout,
-    meta: { title: '权限管理' },
-    children: [
-      {
-        path: '/permission',
-        name: 'Permission',
-        meta: { title: '页面配置' },
-        component: () => import('@/views/permissionPage/index.vue'),
-      },
-    ]
-  },
-  {
-    path: '/dataAccess',
-    component: Layout,
-    meta: { title: '数据接入管理' },
-    children: [
-      {
-        path: '/dataAccess',
-        name: 'DataAccess',
-        meta: { title: '页面配置' },
-        component: () => import('@/views/dataAccessPage/index.vue'),
-      },
-    ]
-  },
   // { path: '/', redirect: '/nopower', component: () => import('@/views/noPower'), hidden: true }
   // 404 page must be placed at the end !!!
 ]

+ 48 - 39
src/views/tablePage/index.vue

@@ -14,9 +14,11 @@
     </div>
     <div class="TablePage_dialog">
       <!--新增/编辑-->
-      <PublicPageDialog :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
-        <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-item="formItem" :form-data="tableForm" />
-      </PublicPageDialog>
+      <template v-if="dialogName">
+        <PublicPageDialog :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+          <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-item="formItem" :form-data="tableForm" />
+        </PublicPageDialog>
+      </template>
       <!--删除-->
       <PublicPageDialog dialog-title="删除" :dialog-drawer="rmFlag" @handleClose="rmFlag = false" @handleSubmit="tableRemove">
         <div class="content del-content">
@@ -69,6 +71,7 @@ export default {
       defaultfilter: { 1: 1 }, //默认查询参数
       pageQuery: {},
       dialogFlag: false,
+      dialogName: '', //弹框名称
       pageTitle: '', //页面名称
       treeData: [], //tree数据
       treeParameters: {}, //tree传递参数
@@ -76,6 +79,7 @@ export default {
       tableData: [], //表格数据
       tableBtns: [], //表格按钮权限
       authBtns: [], //表格里面的操作按钮
+      tableBtnForms: [], //表格按钮下的form表单权限
       dataContent: {}, //表格查询数据
       pageServiceId: null, //表格serviceid
       formItem: [], //弹框表单渲染数据
@@ -136,14 +140,16 @@ export default {
       const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       //获取tree权限
-      const pageAuthtrees = pageAuthArrs.filter(item => item.pagetype == 5)
+      const pageAuthtrees = pageAuthArrs.filter(item => item.pagetype == 'tree')
       if (pageAuthtrees?.length) this.getPageTreeSetting(pageAuths, pageAuthtrees)
       //获取table权限
-      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 3)
+      const pageAuthtables = pageAuthArrs.filter(item => item.pagetype == 'table')
       if (pageAuthtables?.length) this.getPageTableSetting(pageAuths, pageAuthtables)
       //获取按钮权限
-      const pageAuthbtns = pageAuthArrs.filter(item => item.pagetype == 4)
+      const pageAuthbtns = pageAuthArrs.filter(item => item.pagetype == 'button')
       if (pageAuthbtns?.length) this.getPageBtnSetting(pageAuthbtns)
+      //获取form表单弹框权限
+      if (this.tableBtns?.length) this.getPageBtnFormSetting(pageAuths, this.tableBtns)
     },
     //根据页面tree设置数据
     getPageTreeSetting (pageAuths, pageAuthtrees) {
@@ -157,46 +163,42 @@ export default {
       //获取当前页面table的配置
       const { pagename, pageconfigurationid, serviceid, pagecode, userpermissionsid, defaultfilter } = authTableObj
       //获取当前页面table的按钮权限
-      const currPageBtns = pageAuths.filter(item => item['superiorid'] == pageconfigurationid)
+      const currPageBtns = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item.pagetype == 'button')
       if (currPageBtns?.length) this.tableBtns.push(...currPageBtns)
-      this.authBtns = pageAuths.filter(item => item.superiorid == pageconfigurationid && item.pagetype == 4)
+      this.authBtns = pageAuths.filter(item => item.superiorid == pageconfigurationid && item.pagetype == 'button')
       this.pageServiceId = Object.keys(this.msgContent).length ? this.msgContent.serviceid : serviceid;
       this.pageTitle = pagename
       this.defaultfilter = Object.keys(this.pageQuery).length ? this.pageQuery : defaultfilter ? this.formatDefault(defaultfilter, authTableObj) : { 1: 1 }
-      this.getColumnData(pagecode, userpermissionsid)
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      this.getColumnData(tableColumnArrs)
     },
     //根据页面按钮设置数据
     getPageBtnSetting (pageAuthbtns) {
       this.tableBtns.push(...pageAuthbtns)
     },
+    //根据页面按钮设置表单form数据
+    getPageBtnFormSetting (pageAuths, pageAuthForms) {
+      const authForms = [...pageAuthForms]
+      authForms.map(item => {
+        const { pageconfigurationid } = item
+        const currAuthForm = pageAuths.filter(citem => citem['superiorid'] == pageconfigurationid && citem['pagetype'] == 'form')
+        if (currAuthForm?.length) this.tableBtnForms.push(currAuthForm[0])
+      })
+    },
     //获取表头数据
-    async getColumnData (pagecode, id) {
-      try {
-        const { code, returnData } = await Query({
-          serviceid: '3',
-          datacontent: { filter: Object.keys(this.msgContent).length ? this.msgContent : { pagecode } },
-          event: "0"
-        });
-        if (code == 0) {
-          if (returnData?.length) {
-            this.$store.dispatch('auth/changeAuthMsg', returnData)
-            const tableColsCopy = _.cloneDeep(returnData).filter((item) => item.isdisplay == 2);
-            const tableColsCopyOrder = _.orderBy(tableColsCopy, ['displaynumber'], ['asc']);
-            const formItemCopy = _.cloneDeep(returnData).filter((item) => item.isdisplay == 2 || item.isdisplay == 3);
-            this.formItem = _.orderBy(formItemCopy, ['displaynumber'], ['asc']);
-            this.tableCols = tableColsCopyOrder;
-            const columncode = returnData.find(
-              (item) => item.isprimarykey == 1
-            );
-            if (columncode && Object.keys(columncode).length) {
-              this.tableKey = columncode['columncode']
-            }
-          }
-        } else {
-          this.$message.error("获取表头数据失败");
-        }
-      } catch (error) {
-        console.log(error)
+    getColumnData (columnArrs = []) {
+      const returnData = [...columnArrs]
+      this.$store.dispatch('auth/changeAuthMsg', returnData)
+      const tableColsCopy = _.cloneDeep(returnData).filter((item) => item.isdisplay == 1);
+      const tableColsCopyOrder = _.orderBy(tableColsCopy, ['displaynumber'], ['asc']);
+      // const formItemCopy = _.cloneDeep(returnData).filter((item) => item.isdisplay == 2 || item.isdisplay == 3);
+      // this.formItem = _.orderBy(formItemCopy, ['displaynumber'], ['asc']);
+      this.tableCols = tableColsCopyOrder;
+      const columncode = returnData.find(
+        (item) => item.isprimarykey == 1
+      );
+      if (columncode && Object.keys(columncode).length) {
+        this.tableKey = columncode['columncode']
       }
     },
     //获取tree点击
@@ -218,18 +220,25 @@ export default {
       })
       return filterItem
     },
+    //根据按钮权限查询表单权限
+    findBtntoForm (pageroute) {
+      return this.tableBtnForms.filter(item => item.pagecode == pageroute)
+    },
     //表单-新增
     handleAdd () {
       const { openmode, pageroute } = this.pageAuthBtnAdd
       if (!openmode) return
+      if (!this.findBtntoForm(pageroute).length) return
       if (openmode != 2) this.autoBtnClick(openmode, pageroute)
+      const { pageconfigurationid } = this.findBtntoForm(pageroute)[0]
+      const pageAuths = this.authArrs
+      const tableColumnArrs = pageAuths.filter(item => item['superiorid'] == pageconfigurationid && item['pagetype'] == 'column')
+      this.dialogName = pageroute
       this.flag = true;
       this.tableType = "add";
       this.tableTitle = "新增";
       this.tableForm = {};
-      for (let key in this.pageQuery) {
-        this.tableForm[key] = this.pageQuery[key]
-      }
+      this.formItem = tableColumnArrs.filter(item => item.isdisplay == 1)
     },
     //表格-编辑
     handleEdit (row) {