|
@@ -83,7 +83,10 @@
|
|
|
<el-table-column label="操作" slot="cgInfos" align="center">
|
|
|
<template v-slot="scope">
|
|
|
<i
|
|
|
- v-if="activeName === '2' || activeName === '3'"
|
|
|
+ v-if="
|
|
|
+ (roleCode === '0' || roleCode === '1') &&
|
|
|
+ (activeName === '2' || activeName === '3')
|
|
|
+ "
|
|
|
@click="shareRow(scope.row)"
|
|
|
class="el-icon-share elIcon"
|
|
|
title="分享"
|
|
@@ -108,6 +111,7 @@
|
|
|
<script>
|
|
|
import searchLayout from "@/components/grid/searchLayout";
|
|
|
import tableList from "@/components/grid/TableList";
|
|
|
+import { mapState } from "vuex";
|
|
|
|
|
|
export default {
|
|
|
name: "algorithmsLibraryList", // 算法库列表
|
|
@@ -159,6 +163,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapState(["roleCode"]),
|
|
|
getDataWay() {
|
|
|
if (this.activeName === "2" || this.activeName === "3") {
|
|
|
// 私有
|
|
@@ -168,7 +173,10 @@ export default {
|
|
|
type: "post",
|
|
|
// firstRequest: false,
|
|
|
data: this.$api.algorithmsLibrary.selectAlgorithmList,
|
|
|
- param: this.activeName === "2"?{uploadMode: "1"}:{uploadMode: "2"},
|
|
|
+ param:
|
|
|
+ this.activeName === "2"
|
|
|
+ ? { uploadMode: "1" }
|
|
|
+ : { uploadMode: "2" },
|
|
|
};
|
|
|
} else {
|
|
|
// 公有
|
|
@@ -183,11 +191,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- created(){
|
|
|
- if(this.$route.query.activeName){
|
|
|
- this.activeName = this.$route.query.activeName
|
|
|
+ created() {
|
|
|
+ if (this.$route.query.activeName) {
|
|
|
+ this.activeName = this.$route.query.activeName;
|
|
|
}
|
|
|
- this.$route.query.activeName = '2'
|
|
|
+ this.$route.query.activeName = "2";
|
|
|
},
|
|
|
methods: {
|
|
|
doSearch() {
|
|
@@ -228,15 +236,15 @@ export default {
|
|
|
addOne() {
|
|
|
if (this.activeName === "2") {
|
|
|
// 私有导入
|
|
|
- this.$router.push({
|
|
|
+ this.$router.push({
|
|
|
path: "/exportAlgorithms",
|
|
|
- query: {activeName: this.activeName}
|
|
|
+ query: { activeName: this.activeName },
|
|
|
});
|
|
|
} else {
|
|
|
// 私有仓库
|
|
|
- this.$router.push({
|
|
|
+ this.$router.push({
|
|
|
path: "/gitAlgorithms",
|
|
|
- query: {activeName: this.activeName}
|
|
|
+ query: { activeName: this.activeName },
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -245,13 +253,21 @@ export default {
|
|
|
// 私有导入
|
|
|
this.$router.push({
|
|
|
path: "/exportAlgorithms",
|
|
|
- query: { id: row.id, share: row.share, activeName: this.activeName },
|
|
|
+ query: {
|
|
|
+ id: row.id,
|
|
|
+ share: row.share,
|
|
|
+ activeName: this.activeName,
|
|
|
+ },
|
|
|
});
|
|
|
} else {
|
|
|
// 私有仓库
|
|
|
this.$router.push({
|
|
|
path: "/gitAlgorithms",
|
|
|
- query: { id: row.id, share: row.share, activeName: this.activeName },
|
|
|
+ query: {
|
|
|
+ id: row.id,
|
|
|
+ share: row.share,
|
|
|
+ activeName: this.activeName,
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
},
|