更新页面

This commit is contained in:
2025-09-25 10:36:27 +08:00
parent 265c0e618e
commit 2b1ac200aa
5 changed files with 90 additions and 128 deletions

View File

@ -69,10 +69,12 @@ function getDateById (id) {
}
const save = () => {
FormRef.value.submit(()=>{
FormRef.value.submit((val)=>{
loading.value = true;
let url = title.value == '新增' ? `/mosty-base/baxx/jxda/add` : `/mosty-base/baxx/jxda/edit`;
qcckPost(listQuery.value, url).then(() => {
let params = { ...val }
params.fj = params.fj ? params.fj.join(','):''
qcckPost(params, url).then(() => {
loading.value = false;
proxy.$message.success("保存成功");
emit("refresh");
@ -84,7 +86,7 @@ const save = () => {
}
const close = () => {
dialogForm.value = false;
listQuery.value = {fj:''}
listQuery.value = {fj:[]}
FormRef.value.reset()
};;

View File

@ -36,7 +36,7 @@ const formList = reactive([
{ label: "视频标题", prop: "spbt", type: "input" },
],
[
{ label: "附件", prop: "fjid", type: "upload",isImg:false,showBtn:true,limit:2 },
{ label: "附件", prop: "fjid", type: "upload",isImg:false,showBtn:true,limit:2 ,isAll:true},
],
])
@ -46,14 +46,23 @@ const init = (type, row = {}) => {
dialogForm.value = true;
openType.value = type;
title.value = type == "add" ? "新增" : "编辑";
listQuery.value = { ...row }
if(row) getDateById(row.id)
};
const getDateById = (id) =>{
qcckPost({},'/mosty-base/baxx/sok/getInfo/'+id).then(res=>{
res.fjid = res.fjid ? JSON.parse(res.fjid):[];
listQuery.value = res || {}
})
}
const save = () => {
FormRef.value.submit(()=>{
FormRef.value.submit((val)=>{
loading.value = true;
let url = title.value == '新增' ? `/mosty-base/baxx/sok/add` : `/mosty-base/baxx/sok/edit`;
qcckPost(listQuery.value, url).then(() => {
let params = {...val }
params.fjid = params.fjid ? JSON.stringify(params.fjid):''
qcckPost(params, url).then(() => {
loading.value = false;
proxy.$message.success("保存成功");
emit("refresh");

View File

@ -23,7 +23,7 @@
<template #controls="{ row }">
<el-link type="primary" link @click="addEdit('edit', row)">编辑</el-link>
<el-link type="primary" link @click="addEdit('detail', row)">详情</el-link>
<el-link type="danger" link @click="handleDelete(row.id)">删除</el-link>
<el-link type="danger" link @click="handleDelete([row.id])">删除</el-link>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
@ -115,7 +115,7 @@ const getList = () => {
// 删除
const handleDelete = (ids) => {
proxy.$modal.confirm("是否确认删除该视频?").then(() => {
qcckPost({ ids }, "/mosty-base/baxx/sok/remove").then(() => {
qcckPost(ids, "/mosty-base/baxx/sok/remove").then(() => {
proxy.$modal.msgSuccess("删除成功");
getList();
});