Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Aug 27, 2024
1 parent c92c082 commit a58eeb2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
4 changes: 3 additions & 1 deletion src/pages/projects/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<v-chip pill prepend-icon="mdi-clock">{{ project.time }}</v-chip>
</div>
<div class="px-4 d-flex ga-2 mb-2">
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 1 || project.state == 2">开源作品</v-chip>
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'public'">开源作品</v-chip>
<v-chip pill prepend-icon="mdi-xml" v-if="project.state == 'private'">私密作品</v-chip>

<v-chip pill prepend-icon="mdi-application">{{ project.type }}</v-chip>
</div>
<div class="px-4">
Expand Down
6 changes: 2 additions & 4 deletions src/pages/projects/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export default {
data() {
return {
searchstates: [
{ state: "所有", abbr: "" },
{ state: "开源", abbr: 1 },
{ state: "被精选", abbr: 2 },
{ state: "所有", abbr: "public" },
],
typeitems: [
{ name: "所有", type: "" },
Expand All @@ -73,7 +71,7 @@ export default {
order: "view_up",
authorid: "",
type: "",
state: "",
state: "public",
},
};
},
Expand Down
28 changes: 9 additions & 19 deletions src/pages/projects/my.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ export default {
data() {
return {
projectstates: [
{ state: '私密', abbr: 0 },
{ state: '开源', abbr: 1 },
{ state: '被精选', abbr: 2 },
{ state: '私密', abbr: 'private' },
{ state: '开源', abbr: 'public' },
],
searchstates: [
{ state: '所有', abbr: '' },
{ state: '私密', abbr: 0 },
{ state: '开源', abbr: 1 },
{ state: '被精选', abbr: 2 },
{ state: '私密', abbr: 'private' },
{ state: '开源', abbr: 'public' },
],
typeitems: [
{ name: "所有", type: "" },
Expand Down Expand Up @@ -140,7 +139,7 @@ export default {
authorid: "",
type: "",
state: ''
state: 'private'
},
userinfo: localuser.user,
};
Expand Down Expand Up @@ -262,7 +261,7 @@ export default {
}
if (this.nowProject.state !== this.oldProject.state) {
if (this.nowProject.state == 1) {
if (this.nowProject.state == 'public') {
console.log('修改作品状态为公开')
request({
Expand All @@ -279,8 +278,8 @@ export default {
this.addtoast('修改失败')
})
}
if (this.nowProject.state == 0) {
console.log('修改作品状态为公开')
if (this.nowProject.state == 'private') {
console.log('修改作品状态为私密')
request({
url: "/project/noshare",
Expand All @@ -297,15 +296,6 @@ export default {
})
}
if (this.nowProject.state == 2) {
this.$toast.add
({
severity: "error",
summary: "错误",
detail: "好好好自己精选作品是吧",
life: 3000,
});
}
}
},
Expand Down

0 comments on commit a58eeb2

Please sign in to comment.