test
This commit is contained in:
parent
7f0964c627
commit
7925080ea2
|
|
@ -106,7 +106,7 @@
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.add();
|
registerModal.value.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑事件
|
* 编辑事件
|
||||||
*/
|
*/
|
||||||
|
|
@ -114,7 +114,7 @@
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.edit(record);
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
|
|
@ -122,28 +122,28 @@
|
||||||
registerModal.value.disableSubmit = true;
|
registerModal.value.disableSubmit = true;
|
||||||
registerModal.value.edit(record);
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除事件
|
* 删除事件
|
||||||
*/
|
*/
|
||||||
async function handleDelete(record) {
|
async function handleDelete(record) {
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
*/
|
*/
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作栏
|
* 操作栏
|
||||||
*/
|
*/
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下拉操作栏
|
* 下拉操作栏
|
||||||
*/
|
*/
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
function searchQuery() {
|
function searchQuery() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置
|
* 重置
|
||||||
*/
|
*/
|
||||||
|
|
@ -190,7 +190,7 @@
|
||||||
//刷新数据
|
//刷新数据
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,11 +113,6 @@ const disabled = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
setup() {
|
|
||||||
console.log(111)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
|
@ -134,6 +129,11 @@ function edit(record) {
|
||||||
resetFields();
|
resetFields();
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
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)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
@ -175,25 +176,22 @@ async function submitForm() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getContent()
|
onMounted(() => {
|
||||||
|
console.log(`the component is now mounted.`)
|
||||||
|
})
|
||||||
function getContent() {
|
function getContent() {
|
||||||
let params = {id: formData.id}
|
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)
|
console.log(res)
|
||||||
if (Array.isArray(res)) {
|
articleContent.value = res.content
|
||||||
resolve(res);
|
|
||||||
} else {
|
|
||||||
resolve(res['menu']);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
console.log('11')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const articleContent = ref('hello world!');
|
const articleContent = ref('');
|
||||||
|
|
||||||
function handleTinymceChange(value: string) {
|
function handleTinymceChange(value: string) {
|
||||||
formData.ArticleContent = value
|
formData.articleContent = value
|
||||||
console.log(value);
|
console.log(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue