修改新闻管理bug
This commit is contained in:
parent
3837e277dd
commit
d5bcee7296
@ -46,7 +46,7 @@
|
|||||||
>新增</el-button
|
>新增</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@ -56,7 +56,7 @@
|
|||||||
v-hasPermi="['benyi:news:edit']"
|
v-hasPermi="['benyi:news:edit']"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@ -88,7 +88,6 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column label="标题" align="center" prop="title" />
|
<el-table-column label="标题" align="center" prop="title" />
|
||||||
<el-table-column label="摘要" align="center" prop="abstractcontent" />
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="类型"
|
label="类型"
|
||||||
align="center"
|
align="center"
|
||||||
@ -130,6 +129,7 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['benyi:news:edit']"
|
v-hasPermi="['benyi:news:edit']"
|
||||||
|
v-show="isShow(scope.row)"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
<!-- 添加或修改新闻中心对话框 -->
|
<!-- 添加或修改新闻中心对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="1024px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="1024px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.title"
|
v-model="form.title"
|
||||||
@ -162,13 +162,6 @@
|
|||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="摘要" prop="abstractcontent">
|
|
||||||
<el-input
|
|
||||||
v-model="form.abstractcontent"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请输入内容"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="类型">
|
<!-- <el-form-item label="类型">
|
||||||
<el-select v-model="form.type" placeholder="请选择类型">
|
<el-select v-model="form.type" placeholder="请选择类型">
|
||||||
<el-option
|
<el-option
|
||||||
@ -212,6 +205,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@ -260,7 +254,14 @@ export default {
|
|||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {
|
||||||
|
title: [
|
||||||
|
{ required: true, message: "标题不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
content: [
|
||||||
|
{ required: true, message: "内容不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -276,11 +277,18 @@ export default {
|
|||||||
this.getDicts("sys_yes_no").then((response) => {
|
this.getDicts("sys_yes_no").then((response) => {
|
||||||
this.istopOptions = response.data;
|
this.istopOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("sys_yes_no").then((response) => {
|
this.getDicts("sys_dm_ischeck").then((response) => {
|
||||||
this.ischeckOptions = response.data;
|
this.ischeckOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isShow(row) {
|
||||||
|
if (row.ischeck == "1") {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 查询新闻中心列表 */
|
/** 查询新闻中心列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="编号" align="center" prop="id" />
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
<el-table-column label="标题" align="center" prop="title" />
|
<el-table-column label="标题" align="center" prop="title" />
|
||||||
<el-table-column label="摘要" align="center" prop="abstractcontent" />
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="类型"
|
label="类型"
|
||||||
align="center"
|
align="center"
|
||||||
@ -88,12 +87,6 @@
|
|||||||
<div v-html="scope.row.content"></div>
|
<div v-html="scope.row.content"></div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
|
||||||
label="创建人"
|
|
||||||
align="center"
|
|
||||||
prop="createuserid"
|
|
||||||
:formatter="userFormat"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="所属学校"
|
label="所属学校"
|
||||||
align="center"
|
align="center"
|
||||||
@ -101,7 +94,7 @@
|
|||||||
:formatter="deptFormat"
|
:formatter="deptFormat"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="是否审核"
|
label="审核状态"
|
||||||
align="center"
|
align="center"
|
||||||
prop="ischeck"
|
prop="ischeck"
|
||||||
:formatter="ischeckFormat"
|
:formatter="ischeckFormat"
|
||||||
@ -158,41 +151,26 @@
|
|||||||
width="1024px"
|
width="1024px"
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="标题" prop="title">
|
<el-form-item label="标题" prop="title">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.title"
|
v-model="form.title"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
:disabled="true"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="摘要" prop="abstractcontent">
|
|
||||||
<el-input
|
|
||||||
v-model="form.abstractcontent"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请输入内容"
|
|
||||||
:disabled="true"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="类型">
|
|
||||||
<el-select v-model="form.type" placeholder="请选择类型">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in typeOptions"
|
|
||||||
:key="dict.dictValue"
|
|
||||||
:label="dict.dictLabel"
|
|
||||||
:value="dict.dictValue"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item label="内容" prop="content" >
|
<el-form-item label="内容" prop="content" >
|
||||||
<Editor v-model="form.content" placeholder="请输入内容" />
|
<Editor v-model="form.content" placeholder="请输入内容" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否审批通过" prop="ischeck">
|
<el-form-item label="审核状态" prop="ischeck">
|
||||||
<el-radio-group v-model="form.ischeck">
|
<el-select v-model="form.ischeck" placeholder="请选择审核状态">
|
||||||
<el-radio label="Y">是</el-radio>
|
<el-option
|
||||||
<el-radio label="N">否</el-radio>
|
v-for="dict in ischeckOptions"
|
||||||
</el-radio-group>
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -215,7 +193,7 @@ import {
|
|||||||
|
|
||||||
import Editor from "@/components/Editor";
|
import Editor from "@/components/Editor";
|
||||||
import { listDept, getDept } from "@/api/system/dept";
|
import { listDept, getDept } from "@/api/system/dept";
|
||||||
import { listUser, getUser } from "@/api/system/user";
|
// import { listUser, getUser } from "@/api/system/user";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "News",
|
name: "News",
|
||||||
@ -265,7 +243,7 @@ export default {
|
|||||||
createuserid: undefined,
|
createuserid: undefined,
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
istop: undefined,
|
istop: undefined,
|
||||||
ischeck: "N",
|
ischeck: "0",
|
||||||
checkuserid: undefined,
|
checkuserid: undefined,
|
||||||
checkTime: undefined,
|
checkTime: undefined,
|
||||||
},
|
},
|
||||||
@ -276,13 +254,18 @@ export default {
|
|||||||
ischeck: [
|
ischeck: [
|
||||||
{ required: true, message: "审批意见不能为空", trigger: "blur" },
|
{ required: true, message: "审批意见不能为空", trigger: "blur" },
|
||||||
],
|
],
|
||||||
|
title: [
|
||||||
|
{ required: true, message: "标题不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
content: [
|
||||||
|
{ required: true, message: "内容不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getDeptList();
|
this.getDeptList();
|
||||||
this.getUserList();
|
|
||||||
this.getDicts("sys_dm_newstype").then((response) => {
|
this.getDicts("sys_dm_newstype").then((response) => {
|
||||||
this.typeOptions = response.data;
|
this.typeOptions = response.data;
|
||||||
});
|
});
|
||||||
@ -292,7 +275,7 @@ export default {
|
|||||||
this.getDicts("sys_yes_no").then((response) => {
|
this.getDicts("sys_yes_no").then((response) => {
|
||||||
this.istopOptions = response.data;
|
this.istopOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("sys_yes_no").then((response) => {
|
this.getDicts("sys_dm_ischeck").then((response) => {
|
||||||
this.ischeckOptions = response.data;
|
this.ischeckOptions = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -313,11 +296,11 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 用户列表
|
// 用户列表
|
||||||
getUserList() {
|
// getUserList() {
|
||||||
listUser(null).then((response) => {
|
// listUser(null).then((response) => {
|
||||||
this.userOptions = response.rows;
|
// this.userOptions = response.rows;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
// 字典翻译
|
// 字典翻译
|
||||||
deptFormat(row, column) {
|
deptFormat(row, column) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
@ -331,18 +314,18 @@ export default {
|
|||||||
return actions.join("");
|
return actions.join("");
|
||||||
},
|
},
|
||||||
// 字典翻译
|
// 字典翻译
|
||||||
userFormat(row, column) {
|
// userFormat(row, column) {
|
||||||
// return this.selectDictLabel(this.classOptions, row.classid);
|
// // return this.selectDictLabel(this.classOptions, row.classid);
|
||||||
var actions = [];
|
// var actions = [];
|
||||||
var datas = this.userOptions;
|
// var datas = this.userOptions;
|
||||||
Object.keys(datas).map((key) => {
|
// Object.keys(datas).map((key) => {
|
||||||
if (datas[key].userId == "" + row.createuserid) {
|
// if (datas[key].userId == "" + row.createuserid) {
|
||||||
actions.push(datas[key].nickName);
|
// actions.push(datas[key].nickName);
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
return actions.join("");
|
// return actions.join("");
|
||||||
},
|
// },
|
||||||
// 类型字典翻译
|
// 类型字典翻译
|
||||||
typeFormat(row, column) {
|
typeFormat(row, column) {
|
||||||
return this.selectDictLabel(this.typeOptions, row.type);
|
return this.selectDictLabel(this.typeOptions, row.type);
|
||||||
@ -416,8 +399,6 @@ export default {
|
|||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != undefined) {
|
if (this.form.id != undefined) {
|
||||||
var now = new Date();
|
|
||||||
this.form.checkTime = now.toLocaleDateString();
|
|
||||||
updateNews(this.form).then((response) => {
|
updateNews(this.form).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.msgSuccess("审批成功");
|
this.msgSuccess("审批成功");
|
||||||
|
@ -35,8 +35,6 @@ import com.ruoyi.framework.web.page.TableDataInfo;
|
|||||||
public class BySchoolNewsController extends BaseController {
|
public class BySchoolNewsController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBySchoolNewsService bySchoolNewsService;
|
private IBySchoolNewsService bySchoolNewsService;
|
||||||
@Autowired
|
|
||||||
private SchoolCommon schoolCommon;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新闻中心列表
|
* 查询新闻中心列表
|
||||||
@ -91,7 +89,14 @@ public class BySchoolNewsController extends BaseController {
|
|||||||
@Log(title = "新闻中心", businessType = BusinessType.UPDATE)
|
@Log(title = "新闻中心", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody BySchoolNews bySchoolNews) {
|
public AjaxResult edit(@RequestBody BySchoolNews bySchoolNews) {
|
||||||
return toAjax(bySchoolNewsService.updateBySchoolNews(bySchoolNews));
|
if (bySchoolNews.getIscheck().equals("0")) {
|
||||||
|
return toAjax(bySchoolNewsService.updateBySchoolNews(bySchoolNews));
|
||||||
|
}else {
|
||||||
|
bySchoolNews.setCheckTime(new Date());
|
||||||
|
return toAjax(bySchoolNewsService.updateBySchoolNews(bySchoolNews));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user