4 changed files with 80 additions and 140 deletions
-
46src/services/admin/classtic.ts
-
110src/stores/index.ts
-
25src/views/admin/classticmanage/ClassticFormView.vue
-
39src/views/admin/classticmanage/ClassticManageView.vue
@ -1,30 +1,35 @@ |
|||
<template> |
|||
<a-modal v-model:open="modal.open" :title="modal.title" cancelText="取消" okText="确定" @ok="submit"> |
|||
<a-form :model="classticform" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"> |
|||
<a-modal v-model:open="modalForm.open" :title="modalForm.title" cancelText="取消" okText="确定" @ok="submit"> |
|||
<a-form ref="formRef" :model="classticForm" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"> |
|||
<a-form-item label="语录标题" name="header" |
|||
:rules="[{ required: true, message: 'Please input your username!' }]"> |
|||
<a-input v-model:value="classticform.header" /> |
|||
<a-input v-model:value="classticForm.header" /> |
|||
</a-form-item> |
|||
<a-form-item label="语录内容" name="text" :rules="[{ required: true, message: 'Please input your username!' }]"> |
|||
<a-input v-model:value="classticform.text" /> |
|||
<a-input v-model:value="classticForm.text" /> |
|||
</a-form-item> |
|||
<a-form-item label="备注" name="descr" :rules="[{ required: true, message: 'Please input your username!' }]"> |
|||
<a-input v-model:value="classticform.descr" /> |
|||
<a-input v-model:value="classticForm.descr" /> |
|||
</a-form-item> |
|||
</a-form> |
|||
</a-modal> |
|||
</template> |
|||
|
|||
<script setup lang='ts'> |
|||
import {indexStore} from "@/stores/index" |
|||
import { onSubmit,classticform } from "@/services/admin/classtic" |
|||
const {modal}=indexStore() |
|||
import { ref } from "vue"; |
|||
import { classticStore } from "@/stores/index" |
|||
import { onSubmit } from "@/services/admin/classtic" |
|||
const { modalForm, classticForm } = classticStore() |
|||
const formRef = ref(); |
|||
const submit = () => { |
|||
if (modal.ids) { |
|||
onSubmit(modal.ids) |
|||
if (modalForm.ids) { |
|||
onSubmit(modalForm.ids) |
|||
} else { |
|||
onSubmit() |
|||
} |
|||
modalForm.open = false |
|||
formRef.value.resetFields(); |
|||
|
|||
}; |
|||
</script> |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue