提交 1ecb4e28 authored 作者: lihuihui's avatar lihuihui

update

上级 829b79dc
......@@ -28,7 +28,7 @@
</el-select>
</template>
<template v-slot:table-x="{ row }">
<el-button type="text" @click="handlePublish(row)">颁发证书</el-button>
<el-button type="text" @click="handlePublish(row)">{{ getCertText(row) }}</el-button>
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
......@@ -106,14 +106,18 @@ export default {
}
},
methods: {
// 办法证书
getCertText(row) {
return row.students.find(item => item.status === '1') ? '证书生成中' : '生成证书'
},
// 颁发证书
handlePublish(row) {
projectPublish({ id: row.id }).then(res => {
if (res.code === 0) {
this.$message({
message: '颁发成功',
message: '生成成功',
type: 'success'
})
this.$refs.list.refetch(true)
}
})
},
......@@ -138,6 +142,12 @@ export default {
this.$router.push({ path: '/project/update', query: { id: row.id } })
},
handleDelete(row) {
this.$confirm('此操作将永久删除该项目, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteProject({ id: row.id }).then(res => {
if (res.code === 0) {
this.$message({
......@@ -147,6 +157,8 @@ export default {
this.$refs.list.refetch(true)
}
})
})
.catch(() => {})
}
},
mounted() {
......
......@@ -20,7 +20,7 @@
<el-form-item label="关联学员">
<div class="select-btn" @click="drawer = true" style="margin-bottom: 10px">
<i class="el-icon-plus"></i>
<div class="text">选择图文</div>
<div class="text">选择学员</div>
</div>
<app-list v-bind="tableOptions" ref="list">
<template v-slot:table-x="{ row }">
......@@ -31,7 +31,7 @@
<el-form-item>
<div>
<el-button type="primary" @click="submitForm">确认</el-button>
<el-button @click="drawer = true" style="margin-left:20px;">取消</el-button>
<el-button @click="drawer = true" style="margin-left: 20px">取消</el-button>
</div>
</el-form-item>
</el-form>
......
......@@ -139,6 +139,12 @@ export default {
},
// 删除
handleDelete(row) {
this.$confirm('此操作将永久删除该学员, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteStudent({ id: row.id }).then(res => {
if (res.code === 0) {
this.$message({
......@@ -148,6 +154,8 @@ export default {
this.$refs.list.refetch(true)
}
})
})
.catch(() => {})
}
},
mounted() {
......
......@@ -187,6 +187,12 @@ export default {
this.$router.push({ path: '/template/update', query: { id: row.id } })
},
handleDelete(row) {
this.$confirm('此操作将永久删除该模板, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTemplate({ id: row.id }).then(res => {
if (res.code === 0) {
this.$message({
......@@ -196,6 +202,8 @@ export default {
this.$refs.list.refetch(true)
}
})
})
.catch(() => {})
},
handleView(row) {
getDetails({ id: row.id }).then(res => {
......
......@@ -169,6 +169,12 @@ export default {
},
// 删除
handleDelete(row) {
this.$confirm('此操作将永久删除该变量, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteVariable({ id: row.id }).then(res => {
if (res.code === 0) {
this.$message({
......@@ -178,6 +184,8 @@ export default {
this.$refs.list.refetch(true)
}
})
})
.catch(() => {})
}
}
}
......
......@@ -18,7 +18,7 @@ export default defineConfig({
target: 'https://cert-backend-api.ezijing.com',
// target: 'http://localhost-activity-backend.ezijing.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api\/cert/, '')
rewrite: path => path.replace(/^\/api\/certificate/, '')
},
'/api': 'https://project-api.ezijing.com'
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论