From 3fd88315034cbad05d7173061fc80d58fb63bd5a Mon Sep 17 00:00:00 2001 From: wang_yp <357754663@qq.com> Date: Tue, 15 Oct 2024 15:41:22 +0800 Subject: [PATCH] fix(amap):core --- src/components/b_table.tsx | 8 +++--- src/components/layout/layout.tsx | 2 +- src/components/map/MapComponent.tsx | 27 +++++++++++++++++-- src/pages/home/homeRigrt/ac.tsx | 16 ++++++++--- src/pages/home/homeRigrt/wz.tsx | 10 +++++++ src/pages/materialMgmt/material.tsx | 15 ++++++----- src/pages/materialMgmt/materialCat.tsx | 4 +-- src/pages/materialMgmt/mcat_column.tsx | 8 ------ src/pages/politicalStudy/index.tsx | 4 ++- src/pages/politicalStudy/political_column.tsx | 1 - src/store/baseStore.ts | 7 +++-- 11 files changed, 72 insertions(+), 30 deletions(-) diff --git a/src/components/b_table.tsx b/src/components/b_table.tsx index 6e81c38..20a36f2 100644 --- a/src/components/b_table.tsx +++ b/src/components/b_table.tsx @@ -14,14 +14,14 @@ const BTable = (props: any) => { }; const onShowSizeChange = (current, pageSize) => { store.setPages({ - PageNum: current, - PageSize: pageSize, + Offset: current, + Size: pageSize, }); }; const onChange: PaginationProps["onChange"] = (page) => { store.setPages({ - PageNum: page, - PageSize: 20, + Offset: page, + Size: 20, }); }; return ( diff --git a/src/components/layout/layout.tsx b/src/components/layout/layout.tsx index 3ec9dee..2ef0c7b 100644 --- a/src/components/layout/layout.tsx +++ b/src/components/layout/layout.tsx @@ -129,7 +129,7 @@ const LayOut = (props: Store) => { ); diff --git a/src/components/map/MapComponent.tsx b/src/components/map/MapComponent.tsx index 602ed81..8949b26 100644 --- a/src/components/map/MapComponent.tsx +++ b/src/components/map/MapComponent.tsx @@ -16,7 +16,7 @@ export default function MapContainer() { const Amap = await AMapLoader.load({ key: "d58999d072ed7e5897d3900a769cfda0", // 申请好的Web端开发者Key,首次调用 load 时必填 version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 - plugins: ["AMap.Scale","AMap.MoveAnimation","AMap.Weather"], + plugins: ["AMap.Scale","AMap.MoveAnimation","AMap.Weather,AMap.DistrictSearch"], }); amap = new Amap.Map("container", { @@ -26,7 +26,30 @@ export default function MapContainer() { mapStyle: "amap://styles/darkblue", resizeEnable: true, }); - setmaps(amap); + // const district = new Amap.DistrictSearch({ + // subdistrict: 3, //返回下一级行政区 + // extensions: "all", //返回行政区边界坐标组等具体信息 + // level: "street", //查询行政级别为 市 + // }); + // district.search("510116", function (status,result){ + // console.log(result); + // if(status === "complete"){ + // const bundler = result.districtList[0].boundaries; + // const polygon = new Amap.Polygon({ + // map: amap, + // path: bundler, + // strokeColor: "#fff", //线颜色 + // strokeOpacity: 1, //线透明度 + // strokeWeight: 3, //线宽 + // fillColor: "#fff", //填充色 + // fillOpacity: 0.4, //填充透明度 + // }); + // // amap.add(polygon) + // amap.setFitView(); + // } + // }) + + // setmaps(amap); // addMaket(Amap,amap); MapUtl.loadMap = Amap; MapUtl.amap = amap; diff --git a/src/pages/home/homeRigrt/ac.tsx b/src/pages/home/homeRigrt/ac.tsx index 7a9f0ef..37a9a61 100644 --- a/src/pages/home/homeRigrt/ac.tsx +++ b/src/pages/home/homeRigrt/ac.tsx @@ -10,7 +10,7 @@ const Ac = (props: Store) => { var option = { legend: { top: "5%", - right: "right", + left:"left", textStyle: { color: "#fff", }, @@ -29,14 +29,24 @@ const Ac = (props: Store) => { pageTextStyle: { color: "#999", //翻页数字颜色 }, //翻页数字设置 - pageIconSize: 10, + pageIconSize: 5, }, series: [ { - center: ["30%", "40%"], + center: ["70%", "40%"], name: "Access From", type: "pie", radius: ["40%", "60%"], + itemStyle : { + normal : { + label : { + show : false + }, + labelLine : { + show : false + } + }, + }, label: { backgroundColor: "#F6F8FC", borderColor: "#8C8D8E", diff --git a/src/pages/home/homeRigrt/wz.tsx b/src/pages/home/homeRigrt/wz.tsx index 2f227fe..c55ce31 100644 --- a/src/pages/home/homeRigrt/wz.tsx +++ b/src/pages/home/homeRigrt/wz.tsx @@ -33,6 +33,16 @@ const Wz = (props: Store) => { name: "Access From", type: "pie", radius: ["40%", "60%"], + itemStyle : { + normal : { + label : { + show : false + }, + labelLine : { + show : false + } + }, + }, label: { backgroundColor: "#F6F8FC", borderColor: "#8C8D8E", diff --git a/src/pages/materialMgmt/material.tsx b/src/pages/materialMgmt/material.tsx index 39e075d..77ff33f 100644 --- a/src/pages/materialMgmt/material.tsx +++ b/src/pages/materialMgmt/material.tsx @@ -74,7 +74,7 @@ const Material = (props: Store) => { > 物资出库 */} - { @@ -90,7 +90,7 @@ const Material = (props: Store) => { cancelText="No" > { 删除 - ); }; @@ -121,7 +120,6 @@ const Material = (props: Store) => { record.expiry_date = dayjs(record.expiry_date); setRecord(record); }; - const cancel: PopconfirmProps["onCancel"] = (e) => { console.log(e); @@ -132,8 +130,13 @@ const Material = (props: Store) => { ...values, pid: values.pid ?? 0, storage_cloumn: Number(values.storage_cloumn), - supplie_piker: values.supplie_piker[0].name, + // supplie_piker: values.supplie_piker[0].name, }; + if (values.supplie_piker.length > 0) { + data.supplie_piker = values.supplie_piker[0].name; + }else{ + data.supplie_piker = "" + } if (!record?.id) { materialStore.add(data); } else { @@ -175,7 +178,7 @@ const Material = (props: Store) => { /> formRef.current?.resetFields()} onOk={() => formRef.current?.submit()} diff --git a/src/pages/materialMgmt/materialCat.tsx b/src/pages/materialMgmt/materialCat.tsx index 926a124..783bd44 100644 --- a/src/pages/materialMgmt/materialCat.tsx +++ b/src/pages/materialMgmt/materialCat.tsx @@ -92,8 +92,8 @@ const MaterialCat = (props: Store) => { dataSource={materialCatStore.list} /> formRef.current?.resetFields()} onOk={() => formRef.current?.submit()} diff --git a/src/pages/materialMgmt/mcat_column.tsx b/src/pages/materialMgmt/mcat_column.tsx index 33f9240..9839386 100644 --- a/src/pages/materialMgmt/mcat_column.tsx +++ b/src/pages/materialMgmt/mcat_column.tsx @@ -20,14 +20,6 @@ export const defaultConfig = [ value: "", rules: [{ required: true, message: "请输入仓库名称!" }], }, - { - type: FormType.select, - label: "上级分类", - name: "pid", - value: 0, - selectUrl:"suppliesCat/list", - - }, { type: FormType.input, label: "分类描述", diff --git a/src/pages/politicalStudy/index.tsx b/src/pages/politicalStudy/index.tsx index cf7a39c..4a2ccca 100644 --- a/src/pages/politicalStudy/index.tsx +++ b/src/pages/politicalStudy/index.tsx @@ -52,8 +52,10 @@ const PoliticalStudy = (props: Store) => { ...values, score: Number(values.score), }; - if (values.file_url) { + if (values.file_url.length>0) { data.file_url = values.file_url[0].url; + }else{ + data.file_url = ""; } if (!record?.id) { politicalStudyStore.add(data); diff --git a/src/pages/politicalStudy/political_column.tsx b/src/pages/politicalStudy/political_column.tsx index 02d6a16..8626ec5 100644 --- a/src/pages/politicalStudy/political_column.tsx +++ b/src/pages/politicalStudy/political_column.tsx @@ -34,7 +34,6 @@ export const defaultConfig = [ label: "副标题", name: "sub_title", value: "", - rules: [{ required: true, message: "请输入副标题!" }], }, { type: "input", diff --git a/src/store/baseStore.ts b/src/store/baseStore.ts index c20f57b..11ac9a9 100644 --- a/src/store/baseStore.ts +++ b/src/store/baseStore.ts @@ -44,6 +44,8 @@ class BaseStore implements BaseStoreInterface { } // 分页 setPages(page: Pages) { + console.log(page); + this.page = page this.getlist() } @@ -81,10 +83,11 @@ class BaseStore implements BaseStoreInterface { // 获取列表 async getlist(params?: any) { this.listStatus = true; + console.log(this.page); try { let res = await baseHttp.get(this.urlConfig.LIST, { - size: this.page?.Size | 20, - offset: this.page?.Offset | 1, + size: this.page?.Size ?? 20, + offset: this.page?.Offset ?? 1, ...params }); let data: Array = []