Browse Source

前端优化

master
Yanko 3 weeks ago
parent
commit
a1608c3826
6 changed files with 186 additions and 76 deletions
  1. +0
    -1
      frontend/src/app.tsx
  2. +4
    -3
      frontend/src/pages/deviceProductInfo/index.tsx
  3. +51
    -7
      frontend/src/pages/final/index.less
  4. +37
    -21
      frontend/src/pages/final/index.tsx
  5. +45
    -1
      frontend/src/pages/workInfo/index.less
  6. +49
    -43
      frontend/src/pages/workInfo/index.tsx

+ 0
- 1
frontend/src/app.tsx View File

@@ -133,7 +133,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
colorBgPageContainerFixed: '#0960bd' colorBgPageContainerFixed: '#0960bd'
}, },
}, },
headerContentRender: () => <ProBreadcrumb />,
footerRender: () => <Footer />, footerRender: () => <Footer />,
onPageChange: () => { onPageChange: () => {
const userToken = sessionStorage.getItem('USER_TOKEN'); const userToken = sessionStorage.getItem('USER_TOKEN');


+ 4
- 3
frontend/src/pages/deviceProductInfo/index.tsx View File

@@ -1,6 +1,7 @@
import { ArrowLeftOutlined, LeftCircleOutlined, LeftSquareTwoTone, PlusOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined, LeftCircleOutlined, LeftSquareTwoTone, PlusOutlined } from '@ant-design/icons';
import { import {
ActionType, ActionType,
PageContainer,
ProColumns, ProColumns,
ProForm, ProForm,
ProFormInstance, ProFormInstance,
@@ -34,7 +35,7 @@ const ParmsTypeList = [
value: 0 value: 0
}, },
{ {
label: '多选',
label: '物料',
value: 1 value: 1
}, },
{ {
@@ -152,7 +153,7 @@ export default () => {
]; ];


return ( return (
<>
<PageContainer>
{!isfunc ? {!isfunc ?
<> <>


@@ -529,6 +530,6 @@ export default () => {


</> </>
} }
</>
</PageContainer>
); );
}; };

+ 51
- 7
frontend/src/pages/final/index.less View File

@@ -13,7 +13,7 @@
} }
&_item { &_item {
box-shadow:6px 5px 1px 1px rgb(237 236 236 / 50%); box-shadow:6px 5px 1px 1px rgb(237 236 236 / 50%);
border: 1px solid #edecec;
border-bottom: 1px solid @primary-color;
padding: 25px ; padding: 25px ;
height: 38px; height: 38px;
width: 200px; width: 200px;
@@ -57,22 +57,65 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;

box-shadow:6px 5px 1px 1px rgb(237 236 236 / 50%);
&_box{ &_box{
margin: 5px;
position: relative;
margin-right: 63px;
border: 1px solid;
color: #969595;
}
&_jiantou{
position: absolute;
right: -55px;
top: 150px;
z-index: 99;
display: flex;
align-items: center;
justify-items: center;
&_arrow{
position: relative;
width: 15px;
height: 15px;
border-top: 3px solid @primary-color;
border-left: 3px solid @primary-color;
transform: rotate(135deg);
// animation: arrow-load 2s infinite;
}
&_arrow:nth-child(3){
left: 0px;
animation-delay: -0.4s;
}
&_arrow:nth-child(2){
animation-delay: -0.2s;
}
&_arrow:nth-child(1){
right: 0px;
}
@keyframes arrow-load {
0%{
opacity: 0;
transform: rotate(135deg) translate(20px,20px);
}
0%{
opacity: 1;
}
100%{
opacity: 0;
transform: rotate(135deg) translate(-20px,-20px);
}
}
} }
&_item { &_item {
padding: 25px ; padding: 25px ;
height: 38px; height: 38px;
width: 200px;
width: 250px;
position: relative; position: relative;
cursor: pointer; cursor: pointer;
display: -ms-flexbox; display: -ms-flexbox;
box-shadow:6px 5px 1px 1px rgb(237 236 236 / 50%);
border: 1px solid #edecec;
margin: auto;
border-bottom: 1px solid @primary-color;
display: flex; display: flex;
-ms-flex-align: center; -ms-flex-align: center;
align-items: center; align-items: center;
@@ -105,3 +148,4 @@
} }
} }




+ 37
- 21
frontend/src/pages/final/index.tsx View File

@@ -237,9 +237,9 @@ const final = () => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
res.data.map((item: any) => ( res.data.map((item: any) => (
item.value = item.materialCode, item.value = item.materialCode,
item.label = item.materialName+`(${item.mode==1?"人工":"设备"})`
item.label = item.materialName + `(${item.mode == 1 ? "人工" : "设备"})`
)) ))
console.log('物料信息',res.data);
console.log('物料信息', res.data);


setMaterialParmList(res.data) setMaterialParmList(res.data)
} }
@@ -394,7 +394,7 @@ const final = () => {
}> }>
<Divider /> <Divider />


<Card title={'选择产线'}>
<Card bordered={false} title={'选择产线'}>
<div className={styles.tag}> <div className={styles.tag}>
{finallineList.map((item, index) => ( {finallineList.map((item, index) => (
<Badge.Ribbon text={item.status == '0' ? '未配置' : '已配置'} color={item.status == '0' ? '' : 'pink'}> <Badge.Ribbon text={item.status == '0' ? '未配置' : '已配置'} color={item.status == '0' ? '' : 'pink'}>
@@ -421,7 +421,7 @@ const final = () => {
</div> </div>
</Card> </Card>
{lineProcessList.length > 0 ? {lineProcessList.length > 0 ?
<Card title={'产线工序路线'} extra={<Space direction='horizontal' >
<Card bordered={false} title={'产线工序路线'} extra={<Space direction='horizontal' >
<Popconfirm <Popconfirm
key="save" key="save"
title="确定要保存配置?保存成功后将返回成品列表。" title="确定要保存配置?保存成功后将返回成品列表。"
@@ -452,16 +452,29 @@ const final = () => {


{lineProcessList.map((item, index) => ( {lineProcessList.map((item, index) => (
<div className={styles.gongyi_tag_box} key={index} > <div className={styles.gongyi_tag_box} key={index} >
{lineProcessList.length <= index+1?<></>:
<div className={styles.gongyi_tag_jiantou}>

<div className={styles.gongyi_tag_jiantou_arrow}></div>
<div className={styles.gongyi_tag_jiantou_arrow}></div>
<div className={styles.gongyi_tag_jiantou_arrow}></div>

</div>
}
<div <div


className={`${styles.gongyi_tag_item} ${index === selectProcess ? styles.gongyi_tag_item_activeItem : ''}`}> className={`${styles.gongyi_tag_item} ${index === selectProcess ? styles.gongyi_tag_item_activeItem : ''}`}>
<Space size="middle"> <Space size="middle">
<div color="#2db7f5" style={{ fontSize: '22px' }}> 0{index + 1}-{item.processName}</div>
<div color="#2db7f5" style={{ fontSize: '22px' }}> 0{index + 1}-{item.processName}



</div>
</Space> </Space>
<div className={index === selectProcess ? styles.gongyi_tag_item_active : ''}></div> <div className={index === selectProcess ? styles.gongyi_tag_item_active : ''}></div>


</div> </div>
<Card title='所属设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}>
<Card title='设备列表' size="small" bordered={false} styles={{ body:{ height: '200px', overflowY: 'auto', overflowX: 'hidden'} }} className={styles.gongyi_tag_device}>
{ {
item.devicesInfo.length > 0 ? item.devicesInfo.length > 0 ?
<Space title='设备' direction="vertical"> <Space title='设备' direction="vertical">
@@ -530,8 +543,8 @@ const final = () => {
const jsonData: deviceProductFunction.queryParms = { const jsonData: deviceProductFunction.queryParms = {
deviceProductId: currentproductionDev?.deviceType deviceProductId: currentproductionDev?.deviceType
}; };
console.log('jsonData',jsonData);
console.log('jsonData', jsonData);
DeviceProductFunctionAPI.List(jsonData).then((res: MyResponse.Content) => { DeviceProductFunctionAPI.List(jsonData).then((res: MyResponse.Content) => {
if (res.succeeded) { if (res.succeeded) {
setDeviceFun(res.data); setDeviceFun(res.data);
@@ -575,7 +588,7 @@ const final = () => {
}) })
}} }}
> >
添加工艺参数
添加工艺参数
</Button>, </Button>,
<Button <Button
type="primary" type="primary"
@@ -608,23 +621,18 @@ const final = () => {
); );
}, },
}, },
{
title: '步骤备注',
dataIndex: 'description',

hideInSearch: true
},
{ {
title: '功能', title: '功能',
dataIndex: 'deviceProductFunctionName', dataIndex: 'deviceProductFunctionName',
hideInSearch: true, hideInSearch: true,
width:200
width: 200
}, },
{ {
title: '设备参数预览', title: '设备参数预览',
hideInSearch: true, hideInSearch: true,
render(dom, entity, index, action, schema) { render(dom, entity, index, action, schema) {
const deviceFunParams = JSON.parse(entity?.deviceFunParams); const deviceFunParams = JSON.parse(entity?.deviceFunParams);
if (entity?.deviceStepParms) { if (entity?.deviceStepParms) {
@@ -657,7 +665,7 @@ const final = () => {
<Space size='small' direction="vertical" align='start'> <Space size='small' direction="vertical" align='start'>
{ {
newParms.map((sss) => ( newParms.map((sss) => (
<div style={{wordWrap:'break-word'}}>{sss.name}</div>
<div style={{ wordWrap: 'break-word' }}>{sss.name}</div>
)) ))
} }
</Space> </Space>
@@ -665,6 +673,12 @@ const final = () => {
} }
}, },
}, },
{
title: '步骤备注',
dataIndex: 'description',

hideInSearch: true
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
@@ -675,7 +689,8 @@ const final = () => {
render: (_, record, index, action) => [ render: (_, record, index, action) => [
<Space size="middle"> <Space size="middle">
<Button <Button
type='primary' ghost
type='primary'
size='small'
onClick={async () => { onClick={async () => {
setIsSchemaModalOpen(true) setIsSchemaModalOpen(true)
setDeviceParm([]); setDeviceParm([]);
@@ -755,7 +770,8 @@ const final = () => {
okText="确认" okText="确认"
cancelText="关闭" cancelText="关闭"
> >
<Button type='primary' danger ghost>删除</Button>
<Button
size='small' type='primary' danger >删除</Button>
</Popconfirm> </Popconfirm>
</Space> </Space>
], ],


+ 45
- 1
frontend/src/pages/workInfo/index.less View File

@@ -5,4 +5,48 @@
.rowHeight{ .rowHeight{
padding: 10px; padding: 10px;
} }

.box{
position: relative;
margin-right: 60px;
}
.jiantou{
position: absolute;
right: -55px;
top: 150px;
z-index: 99;
display: flex;
align-items: center;
justify-items: center;
&_arrow{
position: relative;
width: 15px;
height: 15px;
border-top: 3px solid @primary-color;
border-left: 3px solid @primary-color;
transform: rotate(135deg);
// animation: arrow-load 2s infinite;
}
&_arrow:nth-child(3){
left: 0px;
animation-delay: -0.4s;
}
&_arrow:nth-child(2){
animation-delay: -0.2s;
}
&_arrow:nth-child(1){
right: 0px;
}
@keyframes arrow-load {
0%{
opacity: 0;
transform: rotate(135deg) translate(20px,20px);
}
0%{
opacity: 1;
}
100%{
opacity: 0;
transform: rotate(135deg) translate(-20px,-20px);
}
}
}

+ 49
- 43
frontend/src/pages/workInfo/index.tsx View File

@@ -137,7 +137,7 @@ export default () => {
ellipsis: true, ellipsis: true,
hideInSearch: true, hideInSearch: true,
align: 'center', align: 'center',
width:80
width: 80
}, },
{ {
dataIndex: 'batchId', dataIndex: 'batchId',
@@ -149,10 +149,10 @@ export default () => {
{ {
title: '进度', title: '进度',
dataIndex: 'status', dataIndex: 'status',
width:300,
width: 300,
hideInSearch: true, hideInSearch: true,
align:'center',
fixed:'right',
align: 'center',
fixed: 'right',
render(_, record) { render(_, record) {
return <ConfigProvider return <ConfigProvider
theme={{ theme={{
@@ -167,7 +167,7 @@ export default () => {
<Steps <Steps
progressDot progressDot
direction='horizontal' direction='horizontal'
style={{padding:'18px'}}
style={{ padding: '18px' }}
type='default' type='default'
current={record.status} current={record.status}
size='small' size='small'
@@ -176,7 +176,7 @@ export default () => {
</ConfigProvider> </ConfigProvider>
}, },
}, },
{ {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
@@ -438,7 +438,7 @@ export default () => {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
key: 'option', key: 'option',
fixed:'right',
fixed: 'right',
render: (_, record) => { render: (_, record) => {
switch (record.status) { switch (record.status) {
case 0: case 0:
@@ -447,7 +447,7 @@ export default () => {
[ [
<Button <Button
key="edit" key="edit"
type="primary"
type="primary"
size='small' size='small'
onClick={async () => { onClick={async () => {
// setIsModalOpen(true); // setIsModalOpen(true);
@@ -492,8 +492,8 @@ export default () => {
okText="确认" okText="确认"
cancelText="关闭" cancelText="关闭"
> >
<Button type="primary"
size='small'>批次下发</Button>
<Button type="primary"
size='small'>批次下发</Button>
</Popconfirm> : "" </Popconfirm> : ""
, ,
<Popconfirm <Popconfirm
@@ -516,8 +516,8 @@ export default () => {
okText="确认" okText="确认"
cancelText="关闭" cancelText="关闭"
> >
<Button type="primary"
size='small' danger >删除</Button>
<Button type="primary"
size='small' danger >删除</Button>
</Popconfirm>, </Popconfirm>,
] ]
) )
@@ -526,7 +526,7 @@ export default () => {
[ [
<Button <Button
key="edit" key="edit"
type="primary"
type="primary"
size='small' size='small'
onClick={async () => { onClick={async () => {
// setIsModalOpen(true); // setIsModalOpen(true);
@@ -566,8 +566,8 @@ export default () => {
okText="确认" okText="确认"
cancelText="关闭" cancelText="关闭"
> >
<Button type="primary"
size='small'>继续下发</Button>
<Button type="primary"
size='small'>继续下发</Button>
</Popconfirm> </Popconfirm>
, ,
<Popconfirm <Popconfirm
@@ -623,8 +623,8 @@ export default () => {
const UpdateGY = (lineId: string, finalId: string) => { const UpdateGY = (lineId: string, finalId: string) => {
productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => { productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
console.log('res.data',res.data);
console.log('res.data', res.data);
setLineProcessList(res.data); setLineProcessList(res.data);
} }
}) })
@@ -676,7 +676,7 @@ export default () => {
const OnSubmit = async (values: any) => { const OnSubmit = async (values: any) => {


values.batchId = selectBatchItemRow?.id values.batchId = selectBatchItemRow?.id


const WorkDeviceAddInputs: any[] = [] const WorkDeviceAddInputs: any[] = []


@@ -926,7 +926,7 @@ export default () => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
setSelectFinal({ name: res.data.finalName, finalId: res.data.finalId, quantity: res.data.quantity }) setSelectFinal({ name: res.data.finalName, finalId: res.data.finalId, quantity: res.data.quantity })
typeForm.setFieldValue('finalName', res.data.finalName) typeForm.setFieldValue('finalName', res.data.finalName)
typeForm.setFieldValue('quantity', res.data.quantity)
typeForm.setFieldValue('quantity', res.data.quantity)
setLineProcessList([]) setLineProcessList([])
FinalAPI.FinishLineList(res.data.finalId).then((res: MyResponse.Content) => { FinalAPI.FinishLineList(res.data.finalId).then((res: MyResponse.Content) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
@@ -942,7 +942,7 @@ export default () => {
</ProFormSelect> </ProFormSelect>
<Row gutter={18}> <Row gutter={18}>
<Col xl={6} md={12} sm={24}> <Col xl={6} md={12} sm={24}>
<Form.Item name='finalId' hidden
<Form.Item name='finalId' hidden
label="成品" > label="成品" >
<Input readOnly disabled value={selectfinal?.id}></Input> <Input readOnly disabled value={selectfinal?.id}></Input>
</Form.Item> </Form.Item>
@@ -957,8 +957,8 @@ export default () => {
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
<Form.Item label="产线" name="lineId" rules={[{ required: true, message: '此项为必填项!' }]}>
<Select onChange={(e) => {
<Form.Item label="选择产线" name="lineId" rules={[{ required: true, message: '此项为必填项!' }]}>
<Select placeholder="请选择" onChange={(e) => {
console.log('selectfinal', selectfinal); console.log('selectfinal', selectfinal);


UpdateGY(e, selectfinal?.finalId) UpdateGY(e, selectfinal?.finalId)
@@ -984,26 +984,32 @@ export default () => {
<div className={styles.gongyi_tag}> <div className={styles.gongyi_tag}>
<Flex wrap gap="small"> <Flex wrap gap="small">
{lineProcessList.map((item, index) => ( {lineProcessList.map((item, index) => (
<div className={styles.gongyi_tag_box} key={index} >
<div

className={styles.gongyi_tag_item}>
<Space size="middle">
<div color="#2db7f5" style={{ fontSize: '22px' }}> {index + 1}-{item.processName}</div>
</Space>
</div>
<Card title='选择设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}>

<Form.Item name={'pro:' + item.id}
rules={[{ required: item.devicesInfo.length > 0,
message: `产线工序路线[${index + 1}-${item.processName}]未选择设备!`,validator(rule, value, callback) {
if (value || item.devicesInfo.length == 0) {
return Promise.resolve();
}else{
message.error(`产线工序路线[${index + 1}-${item.processName}]未选择设备!`)
}
},}]}>
<div className={styles.box} key={index} >
{lineProcessList.length <= index + 1 ? <></> :
<div className={styles.jiantou}>
<div className={styles.jiantou_arrow}></div>
<div className={styles.jiantou_arrow}></div>
<div className={styles.jiantou_arrow}></div>
</div>
}
<Space size="middle">
<div color="#2db7f5" style={{ fontSize: '22px' }}> {index + 1}-{item.processName}</div>
</Space>

<Card title='选择设备' size="small" bordered={false} styles={{ body: { height: '200px', overflowY: 'auto', overflowX: 'hidden' } }} className={styles.gongyi_tag_device}>

<Form.Item name={'pro:' + item.id}
rules={[{
required: item.devicesInfo.length > 0,
message: `产线工序路线[${index + 1}-${item.processName}]未选择设备!`, validator(rule, value, callback) {
if (value || item.devicesInfo.length == 0) {
return Promise.resolve();
} else {
message.error(`产线工序路线[${index + 1}-${item.processName}]未选择设备!`)
}

},
}]}>
<CheckCard.Group > <CheckCard.Group >
{ {
item.devicesInfo.length > 0 ? item.devicesInfo.length > 0 ?
@@ -1013,7 +1019,7 @@ export default () => {
}} size='small' title={devicesItem.name} value={devicesItem.code} /> }} size='small' title={devicesItem.name} value={devicesItem.code} />
))} ))}
</Space> </Space>
: <Empty />
: <Empty description="默认选择" />
} }
</CheckCard.Group> </CheckCard.Group>
</Form.Item> </Form.Item>


Loading…
Cancel
Save