This commit is contained in:
zhouwentao 2024-03-10 23:27:27 +08:00
parent 7f0964c627
commit 7925080ea2
2 changed files with 23 additions and 25 deletions

View File

@ -106,7 +106,7 @@
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
@ -114,7 +114,7 @@
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
@ -122,28 +122,28 @@
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
@ -155,7 +155,7 @@
},
];
}
/**
* 下拉操作栏
*/
@ -180,7 +180,7 @@
function searchQuery() {
reload();
}
/**
* 重置
*/
@ -190,7 +190,7 @@
//
reload();
}

View File

@ -113,11 +113,6 @@ const disabled = computed(() => {
});
export default defineComponent({
setup() {
console.log(111)
}
});
/**
* 新增
*/
@ -134,6 +129,11 @@ function edit(record) {
resetFields();
//
Object.assign(formData, record);
if (formData.id) {
getContent()
}else{
articleContent.value = ''
}
});
}
@ -161,6 +161,7 @@ async function submitForm() {
}
}
}
model.content = articleContent.value
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
@ -175,25 +176,22 @@ async function submitForm() {
});
}
getContent()
onMounted(() => {
console.log(`the component is now mounted.`)
})
function getContent() {
let params = {id: formData.id}
defHttp.get<Object>({url: '/yx/yxArticle/queryById', params}).then((res) => {
defHttp.get({url: '/yx/yxArticle/queryById', params})
.then((res) => {
console.log(res)
if (Array.isArray(res)) {
resolve(res);
} else {
resolve(res['menu']);
}
articleContent.value = res.content
});
console.log('11')
}
const articleContent = ref('hello world!');
const articleContent = ref('');
function handleTinymceChange(value: string) {
formData.ArticleContent = value
formData.articleContent = value
console.log(value);
}