浏览代码

应用版本管理

zhuliu 10 月之前
父节点
当前提交
a5b4bc4905

+ 3 - 0
src/App.vue

@@ -34,6 +34,9 @@ html, body, #app {
   font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
   overflow: hidden;
 }
+.height_100{
+  height:100% !important;
+}
 .margin-left_0 {
   margin-left: 0 !important;
 }

+ 7 - 0
src/api/application.js

@@ -12,4 +12,11 @@ export default {
     queryApplication(data){
         return axios.post('/permission/api/qiaoBiApplication/queryApplication',data)
     },
+
+    /**
+     * 查询功能
+     */
+    queryFunctionList(params) {
+        return axios.get('/permission/api/function/queryPageList', {params})
+    },
 }

+ 4 - 1
src/api/index.js

@@ -5,6 +5,8 @@ import registerAndLogin from './registerAndLogin'
 import application from "./application";
 import version from "./version";
 import vip from "./vip";
+import file from "./file";
+
 
 export default {
 
@@ -12,5 +14,6 @@ export default {
   ...registerAndLogin,
   ...application,
   ...version,
-  ...vip
+  ...vip,
+  ...file
 }

+ 5 - 2
src/assets/css/layout.less

@@ -8,9 +8,12 @@
     }
   }
 }
+.padding_10{
+  padding:10px 0 !important;
+}
 .pagination {
-  text-align: center;
-  margin: 20px 0;
+  text-align: right;
+  margin: 0;
 }
 .vue-treeselect__control {
   padding-left: 10px !important;

+ 21 - 0
src/router/index.js

@@ -57,6 +57,27 @@ export const backStageManageRouterItem = [
       },
     ]
   },
+  {
+    path: '/administrator',
+    name: 'Administrator_organization',
+    component: administrator_layout,
+    redirect: '/administrator/personnel',
+    meta: { title: '人员组织管理', icon: 'application' },
+    children: [
+      {
+        path: 'personnel',
+        name: 'Administrator_personnel',
+        component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
+        meta: {title: '人员清单'},
+      },
+      {
+        path: 'personnel2',
+        name: 'Administrator_personnel2',
+        component: () => import('@/views/backStageManage/organization/personnel/index.vue'),
+        meta: {title: '人员清单2'},
+      },
+    ]
+  },
 
   {
     path: '/administrator',

+ 3 - 3
src/store/modules/history.js

@@ -32,17 +32,17 @@ export default {
     },
     removeHistory(state,path){
         state.history=state.history.filter(item=>{
-            return item.path!==path;
+            return item.path!=path;
         })
     },
     removeHistoryPath(state,path){
         state.historyPath=state.historyPath.filter(item=>{
-            return item!==path;
+            return item!=path;
         })
         if(state.historyPath.length>0)
             state.currentPath=state.historyPath[state.historyPath.length-1];
         else
-            state.currentPath=null;
+            state.currentPath=null; 
     }
 
   },

+ 8 - 0
src/styles/element-ui.scss

@@ -27,3 +27,11 @@
     }
   }
 }
+
+
+.el-header{
+  background: none;
+}
+
+
+

+ 1 - 1
src/utils/axios.js

@@ -63,7 +63,7 @@ _axios.interceptors.response.use(
     }
     else if (code === 401) {
       Router.push({
-        path: `${Store.getters.prefix}/login`
+        path: `/administrator/login`
       }).then(r => {})
       return Promise.reject(response.data)
     }

+ 1 - 0
src/utils/constants.js

@@ -73,4 +73,5 @@ export default {
     { label: 'Courier New', value: 'Courier New' },
     { label: 'Microsoft YaHei', value: 'Microsoft YaHei' },
   ],
+  sourceId:6,
 }

+ 5 - 1
src/utils/model/index.js

@@ -1,9 +1,13 @@
 // 全局注册自定义
 
 import myInput from './input/index.vue'
+import myUpload from './upload/index.vue'
+import myTooltip from './tooltip/index.vue'
 
 var models = {
-  myInput
+  myInput,
+  myUpload,
+  myTooltip
 }
 export default {
   install(Vue) {

+ 44 - 0
src/utils/model/tooltip/index.vue

@@ -0,0 +1,44 @@
+<template>
+  <el-tooltip class="item" :content="content+''" :disabled="!disable" v-bind="$attrs" ref="myToolTip">
+    <template #content="scopeData">
+        <slot name="content"  v-bind="scopeData || {}"></slot>
+    </template>
+    <template>
+        <slot></slot>
+    </template>
+      
+    </el-tooltip>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    disabled:Boolean,
+    content:{
+      type:[String,Number]
+    }
+  },
+  data() {
+    return {
+        disable:true
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.$refs.myToolTip.$el.addEventListener('mouseenter',this.mouseenter)
+  },
+  methods: {
+    mouseenter(e){
+        var target = e.target
+        const target_Width = target.scrollWidth;
+        const target_content_Width= target.clientWidth;
+        this.disable = target_Width > target_content_Width;
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 120 - 0
src/views/backStageManage/application/apply/components/apply.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="height_100">
+    <el-container>
+        <el-header>
+            <el-form :inline="true">
+                <el-form-item>
+                    <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button type="" size="small" @click="getList">查询</el-button>
+                    <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+                </el-form-item>
+            </el-form>
+        </el-header>
+        <el-main class="padding_10">
+            <el-table
+                :row-key="getRowKeys" 
+                v-loading="loading"
+                :data="tableData"
+                header-row-class-name="custom-table-header"
+                max-height="calc(100% - 0)"
+            >
+            <el-table-column label="应用名称" align="" show-overflow-tooltip>
+                <template slot-scope="scope">
+                <span class="details">{{scope.row.name}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="操作" align="center" width="150">
+                <template slot-scope="scope">
+                <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+                    编辑
+                    <el-dropdown-menu slot="dropdown" class="text-align_center">
+                    
+                    <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+                    <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+                    </el-dropdown-menu>
+                </el-dropdown>
+                </template>
+            </el-table-column>
+            </el-table>
+        </el-main>
+        <el-footer class="pagination">
+                <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+        </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+        getRowKeys(row){
+            return row.id
+        },
+        loading: false,
+        btnLoading: false,
+        total: 0,
+        tableData: [],
+        queryParams: {
+            size: 10,
+            current: 1,
+            name: ''
+        },
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.loading = true
+      this.$api.queryApplication(this.queryParams).then(response => {
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.tableData = []
+        this.loading = false
+      })
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    },
+    //新增
+    handleAdd(parentId) {
+    },
+    //编辑
+    handleEdit(row) {
+      this.title = '编辑应用'
+    },
+    //详情
+    handleDetails(row){
+    
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 286 - 0
src/views/backStageManage/application/apply/index copy.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="admin-apply">
+    <el-form :inline="true">
+      <el-form-item>
+        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="" size="small" @click="getList">查询</el-button>
+        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+        :row-key="getRowKeys" 
+        v-loading="loading"
+        :data="tableData"
+        header-row-class-name="custom-table-header"
+
+        :expand-row-keys="expands"
+        @expand-change="expandChange"
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+     <el-table-column type="expand">
+      <template slot-scope="scope" style="width:80%">
+        <function-list :applyId="scope.row.id"></function-list>
+      </template>
+    </el-table-column>
+      <el-table-column label="应用名称" align="" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span class="details">{{scope.row.name}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+            编辑
+            <el-dropdown-menu slot="dropdown" class="text-align_center">
+             
+              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="pagination">
+      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+    </div>
+    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
+      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
+      
+        <el-form-item label="应用名称" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="应用描述" prop="describe">
+          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
+        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
+          <el-form-item label="应用名称 :">
+            <span>{{ruleForm.apply.name}}</span>
+          </el-form-item>
+          <el-form-item label="应用描述 :">
+            <span>{{ruleForm.apply.describe}}</span>
+          </el-form-item>
+           <el-form-item label="创建人 :">
+            <span>{{ruleForm.apply.createUserName}}</span>
+          </el-form-item>
+          <el-form-item label="租户列表" class="list">
+         
+          </el-form-item>
+         
+        </el-form>
+          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
+            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
+            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+              <span v-if="scope.row.state==0">否</span>
+              <span v-if="scope.row.state==1">是</span>
+            </template>
+            </el-table-column>
+          </el-table>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import FunctionList from '../function/index.vue'
+export default {
+  components: {
+    Treeselect,
+    FunctionList
+  },
+  data() {
+    return {
+     getRowKeys(row){
+				return row.id
+			},
+      visible: false,
+      showvisible:false,
+      loading: false,
+      btnLoading: false,
+      total: 0,
+      tableData: [],
+      title: '',
+      expands:[],
+      queryParams: {
+        size: 10,
+        current: 1,
+        name: ''
+      },
+      ruleForm: {},
+      rules: {
+        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
+        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
+      },
+    }
+  },
+    computed: {
+    userinfo() {
+      return this.$store.state.admin.userinfo
+    }
+  },
+  mounted() {
+    this.getList()
+
+  },
+  methods: {
+    expandChange(row,expandedRows) {
+			let that=this
+			console.log(expandedRows);
+			if (expandedRows.length) {
+              that.expands = []
+              if (row) {
+                that.expands.push(row.id)
+              }
+            } else {
+              that.expands = []
+            }
+    },
+   
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.name,
+      }
+    },
+    handleAdd(parentId) {
+      this.title = '新增应用'
+      this.visible = true
+      this.ruleForm = {
+        // sort: 0,
+        // parentId: parentId
+      }
+    },
+    handleEdit(row) {
+      this.title = '编辑应用'
+      this.visible = true
+      this.ruleForm = { ...row }
+    },
+    handleDetails(row){
+      this.title = '应用详情'
+      this.showvisible = true
+      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
+         console.log(response)
+         
+         this.ruleForm = response.data
+         this.ruleForm.apply={...row}
+      })
+     
+    },
+     handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+    close() {
+      this.visible = false
+      this.showvisible = false
+    },
+    getList() {
+      this.loading = true
+      this.$api.queryApplication(this.queryParams).then(response => {
+       
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.loading = false
+      })
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            this.$api.editApply(this.ruleForm).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          } else {
+            this.ruleForm.tenant=this.userinfo.tenantId
+            this.$api.addApply(this.ruleForm).then(response => {
+              console.log(2,response)
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+.my-dialog-name{
+  .el-dialog__body{
+  padding-top:0
+}
+}
+.list .el-form-item__label{
+    font-weight: 900;
+}
+</style>
+<style lang="scss" scoped>
+.admin-apply {
+
+}
+.details:hover{
+  border-bottom: 1px solid black;
+  cursor: pointer;
+}
+ .demo-table-expand {
+    font-size: 0;
+  }
+  .demo-table-expand label {
+    width: 90px;
+    color: #99a9bf;
+  }
+  .demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+    width: 50%;
+  }
+</style>

+ 12 - 272
src/views/backStageManage/application/apply/index.vue

@@ -1,286 +1,26 @@
 <template>
-  <div class="admin-apply">
-    <el-form :inline="true">
-      <el-form-item>
-        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="" size="small" @click="getList">查询</el-button>
-        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-        :row-key="getRowKeys" 
-        v-loading="loading"
-        :data="tableData"
-        header-row-class-name="custom-table-header"
-
-        :expand-row-keys="expands"
-        @expand-change="expandChange"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-    >
-     <el-table-column type="expand">
-      <template slot-scope="scope" style="width:80%">
-        <function-list :applyId="scope.row.id"></function-list>
-      </template>
-    </el-table-column>
-      <el-table-column label="应用名称" align="" show-overflow-tooltip>
-        <template slot-scope="scope">
-          <span class="details">{{scope.row.name}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column label="操作" align="center" width="150">
-        <template slot-scope="scope">
-          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
-            编辑
-            <el-dropdown-menu slot="dropdown" class="text-align_center">
-             
-              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
-              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagination">
-      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
-    </div>
-    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
-      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
-      
-        <el-form-item label="应用名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
-        </el-form-item>
-        
-        <el-form-item label="应用描述" prop="describe">
-          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
-      </div>
-    </el-dialog>
-       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
-        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
-          <el-form-item label="应用名称 :">
-            <span>{{ruleForm.apply.name}}</span>
-          </el-form-item>
-          <el-form-item label="应用描述 :">
-            <span>{{ruleForm.apply.describe}}</span>
-          </el-form-item>
-           <el-form-item label="创建人 :">
-            <span>{{ruleForm.apply.createUserName}}</span>
-          </el-form-item>
-          <el-form-item label="租户列表" class="list">
-         
-          </el-form-item>
-         
-        </el-form>
-          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
-            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
-            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
-              <template slot-scope="scope">
-              <span v-if="scope.row.state==0">否</span>
-              <span v-if="scope.row.state==1">是</span>
-            </template>
-            </el-table-column>
-          </el-table>
-
-    </el-dialog>
+  <div class="height_100">
+    <apply></apply>
   </div>
 </template>
 
 <script>
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import FunctionList from '../function/index.vue'
+import apply from './components/apply.vue';
 export default {
   components: {
-    Treeselect,
-    FunctionList
+    apply
   },
+  props: {},
   data() {
     return {
-     getRowKeys(row){
-				return row.id
-			},
-      visible: false,
-      showvisible:false,
-      loading: false,
-      btnLoading: false,
-      total: 0,
-      tableData: [],
-      title: '',
-      expands:[],
-      queryParams: {
-        size: 10,
-        current: 1,
-        name: ''
-      },
-      ruleForm: {},
-      rules: {
-        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
-        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
-      },
-    }
-  },
-    computed: {
-    userinfo() {
-      return this.$store.state.admin.userinfo
-    }
+    };
   },
-  mounted() {
-    this.getList()
-
-  },
-  methods: {
-    expandChange(row,expandedRows) {
-			let that=this
-			console.log(expandedRows);
-			if (expandedRows.length) {
-              that.expands = []
-              if (row) {
-                that.expands.push(row.id)
-              }
-            } else {
-              that.expands = []
-            }
-    },
-   
-    normalizer(node) {
-      return {
-        id: node.id,
-        label: node.name,
-      }
-    },
-    handleAdd(parentId) {
-      this.title = '新增应用'
-      this.visible = true
-      this.ruleForm = {
-        // sort: 0,
-        // parentId: parentId
-      }
-    },
-    handleEdit(row) {
-      this.title = '编辑应用'
-      this.visible = true
-      this.ruleForm = { ...row }
-    },
-    handleDetails(row){
-      this.title = '应用详情'
-      this.showvisible = true
-      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
-         console.log(response)
-         
-         this.ruleForm = response.data
-         this.ruleForm.apply={...row}
-      })
-     
-    },
-     handleCurrentChange(val) {
-      this.queryParams.current = val;
-      this.getList();
-    },
-    close() {
-      this.visible = false
-      this.showvisible = false
-    },
-    getList() {
-      this.loading = true
-      this.$api.queryApplication(this.queryParams).then(response => {
-       
-        this.tableData = response.data
-        this.total = response.pageColumn.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-      })
-    },
-    submit() {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.btnLoading = true
-          if (this.ruleForm.id) {
-            this.$api.editApply(this.ruleForm).then(response => {
-              this.$message.success('编辑成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          } else {
-            this.ruleForm.tenant=this.userinfo.tenantId
-            this.$api.addApply(this.ruleForm).then(response => {
-              console.log(2,response)
-              this.$message.success('新增成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-    handleDelete(row) {
-      this.$confirm('确认删除本条数据吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.loading = true
-        this.$api.deleteApply({ id: row.id }).then(response => {
-          this.$message.success('删除成功')
-          this.loading = false
-          this.getList()
-        }).catch(error => {
-          this.loading = false
-        })
-      })
-    }
-  }
-}
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
 </script>
-<style lang="scss">
-.my-dialog-name{
-  .el-dialog__body{
-  padding-top:0
-}
-}
-.list .el-form-item__label{
-    font-weight: 900;
-}
-</style>
 <style lang="scss" scoped>
-.admin-apply {
-
-}
-.details:hover{
-  border-bottom: 1px solid black;
-  cursor: pointer;
-}
- .demo-table-expand {
-    font-size: 0;
-  }
-  .demo-table-expand label {
-    width: 90px;
-    color: #99a9bf;
-  }
-  .demo-table-expand .el-form-item {
-    margin-right: 0;
-    margin-bottom: 0;
-    width: 50%;
-  }
 </style>

+ 286 - 0
src/views/backStageManage/application/function/index copy.vue

@@ -0,0 +1,286 @@
+<template>
+  <div class="admin-apply">
+    <el-form :inline="true">
+      <el-form-item>
+        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="" size="small" @click="getList">查询</el-button>
+        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table
+        :row-key="getRowKeys" 
+        v-loading="loading"
+        :data="tableData"
+        header-row-class-name="custom-table-header"
+
+        :expand-row-keys="expands"
+        @expand-change="expandChange"
+        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+    >
+     <el-table-column type="expand">
+      <template slot-scope="scope" style="width:80%">
+        <function-list :applyId="scope.row.id"></function-list>
+      </template>
+    </el-table-column>
+      <el-table-column label="应用名称" align="" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span class="details">{{scope.row.name}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
+      <el-table-column label="操作" align="center" width="150">
+        <template slot-scope="scope">
+          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
+            编辑
+            <el-dropdown-menu slot="dropdown" class="text-align_center">
+             
+              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
+              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="pagination">
+      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+    </div>
+    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
+      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
+      
+        <el-form-item label="应用名称" prop="name">
+          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
+        </el-form-item>
+        
+        <el-form-item label="应用描述" prop="describe">
+          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
+      </div>
+    </el-dialog>
+       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
+        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
+          <el-form-item label="应用名称 :">
+            <span>{{ruleForm.apply.name}}</span>
+          </el-form-item>
+          <el-form-item label="应用描述 :">
+            <span>{{ruleForm.apply.describe}}</span>
+          </el-form-item>
+           <el-form-item label="创建人 :">
+            <span>{{ruleForm.apply.createUserName}}</span>
+          </el-form-item>
+          <el-form-item label="租户列表" class="list">
+         
+          </el-form-item>
+         
+        </el-form>
+          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
+            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
+            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
+              <template slot-scope="scope">
+              <span v-if="scope.row.state==0">否</span>
+              <span v-if="scope.row.state==1">是</span>
+            </template>
+            </el-table-column>
+          </el-table>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import FunctionList from '../function/index.vue'
+export default {
+  components: {
+    Treeselect,
+    FunctionList
+  },
+  data() {
+    return {
+     getRowKeys(row){
+				return row.id
+			},
+      visible: false,
+      showvisible:false,
+      loading: false,
+      btnLoading: false,
+      total: 0,
+      tableData: [],
+      title: '',
+      expands:[],
+      queryParams: {
+        size: 10,
+        current: 1,
+        name: ''
+      },
+      ruleForm: {},
+      rules: {
+        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
+        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
+      },
+    }
+  },
+    computed: {
+    userinfo() {
+      return this.$store.state.admin.userinfo
+    }
+  },
+  mounted() {
+    this.getList()
+
+  },
+  methods: {
+    expandChange(row,expandedRows) {
+			let that=this
+			console.log(expandedRows);
+			if (expandedRows.length) {
+              that.expands = []
+              if (row) {
+                that.expands.push(row.id)
+              }
+            } else {
+              that.expands = []
+            }
+    },
+   
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.name,
+      }
+    },
+    handleAdd(parentId) {
+      this.title = '新增应用'
+      this.visible = true
+      this.ruleForm = {
+        // sort: 0,
+        // parentId: parentId
+      }
+    },
+    handleEdit(row) {
+      this.title = '编辑应用'
+      this.visible = true
+      this.ruleForm = { ...row }
+    },
+    handleDetails(row){
+      this.title = '应用详情'
+      this.showvisible = true
+      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
+         console.log(response)
+         
+         this.ruleForm = response.data
+         this.ruleForm.apply={...row}
+      })
+     
+    },
+     handleCurrentChange(val) {
+      this.queryParams.current = val;
+      this.getList();
+    },
+    close() {
+      this.visible = false
+      this.showvisible = false
+    },
+    getList() {
+      this.loading = true
+      this.$api.getApplyList(this.queryParams).then(response => {
+       
+        this.tableData = response.data
+        this.total = response.pageColumn.total
+        this.loading = false
+      }).catch(error => {
+        this.loading = false
+      })
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            this.$api.editApply(this.ruleForm).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          } else {
+            this.ruleForm.tenant=this.userinfo.tenantId
+            this.$api.addApply(this.ruleForm).then(response => {
+              console.log(2,response)
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.close()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          }
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    handleDelete(row) {
+      this.$confirm('确认删除本条数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.deleteApply({ id: row.id }).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+.my-dialog-name{
+  .el-dialog__body{
+  padding-top:0
+}
+}
+.list .el-form-item__label{
+    font-weight: 900;
+}
+</style>
+<style lang="scss" scoped>
+.admin-apply {
+
+}
+.details:hover{
+  border-bottom: 1px solid black;
+  cursor: pointer;
+}
+ .demo-table-expand {
+    font-size: 0;
+  }
+  .demo-table-expand label {
+    width: 90px;
+    color: #99a9bf;
+  }
+  .demo-table-expand .el-form-item {
+    margin-right: 0;
+    margin-bottom: 0;
+    width: 50%;
+  }
+</style>

+ 10 - 275
src/views/backStageManage/application/function/index.vue

@@ -1,286 +1,21 @@
 <template>
-  <div class="admin-apply">
-    <el-form :inline="true">
-      <el-form-item>
-        <el-input v-model="queryParams.name" size="small" placeholder="请输入"></el-input>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="" size="small" @click="getList">查询</el-button>
-        <el-button type="primary" size="small" @click="handleAdd(0)">新增</el-button>
-      </el-form-item>
-    </el-form>
-    <el-table
-        :row-key="getRowKeys" 
-        v-loading="loading"
-        :data="tableData"
-        header-row-class-name="custom-table-header"
-
-        :expand-row-keys="expands"
-        @expand-change="expandChange"
-        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
-    >
-     <el-table-column type="expand">
-      <template slot-scope="scope" style="width:80%">
-        <function-list :applyId="scope.row.id"></function-list>
-      </template>
-    </el-table-column>
-      <el-table-column label="应用名称" align="" show-overflow-tooltip>
-        <template slot-scope="scope">
-          <span class="details">{{scope.row.name}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column prop="describe" label="应用描述" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="createUserName" label="创建人" align="center" show-overflow-tooltip></el-table-column>
-      <el-table-column label="操作" align="center" width="150">
-        <template slot-scope="scope">
-          <el-dropdown split-button type="primary" size="small" @click="handleEdit(scope.row)">
-            编辑
-            <el-dropdown-menu slot="dropdown" class="text-align_center">
-             
-              <el-dropdown-item @click.native="handleDetails(scope.row)">详情</el-dropdown-item>
-              <el-dropdown-item class="color-red" @click.native="handleDelete(scope.row)" divided>删除</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </template>
-      </el-table-column>
-    </el-table>
-    <div class="pagination">
-      <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
-    </div>
-    <el-dialog :title="title" :visible.sync="visible" width="500px" :before-close="close">
-      <el-form v-if="visible" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px" label-position="left">
-      
-        <el-form-item label="应用名称" prop="name">
-          <el-input v-model="ruleForm.name" placeholder="请输入应用名称"></el-input>
-        </el-form-item>
-        
-        <el-form-item label="应用描述" prop="describe">
-          <el-input v-model="ruleForm.describe" placeholder="请输入" type="textarea" maxlength="100" show-word-limit></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="close">取 消</el-button>
-        <el-button type="primary" @click="submit" :loading="btnLoading">确 定</el-button>
-      </div>
-    </el-dialog>
-       <el-dialog :title="title" :visible.sync="showvisible" width="700px" class="my-dialog-name" contentStyle="width:400px;" :before-close="close" v-if="ruleForm.apply!=null">
-        <el-form label-position="left"  class="demo-table-expand" label-width="80px">
-          <el-form-item label="应用名称 :">
-            <span>{{ruleForm.apply.name}}</span>
-          </el-form-item>
-          <el-form-item label="应用描述 :">
-            <span>{{ruleForm.apply.describe}}</span>
-          </el-form-item>
-           <el-form-item label="创建人 :">
-            <span>{{ruleForm.apply.createUserName}}</span>
-          </el-form-item>
-          <el-form-item label="租户列表" class="list">
-         
-          </el-form-item>
-         
-        </el-form>
-          <el-table :data="ruleForm.tenantVOList" header-row-class-name="custom-table-header"  max-height="250" border>
-            <!-- <el-table-column type="index" label="#" width="55" align="center"></el-table-column> -->
-            <el-table-column prop="name" label="租户名称" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="contacts" label="联系人" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="address" label="联系人地址" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="type" label="类型" align="center" show-overflow-tooltip></el-table-column>
-            <el-table-column label="是否启用" align="center" show-overflow-tooltip>
-              <template slot-scope="scope">
-              <span v-if="scope.row.state==0">否</span>
-              <span v-if="scope.row.state==1">是</span>
-            </template>
-            </el-table-column>
-          </el-table>
-
-    </el-dialog>
-  </div>
+  <div></div>
 </template>
 
 <script>
-import Treeselect from '@riophae/vue-treeselect'
-import '@riophae/vue-treeselect/dist/vue-treeselect.css'
-import FunctionList from '../function/index.vue'
 export default {
-  components: {
-    Treeselect,
-    FunctionList
-  },
+  components: {},
+  props: {},
   data() {
     return {
-     getRowKeys(row){
-				return row.id
-			},
-      visible: false,
-      showvisible:false,
-      loading: false,
-      btnLoading: false,
-      total: 0,
-      tableData: [],
-      title: '',
-      expands:[],
-      queryParams: {
-        size: 10,
-        current: 1,
-        name: ''
-      },
-      ruleForm: {},
-      rules: {
-        name: [{ required: true, message: '请输入应用名称', trigger: 'blur' },],
-        describe: [{ required: true, message: '请输入描述', trigger: 'blur' },],
-      },
-    }
-  },
-    computed: {
-    userinfo() {
-      return this.$store.state.admin.userinfo
-    }
+    };
   },
-  mounted() {
-    this.getList()
-
-  },
-  methods: {
-    expandChange(row,expandedRows) {
-			let that=this
-			console.log(expandedRows);
-			if (expandedRows.length) {
-              that.expands = []
-              if (row) {
-                that.expands.push(row.id)
-              }
-            } else {
-              that.expands = []
-            }
-    },
-   
-    normalizer(node) {
-      return {
-        id: node.id,
-        label: node.name,
-      }
-    },
-    handleAdd(parentId) {
-      this.title = '新增应用'
-      this.visible = true
-      this.ruleForm = {
-        // sort: 0,
-        // parentId: parentId
-      }
-    },
-    handleEdit(row) {
-      this.title = '编辑应用'
-      this.visible = true
-      this.ruleForm = { ...row }
-    },
-    handleDetails(row){
-      this.title = '应用详情'
-      this.showvisible = true
-      this.$api.getAllTenantByApplicationId({id:row.id}).then(response=>{
-         console.log(response)
-         
-         this.ruleForm = response.data
-         this.ruleForm.apply={...row}
-      })
-     
-    },
-     handleCurrentChange(val) {
-      this.queryParams.current = val;
-      this.getList();
-    },
-    close() {
-      this.visible = false
-      this.showvisible = false
-    },
-    getList() {
-      this.loading = true
-      this.$api.getApplyList(this.queryParams).then(response => {
-       
-        this.tableData = response.data
-        this.total = response.pageColumn.total
-        this.loading = false
-      }).catch(error => {
-        this.loading = false
-      })
-    },
-    submit() {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.btnLoading = true
-          if (this.ruleForm.id) {
-            this.$api.editApply(this.ruleForm).then(response => {
-              this.$message.success('编辑成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          } else {
-            this.ruleForm.tenant=this.userinfo.tenantId
-            this.$api.addApply(this.ruleForm).then(response => {
-              console.log(2,response)
-              this.$message.success('新增成功')
-              this.btnLoading = false
-              this.getList()
-              this.close()
-            }).catch(error => {
-              this.btnLoading = false
-            })
-          }
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
-    },
-    handleDelete(row) {
-      this.$confirm('确认删除本条数据吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.loading = true
-        this.$api.deleteApply({ id: row.id }).then(response => {
-          this.$message.success('删除成功')
-          this.loading = false
-          this.getList()
-        }).catch(error => {
-          this.loading = false
-        })
-      })
-    }
-  }
-}
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
 </script>
-<style lang="scss">
-.my-dialog-name{
-  .el-dialog__body{
-  padding-top:0
-}
-}
-.list .el-form-item__label{
-    font-weight: 900;
-}
-</style>
 <style lang="scss" scoped>
-.admin-apply {
-
-}
-.details:hover{
-  border-bottom: 1px solid black;
-  cursor: pointer;
-}
- .demo-table-expand {
-    font-size: 0;
-  }
-  .demo-table-expand label {
-    width: 90px;
-    color: #99a9bf;
-  }
-  .demo-table-expand .el-form-item {
-    margin-right: 0;
-    margin-bottom: 0;
-    width: 50%;
-  }
 </style>

+ 119 - 8
src/views/backStageManage/application/vision/components/functionTable.vue

@@ -1,23 +1,134 @@
 <template>
-    <div>
+    <div class="height_100">
+        <el-table
+            row-key="id"
+            v-loading="loading"
+            :data="tableData.children"
+            border
+            height="calc(100% - 30px)"
+            :default-expand-all="expandAll"
+            header-row-class-name="custom-table-header"
+            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+        >
+            <el-table-column type="index" align="center" width="50px">
+                <template slot-scope="scope">
+                    <div>
+                        <el-checkbox-group v-model="checkList">
+                            <el-checkbox :label="scope.row.id">{{ "" }}</el-checkbox>
+                        </el-checkbox-group>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column prop="name" label="功能名称" align="" show-overflow-tooltip></el-table-column>
+            <el-table-column label="所属应用" align="center" show-overflow-tooltip>
+                <template slot-scope="scope">
+                    <span >{{tableData.applyName}}</span>
+                    </template>
+            </el-table-column>
+            <el-table-column prop="describe" label="功能描述" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="sign" label="路径" align="center" show-overflow-tooltip></el-table-column>
+            <el-table-column label="是否可选" align="center" show-overflow-tooltip>
+                <template slot-scope="scope">
+                    <span >{{scope.row.functionType==1?'是':'否'}}</span>
+                    </template>
+            </el-table-column>
+            <slot name="column"></slot>
+        </el-table>
         
     </div>
 </template>
 
 <script>
-
-
 export default {
     components: {},
-    props: {},
+    props: {
+        applyId:"",
+        checkFunctions:{
+            type:Array,
+            default:()=>{
+                return []
+            }
+        },
+        expandAll:{
+            type:Boolean,
+            default:false
+        },
+        tableData:{
+            type:Object,
+            default:()=>{
+                return {}
+            }
+        },
+        loading:{
+            type:Boolean,
+            default:false
+        }
+    },
     data() {
-        return {};
+        return {
+            // loading:false,
+            // tableData:[],
+            // queryParams:{
+            //     apply:this.applyId,
+            //     name:'',
+            //     current:1,
+            //     size:10,
+            // },
+            // total:0,
+            checkList:this.checkFunctions,
+        };
+    },
+    watch: {
+        checkFunctions(){
+            this.checkList = this.checkFunctions
+            // this.handleCurrentChange(1)
+        }
     },
-    watch: {},
     computed: {},
     created() {},
-    mounted() {},
-    methods: {},
+    mounted() {
+        // this.getList()
+    },
+    methods: {
+        getCheckList(){
+            return this.checkList
+        },
+        getList() {
+            if(!this.queryParams.apply){
+                return false
+            }
+            this.loading = true
+            this.$api.queryFunctionList(this.queryParams).then(response => {
+                this.tableData = response.data
+                var a = response.data.children
+                for(var j = 0;j<a.length;j++){
+                    function l(data){
+                        if(data.hasOwnProperty('children')){
+                            for(var i = 0;i<data.children.length;i++){
+                            
+                                if(data.hasOwnProperty('last')){
+                                    data.children[i].last=data.last+'/'+data.name
+                                }else{
+                                    data.children[i].last=data.name
+                                }
+                                l(data.children[i])
+                            }
+                        }
+                    }
+                    l(a[j])
+                }
+                this.total=response.pageColumn.total
+                this.loading = false
+            }).catch(error => {
+                this.loading = true
+            })
+        },
+        //切换分页
+        handleCurrentChange(val){
+            this.queryParams.current = val
+            this.getList()
+        }
+    },
 };
 </script>
 <style lang="scss">

+ 201 - 20
src/views/backStageManage/application/vision/components/versionForm.vue

@@ -1,44 +1,73 @@
 <template>
     <div class="form_center">
-        <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="80px">
-            <el-form-item label="版本名称" prop="versionName">
+        <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="120px">
+            <el-form-item label="版本名称" prop="versionName">
                 <el-input v-model="form.versionName" placeholder="请输入版本名称" maxlength="20" />
             </el-form-item>
 
-            <el-form-item label="版本号" prop="versionNum">
+            <el-form-item label="版本号" prop="versionNum">
                 <el-input v-model="form.versionNum" placeholder="请输入版本号" maxlength="11" />
             </el-form-item>
         
-            <el-form-item label="备注" prop="remark">
+            <el-form-item label="备注" prop="remark">
                 <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" />
             </el-form-item>
 
-            <el-form-item label="上传文件" class="margin-bottom_0">
-                <myUpload :file-list="[form.systemFileList]" @on-change="onchangeFile" @on-remove="onRemove" :multiple="false" :limit="1"
+            <el-form-item label="上传文件" class="margin-bottom_0">
+                <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove" :multiple="false" :limit="1"
                     style="height: 185px;" :autoUpload="true">
                 </myUpload>
             </el-form-item>
-
+            
         </el-form>
+        <div style="border:1px solid white;padding:10px;margin:10px 0;border-radius:8px;">
+            <div style="height: 500px;" >
+                <p>选择功能:</p>
+                <funTable ref="functionTable" :applyId="form.applyId" :tableData="tableData" :loading="loading" :checkFunctions="checkFunctions" :expandAll="true">
+                    <template slot="column">
+                        <el-table-column label="授权代码" align="center">
+                            <template slot-scope="scope">
+                                <el-input type="textarea" :value="getCode(scope.row.id,'code1')" @change="(val)=>setCodeList_code(scope.row.id,val,'code1')"></el-input>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="代码" align="center">
+                            <template slot-scope="scope">
+                                <el-input type="textarea" :value="getCode(scope.row.id,'code1')" @change="(val)=>setCodeList_code(scope.row.id,val,'code2')"></el-input>
+                            </template>
+                        </el-table-column>
+                    </template>
+                    
+                </funTable>
+            
+            </div>
+            <div class="pagination" style="margin-top:10px">
+                <el-pagination :current-page.sync="queryParams.current" :page-size="queryParams.size" :total="total" @current-change="handleCurrentChange" layout="total, prev, pager, next, jumper" background></el-pagination>
+            </div>
+        </div>
+        
         <div class="button-container">
-            <el-button type="primary" :loading="btnLoading" @click="submitForm">提 交</el-button>
-            <el-button @click="resetForm">重 置</el-button>
+            <el-button type="primary" size="small" :loading="btnLoading" @click="submitForm">提 交</el-button>
+            <el-button size="small"  @click="resetForm">重 置</el-button>
         </div>
     </div>
 </template>
 
 <script>
-
+import funTable from './functionTable.vue';
 
 const currentForm = {
     id:null,
     versionName:null,
     versionNum:null,
+    applicationCode:'4e95e3d926a2a4befa5d913acc0aa9f5',
+    applyId:14,
     remark:null,
-    systemFileList:{}
+    systemFileList:[]
 }
 export default {
-    components: {},
+    components: {
+        funTable
+    },
     props: {
         versionId:"",
         model:{
@@ -59,13 +88,24 @@ export default {
                 versionNum: [
                     { required: true, message: "版本号不能为空", trigger: "blur" }
                 ]
-            }
+            },
+            checkFunctions:[223],
+            checkFunctions_back_up:[223],
+            codeList:[],
+            tableData:[],
+            queryParams:{
+                name:'',
+                current:1,
+                size:10,
+            },
+            total:0,
+            loading:false,
         };
     },
     watch: {
         versionId(){
             this.init()
-        }
+        },
     },
     computed: {},
     created() {},
@@ -74,14 +114,28 @@ export default {
     },
     methods: {
         //初始化当前页面
-        init(){
+        async init(){
             if(this.model == 'add'){
                 this.resetForm()
+                await this.getList()
+                this.getFunctionId(this.tableData.children,[])
             }else if(this.model == 'edit'){
                 //查询数据并检验
                 this.getById()
             }
         },
+        getFunctionId(data,checkData=[]){
+            for(var i = 0;i<data.length;i++){
+                checkData.push(data[i].id)
+                if(data[i].children && data[i].children.length>0){
+                    this.getFunctionId(data[i].children,checkData)
+                }
+            }
+            this.checkFunctions = checkData
+            this.$nextTick(()=>{
+                this.checkFunctions_back_up = [...checkData]
+            })
+        },
         //查询数据并校验
         getById(){
             if(!this.versionId){
@@ -94,11 +148,49 @@ export default {
             this.$api.getVersionById(params).then(response=>{
                 if(response.code == 200){
                     this.form = response.data.records
+                    this.getList()
+                    this.getCodeList()
                 }
             }).catch(error=>{
                 this.resetForm()
             })
         },
+        //获取代码集合
+        getCodeList(){
+            if(!this.form.id){
+                return 
+            }
+            this.codeList = []
+        },
+        //获取代码
+        getCode(funId,field){
+            var index = this.codeList.findIndex(item=>{
+                return item.id == funId
+            })
+            if(index!=-1){
+                return this.codeList[index][field]
+            }
+            return ''
+        },
+        //改变代码
+        setCodeList_code(funId,value,field){
+            var index1 = this.checkFunctions.indexOf(funId)
+            if(index1 ==-1){
+                this.checkFunctions.push(funId)
+            }
+            var index = this.codeList.findIndex(item=>{
+                return item.id == funId
+            })
+            if(index!=-1){
+                this.codeList[index][field] = value
+            }else{
+                var obj = {
+                    id:funId,
+                }
+                obj[field] = value
+                this.codeList.push(obj)
+            }
+        },
         //重置表单
         resetForm(){
             this.form = Object.assign({}, currentForm)
@@ -108,6 +200,15 @@ export default {
         submitForm: function() {
             this.$refs['form'].validate((valid) => {
                 if (valid) {
+                    var fileGuids = this.$commonJS.checkUploadFile(this.form.systemFileList)
+                    if(!fileGuids){
+                        return
+                    }
+                    this.form.fileGuid = fileGuids.length>0?fileGuids[0]:''
+                    this.form.assoFunctionCodeDTO = this.codeList.filter(item=>{
+                        return this.checkFunctions.indexOf(item.id) != -1
+                    })
+
                     this.btnLoading = true
                     var a = '添加'
                     var api = 'addVersion'
@@ -119,7 +220,7 @@ export default {
                         if (response.code === 200) {
                             this.btnLoading = false
                             this.$message.success( a + '成功');
-                            this.resetForm();
+                            this.finish()
                         }
                     })
                     .catch(error => {
@@ -129,18 +230,98 @@ export default {
                 }
             });
         },
+        finish(){
+            if(this.model == 'add'){
+                this.resetForm();
+                this.checkFunctions_back_up = [...this.checkFunctions]
+                this.codeList = []
+            }else{
+                this.$store.commit('removeHistoryPath',this.$route.path);
+                this.$store.commit('removeHistory',this.$route.path);
+                this.$router.push(
+                    {
+                        path:'/administrator/vision'
+                    }
+                )
+            }
+        },
+        //文件切换
+        onchangeFile(file){
+            if(file.guid){
+                let a = this.form.systemFileList.findIndex(item => {
+                    return item.uid == file.uid
+                })
+                if (a != -1) {
+                    this.form.systemFileList.splice(a,1,file)
+                }
+            }else{
+                this.form.systemFileList.push(file)
+            }
+        },
+        //删除文件
+        onRemove(file){
+            if (file.guid) {
+                let a = this.form.systemFileList.findIndex(item => {
+                    return item.guid == file.guid
+                })
+                if(a != -1){
+                    this.form.systemFileList.splice(a, 1)  
+                }
+            } else {
+                let a = this.form.systemFileList.findIndex(item => {
+                    return item.uid == file.uid
+                })
+                this.form.systemFileList.splice(a, 1)
+            }
+        },
+        //查询功能列表
+        async getList() {
+            if(!this.form.applyId){
+                return false
+            }
+            this.queryParams.apply = this.form.applyId
+            this.loading = true
+            await this.$api.queryFunctionList(this.queryParams).then(response => {
+                this.tableData = response.data
+                var a = response.data.children
+                for(var j = 0;j<a.length;j++){
+                    function l(data){
+                        if(data.hasOwnProperty('children')){
+                            for(var i = 0;i<data.children.length;i++){
+                            
+                                if(data.hasOwnProperty('last')){
+                                    data.children[i].last=data.last+'/'+data.name
+                                }else{
+                                    data.children[i].last=data.name
+                                }
+                                l(data.children[i])
+                            }
+                        }
+                    }
+                    l(a[j])
+                }
+                this.total=response.pageColumn.total
+                this.loading = false
+            }).catch(error => {
+                this.loading = true
+            })
+        },
+        //切换分页
+        handleCurrentChange(val){
+            this.queryParams.current = val
+            this.getList()
+        }
     },
 };
 </script>
 <style lang="scss">
 .form_center {
-    display: flex;
-    align-items: center;
-    flex-direction: column;
+    width: 800px;
+    margin: 30px auto;
 }
 
 .button-container {
     display: flex;
-    justify-content: center;
+    justify-content:flex-end;
 }
 </style>

+ 8 - 208
src/views/backStageManage/application/vision/index.vue

@@ -1,226 +1,26 @@
 <template>
-  <div class="container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="版本名" prop="versionName">
-        <el-input v-model="queryParams.versionName" placeholder="请输入版本名称"/>
-      </el-form-item>
-      <el-form-item label="版本号" prop="versionNum">
-        <el-input v-model="queryParams.versionNum" placeholder="请输入版本号"/>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-    
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
-      </el-col>
-    </el-row>
-
-    <el-table
-            ref="table"
-            :data="tableData"
-            row-key="id"
-            style="width: 100%"
-            :maxHeight="tableHeight - 40"
-            v-loading="loading"
-            @selection-change="handleSelectionChange"
-            @sort-change="sortChange"
-        >
-        <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose">
-
-        </el-table-column>
-        <el-table-column  v-if="choose" align="center">
-            <template slot-scope="scope">
-                <div>
-                    <el-checkbox-group v-model="checkList1">
-                        <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
-                    </el-checkbox-group>
-                </div>
-            </template>
-            
-        </el-table-column>
-
-        <el-table-column prop="versionName" label="版本名称"></el-table-column>
-        <el-table-column prop="versionNum" label="版本号"></el-table-column>
-        <el-table-column prop="versionFile" label="版本文件"></el-table-column>
-        <el-table-column prop="remark" label="备注"></el-table-column>
-
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-          <template slot-scope="scope">
-            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
-            <el-button v-if="scope.row.id != 0" size="mini" type="text" icon="el-icon-delete"@click="handleDelete(scope.row)">删除</el-button>
-          </template>
-        </el-table-column>
-    </el-table>
-    <div>
-      <el-pagination background layout="total, sizes, prev, pager, next, jumper"
-        :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
-        @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
-      </el-pagination>
-    </div>
+  <div class="height_100">
+    <version></version>
   </div>
 </template>
 
 <script>
-
+import version from './vision.vue';
 export default {
-
-  components: {},
-  props: {
-    choose:{
-      type:Boolean,
-      default:false
-    },
-    checkList:{
-      type:Array,
-      default:()=>{
-          return []
-      }
-    }
+  components: {
+    version
   },
+  props: {},
   data() {
     return {
-      checkList1:this.checkList,
-      multipleSelection:[],
-      // 遮罩层
-      loading: false,
-      // 显示搜索条件
-      showSearch: true,
-      // 表单参数
-      form: {},
-      // 版本表格数据
-      versionList: [],
-      // 总条数
-      total: 0,
-      tableData: [],
-      // 查询参数
-      queryParams: {
-        current: 1,
-        size: 10,
-        versionNum: '',
-        versionName: ''
-      },
-      rules: {
-        versionNum: [
-          { required: true, message: "版本号不能为空", trigger: "blur" }
-        ],
-        versionName: [
-          { required: true, message: "版本名称不能为空", trigger: "blur" }
-        ]
-      }
     };
   },
   watch: {},
   computed: {},
   created() {},
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    //检索
-    search(){
-      this.queryParams.current = 1
-      this.getList()
-    },
-    /** 查询版本列表 */
-    getList() {
-      this.loading = true;
-      this.$api.getVersionList(this.queryParams).then(response=>{
-        if(response.code == 200){
-            this.tableData = response.data.records
-            this.total = response.data.total
-            this.loading = false
-        }
-      }).catch(error=>{
-          this.tableData = []
-          this.total = 0
-          this.loading = false
-      })
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!=1
-      this.multiple = !selection.length
-    },
-    //切换分页
-    handleCurrentChange(val){
-        this.queryParams.current = val
-        this.getList()
-    },
-
-    //切换也大小
-    handleSizeChange(val){
-        this.queryParams.current = 1
-        this.queryParams.size = val
-        this.getList()
-    },
-
-    //排序
-    sortChange({ column, prop, order }){},
-    /** 新增按钮操作 */
-    handleAdd(row) {
-      this.$router.push('/administrator/addVersion');
-    },
-    /** 提交按钮 */
-    submitForm: function() {
-      this.open = false;
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-    },
-    handleEdit(row) {
-      this.$router.push({ 
-        path: '/administrator/editVersion', 
-        query: {
-            id: row.id
-        }
-      });
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.current = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.handleQuery();
-    },
-    handleDelete(row){
-      this.removeVersions([row.id])
-    },
-  },
+  mounted() {},
+  methods: {},
 };
 </script>
 <style lang="scss" scoped>
-.container{
-  width: 100%;
-}
-.padding_20{
-  padding: 20px
-}
-::v-deep .el-table,
-.el-table__expanded-cell {
-  background-color: transparent;
-}
-
-::v-deep .el-table tr {
-  background-color: transparent !important;
-}
-::v-deep .el-table__body td,::v-deep .el-table__header th,
-.el-table .cell {
-  background-color: transparent;
-}
-::v-deep .el-table::before {
-  //去除底部白线
-  left: 0;
-  bottom: 0;
-  width: 100%;
-  height: 0px;
-}
-
 </style>

+ 205 - 0
src/views/backStageManage/application/vision/vision.vue

@@ -0,0 +1,205 @@
+<template>
+  <div class="height_100">
+    <el-container>
+      <el-header>
+        <div class="header">
+          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"  label-width="68px">
+            <el-form-item label="版本名" prop="versionName">
+              <el-input v-model="queryParams.versionName" placeholder="请输入版本名称"/>
+            </el-form-item>
+            <el-form-item label="版本号" prop="versionNum">
+              <el-input v-model="queryParams.versionNum" placeholder="请输入版本号"/>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="search">搜索</el-button>
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+          
+          <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+              <el-button type="primary" plain icon="el-icon-plus" size="small" @click="handleAdd">新增</el-button>
+            </el-col>
+          </el-row>
+        </div>
+      </el-header>
+      <el-main class="padding_10">
+        <el-table
+            ref="table"
+            :data="tableData"
+            row-key="id"
+            style="width: 100%"
+            max-height="calc(100% - 0)"
+            v-loading="loading"
+            @sort-change="sortChange"
+        >
+            <el-table-column type="index" align="center" width="120px">
+                <template slot-scope="scope">
+                    <div>
+                        <el-checkbox-group v-model="checkList">
+                            <el-checkbox :label="scope.row.id">{{(scope.$index + 1) + ((queryParams.current - 1) * queryParams.size)}}</el-checkbox>
+                        </el-checkbox-group>
+                    </div>
+                </template>
+                
+            </el-table-column>
+
+            <el-table-column prop="versionName" label="版本名称"></el-table-column>
+            <el-table-column prop="versionNum" label="版本号"></el-table-column>
+            <el-table-column prop="versionFile" label="版本文件"></el-table-column>
+            <el-table-column prop="remark" label="备注"></el-table-column>
+
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+              <template slot-scope="scope">
+                <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
+                <el-button v-if="scope.row.id != 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
+              </template>
+            </el-table-column>
+        </el-table>
+      </el-main>
+      <el-footer class="pagination">
+        <div>
+            <div v-if="checkList.length>0">
+              <el-button size="small" type="danger" @click="dels">删除{{ checkList.length }}</el-button>
+            </div>
+            <el-pagination background layout="total, sizes, prev, pager, next, jumper"
+            :current-page.sync="queryParams.current" :page-size.sync="queryParams.size"
+            @current-change="handleCurrentChange" @size-change="changeSize" :total="total">
+          </el-pagination>
+        </div>
+        
+      </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+const searchForm = {
+  versionName:'',
+  versionNum:''
+}
+export default {
+
+  components: {},
+  props: {
+  },
+  data() {
+    return {
+      checkList:[],
+      // 遮罩层
+      loading: false,
+      // 总条数
+      total: 0,
+      tableData: [],
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+        ...searchForm
+      },
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    //检索
+    search(){
+      this.queryParams.current = 1
+      this.getList()
+    },
+    /** 查询版本列表 */
+    getList() {
+      this.loading = true;
+      this.$api.getVersionList(this.queryParams).then(response=>{
+        if(response.code == 200){
+            this.tableData = response.data.records
+            this.total = response.data.total
+            this.loading = false
+        }
+      }).catch(error=>{
+          this.tableData = []
+          this.total = 0
+          this.loading = false
+      })
+    },
+    //切换分页
+    handleCurrentChange(val){
+        this.queryParams.current = val
+        this.getList()
+    },
+    //切换也大小
+    changeSize(val){
+        this.queryParams.current = 1
+        this.queryParams.size = 10
+        this.getList()
+    },
+
+    //排序
+    sortChange({ column, prop, order }){},
+    /** 新增按钮操作 */
+
+    handleAdd(row) {
+      this.$router.push({
+        path:'/administrator/addVersion'
+      });
+    },
+
+    handleEdit(row) {
+      this.$router.push({ 
+        path: '/administrator/editVersion', 
+        query: {
+            id: row.id
+        }
+      });
+    },
+    //删除
+    handleDelete(row){
+      this.removeVersions([row.id])
+    },
+    dels(){
+      this.removeVersions(this.checkList)
+    },
+    //删除
+    removeVersions(ids){
+      this.$confirm('确认删除选择的数据吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.loading = true
+        this.$api.removeVersions(ids).then(response => {
+          this.$message.success('删除成功')
+          this.loading = false
+          this.getList()
+        }).catch(error => {
+          this.loading = false
+        })
+      })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      for(let key in searchForm){
+        this.$set(this.queryParams,key,'')
+      }
+      this.handleQuery();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.header{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+</style>

+ 21 - 0
src/views/backStageManage/organization/personnel/index.vue

@@ -0,0 +1,21 @@
+<template>
+  <div></div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {},
+  data() {
+    return {
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {},
+};
+</script>
+<style lang="scss" scoped>
+</style>