|
@@ -2,7 +2,7 @@
|
|
|
<template>
|
|
|
<el-card :class="{'box-card': true, 'active': data.checked}" shadow="hover" :body-style="{ padding: '0px' }">
|
|
|
<img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+data.pic" class="image">
|
|
|
- <div class="shadow image">
|
|
|
+ <div class="shadow image" v-if="!isRecycle" @click="toEdit">
|
|
|
<el-checkbox v-model="data.checked" class="shadowCheck" @change="changeCheck"></el-checkbox>
|
|
|
</div>
|
|
|
<div class="content">
|
|
@@ -21,7 +21,7 @@
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<template v-for="t in moreList">
|
|
|
- <el-dropdown-item :key="t.name" :command="t.name" v-if="t.show=='any' || t.show == data.pub">{{t.label}}</el-dropdown-item>
|
|
|
+ <el-dropdown-item :key="t.name" :command="t.name" v-if="dropdownItemShow(t, data)">{{t.label}}</el-dropdown-item>
|
|
|
</template>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
@@ -42,22 +42,32 @@ export default {
|
|
|
default: () => {
|
|
|
return {}
|
|
|
}
|
|
|
+ },
|
|
|
+ isRecycle: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
moreList: [
|
|
|
- { name: 'rename', label: '重命名', show: 'any' },
|
|
|
- { name: 'publish', label: '发布', show: false }, // 类型为未发布时出现
|
|
|
- { name: 'download', label: '下载', show: true }, // 类型为发布时出现
|
|
|
- { name: 'editTag', label: '修改标签', show: true }, // 类型为发布时出现
|
|
|
- { name: 'moveTo', label: '移动到', show: 'any' },
|
|
|
- { name: 'delete', label: '删除', show:'any' },
|
|
|
+ { name: 'rename', label: '重命名', show: 'any' }, // 类型为 未发布/已发布 时出现
|
|
|
+ { name: 'publish', label: '发布', show: false }, // 类型为 未发布 时出现
|
|
|
+ { name: 'download', label: '下载', show: true }, // 类型为 已发布 时出现
|
|
|
+ { name: 'editTag', label: '修改标签', show: true }, // 类型为 已发布 时出现
|
|
|
+ { name: 'moveTo', label: '移动到', show: 'any' }, // 类型为 未发布/已发布 时出现
|
|
|
+ { name: 'delete', label: '删除', show: 'any' }, // 类型为 未发布/已发布 时出现
|
|
|
+ { name: 'recover', label: '恢复', show: 'isRecycle' }, // 类型为 回收站 时出现
|
|
|
+ { name: 'deleteRecycle', label: '永久删除', show: 'isRecycle' }, // 类型为 回收站 时出现
|
|
|
],
|
|
|
checked: false
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 显示下拉框内容选项判断
|
|
|
+ dropdownItemShow(item, data) {
|
|
|
+ return (!this.isRecycle && (item.show == 'any' || item.show == data.pub)) || (this.isRecycle && item.show == "isRecycle")
|
|
|
+ },
|
|
|
// 复选框改变时
|
|
|
changeCheck() {
|
|
|
this.$emit('changeCheck', this.data);
|
|
@@ -68,12 +78,14 @@ export default {
|
|
|
graphId: this.data.graphId,
|
|
|
id: this.data.id
|
|
|
};
|
|
|
- switch(command){
|
|
|
+ switch (command) {
|
|
|
case "rename":
|
|
|
case "download":
|
|
|
case "editTag":
|
|
|
case "moveTo":
|
|
|
case "delete":
|
|
|
+ case "recover":
|
|
|
+ case "deleteRecycle":
|
|
|
this.$emit(command, this.data)
|
|
|
break;
|
|
|
case "publish":
|
|
@@ -83,6 +95,11 @@ export default {
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
+ },
|
|
|
+ // 进入编辑页面
|
|
|
+ toEdit(){
|
|
|
+ console.log(123123);
|
|
|
+ alert(111)
|
|
|
}
|
|
|
},
|
|
|
};
|