Commit 4e1e7a5c authored by 皮倩雯's avatar 皮倩雯

fix: '优化数据库升级交互,优化web搭建调序配置'

parent c2247cca
Pipeline #62584 passed with stages
......@@ -50,7 +50,7 @@ import {
InfoCircleOutlined,
} from '@ant-design/icons';
import Tree from '@/components/ExpendableTree';
import { convertLegacyProps } from 'antd/lib/button/button';
import Things from '../../../../../assets/images/icons/时间.svg';
const AddModal = props => {
const {
callBackSubmit = () => {},
......@@ -150,7 +150,7 @@ const AddModal = props => {
picture: '',
must: '',
coordinates: '',
});
const [currentSelectOrg, setCurrentSelectOrg] = useState([]);
const [checkedList, setCheckedList] = useState([]); // 选中的复选框内容
......@@ -216,7 +216,7 @@ const AddModal = props => {
let data = [
{
Unit: obj.Unit || '',
StoreType: 'nvarchar(255)',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
......@@ -465,6 +465,63 @@ const AddModal = props => {
setSynchronization(false);
}
console.log(res[0].data.root.Shape);
if(res[0].data.root.StoreType=='datetime'){
setCharacteristics1([{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}])
}else{
setCharacteristics1([{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}])
}
if (res[0].data.root.Shape == '文本') {
setDetail('输入内容将显示在前端输入框提示信息中');
} else if (res[0].data.root.Shape == '多行文本') {
......@@ -866,6 +923,17 @@ const AddModal = props => {
}else {
setShape(res[0].data.root.Shape)
}
if(!res[0].data.root.Shape){
console.log(1111)
if(res[0].data.root.StoreType=='datetime'){
setShape('日期时间');
}else if(res[0].data.root.StoreType=='int'||res[0].data.root.StoreType=='float'||res[0].data.root.StoreType=='bigint'||res[0].data.root.StoreType=='int'=='decimal'){
setShape('数值');
}else{
console.log(1111122222)
setShape('文本');
}
}
setPramData({ ...res[0].data.root, coordinates, must, picture });
// if (
// res[0].data.root.Shape == '多行文本' ||
......@@ -1194,25 +1262,102 @@ const AddModal = props => {
const mapTree = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0;
return {
title: (
<span className={styles.titleText}>
{org.children ? (
<UnorderedListOutlined style={{ color: '#1890FF' }} />
) : (
<FontColorsOutlined style={{ color: '#1890FF' }} />
)}
<span style={{ marginLeft: '5px' }}>{org.name}</span>
</span>
),
key: org.ID,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org,
};
if(org.storeType=='datetime'){
return {
title: (
<span className={styles.titleText}>
{org.children ? (
<UnorderedListOutlined style={{ color: '#1890FF' }} />
) : (
<img src={Things} style={{ height: '14px' }} alt="" />
)}
<span style={{ marginLeft: '5px' }}>{org.name}</span>
</span>
),
key: org.ID,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org,
};
}
return {
title: (
<span className={styles.titleText}>
{org.children ? (
<UnorderedListOutlined style={{ color: '#1890FF' }} />
) : (
<FontColorsOutlined style={{ color: '#1890FF' }} />
)}
<span style={{ marginLeft: '5px' }}>{org.name}</span>
</span>
),
key: org.ID,
// 判断它是否存在子集,若果存在就进行再次进行遍历操作,知道不存在子集便对其他的元素进行操作
children: haveChildren ? org.children.map(i => mapTree(i)) : [],
org,
};
};
const onSelect = (i, e) => {
console.log(i)
console.log(e)
if(e.node.org.storeType&&e.node.org.storeType=='datetime'){
setCharacteristics1([{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
}])
}else if(e.node.org.storeType&&e.node.org.storeType!='datetime'){
setCharacteristics1([{
name: '文本类',
ID: 0,
children: [
'文本',
'唯一值文本',
'多行文本',
'本人部门',
'本人姓名',
'数值',
'地址',
'设备二维码',
'本人ID',
'富文本',
'编码',
],
},
{
name: '选择器类',
ID: 1,
children: [
'选择器',
'搜索选择器',
'值选择器',
'可编辑值选择器',
'站点选择器',
'人员选择器',
'城市选择器',
'台账选择器',
'业务选择器',
'部门选择器',
],
},
{
name: '附件类',
ID: 2,
children: ['附件', '图片', '录音', '视频'],
},
{
name: '时间类',
ID: 3,
children: ['日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒'],
},
{
name: '地图类',
ID: 4,
children: ['坐标控件', '设备选择', '区域控件', '路径控件', '位置坐标'],
}])
}
if(e && !e.node.org.children){
setKeep(e);
......@@ -1273,6 +1418,18 @@ const AddModal = props => {
}else{
setShape(aa.Shape);
}
console.log(aa)
if(aa.Shape){
console.log(1111)
if(aa.StoreType=='datetime'){
setShape('日期时间');
}else if(aa.StoreType=='int'||aa.StoreType=='float'||aa.StoreType=='bigint'||aa.StoreType=='int'=='decimal'){
setShape('数值');
}else{
console.log(1111122222)
setShape('文本');
}
}
form.setFieldsValue({ ...aa });
if (aa.ExceptionEventFields === '') {
setCharacterValue('');
......@@ -1690,6 +1847,18 @@ const AddModal = props => {
}else{
setShape(res[0].data.root.Shape)
}
console.log(res[0].data.root)
if(!res[0].data.root.Shape){
console.log(1111)
if(res[0].data.root.StoreType=='datetime'){
setShape('日期时间');
}else if(res[0].data.root.StoreType=='int'||res[0].data.root.StoreType=='float'||res[0].data.root.StoreType=='bigint'||res[0].data.root.StoreType=='int'=='decimal'){
setShape('数值');
}else{
console.log(1111122222)
setShape('文本');
}
}
form.setFieldsValue({ ...res[0].data.root });
if (res[0].data.root.ExceptionEventFields === '') {
setCharacterValue('');
......@@ -2071,7 +2240,7 @@ const AddModal = props => {
let data = [
{
Unit: obj.Unit || '',
StoreType: 'nvarchar(255)',
StoreType: pramData.StoreType,
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
......@@ -2656,8 +2825,8 @@ const AddModal = props => {
<Row>
{/* <Col span={1} /> */}
<Col span={16}>
<Item label="形态" labelCol={{ span: 6 }}>
<div className={styles.listEvent}>
<Item label="形态" labelCol={{ span: 6 }}>
<TreeSelect
style={{ width: '95%' }}
value={Shape}
......@@ -2675,28 +2844,8 @@ const AddModal = props => {
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect>
{/* <div className={styles.unit}>
单位:
<Input
style={{ width: '5rem' }}
placeholder=""
allowClear
value={pramData.Unit}
onChange={e => handleInput(e, 'Unit')}
/>
</div>
<div className={styles.unit}>
宽:
<Input
style={{ width: '3.8rem' }}
placeholder=""
allowClear
value={pramData.RowSpan}
onChange={e => handleInput(e, 'RowSpan')}
onkeyup="value=value.replace(/[^\d]/g,'')"
/>
</div> */}
</div>
</Item>
</Col>
......
......@@ -90,7 +90,7 @@ const ProcessConfig = props => {
<Option value="多表显示">多表显示</Option>
<Option value="多表在办显示">多表在办显示</Option>
<Option value="表堆叠显示">表堆叠显示</Option>
<Option value="分派节点显示">分派节点显示</Option>
{/* <Option value="分派节点显示">分派节点显示</Option> */}
</Select>
</Form.Item>
<Form.Item label="编码样式" name="coding12Checked">
......
......@@ -378,30 +378,6 @@ const Master = props => {
))}
</Select>
</Item>
<Item name="qrCodename" label="二维码名称">
<Input placeholder="请输入二维码名称" />
</Item>
<Item
name="qrCodeurl"
label="二维码URL"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().qrCodeurl;
let regEn = /^((ht|f)tps?):\/\/([\w-]+(\.[\w-]+)*\/?)+(\?([\w\-\.,@?^=%&:\/~\+#]*)+)?$/;
if (aa) {
if (regEn.test(aa) === false) {
return Promise.reject('url必须以http(s)://开头');
}
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="请输入二维码URL" />
</Item>
<Item label="展示方式" name="displayMode">
<Radio.Group onChange={onChange} value={radio}>
<Radio value="卡片">卡片</Radio>
......@@ -436,6 +412,37 @@ const Master = props => {
) : (
<></>
)}
<Row>
<Col span={8}>
<Item name="qrCodename" label="二维码名称" labelCol={{ span: 12 }}>
<Input placeholder="请输入二维码名称" />
</Item>
</Col>
<Col span={14}>
<Item
labelCol={{ span: 6 }}
name="qrCodeurl"
label="二维码URL"
rules={[
{
validator: (rule, value) => {
let aa = form.getFieldValue().qrCodeurl;
let regEn = /^((ht|f)tps?):\/\/([\w-]+(\.[\w-]+)*\/?)+(\?([\w\-\.,@?^=%&:\/~\+#]*)+)?$/;
if (aa) {
if (regEn.test(aa) === false) {
return Promise.reject('url必须以http(s)://开头');
}
}
return Promise.resolve();
},
},
]}
>
<Input placeholder="请输入二维码URL" />
</Item>
</Col>
</Row>
</Form>
<PreviewModal
visible={previewModal}
......
import React, { useEffect, useState } from 'react';
import PageContainer from '@/components/BasePageContainer';
import { notification, Spin, Tabs, Button } from 'antd';
import { notification, Spin, Tabs, Button, Tooltip } from 'antd';
import {
getWebModuleTree,
getWebconfig,
......@@ -16,7 +16,7 @@ import {
SyncMapComponent,
BatchDragSingleWebsite,
} from '@/services/webConfig/api';
import { EditTwoTone, ExclamationCircleOutlined } from '@ant-design/icons';
import { EditTwoTone, ExclamationCircleOutlined, OrderedListOutlined } from '@ant-design/icons';
import Modal from 'antd/lib/modal/Modal';
import ProCard from '@ant-design/pro-card';
import styles from './index.less';
......@@ -342,13 +342,27 @@ const WebConfigPage = props => {
<div style={{ display: 'inline-block', float: 'right', marginTop: '-15px' }}>
<strong style={{ marginRight: '15px' }}>
地图组件数量
{console.log(tabPaneItem)}
{tabPaneItem.existMapComponent < 9 ? (
<span style={{ color: 'red' }}>{tabPaneItem.existMapComponent}</span>
<Tooltip title="点击一键修复" placement="topRight">
<span style={{ color: 'red' }} onClick={() => SyncMap(tabPaneItem)}>
{tabPaneItem.existMapComponent}
</span>
/<span style={{ color: '#1890ff' }}>{tabPaneItem.mapComponent}</span>
</Tooltip>
) : (
<span style={{ color: '#1890ff' }}>{tabPaneItem.existMapComponent}</span>
<>
<span style={{ color: '#1890ff' }}>{tabPaneItem.existMapComponent}</span>
<span>/</span>
{tabPaneItem.existMapComponent !== 9 ? (
<span style={{ color: '#1890ff' }}>{tabPaneItem.existMapComponent}</span>
) : (
<span style={{ color: '#1890ff' }}>{tabPaneItem.mapComponent}</span>
)}
</>
)}
</strong>
{tabPaneItem.existMapComponent < 9 && (
{/* {tabPaneItem.existMapComponent < 9 && (
<Button
type="primary"
style={{ marginRight: '20px' }}
......@@ -356,10 +370,7 @@ const WebConfigPage = props => {
>
一键修复
</Button>
)}
<Button type="primary" onClick={sort}>
网站调序
</Button>
)} */}
</div>
<MenuConfig
menu={
......@@ -403,18 +414,39 @@ const WebConfigPage = props => {
<PageContainer>
<div className={styles.webConfigContainer}>
<Spin spinning={loading || submitting}>
<Tabs
type="editable-card"
onEdit={onEdit}
onChange={handleTabChange}
activeKey={curWeb.id}
>
{/* <TabPane key={99} tab="产品配置" closable={false}>
<div style={{ display: 'flex', alignContent: 'center', justifyContent: 'flex-start' }}>
<Tabs
type="editable-card"
onEdit={onEdit}
onChange={handleTabChange}
activeKey={curWeb.id}
>
{/* <TabPane key={99} tab="产品配置" closable={false}>
<ProductConfig />
</TabPane> */}
{/* {webs.map(renderTabPane)} */}
{webs.map(item => renderTabPane(item))}
</Tabs>
{/* {webs.map(renderTabPane)} */}
{webs.map(item => renderTabPane(item))}
</Tabs>
<Tooltip title="调序" placement="topRight">
<span
style={{
display: 'inline-block',
width: '40px',
height: '40px',
backgroundColor: '#FAFAFA',
marginLeft: '5px',
padding: '0 8px',
border: '1px solid #f0f0f0',
borderRadius: '2px 2px 0 0',
outline: 'none',
cursor: 'pointer',
}}
onClick={sort}
>
<OrderedListOutlined style={{ marginTop: '12px', marginLeft: '2px' }} />
</span>
</Tooltip>
</div>
<SiteConfig
webs={webs}
productList={productList}
......
......@@ -65,6 +65,7 @@ const SortModal = props => {
return (
<Modal
title="网站调序"
width="600px"
visible={visible}
onCancel={onCancel}
......
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