董国庆
2025-02-26 6bb88913b78e2862939ecc3f2199a01ce0272107
调试接口
11个文件已修改
1个文件已添加
699 ■■■■■ 已修改文件
management/src/pages/message-notification/index.jsx 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/message-notification/service.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/setting/user/components/addAndEdit.jsx 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/setting/user/service.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/banner/components/addAndEdit.jsx 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/banner/components/index.jsx 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/banner/index.jsx 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/banner/service.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/problem-type/components/addAndEdit.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/problem-type/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/work-order/problem-type/service.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/utils/antdUtils.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/message-notification/index.jsx
@@ -1,9 +1,9 @@
import { PageContainer, ProTable } from '@ant-design/pro-components';
import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils';
import { Button, message, Space } from 'antd';
import { Button, message, Space, Select } from 'antd';
import { useRef, useState } from 'react';
import { Access, history, useAccess } from 'umi';
import { getList, updateStatus, deleteBanner } from './service'
import { getList, setStatus } from './service'
const Banner = () => {
  const actionRef = useRef();
@@ -12,42 +12,76 @@
  const columns = [
    {
      title: '诉求标题',
      dataIndex: 'bannerName'
      dataIndex: 'title'
    },
    {
      title: '承办者',
      dataIndex: 'bannerName1'
      dataIndex: 'undertakerUser'
    },
    {
      title: '联系方式',
      dataIndex: 'bannerName'
      dataIndex: 'phone'
    },
    {
      title: '所在单位',
      dataIndex: 'bannerName'
      dataIndex: 'department',
      renderFormItem: (_, { type, defaultRender, ...rest }, form) => {
        return (
          <Select
            key="searchSelect"
            allowClear
            placeholder="请选择"
            filterOption={false}
            options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]}
          >
          </Select >
        )
      },
      render: (_, record) => {
        return record.department
      }
    },
    {
      title: '所属职位',
      dataIndex: 'bannerName'
      dataIndex: 'position',
      renderFormItem: (_, { type, defaultRender, ...rest }, form) => {
        return (
          <Select
            key="searchSelect"
            allowClear
            placeholder="请选择"
            filterOption={false}
            options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]}
          >
          </Select >
        )
      },
      render: (_, record) => {
        return record.position
      }
    },
    {
      title: '诉求应处理时间',
      dataIndex: 'bannerName',
      dataIndex: 'responseTime',
      hideInSearch: true,
    },
    {
      title: '提示类型',
      dataIndex: 'bannerName',
      dataIndex: 'promptType',
      hideInSearch: true,
      valueEnum: {
        '1': { text: '临期提醒' },
        '2': { text: '超时提醒' },
      }
    },
    {
      title: '状态',
      dataIndex: 'listingStatus',
      dataIndex: 'readStatus',
      hideInSearch: true,
      valueEnum: {
        '上架中': { text: '已读' },
        '已下架': { text: '未读' },
        '1': { text: '已读' },
        '0': { text: '未读' },
      }
    },
    {
@@ -61,11 +95,11 @@
                type="link"
                onClick={() => {
                  showDelConfirm(async () => {
                    let status = await sendRequest(deleteBanner, record.id)
                    let status = await sendRequest(setStatus, record.id)
                    if (status) {
                      actionRef.current.reload();
                    }
                  }, '确认标记已读所选信息吗?');
                  }, '确认将所选信息标记为已读吗?');
                }}
              >
                标记已读
management/src/pages/message-notification/service.js
@@ -2,18 +2,20 @@
// 列表
export const getList = async (data) => {
    return request(`/promotion/mgt/promotion-banner/page`, {
        method: 'POST',
    return request(`/api/huacheng-sangeshenbian/messageNotification/list`, {
        method: 'GET',
        data
    });
}
// 详情
export const getDetail = async (id) => {
    return request(`/promotion/mgt/promotion-banner/detail/${id}`, {
        method: 'GET',
// 设置已读
export const setStatus = async (id) => {
    return request(`/api/huacheng-sangeshenbian/messageNotification/read/${id}`, {
        method: 'PUT',
        // data
    });
}
// 详情列表
export const getDetailList = async (data) => {
    return request(`/goods/mgt/goods-sku/page`, {
management/src/pages/setting/user/components/addAndEdit.jsx
@@ -1,7 +1,7 @@
import { Form, Input, Modal, Tree, Button, Spin, Row, Col, Select } from 'antd';
import { Form, Input, Modal, Tree, Button, Spin, Row, Col, Select, Radio } from 'antd';
import { forwardRef, useImperativeHandle, useState } from 'react';
import { useEffect } from 'react';
import { getTree, getAddTree } from '../service';
import { getDepartmentList } from '../service';
import { Color } from 'antd/es/color-picker';
const formItemLayout = {
    labelCol: { span: 8 },
@@ -27,7 +27,7 @@
    //所属角色
    const [roleList, setRoleList] = useState([])
    //账号层级
    const [levelList, setLevelList] = useState([])
    const [levelList, setLevelList] = useState([{ name: '市级账号', value: 1 }, { name: '区县账号', value: 2 }, { name: '街道账号', value: 3 }, { name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }])
    //所属区县
    const [countyList, setCountyList] = useState([])
    //所属街道
@@ -39,9 +39,18 @@
    useEffect(() => {
        // 获取权限树
        getAddTree().then(res => {
            setTreeData(res.data)
        // 获取单位
        getDepartmentList(1).then(res => {
            setOneCompanyList(() => res.data)
        })
        getDepartmentList(2).then(res => {
            setTwoCompanyList(() => res.data)
        })
        getDepartmentList(3).then(res => {
            setThreeCompanyList(() => res.data)
        })
        getDepartmentList(4).then(res => {
            setThreeCompanyList(() => res.data)
        })
    }, [])
@@ -119,7 +128,7 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="oneDepartmentId"
                            label="所属一级单位"
                            rules={[{ required: true, message: '请选择所属一级单位' }]}
                        >
@@ -127,7 +136,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={oneCompanyList}
                                options={oneCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -136,15 +145,14 @@
                    </Col>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="twoDepartmentId"
                            label="所属二级单位"
                            rules={[{ required: true, message: '请选择所属二级单位' }]}
                        >
                            <Select
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={twoCompanyList}
                                options={twoCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -153,15 +161,14 @@
                    </Col>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="threeDepartmentId"
                            label="所属三级单位"
                            rules={[{ required: true, message: '请选择所属三级单位' }]}
                        >
                            <Select
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={threeCompanyList}
                                options={threeCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -172,15 +179,14 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="fourDepartmentId"
                            label="所属四级单位"
                            rules={[{ required: true, message: '请选择所属四级单位' }]}
                        >
                            <Select
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={fourCompanyList}
                                options={fourCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -191,7 +197,7 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="systemPostId"
                            label="所属职位"
                            rules={[{ required: true, message: '请选择所属职位' }]}
                        >
@@ -199,7 +205,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={positionList}
                                options={positionList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -208,7 +214,7 @@
                    </Col>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="systemRoleId"
                            label="所属角色"
                            rules={[{ required: true, message: '请选择所属角色' }]}
                        >
@@ -216,7 +222,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={roleList}
                                options={roleList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -227,7 +233,7 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="accountLevel"
                            label="账号层级"
                            rules={[{ required: true, message: '请选择账号层级' }]}
                        >
@@ -235,9 +241,9 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={levelList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                                options={levelList}
                                fieldNames={{ label: 'name', value: 'value' }}
                            // filterOption={false}
                            >
                            </Select >
                        </Form.Item>
@@ -251,21 +257,19 @@
                        >
                            <div style={{ display: "flex", flex: 1 }}>
                                <Form.Item
                                    name="name"
                                    rules={[{ required: true, message: '请选择账号层级' }]}
                                    name="isAdmin"
                                    rules={[{ required: true, message: '是否管理员' }]}
                                >
                                    <Select
                                        key="searchSelect"
                                        allowClear
                                        style={{ width: '280px' }}
                                        placeholder="请选择"
                                        dataSource={levelList}
                                        fieldNames={{ label: 'name', value: 'id' }}
                                        filterOption={false}
                                    >
                                    </Select >
                                    <Radio.Group
                                        // style={style}
                                        // onChange={onChange}
                                        // value={value}
                                        options={[{ value: 1, label: '否', }, { value: 2, label: '是', },
                                        ]}
                                    />
                                </Form.Item>
                                <div style={{ fontSize: '12px', Color: "rgba(0,0,0,0.5)" }}>管理员主要用于接收实现临期提醒,以及上级端登录</div>
                                <div style={{ fontSize: '12px', color: "rgba(0,0,0,0.5)", marginLeft: "10px" }}>管理员主要用于接收实现临期提醒,以及上级端登录</div>
                            </div>
                        </Form.Item>
                    </Col>
@@ -273,7 +277,7 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="districts"
                            label="所属区县"
                            rules={[{ required: true, message: '请选择所属区县' }]}
                        >
@@ -281,7 +285,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={oneCompanyList}
                                options={oneCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -290,7 +294,7 @@
                    </Col>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="street"
                            label="所属街道"
                            rules={[{ required: true, message: '请选择所属街道' }]}
                        >
@@ -298,7 +302,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={twoCompanyList}
                                options={twoCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -307,7 +311,7 @@
                    </Col>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                            name="community"
                            label="所属社区"
                            rules={[{ required: true, message: '请选择所属社区' }]}
                        >
@@ -315,7 +319,7 @@
                                key="searchSelect"
                                allowClear
                                placeholder="请选择"
                                dataSource={threeCompanyList}
                                options={threeCompanyList}
                                fieldNames={{ label: 'name', value: 'id' }}
                                filterOption={false}
                            >
@@ -333,12 +337,25 @@
                        >
                            <div style={{ display: "flex", flex: 1 }}>
                                <Form.Item
                                    name="name"
                                    rules={[{ required: true, message: '请输入联系方式' }]}
                                    name="phone"
                                    rules={[{
                                        validator: (rule, value) => {
                                            return new Promise((resolve, reject) => {
                                                if (!value) {
                                                    reject('请输入联系方式');
                                                }
                                                const phoneRegex = /^((\+86)?(13|14|15|16|17|18|19)[0-9]{9})|((\+86)?(0[0-9]{2,3})?([2-9][0-9]{6,7}))$/;
                                                if (!phoneRegex.test(value)) {
                                                    reject('请输入正确的电话号码');
                                                }
                                                resolve('');
                                            });
                                        },
                                    }]}
                                >
                                    <Input disabled={detailType} placeholder='请输入联系方式' />
                                </Form.Item>
                                <div style={{ fontSize: '12px', Color: "rgba(0,0,0,0.5)" }}>联系方式将作为登录账号使用</div>
                                <div style={{ fontSize: '12px', color: "rgba(0,0,0,0.5)", marginLeft: "10px" }}>联系方式将作为登录账号使用</div>
                            </div>
                        </Form.Item>
                    </Col>
@@ -346,28 +363,55 @@
                <Row>
                    <Col span={8}>
                        <Form.Item
                            name="name"
                             label="登录密码"
                            rules={[{ required: true, message: '请输入登录密码' }]}
                            required
                            name="password"
                            label="登录密码"
                            rules={[{
                                validator: (rule, value) => {
                                    return new Promise((resolve, reject) => {
                                        if (!value) {
                                            reject('请输入新密码');
                                        }
                                        const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
                                        if (!passwordRegex.test(value)) {
                                            reject('密码需要包含大小写字母,数字和特殊符号,且长度为8位以上');
                                        }
                                        resolve('');
                                    });
                                },
                            }]}
                        >
                            <Input disabled={detailType} placeholder='请输入' />
                            <Input.Password disabled={detailType} placeholder='请输入' />
                        </Form.Item>
                    </Col>
                    <Col span={16}>
                        <Form.Item
                            label="确认密码"
                            required
                            labelCol={{ span: 4 }}
                            wrapperCol={{ span: 20 }}
                            style={{ marginBottom: 0 }}
                        >
                            <div style={{ display: "flex", flex: 1 }}>
                                <Form.Item
                                    name="name"
                                    rules={[{ required: true, message: '请输入确认密码' }]}
                                    name="surePassword"
                                    rules={[{
                                        validator: (rule, value) => {
                                            return new Promise((resolve, reject) => {
                                                if (!value) {
                                                    reject('请再次输入新密码');
                                                }
                                                if (value != form.getFieldValue('password')) {
                                                    reject('两次密码请保持一致');
                                                }
                                                resolve('');
                                            });
                                        },
                                    },]}
                                >
                                    <Input disabled={detailType} placeholder='请输入' />
                                    <Input.Password disabled={detailType} placeholder='请输入' />
                                </Form.Item>
                                <div style={{ fontSize: '12px', Color: "rgba(0,0,0,0.5)" }}>联系方式将作为登录账号使用</div>
                                <div style={{ fontSize: '12px', color: "rgba(0,0,0,0.5)", marginLeft: "10px" }}>密码需要包含大小写字母,数字和特殊符号,且长度为8位以上</div>
                            </div>
                        </Form.Item>
                    </Col>
management/src/pages/setting/user/service.js
@@ -54,3 +54,22 @@
    });
}
// 根据单位层级查询单位数据
export const getDepartmentList = async (tier) => {
    return request(`/api/huacheng-sangeshenbian/department/getDepartmentList/${tier}`, {
        method: 'GET',
    });
}
// 获取职位列表数据
export const systemPostList = async (tier) => {
    return request(`/api/huacheng-sangeshenbian/systemPost/list`, {
        method: 'GET',
    });
}
// 获取角色列表数据
export const systemRoleList = async (tier) => {
    return request(`/api/huacheng-sangeshenbian/systemRole/list`, {
        method: 'GET',
    });
}
management/src/pages/work-order/banner/components/addAndEdit.jsx
@@ -3,106 +3,14 @@
import { PageContainer, } from '@ant-design/pro-components';
import { Button, Select, Row, Col, Input, Card, Space, Form, Upload, Spin, message, InputNumber } from 'antd';
import { useState, useEffect } from 'react';
import { addAndEdit, getDetail } from '../service';
import { add,Edit, getDetail } from '../service';
import { history, useLocation } from 'umi';
import { customRequest } from '@/utils/utils';
const AddOrEditOrDetail = () => {
  const [form] = Form.useForm();
  const [fileList, setFileList] = useState([])//banner图片
  const [loading, setLoading] = useState(false);
  const { search } = useLocation();
  const searchParams = new URLSearchParams(search);
  const config = {
    name: 'file',
    action: BASE_URL + '/file/obs/upload',
    headers: {
      authorization: localStorage.getItem('token'),
    },
  };
  const formItemLayout = {
    labelCol: { span: 6 },
    wrapperCol: { span: 20 },
  };
  const uploadButton = (text) => {
    return <div>
      <PlusOutlined />
      <div
        style={{
          marginTop: 8,
        }}
      >
      </div>
    </div>
  };
  useEffect(() => {
    if (searchParams.get('id')) {
      getDetail( searchParams.get('id') ).then(res => {
          if (res.data.picUrl) {
              let obj = [{
                  uid: 1,
                  name: 'banner',
                  url: res.data.picUrl
              }]
              setFileList(obj)
          }
          form.setFieldsValue(res.data)
      })
    }
  }, [])
  // 上传banner前
  const beforeUpload = (file) => {
    return new Promise(async (resolve, reject) => {
      if (file.name.includes(',')) {
        message.warning('上传文件不能包含英文逗号(,)')
        return Upload.LIST_IGNORE
      }
      setLoading(true)
      resolve(file)
    });
  };
  // 上传banner
  const handleChange = ({ file: file, fileList: newFileList }) => {
    if (file.status == 'error') {
      setLoading(false)
      setFileList([])
      message.error('上传失败')
      return
    }
    if (file.status == 'done') {
      setLoading(false)
      message.success('上传成功')
    }
    newFileList.map((item) => {
      if (!item.url && item.status == 'done') {
        item.url = item.response.data;
      }
    });
    setFileList(newFileList);
  };
  // 提交表单
  const submit = () => {
    form.validateFields().then(async (values) => {
      values.picUrl = fileList[0].url
      delete values.image
      if (searchParams.get('id')) {
          values.id = searchParams.get('id')
          let state = await sendRequest(addAndEdit, values)
          if (state) {
              history.back()
          }
          return
      }
      let state = await sendRequest(addAndEdit, values)
      if (state) {
          history.back()
      }
    })
  }
  return (
    <PageContainer title={searchParams.get('detail') ? '查看详情' : searchParams.get('id') ? '编辑banner' : '添加banner'}>
      <Spin spinning={loading}>
@@ -111,7 +19,7 @@
            <Row>
              <Col span={12}>
                <Form.Item
                  name="bannerName"
                  name="name"
                  label='banner名称' rules={[
                    {
                      required: true,
management/src/pages/work-order/banner/components/index.jsx
New file
@@ -0,0 +1,181 @@
import { Form, Input, Modal, Select, Upload, Space, Button, message } from 'antd';
import { sendRequest } from '@/utils/antdUtils';
import { LoadingOutlined, PlusOutlined } from '@ant-design/icons';
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
import { customRequest } from '@/utils/utils';
const formItemLayout = {
  labelCol: { span: 7 },
  wrapperCol: { span: 12 },
};
const AddEditView = ({ visible, onSave, onUpdate, onCancel, }, ref) => {
  const [form] = Form.useForm();
  const [fileList, setFileList] = useState([])//banner图片
  const [loading, setLoading] = useState(false);
  const [editData, setEditData] = useState({})
  const config = {
    name: 'file',
    action: 'https://huacheng.psciio.com/api/huacheng-communitybackstage/communitypartybuilding/uploadimage',
    headers: {
      authorization: localStorage.getItem('token'),
    },
  };
  const formItemLayout = {
    labelCol: { span: 6 },
    wrapperCol: { span: 20 },
  };
  const uploadButton = (text) => {
    return <div>
      <PlusOutlined />
      <div
        style={{
          marginTop: 8,
        }}
      >
      </div>
    </div>
  };
  useImperativeHandle(ref, () => {
    return {
      refreshData: (data) => {
        form.resetFields();
        form.setFieldsValue(data);
        setEditData(data);
        if (data.id) {
          getDetail(data.id).then(res => {
            if (res.data.url) {
              let obj = [{
                uid: 1,
                name: 'banner',
                url: res.data.url
              }]
              setFileList(obj)
            }
            form.setFieldsValue(res.data)
          })
        }
      },
      clean: () => {
        form.resetFields();
      },
    };
  });
  // 上传banner前
  const beforeUpload = (file) => {
    return new Promise(async (resolve, reject) => {
      if (file.name.includes(',')) {
        message.warning('上传文件不能包含英文逗号(,)')
        return Upload.LIST_IGNORE
      }
      setLoading(true)
      resolve(file)
    });
  };
  // 上传banner
  const handleChange = ({ file: file, fileList: newFileList }) => {
    console.log('11111111111111', file)
    if (file.status == 'error' || (file.status == 'done' && file.response.code != 200)) {
      setLoading(false)
      setFileList([])
      message.error('上传失败')
      return
    }
    if (file.status == 'done') {
      setLoading(false)
      message.success('上传成功')
    }
    newFileList.map((item) => {
      if (!item.url && item.status == 'done' && item.response.code == 200) {
        item.url = item.response.data;
      }
    });
    setFileList(newFileList);
  };
  // 提交表单
  const submit = () => {
    form.validateFields().then(async (values) => {
      values.url = fileList[0].url
      delete values.image
      if (editData.id) {
        values.id = editData.id
        let state = await sendRequest(add, values)
        if (state) {
          history.back()
        }
        return
      }
      let state = await sendRequest(Edit, values)
      if (state) {
        history.back()
      }
    })
  }
  return (
    <Modal
      getContainer={false}
      width="25%"
      destroyOnClose
      title={editData.id ? '编辑banner' : '添加banner'}
      open={visible}
      onCancel={() => onCancel(false)}
      onOk={submit}
    >
      <Form scrollToFirstError layout="horizontal" {...formItemLayout} form={form}>
        <Form.Item
          name="name"
          label='banner名称' rules={[
            {
              required: true,
              message: '请输入banner名称',
            },
          ]}
        >
          <Input disabled={editData.type == 'detail'} placeholder='请输入banner名称'></Input>
        </Form.Item>
        <Form.Item
          name="image"
          label="banner图片"
          extra={
            <div>
              <div>推荐尺寸732px * 320px</div>
            </div>
          }
          rules={[
            {
              required: fileList.length == 0 ? true : false,
              message: '请上传banner图片',
            },
          ]}
        >
          <Upload
            {...config}
            listType="picture-card"
            maxCount={1}
            beforeUpload={beforeUpload}
            onChange={handleChange}
            showUploadList={{
              showPreviewIcon: false,
            }}
            // customRequest={customRequest}
            // accept="image/png, image/jpeg, image/jpg"
            fileList={fileList}
            disabled={editData.type == 'detail'}
          >
            {fileList?.length == 1 || editData.type == 'detail' ? null : uploadButton()}
          </Upload>
        </Form.Item>
      </Form>
    </Modal>
  );
};
export default forwardRef(AddEditView);
management/src/pages/work-order/banner/index.jsx
@@ -3,35 +3,20 @@
import { Button, message, Space } from 'antd';
import { useRef, useState } from 'react';
import { Access, history, useAccess } from 'umi';
import AddAndEdit from './components/index';
import { getList, updateStatus, deleteBanner } from './service'
const Banner = () => {
  const actionRef = useRef();
  const access = useAccess();
  const addViewRef = useRef();
  const [modalVisible, handleModalVisible] = useState(false);
  const columns = [
    {
      title: 'banner名称',
      dataIndex: 'bannerName'
      dataIndex: 'name'
    },
    // {
    //   title: '添加时间',
    //   dataIndex: 'createTime',
    //   hideInSearch: true,
    // },
    // {
    //   title: '排序',
    //   dataIndex: 'sortNum',
    //   hideInSearch: true,
    // },
    // {
    //   title: '状态',
    //   dataIndex: 'listingStatus',
    //   valueEnum: {
    //     '上架中': { text: '上架中' },
    //     '已下架' : { text: '已下架' },
    //   }
    // },
    {
      title: '操作',
      hideInSearch: true,
@@ -63,46 +48,6 @@
                删除
              </Button>
            </Access>
            {/* <Button
              type="link"
              onClick={() => {
                history.push( `/marketing/banner/add?id=${record.id}&detail=true`);
              }}
            >
              查看详情
            </Button>
            {
              record.listingStatus == '已下架' &&
              <Button
                type="link"
                onClick={() => {
                  showDelConfirm(async () => {
                    let status = await sendRequest(updateStatus, { id: record.id, listingStatus: '上架中' })
                    if (status) {
                      actionRef.current.reload();
                    }
                  }, '确认上架所选信息吗?');
                }}
              >
                上架
              </Button>
            }
            {
              record.listingStatus == '上架中' &&
              <Button
                type="link"
                onClick={async () => {
                  showDelConfirm(async () => {
                    let status = await sendRequest(updateStatus, { id: record.id, listingStatus: '已下架' })
                    if (status) {
                      actionRef.current.reload();
                    }
                  }, '确认下架所选信息吗?');
                }}
              >
                下架
              </Button>
            } */}
          </Space >
        );
      },
@@ -121,7 +66,6 @@
          defaultPageSize: 10,
        }}
        request={(params) => {
          params.bannerType = Number(params.bannerType)
          return buildProTableDataSource(getList, params)
        }}
        toolBarRender={(action, selectRows) => [
@@ -130,9 +74,8 @@
              <Button
                type="primary"
                onClick={() => {
                  history.push({
                    pathname: `/marketing/banner/add`,
                  });
                  addViewRef.current.refreshData({});
                  handleModalVisible(true);
                }}
              >
                添加
@@ -141,6 +84,25 @@
          </Space>
        ]}
      />
      <AddAndEdit
                ref={addViewRef}
                visible={modalVisible}
                onCancel={() => handleModalVisible(false)}
                onSave={async (fileds) => {
                  const success = await sendRequest(add, fileds);
                  if (success) {
                    handleModalVisible(false);
                    actionRef.current.reload();
                  }
                }}
                onUpdate={async (fileds) => {
                  const success = await sendRequest(Edit, fileds);
                  if (success) {
                    handleModalVisible(false);
                    actionRef.current.reload();
                  }
                }}
              />
    </PageContainer>
  </div>;
};
management/src/pages/work-order/banner/service.js
@@ -2,49 +2,41 @@
// 列表
export const getList = async (data) => {
    return request(`/promotion/mgt/promotion-banner/page`, {
        method: 'POST',
        data
    return request(`/api/huacheng-sangeshenbian/banner/list`, {
        method: 'GET',
        params:data
    });
}
// 详情
export const getDetail = async (id) => {
    return request(`/promotion/mgt/promotion-banner/detail/${id}`, {
    return request(`/api/huacheng-sangeshenbian/banner/getBannerInfo/${id}`, {
        method: 'GET',
        // data
    });
}
// 详情列表
export const getDetailList = async (data) => {
    return request(`/goods/mgt/goods-sku/page`, {
        method: 'POST',
        data
    });
}
// 删除
export const deleteBanner = async (id) => {
    return request(`/promotion/mgt/promotion-banner/${id}`, {
    return request(`/api/huacheng-sangeshenbian/banner/delete/${id}`, {
        method: 'delete',
        // params
    });
}
// 添加 编辑
export const addAndEdit = async (data) => {
    return request('/promotion/mgt/promotion-banner/save', {
export const add = async (data) => {
    return request('/api/huacheng-sangeshenbian/banner/add', {
        method: 'POST',
        data,
    });
}
// 上下架
export const updateStatus = async (data) => {
    return request(`/promotion/mgt/promotion-banner/upd-status`, {
// 添加 编辑
export const Edit = async (data) => {
    return request('/api/huacheng-sangeshenbian/banner/edit', {
        method: 'POST',
        data
        data,
    });
}
management/src/pages/work-order/problem-type/components/addAndEdit.jsx
@@ -49,7 +49,7 @@
    >
      <Form layout="horizontal" {...formItemLayout} form={form}>
      <Form.Item
          name="categoryName"
          name="name"
          label="问题名称"
          rules={[{ required: true, message: '请输入' }]}
        >
management/src/pages/work-order/problem-type/index.jsx
@@ -1,10 +1,10 @@
import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils';
import { buildProTableDataSource, sendRequest, showDelConfirm1 } from '@/utils/antdUtils';
import { PageContainer, ProTable } from '@ant-design/pro-components';
import { Button, Space } from 'antd';
import { useRef, useState } from 'react';
import { useAccess, Access } from 'umi';
import AddAndEdit from './components/addAndEdit';
import { addAndEdit, del, getList } from './service';
import { add,Edit, del, getList } from './service';
const Account = () => {
  const actionRef = useRef();
  const addViewRef = useRef();
@@ -15,7 +15,7 @@
  const columns = [
    {
      title: '问题类型名称',
      dataIndex: 'categoryName',
      dataIndex: 'name',
    },
    {
      title: '操作',
@@ -38,7 +38,7 @@
              <Button
                type="link"
                onClick={() => {
                  showDelConfirm(async () => {
                  showDelConfirm1(async () => {
                    let status = await sendRequest(del, record.id);
                    if (status) {
                      actionRef.current.reload();
@@ -93,14 +93,14 @@
          visible={modalVisible}
          onCancel={() => handleModalVisible(false)}
          onSave={async (fileds) => {
            const success = await sendRequest(addAndEdit, fileds);
            const success = await sendRequest(add, fileds);
            if (success) {
              handleModalVisible(false);
              actionRef.current.reload();
            }
          }}
          onUpdate={async (fileds) => {
            const success = await sendRequest(addAndEdit, fileds);
            const success = await sendRequest(Edit, fileds);
            if (success) {
              handleModalVisible(false);
              actionRef.current.reload();
management/src/pages/work-order/problem-type/service.js
@@ -2,27 +2,33 @@
// 列表
export const getList = async (data) => {
    return request(`/goods/mgt/goods-category/page`, {
        method: 'POST',
        data
    return request(`/api/huacheng-sangeshenbian/problemType/list`, {
        method: 'GET',
        params:data
    });
}
// 添加dept
export const addAndEdit = async (data) => {
    return request('/goods/mgt/goods-category/save', {
export const add = async (data) => {
    return request('/api/huacheng-sangeshenbian/problemType/add', {
        method: 'POST',
        data,
    });
}
// 添加dept
export const Edit = async (data) => {
    return request('/api/huacheng-sangeshenbian/problemType/edit', {
        method: 'POST',
        data,
    });
}
// 批量删除dept
export const del = async (id) => {
    return request(`/goods/mgt/goods-category/${id}`, {
    return request(`/api/huacheng-sangeshenbian/problemType/delete/${id}`, {
        method: 'DELETE',
        // data
    });
management/src/utils/antdUtils.js
@@ -33,6 +33,21 @@
    },
  });
}
export function showDelConfirm1(okHandler, content, confirmText, cancelText, title) {
  confirm({
    title: title || '提示',
    content: content || '确认删除所选信息吗?',
    okText: confirmText || '确认',
    cancelText: cancelText || '关闭',
    onOk() {
      okHandler();
    },
    onCancel() {
    },
  });
}
// 转换成ProFormSelect可用的数据
export async function buildProFormSelectDataSourceTwo(fun, params) {
  const response = await fun(params);