提交 0fa53bcd authored 作者: 林国禄's avatar 林国禄

更新指标

上级 33ef0f4d
import request from '@/utils/request'
// 是否发布项目
export function changeReleaseStatus(id) {
return request({
url: '/backstage/project/changeReleaseStatus/' + id,
method: 'put',
})
}
// 获取主题列表
export function getThemeList() {
return request({
......
......@@ -60,16 +60,27 @@
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="自增id" align="center" prop="id" />
<!-- <el-table-column label="自增id" align="center" prop="id" />-->
<el-table-column label="项目名称" align="center" prop="name" />
<el-table-column label="项目标题" align="center" prop="title" />
<el-table-column label="调查范围" align="center" prop="scope" />
<el-table-column label="提取码" align="center" prop="extractionCode" />
<el-table-column label="主题id合集,用逗号分隔 (已弃用)" align="center" prop="itemIds" />
<el-table-column label="是否发布数据 1已发布 0未发布" align="center" prop="isPublish" />
<el-table-column label="状态 1正常 0删除" align="center" prop="status" />
<el-table-column label="所选主题值" align="center" prop="itemSelectValue" />
<el-table-column label="所选区域值" align="center" prop="areaSelectValue" />
<el-table-column label="是否发布" align="center" prop="isPublish" >
<template scope="scope">
<el-switch
v-model="scope.row.isPublish"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
@change="changeReleaseStatus(scope.row)">
</el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="考核主题数量" align="center" prop="targetCount" >
<!-- <template scope="scope">-->
<!-- <el-button @click="getTargetListDetail(scope.row.id)" round type="success">{{scope.row.targetCount}}</el-button>-->
<!-- </template>-->
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -121,16 +132,34 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 考核主题列表 -->
<el-dialog :title="title" :visible.sync="themeListOpen" width="500px" append-to-body>
<el-table v-loading="themeListLoading" :data="themeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主题名称" align="center" prop="name" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="参与村数量" align="center" prop="" />
<el-table-column label="考核指标数量" align="center" prop="targetCount"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="repeatSubmit">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getThemeList, listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/backstage/project";
import { changeReleaseStatus, getThemeList, listProject, getProject, delProject, addProject, updateProject, exportProject } from "@/api/backstage/project";
export default {
name: "Project",
data() {
return {
themeListLoading: false,
themeListOpen: false,
themeList: [],//主题列表
themeSelectValueOptions: [],
// 不可重复提交
repeatSubmit: false,
......@@ -328,7 +357,30 @@ export default {
}).then(response => {
this.download(response.msg);
})
}
},
//改变发布状态
changeReleaseStatus(row){
let title = '';
if(row.isPublish == '0'){
title = '停止发布';
}else {
title = '发布';
}
this.$confirm('是否确认'+ title +'该项目?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() =>{
changeReleaseStatus(row.id).then(response => {
this.msgSuccess(title + "成功");
this.open = false;
this.getList();
});
}).catch(() => {
this.getList();
this.$message.error('取消操作')
})
},
}
};
</script>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论