fix(amap):core
This commit is contained in:
parent
b62973648b
commit
3fd8831503
|
@ -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 (
|
||||
|
|
|
@ -129,7 +129,7 @@ const LayOut = (props: Store) => {
|
|||
<Outlet />
|
||||
</Content>
|
||||
<Footer style={{ textAlign: "center" }}>
|
||||
Ant Design ©{new Date().getFullYear()} Created by Ant UED
|
||||
黄水武装部 ©{new Date().getFullYear()} Created
|
||||
</Footer>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -74,7 +74,7 @@ const Material = (props: Store) => {
|
|||
>
|
||||
物资出库
|
||||
</Button> */}
|
||||
<Popconfirm
|
||||
<Popconfirm
|
||||
title="出库操作"
|
||||
description="请确认是否出库该物资?"
|
||||
onConfirm={() => {
|
||||
|
@ -90,7 +90,7 @@ const Material = (props: Store) => {
|
|||
cancelText="No"
|
||||
>
|
||||
<Button danger size="small">
|
||||
物资出库
|
||||
物资出库
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
|
@ -112,7 +112,6 @@ const Material = (props: Store) => {
|
|||
删除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
|
||||
</Space>
|
||||
);
|
||||
};
|
||||
|
@ -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) => {
|
|||
/>
|
||||
<Modal
|
||||
title={!record?.id ? "添加物资" : "编辑物资"}
|
||||
width={1200}
|
||||
width={1000}
|
||||
open={isModalOpen}
|
||||
afterClose={() => formRef.current?.resetFields()}
|
||||
onOk={() => formRef.current?.submit()}
|
||||
|
|
|
@ -92,8 +92,8 @@ const MaterialCat = (props: Store) => {
|
|||
dataSource={materialCatStore.list}
|
||||
/>
|
||||
<Modal
|
||||
title={!record?.id ? "添加个人属性" : "编辑个人属性"}
|
||||
width={1200}
|
||||
title={!record?.id ? "添加物资类别" : "编辑物资类别"}
|
||||
width={600}
|
||||
open={isModalOpen}
|
||||
afterClose={() => formRef.current?.resetFields()}
|
||||
onOk={() => formRef.current?.submit()}
|
||||
|
|
|
@ -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: "分类描述",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -34,7 +34,6 @@ export const defaultConfig = [
|
|||
label: "副标题",
|
||||
name: "sub_title",
|
||||
value: "",
|
||||
rules: [{ required: true, message: "请输入副标题!" }],
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
|
|
|
@ -44,6 +44,8 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
|||
}
|
||||
// 分页
|
||||
setPages(page: Pages) {
|
||||
console.log(page);
|
||||
|
||||
this.page = page
|
||||
this.getlist()
|
||||
}
|
||||
|
@ -81,10 +83,11 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
|||
// 获取列表
|
||||
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<B> = []
|
||||
|
|
Loading…
Reference in New Issue