From d835d1b51f832889929cdf69010034a30ef44d02 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 17 十月 2024 13:57:29 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/batch/index.jsx | 134 ++++++++++++++------------------------------
1 files changed, 44 insertions(+), 90 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/batch/index.jsx b/zy-asrs-flow/src/pages/map/batch/index.jsx
index b9fc998..6c18bf1 100644
--- a/zy-asrs-flow/src/pages/map/batch/index.jsx
+++ b/zy-asrs-flow/src/pages/map/batch/index.jsx
@@ -1,46 +1,39 @@
import React, { useState, useRef, useEffect } from 'react';
import { Drawer, Space, Button, Card } from 'antd';
-import {
- ProCard,
- ProForm,
- ProFormCheckbox,
- ProFormDatePicker,
- ProFormDateRangePicker,
- ProFormSelect,
- ProFormText,
- ProFormTextArea,
- StepsForm,
-} from '@ant-design/pro-components';
import { FormattedMessage, useIntl, useModel } from '@umijs/max';
import { createStyles } from 'antd-style';
import * as Utils from '../utils'
import ShowJson from '../drawer/showJson';
+import BatchShelfView from './view'
+import BatchModify from './modify';
const useStyles = createStyles(({ token, css }) => {
return {
}
})
-const waitTime = (time = 100) => {
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve(true);
- }, time);
- });
-};
-
const BatchDrawer = (props) => {
const intl = useIntl();
const { styles } = useStyles();
- const { batchSprites } = props;
- const formRef = useRef();
+ const {
+ batchSprites,
+ model,
+ ModelEnum,
+ } = props;
useEffect(() => {
- console.log(batchSprites);
- }, []);
+ }, [props]);
const handleCancel = () => {
props.onCancel();
+ };
+
+ const handleDelete = () => {
+ batchSprites.forEach((curSprite) => {
+ Utils.getMapContainer().removeChild(curSprite);
+ Utils.removeSelectedEffect();
+ props.onCancel();
+ })
};
return (
@@ -52,11 +45,15 @@
rootStyle={{ position: "absolute" }}
mask={false}
width={600}
+ placement={'left'}
style={{
opacity: 1
}}
extra={
<Space>
+ <Button onClick={handleDelete} danger>
+ <FormattedMessage id='page.delete' defaultMessage='鍒犻櫎' />
+ </Button>
<Button onClick={handleCancel}>
<FormattedMessage id='common.cancel' defaultMessage='鍙栨秷' />
</Button>
@@ -72,73 +69,30 @@
height: '100%'
}}
>
- <StepsForm
- formRef={formRef}
- onFinish={async () => {
- await waitTime(1000);
- message.success('鎻愪氦鎴愬姛');
- }}
- formProps={{
- validateMessages: {
- required: '姝ら」涓哄繀濉」',
- },
- }}
- >
- {/************************* first ****************************/}
- <StepsForm.StepForm
- name="base"
- title="閫夋嫨璐ф灦"
- onFinish={() => {
- return true;
- }}
- >
- <ProForm.Item
- >
- <ShowJson
- data={
- batchSprites?.filter(item => {
- return item.data?.type === Utils.SENSOR_TYPE.SHELF
- }).map(item => {
- return item.data?.no;
- })
- }
- height='500px'
- jsonType={0}
- />
- </ProForm.Item>
- </StepsForm.StepForm>
- {/************************* second ****************************/}
- <StepsForm.StepForm
- name="checkbox"
- title="璁剧疆鍙傛暟"
- onFinish={(values) => {
- console.log(values);
- return true;
- }}
- >
- <ProForm.Group>
- <ProFormText name="dbname" label="涓氬姟 DB 鐢ㄦ埛鍚�" />
- <ProFormSelect
- label="Pod 璋冨害绛栫暐"
- name="remark2"
- initialValue="2"
- options={[
- {
- value: '1',
- label: '绛栫暐涓�',
- },
- { value: '2', label: '绛栫暐浜�' },
- ]}
- />
- </ProForm.Group>
- </StepsForm.StepForm>
- {/************************* third ****************************/}
- <StepsForm.StepForm
- name="time"
- title="缁撴灉"
- >
- </StepsForm.StepForm>
- </StepsForm >
+ {model === ModelEnum.OBSERVER_MODEL && (
+ <>
+ <ShowJson
+ data={
+ batchSprites?.map(item => {
+ return item.data?.no;
+ })
+ }
+ />
+ {/* <BatchShelfView
+
+ /> */}
+ </>
+ )}
+
+ {model === ModelEnum.SETTINGS_MODEL && (
+ <>
+ <BatchModify
+ batchSprites={batchSprites}
+ handleCancel={handleCancel}
+ />
+ </>
+ )}
+
</Card >
</Drawer >
</>
--
Gitblit v1.9.1