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

update

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