Преглед изворни кода

Merge branch 'master' into kitchenmanage

tmp
gwbvipvip пре 10 месеци
родитељ
комит
c97628c5e5
1 измењених фајлова са 47 додато и 43 уклоњено
  1. +47
    -43
      src/pages/device/deviceVesion/index.jsx

+ 47
- 43
src/pages/device/deviceVesion/index.jsx Прегледај датотеку

@@ -9,6 +9,50 @@ import { GetDeviceVesionPage, AddDeviceVesion, DelDeviceVesion, UpdateDeviceVesi
import { history } from 'umi';
const key = 'message';


const GoodsTypeManage = () => {
const [createModalVisible, handleModalVisible] = useState(false);
const actionRef = useRef();
const [DictData, setDictData] = useState([]);
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isAddGoodsTemplate,setIsAddGoodsTemplate]=useState(false);
const [form] = Form.useForm();
const props = {
beforeUpload: (file) => {
if (
file.type !== 'application/vnd.ms-excel' &&
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
) {
message.error(`${file.name} 不是 exelce 文件`);
}
return file.type == 'application/vnd.ms-excel' ||
file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
? true
: Upload.LIST_IGNORE;
},
name: 'file',
data: { "id": currentRow?.id, "deviceClientType": currentRow?.deviceTypeKey, "version": currentRow?.vesion,"isAddGoodsTemplate":isAddGoodsTemplate},
action: '/saasbase/api/goods/goodstemplateexport',
headers: {
Authorization: 'Bearer ' + localStorage.getItem('token')
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
setIsAddGoodsTemplate(false);
if (info.file.status === 'done') {
setIsModalOpen(false);
actionRef.current.reload();
message.success(`${info.file.name} 文件上传成功.`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 文件上载失败.`);
}
}
};

//添加
const handleAdd = async (fields) => {
try {
@@ -17,6 +61,7 @@ const handleAdd = async (fields) => {
message.destroy(key);
if (r.data) {
message.success('添加成功');
actionRef.current?.reloadAndRest?.();
return true;
} else {
message.error('添加失败');
@@ -39,6 +84,7 @@ const handleUpdate = async (fields) => {
message.destroy(key);
if (r.data) {
message.success('修改成功',);
actionRef.current?.reloadAndRest?.();
return true;
} else {
message.success('修改失败');
@@ -63,6 +109,7 @@ const handleRemove = async (selectedRows) => {
await DelDeviceVesion(ids).then((r) => {
if (r.data) {
message.success('删除成功');
actionRef.current?.reloadAndRest?.();
return true;
} else {
message.error(r.errors);
@@ -75,49 +122,6 @@ const handleRemove = async (selectedRows) => {
}
};


const GoodsTypeManage = () => {
const [createModalVisible, handleModalVisible] = useState(false);
const actionRef = useRef();
const [DictData, setDictData] = useState([]);
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const [isModalOpen, setIsModalOpen] = useState(false);
const [isAddGoodsTemplate,setIsAddGoodsTemplate]=useState(false);
const [form] = Form.useForm();
const props = {
beforeUpload: (file) => {
if (
file.type !== 'application/vnd.ms-excel' &&
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
) {
message.error(`${file.name} 不是 exelce 文件`);
}
return file.type == 'application/vnd.ms-excel' ||
file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
? true
: Upload.LIST_IGNORE;
},
name: 'file',
data: { "id": currentRow?.id, "deviceClientType": currentRow?.deviceTypeKey, "version": currentRow?.vesion,"isAddGoodsTemplate":isAddGoodsTemplate},
action: '/saasbase/api/goods/goodstemplateexport',
headers: {
Authorization: 'Bearer ' + localStorage.getItem('token')
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
setIsAddGoodsTemplate(false);
if (info.file.status === 'done') {
setIsModalOpen(false);
actionRef.current.reload();
message.success(`${info.file.name} 文件上传成功.`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 文件上载失败.`);
}
}
};
const columns = [
{
title: '主键',


Loading…
Откажи
Сачувај