diff --git a/.gitignore b/.gitignore
index 6c8ab28..46b05c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,9 @@
/node_modules
/src/.umi
/.history
+/.vs/BPA.SAAS.Web/v17
+/.vs
+/.history
*.vsidx
/.vs/slnx.sqlite
*.lock
diff --git a/config/routes.js b/config/routes.js
index e20600a..bd383b0 100644
--- a/config/routes.js
+++ b/config/routes.js
@@ -164,8 +164,8 @@ export default [
{
name: '产品管理',
icon: 'smile',
- path: '/device/deviceType',
- component: './device/deviceType',
+ path: '/device/product',
+ component: './device/product',
access: 'k12',
},
{
@@ -182,6 +182,13 @@ export default [
component: './device/deviceVesion',
access: 'k14',
},
+ {
+ name: '产品功能',
+ icon: 'smile',
+ path: '/device/productmanage',
+ component: './device/productmanage',
+ access: 'k14',
+ },
// {
// name: '设备工艺信息',
// icon: 'smile',
diff --git a/src/app.jsx b/src/app.jsx
index bb9e767..4997472 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -152,8 +152,8 @@ export async function getInitialState() {
code: 'deviceType',
name: '产品管理',
icon: 'smile',
- path: '/device/deviceType',
- component: './device/deviceType',
+ path: '/device/product',
+ component: './device/product',
access: 'k12',
},
{
diff --git a/src/pages/database/goods/goodsattribute/index.jsx b/src/pages/database/goods/goodsattribute/index.jsx
index 6577e81..e89aa7c 100644
--- a/src/pages/database/goods/goodsattribute/index.jsx
+++ b/src/pages/database/goods/goodsattribute/index.jsx
@@ -16,7 +16,52 @@ import {
} from './service';
-/**
+
+
+const goodsattribute = () => {
+ /** 新建/更新窗口的弹窗 */
+ const [createModalVisible, handleModalVisible] = useState(false);
+ const [createattrModalVisible, handleMattrodalVisible] = useState(false);
+ /** 分布更新窗口的弹窗 */
+
+ const [goodstypeData, setGoodstypeData] = useState([]);
+ const [attributeid, setAttributeid] = useState('');
+ const actionRef = useRef();
+ const [currentRow, setCurrentRow] = useState();
+ const [selectedRowsState, setSelectedRows] = useState([]);
+ const [treeData, setTreeData] = useState();
+ /** 国际化修改 */
+ useEffect(() => {
+
+ intDicData();
+ }, []);
+ function intDicData() {
+ gettree().then((r) => {
+ setTreeData(r.data);
+ });
+ }
+
+ /**
+ * 批量删除
+ *
+ * @param selectedRows
+ */
+
+ const handleRemove = async (selectedRows) => {
+ const hide = message.loading('正在删除');
+ if (!selectedRows) return true;
+ await deletegoodsattribute(selectedRows.map((row) => row.id)).then((r) => {
+ if (r.succeeded) {
+ message.success('删除成功');
+ actionRef.current.reload();
+ } else {
+ message.error(r.errors);
+ }
+ });
+ hide();
+ return true;
+ };
+ /**
* 添加节点
*
* @param fields
@@ -28,6 +73,7 @@ const handleAdd = async (fields) => {
await addgoodsattribute(JSON.stringify(fields)).then((r) => {
if (r.succeeded) {
message.success('添加成功');
+ actionRef.current.reload();
} else {
message.error(r.errors);
}
@@ -57,6 +103,7 @@ const handleUpdate = async (fields) => {
}).then((r) => {
if (r.succeeded) {
message.success('修改成功');
+ actionRef.current.reload();
} else {
message.error(r.errors);
}
@@ -69,50 +116,6 @@ const handleUpdate = async (fields) => {
return false;
}
};
-
-const goodsattribute = () => {
- /** 新建/更新窗口的弹窗 */
- const [createModalVisible, handleModalVisible] = useState(false);
- const [createattrModalVisible, handleMattrodalVisible] = useState(false);
- /** 分布更新窗口的弹窗 */
-
- const [goodstypeData, setGoodstypeData] = useState([]);
- const [attributeid, setAttributeid] = useState('');
- const actionRef = useRef();
- const [currentRow, setCurrentRow] = useState();
- const [selectedRowsState, setSelectedRows] = useState([]);
- const [treeData, setTreeData] = useState();
- /** 国际化修改 */
- useEffect(() => {
-
- intDicData();
- }, []);
- function intDicData() {
- gettree().then((r) => {
- setTreeData(r.data);
- });
- }
-
- /**
- * 批量删除
- *
- * @param selectedRows
- */
-
- const handleRemove = async (selectedRows) => {
- const hide = message.loading('正在删除');
- if (!selectedRows) return true;
- await deletegoodsattribute(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: '主键',
diff --git a/src/pages/database/goods/goodstechnology/components/CreateForm.jsx b/src/pages/database/goods/goodstechnology/components/CreateForm.jsx
deleted file mode 100644
index 03c2829..0000000
--- a/src/pages/database/goods/goodstechnology/components/CreateForm.jsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import React, { useState } from 'react';
-import { Modal, Form, Input, Button, Select } from 'antd';
-const CreateForm = (props) => {
- const { Option, OptGroup } = Select;
- return (
- {
- props?.onCancel();
- }}
- destroyOnClose
- maskClosable={false}
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-export default CreateForm;
diff --git a/src/pages/database/goods/goodstechnology/index.jsx b/src/pages/database/goods/goodstechnology/index.jsx
deleted file mode 100644
index 8c2419c..0000000
--- a/src/pages/database/goods/goodstechnology/index.jsx
+++ /dev/null
@@ -1,292 +0,0 @@
-import { DropboxOutlined, PlusOutlined } from '@ant-design/icons';
-import { Button, message, Input, Drawer, Modal, 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 CreateForm from './components/CreateForm';
-import ActionForm from './components/ActionForm';
-import {
- getGoodstechnologypage,
- addgoodstechnology,
- updategoodstechnology,
- deletegoodstechnology,
-} from './services';
-
-//页面 相当于 class
-/**
- * 添加节点
- *
- * @param fields
- */
-const handleAdd = async (fields) => {
- try {
- await addgoodstechnology(JSON.stringify(fields)).then((r) => {
- if (r.data) {
- message.success('添加成功');
- } else {
- message.error(r.errors);
- }
- });
- return true;
- } catch (error) {
- message.error('添加失败请重试!');
- return false;
- }
-};
-/**
- * 批量删除节点
- *
- * @param selectedRows
- */
-const handleRemove = async (ids) => {
- try {
- deletegoodstechnology(ids).then((r) => {
- if (r.data) {
- message.success('删除成功');
- } else {
- message.error(r.errors);
- }
- });
- return true;
- } catch (error) {
- message.error('删除失败,请重试');
- }
-};
-
-/**
- * 更新节点
- *
- * @param fields
- */
-
-const handleUpdate = async (fields) => {
- try {
- updategoodstechnology(fields).then((r) => {
- if (r.data) {
- message.success('修改成功');
- } else {
- message.error(r.errors);
- }
- });
- return true;
- } catch (error) {
- message.error('修改失败请重试!');
- return false;
- }
-};
-//页面 相当于 class
-const bomtechnology = () => {
- /** 新建/更新窗口的弹窗 */
- const [createModalVisible, handleModalVisible] = useState(false);
- /** 分布更新窗口的弹窗 */
-
- const [actionFormModalVisible, setactionFormModalVisible] = useState(false);
- const [showDetail, setShowDetail] = useState(false);
- //绑定
- const actionRef = useRef();
- const [currentRow, setCurrentRow] = useState();
- //选中的行
- const [selectedRowsState, setSelectedRows] = useState([]);
-
- /** 国际化配置 */
-
- const columns = [
- {
- title: '主键',
- dataIndex: 'id',
- tip: '规则名称是唯一的 key',
- hideInSearch: true,
- hideInTable: true,
- render: (dom, entity) => {
- return (
- {
- setCurrentRow(entity);
- setShowDetail(true);
- }}
- >
- {dom}
-
- );
- },
- },
- {
- title: '名称',
- dataIndex: 'name',
- valueType: 'textarea',
- ellipsis: true,
- search: true,
- },
- {
- title: '关联外键',
- dataIndex: 'foreignKeyRe',
- valueType: 'textarea',
- ellipsis: true,
- search: true,
- },
- {
- title: '状态',
- dataIndex: 'status',
- hideInForm: true,
- search: true,
- valueEnum: {
- 0: {
- text: '正常',
- status: 'Processing',
- },
- 1: {
- text: '停用',
- status: 'Success',
- },
- },
- },
- {
- title: '创建时间',
- dataIndex: 'createAt',
- valueType: 'date',
- hideInSearch: true,
- },
- {
- title: '操作',
- dataIndex: 'option',
- valueType: 'option',
- render: (_, record) => [
- {
- let a = 0;
- if (record.status == 0) {
- a = 1;
- }
- setCurrentRow((record.status = a));
-
- await handleUpdate(record).then((r) => {
- if (r) {
- actionRef.current.reload();
- } else {
- message.error('配置失败请重试!');
- }
- });
- }}
- >
- {record.status == 0 ? '停用' : '使用'}
- ,
- {
- handleModalVisible(true);
- setCurrentRow(record);
- actionRef.current?.reloadAndRest?.();
- }}
- >
- 更新
- ,
- {
- setactionFormModalVisible(true);
- setCurrentRow(record);
- actionRef.current?.reloadAndRest?.();
- }}
- >
- 模型配置
- ,
- {
- handleRemove([record.id]);
- actionRef.current?.reloadAndRest();
- }}
- onCancel={() => {}}
- >
- 删除
- ,
- ],
- },
- ];
-
- return (
-
- [
- ,
- ]}
- //数据绑定
- request={async (params) => {
- var data = [];
- var total = 0;
- await getGoodstechnologypage(params).then((r) => {
- data = r.data.data;
- data.forEach((x) => {
- x.status = x.status.toString();
- });
- total = r.data.total;
- });
- return {
- data: data,
- success: true,
- total: total,
- };
- }}
- // 每行选择点击事件
- rowSelection={{
- onChange: (_, selectedRows) => {
- setSelectedRows(selectedRows);
- },
- }}
- >
- {
- var success = false;
- if (value.id) {
- success = await handleUpdate(value);
- } else {
- success = await handleAdd(value);
- }
- if (success) {
- handleModalVisible(false);
- if (actionRef.current) {
- actionRef.current.reload();
- }
- }
- }}
- onCancel={() => {
- setCurrentRow(undefined);
- handleModalVisible(false);
- }}
- createModalVisible={createModalVisible}
- values={currentRow || {}}
- />
- {
- setCurrentRow(undefined);
- setactionFormModalVisible(false);
- }}
- />
-
- );
-};
-
-export default bomtechnology;
diff --git a/src/pages/device/deviceInfo/components/CreateForm.jsx b/src/pages/device/deviceInfo/components/CreateForm.jsx
index 6ea1ffa..56c2790 100644
--- a/src/pages/device/deviceInfo/components/CreateForm.jsx
+++ b/src/pages/device/deviceInfo/components/CreateForm.jsx
@@ -13,7 +13,7 @@ const CreateForm = (props) => {
useEffect(() => {
console.log(props.values)
if(Object.keys(props.values).length>0){
- GetDeviceVesion(props.values.deviceTypeKey).then((res)=>{
+ GetDeviceVesion(props.values.productId).then((res)=>{
setDeviceVesionData(res.data)
})
}
@@ -70,18 +70,18 @@ const CreateForm = (props) => {
-
-