fix(amap):core

This commit is contained in:
wang_yp 2024-10-15 15:41:22 +08:00
parent b62973648b
commit 3fd8831503
11 changed files with 72 additions and 30 deletions

View File

@ -14,14 +14,14 @@ const BTable = (props: any) => {
}; };
const onShowSizeChange = (current, pageSize) => { const onShowSizeChange = (current, pageSize) => {
store.setPages({ store.setPages({
PageNum: current, Offset: current,
PageSize: pageSize, Size: pageSize,
}); });
}; };
const onChange: PaginationProps["onChange"] = (page) => { const onChange: PaginationProps["onChange"] = (page) => {
store.setPages({ store.setPages({
PageNum: page, Offset: page,
PageSize: 20, Size: 20,
}); });
}; };
return ( return (

View File

@ -129,7 +129,7 @@ const LayOut = (props: Store) => {
<Outlet /> <Outlet />
</Content> </Content>
<Footer style={{ textAlign: "center" }}> <Footer style={{ textAlign: "center" }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED ©{new Date().getFullYear()} Created
</Footer> </Footer>
</div> </div>
); );

View File

@ -16,7 +16,7 @@ export default function MapContainer() {
const Amap = await AMapLoader.load({ const Amap = await AMapLoader.load({
key: "d58999d072ed7e5897d3900a769cfda0", // 申请好的Web端开发者Key首次调用 load 时必填 key: "d58999d072ed7e5897d3900a769cfda0", // 申请好的Web端开发者Key首次调用 load 时必填
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15 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", { amap = new Amap.Map("container", {
@ -26,7 +26,30 @@ export default function MapContainer() {
mapStyle: "amap://styles/darkblue", mapStyle: "amap://styles/darkblue",
resizeEnable: true, 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); // addMaket(Amap,amap);
MapUtl.loadMap = Amap; MapUtl.loadMap = Amap;
MapUtl.amap = amap; MapUtl.amap = amap;

View File

@ -10,7 +10,7 @@ const Ac = (props: Store) => {
var option = { var option = {
legend: { legend: {
top: "5%", top: "5%",
right: "right", left:"left",
textStyle: { textStyle: {
color: "#fff", color: "#fff",
}, },
@ -29,14 +29,24 @@ const Ac = (props: Store) => {
pageTextStyle: { pageTextStyle: {
color: "#999", //翻页数字颜色 color: "#999", //翻页数字颜色
}, //翻页数字设置 }, //翻页数字设置
pageIconSize: 10, pageIconSize: 5,
}, },
series: [ series: [
{ {
center: ["30%", "40%"], center: ["70%", "40%"],
name: "Access From", name: "Access From",
type: "pie", type: "pie",
radius: ["40%", "60%"], radius: ["40%", "60%"],
itemStyle : {
normal : {
label : {
show : false
},
labelLine : {
show : false
}
},
},
label: { label: {
backgroundColor: "#F6F8FC", backgroundColor: "#F6F8FC",
borderColor: "#8C8D8E", borderColor: "#8C8D8E",

View File

@ -33,6 +33,16 @@ const Wz = (props: Store) => {
name: "Access From", name: "Access From",
type: "pie", type: "pie",
radius: ["40%", "60%"], radius: ["40%", "60%"],
itemStyle : {
normal : {
label : {
show : false
},
labelLine : {
show : false
}
},
},
label: { label: {
backgroundColor: "#F6F8FC", backgroundColor: "#F6F8FC",
borderColor: "#8C8D8E", borderColor: "#8C8D8E",

View File

@ -74,7 +74,7 @@ const Material = (props: Store) => {
> >
</Button> */} </Button> */}
<Popconfirm <Popconfirm
title="出库操作" title="出库操作"
description="请确认是否出库该物资?" description="请确认是否出库该物资?"
onConfirm={() => { onConfirm={() => {
@ -90,7 +90,7 @@ const Material = (props: Store) => {
cancelText="No" cancelText="No"
> >
<Button danger size="small"> <Button danger size="small">
</Button> </Button>
</Popconfirm> </Popconfirm>
<Popconfirm <Popconfirm
@ -112,7 +112,6 @@ const Material = (props: Store) => {
</Button> </Button>
</Popconfirm> </Popconfirm>
</Space> </Space>
); );
}; };
@ -121,7 +120,6 @@ const Material = (props: Store) => {
record.expiry_date = dayjs(record.expiry_date); record.expiry_date = dayjs(record.expiry_date);
setRecord(record); setRecord(record);
}; };
const cancel: PopconfirmProps["onCancel"] = (e) => { const cancel: PopconfirmProps["onCancel"] = (e) => {
console.log(e); console.log(e);
@ -132,8 +130,13 @@ const Material = (props: Store) => {
...values, ...values,
pid: values.pid ?? 0, pid: values.pid ?? 0,
storage_cloumn: Number(values.storage_cloumn), 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) { if (!record?.id) {
materialStore.add(data); materialStore.add(data);
} else { } else {
@ -175,7 +178,7 @@ const Material = (props: Store) => {
/> />
<Modal <Modal
title={!record?.id ? "添加物资" : "编辑物资"} title={!record?.id ? "添加物资" : "编辑物资"}
width={1200} width={1000}
open={isModalOpen} open={isModalOpen}
afterClose={() => formRef.current?.resetFields()} afterClose={() => formRef.current?.resetFields()}
onOk={() => formRef.current?.submit()} onOk={() => formRef.current?.submit()}

View File

@ -92,8 +92,8 @@ const MaterialCat = (props: Store) => {
dataSource={materialCatStore.list} dataSource={materialCatStore.list}
/> />
<Modal <Modal
title={!record?.id ? "添加个人属性" : "编辑个人属性"} title={!record?.id ? "添加物资类别" : "编辑物资类别"}
width={1200} width={600}
open={isModalOpen} open={isModalOpen}
afterClose={() => formRef.current?.resetFields()} afterClose={() => formRef.current?.resetFields()}
onOk={() => formRef.current?.submit()} onOk={() => formRef.current?.submit()}

View File

@ -20,14 +20,6 @@ export const defaultConfig = [
value: "", value: "",
rules: [{ required: true, message: "请输入仓库名称!" }], rules: [{ required: true, message: "请输入仓库名称!" }],
}, },
{
type: FormType.select,
label: "上级分类",
name: "pid",
value: 0,
selectUrl:"suppliesCat/list",
},
{ {
type: FormType.input, type: FormType.input,
label: "分类描述", label: "分类描述",

View File

@ -52,8 +52,10 @@ const PoliticalStudy = (props: Store) => {
...values, ...values,
score: Number(values.score), score: Number(values.score),
}; };
if (values.file_url) { if (values.file_url.length>0) {
data.file_url = values.file_url[0].url; data.file_url = values.file_url[0].url;
}else{
data.file_url = "";
} }
if (!record?.id) { if (!record?.id) {
politicalStudyStore.add(data); politicalStudyStore.add(data);

View File

@ -34,7 +34,6 @@ export const defaultConfig = [
label: "副标题", label: "副标题",
name: "sub_title", name: "sub_title",
value: "", value: "",
rules: [{ required: true, message: "请输入副标题!" }],
}, },
{ {
type: "input", type: "input",

View File

@ -44,6 +44,8 @@ class BaseStore<B> implements BaseStoreInterface<B> {
} }
// 分页 // 分页
setPages(page: Pages) { setPages(page: Pages) {
console.log(page);
this.page = page this.page = page
this.getlist() this.getlist()
} }
@ -81,10 +83,11 @@ class BaseStore<B> implements BaseStoreInterface<B> {
// 获取列表 // 获取列表
async getlist(params?: any) { async getlist(params?: any) {
this.listStatus = true; this.listStatus = true;
console.log(this.page);
try { try {
let res = await baseHttp.get(this.urlConfig.LIST, { let res = await baseHttp.get(this.urlConfig.LIST, {
size: this.page?.Size | 20, size: this.page?.Size ?? 20,
offset: this.page?.Offset | 1, offset: this.page?.Offset ?? 1,
...params ...params
}); });
let data: Array<B> = [] let data: Array<B> = []