Commit d9a8cec6 authored by TZW's avatar TZW

11.11

parent fd65ec2a
......@@ -8,7 +8,7 @@ const Settings = {
fixedHeader: false,
fixSiderbar: false,
pwa: false,
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
logo: '/staticfile/group1/M00/00/00/oYYBAGNuFCqARiJKAAGIO2gWB34399.png',
colorPrimary: '#1890ff',
siderMenuType: 'sub',
proxypath: '/emspro',
......
......@@ -128,10 +128,10 @@ export const layout = ({ initialState, setInitialState }) => {
},
links: isDev
? [
<Link key="openapi" to="/umi/plugin/openapi" target="_blank">
<LinkOutlined />
<span>OpenAPI 文档</span>
</Link>,
// <Link key="openapi" to="/umi/plugin/openapi" target="_blank">
// <LinkOutlined />
// <span>OpenAPI 文档</span>
// </Link>,
]
: [],
//接口获取菜单数据
......@@ -146,18 +146,18 @@ export const layout = ({ initialState, setInitialState }) => {
? JSON.parse(JSON.stringify(initialState?.newMenu?.userHavePermList))
: [],
newArr = [
{
path: '/welcome',
name: '首页',
icon: 'smile',
component: './Welcome',
haveChildren: false,
key: '000000',
parentKey: '0',
routes: [],
children: null,
title: null,
},
// {
// path: '/welcome',
// name: '首页',
// icon: 'smile',
// component: './Welcome',
// haveChildren: false,
// key: '000000',
// parentKey: '0',
// routes: [],
// children: null,
// title: null,
// },
].concat(lastArr);
return newArr.map((item, index) => {
......
......@@ -12,26 +12,28 @@ const Footer = () => {
background: 'none',
}}
copyright={`${currentYear} ${defaultMessage}`}
links={[
{
key: 'basepro',
title: 'basepro',
href: 'https://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <GithubOutlined />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'https://ant.design',
blankTarget: true,
},
]}
links={
[
// {
// key: 'basepro',
// title: 'basepro',
// href: 'https://pro.ant.design',
// blankTarget: true,
// },
// {
// key: 'github',
// title: <GithubOutlined />,
// href: 'https://github.com/ant-design/ant-design-pro',
// blankTarget: true,
// },
// {
// key: 'Ant Design',
// title: 'Ant Design',
// href: 'https://ant.design',
// blankTarget: true,
// },
]
}
/>
);
};
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 15:12:23
* @Last Modified time: 2022-11-11 17:11:00
*/
import * as React from 'react';
......@@ -96,7 +96,7 @@ function Model(props) {
return (
<PremButton
pop={{
title: '是否删除该用户?',
title: '是否删除该设备?',
okText: '确认',
cancelText: '取消',
onConfirm: async () => {
......@@ -143,6 +143,7 @@ function Model(props) {
addconfig={{
// access: 'sysDepartment_save',
btn: {
type: 'primary',
disabled: false,
onClick: () => {
setDrawer((s) => ({
......
......@@ -6,12 +6,6 @@ function getcolumns(setdrawer) {
title: '供应商编号',
dataIndex: 'supplierNo',
key: 'supplierNo',
hideInForm: {
accountName: {
reverse: ['1', '2', '5'],
},
remark: ['3'],
},
},
{
title: '供应商名称',
......@@ -20,16 +14,18 @@ function getcolumns(setdrawer) {
formItemProps: {
rules: [
{
required: false,
required: true,
message: '此项为必填项',
},
],
},
},
{
title: '电话',
dataIndex: 'telephone',
key: 'telephone',
title: '公司官网',
dataIndex: 'officialWebsite',
key: 'officialWebsite',
hideInTable: true,
search: false,
formItemProps: {
rules: [
{
......@@ -40,9 +36,9 @@ function getcolumns(setdrawer) {
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
title: '联系电话',
dataIndex: 'telephone',
key: 'telephone',
formItemProps: {
rules: [
{
......@@ -53,9 +49,9 @@ function getcolumns(setdrawer) {
},
},
{
title: '地址',
dataIndex: 'address',
key: 'address',
title: '邮箱',
dataIndex: 'email',
key: 'email',
formItemProps: {
rules: [
{
......@@ -66,8 +62,10 @@ function getcolumns(setdrawer) {
},
},
{
title: '评分',
dataIndex: 'score',
title: '地址',
dataIndex: 'address',
key: 'address',
width: 300,
formItemProps: {
rules: [
{
......@@ -90,6 +88,16 @@ function getcolumns(setdrawer) {
},
],
},
options: [
{
label: '启用',
value: 1,
},
{
label: '禁用',
value: 2,
},
],
render: (text, row) => {
return (
<Switch
......@@ -114,6 +122,122 @@ function getcolumns(setdrawer) {
);
},
},
{
title: '评分',
dataIndex: 'score',
key: 'score',
valueType: 'rate',
fieldProps: {
defaultValue: 1,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '备注',
dataIndex: 'remark',
key: 'remark',
valueType: 'textarea',
width: 300,
fieldProps: {
placeholder: '请输入',
showCount: true,
maxLength: 255,
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
},
{
title: '联系信息',
valueType: 'formList',
dataIndex: 'list',
key: 'supplierUserList',
initialValue: [
{
state: 'all',
title: '标题',
},
],
colProps: {
xs: 24,
sm: 24,
},
columns: [
{
title: '联系人',
dataIndex: 'userName',
key: 'userName',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
{
title: '手机号码',
dataIndex: 'telephone',
key: 'telephone',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
{
title: '邮箱',
dataIndex: 'email',
key: 'email',
colProps: {
sm: 6,
},
},
{
title: '职务',
dataIndex: 'title',
key: 'title',
fieldProps: {
placeholder: '请选择',
},
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
colProps: {
sm: 6,
},
},
],
search: false,
hideInTable: true,
},
];
}
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-10 16:57:58
* @Last Modified time: 2022-11-11 17:06:07
*/
import * as React from 'react';
......@@ -62,7 +62,7 @@ function Supplier(props) {
...s,
visible: true,
detailpath: urlParams.detail,
params: { id: drawer?.item?.id },
params: { id: row?.id },
title: '编辑',
val: 'edit',
onFinish: async (vals) => {
......@@ -150,8 +150,11 @@ function Supplier(props) {
setDrawer((s) => ({
...s,
visible: true,
item: null,
item: {
status: 1,
},
title: '新增',
detailpath: null,
val: 'add',
onFinish: async (vals) => {
let params = {
......
function getcolumns(setdrawer) {
return [
{
title: '基础信息',
valueType: 'split',
},
{
title: '用户名',
dataIndex: 'accountName',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
initialValue: '默认值',
hideInForm: false,
search: false,
render: (text, row) => {
return (
<a
onClick={() => {
setdrawer?.((s) => ({
...s,
visible: true,
item: null,
title: '新增',
val: 'add',
}));
}}
>
{text}
</a>
);
},
},
{
title: '姓名',
dataIndex: 'userName',
key: 'userId',
title: '设备类型',
dataIndex: 'title',
key: 'title',
hideInForm: {
accountName: {
reverse: ['1', '2', '5'],
......@@ -48,52 +12,9 @@ function getcolumns(setdrawer) {
},
search: false,
},
{
title: '额外信息',
valueType: 'split',
},
{
title: '联系电话',
dataIndex: 'telephone',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
search: false,
},
{
title: '邮箱',
dataIndex: 'mailNo',
formItemProps: {
rules: [
{
required: false,
message: '此项为必填项',
},
],
},
search: false,
},
{
title: '备注',
dataIndex: 'remark',
valueType: 'editor',
search: false,
colProps: { span: 24 },
initialValue: '<p>Hello <b>World!</b></p>',
},
{
title: '上传样式-图片',
dataIndex: 'uploadImage',
key: 'uploadImage',
valueType: 'uploadImage',
fieldProps: {
limit: 2,
},
formItemProps: {
rules: [
{
......@@ -102,6 +23,7 @@ function getcolumns(setdrawer) {
},
],
},
search: false,
},
];
}
......
/* 设备类型
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-11 11:15:50
*/
import * as React from 'react';
import { useState, useMemo, useRef } from 'react';
import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton';
import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch';
import { message } from 'antd';
function Type(props) {
const actionRef = useRef(),
formRef = useRef();
const [drawer, setdrawer] = useState({
const [drawer, setDrawer] = useState({
visible: false,
});
const urlParams = {
save: '/asset/equipmentType/save',
remove: '/asset/equipmentType/deleteById',
list: '/asset/equipmentType/queryTreeList',
detail: '/asset/equipmentSupplier/query/detail',
};
const detail = (text, row, _, action) => {
return (
<PremButton
......@@ -19,7 +35,7 @@ function Type(props) {
size: 'small',
type: 'link',
onClick: () => {
setdrawer((s) => ({
setDrawer((s) => ({
...s,
visible: true,
item: row,
......@@ -41,12 +57,32 @@ function Type(props) {
btn={{
size: 'small',
onClick: () => {
setdrawer((s) => ({
setDrawer((s) => ({
...s,
visible: true,
item: row,
detailpath: urlParams.detail,
params: { id: drawer?.item?.id },
title: '编辑',
val: 'edit',
onFinish: async (vals) => {
console.log(1);
let params = {
...vals,
id: row.id,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('编辑成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
}}
......@@ -60,11 +96,19 @@ function Type(props) {
return (
<PremButton
pop={{
title: '是否删除该用户?',
title: '是否删除该供应商?',
okText: '确认',
cancelText: '取消',
onConfirm: () => {
alert(0);
onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } });
if (res.code === '0000') {
message.success('删除成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}}
btn={{
......@@ -78,39 +122,53 @@ function Type(props) {
};
const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer);
let defcolumn = getcolumns(setDrawer);
return defcolumn.concat({
title: '操作',
valueType: 'option',
width: 150,
render: (text, row, _, action) => [
detail(text, row, _, action),
edit(text, row, _, action),
remove(text, row, _, action),
],
render: (text, row, _, action) => [edit(text, row, _, action), remove(text, row, _, action)],
});
}, []);
return (
<div style={{ position: 'relative' }}>
<AutoTable
pagetitle=" 设备类型"
pagetitle={<h3 className="page-title">设备类型</h3>}
columns={columns}
path="/ngic-auth/sysUser/query/page"
path={urlParams.list}
actionRef={actionRef}
pageextra={'add'}
resizeable={true}
resizeable={false}
addconfig={{
// access: 'sysDepartment_save',
btn: {
disabled: false,
type: 'primary',
onClick: () => {
setdrawer((s) => ({
setDrawer((s) => ({
...s,
visible: true,
item: null,
title: '新增',
val: 'add',
onFinish: async (vals) => {
let params = {
...vals,
};
let res = await doFetch({
url: urlParams.save,
params,
});
if (res.code === '0000') {
message.success('新增成功!');
setDrawer((s) => ({
...s,
visible: false,
}));
actionRef.current.reload();
}
},
}));
},
},
......@@ -119,12 +177,11 @@ function Type(props) {
<DrawerPro
fields={columns}
detailpath="/ngic-auth/sysUser/query/detail"
params={{ id: drawer?.item?.id }}
defaultFormValue={drawer?.item ?? {}}
formRef={formRef}
placement="right"
onClose={() => {
setdrawer((s) => ({
setDrawer((s) => ({
...s,
visible: false,
}));
......@@ -135,4 +192,4 @@ function Type(props) {
);
}
export default Type;
\ No newline at end of file
export default Type;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment