|
|
@@ -118,6 +118,7 @@
|
|
|
|
|
|
<script setup name="Release">
|
|
|
import { listRelease, getRelease, delRelease, addRelease, updateRelease } from "@/api/basicData/release";
|
|
|
+import {likeQueryMethod} from "../../../utils/likeQueryMethod";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
@@ -136,7 +137,7 @@ const data = reactive({
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- title: null,
|
|
|
+ title: '',
|
|
|
specialColumn: null,
|
|
|
date: null,
|
|
|
content: null,
|
|
|
@@ -150,8 +151,9 @@ const { queryParams, form, rules } = toRefs(data);
|
|
|
/** 查询新闻发布列表 */
|
|
|
function getList() {
|
|
|
loading.value = true;
|
|
|
- listRelease(queryParams.value).then(response => {
|
|
|
- releaseList.value = response.rows;
|
|
|
+ let toServerObj = likeQueryMethod('title', queryParams.value.title, queryParams.value.pageNum, queryParams.value.pageSize);
|
|
|
+ listRelease(toServerObj).then(response => {
|
|
|
+ releaseList.value = response.records;
|
|
|
total.value = response.total;
|
|
|
loading.value = false;
|
|
|
});
|
|
|
@@ -167,7 +169,7 @@ function cancel() {
|
|
|
function reset() {
|
|
|
form.value = {
|
|
|
id: null,
|
|
|
- title: null,
|
|
|
+ title: '',
|
|
|
specialColumn: null,
|
|
|
date: null,
|
|
|
content: null,
|
|
|
@@ -221,6 +223,7 @@ function submitForm() {
|
|
|
proxy.$refs["releaseRef"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (form.value.id != null) {
|
|
|
+ console.log(form.value);
|
|
|
updateRelease(form.value).then(response => {
|
|
|
proxy.$modal.msgSuccess("修改成功");
|
|
|
open.value = false;
|
|
|
@@ -240,9 +243,11 @@ function submitForm() {
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
function handleDelete(row) {
|
|
|
- const ids = row.id || ids.value;
|
|
|
- proxy.$modal.confirm('是否确认删除新闻发布编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delRelease(ids);
|
|
|
+ console.log(7777)
|
|
|
+ const ids2 = row.id || ids.value;
|
|
|
+ console.log(ids2);
|
|
|
+ proxy.$modal.confirm('是否确认删除新闻发布编号为"' + ids2 + '"的数据项?').then(function() {
|
|
|
+ return delRelease(ids2);
|
|
|
}).then(() => {
|
|
|
getList();
|
|
|
proxy.$modal.msgSuccess("删除成功");
|