Commit d3c28c62 authored by Maofei94's avatar Maofei94

perf(page/database): fix bug

parent 25fdc784
...@@ -5,8 +5,8 @@ import { getSolutionList, changeSolution } from '@/services/database/api'; ...@@ -5,8 +5,8 @@ import { getSolutionList, changeSolution } from '@/services/database/api';
import styles from './CurrentSolution.less'; import styles from './CurrentSolution.less';
const { Option } = Select; const { Option } = Select;
const CurrentSolution = () => { const CurrentSolution = () => {
const [currentData, setCurrentData] = useState(''); const [currentData, setCurrentData] = useState(''); // 解决方案的值
const [dataList, setDataList] = useState([]); const [dataList, setDataList] = useState([]); // 下拉数组
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
setLoading(true); setLoading(true);
...@@ -26,12 +26,13 @@ const CurrentSolution = () => { ...@@ -26,12 +26,13 @@ const CurrentSolution = () => {
console.error(err); console.error(err);
}); });
}, []); }, []);
// 切换解决方案
const handleSelect = e => { const handleSelect = e => {
setCurrentData(e); setCurrentData(e);
}; };
// 提交配置信息
const submit = params => { const submit = params => {
setLoading(true); setLoading(true);
console.log(params);
changeSolution({ changeSolution({
solution: currentData, solution: currentData,
_version: 9999, _version: 9999,
...@@ -42,14 +43,14 @@ const CurrentSolution = () => { ...@@ -42,14 +43,14 @@ const CurrentSolution = () => {
if (res.success) { if (res.success) {
notification.success({ notification.success({
message: '提示', message: '提示',
description: '切换成功', description: res.message || '切换成功',
duration: 3, duration: 3,
}); });
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
description: res.message, description: res.message || '切换失败',
duration: null, duration: 10,
}); });
} }
}) })
......
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
Row, Row,
Col, Col,
Popconfirm, Popconfirm,
Spin,
} from 'antd'; } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -47,9 +48,11 @@ const InitDataBase = props => { ...@@ -47,9 +48,11 @@ const InitDataBase = props => {
const [desc, setDesc] = useState(''); // 修改描述 const [desc, setDesc] = useState(''); // 修改描述
const [allSqlDir, setAllSqulDir] = useState([]); // 修改产品方案 const [allSqlDir, setAllSqulDir] = useState([]); // 修改产品方案
const [defaultSqlDir, setDefaultSqlDir] = useState(''); // 修改产品方案默认值 const [defaultSqlDir, setDefaultSqlDir] = useState(''); // 修改产品方案默认值
const [modalVisible, setModalVisible] = useState(false); const [modalVisible, setModalVisible] = useState(false); // 修改秒速弹窗
const [initVisible, setInitVisible] = useState(false); const [initVisible, setInitVisible] = useState(false); // 数据库初始化弹窗
const [initContent, setInitContent] = useState(''); const [initContent, setInitContent] = useState(''); // 数据库初始化内容
const [initLoading, setInitLoading] = useState(false);
const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading
// 获取数据库链接记录 // 获取数据库链接记录
useEffect(() => { useEffect(() => {
setTableLoading(true); setTableLoading(true);
...@@ -74,11 +77,13 @@ const InitDataBase = props => { ...@@ -74,11 +77,13 @@ const InitDataBase = props => {
}, [upData]); }, [upData]);
// 获取数据库配置信息 // 获取数据库配置信息
useEffect(() => { useEffect(() => {
setCardLoading(true);
get(`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`, { get(`/Cityinterface/rest/services/OMS.svc/S_GetDataBaseConfig`, {
_version: 9999, _version: 9999,
dc: 1603334559186, dc: 1603334559186,
}) })
.then(res => { .then(res => {
setCardLoading(false);
if (res.success) { if (res.success) {
let obj = {}; let obj = {};
Object.keys(dbForm).forEach(k => { Object.keys(dbForm).forEach(k => {
...@@ -91,17 +96,21 @@ const InitDataBase = props => { ...@@ -91,17 +96,21 @@ const InitDataBase = props => {
} }
}) })
.catch(err => { .catch(err => {
setCardLoading(false);
console.error(err); console.error(err);
}); });
}, []); }, []);
// 数据库初始化 // 数据库初始化
const initClick = () => { const initClick = () => {
setInitLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
initDBv4({ initDBv4({
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
...obj, ...obj,
}).then(res => { })
.then(res => {
setInitLoading(false);
if (res.GetMe) { if (res.GetMe) {
getInitDBLog({ getInitDBLog({
_version: 9999, _version: 9999,
...@@ -120,18 +129,25 @@ const InitDataBase = props => { ...@@ -120,18 +129,25 @@ const InitDataBase = props => {
description: res.Say.Message || '初始化失败', description: res.Say.Message || '初始化失败',
}); });
} }
})
.catch(err => {
setInitLoading(false);
console.log(err);
}); });
}; };
const onValuesChange = (value, b) => { const onValuesChange = (value, b) => {
form.setFieldsValue(value); form.setFieldsValue(value);
}; };
const onChange = value => { const onChange = value => {
console.log(value);
const { length } = value;
form.setFieldsValue({ form.setFieldsValue({
dbName: value, dbName: value[length - 1],
}); });
}; };
// 保存连接 // 保存连接
const onFinish = values => { const onFinish = values => {
setCardLoading(true);
const obj = values; const obj = values;
get('/Cityinterface/rest/services/OMS.svc/S_SaveConnection', { get('/Cityinterface/rest/services/OMS.svc/S_SaveConnection', {
_version: 9999, _version: 9999,
...@@ -142,6 +158,7 @@ const InitDataBase = props => { ...@@ -142,6 +158,7 @@ const InitDataBase = props => {
password: obj.password, password: obj.password,
}) })
.then(res => { .then(res => {
setCardLoading(false);
if (res.GetMe === true) { if (res.GetMe === true) {
setUpData(upData + 1); setUpData(upData + 1);
notification.success({ notification.success({
...@@ -158,6 +175,7 @@ const InitDataBase = props => { ...@@ -158,6 +175,7 @@ const InitDataBase = props => {
} }
}) })
.catch(err => { .catch(err => {
setCardLoading(false);
console.log(err); console.log(err);
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -166,9 +184,10 @@ const InitDataBase = props => { ...@@ -166,9 +184,10 @@ const InitDataBase = props => {
}); });
}); });
}; };
const onCheck = e => {
// 测试连接 // 测试连接
const onCheck = e => {
console.log(dbForm); console.log(dbForm);
setCardLoading(true);
const obj = form.getFieldsValue(); const obj = form.getFieldsValue();
get('/Cityinterface/rest/services/OMS.svc/S_GetConnectionTest', { get('/Cityinterface/rest/services/OMS.svc/S_GetConnectionTest', {
_version: 9999, _version: 9999,
...@@ -179,6 +198,7 @@ const InitDataBase = props => { ...@@ -179,6 +198,7 @@ const InitDataBase = props => {
password: obj.password, password: obj.password,
}) })
.then(res => { .then(res => {
setCardLoading(false);
if (res.GetMe === true) { if (res.GetMe === true) {
notification.success({ notification.success({
message: '通知', message: '通知',
...@@ -194,6 +214,7 @@ const InitDataBase = props => { ...@@ -194,6 +214,7 @@ const InitDataBase = props => {
} }
}) })
.catch(err => { .catch(err => {
setCardLoading(false);
console.log(err); console.log(err);
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -390,6 +411,7 @@ const InitDataBase = props => { ...@@ -390,6 +411,7 @@ const InitDataBase = props => {
<> <>
<PageContainer> <PageContainer>
<Card> <Card>
<Spin tip="loading..." spinning={cardLoading}>
<div className={styles.tableTitle}>数据库初始化</div> <div className={styles.tableTitle}>数据库初始化</div>
<Form <Form
className={styles.mgTop20} className={styles.mgTop20}
...@@ -412,6 +434,7 @@ const InitDataBase = props => { ...@@ -412,6 +434,7 @@ const InitDataBase = props => {
<Form.Item label={`${formLables.dbName}:`} name="dbName"> <Form.Item label={`${formLables.dbName}:`} name="dbName">
<Select <Select
showSearch showSearch
mode="tags"
placeholder="请选择数据库" placeholder="请选择数据库"
optionFilterProp="children" optionFilterProp="children"
onFocus={() => { onFocus={() => {
...@@ -421,15 +444,20 @@ const InitDataBase = props => { ...@@ -421,15 +444,20 @@ const InitDataBase = props => {
onChange(e); onChange(e);
}} }}
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
filterOption={(input, option) => filterOption={(input, option) => {
option.children.toLowerCase().indexOf(input.toLowerCase()) >= console.log(option);
0 return (
} option.children &&
option.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
);
}}
> >
{option && {option &&
option.length > 0 && option.length > 0 &&
option.map((item, index) => ( option.map((item, index) => (
<Option value={item.value} key={index}> <Option value={item.value} key={item.value + index}>
{item.value} {item.value}
</Option> </Option>
))} ))}
...@@ -457,7 +485,9 @@ const InitDataBase = props => { ...@@ -457,7 +485,9 @@ const InitDataBase = props => {
initClick(); initClick();
}} }}
> >
<Button type="primary">数据库初始化</Button> <Button type="primary" loading={initLoading}>
数据库初始化
</Button>
</Popconfirm> </Popconfirm>
{defaultSqlDir && ( {defaultSqlDir && (
<Select <Select
...@@ -481,6 +511,7 @@ const InitDataBase = props => { ...@@ -481,6 +511,7 @@ const InitDataBase = props => {
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>
</Spin>
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
...@@ -506,7 +537,11 @@ const InitDataBase = props => { ...@@ -506,7 +537,11 @@ const InitDataBase = props => {
setInitVisible(false); setInitVisible(false);
setInitContent(''); setInitContent('');
}} }}
width="600px" width="800px"
bodyStyle={{
maxHeight: '600px',
overflowY: 'scroll',
}}
footer={[ footer={[
<Button <Button
onClick={() => { onClick={() => {
......
...@@ -14,11 +14,12 @@ import styles from './ManagementDataBase.less'; ...@@ -14,11 +14,12 @@ import styles from './ManagementDataBase.less';
import { updateDateBase } from '@/services/database/api'; import { updateDateBase } from '@/services/database/api';
const ManagementDataBase = () => { const ManagementDataBase = () => {
const [autoCheckList, setAutoCheckList] = useState([]); const [autoCheckList, setAutoCheckList] = useState([]); // 自动列表
const [checkList, setCheckList] = useState([]); const [checkList, setCheckList] = useState([]); // 手动列表
const [logList, setLogList] = useState([]); const [logList, setLogList] = useState([]); // 日志列表
const [checkFlag, setCheckFlag] = useState(1); const [checkFlag, setCheckFlag] = useState(1);
const [checkLoading, setCheckLoading] = useState(false); const [upFlag, setUpFlag] = useState(1); //
const [checkLoading, setCheckLoading] = useState(false); // 按钮loading
const [logLoading, setLogLoading] = useState(false); const [logLoading, setLogLoading] = useState(false);
const [modalVisible, setModalVisible] = useState(false); // 弹窗 const [modalVisible, setModalVisible] = useState(false); // 弹窗
const [content, setContent] = useState(null); const [content, setContent] = useState(null);
...@@ -63,7 +64,6 @@ const ManagementDataBase = () => { ...@@ -63,7 +64,6 @@ const ManagementDataBase = () => {
}) })
.then(res => { .then(res => {
setLogLoading(false); setLogLoading(false);
console.log(res);
if (res) { if (res) {
let arr = []; let arr = [];
res.map((item, index) => { res.map((item, index) => {
...@@ -77,18 +77,23 @@ const ManagementDataBase = () => { ...@@ -77,18 +77,23 @@ const ManagementDataBase = () => {
setLogLoading(false); setLogLoading(false);
console.error(err); console.error(err);
}); });
}, []); }, [upFlag]);
// 检查功能
const handleCheck = () => { const handleCheck = () => {
setCheckFlag(checkFlag + 1); setCheckFlag(checkFlag + 1);
}; };
// 升级功能
const handleUpdate = () => { const handleUpdate = () => {
setCheckLoading(true);
updateDateBase({ updateDateBase({
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
}) })
.then(res => { .then(res => {
setCheckLoading(false);
setCheckFlag(checkFlag + 1); setCheckFlag(checkFlag + 1);
if (res.sucess) { setUpFlag(upFlag + 1);
if (res.success) {
notification.success({ notification.success({
message: '通知', message: '通知',
duration: 3, duration: 3,
...@@ -103,6 +108,7 @@ const ManagementDataBase = () => { ...@@ -103,6 +108,7 @@ const ManagementDataBase = () => {
} }
}) })
.catch(err => { .catch(err => {
setCheckLoading(false);
console.error(err); console.error(err);
}); });
}; };
...@@ -229,7 +235,7 @@ const ManagementDataBase = () => { ...@@ -229,7 +235,7 @@ const ManagementDataBase = () => {
handleUpdate(); handleUpdate();
}} }}
> >
<Button danger type="primary"> <Button danger type="primary" loading={checkLoading}>
升级 升级
</Button> </Button>
</Popconfirm> </Popconfirm>
...@@ -237,27 +243,27 @@ const ManagementDataBase = () => { ...@@ -237,27 +243,27 @@ const ManagementDataBase = () => {
</div> </div>
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
<div className={styles.tableTitle}> <div className={styles.tableTitle}>数据库升级记录</div>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</div>
<Table <Table
className={styles.mgTop20} className={styles.mgTop20}
columns={checkColumns} columns={logColumns}
dataSource={checkList} dataSource={logList}
bordered bordered
loading={checkLoading} loading={logLoading}
size="small" size="small"
/> />
</Card> </Card>
<Card className={styles.mgTop20}> <Card className={styles.mgTop20}>
<div className={styles.tableTitle}>数据库升级记录</div> <div className={styles.tableTitle}>
表字段手动修复
(字段长度不统一,请手动修改差异,数据可能会截断,请谨慎操作)
</div>
<Table <Table
className={styles.mgTop20} className={styles.mgTop20}
columns={logColumns} columns={checkColumns}
dataSource={logList} dataSource={checkList}
bordered bordered
loading={logLoading} loading={checkLoading}
size="small" size="small"
/> />
</Card> </Card>
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Select, Input, Button, Row, Col, Radio } from 'antd'; import {
Form,
Select,
Input,
Button,
Row,
Col,
Radio,
notification,
} from 'antd';
import { editWebsite, getWebsite } from '@/services/mobileConfig/api'; import { editWebsite, getWebsite } from '@/services/mobileConfig/api';
import PicturesWall from '@/components/Upload/index';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const SiteConfig = props => { const SiteConfig = props => {
const { submitCallback } = props;
const [config, setConfig] = useState(''); // 网站配置信息 const [config, setConfig] = useState(''); // 网站配置信息
const [loginList, setLoginList] = useState([ const [loginList, setLoginList] = useState([
{ text: '默认界面', value: 'default' }, { text: '默认界面', value: 'default' },
...@@ -22,16 +33,15 @@ const SiteConfig = props => { ...@@ -22,16 +33,15 @@ const SiteConfig = props => {
labelCol: { span: 3 }, labelCol: { span: 3 },
wrapperCol: { span: 14 }, wrapperCol: { span: 14 },
}; };
useEffect(() => { useEffect(() => {
getWebsite({ getWebsite({
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
title: '新运维测试小程序', title: '新运维测试小程序222',
}).then(res => { }).then(res => {
console.log(res);
let obj = { ...form.getFieldsValue() }; let obj = { ...form.getFieldsValue() };
let arr = Object.keys({ ...form.getFieldsValue() }); let arr = Object.keys({ ...form.getFieldsValue() });
console.log(arr);
arr.map(k => { arr.map(k => {
obj[k] = res[k]; obj[k] = res[k];
}); });
...@@ -42,22 +52,77 @@ const SiteConfig = props => { ...@@ -42,22 +52,77 @@ const SiteConfig = props => {
const radioChange = e => {}; const radioChange = e => {};
// 提交选择 // 提交选择
const submit = value => { const submit = value => {
console.log(form.getFieldsValue()); form.validateFields().then(valid => {
if (valid) {
const obj = { ...form.getFieldsValue() };
let params = { ...obj, mode: 'single', client: 'miniapp' };
editWebsite(params, {
headers: {
'content-type': 'application/x-www-form-urlencggoded;charset=UTF-8',
},
}).then(res => {
if (res.success) {
notification.success({
message: '提示',
duration: 3,
description: '编辑成功',
});
submitCallback();
} else {
notification.error({
message: '提示',
duration: 3,
description: res.message || '编辑失败',
});
}
console.log(res, 'res');
});
}
});
}; };
return ( return (
<Form form={form} {...layout}> <Form form={form} {...layout}>
<Item label="应用名称:" name="title"> <Item
label="应用名称:"
name="title"
rules={[
{
required: true,
message: '请输入应用名称',
},
]}
>
<Input placeholder="请输入应用名称" allowClear /> <Input placeholder="请输入应用名称" allowClear />
</Item> </Item>
<Item label="系统图标:" name="shortcutIcon"> <Item
label="系统图标:"
name="shortcutIcon"
rules={[
{
required: true,
message: '请选择系统图标',
},
]}
>
<Input placeholder="请输入系统图标名称" allowClear /> <Input placeholder="请输入系统图标名称" allowClear />
</Item> </Item>
{/* <Button type="primary">按路径选择</Button> */} {/* <Button type="primary">按路径选择</Button> */}
<Item label="系统图标预览:" /> <Item label="系统图标预览:">
<Item label="登陆页面:" name="loginTemplate"> <PicturesWall maxLen={3} />
</Item>
<Item
label="登陆页面:"
name="loginTemplate"
rules={[
{
required: true,
message: '请选择登陆页面',
},
]}
>
<Select placeholder="请选择登陆页面"> <Select placeholder="请选择登陆页面">
{loginList && {loginList &&
loginList.map((item, index) => ( loginList.map((item, index) => (
...@@ -67,7 +132,16 @@ const SiteConfig = props => { ...@@ -67,7 +132,16 @@ const SiteConfig = props => {
))} ))}
</Select> </Select>
</Item> </Item>
<Item label="系统皮肤:" name="theme"> <Item
label="系统皮肤:"
name="theme"
rules={[
{
required: true,
message: '请选择系统皮肤',
},
]}
>
<Select placeholder="请选择系统皮肤"> <Select placeholder="请选择系统皮肤">
{themeList && {themeList &&
themeList.map((item, index) => ( themeList.map((item, index) => (
...@@ -77,7 +151,16 @@ const SiteConfig = props => { ...@@ -77,7 +151,16 @@ const SiteConfig = props => {
))} ))}
</Select> </Select>
</Item> </Item>
<Item label="系统风格:" name="style"> <Item
label="系统风格:"
name="style"
rules={[
{
required: true,
message: '请选择系统风格',
},
]}
>
<Select placeholder="请选择系统风格"> <Select placeholder="请选择系统风格">
{styleList && {styleList &&
styleList.map((item, index) => ( styleList.map((item, index) => (
......
...@@ -6,6 +6,7 @@ import SiteConfig from './SiteConfig'; ...@@ -6,6 +6,7 @@ import SiteConfig from './SiteConfig';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const MobileConfigPage = props => { const MobileConfigPage = props => {
const [activeKey, setActiveKey] = useState('0'); // tabs活动页 const [activeKey, setActiveKey] = useState('0'); // tabs活动页
const [flag, setFlag] = useState(1);
useEffect(() => { useEffect(() => {
miniAppSiteTree({ miniAppSiteTree({
userMode: 'admin', userMode: 'admin',
...@@ -16,17 +17,20 @@ const MobileConfigPage = props => { ...@@ -16,17 +17,20 @@ const MobileConfigPage = props => {
}).then(res => { }).then(res => {
console.log(res); console.log(res);
}); });
}, []); }, [flag]);
// 修改选中的tab // 修改选中的tab
const handleChange = key => { const handleChange = key => {
setActiveKey(key); setActiveKey(key);
}; };
const submitCallback = val => {
setFlag(flag + 1);
};
return ( return (
<PageContainer> <PageContainer>
<Card> <Card>
<Tabs activeKey={activeKey} type="card" onChange={handleChange}> <Tabs activeKey={activeKey} type="card" onChange={handleChange}>
<TabPane tab="网站配置" key="0"> <TabPane tab="网站配置" key="0">
<SiteConfig /> <SiteConfig submitCallback={submitCallback} />
</TabPane> </TabPane>
<TabPane tab="菜单管理" key="1"> <TabPane tab="菜单管理" key="1">
<div>菜单管理</div> <div>菜单管理</div>
......
...@@ -84,7 +84,7 @@ const AddModal = props => { ...@@ -84,7 +84,7 @@ const AddModal = props => {
> >
<Input placeholder="请输入站点名称" /> <Input placeholder="请输入站点名称" />
</Item> </Item>
<Item label="站点类别">all</Item> {/* <Item label="站点类别">all</Item> */}
<Item label="站点描述" name="description"> <Item label="站点描述" name="description">
<Input placeholder="请输入站点描述" /> <Input placeholder="请输入站点描述" />
</Item> </Item>
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
Button, Button,
notification, notification,
Spin, Spin,
Tabs,
} from 'antd'; } from 'antd';
import { FileAddTwoTone, EditTwoTone, DeleteTwoTone } from '@ant-design/icons'; import { FileAddTwoTone, EditTwoTone, DeleteTwoTone } from '@ant-design/icons';
import { PageContainer, GridContent } from '@ant-design/pro-layout'; import { PageContainer, GridContent } from '@ant-design/pro-layout';
...@@ -22,7 +23,9 @@ import qs from 'qs'; ...@@ -22,7 +23,9 @@ import qs from 'qs';
import AddModal from './AddModal'; import AddModal from './AddModal';
import DelModal from './DelModal'; import DelModal from './DelModal';
import EditModal from './EditModal'; import EditModal from './EditModal';
const { Search } = Input; const { Search } = Input;
const { TabPane } = Tabs;
const placeholder = '请输入人员姓名'; const placeholder = '请输入人员姓名';
const SiteManage = () => { const SiteManage = () => {
const [treeData, setTreeData] = useState([]); // 树结构数据 const [treeData, setTreeData] = useState([]); // 树结构数据
...@@ -39,8 +42,8 @@ const SiteManage = () => { ...@@ -39,8 +42,8 @@ const SiteManage = () => {
const [spinLoading, setSpinLoading] = useState(false); const [spinLoading, setSpinLoading] = useState(false);
const now = new Date().getTime(); const now = new Date().getTime();
// 点击树的回调 // 点击树的回调
const handleTreeSelect = e => { const handleTreeSelect = (e, info) => {
console.log(e); console.log(e, info);
let id = e[0]; let id = e[0];
if (id) { if (id) {
setSaveTreeId(id); setSaveTreeId(id);
...@@ -110,7 +113,7 @@ const SiteManage = () => { ...@@ -110,7 +113,7 @@ const SiteManage = () => {
}; };
// 站点删除 // 站点删除
const handleDel = e => { const handleDel = e => {
setStationId(e.stationID); setStationId(e);
setDelVisible(true); setDelVisible(true);
}; };
// 编辑站点 // 编辑站点
...@@ -199,6 +202,15 @@ const SiteManage = () => { ...@@ -199,6 +202,15 @@ const SiteManage = () => {
spinning={spinLoading} spinning={spinLoading}
style={{ marginTop: '20px' }} style={{ marginTop: '20px' }}
> >
{/* <Tabs
tabPosition="left"
defaultValue="0"
type="card"
style={{ width: '100%' }}
>
<TabPane key="0" tab="tab1" />
<TabPane key="1" tab="tab2" />
</Tabs> */}
<Tree <Tree
showLine={{ showLeafIcon: false }} showLine={{ showLeafIcon: false }}
showIcon showIcon
...@@ -226,7 +238,7 @@ const SiteManage = () => { ...@@ -226,7 +238,7 @@ const SiteManage = () => {
</Card> </Card>
</Col> </Col>
<Col lg={18}> <Col lg={18}>
<Card className={styles.cardBox}> <Card style={{ marginBottom: '10px' }}>
<Row align="middle"> <Row align="middle">
<Col span={1}>搜索</Col> <Col span={1}>搜索</Col>
<Col span={8}> <Col span={8}>
...@@ -238,7 +250,42 @@ const SiteManage = () => { ...@@ -238,7 +250,42 @@ const SiteManage = () => {
enterButton enterButton
/> />
</Col> </Col>
<Col span={3} />
{/* <Col span={2}>
<Button
type="primary"
onClick={() => {
handleAdd();
}}
>
新增
</Button>
</Col>
<Col span={2}>
<Button
type="primary"
onClick={() => {
handleEdit();
}}
disabled={!ouid}
>
编辑
</Button>
</Col>
<Col span={2}>
<Button
danger
onClick={() => {
handleDel(ouid);
}}
disabled={!ouid}
>
删除
</Button>
</Col> */}
</Row> </Row>
</Card>
<Card className={styles.cardBoxR}>
{ouid && ( {ouid && (
<ListCard <ListCard
ouid={ouid} ouid={ouid}
......
.cardBox{ .cardBox{
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);
} }
.cardBoxR{
min-height: calc(100vh - 292px);
}
.ant-tree-node-content-wrapper-open{ .ant-tree-node-content-wrapper-open{
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -4,6 +4,7 @@ import { ...@@ -4,6 +4,7 @@ import {
UsergroupAddOutlined, UsergroupAddOutlined,
SettingOutlined, SettingOutlined,
HomeOutlined, HomeOutlined,
SolutionOutlined,
// AndroidOutlined, // AndroidOutlined,
// CommentOutlined, // CommentOutlined,
CopyOutlined, CopyOutlined,
...@@ -55,6 +56,13 @@ export default { ...@@ -55,6 +56,13 @@ export default {
path: '/', path: '/',
component: BasicLayout, component: BasicLayout,
routes: [ routes: [
{
path: '/solution',
name: '解决方案管理',
icon: <SolutionOutlined style={iconStyle} />,
authority: superAuthority,
component: CurrentSolution,
},
{ {
path: '/dbm', path: '/dbm',
name: '数据库管理', name: '数据库管理',
...@@ -62,12 +70,12 @@ export default { ...@@ -62,12 +70,12 @@ export default {
component: BlankLayout, component: BlankLayout,
authority: adminAuthority, authority: adminAuthority,
routes: [ routes: [
{ // {
path: '/dbm/solution', // path: '/dbm/solution',
name: '数据库解决方案', // name: '数据库解决方案',
authority: superAuthority, // authority: superAuthority,
component: CurrentSolution, // component: CurrentSolution,
}, // },
{ {
path: '/dbm/dbInit', path: '/dbm/dbInit',
name: '数据库初始化', name: '数据库初始化',
......
...@@ -11,7 +11,6 @@ export const setTableSQLDirName = params => ...@@ -11,7 +11,6 @@ export const setTableSQLDirName = params =>
get('/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName', params); get('/Cityinterface/rest/services/OMS.svc/S_SetTableSQLDirName', params);
// 删除数据库连接记录 // 删除数据库连接记录
export const deleteConn = params => export const deleteConn = params =>
get('/Cityinterface/rest/services/OMS.svc/S_DeleteConn', params); get('/Cityinterface/rest/services/OMS.svc/S_DeleteConn', params);
......
import { get, post } from '@/services/index'; import { get, post } from '@/services/index';
import qs from 'qs';
/** /**
* @param {*} params * @param {*} params
...@@ -14,19 +15,25 @@ export const miniAppSiteTree = params => ...@@ -14,19 +15,25 @@ export const miniAppSiteTree = params =>
export const getWebsite = params => export const getWebsite = params =>
get('/Cityinterface/rest/services/OMS.svc/MiniApp_GetWebsite', params); get('/Cityinterface/rest/services/OMS.svc/MiniApp_GetWebsite', params);
/** /**
* 编辑网站配置 *
* @param {*} params * @param {*} params
* title:"节水平台", * /**
* "shortcutIcon":"assets/images/icon/小程序logo/gck.png", * 编辑小程序网站配置
title:"节水平台",
"shortcutIcon":"assets/images/icon/小程序logo/gck.png",
"style":"default", "style":"default",
"mode":"single", "mode":"single",
"client":"miniapp", "client":"miniapp",
"loginTemplate":"default", "loginTemplate":"default",
"theme":"default", "theme":"default",
"cloudLogin":false "cloudLogin":false
*/ */
export const editWebsite = params => export const editWebsite = (params, options) => {
post( let strParams = JSON.stringify(params);
let qsParams = qs.stringify({ config: strParams });
return post(
'/Cityinterface/rest/services/OMS.svc/MiniApp_EditWebsite?_version=9999', '/Cityinterface/rest/services/OMS.svc/MiniApp_EditWebsite?_version=9999',
params, qsParams,
options,
); );
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment