update
This commit is contained in:
parent
41c7a9512e
commit
8628a6beab
62
src/main.js
62
src/main.js
@ -15,7 +15,37 @@ import {
|
||||
Pagination,
|
||||
Spin,
|
||||
ConfigProvider,
|
||||
message
|
||||
message,
|
||||
Card,
|
||||
Dropdown,
|
||||
Checkbox,
|
||||
Radio,
|
||||
Switch,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
InputNumber,
|
||||
Upload,
|
||||
Badge,
|
||||
Avatar,
|
||||
Drawer,
|
||||
Divider,
|
||||
List,
|
||||
Popover,
|
||||
Tooltip,
|
||||
Tag,
|
||||
Timeline,
|
||||
Tree,
|
||||
Alert,
|
||||
Space,
|
||||
Row,
|
||||
Col,
|
||||
Breadcrumb,
|
||||
Steps,
|
||||
Result,
|
||||
Statistic,
|
||||
Descriptions,
|
||||
Empty,
|
||||
AutoComplete
|
||||
} from 'ant-design-vue'
|
||||
import 'ant-design-vue/dist/antd.css'
|
||||
|
||||
@ -35,6 +65,36 @@ const ANT_DESIGN = {
|
||||
app.use(Pagination)
|
||||
app.use(Spin)
|
||||
app.use(ConfigProvider)
|
||||
app.use(Card)
|
||||
app.use(Dropdown)
|
||||
app.use(Checkbox)
|
||||
app.use(Radio)
|
||||
app.use(Switch)
|
||||
app.use(DatePicker)
|
||||
app.use(TimePicker)
|
||||
app.use(InputNumber)
|
||||
app.use(Upload)
|
||||
app.use(Badge)
|
||||
app.use(Avatar)
|
||||
app.use(Drawer)
|
||||
app.use(Divider)
|
||||
app.use(List)
|
||||
app.use(Popover)
|
||||
app.use(Tooltip)
|
||||
app.use(Tag)
|
||||
app.use(Timeline)
|
||||
app.use(Tree)
|
||||
app.use(Alert)
|
||||
app.use(Space)
|
||||
app.use(Row)
|
||||
app.use(Col)
|
||||
app.use(Breadcrumb)
|
||||
app.use(Steps)
|
||||
app.use(Result)
|
||||
app.use(Statistic)
|
||||
app.use(Descriptions)
|
||||
app.use(Empty)
|
||||
app.use(AutoComplete)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -181,26 +181,6 @@
|
||||
/>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="产品描述" name="product_detail">
|
||||
<md-editor
|
||||
v-model:value="formState.product_detail"
|
||||
:toolbars="toolbars"
|
||||
language="zh-CN"
|
||||
preview-theme="github"
|
||||
:placeholder="'请输入产品描述'"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="购买须知" name="purchase_note">
|
||||
<md-editor
|
||||
v-model:value="formState.purchase_note"
|
||||
:toolbars="toolbars"
|
||||
language="zh-CN"
|
||||
preview-theme="github"
|
||||
:placeholder="'请输入购买须知'"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
@ -345,26 +325,6 @@
|
||||
/>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="产品描述" name="product_detail">
|
||||
<md-editor
|
||||
v-model:value="editFormState.product_detail"
|
||||
:toolbars="toolbars"
|
||||
language="zh-CN"
|
||||
preview-theme="github"
|
||||
:placeholder="'请输入产品描述'"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="购买须知" name="purchase_note">
|
||||
<md-editor
|
||||
v-model:value="editFormState.purchase_note"
|
||||
:toolbars="toolbars"
|
||||
language="zh-CN"
|
||||
preview-theme="github"
|
||||
:placeholder="'请输入购买须知'"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
@ -439,8 +399,6 @@ import PageContainer from '@/components/PageContainer.vue'
|
||||
import { loadAMap, createMap, createAutoComplete, createGeocoder } from '@/utils/amap.js'
|
||||
import request from '@/utils/request'
|
||||
import { PlusOutlined, SearchOutlined, EditOutlined, DownOutlined, GiftOutlined, AccountBookOutlined } from '@ant-design/icons-vue'
|
||||
import { MdEditor } from 'md-editor-v3'
|
||||
import 'md-editor-v3/lib/style.css'
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -452,8 +410,7 @@ export default defineComponent({
|
||||
GiftOutlined,
|
||||
AccountBookOutlined,
|
||||
AUpload: Upload,
|
||||
AModal: Modal,
|
||||
MdEditor
|
||||
AModal: Modal
|
||||
},
|
||||
setup() {
|
||||
const loading = ref(false)
|
||||
@ -462,27 +419,6 @@ export default defineComponent({
|
||||
const currentMap = ref(null)
|
||||
const currentMarker = ref(null)
|
||||
|
||||
// Markdown 编辑器工具栏配置
|
||||
const toolbars = [
|
||||
'bold',
|
||||
'underline',
|
||||
'italic',
|
||||
'strikeThrough',
|
||||
'title',
|
||||
'sub',
|
||||
'sup',
|
||||
'quote',
|
||||
'unorderedList',
|
||||
'orderedList',
|
||||
'codeRow',
|
||||
'code',
|
||||
'link',
|
||||
'image',
|
||||
'table',
|
||||
'preview',
|
||||
'fullscreen'
|
||||
]
|
||||
|
||||
const pagination = ref({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
@ -687,9 +623,7 @@ export default defineComponent({
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: '',
|
||||
brand_image_url: '',
|
||||
product_detail: '',
|
||||
purchase_note: '',
|
||||
brand_image_url: ''
|
||||
})
|
||||
|
||||
const rules = {
|
||||
@ -699,9 +633,7 @@ export default defineComponent({
|
||||
name: [{ required: true, message: '请输入商家名称' }],
|
||||
business_hours: [{ required: true, message: '请输入营业时间' }],
|
||||
address: [{ required: true, message: '请输入详细地址' }],
|
||||
phone: [{ required: true, message: '请输入联系电话' }],
|
||||
product_detail: [{ required: false, message: '请输入产品描述' }],
|
||||
purchase_note: [{ required: false, message: '请输入购买须知' }],
|
||||
phone: [{ required: true, message: '请输入联系电话' }]
|
||||
}
|
||||
|
||||
// 获取商家分类
|
||||
@ -844,14 +776,7 @@ export default defineComponent({
|
||||
try {
|
||||
confirmLoading.value = true
|
||||
|
||||
// 确保包含产品描述和购买须知字段
|
||||
const postData = {
|
||||
...formState.value,
|
||||
product_detail: formState.value.product_detail || '',
|
||||
purchase_note: formState.value.purchase_note || ''
|
||||
}
|
||||
|
||||
await request.post('/api/merchant', postData)
|
||||
await request.post('/api/merchant', formState.value)
|
||||
message.success('添加成功')
|
||||
addModalVisible.value = false
|
||||
fetchData()
|
||||
@ -875,9 +800,7 @@ export default defineComponent({
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: '',
|
||||
brand_image_url: '',
|
||||
product_detail: '',
|
||||
purchase_note: '',
|
||||
brand_image_url: ''
|
||||
}
|
||||
searchAddress.value = ''
|
||||
searchOptions.value = []
|
||||
@ -932,9 +855,7 @@ export default defineComponent({
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: '',
|
||||
brand_image_url: '',
|
||||
product_detail: '',
|
||||
purchase_note: '',
|
||||
brand_image_url: ''
|
||||
})
|
||||
const editSearchAddress = ref('')
|
||||
const editMap = ref(null)
|
||||
@ -947,8 +868,14 @@ export default defineComponent({
|
||||
editFormState.value = {
|
||||
...record,
|
||||
user_id: record.user_id,
|
||||
product_detail: record.product_detail || '',
|
||||
purchase_note: record.purchase_note || ''
|
||||
name: record.name,
|
||||
category_id: record.category_id,
|
||||
business_hours: record.business_hours,
|
||||
address: record.address,
|
||||
longitude: record.longitude,
|
||||
latitude: record.latitude,
|
||||
phone: record.phone,
|
||||
brand_image_url: record.brand_image_url
|
||||
}
|
||||
|
||||
// 获取分类数据
|
||||
@ -1058,12 +985,9 @@ export default defineComponent({
|
||||
try {
|
||||
editLoading.value = true
|
||||
|
||||
// 确保包含 user_id、产品描述和购买须知字段在请求数据中
|
||||
const updateData = {
|
||||
...editFormState.value,
|
||||
user_id: editFormState.value.user_id,
|
||||
product_detail: editFormState.value.product_detail || '',
|
||||
purchase_note: editFormState.value.purchase_note || ''
|
||||
user_id: editFormState.value.user_id
|
||||
}
|
||||
|
||||
const res = await request.put(`/api/merchant/${currentEditId.value}`, updateData)
|
||||
@ -1095,9 +1019,7 @@ export default defineComponent({
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
phone: '',
|
||||
brand_image_url: '',
|
||||
product_detail: '',
|
||||
purchase_note: '',
|
||||
brand_image_url: ''
|
||||
}
|
||||
editSearchAddress.value = ''
|
||||
userOptions.value = []
|
||||
@ -1335,8 +1257,7 @@ export default defineComponent({
|
||||
shareRateModalVisible,
|
||||
shareRateValue,
|
||||
showShareRateModal,
|
||||
handleShareRateSubmit,
|
||||
toolbars
|
||||
handleShareRateSubmit
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1554,47 +1475,6 @@ export default defineComponent({
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* Markdown 编辑器样式 */
|
||||
:deep(.md-editor) {
|
||||
height: 300px !important;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
:deep(.md-editor-content) {
|
||||
height: 300px !important;
|
||||
}
|
||||
|
||||
:deep(.ant-modal-body) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
:deep(.md-editor-toolbar) {
|
||||
border-radius: 2px 2px 0 0 !important;
|
||||
}
|
||||
|
||||
:deep(.md-editor-input, .md-editor-preview) {
|
||||
border-radius: 0 0 2px 2px !important;
|
||||
}
|
||||
|
||||
:deep(.md-editor-preview-wrapper) {
|
||||
padding: 8px 16px !important;
|
||||
}
|
||||
|
||||
:deep(.ant-modal .ant-modal-content) {
|
||||
background: #fff;
|
||||
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
:deep(.md-editor) {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
:deep(.md-editor-input) {
|
||||
padding: 12px !important;
|
||||
}
|
||||
|
||||
/* 编辑和添加模态框中的内容样式 */
|
||||
:deep(.ant-modal-body:has(.ant-form)) {
|
||||
padding: 24px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user