diff --git a/package-lock.json b/package-lock.json index 61400bd..5a92753 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "HaHa-Admin", "version": "1.0.0", "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@ant-design/colors": "^7.0.0", "@ant-design/icons-vue": "^6.1.0", "@icon-park/vue-next": "^1.4.2", @@ -240,6 +241,11 @@ "@algolia/requester-common": "4.19.1" } }, + "node_modules/@amap/amap-jsapi-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", + "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==" + }, "node_modules/@ant-design/colors": { "version": "7.0.0", "resolved": "https://registry.npmmirror.com/@ant-design/colors/-/colors-7.0.0.tgz", @@ -5179,6 +5185,11 @@ "@algolia/requester-common": "4.19.1" } }, + "@amap/amap-jsapi-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", + "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==" + }, "@ant-design/colors": { "version": "7.0.0", "resolved": "https://registry.npmmirror.com/@ant-design/colors/-/colors-7.0.0.tgz", diff --git a/package.json b/package.json index c32cfa6..2d59900 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "src/**/*.{js,vue}": "eslint --ext .js,.vue .eslintignore --no-cache --fix" }, "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", "@ant-design/colors": "^7.0.0", "@ant-design/icons-vue": "^6.1.0", "@icon-park/vue-next": "^1.4.2", diff --git a/src/components/ExportRecord/index.vue b/src/components/ExportRecord/index.vue new file mode 100644 index 0000000..ea2086b --- /dev/null +++ b/src/components/ExportRecord/index.vue @@ -0,0 +1,296 @@ + + + + + \ No newline at end of file diff --git a/src/components/ImportRecord/index.vue b/src/components/ImportRecord/index.vue new file mode 100644 index 0000000..42e86f2 --- /dev/null +++ b/src/components/ImportRecord/index.vue @@ -0,0 +1,310 @@ + + + + + + + + + diff --git a/src/components/Map/index.vue b/src/components/Map/index.vue new file mode 100644 index 0000000..f4e8d24 --- /dev/null +++ b/src/components/Map/index.vue @@ -0,0 +1,926 @@ + + + + + \ No newline at end of file diff --git a/src/views/serviceMenu/serviceOrganization/index.vue b/src/views/serviceMenu/serviceOrganization/index.vue index b2ca16a..26597db 100644 --- a/src/views/serviceMenu/serviceOrganization/index.vue +++ b/src/views/serviceMenu/serviceOrganization/index.vue @@ -5,7 +5,7 @@ - + @@ -24,26 +24,30 @@ - 已结单 - 已作废 + + {{ item.introduction }} + - + - + - 已结单 - 已作废 + + {{ item.introduction }} + @@ -135,6 +139,8 @@ import EditDialog from './components/EditDialog.vue' import DeviceManagementModal from './components/AddEquipments.vue' import { useI18n } from 'vue-i18n' import storage from '@/utils/storage' +import AreaCascader from '@/components/AreaCascader/index.vue' + import { useDicsStore } from '@/store' defineOptions({ name: 'menu', @@ -169,6 +175,7 @@ const columns = ref([ const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } = usePagination() const { resetForm } = useForm() +const dicsStore = useDicsStore() getMenuList() diff --git a/src/views/serviceMenu/serviceSites/components/EditDialog.vue b/src/views/serviceMenu/serviceSites/components/EditDialog.vue index a73a3e2..eb8b566 100644 --- a/src/views/serviceMenu/serviceSites/components/EditDialog.vue +++ b/src/views/serviceMenu/serviceSites/components/EditDialog.vue @@ -1,15 +1,6 @@ @@ -288,6 +259,7 @@ import { config } from '@/config' import { useI18n } from 'vue-i18n' import storage from '@/utils/storage' import { message } from 'ant-design-vue' +import MapPickerModal from '@/components/Map/index.vue' const emit = defineEmits(['ok']) const { t } = useI18n() // 解构出t方法 const { modal, showModal, hideModal, showLoading, hideLoading } = useModal() @@ -344,14 +316,14 @@ formRules.value = { ], phone: [ { required: true, message: '请输入联系电话' }, - { + { pattern: /^1[3-9]\d{9}$/, - message: '请输入正确的联系电话' + message: '请输入正确的联系电话' } ], bedCount: [ { required: true, message: '请输入床位数' }, - { + { validator: (_, value) => { if (value !== null && value !== undefined && value !== '') { if (typeof value === 'number' && value >= 0) { @@ -366,8 +338,8 @@ formRules.value = { address: { required: true, message: '请选择省市区' }, detailAddress: { required: true, message: '请输入详细地址' }, buildTime: { required: true, message: '请选择建成时间' }, - area: { - required: true, + area: { + required: true, validator: (_, value) => { if (value && value > 0) { return Promise.resolve(); @@ -378,8 +350,8 @@ formRules.value = { openTime: { required: true, message: '请选择开始营业时间' }, closeTime: { required: true, message: '请选择结束营业时间' }, businessStatus: { required: true, message: '请选择营业状态' }, - services: { - required: true, + services: { + required: true, validator: (_, value) => { if (value && value.length > 0) { return Promise.resolve(); @@ -404,6 +376,20 @@ const reqType = ['GET', 'POST', 'PUT', 'PATCH', 'HEAD', 'DELETE'] const cancelText = ref(t('button.cancel')) const okText = ref(t('button.confirm')) const platform = ref('') +const showMapPicker = ref(false) +const location = ref('') + +const handleLocationSelect = (lngLat) => { + console.log('确认选择:', lngLat) + formData.value.location = lngLat.address + showMapPicker.value = false +} + +// 实时位置变化 +const handleLocationChange = (location) => { + console.log('位置变化:', location) + // 可以实时更新UI +} // 地址选项 - 实际项目中可以从接口获取 const addressOptions = ref([ @@ -514,12 +500,12 @@ function handleOk() { } params.sequence = Number.parseInt(params.sequence) || 0 params.properties = JSON.stringify(params.properties) - + // 处理地址数据 params.province = params.address[0] params.city = params.address[1] params.district = params.address[2] - + let result = null switch (modal.value.type) { case 'create': @@ -600,7 +586,7 @@ function handleServiceClick(value) { if (!formData.value.services) { formData.value.services = [] } - + const index = formData.value.services.indexOf(value) if (index > -1) { // 如果已选中,则取消选中 @@ -615,9 +601,7 @@ function handleServiceClick(value) { * 打开地图选择器 */ function openMapSelector() { - // 实际项目中可以调用地图组件或打开地图选择弹窗 - // 这里使用模拟数据 - formData.value.location = '北京市海淀区中关村大街1号 (经纬度: 39.9847, 116.3055)' + showMapPicker.value = true } /** @@ -655,18 +639,18 @@ defineExpose({ // 服务标签选中样式 .service-tag { cursor: pointer; - + &.ant-tag-checkable-checked { background-color: #1890ff; // 蓝色背景 color: #fff; // 白色文字 border-color: #1890ff; - + &:hover { background-color: #40a9ff; border-color: #40a9ff; } } - + &:not(.ant-tag-checkable-checked) { &:hover { border-color: #1890ff; diff --git a/src/views/serviceMenu/serviceSites/index.vue b/src/views/serviceMenu/serviceSites/index.vue index 037a2a6..e4ff3c1 100644 --- a/src/views/serviceMenu/serviceSites/index.vue +++ b/src/views/serviceMenu/serviceSites/index.vue @@ -11,16 +11,18 @@ - - 已结单 - 已作废 + + + {{ item.introduction }} + - + @@ -66,18 +68,18 @@ 导入 - + 导入记录 - + 导出 - + @@ -145,8 +147,29 @@ + + + + + + + \ No newline at end of file