Browse Source

feat;

回收站
 停止发布
old
wangqing 4 years ago
parent
commit
9be3483b4f
  1. 5
      src/router/modules/root.js
  2. 11
      src/views/form/publish.vue
  3. 2
      src/views/form/write.vue
  4. 4
      src/views/home/HomButton.vue
  5. 2
      src/views/home/dashboard.vue
  6. 33
      src/views/project/MyProject.vue
  7. 148
      src/views/project/RecycleBin.vue

5
src/router/modules/root.js

@ -82,6 +82,11 @@ export default [
meta: {requireLogin: true},
component: () => import(/* webpackChunkName: 'root' */ '@/views/project/MyProject.vue')
},
{
path: 'recycle',
meta: {requireLogin: true},
component: () => import(/* webpackChunkName: 'root' */ '@/views/project/RecycleBin.vue')
},
{
path: 'template/preview',
meta: {requireLogin: true},

11
src/views/form/publish.vue

@ -32,6 +32,7 @@
</el-col>
<el-col :span="6" >
<el-button
@click="stopPublishProject"
type="danger">停止发布
</el-button>
</el-col>
@ -90,6 +91,8 @@ export default {
this.$api.get(`/user/project/${this.projectKey}`).then(res => {
if (res.data.status == 2) {
this.publishStatus = true
}else{
this.publishStatus = false
}
})
},
@ -99,6 +102,14 @@ export default {
this.msgSuccess('发布成功')
})
},
stopPublishProject() {
this.$api.post('/user/project/stop', {'key': this.projectKey}).then(res => {
if (res.data) {
this.msgSuccess('停止成功')
this.getProjectStatus()
}
})
},
qrCodeGenSuccess(dataUrl, id) {
this.qrCodeUrl = dataUrl
},

2
src/views/form/write.vue

@ -105,7 +105,7 @@ export default {
},
queryProjectSettingStatus() {
//
this.$api.get(`/user/project/setting/status`, {params: {projectKey: this.projectConfig.projectKey}}).then(res => {
this.$api.get(`/user/project/setting-status`, {params: {projectKey: this.projectConfig.projectKey}}).then(res => {
if (res.msg) {
this.writeNotStartPrompt = res.msg
this.writeStatus = 0

4
src/views/home/HomButton.vue

@ -16,7 +16,9 @@
</el-button>
</el-col>
<el-col :span="5">
<el-button class="home-fun-btn">回收站<i class="el-icon-delete-solid" /></el-button>
<el-button class="home-fun-btn" @click="$router.push({path:'/project/recycle'})">
回收站<i class="el-icon-delete-solid" />
</el-button>
</el-col>
</el-row>
</template>

2
src/views/home/dashboard.vue

@ -140,7 +140,7 @@ export default {
created() {
this.$api.get('/user/project/list', {params: {status: 2}}).then(res => {
this.projectListData = res.data
if (res.data) {
if (res.data && res.data[0]) {
this.activeProjectKey = res.data[0].key
this.projectChangeHandle()
}

33
src/views/project/MyProject.vue

@ -48,7 +48,7 @@
<!-- <font-icon class="fas fa-plus-square" />-->
<!-- 新建文件夹-->
<!-- </el-button>-->
<el-button style="margin-left: 10px;">
<el-button style="margin-left: 10px;" @click="$router.push({path:'/project/recycle'})">
<font-icon class="fas fa-recycle" />
回收站
</el-button>
@ -97,13 +97,40 @@
<i class="el-icon-edit" />
编辑
</el-button>
<span>
<el-button
v-if="p.status!=1"
type="text" @click="toProjectHandle(p.key,5)"
v-if="p.status!=1" type="text" @click="toProjectHandle(p.key,5)"
>
<i class="el-icon-data-analysis" />
统计
</el-button>
</span>
<el-popconfirm
v-if="p.status==2"
title="确定停止收集该项目吗?"
@confirm="stopProject(p.key)"
>
<el-button slot="reference"
class="pink-text-btn"
type="text"
>
<i class="el-icon-video-pause" />
停止
</el-button>
</el-popconfirm>
<el-popconfirm
v-if="p.status==3"
title="确定删除该项目吗?"
@confirm="deleteProject(p.key)"
>
<el-button slot="reference"
class="pink-text-btn"
type="text"
>
<i class="el-icon-delete" />
删除
</el-button>
</el-popconfirm>
</div>
</div>
</div>

148
src/views/project/RecycleBin.vue

@ -0,0 +1,148 @@
<template>
<div class="rc-bin-container">
<div class="back-view">
<el-button size="mini" round @click="$router.back(-1)">
<i class="el-icon-arrow-left" />
返回
</el-button>
</div>
<el-table
:data="projectList"
stripe
border
highlight-current-row
style="width: 100%;"
empty-text="暂无数据"
>
<el-table-column
prop="name"
show-overflow-tooltip
align="center"
label="标题"
/>
<el-table-column
prop="resultCount"
align="center"
label="收集数"
/>
<el-table-column
align="center"
prop="createTime"
label="创建时间"
/>
<el-table-column
align="center"
prop="updateTime"
label="删除时间"
/>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text"
@click="restoreProject(scope.row.key,1)"
>
恢复
</el-button>
<el-popconfirm
title="确定删除该项目吗?"
@confirm="deleteProject(scope.row.key)"
>
<el-button slot="reference"
class="pink-text-btn"
type="text"
>
删除
</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<div class="project-page-view">
<el-pagination
v-if="total>10"
background
:page-size.sync="queryParams.size"
:current-page.sync="queryParams.current"
layout="total, prev, pager, next"
:total="total"
@current-change="queryRecycleProjectPage"
/>
</div>
</div>
</template>
<script>
export default {
name: 'RecycleBin',
data() {
return {
total: 0,
queryParams: {
current: 1,
size: 10,
name: '',
beginDateTime: null,
endDateTime: null,
status: null
},
projectList: [],
projectListLoading: true
}
},
computed: {
},
created() {
this.queryRecycleProjectPage()
},
methods: {
restoreProject(key) {
this.$api.post('/user/project/recycle/restore', {'key': key}).then(res => {
if (res.data) {
this.msgSuccess('恢复成功')
this.queryRecycleProjectPage()
}
})
},
deleteProject(key) {
this.$api.post('/user/project/recycle/delete', {'key': key}).then(res => {
if (res.data) {
this.msgSuccess('刪除成功')
this.queryRecycleProjectPage()
}
})
},
queryRecycleProjectPage() {
this.$api.get('/user/project/recycle/page', {
params: this.queryParams
}).then(res => {
let {records, total, size} = res.data
this.projectList = records
this.total = total
this.queryParams.size = size
this.projectListLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.rc-bin-container {
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
align-items: center;
align-content: center;
}
.back-view {
display: flex;
width: 80%;
align-content: flex-start;
margin: 10px;
}
.project-page-view {
margin-top: 30px;
}
</style>
Loading…
Cancel
Save