From 298a4183ddcd8f95591a2dea752a571cf417ecbd Mon Sep 17 00:00:00 2001
From: zhaoy <137053305@qq.com>
Date: Thu, 25 Jan 2024 17:42:45 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/routes.js | 7 -
.../deviceInfo/components/CreateForm.jsx | 4 +-
.../deviceInfo/components/DeviceFood.jsx | 216 ---------------
.../deviceInfo/components/StockMaterial.jsx | 195 --------------
.../components/StockMaterialForm.jsx | 151 -----------
src/pages/device/deviceInfo/index.jsx | 26 +-
.../device/devicepush/components/PushFrom.jsx | 67 -----
src/pages/device/devicepush/index.jsx | 254 ------------------
src/pages/device/devicepush/services.js | 30 ---
9 files changed, 4 insertions(+), 946 deletions(-)
delete mode 100644 src/pages/device/deviceInfo/components/DeviceFood.jsx
delete mode 100644 src/pages/device/deviceInfo/components/StockMaterial.jsx
delete mode 100644 src/pages/device/deviceInfo/components/StockMaterialForm.jsx
delete mode 100644 src/pages/device/devicepush/components/PushFrom.jsx
delete mode 100644 src/pages/device/devicepush/index.jsx
delete mode 100644 src/pages/device/devicepush/services.js
diff --git a/config/routes.js b/config/routes.js
index 9e99c34..f2a56e3 100644
--- a/config/routes.js
+++ b/config/routes.js
@@ -190,13 +190,6 @@ export default [
component: './device/productmanage',
access: 'k14',
},
- {
- name: '设备数据下发',
- icon: 'smile',
- path: '/device/devicepush',
- component: './device/devicepush',
- access: 'k14',
- },
// {
// name: '设备工艺信息',
// icon: 'smile',
diff --git a/src/pages/device/deviceInfo/components/CreateForm.jsx b/src/pages/device/deviceInfo/components/CreateForm.jsx
index 56c2790..d34c003 100644
--- a/src/pages/device/deviceInfo/components/CreateForm.jsx
+++ b/src/pages/device/deviceInfo/components/CreateForm.jsx
@@ -117,12 +117,12 @@ const CreateForm = (props) => {
)}
/>
-
+ {/*
工艺
配方
-
+ */}
,
-
-
- 确定
-
-
- ]}
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-export default StockMaterialForm;
diff --git a/src/pages/device/deviceInfo/index.jsx b/src/pages/device/deviceInfo/index.jsx
index cc20dc0..832ccbb 100644
--- a/src/pages/device/deviceInfo/index.jsx
+++ b/src/pages/device/deviceInfo/index.jsx
@@ -17,8 +17,7 @@ import {
GoodsTemplateExport,
} from './services';
import { gettree } from '../../org/orgamange/service';
-import DeviceFood from './components/DeviceFood';
-import StockMaterial from './components/StockMaterial';
+
import { values } from 'lodash';
const key = 'message';
@@ -31,12 +30,7 @@ const GoodsTypeManage = () => {
const [OrgListArray, setOrgListArray] = useState([]);
const [dicDataAny, setDicDataAny] = useState([]);
const [dicData, setDicData] = useState([]);
- const [DeviceVesionData, setDeviceVesionData] = useState([]);
const [deviceVersion, setDeviceVersion] = useState([]);
- // 是否显示 设备商品弹窗
- const [deviceFoodModal, setDeviceFoodModal] = useState();
- // 是否显示 库存物料弹窗
- const [stockModal, setStockModal] = useState(false);
/** 新建/更新窗口的弹窗 */
const [createModalVisible, handleModalVisible] = useState(false);
/** 分布更新窗口的弹窗 */
@@ -431,23 +425,7 @@ const handleRemove = async (selectedRows) => {
deviceVersions={deviceVersion}
values={currentRow || {}}
/>
- {deviceFoodModal && (
- setDeviceFoodModal(false)}
- onCancel={() => setDeviceFoodModal(false)}
- >
- )}
-
- {stockModal && (
- setStockModal(false)}
- onCancel={() => setStockModal(false)}
- >
- )}
+
);
};
diff --git a/src/pages/device/devicepush/components/PushFrom.jsx b/src/pages/device/devicepush/components/PushFrom.jsx
deleted file mode 100644
index 5558776..0000000
--- a/src/pages/device/devicepush/components/PushFrom.jsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import React, { useState, useEffect,useRef } from 'react';
-import { Modal, Row, Col, Checkbox, Select} from 'antd';
-import {
- GetDeviceList,
-} from '../services';
-const PushFrom = (props) => {
- const [deviceData, setdeviceData] = useState([]);
- useEffect(() => {
- console.log(props.values)
- GetDeviceList().then((r)=>{
- var data=r.data.map(x=>{
- return {value:x.id,label:x.name}
- })
- setdeviceData(data)
- })
- },[props.values])
- const handleChange=()=>{
-
- }
- const onChangedata=()=>{
-
- }
- return (
- {
- }}
- onCancel={() => {
- props.onCancel();
- }}
- destroyOnClose
- >
-
-
- 选择设备:
-
-
-
-
-
-
- 选择数据:
-
- 商品【选择商品】
- 物料 【选择物料】
- 工艺【选择工艺】
- 配方【选择配方】
-
-
-
-
- );
-};
-
-export default PushFrom;
diff --git a/src/pages/device/devicepush/index.jsx b/src/pages/device/devicepush/index.jsx
deleted file mode 100644
index c7503fc..0000000
--- a/src/pages/device/devicepush/index.jsx
+++ /dev/null
@@ -1,254 +0,0 @@
-import { PlusOutlined } from '@ant-design/icons';
-import { Button, message, Input, Drawer, Popconfirm } from 'antd';
-import React, { useState, useRef, useEffect } from 'react';
-import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
-import ProTable from '@ant-design/pro-table';
-import ProDescriptions from '@ant-design/pro-descriptions';
-import PushFrom from './components/PushFrom';
-
-import {
- GetDevicePushRecodePage,
- DevicePushRecodeDelete
-} from './services';
-
-
-
-const DevicePush = () => {
- /** 新建/更新窗口的弹窗 */
- const [createModalVisible, handleModalVisible] = useState(false);
- /** 分布更新窗口的弹窗 */
- const [showDetail, setShowDetail] = useState(false);
- const actionRef = useRef();
- const [currentRow, setCurrentRow] = useState();
- const [selectedRowsState, setSelectedRows] = useState([]);
- /** 国际化修改 */
- useEffect(() => {
-
-
- }, []);
-
- /**
- * 批量删除
- *
- * @param selectedRows
- */
-
- const handleRemove = async (selectedRows) => {
- const hide = message.loading('正在删除');
- if (!selectedRows) return true;
- await DevicePushRecodeDelete(selectedRows.map((row) => row.id)).then((r) => {
- if (r.succeeded) {
- message.success('删除成功');
- actionRef.current.reload();
- } else {
- message.error(r.errors);
- }
- });
- hide();
- return true;
- };
- const columns = [
- {
- title: '主键',
- dataIndex: 'id',
- hideInSearch: true,
- hideInTable: true,
- tip: '规则名称是唯一的 key',
- render: (dom, entity) => {
- return (
- {
- setCurrentRow(entity);
- setShowDetail(true);
- }}
- >
- {dom}
-
- );
- },
- },
- {
- title: '下发设备',
- dataIndex: 'deviceName',
- valueType: 'textarea',
- ellipsis: true,
- },
-
- {
- title: '下发数据',
- dataIndex: 'type',
- ellipsis: true,
- valueEnum: {
- 1: {
- text: '商品',
- },
- 2: {
- text: '物料',
- },
- 3: {
- text: '工艺',
- },
- 4: {
- text: '配方',
- },
- },
- },
- {
- title: '下发时间',
- dataIndex: 'ceateAt',
- hideInSearch: true,
- },
- {
- title: '操作',
- dataIndex: 'option',
- valueType: 'option',
- render: (_, record) => [
- {
- handleModalVisible(true);
- setCurrentRow(record);
- }}
- >
- 下发详情
- ,
- {
- await DeleteGoodsType(record.id).then((r) => {
- if (r.succeeded) {
- message.success('删除成功');
- actionRef.current.reload();
- } else {
- message.error(r.errors);
- }
- });
- }}
- onCancel={() => {}}
- >
- 删除
- ,
- ],
- },
- ];
-
- return (
-
- [
- {
- handleModalVisible(true);
- }}
- >
- 下发数据
- ,
- ]}
- request={async (params) => {
- var goodsData = [];
- var total = 0;
- await GetDevicePushRecodePage(params).then((r) => {
- goodsData = r.data.data;
- total = r.data.total;
- });
- return {
- data: goodsData,
- success: true,
- total: total,
- };
- }}
- columns={columns}
- rowSelection={{
- onChange: (_, selectedRows) => {
- setSelectedRows(selectedRows);
- },
- }}
- />
- {selectedRowsState?.length > 0 && (
-
- 已选择{' '}
-
- {selectedRowsState.length}
- {' '}
- 项
- {/*
- 服务调用次数总计 {selectedRowsState.reduce((pre, item) => pre + item.id, 0)} 万
- */}
-
- }
- >
- {
- await handleRemove(selectedRowsState);
- setSelectedRows([]);
- actionRef.current?.reloadAndRest?.();
- }}
- >
- 删除
-
- {/* 批量审批 */}
-
- )}
-
- {
-
- }}
- onCancel={() => {
- handleModalVisible(false);
- setCurrentRow(undefined);
- }}
- createModalVisible={createModalVisible}
- values={currentRow || {}}
- />
-
- {
- setCurrentRow(undefined);
- setShowDetail(false);
- }}
- closable={false}
- >
- {currentRow?.name && (
- ({
- data: currentRow || {},
- })}
- params={{
- id: currentRow?.name,
- }}
- columns={columns}
- />
- )}
-
-
- );
-};
-
-export default DevicePush;
diff --git a/src/pages/device/devicepush/services.js b/src/pages/device/devicepush/services.js
deleted file mode 100644
index 3d4c3fe..0000000
--- a/src/pages/device/devicepush/services.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import { request } from 'umi';
-export async function GetDevicePushRecodePage(data) {
- return request(`/saasstore/api/devicepushrecode/page`, {
- method: 'POST',
- data: data,
- });
- }
- export async function DevicePushRecodeAdd(data) {
- return request(`/saasstore/api/devicepushrecode/add`, {
- method: 'POST',
- data: data,
- });
- }
- export async function DevicePushRecodeUpdate(data) {
- return request(`/saasstore/api/devicepushrecode/update`, {
- method: 'POST',
- data: data,
- });
- }
- export async function DevicePushRecodeDelete(data) {
- return request(`/saasstore/api/devicepushrecode/delete`, {
- method: 'POST',
- data: data,
- });
- }
- export async function GetDeviceList() {
- return request(`/saasbase/api/device/list`, {
- method: 'GET',
- });
- }