@@ -16,11 +21,12 @@
- 编辑
+ 编辑
预览
@@ -35,23 +41,62 @@ import { ref, reactive, onMounted } from 'vue';
import type { searchValue } from "@/api/admin"
import { useRouter } from "vue-router"
const router = useRouter()
-import {classticContentStore} from "@/stores"
+import { classticContentStore } from "@/stores"
+
+const addModal=reactive({
+ addOpen:false,
+ addTitle:"",
+ modalMode:""
+})
+const modal=(mode:string)=>{
+ addModal.modalMode=mode
+ if (mode === 'add') {
+ addModal.addTitle = '新增';
+ } else if (mode === 'edit') {
+ addModal.addTitle = '编辑';
+ }
+ addModal.addOpen = true;
+}
+const addhandleOk = () => {
+ addOpen.value = true;
+ addOpen.value = false;
+};
+const edithandleOk=()=> {
+ // Logic for editing
+ console.log('Edit logic here');
+ }
+
+const handleOk=()=> {
+ if (addModal.modalMode === 'add') {
+ // Handle add action
+ addhandleOk();
+ } else if (addModal.modalMode === 'edit') {
+ // Handle edit action
+ edithandleOk();
+ }
+ addModal.addOpen = false;
+ }
+
const searchList = reactive
({
- classtictitle:""
+ classtictitle: ""
})
-const classticContent=classticContentStore()
-const open = ref(false);
+const classticContent = classticContentStore()
+const deleteOpen = ref(false);
const toDelete = reactive<{ key: string, id: number }>({
key: '',
id: 0
});
const showModal = (key: string, id: number) => {
- open.value = true;
+ deleteOpen.value = true;
// 将需要删除的数据项的 key 和 id 存储到 ref 中,以便确认后使用
toDelete.key = key;
toDelete.id = id;
};
+const addOpen = ref(false);
+
+
+
// 新增单独跳转到一个页面
const blogAdd = function () {
router.push('/admin/blogmanage/add')