Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
66a3d55f14 | |
|
b73d2a1ead | |
|
a8df35e175 | |
|
2c167bf638 | |
|
c44f99684b | |
|
c76d3d3f1f |
|
@ -4,7 +4,7 @@ import { PlusOutlined } from "@ant-design/icons";
|
||||||
import Upload, { RcFile, UploadFile, UploadProps } from "antd/lib/upload";
|
import Upload, { RcFile, UploadFile, UploadProps } from "antd/lib/upload";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import baseHttp from "@/service/base";
|
import baseHttp from "@/service/base";
|
||||||
import SystemConfig from "@/service/apiConfig/systemConfig";
|
import SystemConfig from "@/service/apiConfig/system_config";
|
||||||
|
|
||||||
interface UploadFileProps {
|
interface UploadFileProps {
|
||||||
imgList: Array<UploadFileEx>;
|
imgList: Array<UploadFileEx>;
|
|
@ -1,4 +1,4 @@
|
||||||
import { PaginationProps, Table } from "antd";
|
import { Pagination, PaginationProps, Table } from "antd";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
const BTable = (props: any) => {
|
const BTable = (props: any) => {
|
||||||
const { store, dataSource } = props;
|
const { store, dataSource } = props;
|
||||||
|
@ -24,21 +24,27 @@ const BTable = (props: any) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
<Table
|
<Table
|
||||||
pagination={{
|
style={{height:"100%",overflow:"auto"}}
|
||||||
size: "small",
|
pagination={false}
|
||||||
total: store.total,
|
loading={store.listStatus}
|
||||||
defaultCurrent: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
showSizeChanger: true,
|
|
||||||
onShowSizeChange: onShowSizeChange,
|
|
||||||
onChange: onChange,
|
|
||||||
}}
|
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
columns={props.columns}
|
columns={props.columns}
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
<div style={{textAlign:"right",padding:"10px"}}>
|
||||||
|
<Pagination
|
||||||
|
size="small"
|
||||||
|
defaultCurrent={1}
|
||||||
|
pageSize={20}
|
||||||
|
showSizeChanger={true}
|
||||||
|
total={store.total}
|
||||||
|
onShowSizeChange= {onShowSizeChange}
|
||||||
|
onChange={onChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,11 +2,10 @@ import { Checkbox, DatePicker, Form, Input, Radio } from "antd";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { SimpleFormData } from "./interface";
|
import { SimpleFormData } from "./interface";
|
||||||
import { FormSelect } from "./select";
|
import { FormSelect } from "./select";
|
||||||
import AliUpload from "../aliUpload";
|
import AliUpload from "../ali_upload";
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
const SimpleForm = (props: SimpleFormData) => {
|
const SimpleForm = (props: SimpleFormData) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { RangePicker } = DatePicker;
|
|
||||||
const onFinish = (values: any) => {
|
const onFinish = (values: any) => {
|
||||||
props.onFinish(values);
|
props.onFinish(values);
|
||||||
};
|
};
|
||||||
|
@ -21,9 +20,10 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
name={props.formName}
|
name={props.formName}
|
||||||
ref={props.formRef}
|
ref={props.formRef}
|
||||||
form={form}
|
form={form}
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
wrapperCol={{ span: 8 }}
|
||||||
|
layout="horizontal"
|
||||||
initialValues={{ menubar: true }}
|
initialValues={{ menubar: true }}
|
||||||
labelCol={{ span: props.colProps }}
|
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
onFinish={onFinish}
|
onFinish={onFinish}
|
||||||
autoComplete="on"
|
autoComplete="on"
|
||||||
>
|
>
|
||||||
|
@ -36,6 +36,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
label={v.label}
|
label={v.label}
|
||||||
name={v.name}
|
name={v.name}
|
||||||
rules={v.rules}
|
rules={v.rules}
|
||||||
|
|
||||||
>
|
>
|
||||||
<Input defaultValue={v.value} value={v.value} />
|
<Input defaultValue={v.value} value={v.value} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -8,7 +8,7 @@ const appMenu = {
|
||||||
label: "app管理",
|
label: "app管理",
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
key: "/app-list",
|
key: "/app/list",
|
||||||
icon: <VideoCameraOutlined />,
|
icon: <VideoCameraOutlined />,
|
||||||
label: "app列表",
|
label: "app列表",
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
import {
|
||||||
|
UploadOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
VideoCameraOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
|
const demand = {
|
||||||
|
key: "/demand",
|
||||||
|
icon: <UserOutlined />,
|
||||||
|
label: "需求池",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: "/shop1",
|
||||||
|
icon: <VideoCameraOutlined />,
|
||||||
|
label: "go to home",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "/shop2",
|
||||||
|
icon: <UploadOutlined />,
|
||||||
|
label: "go test",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default demand;
|
|
@ -3,29 +3,30 @@ import { UserOutlined } from "@ant-design/icons";
|
||||||
import userMenu from "./user";
|
import userMenu from "./user";
|
||||||
import activeMenu from "./active";
|
import activeMenu from "./active";
|
||||||
import taskMenu from "./task";
|
import taskMenu from "./task";
|
||||||
import contentMenu from "./contentMenu";
|
import contentMenu from "./content_menu";
|
||||||
import system from "./system";
|
import system from "./system";
|
||||||
import merchant from "./merchant";
|
import merchant from "./merchant";
|
||||||
import dynimacStateMenu from "./dynimacState";
|
import dynimacStateMenu from "./dynimac_state";
|
||||||
import rbac from "./rbac";
|
import rbac from "./rbac";
|
||||||
import app from "./app";
|
import app from "./app";
|
||||||
import cardMenu from "./card";
|
import demand from "./demand";
|
||||||
|
// demand
|
||||||
const menuList: ItemType[] = [
|
const menuList: ItemType[] = [
|
||||||
{
|
{
|
||||||
key: "/",
|
key: "/",
|
||||||
icon: <UserOutlined />,
|
icon: <UserOutlined />,
|
||||||
label: "首页",
|
label: "首页",
|
||||||
},
|
},
|
||||||
// userMenu,
|
userMenu,
|
||||||
cardMenu,
|
demand,
|
||||||
// contentMenu,
|
contentMenu,
|
||||||
// dynimacStateMenu,
|
dynimacStateMenu,
|
||||||
activeMenu,
|
activeMenu,
|
||||||
// merchant,
|
merchant,
|
||||||
// system,
|
system,
|
||||||
// rbac,
|
rbac,
|
||||||
// taskMenu,
|
taskMenu,
|
||||||
// app,
|
app,
|
||||||
];
|
];
|
||||||
|
|
||||||
export default menuList;
|
export default menuList;
|
||||||
|
|
|
@ -10,7 +10,14 @@ body {
|
||||||
#root{
|
#root{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.projectContent {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 10px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||||
monospace;
|
monospace;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Button, Space, Modal, Switch } from "antd";
|
import { Button, Space, Modal, Switch, Tooltip } from "antd";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { UserDataType } from "@/model/userModel";
|
import { UserDataType } from "@/model/userModel";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
@ -11,7 +11,7 @@ import React from "react";
|
||||||
import ActiveConfig from "@/service/apiConfig/active";
|
import ActiveConfig from "@/service/apiConfig/active";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
const Active = (props: Store) => {
|
const Active = (props: Store) => {
|
||||||
const { activeStore } = props;
|
const { activityStore } = props;
|
||||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||||
const [id, setId] = useState<any>(null);
|
const [id, setId] = useState<any>(null);
|
||||||
const [record, setRecord] = useState<any>(null);
|
const [record, setRecord] = useState<any>(null);
|
||||||
|
@ -20,64 +20,67 @@ const Active = (props: Store) => {
|
||||||
const columns: ColumnsType<UserDataType> = [
|
const columns: ColumnsType<UserDataType> = [
|
||||||
{
|
{
|
||||||
title: "活动标题",
|
title: "活动标题",
|
||||||
dataIndex: "activeName",
|
dataIndex: "title",
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "活动描述",
|
||||||
|
dataIndex: "desc",
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "活动图片",
|
||||||
|
dataIndex: "activeIcon",
|
||||||
|
width: 200,
|
||||||
|
ellipsis: {
|
||||||
|
showTitle: false,
|
||||||
|
},
|
||||||
|
render: (address) => (
|
||||||
|
<Tooltip placement="topLeft" title={address}>
|
||||||
|
{address}
|
||||||
|
</Tooltip>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "活动人数",
|
||||||
|
dataIndex: "peopleNum",
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "活动地址",
|
||||||
|
dataIndex: "address",
|
||||||
|
width: 200,
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: "活动描述",
|
|
||||||
// dataIndex: "desc",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "活动图片",
|
|
||||||
// dataIndex: "activeIcon",
|
|
||||||
// ellipsis: {
|
|
||||||
// showTitle: false,
|
|
||||||
// },
|
|
||||||
// render: (address) => (
|
|
||||||
// <Tooltip placement="topLeft" title={address}>
|
|
||||||
// {address}
|
|
||||||
// </Tooltip>
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "活动人数",
|
|
||||||
// dataIndex: "peopleNum",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "活动地址",
|
|
||||||
// dataIndex: "address",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: "折扣",
|
title: "折扣",
|
||||||
dataIndex: "discount",
|
dataIndex: "discount",
|
||||||
|
width: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动开始时间",
|
title: "活动开始时间",
|
||||||
dataIndex: "startTime",
|
dataIndex: "startTime",
|
||||||
|
width: 200,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "活动结束时间",
|
title: "活动结束时间",
|
||||||
dataIndex: "endTime",
|
dataIndex: "endTime",
|
||||||
|
width: 200,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动状态",
|
title: "活动状态",
|
||||||
render: (any, record) => (
|
width: 200,
|
||||||
<div>
|
render: (any, record) => <span>{record.status ? "开启" : "关闭"}</span>,
|
||||||
<span>{record.status ? "开启" : "关闭"}</span>
|
},
|
||||||
</div>
|
{
|
||||||
),
|
width: 200,
|
||||||
|
title: "发起人",
|
||||||
|
dataIndex: "userId",
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: "发起人",
|
|
||||||
// dataIndex: "userId",
|
|
||||||
// },
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
|
width: 200,
|
||||||
|
fixed: "right",
|
||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
ellipsis: {
|
|
||||||
showTitle: false,
|
|
||||||
},
|
|
||||||
render: (any, record) => (
|
render: (any, record) => (
|
||||||
<div>
|
<div>
|
||||||
<Space direction="vertical">
|
<Space direction="vertical">
|
||||||
|
@ -93,7 +96,7 @@ const Active = (props: Store) => {
|
||||||
danger
|
danger
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
activeStore.deleteItem(record.id);
|
activityStore.deleteItem(record.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
|
@ -123,7 +126,7 @@ const Active = (props: Store) => {
|
||||||
setId(record.id);
|
setId(record.id);
|
||||||
};
|
};
|
||||||
const onChange = (bools, record) => {
|
const onChange = (bools, record) => {
|
||||||
activeStore.putItem(record.id, {
|
activityStore.putItem(record.id, {
|
||||||
status: bools,
|
status: bools,
|
||||||
activeName: record.activeName,
|
activeName: record.activeName,
|
||||||
discount: record.discount,
|
discount: record.discount,
|
||||||
|
@ -161,15 +164,15 @@ const Active = (props: Store) => {
|
||||||
];
|
];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
activeStore.getlist(ActiveConfig.LIST);
|
activityStore.getlist(ActiveConfig.LIST);
|
||||||
}, [activeStore]);
|
}, [activityStore]);
|
||||||
const onFinish = (values: any) => {
|
const onFinish = (values: any) => {
|
||||||
values["startTime"] = values["startTime"].format("YYYY.MM.DD");
|
values["startTime"] = values["startTime"].format("YYYY.MM.DD");
|
||||||
values["endTime"] = values["endTime"].format("YYYY.MM.DD");
|
values["endTime"] = values["endTime"].format("YYYY.MM.DD");
|
||||||
if (!id) {
|
if (!id) {
|
||||||
activeStore.add(values);
|
activityStore.add(values);
|
||||||
} else {
|
} else {
|
||||||
activeStore.putItem(id, values);
|
activityStore.putItem(id, values);
|
||||||
}
|
}
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
};
|
};
|
||||||
|
@ -177,14 +180,17 @@ const Active = (props: Store) => {
|
||||||
const addAction = () => {
|
const addAction = () => {
|
||||||
setProjectConfig(defaultConfig);
|
setProjectConfig(defaultConfig);
|
||||||
setId(null);
|
setId(null);
|
||||||
setRecord(null)
|
setRecord(null);
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
formRef.current?.setFieldsValue(record);
|
formRef.current?.setFieldsValue(record);
|
||||||
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className="projectContent">
|
<div style={{ padding: "10px" }}>
|
||||||
<Button className="projectContentAdd" onClick={() => addAction()}>
|
<Button
|
||||||
|
style={{ marginBottom: "10px" }}
|
||||||
|
className="projectContentAdd"
|
||||||
|
onClick={() => addAction()}
|
||||||
|
>
|
||||||
添加活动
|
添加活动
|
||||||
</Button>
|
</Button>
|
||||||
<Modal
|
<Modal
|
||||||
|
@ -211,13 +217,13 @@ const Active = (props: Store) => {
|
||||||
</Modal>
|
</Modal>
|
||||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
<BTable
|
<BTable
|
||||||
store={activeStore}
|
store={activityStore}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={activeStore.list}
|
dataSource={activityStore.list}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default inject("activeStore")(observer(Active));
|
export default inject("activityStore")(observer(Active));
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Button, Space, Modal, FormInstance } from "antd";
|
import { Button, Space, Modal, FormInstance } from "antd";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import UserConfig from "@/service/apiConfig/userConfig";
|
import UserConfig from "@/service/apiConfig/user_config";
|
||||||
import { UserDataType } from "@/model/userModel";
|
import { UserDataType } from "@/model/userModel";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
|
@ -17,15 +17,8 @@ const ActiveType = (props: Store) => {
|
||||||
const [record, setRecord] = useState<any>(null);
|
const [record, setRecord] = useState<any>(null);
|
||||||
const [userId, setId] = useState<Number | null>(null);
|
const [userId, setId] = useState<Number | null>(null);
|
||||||
const columns: ColumnsType<UserDataType> = [
|
const columns: ColumnsType<UserDataType> = [
|
||||||
{
|
{ title: "类型名称", dataIndex: "name" },
|
||||||
title: "类型名称",
|
{ title: "类型描述", dataIndex: "desc" },
|
||||||
dataIndex: "name",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "类型描述",
|
|
||||||
dataIndex: "desc",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
|
@ -36,6 +29,16 @@ const ActiveType = (props: Store) => {
|
||||||
<div>
|
<div>
|
||||||
<Space direction="vertical">
|
<Space direction="vertical">
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
<EditBtn />
|
||||||
|
<DeBtn />
|
||||||
|
</Space>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const EditBtn = () => {
|
||||||
|
return (
|
||||||
<Button
|
<Button
|
||||||
type="dashed"
|
type="dashed"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -45,7 +48,10 @@ const ActiveType = (props: Store) => {
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const DeBtn = () => {
|
||||||
|
return (
|
||||||
<Button
|
<Button
|
||||||
type="dashed"
|
type="dashed"
|
||||||
danger
|
danger
|
||||||
|
@ -56,12 +62,8 @@ const ActiveType = (props: Store) => {
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
);
|
||||||
</Space>
|
};
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const edit = (record) => {
|
const edit = (record) => {
|
||||||
record = {
|
record = {
|
||||||
...record,
|
...record,
|
||||||
|
@ -84,6 +86,7 @@ const ActiveType = (props: Store) => {
|
||||||
}
|
}
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
activityTypeStore.getlist(UserConfig.LIST);
|
activityTypeStore.getlist(UserConfig.LIST);
|
||||||
}, [activityTypeStore]);
|
}, [activityTypeStore]);
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
import { Space, Tabs, TabsProps } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
import PayConfig from "./config/pay-config";
|
||||||
|
import PushConfig from "./config/push-config";
|
||||||
|
import ImConfig from "./config/im-config";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { useParams } from "react-router";
|
||||||
|
const AppManageConfig = (props: Store) => {
|
||||||
|
const { appStore } = props
|
||||||
|
const { id } = useParams();
|
||||||
|
useEffect(()=>{
|
||||||
|
appStore.getApp(id)
|
||||||
|
},[appStore,id])
|
||||||
|
const items: TabsProps["items"] = [
|
||||||
|
{
|
||||||
|
key: "1",
|
||||||
|
label: "支付配置",
|
||||||
|
children: <PayConfig />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "2",
|
||||||
|
label: "推送配置",
|
||||||
|
children: <PushConfig />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "3",
|
||||||
|
label: "im配置",
|
||||||
|
children: <ImConfig />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const onChange = ()=>{
|
||||||
|
appStore.getApp(id)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<Tabs defaultActiveKey="1" type="card" items={items} onChange={onChange}/>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("appStore")(observer(AppManageConfig));
|
|
@ -0,0 +1,162 @@
|
||||||
|
import { Space, Button, FormInstance } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import type { ColumnsType } from "antd/es/table";
|
||||||
|
import BTable from "@/components/b_table";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import UserConfig from "@/service/apiConfig/user_config";
|
||||||
|
import { UserDataType } from "@/model/userModel";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
import Modal from "antd/lib/modal/Modal";
|
||||||
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
|
import React from "react";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
const AppManageList = (props: Store) => {
|
||||||
|
const { appStore } = props;
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const [id, setId] = useState<any>(null);
|
||||||
|
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||||
|
const [record, setRecord] = useState<any>(null);
|
||||||
|
const formRef = React.useRef<FormInstance>(null);
|
||||||
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
|
const columns: ColumnsType<UserDataType> = [
|
||||||
|
{ title: "app名称", dataIndex: "appName" },
|
||||||
|
{ title: "图标", dataIndex: "appIcon" },
|
||||||
|
{ title: "预览图片", dataIndex: "activeIcon" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
dataIndex: "id",
|
||||||
|
ellipsis: {
|
||||||
|
showTitle: false,
|
||||||
|
},
|
||||||
|
render: (any, record) => (
|
||||||
|
<div>
|
||||||
|
<Space direction="vertical">
|
||||||
|
<Space wrap>
|
||||||
|
<Button
|
||||||
|
type="dashed"
|
||||||
|
size="small"
|
||||||
|
onClick={() => {
|
||||||
|
edit(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="dashed"
|
||||||
|
size="small"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/app/config/" + record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
信息配置
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="dashed"
|
||||||
|
danger
|
||||||
|
size="small"
|
||||||
|
onClick={() => {
|
||||||
|
appStore.deleteItem(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const edit = (record) => {
|
||||||
|
setProjectConfig(defaultConfig);
|
||||||
|
setIsModalOpen(true);
|
||||||
|
formRef.current?.setFieldsValue(record);
|
||||||
|
setRecord(record);
|
||||||
|
setId(record.id);
|
||||||
|
};
|
||||||
|
const defaultConfig = [
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "app名称",
|
||||||
|
name: "appName",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "upload",
|
||||||
|
label: "icon",
|
||||||
|
name: "appIcon",
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "upload",
|
||||||
|
label: "图片",
|
||||||
|
name: "photosIds",
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
useEffect(() => {
|
||||||
|
appStore.getlist(UserConfig.LIST);
|
||||||
|
}, [appStore]);
|
||||||
|
const onFinish = (values: any) => {
|
||||||
|
let ids = values.photosIds.map((item) => {
|
||||||
|
return item.id;
|
||||||
|
});
|
||||||
|
let appIcon = values.appIcon.map((item) => {
|
||||||
|
return item.id;
|
||||||
|
});
|
||||||
|
console.log(values);
|
||||||
|
values = {
|
||||||
|
...values,
|
||||||
|
photosIds: ids.join(","),
|
||||||
|
appIcon: appIcon.join(","),
|
||||||
|
};
|
||||||
|
if (!id) {
|
||||||
|
appStore.add(values);
|
||||||
|
} else {
|
||||||
|
appStore.putItem(id, values);
|
||||||
|
}
|
||||||
|
setIsModalOpen(false);
|
||||||
|
};
|
||||||
|
const onFinishFailed = () => {};
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Button
|
||||||
|
className="projectContentAdd"
|
||||||
|
style={{ marginBottom: "10px" }}
|
||||||
|
onClick={() => {
|
||||||
|
setProjectConfig(defaultConfig);
|
||||||
|
setIsModalOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
添加app
|
||||||
|
</Button>
|
||||||
|
<Modal
|
||||||
|
title="app信息"
|
||||||
|
width={800}
|
||||||
|
open={isModalOpen}
|
||||||
|
onCancel={() => setIsModalOpen(false)}
|
||||||
|
afterClose={() => formRef.current?.resetFields()}
|
||||||
|
onOk={() => formRef.current?.submit()}
|
||||||
|
>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={formRef}
|
||||||
|
createCallback={() => {
|
||||||
|
formRef.current?.setFieldsValue(record);
|
||||||
|
}}
|
||||||
|
formName="card_basic"
|
||||||
|
colProps={4}
|
||||||
|
subBtnName="提交"
|
||||||
|
formDatas={projectConfig}
|
||||||
|
onFinish={onFinish}
|
||||||
|
initialValues={true}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<BTable store={appStore} columns={columns} dataSource={appStore.list} />
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("appStore")(observer(AppManageList));
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { Space } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
const ImConfig = (props: Store) => {
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("im");
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
im配置
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("appStore")(observer(ImConfig));
|
|
@ -0,0 +1,139 @@
|
||||||
|
import { Button, FormInstance, Space } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
|
import React from "react";
|
||||||
|
import { useParams } from "react-router";
|
||||||
|
const PayConfig = (props: Store) => {
|
||||||
|
const { appStore } = props;
|
||||||
|
const { id } = useParams();
|
||||||
|
const wxformRef = React.useRef<FormInstance>(null);
|
||||||
|
const aliformRef = React.useRef<FormInstance>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
wxformRef.current?.setFieldsValue(appStore.item?.wechat)
|
||||||
|
aliformRef.current?.setFieldsValue(appStore.item?.ali)
|
||||||
|
}, [appStore.item,id]);
|
||||||
|
const onFinishFailed = () => {};
|
||||||
|
const onwxFinish = (values: any) => {
|
||||||
|
appStore.setWechatConfig(id,values)
|
||||||
|
};
|
||||||
|
const onAliFinish = (values: any) => {
|
||||||
|
appStore.setAlConfig(id,values)
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>微信支付</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
wxformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
formRef={wxformRef}
|
||||||
|
onFinish={onwxFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "wechatAppid",
|
||||||
|
name: "wechatAppid",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "mchid",
|
||||||
|
name: "mchid",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "body",
|
||||||
|
name: "body",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "notifyURL",
|
||||||
|
name: "notifyURL",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "key",
|
||||||
|
name: "key",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>支付宝支付</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
aliformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={aliformRef}
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={onAliFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "AliAppId",
|
||||||
|
name: "appid",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "AliKey",
|
||||||
|
name: "aliKey",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "returnUrl",
|
||||||
|
name: "returnUrl",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "notifyURL",
|
||||||
|
name: "notifyURL",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("appStore")(observer(PayConfig));
|
|
@ -0,0 +1,259 @@
|
||||||
|
import { Button, FormInstance, Space } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
|
import React from "react";
|
||||||
|
import { useParams } from "react-router";
|
||||||
|
const PushConfig = (props: Store) => {
|
||||||
|
const { appStore } = props;
|
||||||
|
const { id } = useParams();
|
||||||
|
const hwformRef = React.useRef<FormInstance>(null);
|
||||||
|
const iosformRef = React.useRef<FormInstance>(null);
|
||||||
|
const opformRef = React.useRef<FormInstance>(null);
|
||||||
|
const vivoformRef = React.useRef<FormInstance>(null);
|
||||||
|
const xmformRef = React.useRef<FormInstance>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
hwformRef.current?.setFieldsValue(appStore.item.pushHwawei);
|
||||||
|
iosformRef.current?.setFieldsValue(appStore.item.pushIos);
|
||||||
|
opformRef.current?.setFieldsValue(appStore.item.pushOppo);
|
||||||
|
vivoformRef.current?.setFieldsValue(appStore.item.pushVivo);
|
||||||
|
xmformRef.current?.setFieldsValue(appStore.item.pushXiaomi);
|
||||||
|
}, [appStore.item, id]);
|
||||||
|
|
||||||
|
const onFinishFailed = () => {};
|
||||||
|
|
||||||
|
const iosOnFinish = (values: any) => {
|
||||||
|
appStore.setIosConfig(id, values);
|
||||||
|
};
|
||||||
|
const xmOnFinish = (values: any) => {
|
||||||
|
appStore.setXmConfig(id, values);
|
||||||
|
};
|
||||||
|
const hwOnFinish = (values: any) => {
|
||||||
|
appStore.setHwConfig(id, values);
|
||||||
|
};
|
||||||
|
const oppoOnFinish = (values: any) => {
|
||||||
|
appStore.setOPConfig(id, values);
|
||||||
|
};
|
||||||
|
const vivoOnFinish = (values: any) => {
|
||||||
|
appStore.setVivoConfig(id, values);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>苹果推送</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
iosformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={iosformRef}
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={iosOnFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "appleBundleId",
|
||||||
|
name: "appleBundleId",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入appleBundleId!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "password",
|
||||||
|
name: "password",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入推送密码!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "upload",
|
||||||
|
label: "推送证书",
|
||||||
|
name: "centerFile",
|
||||||
|
value: [],
|
||||||
|
rules: [{ required: true, message: "请上传推送证书!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>华为推送</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
hwformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formName={""}
|
||||||
|
formRef={hwformRef}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={hwOnFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "huaWeiClientID",
|
||||||
|
name: "huaWeiClientID",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "huaWeiClientSecret",
|
||||||
|
name: "huaWeiClientSecret",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>oppo推送</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
opformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SimpleForm
|
||||||
|
formRef={opformRef}
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={oppoOnFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "oppoAppKey",
|
||||||
|
name: "oppoAppKey",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "oppoMasterSecret",
|
||||||
|
name: "oppoMasterSecret",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>vivo推送</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
vivoformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={vivoformRef}
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={vivoOnFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "vivoappId",
|
||||||
|
name: "vivoappId",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "vivoAppKey",
|
||||||
|
name: "vivoAppKey",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "vivoAppSecret",
|
||||||
|
name: "vivoAppSecret",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ backgroundColor: "#fff", padding: "10px" }}>
|
||||||
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||||
|
<p>小米推送</p>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
xmformRef.current?.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SimpleForm
|
||||||
|
formRef={xmformRef}
|
||||||
|
formName={""}
|
||||||
|
colProps={0}
|
||||||
|
onFinish={xmOnFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
formDatas={[
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "xiaoMiappId",
|
||||||
|
name: "xiaoMiappId",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "xiaoMiAppKey",
|
||||||
|
name: "xiaoMiAppKey",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "xiaoMiAppSecret",
|
||||||
|
name: "xiaoMiAppSecret",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "input",
|
||||||
|
label: "xiaoMiAppChannelId",
|
||||||
|
name: "xiaoMiAppChannelId",
|
||||||
|
value: "",
|
||||||
|
rules: [{ required: true, message: "请输入卡片名称!" }],
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("appStore")(observer(PushConfig));
|
|
@ -1,158 +1,10 @@
|
||||||
import { Tooltip, Space, Button, FormInstance } from "antd";
|
import { Outlet } from "react-router";
|
||||||
import { inject, observer } from "mobx-react";
|
const AppManage = () => {
|
||||||
import type { ColumnsType } from "antd/es/table";
|
|
||||||
import BTable from "@/components/BTable";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import UserConfig from "@/service/apiConfig/userConfig";
|
|
||||||
import { UserDataType } from "@/model/userModel";
|
|
||||||
import { Store } from "antd/lib/form/interface";
|
|
||||||
import Modal from "antd/lib/modal/Modal";
|
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
|
||||||
import React from "react";
|
|
||||||
const AppManage = (props: Store) => {
|
|
||||||
const { appStore } = props;
|
|
||||||
const [id, setId] = useState<any>(null);
|
|
||||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
|
||||||
const [record, setRecord] = useState<any>(null);
|
|
||||||
const formRef = React.useRef<FormInstance>(null);
|
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
||||||
const columns: ColumnsType<UserDataType> = [
|
|
||||||
{
|
|
||||||
title: "app名称",
|
|
||||||
dataIndex: "title",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "图标",
|
|
||||||
dataIndex: "desc",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "预览图片",
|
|
||||||
dataIndex: "activeIcon",
|
|
||||||
ellipsis: {
|
|
||||||
showTitle: false,
|
|
||||||
},
|
|
||||||
render: (address) => (
|
|
||||||
<Tooltip placement="topLeft" title={address}>
|
|
||||||
{address}
|
|
||||||
</Tooltip>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
dataIndex: "id",
|
|
||||||
ellipsis: {
|
|
||||||
showTitle: false,
|
|
||||||
},
|
|
||||||
render: (any, record) => (
|
|
||||||
<div>
|
|
||||||
<Space direction="vertical">
|
|
||||||
<Space wrap>
|
|
||||||
<Button
|
|
||||||
type="dashed"
|
|
||||||
size="small"
|
|
||||||
onClick={() => {
|
|
||||||
edit(record);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</Button>
|
|
||||||
{/* <Button type="dashed" size="small" onClick={() => {
|
|
||||||
navigate("/card/componsition/" + record.id)
|
|
||||||
}}>用户作文</Button> */}
|
|
||||||
<Button
|
|
||||||
type="dashed"
|
|
||||||
danger
|
|
||||||
size="small"
|
|
||||||
onClick={() => {
|
|
||||||
appStore.deleteItem(record.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</Button>
|
|
||||||
</Space>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const edit = (record) => {
|
|
||||||
setProjectConfig(defaultConfig);
|
|
||||||
setIsModalOpen(true);
|
|
||||||
formRef.current?.setFieldsValue(record);
|
|
||||||
setRecord(record);
|
|
||||||
setId(record.id);
|
|
||||||
};
|
|
||||||
const defaultConfig = [
|
|
||||||
{
|
|
||||||
type: "input",
|
|
||||||
label: "app名称",
|
|
||||||
name: "appName",
|
|
||||||
value: "",
|
|
||||||
rules: [{ required: true, message: "请输入卡片名称!" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "upload",
|
|
||||||
label: "icon",
|
|
||||||
name: "appIcon",
|
|
||||||
value:[],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "upload",
|
|
||||||
label: "图片",
|
|
||||||
name: "photosIds",
|
|
||||||
value: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
useEffect(() => {
|
|
||||||
appStore.getlist(UserConfig.LIST);
|
|
||||||
}, [appStore]);
|
|
||||||
const onFinish = (values: any) => {
|
|
||||||
if (!id) {
|
|
||||||
appStore.add(values);
|
|
||||||
} else {
|
|
||||||
appStore.putItem(id, values);
|
|
||||||
}
|
|
||||||
setIsModalOpen(false);
|
|
||||||
};
|
|
||||||
const onFinishFailed = () => {};
|
|
||||||
return (
|
return (
|
||||||
<div className="contentBox">
|
<div className="contentBox">
|
||||||
<Button
|
<Outlet></Outlet>
|
||||||
className="projectContentAdd"
|
|
||||||
onClick={() => {
|
|
||||||
setProjectConfig(defaultConfig);
|
|
||||||
setIsModalOpen(true);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
添加app
|
|
||||||
</Button>
|
|
||||||
<Modal
|
|
||||||
title="app信息"
|
|
||||||
width={800}
|
|
||||||
open={isModalOpen}
|
|
||||||
onCancel={() => setIsModalOpen(false)}
|
|
||||||
afterClose={() => formRef.current?.resetFields()}
|
|
||||||
onOk={() => formRef.current?.submit()}
|
|
||||||
>
|
|
||||||
<SimpleForm
|
|
||||||
formRef={formRef}
|
|
||||||
createCallback={() => {
|
|
||||||
formRef.current?.setFieldsValue(record);
|
|
||||||
}}
|
|
||||||
formName="card_basic"
|
|
||||||
colProps={4}
|
|
||||||
subBtnName="提交"
|
|
||||||
formDatas={projectConfig}
|
|
||||||
onFinish={onFinish}
|
|
||||||
initialValues={true}
|
|
||||||
onFinishFailed={onFinishFailed}
|
|
||||||
/>
|
|
||||||
</Modal>
|
|
||||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
|
||||||
<BTable store={appStore} columns={columns} dataSource={appStore.list} />
|
|
||||||
</Space>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default inject("appStore")(observer(AppManage));
|
export default AppManage;
|
||||||
|
|
|
@ -2,13 +2,13 @@ import { Button, Space, Modal, FormInstance } from "antd";
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
const CardPageList = (props) => {
|
const CardPageList = (props) => {
|
||||||
const { cardStore } = props;
|
const { cardStore } = props;
|
||||||
const [projectConfig, setProjectConfig] = useState<any>([])
|
const [projectConfig, setProjectConfig] = useState<any>([])
|
||||||
|
|
|
@ -2,14 +2,14 @@ import { Button, Space, Modal, FormInstance } from "antd";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
const CharacterPageList = (props) => {
|
const CharacterPageList = (props) => {
|
||||||
const { characterStore } = props;
|
const { characterStore } = props;
|
||||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||||
|
|
|
@ -3,12 +3,12 @@ import "./index.less";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
const CurrentEventPageList = (props) => {
|
const CurrentEventPageList = (props) => {
|
||||||
const currentEventStore = props.currentEventStore;
|
const currentEventStore = props.currentEventStore;
|
||||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Button, Modal, Popconfirm } from "antd";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import "./index.less";
|
import "./index.less";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { Button, Space } from "antd";
|
import { Button, Space } from "antd";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
|
@ -36,8 +36,9 @@ const DymiticState = (props: Store) => {
|
||||||
dynamicStore.getlist();
|
dynamicStore.getlist();
|
||||||
}, [dynamicStore]);
|
}, [dynamicStore]);
|
||||||
return (
|
return (
|
||||||
<div style={{ margin: 10 }}>
|
<div style={{ margin: 10 }} className="projectContent">
|
||||||
<BTable
|
<BTable
|
||||||
|
loading={dynamicStore.listStatus}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
store={dynamicStore}
|
store={dynamicStore}
|
||||||
dataSource={dynamicStore.list}
|
dataSource={dynamicStore.list}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { Button, FormInstance, Modal, Space } from "antd";
|
import { Button, FormInstance, Modal, Space } from "antd";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import merchantsConfig from "@/service/apiConfig/merchantsConfig";
|
import merchantsConfig from "@/service/apiConfig/merchants_config";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import EditorComponent from "@/components/edittor";
|
import EditorComponent from "@/components/edittor";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { Button, FormInstance, Modal, Space } from "antd";
|
import { Button, FormInstance, Modal, Space } from "antd";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import merchantsConfig from "@/service/apiConfig/merchantsConfig";
|
import merchantsConfig from "@/service/apiConfig/merchants_config";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { Button, FormInstance, Modal, Space } from "antd";
|
import { Button, FormInstance, Modal, Space } from "antd";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import merchantsConfig from "@/service/apiConfig/merchantsConfig";
|
import merchantsConfig from "@/service/apiConfig/merchants_config";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { Button, FormInstance, Modal, Space } from "antd";
|
import { Button, FormInstance, Modal, Space } from "antd";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import merchantsConfig from "@/service/apiConfig/merchantsConfig";
|
import merchantsConfig from "@/service/apiConfig/merchants_config";
|
||||||
import SimpleForm from "@/components/form/simple_form";
|
import SimpleForm from "@/components/form/simple_form";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import EditorComponent from "@/components/edittor";
|
import EditorComponent from "@/components/edittor";
|
||||||
import projectTypeConfig from "@/service/apiConfig/projectTypeConfig";
|
import projectTypeConfig from "@/service/apiConfig/project_type_config";
|
||||||
|
|
||||||
const Project = (props: Store) => {
|
const Project = (props: Store) => {
|
||||||
const { projectStore } = props;
|
const { projectStore } = props;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import AliUpload from "@/components/aliUpload";
|
import AliUpload from "@/components/ali_upload";
|
||||||
import { UploadFile } from "antd";
|
import { UploadFile } from "antd";
|
||||||
|
|
||||||
const Banner = (props: Store) => {
|
const Banner = (props: Store) => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import AliUpload from "@/components/aliUpload";
|
import AliUpload from "@/components/ali_upload";
|
||||||
import { UploadFile } from "antd";
|
import { UploadFile } from "antd";
|
||||||
|
|
||||||
const Logs = (props: Store) => {
|
const Logs = (props: Store) => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Button, Tooltip, Image, Space, Modal, FormInstance } from "antd";
|
import { Button, Tooltip, Image, Space, Modal, FormInstance } from "antd";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import type { ColumnsType } from "antd/es/table";
|
import type { ColumnsType } from "antd/es/table";
|
||||||
import BTable from "@/components/BTable";
|
import BTable from "@/components/b_table";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import UserConfig from "@/service/apiConfig/userConfig";
|
import UserConfig from "@/service/apiConfig/user_config";
|
||||||
import { UserDataType } from "@/model/userModel";
|
import { UserDataType } from "@/model/userModel";
|
||||||
import { Store } from "antd/lib/form/interface";
|
import { Store } from "antd/lib/form/interface";
|
||||||
import "./user.less";
|
import "./user.less";
|
||||||
|
|
|
@ -1,13 +1,28 @@
|
||||||
import { Suspense, lazy } from "react";
|
import { Suspense, lazy } from "react";
|
||||||
const AppManage = lazy(() => import("@/pages/app"));
|
const AppManageList = lazy(() => import("@/pages/app/app-list"));
|
||||||
|
const AppManageConfig = lazy(() => import("@/pages/app/app-config"));
|
||||||
export const appRouter = [
|
export const appRouter = [
|
||||||
{
|
{
|
||||||
path: "/app-list",
|
path: "/app",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/app/list",
|
||||||
index: true,
|
index: true,
|
||||||
element: (
|
element: (
|
||||||
<Suspense>
|
<Suspense>
|
||||||
<AppManage />
|
<AppManageList />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/app/config/:id",
|
||||||
|
index: true,
|
||||||
|
element: (
|
||||||
|
<Suspense>
|
||||||
|
<AppManageConfig />
|
||||||
|
</Suspense>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
class AppConfig {
|
|
||||||
static LIST = "app/list"
|
|
||||||
static LISTPo = "app"
|
|
||||||
static ADD = "app"
|
|
||||||
static DELETE = "app"
|
|
||||||
static EDIT = "app"
|
|
||||||
static XIAOMIAPPPUSH = "app/push/xiaomi/" // 小米推送配置信息
|
|
||||||
static VIVOAPPPUSH = "app/push/vivo/" // 小米推送配置信息
|
|
||||||
static OPPOAPPPUSH = "app/push/oppo/" // 小米推送配置信息
|
|
||||||
static HUAWEIAPPPUSH = "app/push/huawei/" // 小米推送配置信息
|
|
||||||
static IOSAPPPUSH = "app/push/ios/" // 小米推送配置信息
|
|
||||||
static WechatConfig = "app/wechatConfig/" // 小米推送配置信息
|
|
||||||
}
|
|
||||||
export default AppConfig;
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
class AppConfig {
|
||||||
|
static LIST = "app/list"
|
||||||
|
static LISTPo = "app"
|
||||||
|
static ADD = "app"
|
||||||
|
static DELETE = "app"
|
||||||
|
static EDIT = "app"
|
||||||
|
static XIAOMIAPPPUSH = "app/push/xiaomi/" // 小米推送配置信息
|
||||||
|
static VIVOAPPPUSH = "app/push/vivo/" // vivo推送配置信息
|
||||||
|
static OPPOAPPPUSH = "app/push/oppo/" // oppo推送配置信息
|
||||||
|
static HUAWEIAPPPUSH = "app/push/huawei/" // huawei推送配置信息
|
||||||
|
static IOSAPPPUSH = "app/push/ios/" // ios推送配置信息
|
||||||
|
static WechatConfig = "app/wechatConfig/" // 微信配置信息
|
||||||
|
static ALCONFIG = "app/alConfig/" // 微信配置信息
|
||||||
|
|
||||||
|
}
|
||||||
|
export default AppConfig;
|
|
@ -1,5 +1,5 @@
|
||||||
class UserConfig {
|
class UserConfig {
|
||||||
static LOGINURI: string = "user/login/system"
|
static LOGINURI: string = "login"
|
||||||
static LIST: string = "user/list"
|
static LIST: string = "user/list"
|
||||||
static ADD: string = "user"
|
static ADD: string = "user"
|
||||||
static DELETE: string = "user"
|
static DELETE: string = "user"
|
|
@ -1,12 +1,10 @@
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import axios, { AxiosResponse } from "axios";
|
import axios, { AxiosResponse } from "axios";
|
||||||
|
|
||||||
// 添加请求拦截器
|
// 添加请求拦截器
|
||||||
|
|
||||||
axios.defaults.headers.common["CommonType"] = "shouka";
|
axios.defaults.headers.common["CommonType"] = "shouka";
|
||||||
axios.defaults.headers.common["Content-Type"] = "application/json; charset=utf8";
|
axios.defaults.headers.common["Content-Type"] = "application/json; charset=utf8";
|
||||||
axios.interceptors.request.use((config) => {
|
axios.interceptors.request.use((config) => {
|
||||||
config.baseURL = "http://81.68.81.205:8181/apis/v1/";
|
config.baseURL = "http://quwanya.cn:8899/v1/api/";
|
||||||
config.timeout = 5000;
|
config.timeout = 5000;
|
||||||
let token = window.localStorage.getItem("token")
|
let token = window.localStorage.getItem("token")
|
||||||
config.headers.Authorization = 'Bearer ' + token
|
config.headers.Authorization = 'Bearer ' + token
|
||||||
|
@ -58,7 +56,6 @@ class BaseHttp {
|
||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|
||||||
};
|
};
|
||||||
async put(url: string, params: any) {
|
async put(url: string, params: any) {
|
||||||
let res = await axios({
|
let res = await axios({
|
||||||
|
@ -67,7 +64,6 @@ class BaseHttp {
|
||||||
data: params
|
data: params
|
||||||
});
|
});
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|
||||||
};
|
};
|
||||||
async delete(url: string, params: any) {
|
async delete(url: string, params: any) {
|
||||||
let res = await axios({
|
let res = await axios({
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { CardDataType } from "@/util/model/interface";
|
||||||
|
import BaseStore from "../baseStore";
|
||||||
|
import { makeObservable } from "mobx";
|
||||||
|
import ActivityConfig from "@/service/apiConfig/activity_config";
|
||||||
|
|
||||||
|
class ActivityStore extends BaseStore<CardDataType> {
|
||||||
|
constructor() {
|
||||||
|
super(ActivityConfig)
|
||||||
|
makeObservable(this, {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
export default new ActivityStore();
|
|
@ -1,17 +0,0 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
|
||||||
import BaseStore from "../baseStore";
|
|
||||||
import { action, makeObservable } from "mobx";
|
|
||||||
import ActivityConfig from "@/service/apiConfig/activityConfig";
|
|
||||||
|
|
||||||
class ActivityStore extends BaseStore<CardDataType>{
|
|
||||||
constructor() {
|
|
||||||
super(ActivityConfig)
|
|
||||||
makeObservable(this, {
|
|
||||||
otherAction: action,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
otherAction() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default new ActivityStore();
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import { action, makeObservable } from "mobx";
|
import { action, makeObservable } from "mobx";
|
||||||
import ActivityTypeConfig from "@/service/apiConfig/activityTypeConfig";
|
import ActivityTypeConfig from "@/service/apiConfig/activity_type_config";
|
||||||
|
|
||||||
class ActivityType extends BaseStore<CardDataType>{
|
class ActivityType extends BaseStore<CardDataType>{
|
||||||
constructor() {
|
constructor() {
|
|
@ -0,0 +1,53 @@
|
||||||
|
import { CardDataType } from "@/util/model/interface";
|
||||||
|
import BaseStore from "../baseStore";
|
||||||
|
import baseHttp from "@/service/base";
|
||||||
|
import { action, makeObservable } from "mobx";
|
||||||
|
import AppConfig from "@/service/apiConfig/app_config";
|
||||||
|
|
||||||
|
class AppStore extends BaseStore<CardDataType> {
|
||||||
|
constructor() {
|
||||||
|
super(AppConfig)
|
||||||
|
makeObservable(this, {
|
||||||
|
getApp: action
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 设置Ios 配置
|
||||||
|
async setIosConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.IOSAPPPUSH + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置hw 配置
|
||||||
|
async setHwConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.HUAWEIAPPPUSH + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置op 配置
|
||||||
|
async setOPConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.OPPOAPPPUSH + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置op 配置
|
||||||
|
async setVivoConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.VIVOAPPPUSH + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置wx 配置
|
||||||
|
async setWechatConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.WechatConfig + id, param)
|
||||||
|
}
|
||||||
|
// 设置wx 配置
|
||||||
|
async setXmConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.XIAOMIAPPPUSH + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置wx 配置
|
||||||
|
async setAlConfig(id: number, param) {
|
||||||
|
return await baseHttp.put(AppConfig.ALCONFIG + id, param)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getApp(id: number) {
|
||||||
|
let data = await baseHttp.get(AppConfig.ADD + "/" + id, {})
|
||||||
|
this.item = data.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default new AppStore();
|
|
@ -1,17 +0,0 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
|
||||||
import BaseStore from "../baseStore";
|
|
||||||
import { action, makeObservable } from "mobx";
|
|
||||||
import AppConfig from "@/service/apiConfig/appConfig";
|
|
||||||
|
|
||||||
class AppStore extends BaseStore<CardDataType>{
|
|
||||||
constructor() {
|
|
||||||
super(AppConfig)
|
|
||||||
makeObservable(this, {
|
|
||||||
otherAction: action,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
otherAction() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default new AppStore();
|
|
|
@ -11,6 +11,7 @@ interface BaseStoreInterface<T> {
|
||||||
total: number
|
total: number
|
||||||
page: Pages
|
page: Pages
|
||||||
setPages(pages: Pages): any
|
setPages(pages: Pages): any
|
||||||
|
listStatus:boolean | null | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
class BaseStore<B> implements BaseStoreInterface<B> {
|
class BaseStore<B> implements BaseStoreInterface<B> {
|
||||||
|
@ -25,10 +26,12 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
||||||
item: observable,
|
item: observable,
|
||||||
total: observable,
|
total: observable,
|
||||||
page: observable,
|
page: observable,
|
||||||
add: action
|
add: action,
|
||||||
|
listStatus:observable,
|
||||||
})
|
})
|
||||||
this.urlConfig = urlConfig;
|
this.urlConfig = urlConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
async deleteItem(id: number) {
|
async deleteItem(id: number) {
|
||||||
await baseHttp.delete(this.urlConfig.DELETE + "/" + id, {})
|
await baseHttp.delete(this.urlConfig.DELETE + "/" + id, {})
|
||||||
|
@ -53,6 +56,7 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
||||||
|
|
||||||
// 获取列表
|
// 获取列表
|
||||||
async getlist() {
|
async getlist() {
|
||||||
|
this.listStatus = true;
|
||||||
let res = await baseHttp.get(this.urlConfig.LIST, {
|
let res = await baseHttp.get(this.urlConfig.LIST, {
|
||||||
pageNum: this.page?.PageNum | 1,
|
pageNum: this.page?.PageNum | 1,
|
||||||
pageSize: this.page?.PageSize | 20,
|
pageSize: this.page?.PageSize | 20,
|
||||||
|
@ -64,27 +68,31 @@ class BaseStore<B> implements BaseStoreInterface<B> {
|
||||||
PageSize: res.data?.pageSize
|
PageSize: res.data?.pageSize
|
||||||
}
|
}
|
||||||
let data: Array<B> = []
|
let data: Array<B> = []
|
||||||
if (!res.data.records) {
|
if (!res.data.list) {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.list = data;
|
this.list = data;
|
||||||
})
|
})
|
||||||
|
this.listStatus = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < res.data.records.length; i++) {
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
data.push({
|
data.push({
|
||||||
key: res.data.records[i].id,
|
key: res.data.list[i].id,
|
||||||
...res.data.records[i]
|
...res.data.list[i]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.list = data;
|
this.list = data;
|
||||||
this.total = res.data.total | res.data.totals
|
this.total = res.data.total | res.data.totals
|
||||||
})
|
})
|
||||||
|
this.listStatus = false;
|
||||||
}
|
}
|
||||||
list!: Array<B>;
|
list!: Array<B>;
|
||||||
item!: B | null | string
|
item!: B | null | string
|
||||||
total!: number;
|
total!: number;
|
||||||
page!: Pages;
|
page!: Pages;
|
||||||
|
listStatus: boolean | null | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default BaseStore
|
export default BaseStore
|
|
@ -1,5 +1,5 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import { action, makeObservable } from "mobx";
|
import { action, makeObservable } from "mobx";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import { action, makeObservable } from "mobx";
|
import { action, makeObservable } from "mobx";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { action, makeAutoObservable, observable } from "mobx";
|
import { action, makeAutoObservable, observable } from "mobx";
|
||||||
import baseHttp from "@/service/base";
|
import baseHttp from "@/service/base";
|
||||||
import { CardDataType, Pages, ComponsitionDataType } from "@/util/model/interface";
|
import { CardDataType, Pages, ComponsitionDataType } from "@/util/model/interface";
|
||||||
import componsitionConfig from "@/service/apiConfig/componsitionConfig";
|
import componsitionConfig from "@/service/apiConfig/componsition_config";
|
||||||
class ComponSitionStore {
|
class ComponSitionStore {
|
||||||
datalist: ComponsitionDataType[] = [];
|
datalist: ComponsitionDataType[] = [];
|
||||||
total: number | null | undefined;
|
total: number | null | undefined;
|
|
@ -1,5 +1,5 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import CardConfig from "@/service/apiConfig/cardConfig";
|
import CardConfig from "@/service/apiConfig/card_config";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import { action, makeObservable } from "mobx";
|
import { action, makeObservable } from "mobx";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { CardDataType } from "@/util/model/interface";
|
import { CardDataType } from "@/util/model/interface";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import { makeObservable } from "mobx";
|
import { makeObservable } from "mobx";
|
||||||
import DynamicConfig from "@/service/apiConfig/dynamicConfig";
|
import DynamicConfig from "@/service/apiConfig/dynamic_config";
|
||||||
|
|
||||||
class DynamicStore extends BaseStore<CardDataType>{
|
class DynamicStore extends BaseStore<CardDataType>{
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import usrStore from '@/store/user'
|
import usrStore from '@/store/user'
|
||||||
import projectStore from '@/store/project'
|
import projectStore from '@/store/project'
|
||||||
import cardStore from '@/store/cardStore'
|
import cardStore from '@/store/card'
|
||||||
import characterStore from '@/store/characterStore'
|
import characterStore from '@/store/character'
|
||||||
import currentEventStore from '@/store/currentEventStore'
|
import currentEventStore from '@/store/current_event'
|
||||||
import componSitionStore from '@/store/componsitionStroe'
|
import componSitionStore from '@/store/componsition'
|
||||||
import systemStore from '@/store/system'
|
import systemStore from '@/store/system'
|
||||||
import merchantStore from '@/store/merchantsStore'
|
import merchantStore from '@/store/merchants'
|
||||||
import projectTypeStore from '@/store/projectTypeStore'
|
import projectTypeStore from '@/store/project_type'
|
||||||
import productUnitStore from '@/store/productUnitStore'
|
import productUnitStore from '@/store/product_unit'
|
||||||
import dynamicStore from '@/store/dynamic'
|
import dynamicStore from '@/store/dynamic'
|
||||||
import activityStore from '@/store/activityStore'
|
import activityStore from '@/store/activity'
|
||||||
import activityTypeStore from '@/store/activityTypeStore'
|
import activityTypeStore from '@/store/activity_type'
|
||||||
import appStore from '@/store/appStore'
|
import appStore from '@/store/app'
|
||||||
import activeStore from '@/store/active'
|
import activeStore from '@/store/active'
|
||||||
|
|
||||||
const store = {
|
const store = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { makeObservable } from "mobx";
|
import { makeObservable } from "mobx";
|
||||||
import BaseStore from "@/store/baseStore";
|
import BaseStore from "@/store/baseStore";
|
||||||
import merchantsConfig from '@/service/apiConfig/merchantsConfig';
|
import merchantsConfig from '@/service/apiConfig/merchants_config';
|
||||||
class MerchantStore extends BaseStore<any> {
|
class MerchantStore extends BaseStore<any> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(merchantsConfig)
|
super(merchantsConfig)
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeObservable } from "mobx";
|
import { makeObservable } from "mobx";
|
||||||
import productUnit from "@/service/apiConfig/productUnitConfig";
|
import productUnit from "@/service/apiConfig/product_unit_config";
|
||||||
import BaseStore from "@/store/baseStore";
|
import BaseStore from "@/store/baseStore";
|
||||||
|
|
||||||
class ProductUnitStore extends BaseStore<any> {
|
class ProductUnitStore extends BaseStore<any> {
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeObservable } from "mobx";
|
import { makeObservable } from "mobx";
|
||||||
import ProjectConfig from "@/service/apiConfig/projectConfig";
|
import ProjectConfig from "@/service/apiConfig/project_config";
|
||||||
import BaseStore from "@/store/baseStore";
|
import BaseStore from "@/store/baseStore";
|
||||||
|
|
||||||
class ProjectStore extends BaseStore<any> {
|
class ProjectStore extends BaseStore<any> {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { makeObservable } from "mobx";
|
import { makeObservable } from "mobx";
|
||||||
import projectTypeConfig from "@/service/apiConfig/projectTypeConfig";
|
import projectTypeConfig from "@/service/apiConfig/project_type_config";
|
||||||
import BaseStore from "@/store/baseStore";
|
import BaseStore from "@/store/baseStore";
|
||||||
|
|
||||||
class ProjectTypeStore extends BaseStore<any> {
|
class ProjectTypeStore extends BaseStore<any> {
|
|
@ -1,7 +1,7 @@
|
||||||
import { action, makeObservable } from "mobx";
|
import { action, makeObservable } from "mobx";
|
||||||
import baseHttp from "@/service/base";
|
import baseHttp from "@/service/base";
|
||||||
import BaseStore from "../baseStore";
|
import BaseStore from "../baseStore";
|
||||||
import SystemConfig from '../../service/apiConfig/systemConfig';
|
import SystemConfig from '../../service/apiConfig/system_config';
|
||||||
class SystemStore extends BaseStore<any> {
|
class SystemStore extends BaseStore<any> {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(SystemConfig)
|
super(SystemConfig)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import UserConfig from "@/service/apiConfig/userConfig";
|
import UserConfig from "@/service/apiConfig/user_config";
|
||||||
import { action, computed, makeObservable, observable } from "mobx";
|
import { action, computed, makeObservable, observable } from "mobx";
|
||||||
// 用户信息
|
// 用户信息
|
||||||
import baseHttp from "@/service/base";
|
import baseHttp from "@/service/base";
|
||||||
|
@ -29,9 +29,10 @@ class UserStore extends BaseStore<UserDataType> {
|
||||||
this.item = "";
|
this.item = "";
|
||||||
}
|
}
|
||||||
async login(params: UserInfos) {
|
async login(params: UserInfos) {
|
||||||
let data = await baseHttp.forms(UserConfig.LOGINURI, {
|
let data = await baseHttp.post(UserConfig.LOGINURI, {
|
||||||
acount: params.userName,
|
acount: params.userName,
|
||||||
password: params.passWord,
|
passwd: params.passWord,
|
||||||
|
loginType:5
|
||||||
})
|
})
|
||||||
this._userinfo = {
|
this._userinfo = {
|
||||||
userName: data.data.name,
|
userName: data.data.name,
|
||||||
|
|
Loading…
Reference in New Issue