脚本管理支持新增文件

This commit is contained in:
hanhh
2021-09-19 21:23:03 +08:00
parent 646443deb5
commit 0baf0d23ae
9 changed files with 234 additions and 54 deletions
+3 -9
View File
@@ -7,19 +7,17 @@ const SaveModal = ({
file,
handleCancel,
visible,
isNewFile,
}: {
file?: any;
visible: boolean;
handleCancel: (cks?: any[]) => void;
isNewFile: boolean;
}) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const handleOk = async (values: any) => {
setLoading(true);
const payload = { ...file, ...values };
const payload = { ...file, ...values, originFilename: file.filename };
request
.post(`${config.apiPrefix}scripts`, {
data: payload,
@@ -71,12 +69,8 @@ const SaveModal = ({
>
<Input placeholder="请输入文件名" />
</Form.Item>
<Form.Item
name="path"
label="保存目录"
rules={[{ required: true, message: '请输入保存目录' }]}
>
<Input placeholder="请输入保存目录" />
<Form.Item name="path" label="保存目录">
<Input placeholder="请输入保存目录,默认scripts目录" />
</Form.Item>
</Form>
</Modal>