diff --git a/README.md b/README.md index 91cd770..68863cd 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 基于 qiankun + vue2&vue3 + Vite + vite-plugin-qiankun 技术栈实现的前端微应用架构,实现了主子应用切换。 -1、主应用介绍 +1、主应用介绍 技术栈 Vite+Vue3 + Element-plus + qiankun + Pinia diff --git a/main/.env.development b/main/.env.development index 681745b..3aa18c8 100644 --- a/main/.env.development +++ b/main/.env.development @@ -17,5 +17,5 @@ VITE_APP_UPLOAD_API = '/uploadApis' # VITE_APP_UPLOAD_URL = 'http://47.109.205.240:9300' # 内网接口地址 VITE_APP_BASE_URL = 'http://192.168.18.99:8080' -VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080' -VITE_APP_VIST_URL = 'http://192.168.18.99' +VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080' +# VITE_APP_VIST_URL = 'http://192.168.18.99' diff --git a/sub-government-affairs-service/.env.development b/sub-government-affairs-service/.env.development index 7a86ca4..8b97e98 100644 --- a/sub-government-affairs-service/.env.development +++ b/sub-government-affairs-service/.env.development @@ -14,4 +14,4 @@ VITE_APP_UPLOAD_API = '/uploadApis' # 内网接口地址 VITE_APP_BASE_URL = 'http://192.168.18.99:8080' -VITE_APP_UPLOAD_URL = 'http://192.168.18.99:8080' +VITE_APP_UPLOAD_URL = 'http://192.168.18.74:8080' diff --git a/sub-government-affairs-service/src/apis/landResourceManagement/gridManagement/index.js b/sub-government-affairs-service/src/apis/landResourceManagement/gridManagement/index.js index e69de29..1f6a90f 100644 --- a/sub-government-affairs-service/src/apis/landResourceManagement/gridManagement/index.js +++ b/sub-government-affairs-service/src/apis/landResourceManagement/gridManagement/index.js @@ -0,0 +1,43 @@ +import request from '@/utils/axios'; + +// 新增(POST) +export function createGrid(data = {}) { + return request('/land-resource/gridManage/save', { + method: 'POST', + data, + }); +} +// 删除(DELETE) +export function deleteGrid(id) { + return request(`/land-resource/gridManage/${id}`, { + method: 'DELETE', + }); +} +// 修改(PUT) +export function updateGrid(data = {}) { + return request('/land-resource/gridManage/edit', { + method: 'PUT', + data, + }); +} +// 查询列表(GET) +export function fetchGridList(params) { + return request('/land-resource/gridManage/page', { + method: 'GET', + params, + }); +} +// 获取详情(GET) +export function getGridDetail(id) { + return request(`/land-resource/gridManage/${id}`, { + method: 'GET', + }); +} +// 导出(GET + Blob) +export function exportGrid(params = {}) { + return request('/land-resource/gridManage/export', { + method: 'GET', + params, + responseType: 'blob', + }); +} diff --git a/sub-government-affairs-service/src/components/AreaCascader/index.vue b/sub-government-affairs-service/src/components/AreaCascader/index.vue index 1920dfa..25ff12c 100644 --- a/sub-government-affairs-service/src/components/AreaCascader/index.vue +++ b/sub-government-affairs-service/src/components/AreaCascader/index.vue @@ -1,40 +1,27 @@ diff --git a/sub-government-affairs-service/src/components/AreaSelect/index.vue b/sub-government-affairs-service/src/components/AreaSelect/index.vue index f4cb29a..82669c1 100644 --- a/sub-government-affairs-service/src/components/AreaSelect/index.vue +++ b/sub-government-affairs-service/src/components/AreaSelect/index.vue @@ -24,7 +24,7 @@ const props = defineProps({ default: false, }, modelValue: { - type: Array, + type: [Array, String], default: () => [], }, label: { @@ -39,6 +39,10 @@ const props = defineProps({ type: [Number, String], default: 500, }, + emitPath: { + type: Boolean, + default: true, + }, }); const emit = defineEmits(['update:modelValue']); @@ -46,14 +50,35 @@ const emit = defineEmits(['update:modelValue']); const userStore = useUserStore(); const areaOptions = ref([]); -const selectedAreaPath = ref([...props.modelValue]); + +// 检查计算属性有没有循环依赖用 +// const selectedAreaPath = props.emitPath ? ref([].concat(props.modelValue)) : ref(props.modelValue); + +const selectedAreaPath = computed({ + get() { + // 初始回显 & 外部变更都走这里 + if (props.emitPath) { + return Array.isArray(props.modelValue) ? props.modelValue : []; + } else { + return typeof props.modelValue === 'string' ? props.modelValue : ''; + } + }, + set(val) { + // 组件内部选中时走这里 + if (props.emitPath) { + emit('update:modelValue', Array.isArray(val) ? val : []); + } else { + emit('update:modelValue', typeof val === 'string' ? val : ''); + } + }, +}); // 自定义字段映射 const cascaderProps = computed(() => ({ label: 'areaName', value: 'areaCode', children: 'areaChildVOS', - emitPath: true, + emitPath: props.emitPath, expandTrigger: 'hover', })); @@ -70,7 +95,7 @@ const fetchAreaData = async () => { console.error('加载行政区域失败', err); } }; - +// !!!禁止使用外部更新,会造成循环依赖 // // 外部更新 => 内部同步 // watch( // () => props.modelValue, @@ -80,9 +105,19 @@ const fetchAreaData = async () => { // ); // 内部更新 => 外部同步 -watch(selectedAreaPath, (val) => { - emit('update:modelValue', val); -}); +watch( + selectedAreaPath, + (val) => { + if (props.emitPath) { + // 期望数组模式,确保输出数组 + emit('update:modelValue', Array.isArray(val) ? val : []); + } else { + // 期望字符串模式,确保输出字符串 + emit('update:modelValue', typeof val === 'string' ? val : ''); + } + }, + { deep: true } +); onMounted(() => { fetchAreaData(); diff --git a/sub-government-affairs-service/src/components/FileUploader/index.vue b/sub-government-affairs-service/src/components/FileUploader/index.vue index e4990ca..808d766 100644 --- a/sub-government-affairs-service/src/components/FileUploader/index.vue +++ b/sub-government-affairs-service/src/components/FileUploader/index.vue @@ -12,6 +12,7 @@ :auto-upload="true" :disabled="readonly" :accept="accept" + @preview="handlePreview" > @@ -24,78 +25,74 @@ import { ref, computed } from 'vue'; import { Plus } from '@element-plus/icons-vue'; import { CommonUpload } from '@/apis/index'; +// 1. props & emit const props = defineProps({ - modelValue: { - type: Array, - default: () => [], - }, - ossUrl: { - type: String, - default: 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/', - }, - limit: { - type: Number, - default: 5, - }, - accept: { - type: String, - default: 'image/*', - }, - readonly: { - type: Boolean, - default: false, - }, + modelValue: { type: [Array, String], default: () => [] }, + ossUrl: { type: String, default: 'http://gov-cloud.oss-cn-chengdu.aliyuncs.com/' }, + limit: { type: Number, default: 5 }, + accept: { type: String, default: 'image/*' }, + readonly: { type: Boolean, default: false }, }); const emit = defineEmits(['update:modelValue']); -// 构造 el-upload 所需 file-list -const fileList = computed(() => { - return props.modelValue.map((path, idx) => ({ - name: `image_${idx}`, - url: props.ossUrl + path, - uid: `${idx}`, - })); +// 2. 中间层 computed:统一成数组,写时根据 limit 决定发出数组还是字符串 +const selectedFiles = computed({ + get() { + // 回显:如果父传字符串且 limit===1,就把它当成长度 1 数组 + if (props.limit === 1 && typeof props.modelValue === 'string' && props.modelValue) { + return [props.modelValue]; + } + // 其他情况,确保数组 + return Array.isArray(props.modelValue) ? props.modelValue : []; + }, + set(val) { + // 内部操作后:如果单文件场景,传字符串;多文件场景,传数组 + if (props.limit === 1) { + emit('update:modelValue', val.length ? val[0] : ''); + } else { + emit('update:modelValue', val); + } + }, }); -// 预览 +// 3. fileList & previewList 都基于 selectedFiles +const fileList = computed(() => + selectedFiles.value.map((path, idx) => ({ + name: `file_${idx}`, + url: props.ossUrl + path, + uid: `${idx}`, + })) +); const previewShow = ref(false); -const previewList = computed(() => fileList.value.map((item) => item.url)); const previewIndex = ref(0); +const previewList = computed(() => fileList.value.map((f) => f.url)); -// 上传请求内部实现 +// 4. 上传 & 移除 const customUploadRequest = async ({ file, onSuccess, onError }) => { const formData = new FormData(); formData.append('file', file); try { const res = await CommonUpload(formData); - // 假设后端返回 { code:200, data: { url: 'relative/path.jpg' } } onSuccess(res, file); } catch (err) { onError(err); } }; - -// 上传成功回调,推入 modelValue function handleUploadSuccess(res) { const relative = res.data?.url; - if (relative) { - const newArr = [...props.modelValue, relative]; - emit('update:modelValue', newArr); - } + if (!relative) return; + // 推入中间层 + selectedFiles.value = [...selectedFiles.value, relative]; } - -// 删除图片 function handleRemove(file) { - const fullUrl = file.url; - const relative = fullUrl.replace(props.ossUrl, ''); - const newArr = props.modelValue.filter((path) => path !== relative); - emit('update:modelValue', newArr); + const rel = file.url.replace(props.ossUrl, ''); + selectedFiles.value = selectedFiles.value.filter((p) => p !== rel); } -// 点击预览 +// 5. 预览 function handlePreview(file) { const idx = fileList.value.findIndex((item) => item.uid === file.uid); - if (idx !== -1) { + if (idx >= 0) { previewIndex.value = idx; previewShow.value = true; } diff --git a/sub-government-affairs-service/src/store/modules/coop.js b/sub-government-affairs-service/src/store/modules/coop.js new file mode 100644 index 0000000..b87a2f5 --- /dev/null +++ b/sub-government-affairs-service/src/store/modules/coop.js @@ -0,0 +1,15 @@ +import { defineStore } from 'pinia'; +import { getEnterList } from '@/apis/businessEntity'; + +export const useCoop = defineStore('useCoop', { + state: () => ({ + data: {}, + }), + actions: { + //订单 + getData(params) { + return Promise.resolve((useCoop().$state.data = params)); + }, + }, + getters: {}, +}); diff --git a/sub-government-affairs-service/src/views/inputSuppliesManage/material/annualPlan/index.vue b/sub-government-affairs-service/src/views/inputSuppliesManage/material/annualPlan/index.vue index 0b13ed8..01acc41 100644 --- a/sub-government-affairs-service/src/views/inputSuppliesManage/material/annualPlan/index.vue +++ b/sub-government-affairs-service/src/views/inputSuppliesManage/material/annualPlan/index.vue @@ -99,7 +99,13 @@ @@ -112,12 +112,12 @@ const route = useRoute(); const router = useRouter(); let number = ref(1); -let total = ref(99); +let total = ref(0); let isAll = ref(false); let data = ref([]); let page = reactive({ current: 1, - size: 100, + size: 20, }); let ids = ref([]); @@ -157,10 +157,19 @@ let datalist = reactive([ onMounted(() => { shoppingCart(page).then((res) => { data.value = res.data.records; + total.value = res.data.total; addIsCheckProperty(data); }); }); +const pagination = (value) => { + page.current = value; + shoppingCart(page).then((res) => { + data.value = res.data.records; + addIsCheckProperty(data); + }); +}; + function addIsCheckProperty(data) { if (Array.isArray(data)) { data.forEach((item) => { @@ -411,6 +420,7 @@ function removeCheckedItems(data) { background: $color-fff; } .fix-top { + z-index: 999; top: 0; display: inline-flex; justify-content: space-between; @@ -461,8 +471,8 @@ function removeCheckedItems(data) { bottom: 38px; } .fix-bottom { - // bottom: 30px; - bottom: 0; + bottom: 30px; + // bottom: 0; display: inline-flex; justify-content: space-between; width: 100%; diff --git a/sub-operation-service/src/views/shoppingCarts/sureOrders.vue b/sub-operation-service/src/views/shoppingCarts/sureOrders.vue index b291c56..24b6e2a 100644 --- a/sub-operation-service/src/views/shoppingCarts/sureOrders.vue +++ b/sub-operation-service/src/views/shoppingCarts/sureOrders.vue @@ -40,6 +40,7 @@ +
确认订单信息
diff --git a/sub-operation-service/src/views/userCenter/orderDetails.vue b/sub-operation-service/src/views/userCenter/orderDetails.vue index bd124f0..cd691cd 100644 --- a/sub-operation-service/src/views/userCenter/orderDetails.vue +++ b/sub-operation-service/src/views/userCenter/orderDetails.vue @@ -341,6 +341,9 @@ const back = () => { .order-list-warp-left { width: 55%; height: 70vh; + overflow: hidden; + overflow-y: scroll; + scrollbar-width: none; .order-list-warp-left-title { margin-top: 20px; font-size: 18px;