diff --git a/src/components/blogs/ceshi.vue b/src/components/blogs/ceshi.vue index e997e5f..63b1d44 100644 --- a/src/components/blogs/ceshi.vue +++ b/src/components/blogs/ceshi.vue @@ -1,95 +1,30 @@ - + diff --git a/src/router/admin.ts b/src/router/admin.ts index c6c3237..2f9a48d 100644 --- a/src/router/admin.ts +++ b/src/router/admin.ts @@ -14,18 +14,7 @@ const adminRoute: Array = [ { path: "blogmanage", name: "blogmanage", - component: () => import("@/views/admin/blogmange/BlogManageView.vue") - }, - { - path: "blogmanage/add", - component: () => import("@/views/admin/blogmange/BlogFormView.vue"), - meta: { requiresAuth: true } - }, - { - path: "blogmanage/update/:id", - component: () => import("@/views/admin/blogmange/BlogFormView.vue"), - meta: { requiresAuth: true }, - props: true + component: () => import("@/views/admin/BlogManageView.vue") }, { path: "classticmanage", diff --git a/src/views/admin/blogmange/BlogManageView.vue b/src/views/admin/BlogManageView.vue similarity index 97% rename from src/views/admin/blogmange/BlogManageView.vue rename to src/views/admin/BlogManageView.vue index 4c8a4c9..12ad9c9 100644 --- a/src/views/admin/blogmange/BlogManageView.vue +++ b/src/views/admin/BlogManageView.vue @@ -27,7 +27,7 @@ - + {{ label.labelname }} @@ -135,17 +135,15 @@ const search = async () => { } }; -// 新增 const formState = ref({ id: '', blogtitle: '', typeid: null, blogcontent: "", - labelname: [], + labelnames: [], descr: '', imglink: "" }); - const labellist = ref([]) const labelList = async () => { try { @@ -207,6 +205,7 @@ const addModal = () => { formControl.value.open = true console.log(formControl.value.ids) } + const editModal = (id: any) => { formControl.value.ids = id formControl.value.open = true @@ -214,6 +213,7 @@ const editModal = (id: any) => { `/blogs/list/search/${id}` ).then(response=>{ formState.value=response.data.data + }) console.log(formControl.value.ids) } @@ -221,7 +221,7 @@ const onSubmit = () => { formRef.value .validate() .then(async () => { - const labels = formState.value.labelname.map(labelId => { + const labels = formState.value.labelnames.map(labelId => { const label = labellist.value.find((label: any) => label.id === labelId); return label ? { "id": label.id, "labelname": label.labelname, "descr": label.descr } : null; }); @@ -267,7 +267,7 @@ const blogList = async () => { update_at: dayjs(items.update_at).format('YYYY-MM-DD HH:mm:ss'), readnum: items.readnum, readminite: items.readminite, - wordcount: items.wordcount, + wordcount: items.blogcontent.length, img: items.img, blogcontent: items.blogcontent, typename: items.typename, diff --git a/src/views/blog/blogcontent/BlogListView.vue b/src/views/blog/blogcontent/BlogListView.vue index 8045a6f..c928335 100644 --- a/src/views/blog/blogcontent/BlogListView.vue +++ b/src/views/blog/blogcontent/BlogListView.vue @@ -1,6 +1,6 @@