@@ -1,36 +1,76 @@ | |||||
import React, { useState, useEffect } from 'react'; | import React, { useState, useEffect } from 'react'; | ||||
import { Modal, Tree, Row, Col, List,Tag } from 'antd'; | |||||
import { Modal, Tree, Row, Col, Checkbox } from 'antd'; | |||||
import api from '../service'; | import api from '../service'; | ||||
import Enumerable from 'linq'; | import Enumerable from 'linq'; | ||||
const MenuForm = (props) => { | const MenuForm = (props) => { | ||||
const [load, setLoad] = useState(); | |||||
const [selectedRowsState, setSelectedRows] = useState(); | |||||
const [load, setLoad] = useState([]); | |||||
const [checkedKeys, setCheckedKeys] = useState(); | const [checkedKeys, setCheckedKeys] = useState(); | ||||
const [indeterminate, setindeterminate] = useState(false); | |||||
const [checkAll,setcheckAll] = useState(false); | |||||
useEffect(async () => { | useEffect(async () => { | ||||
var arr = []; | var arr = []; | ||||
var filteredArr=[] | |||||
Enumerable.from(props.values).forEach(t => { | Enumerable.from(props.values).forEach(t => { | ||||
if(!t.isParentMenu){ | if(!t.isParentMenu){ | ||||
arr.push(t.id); | arr.push(t.id); | ||||
} | } | ||||
if(t.id !== null && typeof t.id !== "undefined"){ | |||||
filteredArr.push(t); | |||||
} | |||||
}); | }); | ||||
setCheckedKeys(arr) | setCheckedKeys(arr) | ||||
console.log("props.values",props.datas) | |||||
var parm={getType:'ALL',type:props.datas.type} | |||||
var ret = await api.GetMenu(parm); | |||||
var data = Enumerable.from(ret.data).toArray(); | |||||
var data =props.treeData; | |||||
if(getTreeLength(data)===filteredArr.length){ | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setcheckAll(false); | |||||
if(props.values.length==0){ | |||||
setindeterminate(false); | |||||
}else{ | |||||
setindeterminate(true); | |||||
} | |||||
} | |||||
setLoad(data); | setLoad(data); | ||||
}, [props.modalVisible]) | }, [props.modalVisible]) | ||||
const lbl = () => { | |||||
var arr = []; | |||||
Enumerable.from(props.values).forEach(t => { | |||||
arr.push(<Tag style={{ width: 100, margin: 'Center' }} color="processing">{t.name}</Tag>); | |||||
}); | |||||
return arr; | |||||
function getTreeLength(tree) { | |||||
let length = tree.length; // 初始化计算器为根节点的子节点数量 | |||||
for (let i = 0; i < tree.length; i++) { | |||||
if (Array.isArray(tree[i].children)) { // 如果当前节点有子节点 | |||||
length += getTreeLength(tree[i].children); // 将子节点的长度加到计算器上 | |||||
} | |||||
} | |||||
return length; | |||||
} | |||||
const onCheckAllChange = (e) => { | |||||
if(!checkAll){ | |||||
var data=getAllIds(load,[]); | |||||
setCheckedKeys(data) | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setCheckedKeys([]) | |||||
setcheckAll(false) | |||||
setindeterminate(false); | |||||
} | |||||
}; | |||||
function getAllIds(tree, result) { | |||||
console.log(tree) | |||||
//遍历树 获取id数组 | |||||
for (const i in tree) { | |||||
result.push(tree[i].key); // 遍历项目满足条件后的操作 | |||||
if (tree[i].children) { | |||||
//存在子节点就递归 | |||||
getAllIds(tree[i].children, result); | |||||
} | |||||
} | |||||
return result; | |||||
} | } | ||||
var html = <Modal width={700} | var html = <Modal width={700} | ||||
bodyStyle={{ padding: '32px 40px 48px' }} | bodyStyle={{ padding: '32px 40px 48px' }} | ||||
destroyOnClose | destroyOnClose | ||||
@@ -41,9 +81,21 @@ const MenuForm = (props) => { | |||||
maskClosable={false}> | maskClosable={false}> | ||||
<Row> | <Row> | ||||
<Col span={8}> | <Col span={8}> | ||||
<Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll}> | |||||
全选 | |||||
</Checkbox> | |||||
<Tree treeData={load} | <Tree treeData={load} | ||||
onCheck={(keys, e) => { setCheckedKeys(keys) }} | |||||
defaultExpandAll={true} | |||||
onCheck={(keys, e) => { | |||||
if(getTreeLength(props.treeData)==keys.length){ | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setcheckAll(false) | |||||
setindeterminate(true); | |||||
} | |||||
setCheckedKeys(keys) ; | |||||
}} | |||||
defaultExpandAll={false} | |||||
checkedKeys={checkedKeys} | checkedKeys={checkedKeys} | ||||
checkable /> | checkable /> | ||||
</Col> | </Col> | ||||
@@ -123,7 +123,7 @@ const companyManage = () => { | |||||
var parm={getType:'ALL',type:0} | var parm={getType:'ALL',type:0} | ||||
api.GetMenu(parm).then((r) => { | api.GetMenu(parm).then((r) => { | ||||
if(r.data){ | if(r.data){ | ||||
setTreeData(r.data.data); | |||||
setTreeData(r.data); | |||||
} | } | ||||
}); | }); | ||||
@@ -26,7 +26,7 @@ const CreateForm = (props) => { | |||||
<Form.Item name="id" hidden={true}> | <Form.Item name="id" hidden={true}> | ||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="pid" label="上级名称" rules={[{ required: true }]}> | |||||
<Form.Item name="pid" label="上级名称" rules={[{ required: false }]}> | |||||
<TreeSelect | <TreeSelect | ||||
allowClear | allowClear | ||||
showSearch | showSearch | ||||
@@ -1,5 +1,5 @@ | |||||
import { PlusOutlined } from '@ant-design/icons'; | import { PlusOutlined } from '@ant-design/icons'; | ||||
import { Modal, Button, message } from 'antd'; | |||||
import { Modal, Button, message,Popconfirm } from 'antd'; | |||||
import React, { useState, useRef, useEffect } from 'react'; | import React, { useState, useRef, useEffect } from 'react'; | ||||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | ||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
@@ -192,7 +192,27 @@ const GoodsTypeManage = () => { | |||||
> | > | ||||
更新 | 更新 | ||||
</a>, | </a>, | ||||
<Popconfirm | |||||
type="primary" | |||||
key="primary" | |||||
title="确认删除吗?" | |||||
okText="是" | |||||
cancelText="否" | |||||
onConfirm={async () => { | |||||
await DelDeviceInfo([record.id]).then((r) => { | |||||
if(r.data){ | |||||
message.success('删除成功,即将刷新'); | |||||
actionRef.current.reload(); | |||||
}else{ | |||||
message.error('删除失败'); | |||||
} | |||||
}); | |||||
}} | |||||
onCancel={() => { }} | |||||
> | |||||
<a href="#">删除</a> | |||||
</Popconfirm>, | |||||
// <a | // <a | ||||
// key="copy" | // key="copy" | ||||
// onClick={() => { | // onClick={() => { | ||||
@@ -326,15 +346,15 @@ const handleRemove = async (selectedRows) => { | |||||
> | > | ||||
<PlusOutlined /> 新建 | <PlusOutlined /> 新建 | ||||
</Button>, | </Button>, | ||||
<Button | |||||
onClick={async () => { | |||||
await handleRemove(selectedRowsState); | |||||
setSelectedRows([]); | |||||
actionRef.current?.reloadAndRest?.(); | |||||
}} | |||||
> | |||||
删除 | |||||
</Button>, | |||||
// <Button | |||||
// onClick={async () => { | |||||
// await handleRemove(selectedRowsState); | |||||
// setSelectedRows([]); | |||||
// actionRef.current?.reloadAndRest?.(); | |||||
// }} | |||||
// > | |||||
// 删除 | |||||
// </Button>, | |||||
]} | ]} | ||||
request={async (params) => { | request={async (params) => { | ||||
var data = []; | var data = []; | ||||
@@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons'; | |||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
import CreateForm from './components/CreateForm'; | import CreateForm from './components/CreateForm'; | ||||
import { GetDeviceVesionPage, AddDeviceVesion, DelDeviceVesion, UpdateDeviceVesion, GetProductList,UpdateStatus } from "./services" | import { GetDeviceVesionPage, AddDeviceVesion, DelDeviceVesion, UpdateDeviceVesion, GetProductList,UpdateStatus } from "./services" | ||||
import { history } from 'umi'; | |||||
const key = 'message'; | const key = 'message'; | ||||
//添加 | //添加 | ||||
@@ -136,16 +136,17 @@ const GoodsTypeManage = () => { | |||||
dataIndex: 'productName', | dataIndex: 'productName', | ||||
valueType: 'textarea', | valueType: 'textarea', | ||||
}, | }, | ||||
{ | |||||
title: '是否存在模板', | |||||
dataIndex: 'templatePath', | |||||
valueType: 'textarea', | |||||
render: (_, record) => [ | |||||
<div> | |||||
<Tag color="#f50" style={{ textAlign: "center", display: (record.templatePath == null||record.templatePath == "") ? "none" : "block" }} >存在模板</Tag> | |||||
<Tag style={{ textAlign: "center", display: (record.templatePath == null||record.templatePath == "")? "block" : "none" }} color="#2db7f5">无模板</Tag> | |||||
</div>], | |||||
}, | |||||
// { | |||||
// title: '是否存在模板', | |||||
// dataIndex: 'templatePath', | |||||
// valueType: 'textarea', | |||||
// hideInSearch: true, | |||||
// render: (_, record) => [ | |||||
// <div> | |||||
// <Tag color="#f50" style={{ textAlign: "center", display: (record.templatePath == null||record.templatePath == "") ? "none" : "block" }} >存在模板</Tag> | |||||
// <Tag style={{ textAlign: "center", display: (record.templatePath == null||record.templatePath == "")? "block" : "none" }} color="#2db7f5">无模板</Tag> | |||||
// </div>], | |||||
// }, | |||||
{ | { | ||||
title: '操作', | title: '操作', | ||||
dataIndex: 'option', | dataIndex: 'option', | ||||
@@ -182,26 +183,37 @@ const GoodsTypeManage = () => { | |||||
> | > | ||||
<a href="#">删除</a> | <a href="#">删除</a> | ||||
</Popconfirm>, | </Popconfirm>, | ||||
<a | |||||
key="config" | |||||
onClick={() => { | |||||
setCurrentRow(record); | |||||
setIsModalOpen(true); | |||||
setIsAddGoodsTemplate(false); | |||||
}} > 上传设备工艺模型</a>, | |||||
<a | |||||
key="config" | |||||
onClick={() => { | |||||
setCurrentRow(record); | |||||
setIsModalOpen(true); | |||||
setIsAddGoodsTemplate(true); | |||||
}} > 上传商品工艺模版</a>, | |||||
<a | |||||
key="config" | |||||
href={record.templatePath} | |||||
> 下载工艺模板</a> | |||||
// <a | |||||
// key="config" | |||||
// onClick={() => { | |||||
// setCurrentRow(record); | |||||
// setIsModalOpen(true); | |||||
// setIsAddGoodsTemplate(false); | |||||
// }} > 上传设备工艺模型</a>, | |||||
// <a | |||||
// key="config" | |||||
// onClick={() => { | |||||
// setCurrentRow(record); | |||||
// setIsModalOpen(true); | |||||
// setIsAddGoodsTemplate(true); | |||||
// }} > 上传商品工艺模版</a>, | |||||
// <a | |||||
// key="config" | |||||
// href={record.templatePath} | |||||
// > 下载工艺模板</a>, | |||||
<a | |||||
key="config" | |||||
onClick={() => { | |||||
history.push({ | |||||
pathname: '/device/productmanage', | |||||
query: { | |||||
isAdd: false, | |||||
values: record, | |||||
tabStatus: 'basis' | |||||
}, | |||||
}); | |||||
}} > 管理</a>, | |||||
], | ], | ||||
}, | }, | ||||
]; | ]; | ||||
@@ -6,7 +6,7 @@ import { PlusOutlined } from '@ant-design/icons'; | |||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
import CreateForm from './components/CreateForm'; | import CreateForm from './components/CreateForm'; | ||||
import { GetProductPage, AddProduct, DelProduct, UpdateProduct,UpdateStatus } from "./services" | import { GetProductPage, AddProduct, DelProduct, UpdateProduct,UpdateStatus } from "./services" | ||||
import { history } from 'umi'; | |||||
const key = 'message'; | const key = 'message'; | ||||
const { Paragraph, Text } = Typography; | const { Paragraph, Text } = Typography; | ||||
const GoodsTypeManage = () => { | const GoodsTypeManage = () => { | ||||
@@ -75,18 +75,7 @@ const GoodsTypeManage = () => { | |||||
> | > | ||||
<a href="#">删除</a> | <a href="#">删除</a> | ||||
</Popconfirm>, | </Popconfirm>, | ||||
<a | |||||
key="config" | |||||
onClick={() => { | |||||
history.push({ | |||||
pathname: '/device/productmanage', | |||||
query: { | |||||
isAdd: false, | |||||
values: record, | |||||
tabStatus: 'basis' | |||||
}, | |||||
}); | |||||
}} > 管理</a>, | |||||
], | ], | ||||
}, | }, | ||||
]; | ]; | ||||
@@ -50,7 +50,7 @@ const CreateForm = (props) => { | |||||
form.setFieldsValue({ | form.setFieldsValue({ | ||||
id: props?.values?.id, | id: props?.values?.id, | ||||
type: props?.values?.type, | type: props?.values?.type, | ||||
deviceVersionKey: props?.values?.deviceVersionKey, | |||||
//deviceVersionKey: props?.values?.deviceVersionKey, | |||||
name: props?.values?.name, | name: props?.values?.name, | ||||
dataType: props?.values?.dataType, | dataType: props?.values?.dataType, | ||||
dataRange: props?.values?.dataRange, | dataRange: props?.values?.dataRange, | ||||
@@ -200,7 +200,7 @@ const onChangeboolLabel1=(e)=>{ | |||||
<Form.Item name="id" hidden={true}> | <Form.Item name="id" hidden={true}> | ||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item label={'产品版本'} name="deviceVersionKey" rules={[{ required: true }]}> | |||||
{/* <Form.Item label={'产品版本'} name="deviceVersionKey" rules={[{ required: true }]}> | |||||
<Select> | <Select> | ||||
{props.DeviceVesionData.map((item, index) => { | {props.DeviceVesionData.map((item, index) => { | ||||
return ( | return ( | ||||
@@ -210,7 +210,7 @@ const onChangeboolLabel1=(e)=>{ | |||||
); | ); | ||||
})} | })} | ||||
</Select> | </Select> | ||||
</Form.Item> | |||||
</Form.Item> */} | |||||
<Form.Item name="type" label="功能类型"> | <Form.Item name="type" label="功能类型"> | ||||
<Radio.Group name="type" defaultValue={0} value={arttue} onChange={onchagetype} disabled={disabled}> | <Radio.Group name="type" defaultValue={0} value={arttue} onChange={onchagetype} disabled={disabled}> | ||||
<Radio.Button value={0}>属性</Radio.Button> | <Radio.Button value={0}>属性</Radio.Button> | ||||
@@ -51,7 +51,7 @@ const onChange=(e)=>{ | |||||
// initialValues={props?.values} | // initialValues={props?.values} | ||||
onFinish={()=>{ | onFinish={()=>{ | ||||
form.setFieldsValue({ | form.setFieldsValue({ | ||||
topics:"/"+props.productCode+"/${deviceKey}/use/"+topics | |||||
topics:"/"+props.productCode+"/"+props.productVesion+"/${deviceKey}/use/"+topics | |||||
}) | }) | ||||
console.log(form.getFieldsValue()) | console.log(form.getFieldsValue()) | ||||
props?.onFinish(form.getFieldsValue()) | props?.onFinish(form.getFieldsValue()) | ||||
@@ -61,20 +61,20 @@ const onChange=(e)=>{ | |||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="topics" label="Topics类" rules={[{ required: true, max: 64, whitespace: true }]}> | <Form.Item name="topics" label="Topics类" rules={[{ required: true, max: 64, whitespace: true }]}> | ||||
<Input addonBefore={props.productCode+"/${deviceKey}/use/"} onChange={onChange} placeholder="请输入Topics类" /> | |||||
<Input addonBefore={props.productCode+"/"+props.productVesion+"/${deviceKey}/use/"} onChange={onChange} placeholder="请输入Topics类" /> | |||||
</Form.Item> | </Form.Item> | ||||
<Form.Item label={'类型'} name="topicsType" rules={[{ required: true }]}> | <Form.Item label={'类型'} name="topicsType" rules={[{ required: true }]}> | ||||
<Select options={[ | <Select options={[ | ||||
{ | { | ||||
value: '0', | |||||
value: 0, | |||||
label: '发布', | label: '发布', | ||||
}, | }, | ||||
{ | { | ||||
value: '1', | |||||
value: 1, | |||||
label: '订阅', | label: '订阅', | ||||
}, | }, | ||||
{ | { | ||||
value: '2', | |||||
value: 2, | |||||
label: '发布和订阅', | label: '发布和订阅', | ||||
}, | }, | ||||
]}/> | ]}/> | ||||
@@ -1,5 +1,5 @@ | |||||
import { DropboxOutlined, PlusOutlined,ArrowLeftOutlined } from '@ant-design/icons'; | import { DropboxOutlined, PlusOutlined,ArrowLeftOutlined } from '@ant-design/icons'; | ||||
import { Button, message, Input, Upload, Modal, Popconfirm,Card,Typography } from 'antd'; | |||||
import { Button, message, Input, Upload, Modal, Popconfirm,Card,Typography,Tabs } from 'antd'; | |||||
import React, { useState, useRef, useEffect } from 'react'; | import React, { useState, useRef, useEffect } from 'react'; | ||||
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | ||||
import ProTable from '@ant-design/pro-table'; | import ProTable from '@ant-design/pro-table'; | ||||
@@ -16,7 +16,8 @@ import { | |||||
getproducttopicspage, | getproducttopicspage, | ||||
addproducttopics, | addproducttopics, | ||||
updateproducttopics, | updateproducttopics, | ||||
deleteproducttopics | |||||
deleteproducttopics, | |||||
GetProduct | |||||
} from './services'; | } from './services'; | ||||
import { history } from 'umi'; | import { history } from 'umi'; | ||||
const { Paragraph, Text } = Typography; | const { Paragraph, Text } = Typography; | ||||
@@ -72,14 +73,16 @@ const bomtechnology = (props) => { | |||||
//绑定 | //绑定 | ||||
const actionRef = useRef(); | const actionRef = useRef(); | ||||
const actiontopisRef= useRef(); | const actiontopisRef= useRef(); | ||||
const actiontopismrRef= useRef(); | |||||
const [currentRow, setCurrentRow] = useState(); | const [currentRow, setCurrentRow] = useState(); | ||||
const [currenttopsRow,setcurrenttopsRow] = useState(); | const [currenttopsRow,setcurrenttopsRow] = useState(); | ||||
//选中的行 | //选中的行 | ||||
const [selectedRowsState, setSelectedRows] = useState([]); | const [selectedRowsState, setSelectedRows] = useState([]); | ||||
const [dataSource,setdataSource]=useState([]); | const [dataSource,setdataSource]=useState([]); | ||||
const [datafunctionSource,setdatafunctionSource]=useState([]); | const [datafunctionSource,setdatafunctionSource]=useState([]); | ||||
const [DeviceVesionData, setDeviceVesionData] = useState([]); | |||||
const [DeviceVesionEnum, setDeviceVesionEnum] = useState({}); | |||||
// const [DeviceVesionData, setDeviceVesionData] = useState([]); | |||||
// const [DeviceVesionEnum, setDeviceVesionEnum] = useState({}); | |||||
const [Product, setProduct] = useState({}); | |||||
const [total,settotal]=useState(0); | const [total,settotal]=useState(0); | ||||
const [totalfun,settotalfun]=useState(0); | const [totalfun,settotalfun]=useState(0); | ||||
/** 国际化配置 */ | /** 国际化配置 */ | ||||
@@ -92,17 +95,21 @@ const bomtechnology = (props) => { | |||||
SetCurrTabKey(tabStatus.tabActiveKey); | SetCurrTabKey(tabStatus.tabActiveKey); | ||||
if(!props.location.query.values.id){ | if(!props.location.query.values.id){ | ||||
history.push({ | history.push({ | ||||
pathname: '/device/product', | |||||
pathname: '/device/deviceVesion', | |||||
}); | }); | ||||
}else{ | }else{ | ||||
GetDeviceVesion(props.location.query.values.id).then((res)=>{ | |||||
let list = {}; | |||||
res.data.forEach((item) => { | |||||
list[item.id] = { text: item.vesion }; | |||||
}); | |||||
setDeviceVesionData(res.data) | |||||
setDeviceVesionEnum(list) | |||||
var params={productId:props.location.query.values.id,deviceTypeKey:props.location.query.values.id,current:1,pageSize:10} | |||||
// GetDeviceVesion(props.location.query.values.id).then((res)=>{ | |||||
// let list = {}; | |||||
// res.data.forEach((item) => { | |||||
// list[item.id] = { text: item.vesion }; | |||||
// }); | |||||
// setDeviceVesionData(res.data) | |||||
// setDeviceVesionEnum(list) | |||||
// }) | |||||
GetProduct(props.location.query.values.productId).then((res)=>{ | |||||
setProduct(res.data) | |||||
var params={productId:props.location.query.values.productId,productVesionId:props.location.query.values.id,isDefault:true,current:1,pageSize:10} | |||||
LoadfunData(params) | LoadfunData(params) | ||||
LoadtopisData(params); | LoadtopisData(params); | ||||
}) | }) | ||||
@@ -195,14 +202,14 @@ const bomtechnology = (props) => { | |||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{ | |||||
title: '版本', | |||||
dataIndex: 'vesion', | |||||
valueType: 'select', | |||||
ellipsis: true, | |||||
search: true, | |||||
valueEnum:DeviceVesionEnum | |||||
}, | |||||
// { | |||||
// title: '版本', | |||||
// dataIndex: 'vesion', | |||||
// valueType: 'select', | |||||
// ellipsis: true, | |||||
// search: true, | |||||
// valueEnum:DeviceVesionEnum | |||||
// }, | |||||
{ | { | ||||
title: '创建时间', | title: '创建时间', | ||||
dataIndex: 'createAt', | dataIndex: 'createAt', | ||||
@@ -242,6 +249,7 @@ const bomtechnology = (props) => { | |||||
title: 'Topics类', | title: 'Topics类', | ||||
dataIndex: 'topics', | dataIndex: 'topics', | ||||
valueType: 'textarea', | valueType: 'textarea', | ||||
with:500, | |||||
render: (text) => <Paragraph style={{display:'inline'}} copyable>{text}</Paragraph>, | render: (text) => <Paragraph style={{display:'inline'}} copyable>{text}</Paragraph>, | ||||
}, | }, | ||||
{ | { | ||||
@@ -275,7 +283,7 @@ const bomtechnology = (props) => { | |||||
dataIndex: 'option', | dataIndex: 'option', | ||||
valueType: 'option', | valueType: 'option', | ||||
fixed: 'right', | fixed: 'right', | ||||
width: 450, | |||||
width: 250, | |||||
render: (_, record) => [ | render: (_, record) => [ | ||||
<a | <a | ||||
key="config" | key="config" | ||||
@@ -293,7 +301,7 @@ const bomtechnology = (props) => { | |||||
await deleteproducttopics([record.id]).then((r) => { | await deleteproducttopics([record.id]).then((r) => { | ||||
message.success('删除成功,即将刷新'); | message.success('删除成功,即将刷新'); | ||||
var params={productId:props.location.query.values.id,current:1,pageSize:10} | |||||
var params={productId:props.location.query.values.productId,current:1,pageSize:10} | |||||
LoadtopisData(params) | LoadtopisData(params) | ||||
}); | }); | ||||
}} | }} | ||||
@@ -305,6 +313,60 @@ const bomtechnology = (props) => { | |||||
], | ], | ||||
}, | }, | ||||
] | ] | ||||
const topicsmrcolumns=[ | |||||
{ | |||||
title: '主键', | |||||
dataIndex: 'id', | |||||
tip: '规则名称是唯一的 key', | |||||
hideInSearch: true, | |||||
hideInTable: true, | |||||
render: (dom, entity) => { | |||||
return ( | |||||
<a | |||||
onClick={() => { | |||||
setCurrentRow(entity); | |||||
setShowDetail(true); | |||||
}} | |||||
> | |||||
{dom} | |||||
</a> | |||||
); | |||||
}, | |||||
}, | |||||
{ | |||||
title: 'Topics类', | |||||
dataIndex: 'topics', | |||||
valueType: 'textarea', | |||||
with:500, | |||||
render: (text) => <Paragraph style={{display:'inline'}} copyable>{text}</Paragraph>, | |||||
}, | |||||
{ | |||||
title: '类型', | |||||
dataIndex: 'topicsType', | |||||
valueType: 'select', | |||||
ellipsis: true, | |||||
search: true, | |||||
valueEnum: { | |||||
0: { | |||||
text: '发布', | |||||
}, | |||||
1: { | |||||
text: '订阅', | |||||
}, | |||||
2: { | |||||
text: '发布和订阅', | |||||
}, | |||||
}, | |||||
}, | |||||
{ | |||||
title: '描述', | |||||
dataIndex: 'description', | |||||
valueType: 'textarea', | |||||
ellipsis: true, | |||||
search: false, | |||||
with:350, | |||||
}, | |||||
] | |||||
const operationTabList = [ | const operationTabList = [ | ||||
{ | { | ||||
key: 'basis', | key: 'basis', | ||||
@@ -312,7 +374,7 @@ const bomtechnology = (props) => { | |||||
}, | }, | ||||
{ | { | ||||
key: 'topis', | key: 'topis', | ||||
tab: 'topis类列表', | |||||
tab: 'topics类列表', | |||||
}, | }, | ||||
]; | ]; | ||||
@@ -341,7 +403,7 @@ const handleAdd = async (fields) => { | |||||
await addgoodstechnology(JSON.stringify(fields)).then((r) => { | await addgoodstechnology(JSON.stringify(fields)).then((r) => { | ||||
if (r.data) { | if (r.data) { | ||||
message.success('添加成功'); | message.success('添加成功'); | ||||
var params={productId:props.location.query.values.id,deviceTypeKey:props.location.query.values.id,current:1,pageSize:10} | |||||
var params={productId:props.location.query.values.productId,deviceTypeKey:props.location.query.values.productId,current:1,pageSize:10} | |||||
LoadfunData(params) | LoadfunData(params) | ||||
handleModalVisible(false); | handleModalVisible(false); | ||||
if (actionRef.current) { | if (actionRef.current) { | ||||
@@ -366,7 +428,7 @@ const handleRemove = async (ids) => { | |||||
deletegoodstechnology(ids).then((r) => { | deletegoodstechnology(ids).then((r) => { | ||||
if (r.data) { | if (r.data) { | ||||
message.success('删除成功'); | message.success('删除成功'); | ||||
var params={productId:props.location.query.values.id,deviceTypeKey:props.location.query.values.id,current:1,pageSize:10} | |||||
var params={productId:props.location.query.values.productId,deviceTypeKey:props.location.query.values.productId,current:1,pageSize:10} | |||||
LoadfunData(params) | LoadfunData(params) | ||||
} else { | } else { | ||||
message.error(r.errors); | message.error(r.errors); | ||||
@@ -392,7 +454,7 @@ const handleRemove = async (ids) => { | |||||
updategoodstechnology(fields).then((r) => { | updategoodstechnology(fields).then((r) => { | ||||
if (r.data) { | if (r.data) { | ||||
message.success('修改成功'); | message.success('修改成功'); | ||||
var params={productId:props.location.query.values.id,deviceTypeKey:props.location.query.values.id,current:1,pageSize:10} | |||||
var params={productId:props.location.query.values.productId,deviceTypeKey:props.location.query.values.productId,current:1,pageSize:10} | |||||
LoadfunData(params) | LoadfunData(params) | ||||
handleModalVisible(false); | handleModalVisible(false); | ||||
if (actionRef.current) { | if (actionRef.current) { | ||||
@@ -432,10 +494,123 @@ const handleRemove = async (ids) => { | |||||
// } | // } | ||||
// //initGoodsType() | // //initGoodsType() | ||||
}; | }; | ||||
const onTabsChange=(key)=> { | |||||
console.log(key) | |||||
var params={} | |||||
if(key=="1"){ | |||||
params.productId=props.location.query.values.productId | |||||
params.productVesionId=props.location.query.values.id | |||||
params.isDefault=true; | |||||
params.current=1; | |||||
params.pageSize=10 | |||||
LoadtopisData(params) | |||||
}else{ | |||||
//actiontopisRef.current.reload(); | |||||
params.productId=props.location.query.values.productId | |||||
params.productVesionId=props.location.query.values.id | |||||
params.isDefault=false; | |||||
params.current=1; | |||||
params.pageSize=10 | |||||
LoadtopisData(params) | |||||
} | |||||
} | |||||
const zdytopicslist={ | |||||
zdy: ( | |||||
<ProTable | |||||
id="table1" | |||||
actionRef={actiontopisRef} | |||||
rowKey="id" | |||||
pagination={{ defaultPageSize: 10,total:total }} | |||||
search={{labelWidth: 120}} | |||||
columns={topicscolumns} | |||||
toolBarRender={() => [ | |||||
<Button | |||||
type="primary" | |||||
key="primary" | |||||
onClick={() => { | |||||
setcreateTopisModalVisible(true); | |||||
setcurrenttopsRow({}); | |||||
}} | |||||
> | |||||
<PlusOutlined /> 新建 | |||||
</Button>, | |||||
]} | |||||
//数据绑定 | |||||
dataSource={dataSource} | |||||
request={async (params) => { | |||||
var data = []; | |||||
var total = 0; | |||||
params.productId=props.location.query.values.productId | |||||
params.productVesionId=props.location.query.values.id | |||||
params.isDefault=false; | |||||
await getproducttopicspage(params).then((r) => { | |||||
setdataSource( r.data.data) | |||||
data = r.data.data; | |||||
total = r.data.total; | |||||
}); | |||||
return { | |||||
data: data, | |||||
success: true, | |||||
total: total, | |||||
}; | |||||
}} | |||||
// 每行选择点击事件 | |||||
rowSelection={{ | |||||
onChange: (_, selectedRows) => { | |||||
setSelectedRows(selectedRows); | |||||
}, | |||||
}} | |||||
/> | |||||
), | |||||
mr:( | |||||
<ProTable | |||||
id="table3" | |||||
actionRef={actiontopismrRef} | |||||
rowKey="id" | |||||
search={false} | |||||
pagination={{ defaultPageSize: 10,total:total }} | |||||
columns={topicsmrcolumns} | |||||
toolBarRender={false} | |||||
//数据绑定 | |||||
dataSource={dataSource} | |||||
request={async (params) => { | |||||
var data = []; | |||||
var total = 0; | |||||
params.productId=props.location.query.values.productId | |||||
params.productVesionId=props.location.query.values.id | |||||
params.isDefault=true; | |||||
await getproducttopicspage(params).then((r) => { | |||||
setdataSource( r.data.data) | |||||
data = r.data.data; | |||||
total = r.data.total; | |||||
}); | |||||
return { | |||||
data: data, | |||||
success: true, | |||||
total: total, | |||||
}; | |||||
}} | |||||
/> | |||||
) | |||||
}; | |||||
const items=[{ | |||||
key: '1', | |||||
label: '默认topics', | |||||
children: zdytopicslist.mr, | |||||
}, | |||||
{ | |||||
key: '2', | |||||
label: '自定义topics', | |||||
children: zdytopicslist.zdy | |||||
}] | |||||
const contentList = { | const contentList = { | ||||
basis: ( | basis: ( | ||||
<Card style={{marginBottom: 24}} bordered={false}> | <Card style={{marginBottom: 24}} bordered={false}> | ||||
<ProTable | <ProTable | ||||
id="table2" | |||||
actionRef={actionRef} | actionRef={actionRef} | ||||
rowKey="id" | rowKey="id" | ||||
pagination={{ defaultPageSize: 10 }} | pagination={{ defaultPageSize: 10 }} | ||||
@@ -472,8 +647,8 @@ const handleRemove = async (ids) => { | |||||
request={async (params) => { | request={async (params) => { | ||||
var data = []; | var data = []; | ||||
var total = 0; | var total = 0; | ||||
params.deviceTypeKey=props.location.query.values.id | |||||
params.productId=props.location.query.values.productId | |||||
params.productVesionId=props.location.query.values.id | |||||
await getGoodstechnologypage(params).then((r) => { | await getGoodstechnologypage(params).then((r) => { | ||||
data = r.data.data; | data = r.data.data; | ||||
setdatafunctionSource( r.data.data) | setdatafunctionSource( r.data.data) | ||||
@@ -496,8 +671,8 @@ const handleRemove = async (ids) => { | |||||
onFinish={async (value) => { | onFinish={async (value) => { | ||||
console.log("jnlaile ") | console.log("jnlaile ") | ||||
console.log(value) | console.log(value) | ||||
value.productId=props.location.query.values.id | |||||
var success = false; | |||||
value.productId=props.location.query.values.productId | |||||
value.deviceVersionKey=props.location.query.values.id; | |||||
if (value.id) { | if (value.id) { | ||||
await handleUpdate(value); | await handleUpdate(value); | ||||
} else { | } else { | ||||
@@ -510,7 +685,7 @@ const handleRemove = async (ids) => { | |||||
}} | }} | ||||
createModalVisible={createModalVisible} | createModalVisible={createModalVisible} | ||||
values={currentRow || {}} | values={currentRow || {}} | ||||
DeviceVesionData={DeviceVesionData} | |||||
// DeviceVesionData={DeviceVesionData} | |||||
/> | /> | ||||
<ActionForm actionFormModalVisible={actionFormModalVisible} | <ActionForm actionFormModalVisible={actionFormModalVisible} | ||||
values={currentRow || {} } | values={currentRow || {} } | ||||
@@ -523,46 +698,21 @@ const handleRemove = async (ids) => { | |||||
), | ), | ||||
topis: ( | topis: ( | ||||
<Card style={{marginBottom: 24}} bordered={false}> | <Card style={{marginBottom: 24}} bordered={false}> | ||||
<ProTable | |||||
id="table1" | |||||
actionRef={actiontopisRef} | |||||
rowKey="id" | |||||
pagination={{ defaultPageSize: 10,total:total }} | |||||
search={{labelWidth: 120}} | |||||
columns={topicscolumns} | |||||
toolBarRender={() => [ | |||||
<Button | |||||
type="primary" | |||||
key="primary" | |||||
onClick={() => { | |||||
setcreateTopisModalVisible(true); | |||||
setcurrenttopsRow({}); | |||||
}} | |||||
> | |||||
<PlusOutlined /> 新建 | |||||
</Button>, | |||||
<Tabs tabPosition='left' items={items} onChange={onTabsChange}/> | |||||
]} | |||||
//数据绑定 | |||||
dataSource={dataSource} | |||||
// 每行选择点击事件 | |||||
rowSelection={{ | |||||
onChange: (_, selectedRows) => { | |||||
setSelectedRows(selectedRows); | |||||
}, | |||||
}} | |||||
></ProTable> | |||||
<CreateTopis createModalVisible={createTopisModalVisible} productCode={props.location.query.values.key} | |||||
<CreateTopis createModalVisible={createTopisModalVisible} productCode={Product.key} productVesion={props.location.query.values?.vesion} | |||||
values={currenttopsRow || {}} | values={currenttopsRow || {}} | ||||
onFinish={async (value) => { | onFinish={async (value) => { | ||||
value.productId=props.location.query.values.id | |||||
value.productId=props.location.query.values.productId | |||||
value.productVesionId=props.location.query.values.id | |||||
if (value.id) { | if (value.id) { | ||||
await updateproducttopics(value).then((r)=>{ | await updateproducttopics(value).then((r)=>{ | ||||
if (r.data) { | if (r.data) { | ||||
message.success('修改成功'); | message.success('修改成功'); | ||||
actiontopisRef.current.reload(); | |||||
setcreateTopisModalVisible(false) | setcreateTopisModalVisible(false) | ||||
var params={productId:props.location.query.values.id,current:1,pageSize:10} | |||||
LoadtopisData(params) | |||||
//var params={productId:props.location.query.values.productId,current:1,pageSize:10} | |||||
//LoadtopisData(params) | |||||
} else { | } else { | ||||
message.error(r.errors); | message.error(r.errors); | ||||
} | } | ||||
@@ -571,8 +721,9 @@ const handleRemove = async (ids) => { | |||||
await addproducttopics(value).then((r)=>{ | await addproducttopics(value).then((r)=>{ | ||||
if (r.data) { | if (r.data) { | ||||
message.success('添加成功'); | message.success('添加成功'); | ||||
var params={productId:props.location.query.values.id,current:1,pageSize:10} | |||||
LoadtopisData(params) | |||||
actiontopisRef.current.reload(); | |||||
// var params={productId:props.location.query.values.productId,current:1,pageSize:10} | |||||
// LoadtopisData(params) | |||||
setcreateTopisModalVisible(false) | setcreateTopisModalVisible(false) | ||||
} else { | } else { | ||||
message.error(r.errors); | message.error(r.errors); | ||||
@@ -590,20 +741,19 @@ const handleRemove = async (ids) => { | |||||
), | ), | ||||
}; | }; | ||||
return ( | return ( | ||||
<PageContainer host header={{ | <PageContainer host header={{ | ||||
title: [<a key="back" | title: [<a key="back" | ||||
onClick={() => { | onClick={() => { | ||||
history.push({ | history.push({ | ||||
pathname: '/device/product', | |||||
pathname: '/device/deviceVesion', | |||||
}); | }); | ||||
}}><ArrowLeftOutlined />返回</a>, | }}><ArrowLeftOutlined />返回</a>, | ||||
<div style={{backgroundColor:'#f3eaea',width:'1640px',height: '54px'}}> | <div style={{backgroundColor:'#f3eaea',width:'1640px',height: '54px'}}> | ||||
<div style={{fontSize: '14px',color: 'cornflowerblue'}}> | <div style={{fontSize: '14px',color: 'cornflowerblue'}}> | ||||
<span style={{marginRight:20,marginLeft:10,marginTop:10,float:'left' }}>产品名称:<span style={{marginLeft:10}}>{props.location.query.values.name}</span></span> | |||||
<span style={{marginRight:120,marginLeft:10,marginTop:10,float:'right'}}>产品key: <Paragraph style={{display:'inline'}} copyable>{props.location.query.values.key}</Paragraph></span></div> | |||||
<span style={{marginRight:20,marginLeft:10,marginTop:10,float:'left' }}>产品版本:<span style={{marginLeft:10}}>{props.location.query.values?.vesion}</span></span> | |||||
<span style={{marginRight:20,marginLeft:10,marginTop:10,float:'left' }}>产品名称:<span style={{marginLeft:10}}>{Product?.name}</span></span> | |||||
<span style={{marginRight:120,marginLeft:10,marginTop:10,float:'right'}}>产品key: <Paragraph style={{display:'inline'}} copyable>{Product?.key}</Paragraph></span></div> | |||||
</div> | </div> | ||||
], | ], | ||||
breadcrumb: {}, | breadcrumb: {}, | ||||
@@ -77,4 +77,9 @@ export async function addgoodstechnology(data) { | |||||
return request(getDataBaseUrl()+`/api/devicevesion/getdevicevesion?productId=${TypeCode}`, { | return request(getDataBaseUrl()+`/api/devicevesion/getdevicevesion?productId=${TypeCode}`, { | ||||
method: 'Get', | method: 'Get', | ||||
}); | }); | ||||
} | |||||
export async function GetProduct(productId) { | |||||
return request(getDataBaseUrl()+`/api/product/getproduct?productId=${productId}`, { | |||||
method: 'Get', | |||||
}); | |||||
} | } |
@@ -41,7 +41,7 @@ const CreateForm = (props) => { | |||||
<Form.Item name="id" hidden={true}> | <Form.Item name="id" hidden={true}> | ||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="pid" label="上级名称" rules={[{ required: true }]}> | |||||
<Form.Item name="pid" label="上级名称" rules={[{ required: false }]}> | |||||
<TreeSelect | <TreeSelect | ||||
style={{ width: '100%' }} | style={{ width: '100%' }} | ||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} | dropdownStyle={{ maxHeight: 400, overflow: 'auto' }} | ||||
@@ -1,31 +1,79 @@ | |||||
import React, { useState, useEffect } from 'react'; | import React, { useState, useEffect } from 'react'; | ||||
import { Modal, Tree, Row, Col, List,Tag } from 'antd'; | |||||
import api from './service'; | |||||
import { Modal, Tree, Row, Col, Checkbox } from 'antd'; | |||||
import Enumerable from 'linq'; | import Enumerable from 'linq'; | ||||
const MenuForm = (props) => { | const MenuForm = (props) => { | ||||
const [load, setLoad] = useState(); | const [load, setLoad] = useState(); | ||||
const [selectedRowsState, setSelectedRows] = useState(); | |||||
const [checkedKeys, setCheckedKeys] = useState(); | const [checkedKeys, setCheckedKeys] = useState(); | ||||
const [indeterminate, setindeterminate] = useState(false); | |||||
const [checkAll,setcheckAll] = useState(false); | |||||
useEffect(async () => { | useEffect(async () => { | ||||
var arr = []; | var arr = []; | ||||
var filteredArr=[] | |||||
Enumerable.from(props.values).forEach(t => { | Enumerable.from(props.values).forEach(t => { | ||||
arr.push(t.id); | |||||
if(!t.isParentMenu){ | |||||
arr.push(t.id); | |||||
} | |||||
if(t.id !== null && typeof t.id !== "undefined"){ | |||||
filteredArr.push(t); | |||||
} | |||||
}); | }); | ||||
setCheckedKeys(arr) | setCheckedKeys(arr) | ||||
var ret = await api.SelectTree(); | |||||
var data = Enumerable.from(ret.data).toArray(); | |||||
var data =props.treeData; | |||||
console.log("props.values",props.values) | |||||
console.log("data",data) | |||||
console.log("filteredArr",filteredArr) | |||||
if(getTreeLength(data)===filteredArr.length){ | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setcheckAll(false); | |||||
if(props.values.length==0){ | |||||
setindeterminate(false); | |||||
}else{ | |||||
setindeterminate(true); | |||||
} | |||||
} | |||||
setLoad(data); | setLoad(data); | ||||
}, [props.modalVisible]) | }, [props.modalVisible]) | ||||
function getTreeLength(tree) { | |||||
let length = tree.length; // 初始化计算器为根节点的子节点数量 | |||||
for (let i = 0; i < tree.length; i++) { | |||||
if (Array.isArray(tree[i].children)) { // 如果当前节点有子节点 | |||||
length += getTreeLength(tree[i].children); // 将子节点的长度加到计算器上 | |||||
} | |||||
} | |||||
return length; | |||||
} | |||||
const onCheckAllChange = (e) => { | |||||
if(!checkAll){ | |||||
var data=getAllIds(load,[]); | |||||
setCheckedKeys(data) | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setCheckedKeys([]) | |||||
setcheckAll(false) | |||||
setindeterminate(false); | |||||
} | |||||
}; | |||||
const lbl = () => { | |||||
var arr = []; | |||||
Enumerable.from(props.values).forEach(t => { | |||||
arr.push(<Tag style={{ width: 68, margin: 'Center' }} color="processing">{t.name}</Tag>); | |||||
}); | |||||
return arr; | |||||
function getAllIds(tree, result) { | |||||
console.log(tree) | |||||
//遍历树 获取id数组 | |||||
for (const i in tree) { | |||||
result.push(tree[i].key); // 遍历项目满足条件后的操作 | |||||
if (tree[i].children) { | |||||
//存在子节点就递归 | |||||
getAllIds(tree[i].children, result); | |||||
} | |||||
} | |||||
return result; | |||||
} | } | ||||
var html = <Modal width={700} | var html = <Modal width={700} | ||||
bodyStyle={{ padding: '32px 40px 48px' }} | bodyStyle={{ padding: '32px 40px 48px' }} | ||||
destroyOnClose | destroyOnClose | ||||
@@ -38,9 +86,21 @@ const MenuForm = (props) => { | |||||
maskClosable={false}> | maskClosable={false}> | ||||
<Row> | <Row> | ||||
<Col span={12}> | <Col span={12}> | ||||
<Checkbox indeterminate={indeterminate} onChange={onCheckAllChange} checked={checkAll}> | |||||
全选 | |||||
</Checkbox> | |||||
<Tree treeData={load} | <Tree treeData={load} | ||||
onCheck={(keys, e) => { setCheckedKeys(keys) }} | |||||
defaultExpandAll={true} | |||||
onCheck={(keys, e) => { | |||||
if(getTreeLength(props.treeData)==keys.length){ | |||||
setcheckAll(true) | |||||
setindeterminate(false); | |||||
}else{ | |||||
setcheckAll(false) | |||||
setindeterminate(true); | |||||
} | |||||
setCheckedKeys(keys) ; | |||||
}} | |||||
defaultExpandAll={false} | |||||
checkedKeys={checkedKeys} | checkedKeys={checkedKeys} | ||||
checkable /> | checkable /> | ||||
</Col> | </Col> | ||||
@@ -5,7 +5,7 @@ import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; | |||||
import ProTable, { ProColumns, ActionType, TableDropdown } from '@ant-design/pro-table'; | import ProTable, { ProColumns, ActionType, TableDropdown } from '@ant-design/pro-table'; | ||||
import Enumerable from 'linq' | import Enumerable from 'linq' | ||||
import CreateForm from './components/CreateForm'; | import CreateForm from './components/CreateForm'; | ||||
import { Page, add, edit, removeRole, setMenu, setUserGrantData, Enable, Disable, GetRoleMenu, SetDataRole } from './service'; | |||||
import { Page, add, edit, removeRole, setMenu, GetMenu, GetRoleMenu, SetDataRole } from './service'; | |||||
import { useAccess } from 'umi'; | import { useAccess } from 'umi'; | ||||
import MenuForm from './components/MenuForm'; | import MenuForm from './components/MenuForm'; | ||||
import OrgForm from './components/OrgForm'; | import OrgForm from './components/OrgForm'; | ||||
@@ -105,7 +105,7 @@ const roleManager = () => { | |||||
const [row, setRow] = useState(); | const [row, setRow] = useState(); | ||||
const [selectedRowsState, setSelectedRows] = useState(); | const [selectedRowsState, setSelectedRows] = useState(); | ||||
const [selectData, setSelectData] = useState([]); | const [selectData, setSelectData] = useState([]); | ||||
const [treeData, setTreeData] = useState(); | |||||
/** | /** | ||||
* 删除节点 | * 删除节点 | ||||
* @param selectedRows | * @param selectedRows | ||||
@@ -190,6 +190,15 @@ const roleManager = () => { | |||||
return arr; | return arr; | ||||
} | } | ||||
useEffect(() => { | |||||
var parm={getType:'ALL',type:0} | |||||
GetMenu(parm).then((r) => { | |||||
if(r.data){ | |||||
setTreeData(r.data); | |||||
} | |||||
}); | |||||
}, []); | |||||
const columns = [ | const columns = [ | ||||
{ | { | ||||
@@ -342,6 +351,7 @@ const roleManager = () => { | |||||
}} | }} | ||||
modalVisible={updateMenuModalVisible} | modalVisible={updateMenuModalVisible} | ||||
values={row || {}} | values={row || {}} | ||||
treeData={treeData} | |||||
/> | /> | ||||
) : null} | ) : null} | ||||
@@ -64,3 +64,10 @@ export async function SetDataRole(params) { | |||||
data:params | data:params | ||||
}); | }); | ||||
} | } | ||||
/** 查询功能菜单*/ | |||||
export async function GetMenu(params) { | |||||
return request(getDataBaseUrl()+`/api/menu/menuparmytrees?getType=${params.getType}&&type=${params.type}`, | |||||
{ | |||||
method: 'Get', | |||||
}); | |||||
} |
@@ -34,7 +34,7 @@ const CreateForm = (props) => { | |||||
<Form.Item name="code" label="字典编码" rules={[{ required: true, max: 64 }]}> | <Form.Item name="code" label="字典编码" rules={[{ required: true, max: 64 }]}> | ||||
<Input placeholder="请输入字典编码" /> | <Input placeholder="请输入字典编码" /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item | |||||
{/* <Form.Item | |||||
name="typeId" | name="typeId" | ||||
label="字典类型" | label="字典类型" | ||||
rules={[{ required: true, message: '请选择字典类型' }]} | rules={[{ required: true, message: '请选择字典类型' }]} | ||||
@@ -48,7 +48,7 @@ const CreateForm = (props) => { | |||||
); | ); | ||||
})} | })} | ||||
</Select> | </Select> | ||||
</Form.Item> | |||||
</Form.Item> */} | |||||
{/* <Form.Item | {/* <Form.Item | ||||
name="status" | name="status" | ||||
label="状态" | label="状态" | ||||
@@ -133,20 +133,20 @@ const DictDataManage = (props) => { | |||||
dataIndex: 'code', | dataIndex: 'code', | ||||
ellipsis:true | ellipsis:true | ||||
}, | }, | ||||
{ | |||||
title: '字典类型', | |||||
dataIndex: 'typeName', | |||||
hideInForm: true, | |||||
hideInSearch: true, | |||||
}, | |||||
{ | |||||
title: '字典类型', | |||||
dataIndex: 'typeId', | |||||
hideInForm: true, | |||||
hideInTable: true, | |||||
hideInSearch: true, | |||||
valueEnum: typeNames, | |||||
}, | |||||
// { | |||||
// title: '字典类型', | |||||
// dataIndex: 'typeName', | |||||
// hideInForm: true, | |||||
// hideInSearch: true, | |||||
// }, | |||||
// { | |||||
// title: '字典类型', | |||||
// dataIndex: 'typeId', | |||||
// hideInForm: true, | |||||
// hideInTable: true, | |||||
// hideInSearch: true, | |||||
// valueEnum: typeNames, | |||||
// }, | |||||
{ | { | ||||
title: '备注', | title: '备注', | ||||
dataIndex: 'remark', | dataIndex: 'remark', | ||||
@@ -279,7 +279,7 @@ const DictDataManage = (props) => { | |||||
<CreateForm | <CreateForm | ||||
typeNameData={typeNames} | typeNameData={typeNames} | ||||
onFinish={async (value) => { | onFinish={async (value) => { | ||||
value.typeId=props.currentRow.id; | |||||
var success = false; | var success = false; | ||||
if (value.id) { | if (value.id) { | ||||
success = await handleUpdate(value); | success = await handleUpdate(value); | ||||
@@ -179,7 +179,6 @@ const handleUpdate = async (fields) => { | |||||
{ | { | ||||
title: '创建时间', | title: '创建时间', | ||||
dataIndex: 'createAt', | dataIndex: 'createAt', | ||||
sorter: true, | |||||
hideInSearch: true, | hideInSearch: true, | ||||
}, | }, | ||||
{ | { | ||||