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

@ -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);
}