zhaoke hace 1 año
padre
commit
0bcca7301e

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

@@ -405,7 +405,7 @@ export default {
         color: purple;
       }
     }
-    .el-table__header-wrapper {
+    .el-table__header {
       .cell {
         font-weight: bold;
         color: #101116;

+ 6 - 19
src/views/dataAccessPage/components/accessPageNode.vue

@@ -76,31 +76,16 @@
         </el-form>
         <el-table :data="tableData" border style="width: 100%">
           <el-table-column prop="name" label="参数名">
+            <template slot-scope="scope">
+              <el-input size="small" v-model="scope.row.name" placeholder="请输入参数名" />
+            </template>
           </el-table-column>
           <el-table-column prop="code" label="参数订阅规则">
-          </el-table-column>
-          <el-table-column fixed="right" label="操作" width="100">
             <template slot-scope="scope">
-              <el-button type="text" @click="editTable(scope.row)" size="small">编辑</el-button>
+              <el-input size="small" v-model="scope.row.code" placeholder="请输入参数订阅规则" />
             </template>
           </el-table-column>
         </el-table>
-        <PublicPageDialog dialog-title="编辑" dialogSize="600px" :dialogBody="true" :dialog-drawer="tableDrawer" @handleClose="tableClose" @handleSubmit="tableSubmit">
-          <el-form ref="ruleTableForm" style="width: 98%;" :model="tableForm" label-width="100px">
-            <el-row :gutter="20">
-              <el-col :span="24">
-                <el-form-item prop="name" label="参数名">
-                  <el-input size="small" v-model="editTableForm.name" placeholder="请输入" />
-                </el-form-item>
-              </el-col>
-              <el-col :span="24">
-                <el-form-item prop="code" label="参数订阅规则">
-                  <el-input size="small" v-model="editTableForm.code" placeholder="请输入" />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </PublicPageDialog>
       </div>
     </PublicPageDialog>
   </div>
@@ -296,6 +281,8 @@ export default {
     },
     //弹框确定
     advancedTable () {
+      console.log(this.tableData)
+      return
       const data = _.cloneDeep(this.tableForm)
       data.serviceid = this.msgContent.serviceid
       data.algorithmtype = this.formInline.algorithmtype

+ 47 - 9
src/views/dataAccessPage/components/accessPageTable.vue

@@ -7,8 +7,9 @@
       <PublicPageTable :loading="loading" :table-cols="tableCols" :table-btns="authBtns" :data="tableData" @mounted="tableMountedHandler" @load="load" @handleEdit="handleEdit" @handleOther="handleOther" @handleRemove="handleRemove" />
     </div>
     <div class="accessPageTable_dialog">
-      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
-        <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-data="tableForm" />
+      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" :dialogSize="dialogSize" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+        <PublicPageForm v-if="dialogTabFlag" ref="ruleForm" :label-width="labelWidth" :form-data="tableForm" />
+        <Table :auth-id="233" :auth-query="tableRow" v-else />
       </PublicPageDialog>
     </div>
   </div>
@@ -20,13 +21,14 @@ import PublicPageDialog from '@/components/PublicPageDialog'
 import PublicPageForm from './accessPageForm.vue'
 import PublicPageTable from '@/components/SimpleTable'
 import AuthButton from '@/components/AuthButton'
+import Table from '@/views/tablePage/index.vue'
 import { mapGetters } from 'vuex'
 import { Query, newData, modifyData, moveData } from "@/api/webApi"
 import { formatChange } from '@/utils/validate'
 
 export default {
   name: 'AccessPageTable',
-  components: { PublicPageHeader, PublicPageDialog, PublicPageForm, PublicPageTable, AuthButton },
+  components: { PublicPageHeader, PublicPageDialog, PublicPageForm, PublicPageTable, AuthButton, Table },
   props: {
     msgContent: {
       type: Object,
@@ -40,12 +42,17 @@ export default {
       page: 0, //当前table页面
       noMore: false, //当前table是否加载到最后开关
       loading: false, //页面加载
+      ploading: false,
       dialogLoading: false,
       dialogFlag: false,
+      dialogTabFlag: false,
+      dialogSize: '630px',
+      tableRow: {},
       pageTitle: '', //页面名称
       tableCols: [], //表头数据
       tableData: [], //表格数据
       tableBtns: [], //表格按钮权限
+      paramsData: [], //参数设置表格
       dataContent: {}, //表格查询数据
       pageServiceId: null, //表格serviceid
       formItem: [], //弹框表单渲染数据
@@ -197,9 +204,11 @@ export default {
       const { openmode, pageroute } = this.pageAuthBtnAdd
       if (!openmode) return
       if (openmode != 2) this.autoBtnClick(openmode, pageroute)
-      this.flag = true;
-      this.tableType = "add";
-      this.tableTitle = "新增";
+      this.flag = true
+      this.dialogTabFlag = true
+      this.tableType = "add"
+      this.tableTitle = "新增"
+      this.dialogSize = '630px'
       this.tableForm = {
         serviceid: this.msgContent['serviceid'] || '',
         preconditions: '',
@@ -219,8 +228,10 @@ export default {
       if (!openmode) return
       if (openmode != 2) this.autoBtnClick(openmode, pageroute)
       this.flag = true
+      this.dialogTabFlag = true
       this.tableType = "edit"
       this.tableTitle = "编辑"
+      this.dialogSize = '630px'
       this.tableForm = _.cloneDeep(row)
     },
     //表格-其他类型按钮操作
@@ -228,6 +239,14 @@ export default {
       const { openmode, pageroute, passparameters } = this.pageAuthBtnOther
       if (!openmode) return
       if (openmode != 2) this.autoBtnClick(openmode, pageroute, passparameters, row)
+      if (openmode == 4) {
+        const { algorithmlibraryid } = row
+        this.flag = true
+        this.dialogTabFlag = false
+        this.tableTitle = "参数设置"
+        this.dialogSize = '830px'
+        this.tableRow = { algorithmlibraryid }
+      }
     },
     //表格-删除
     handleRemove (row) {
@@ -257,12 +276,18 @@ export default {
     // 新增/编辑-取消
     submitClickClose (formName) {
       this.flag = false
-      this.$refs[formName].restForm()
+      if (this.dialogTabFlag) {
+        this.$refs[formName].restForm()
+      }
     },
     // 新增/编辑-确认
     submitClickHandler () {
-      const flag = this.$refs["ruleForm"].submitClickHandler()
-      if (flag) this.tableType == "add" ? this.generalDataReception(1, this.tableForm) : this.generalDataReception(2, this.tableForm, this.tableKey)
+      if (this.dialogTabFlag) {
+        const flag = this.$refs["ruleForm"].submitClickHandler()
+        if (flag) this.tableType == "add" ? this.generalDataReception(1, this.tableForm) : this.generalDataReception(2, this.tableForm, this.tableKey)
+      } else {
+        this.flag = false
+      }
     },
     //表格-增/删/改
     async generalDataReception (event, data, key) {
@@ -305,6 +330,19 @@ export default {
         this.tableForm = {}
       }
     },
+    async getParamsData (serviceid, datacontent) {
+      this.ploading = true
+      try {
+        datacontent = { filter: datacontent }
+        const { code, returnData } = await Query({ serviceid, datacontent, event: '0', page: 1, size: 9999 })
+        if (code && returnData?.length) {
+          this.paramsData = [...returnData]
+        }
+      } catch (error) {
+        this.$message.error(error)
+      }
+      this.ploading = false
+    },
     tableMountedHandler (refName, ref) {
       this.$refs[refName] = ref
     },

+ 2 - 2
src/views/dataAccessPage/index.vue

@@ -6,8 +6,8 @@
         <AccessPageTree @treeNodeClick="treeNodeClick" />
       </div>
       <div class="dataAccessPage_content_right">
-        <accessPageNode :msg-content="msgContent" />
-        <!-- <AccessPageTable :msg-content="msgContent" /> -->
+        <!-- <accessPageNode :msg-content="msgContent" /> -->
+        <AccessPageTable :msg-content="msgContent" />
       </div>
     </div>
   </div>

+ 26 - 6
src/views/tablePage/index.vue

@@ -20,7 +20,7 @@
     </div>
     <div class="TablePage_dialog">
       <!--新增/编辑-->
-      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :form-auth="formAuth" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+      <PublicPageDialog :dialog-body="authId ? true : false " :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :form-auth="formAuth" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
         <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-pass="tableData" :form-type="tableType" :form-item="formItem" :form-data="tableForm" />
       </PublicPageDialog>
       <!--高级查询-->
@@ -64,7 +64,15 @@ export default {
     msgContent: {
       type: Object,
       default: () => new Object()
-    }
+    },
+    authId: {
+      type: Number,
+      default: 0
+    },
+    authQuery: {
+      type: Object,
+      default: () => new Object()
+    },
   },
   data () {
     return {
@@ -120,10 +128,12 @@ export default {
     ...mapGetters(['authArrs']),
     pageTableHeight () {
       if (this.dataFlag) return 'height:100%'
+      if (this.authId) return 'height:calc(100vh - 180px);padding:0'
       return ''
     },
     pageTableContentHeight () {
       if (this.dataFlag) return 'height:calc(100% - 60px)'
+      if (this.authId) return 'height:calc(100% - 130px)'
       return ''
     },
     pageAuthBtnQuery () {
@@ -161,24 +171,34 @@ export default {
       },
       deep: true,
       immediate: true
+    },
+    authQuery: {
+      handler (row) {
+        if (row && Object.keys(row).length) {
+          this.defaultfilter = row
+          this.queryTableData(true)
+        }
+      },
+      deep: true,
     }
   },
   mounted () {
-    this.pageInit()
+    this.authId ? this.pageInit(this.authId) : this.pageInit()
   },
   methods: {
     //页面初始化
-    pageInit () {
+    pageInit (authId) {
       //获取页面查询参数
       const { query } = this.$route
-      this.pageQuery = query
+      authId ? this.pageQuery = this.authQuery : this.pageQuery = query
       //获取页面配置
       const { pagecode, qid, auth_id } = this.$route.meta
       //获取页面权限类型组件  pagetype 1模块  2页面  3按钮 4表格 5树形  6弹窗
       const pageAuths = this.authArrs
       if (!pageAuths.length) return
+      let pageAuthArrs = null
+      authId ? pageAuthArrs = pageAuths.filter(item => item['superiorid'] == authId) : pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       //获取当前页面权限类型
-      const pageAuthArrs = pageAuths.filter(item => item['superiorid'] == auth_id)
       if (!pageAuthArrs.length) return
       //获取tree权限
       const pageAuthtrees = pageAuthArrs.filter(item => item.pagetype == 'tree')