Browse Source

Merge branch 'ETA_1.0.1'

hbchen 1 year ago
parent
commit
047778f3c7

+ 37 - 0
src/api/modules/etaBaseConfigApi.js

@@ -7,4 +7,41 @@ export const etaBaseConfigInterence = {
     saveBaseConfig:params=>{
         return http.post('/business_conf/save',params)
     }
+}
+
+// 外部链接配置 接口
+export const outlinkConfigInterence = {
+    /**
+     * 外部链接列表
+     * @param params.CurrentIndex 页码-number
+     * @param params.PageSize 每页数据量-number
+     * @param params.SortParam 排序字段-string
+     * @param params.SortType 排序类型-string desc/asc/""
+     * @returns 
+     */
+    getOutlinkList:params=>{
+        return http.get('/out_link/list',params)
+    },
+    // 外部链接列表全部
+    getOutlinkListAll:params=>{
+        return http.get('/out_link/all',params)
+    },
+    /** 
+     * 新增/编辑
+     * @param params.Id Id-number-不传ID表示新增,传了ID表示编辑
+     * @param params.Title 菜单名称-string
+     * @param params.Url 页面链接-string
+     * @returns 
+     */
+    outlinkSave:params=>{
+        return http.post('/out_link/save',params)
+    },
+    /** 
+     * 删除
+     * @param params.Id Id-number
+     * @returns 
+     */
+    outlinkDelete:params=>{
+        return http.post('/out_link/del',params)
+    }
 }

BIN
src/assets/img/eta_base_config/outlink.png


+ 22 - 0
src/routes/modules/oldRoutes.js

@@ -300,6 +300,28 @@ export default [
         name: "基本配置",
         hidden: true,
       },
+      {
+        path: "outlinkListConfig",
+        component: () => import("@/views/system_manage/outlinkListConfig.vue"),
+        name: "外部链接配置",
+        hidden: true,
+      },
     ],
   },
+  // 外部链接
+  {    
+    path: "/",
+    component: home,
+    name: "外部链接",
+    hidden: false,
+    icon_path: require("@/assets/img/home/set_ico.png"),
+    children: [
+      {
+        path: "outlinkList",
+        component: () => import("@/views/system_manage/outlinkList.vue"),
+        name: "外部链接",
+        hidden: true,
+      },
+    ]
+  }
 ];

+ 8 - 0
src/utils/buttonConfig.js

@@ -454,4 +454,12 @@ export const baseConfigPermission = {
     etaBaseConfig_watermark:'etaBaseConfig:watermark',
     etaBaseConfig_watermark_ybChart:'etaBaseConfig:watermark:ybChart',//如果没权限,表单不显示也不校验
 
+}
+
+/*-----------外部链接配置-------- */
+export const outlinkConfigPermission = {
+    outlinkListConfig_list:'outlinkListConfig:list',//查看列表
+    outlinkListConfig_add:'outlinkListConfig:add',//添加
+    outlinkListConfig_edit:'outlinkListConfig:edit',//编辑
+    outlinkListConfig_del:'outlinkListConfig:del',//删除
 }

+ 125 - 0
src/views/system_manage/outlinkList.vue

@@ -0,0 +1,125 @@
+<template>
+  <div id="out-link-list" class="out-link-list">
+    <div v-if="outlinkData && outlinkData.length>0" class="outlink-box">
+      <div class="outlink-item" v-for="item in outlinkData" :key="item.Id" @click="gotoOutlink(item)">
+        <img src="~@/assets/img/eta_base_config/outlink.png">
+        <div class="outlink-item-text-zone">
+          <span>{{ item.Title }}</span>
+          <span>{{ item.Url }}</span>
+        </div>
+      </div>
+    </div>
+    <div class="no-outlink" v-else>
+      <img src="~@/assets/img/data_m/nodata.png"/>
+      <span>暂无数据</span>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import {outlinkConfigInterence} from "@/api/modules/etaBaseConfigApi.js"
+  export default {
+    name:"outlinkList",
+    data() {
+      return {
+        outlinkData:[]
+      }
+    },
+    created(){
+      this.getOutlinkData()
+    },
+    methods: {
+      getOutlinkData(){
+        outlinkConfigInterence.getOutlinkListAll().then(res=>{
+          if(res.Ret == 200){
+            this.outlinkData = res.Data.List || []
+            // console.log(this.outlinkData);
+          }
+        })
+      },
+      gotoOutlink(item){
+        window.open(item.Url, '_blank')
+      }
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .out-link-list{
+    min-height: calc(100vh - 110px);
+    height:calc(100vh - 110px);
+    background-color: white;
+    border: solid 1px #DCDFE6;
+    box-sizing: border-box;
+    padding: 30px;
+    .outlink-box{
+      display: flex;
+      flex-wrap: wrap;
+      align-items: center;
+      justify-content: flex-start;
+      margin-right: -30px;
+      .outlink-item{
+        display: flex;
+        align-items: flex-start;
+        height: 100px;
+        width: 250px;
+        border-radius: 8px;
+        box-sizing: border-box;
+        padding: 30px 40px 30px 13px;
+        border: solid 2px #0052D9;
+        cursor: pointer;
+        margin: 0 30px 30px 0;
+        background-color: #F2F3FF;
+        img{
+          height: 55px;
+          margin-top: -6px;
+          width: 55px;
+        }
+        .outlink-item-text-zone{
+          overflow: hidden;
+          text-overflow: ellipsis;
+          span{
+            font-size: 16px;
+            font-weight: bold;
+            color: #333;
+            white-space: nowrap;
+            &:last-child{
+              font-size: 12px;
+              color: #999999;
+              font-weight: 400;
+              display: block;
+              margin-top: 4px;
+            }
+          }
+        }
+        &:hover{
+          background-color: #0052D9;
+          .outlink-item-text-zone{
+            span{
+              color: #ffffff;
+              &:last-child{
+                color: rgba($color: #ffffff, $alpha: 0.65);
+              }
+            }
+          }
+        }
+      }
+    }
+    .no-outlink{
+      margin: 70px auto;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: center;
+      width: 260px;
+      img{
+        width: 260px;
+      }
+      span{
+       font-size: 16px;
+       color: #999999; 
+      }
+    }
+  }
+</style>

+ 194 - 0
src/views/system_manage/outlinkListConfig.vue

@@ -0,0 +1,194 @@
+<template>
+  <div id="outlink-list-config" class="outlink-list-config">
+    <div class="outlink-top-button-zone">
+      <el-button type="primary" @click="addOutlink" 
+      v-permission="permissionBtn.outlinkConfigPermission.outlinkListConfig_add">添加菜单</el-button>
+    </div>
+    <el-table :data="outlinkData" border @sort-change="sortChange">
+      <el-table-column label="菜单名称" prop="Title" align="center">
+        <template slot-scope="{ row }">
+          {{ row.Title }}
+        </template>
+      </el-table-column>
+      <el-table-column label="页面链接" prop="Url" align="center">
+        <template slot-scope="{ row }">
+          {{ row.Url }}
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" prop="CreateTime" align="center" sortable >
+        <template slot-scope="{ row }">
+          {{ row.CreateTime }}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center">
+        <template slot-scope="{ row }">
+          <span class="table-button" @click="editOutlink(row)" 
+          v-permission="permissionBtn.outlinkConfigPermission.outlinkListConfig_edit">编辑</span>
+          <span class="table-button" style="color: #C54322;" @click="deleteOutlink(row)"
+          v-permission="permissionBtn.outlinkConfigPermission.outlinkListConfig_del">删除</span>
+        </template>
+      </el-table-column>
+      <div slot="empty" style="line-height: 44px; margin: 60px 0; color: #999">
+        <tableNoData text="暂无数据" size="mini"/>
+      </div>
+    </el-table>
+    <m-page
+      :page_no="queryParams.CurrentIndex"
+      :pageSize="queryParams.PageSize"
+      :total="total"
+      @handleCurrentChange="pageChange"
+      style="margin-top: 20px;"
+    />
+    <el-dialog 
+    :append-to-body="true" 
+    :visible.sync="addOutlinkShow" 
+    width="600px" 
+    :title="dialogTitle"
+    :close-on-click-modal="false"
+    center @close="resetForm">
+      <div class="form-box">
+        <el-form
+        :model="outlinkForm"
+        ref="outlinkFormRef"
+        label-width="90px">
+          <el-form-item prop="Title" label="菜单名称" :rules="{required:true,message:'菜单名称不能为空',trigger:'blur'}">
+              <el-input v-model="outlinkForm.Title" placeholder="请输入菜单名称" style="width: 295px;"></el-input>
+          </el-form-item>
+          <el-form-item prop="Url" label="页面链接" :rules="{required:true,message:'URL不能为空',trigger:'blur'}">
+              <el-input v-model="outlinkForm.Url" placeholder="请输入URL" style="width: 295px;"></el-input>
+          </el-form-item>
+          <div class="form-box-buttons-zone">
+            <el-button style="width: 120px;height: 40px;" @click="addOutlinkShow=false">取消</el-button>
+            <el-button type="primary" @click="addOutlinkSave" style="margin-left:30px;width: 120px;height: 40px;">确定</el-button>
+          </div>
+        </el-form>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {outlinkConfigInterence} from "@/api/modules/etaBaseConfigApi.js"
+import mPage from '@/components/mPage.vue';
+
+  export default {
+    name:"outlinkListConfig",
+    components:{mPage},
+    data() {
+      return {
+        outlinkData:[],
+        queryParams:{
+          CurrentIndex:1,
+          PageSize:10,
+          SortParam:'create_time',
+          SortType:''
+        },
+        total:0,
+        dialogTitle:"",
+        addOutlinkShow:false,
+        outlinkForm:{
+          Title:"",
+          Url:""
+        }
+      }
+    },
+    created(){
+      this.getOutlinkData()
+    },
+    methods: {
+      getOutlinkData(){
+        if(!this.permissionBtn.checkPermissionBtn(this.permissionBtn.outlinkConfigPermission.outlinkListConfig_list)) return 
+        outlinkConfigInterence.getOutlinkList(this.queryParams).then(res=>{
+          if(res.Ret == 200){
+            this.outlinkData = res.Data.List || []
+            this.total =res.Data.Paging?res.Data.Paging.Totals || 0:0
+          }
+        })
+      },
+      pageChange(page_no){
+        this.queryParams.CurrentIndex=page_no
+        this.getOutlinkData()
+      },
+      sortChange({ prop,order }){
+        // console.log(prop,order);
+        this.queryParams.SortType = order?order=="descending"?"desc":"asc":""
+        this.getOutlinkData()
+      },
+      addOutlink(){
+        this.dialogTitle="添加菜单"
+        this.addOutlinkShow=true
+      },
+      editOutlink(item){
+        this.outlinkForm=item
+        this.dialogTitle="编辑菜单"
+        this.addOutlinkShow=true
+      },
+      resetForm(){
+        this.outlinkForm={
+          Title:"",
+          Url:""
+        }
+        this.$refs.outlinkFormRef.clearValidate()
+      },
+      addOutlinkSave(){
+        this.$refs.outlinkFormRef.validate((valid)=>{
+          if(valid){
+            outlinkConfigInterence.outlinkSave(this.outlinkForm).then(res=>{
+              if(res.Ret == 200){
+                this.$message.success(`${this.dialogTitle}成功`)
+                this.addOutlinkShow=false
+                this.getOutlinkData()
+              }
+            })
+          }
+        })
+      },
+      deleteOutlink(item){
+        this.$confirm("删除后不可恢复,确认删除吗?", "提示", {
+          type: "warning"
+        }).then(() => {
+          outlinkConfigInterence.outlinkDelete({Id:item.Id}).then(res=>{
+            if(res.Ret == 200){
+              this.$message.success("删除菜单成功")
+              this.getOutlinkData()
+            }
+          })
+        }).catch(() => {});
+      }
+    },
+  }
+</script>
+
+<style lang="scss" scoped>
+  .outlink-list-config{
+    min-height: calc(100vh - 110px);
+    height:calc(100vh - 110px);
+    background-color: white;
+    border: solid 1px #DCDFE6;
+    box-sizing: border-box;
+    padding: 30px;
+    .outlink-top-button-zone{
+      margin-bottom: 30px;
+    }
+    .table-button{
+      font-size: 14px;
+      cursor: pointer;
+      color: #0052D9;
+      margin-right: 8px;
+      &:last-child{
+        margin-right: 0;
+      }
+    }
+  }
+  .form-box{
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding-top: 30px;
+      .form-box-buttons-zone{
+        text-align:center;
+        margin-bottom:35px;
+        margin-top:120px;
+      }
+    }
+</style>