From c593048fd2b71df0bed46c97110e19e0b9bb3cd4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 07 十月 2022 15:50:53 +0800 Subject: [PATCH] 2022-10-07 --- src/templates/sharecomponent/settingcomponent/index.jsx | 1 src/menu/datasource/verifycard/utils.jsx | 2 src/utils/utils-datamanage.js | 1 src/menu/components/card/cardcellcomponent/dragaction/index.scss | 1 src/menu/datasource/verifycard/index.scss | 12 ++ src/components/mkPicture/index.scss | 11 + src/tabviews/zshare/normalTable/index.jsx | 46 ------- src/tabviews/custom/components/share/normalTable/index.scss | 7 - src/templates/zshare/verifycard/customscript/index.jsx | 2 public/options.json | 12 +- src/menu/components/form/dragtitle/index.jsx | 3 src/tabviews/custom/components/share/normalTable/index.jsx | 6 src/tabviews/commontable/index.jsx | 2 src/templates/sharecomponent/settingcomponent/settingform/utils.jsx | 2 src/menu/datasource/verifycard/index.jsx | 8 + src/utils/utils.js | 5 src/tabviews/custom/components/card/cardcellList/index.jsx | 21 --- src/components/mkPicture/index.jsx | 74 ++++++++++++ src/pc/bgcontroller/index.jsx | 16 +- src/tabviews/debugtable/index.jsx | 39 +++++- src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 4 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 2 src/store/options.js | 2 src/tabviews/custom/components/table/edit-table/normalTable/index.scss | 11 - src/tabviews/custom/index.jsx | 8 src/tabviews/custom/components/card/cardcellList/index.scss | 9 - src/tabviews/debugtable/index.scss | 10 + src/tabviews/zshare/normalTable/index.scss | 9 - src/menu/components/form/dragtitle/card.jsx | 4 29 files changed, 189 insertions(+), 141 deletions(-) diff --git a/public/options.json b/public/options.json index ea0061e..eb7e988 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", - "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", + "appId": "", + "appkey": "", + "mainSystemApi": "", "systemType": "", "externalDatabase": "false", "lineColor": "", "filter": "false", - "defaultApp": "mk", + "defaultApp": "mkindustry", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -17,6 +17,6 @@ "transfer": "false", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "https://cloud.mk9h.cn", + "service": "" } \ No newline at end of file diff --git a/src/components/mkPicture/index.jsx b/src/components/mkPicture/index.jsx new file mode 100644 index 0000000..6414970 --- /dev/null +++ b/src/components/mkPicture/index.jsx @@ -0,0 +1,74 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' + +import LostPng from '@/assets/img/lost.png' +import MKEmitter from '@/utils/events.js' + +import './index.scss' + +class MkPicture extends Component { + static propTpyes = { + style: PropTypes.object, + scale: PropTypes.bool, + url: PropTypes.string, + urls: PropTypes.array, + } + + state = { + url: '', + lost: false + } + + UNSAFE_componentWillMount() { + const { url } = this.props + + if (url) { + this.setState({url: url, lost: false}) + this.checkUrl(url) + } else { + this.setState({url: LostPng, lost: true}) + } + } + + UNSAFE_componentWillReceiveProps (nextProps) { + if (nextProps.url) { + if (nextProps.url !== this.state.url) { + this.setState({url: nextProps.url, lost: false}) + this.checkUrl(nextProps.url) + } + } else { + this.setState({url: LostPng, lost: true}) + } + } + + checkUrl = (url) => { + let img = new Image() + img.addEventListener('error', this.loadHandler) + img.src = url + } + + loadHandler = (e) => { + this.setState({url: LostPng, lost: true}) + } + + render() { + const { style, scale, urls } = this.props + const { url, lost } = this.state + + return ( + <div + className={'ant-mk-picture' + (scale ? ' scale' : '') + (lost ? ' lost' : '')} + onClick={(e) => { + if (!scale) return + + e.stopPropagation() + + MKEmitter.emit('mkImageScale', url, urls) + }} + style={{...style, backgroundImage: `url('${url}')`}} + ></div> + ) + } +} + +export default MkPicture \ No newline at end of file diff --git a/src/components/mkPicture/index.scss b/src/components/mkPicture/index.scss new file mode 100644 index 0000000..3d6e51e --- /dev/null +++ b/src/components/mkPicture/index.scss @@ -0,0 +1,11 @@ +.ant-mk-picture { + background-size: cover; + background-position: center center; + background-repeat: no-repeat; +} +.ant-mk-picture.lost { + background-size: contain!important; +} +.ant-mk-picture.scale { + cursor: zoom-in; +} \ No newline at end of file diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.scss b/src/menu/components/card/cardcellcomponent/dragaction/index.scss index ea8410f..3683516 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.scss +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.scss @@ -114,7 +114,6 @@ background-size: cover; background-position: center center; background-repeat: no-repeat; - background-color: #f5f5f5; } .ant-mk-icon { vertical-align: top; diff --git a/src/menu/components/form/dragtitle/card.jsx b/src/menu/components/form/dragtitle/card.jsx index 63a8d4b..090ccd1 100644 --- a/src/menu/components/form/dragtitle/card.jsx +++ b/src/menu/components/form/dragtitle/card.jsx @@ -11,7 +11,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const Card = ({ id, card, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { +const Card = ({ id, card, sort, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ item: { type: 'form', id, originalIndex }, @@ -80,7 +80,7 @@ } trigger="hover"> <div className={'page-card ' + (active ? 'active' : '')} onClick={select} style={{ opacity: opacity}}> <div ref={node => drag(drop(node))}> - <span className="form-sort">{card.sort}</span> + <span className="form-sort">{sort}</span> {card.setting.title} </div> </div> diff --git a/src/menu/components/form/dragtitle/index.jsx b/src/menu/components/form/dragtitle/index.jsx index 138a259..96a6e7f 100644 --- a/src/menu/components/form/dragtitle/index.jsx +++ b/src/menu/components/form/dragtitle/index.jsx @@ -40,10 +40,11 @@ return ( <div className={'normal-form-titles ' + (tabtype || '') } > - {cards.map(card => ( + {cards.map((card, i) => ( <Card id={card.uuid} key={card.uuid} + sort={i + 1} active={card.uuid === selectId} card={card} moveCard={moveCard} diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index 85eb070..64a38ce 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -743,14 +743,18 @@ wrappedComponentRef={(inst) => this.settingForm = inst} /> </TabPane> - <TabPane tab="瀛楁闆�" key="columns"> + <TabPane tab={ + <span> + 瀛楁闆� + <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" className="mk-copy-fields" onClick={this.copyColumns}/> + </span> + } key="columns"> <ColForm dict={this.props.dict} columnChange={this.columnChange}/> <FieldsComponent config={{...config, columns}} type="fields" updatefield={this.updatefields} /> - <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" onClick={this.copyColumns} style={{position: 'absolute', cursor: 'pointer', zIndex: 1, top: '-35px', right: '0px', color: '#1890ff'}} /> <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> </TabPane> <TabPane tab={ diff --git a/src/menu/datasource/verifycard/index.scss b/src/menu/datasource/verifycard/index.scss index 8615405..4be45ad 100644 --- a/src/menu/datasource/verifycard/index.scss +++ b/src/menu/datasource/verifycard/index.scss @@ -9,6 +9,18 @@ .ant-tabs-nav-scroll { text-align: center; } + .mk-copy-fields { + position: absolute; + cursor: pointer; + z-index: 1; + top: 19px; + right: -210px; + color: rgb(24, 144, 255); + display: none; + } + .ant-tabs-tab-active .mk-copy-fields { + display: inline-block; + } .count-tip { position: absolute; top: 0px; diff --git a/src/menu/datasource/verifycard/utils.jsx b/src/menu/datasource/verifycard/utils.jsx index 38cfddf..835d503 100644 --- a/src/menu/datasource/verifycard/utils.jsx +++ b/src/menu/datasource/verifycard/utils.jsx @@ -221,7 +221,7 @@ } scripts && scripts.forEach(script => { if (reg.test(script.sql)) { - errors.push(`鑷畾涔夎剼鏈�(${script.$index})瀛樺湪鏈浛鎹㈠��${item}`) + errors.push(`鑷畾涔夎剼鏈�(${script.$index || ''})瀛樺湪鏈浛鎹㈠��${item}`) } }) }) diff --git a/src/pc/bgcontroller/index.jsx b/src/pc/bgcontroller/index.jsx index 23ee485..35def8d 100644 --- a/src/pc/bgcontroller/index.jsx +++ b/src/pc/bgcontroller/index.jsx @@ -215,28 +215,28 @@ className="normal-view" label={<ArrowUpOutlined title="涓婅竟璺�"/>} > - <StyleInput defaultValue={config.style.paddingTop || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingTop')}/> + <StyleInput defaultValue={config.style.paddingTop || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingTop')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowDownOutlined title="涓嬭竟璺�"/>} > - <StyleInput defaultValue={config.style.paddingBottom || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingBottom')}/> + <StyleInput defaultValue={config.style.paddingBottom || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingBottom')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowLeftOutlined title="宸﹁竟璺�"/>} > - <StyleInput defaultValue={config.style.paddingLeft || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingLeft')}/> + <StyleInput defaultValue={config.style.paddingLeft || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingLeft')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowRightOutlined title="鍙宠竟璺�"/>} > - <StyleInput defaultValue={config.style.paddingRight || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingRight')}/> + <StyleInput defaultValue={config.style.paddingRight || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'paddingRight')}/> </Form.Item> <p className="normal-view" style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>澶栬竟璺�</p> <Form.Item @@ -244,28 +244,28 @@ className="normal-view" label={<ArrowUpOutlined title="涓婅竟璺�"/>} > - <StyleInput defaultValue={config.style.marginTop || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginTop')}/> + <StyleInput defaultValue={config.style.marginTop || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginTop')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowDownOutlined title="涓嬭竟璺�"/>} > - <StyleInput defaultValue={config.style.marginBottom || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginBottom')}/> + <StyleInput defaultValue={config.style.marginBottom || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginBottom')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowLeftOutlined title="宸﹁竟璺�"/>} > - <StyleInput defaultValue={config.style.marginLeft || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginLeft')}/> + <StyleInput defaultValue={config.style.marginLeft || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginLeft')}/> </Form.Item> <Form.Item colon={false} className="normal-view" label={<ArrowRightOutlined title="鍙宠竟璺�"/>} > - <StyleInput defaultValue={config.style.marginRight || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginRight')}/> + <StyleInput defaultValue={config.style.marginRight || '0px'} options={['px', '%', 'vh', 'vw']} onChange={(val) => this.changePadding(val, 'marginRight')}/> </Form.Item> </Form> </div> diff --git a/src/store/options.js b/src/store/options.js index 1b683f6..6219e45 100644 --- a/src/store/options.js +++ b/src/store/options.js @@ -6,7 +6,7 @@ * 4銆乸ositecgroup ( aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t ) */ export default { - sysType: 'bG9j$mkYWw=', + sysType: 'Y2xv$mkdWQ=', caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==', cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==', cdomain: 'aHR0cHM6Ly9jbG91$mkZC5tazloLmNu' diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index b861521..5466607 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -28,6 +28,7 @@ const ChartComponent = asyncSpinComponent(() => import('@/tabviews/zshare/chartcomponent')) const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage')) const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) +const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) const { TabPane } = Tabs @@ -1273,6 +1274,7 @@ })} </Tabs>)) } + {setting && window.GLOB.breakpoint ? <DebugTable /> : null} {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null} {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} {!window.GLOB.mkHS && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null} diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index b5ebd9f..8989e73 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -9,8 +9,6 @@ import asyncElementComponent from '@/utils/asyncComponent' import { getMark } from '@/utils/utils.js' import MkIcon from '@/components/mk-icon' -import MKEmitter from '@/utils/events.js' -import LostPng from '@/assets/img/lost.png' import Encrypts from '@/components/encrypts' import './index.scss' @@ -29,6 +27,7 @@ const QrCode = asyncElementComponent(() => import('@/components/qrcode')) const MkProgress = asyncElementComponent(() => import('@/components/mkProgress')) const Video = asyncComponent(() => import('@/components/video')) +const MkPicture = asyncComponent(() => import('@/components/mkPicture')) const PicRadio = { '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', @@ -555,26 +554,12 @@ } let scale = url && card.scale === 'true' - let urls = url ? url.split(',').filter(Boolean) : [LostPng] - - if (!url) { - _imagestyle = {backgroundSize: 'contain'} - } + let urls = url ? url.split(',').filter(Boolean) : [''] urls.forEach((u, i) => { contents.push(<Col key={card.uuid + i} span={card.width}> <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> - <div - className={'ant-mk-picture' + (scale ? ' scale' : '')} - onClick={(e) => { - if (!scale) return - - e.stopPropagation() - - MKEmitter.emit('mkImageScale', url, urls) - }} - style={{..._imagestyle, backgroundImage: `url('${u}')`}} - ></div> + <MkPicture style={_imagestyle} scale={scale} url={u} urls={urls}/> </div> </Col>) }) diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index 2030460..fa2af83 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -151,15 +151,6 @@ } } } - .ant-mk-picture { - background-size: cover; - background-position: center center; - background-repeat: no-repeat; - background-color: #f5f5f5; - } - .ant-mk-picture.scale { - cursor: zoom-in; - } .ant-mk-icon { vertical-align: top; line-height: inherit; diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 317b96d..0e98c31 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -16,6 +16,7 @@ const { Paragraph } = Typography const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) +const MkPicture = asyncComponent(() => import('@/components/mkPicture')) const PicRadio = { '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', @@ -253,10 +254,7 @@ <div> {photos.map((url, i) => ( <Col key={i} span={col.span || 24}> - <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { - if (!scale) return - MKEmitter.emit('mkImageScale', url, photos) - }} style={{paddingTop, backgroundImage: `url('${url}')`}}></div> + <MkPicture style={{paddingTop}} scale={scale} url={url} urls={photos}/> </Col> ))} </div> diff --git a/src/tabviews/custom/components/share/normalTable/index.scss b/src/tabviews/custom/components/share/normalTable/index.scss index ebaa748..697e60e 100644 --- a/src/tabviews/custom/components/share/normalTable/index.scss +++ b/src/tabviews/custom/components/share/normalTable/index.scss @@ -98,14 +98,7 @@ } .ant-mk-picture { position: relative; - background-position: center center; - background-size: cover; - background-repeat: no-repeat; - background-color: #f5f5f5; margin: 2px; - } - .ant-mk-picture.scale { - cursor: zoom-in; } .action-col { .ant-btn > .anticon + span { diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 8651b50..f9ece5a 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -893,7 +893,7 @@ static propTpyes = { statFValue: PropTypes.any, // 鍚堣瀛楁鏁版嵁 MenuID: PropTypes.string, // 鑿滃崟Id - setting: PropTypes.object, // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乧olumnfixed锛堝垪鍥哄畾锛夈�乤ctionfixed锛堟寜閽浐瀹氾級 + setting: PropTypes.object, // 琛ㄦ牸鍏ㄥ眬璁剧疆锛歵ableType锛堣〃鏍兼槸鍚﹀彲閫夈�佸崟閫夈�佸閫夛級銆乤ctionfixed锛堟寜閽浐瀹氾級 columns: PropTypes.array, // 琛ㄦ牸鍒� lineMarks: PropTypes.any, // 琛屾爣璁� fields: PropTypes.array, // 缁勪欢瀛楁闆� diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss index 4e5b652..971228d 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss @@ -74,17 +74,6 @@ .card-cell-list { color: rgba(0, 0, 0, 0.85); } - .ant-mk-picture { - position: relative; - background-position: center center; - background-size: cover; - background-repeat: no-repeat; - background-color: #f5f5f5; - margin: 2px; - } - .ant-mk-picture.scale { - cursor: zoom-in; - } .action-col { .ant-btn > .anticon + span { margin-left: 3px; diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 6f41f64..5cf8beb 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -42,6 +42,7 @@ const CustomChart = asyncComponent(() => import('./components/chart/custom-chart')) const TimeLine = asyncComponent(() => import('./components/timeline/normal-timeline')) const Voucher = asyncComponent(() => import('./components/module/voucher')) +const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) class CustomPage extends Component { static propTpyes = { @@ -302,9 +303,9 @@ inters.push(item) }) - if (inters.length > 0) { - this.loadOutResource(inters) - } + // if (inters.length > 0) { + // this.loadOutResource(inters) + // } } loadOutResource = (inters) => { @@ -1366,6 +1367,7 @@ <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}> {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null} <Row className="component-wrap">{this.getComponents()}</Row> + {config && window.GLOB.breakpoint ? <DebugTable /> : null} {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null} {!window.GLOB.mkHS && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null} {viewlost ? <NotFount msg={this.state.lostmsg} /> : null} diff --git a/src/tabviews/debugtable/index.jsx b/src/tabviews/debugtable/index.jsx index 8e6d5c1..7b76927 100644 --- a/src/tabviews/debugtable/index.jsx +++ b/src/tabviews/debugtable/index.jsx @@ -1,23 +1,34 @@ import React, {Component} from 'react' import { is, fromJS } from 'immutable' import { notification, Table} from 'antd' +import { RedoOutlined } from '@ant-design/icons' import Api from '@/api' +import MKEmitter from '@/utils/events.js' import UtilsDM from '@/utils/utils-datamanage.js' import './index.scss' class DebugTable extends Component { state = { - columns: null, // 鏄剧ず鍒� - data: [], // 鍒楄〃鏁版嵁闆� - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� + columns: [ + {align: 'left', dataIndex: 'Sort', sorter: false, title: 'Sort', width: 120}, + {align: 'left', dataIndex: 'CDefine1', sorter: false, title: '鏂囨湰1', width: 120}, + {align: 'left', dataIndex: 'CDefine2', sorter: false, title: '鏂囨湰2', width: 120}, + {align: 'left', dataIndex: 'CDefine3', sorter: false, title: '鏂囨湰3', width: 120}, + {align: 'left', dataIndex: 'CDefine4', sorter: false, title: '鏂囨湰4', width: 120}, + {align: 'left', dataIndex: 'CDefine5', sorter: false, title: '鏂囨湰5', width: 120}, + {align: 'left', dataIndex: 'CDefine6', sorter: false, title: '鏂囨湰6', width: 120}, + {align: 'left', dataIndex: 'CDefine7', sorter: false, title: '鏂囨湰7', width: 120}, + ], + data: [], + loading: false, setting: { interType: 'system', execute: true, - dataresource: 'select * from s_debug_value_log where createuserid=@userid@' + dataresource: '(select * from s_debug_value_log where createuserid=@userid@) tb' }, - arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7,' + arr_field: 'ID,Sort,CDefine1,CDefine2,CDefine3,CDefine4,CDefine5,CDefine6,CDefine7' } /** @@ -30,8 +41,7 @@ loading: true }) - let _orderBy = 'sort' - let param = UtilsDM.getQueryDataParams(setting, arr_field, [], _orderBy, 1, 9999, '') + let param = UtilsDM.getQueryDataParams(setting, arr_field, [], 'sort', 1, 9999, '') let result = await Api.genericInterface(param) @@ -42,7 +52,6 @@ data: result.data.map((item, index) => { item.key = index item.$$uuid = item.ID || '' - item.$$key = '' + item.key + item.$$uuid item.$Index = start + index + '' return item @@ -62,9 +71,21 @@ } } + refreshByButtonResult = () => { + const { loading } = this.state + + if (!loading) { + this.loadmaindata() + } + } + UNSAFE_componentWillMount() { // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁 this.loadmaindata() + } + + componentDidMount() { + MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) } shouldComponentUpdate (nextProps, nextState) { @@ -78,6 +99,7 @@ this.setState = () => { return } + MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) } render() { @@ -85,6 +107,7 @@ return ( <div className="debugtable"> + <RedoOutlined className="mk-debug-reload" onClick={() => this.loadmaindata()}/> <Table size="middle" columns={columns} dataSource={data} loading={loading} scroll={{ x: '100%', y: false }}/> </div> ) diff --git a/src/tabviews/debugtable/index.scss b/src/tabviews/debugtable/index.scss index 7608d90..773c2c0 100644 --- a/src/tabviews/debugtable/index.scss +++ b/src/tabviews/debugtable/index.scss @@ -1,4 +1,14 @@ .debugtable { position: relative; min-height: 200px; + margin: 20px; + + .mk-debug-reload { + color: var(--mk-sys-color); + position: absolute; + z-index: 1; + top: 5px; + right: 10px; + font-size: 16px; + } } diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index b355463..c3147cc 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import md5 from 'md5' import { is, fromJS } from 'immutable' -import { Table, Affix, Typography, Col } from 'antd' +import { Table, Typography, Col } from 'antd' import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' @@ -18,6 +18,7 @@ const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) const Video = asyncComponent(() => import('@/components/video')) +const MkPicture = asyncComponent(() => import('@/components/mkPicture')) const PicRadio = { '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', @@ -660,17 +661,7 @@ return ( <div className="picture-col"> {photos.map((url, i) => (<Col key={i} span={item.span || 24}> - <div - className={'mk-picture' + (scale ? ' image-scale' : '')} - onClick={(e) => { - if (!scale) return - - e.stopPropagation() - - MKEmitter.emit('mkImageScale', url, photos) - }} - style={{...style, backgroundImage: `url('${url}')`}} - ></div> + <MkPicture style={style} scale={scale} url={url} urls={photos}/> </Col>))} </div> ) @@ -1250,21 +1241,6 @@ } } - // 琛ㄦ牸澶撮儴鍥哄畾浜庨《閮ㄦ椂锛屽垽鏂窛椤堕儴楂樺害 - let offset = null - if (this.props.tableId === 'mainTable' && setting.columnfixed) { - if (!setting.actionfixed) { - offset = 48 - } else { - let box = document.getElementById(this.props.MenuID + 'mainaction') - if (box) { - offset = 48 + box.offsetHeight - } else { - offset = 105 - } - } - } - // 鏁版嵁鏀惰捣鏃讹紝杩囨护宸查�夋暟鎹� let _data = this.props.data ? this.props.data : [] @@ -1308,22 +1284,6 @@ return ( <div className={'normal-data-table mingke-table ' + (height ? 'fixed-height' : '')}> - {offset && <Affix offsetTop={offset} className="fix-header"> - <Table - size={setting.size || 'middle'} - style={style} - bordered={setting.bordered !== 'false'} - rowSelection={rowSelection} - columns={this.state.columns.map(column => { - return { - align: column.align, - dataIndex: column.dataIndex, - title: column.title, - width: column.width - } - })} - /> - </Affix>} <Table components={components} size={setting.size || 'middle'} diff --git a/src/tabviews/zshare/normalTable/index.scss b/src/tabviews/zshare/normalTable/index.scss index 0011eac..75c4770 100644 --- a/src/tabviews/zshare/normalTable/index.scss +++ b/src/tabviews/zshare/normalTable/index.scss @@ -174,15 +174,6 @@ >.ant-col { padding: 5px; } - .mk-picture { - background-color: #f5f5f5; - background-position: center center; - background-size: cover; - background-repeat: no-repeat; - } - .image-scale { - cursor: zoom-in; - } } .action-col { .ant-btn > .anticon + span { diff --git a/src/templates/sharecomponent/settingcomponent/index.jsx b/src/templates/sharecomponent/settingcomponent/index.jsx index d2c3f5d..72b3c79 100644 --- a/src/templates/sharecomponent/settingcomponent/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/index.jsx @@ -71,7 +71,6 @@ loading: false }) res.actionfixed = res.actionfixed === 'true' - res.columnfixed = res.columnfixed === 'true' this.props.updatesetting({...config, setting: res}) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 30dc05c..79e0fe0 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -442,7 +442,7 @@ </Radio.Group>)} </Form.Item> </Col> : null} - {config.Template === 'CommonTable' ? <Col span={8}> + {/* {config.Template === 'CommonTable' ? <Col span={8}> <Form.Item label={ <Tooltip placement="topLeft" title={'鍚湁鍚堝苟鍒楁垨琛ㄦ牸鍑虹幇妯悜婊氬姩鏃朵細鏄剧ず寮傚父锛岃鎱庣敤锛�'}> <QuestionCircleOutlined className="mk-form-tip" /> @@ -457,7 +457,7 @@ <Radio value="false">{dict['model.false']}</Radio> </Radio.Group>)} </Form.Item> - </Col> : null} + </Col> : null} */} <Col span={8}> <Form.Item label="杈规"> {getFieldDecorator('bordered', { diff --git a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx index 2f6b872..b165395 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/utils.jsx @@ -157,7 +157,7 @@ } scripts && scripts.forEach(script => { if (reg.test(script.sql)) { - errors.push(`鑷畾涔夎剼鏈�(${script.$index})瀛樺湪鏈浛鎹㈠��${item}`) + errors.push(`鑷畾涔夎剼鏈�(${script.$index || ''})瀛樺湪鏈浛鎹㈠��${item}`) } }) }) diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index 7b42a66..979d472 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -325,7 +325,7 @@ </Col> <Col span={24} className="sql"> <Form.Item label={ - <Tooltip placement="topLeft" title={'鏁版嵁妫�鏌ユ浛鎹㈢ $check@ -> \'\'銆� @check$ -> \'\'锛孍rrorCode绛変簬C鏃� $check@ -> /*銆� @check$ -> */銆傛敞锛�1銆侀渶浣跨敤绯荤粺鎺ュ彛 2銆佽璁剧疆涓衡�滈�夋嫨澶氳鈥濇椂鏃犳晥銆�'}> + <Tooltip placement="topLeft" title={'鏁版嵁妫�鏌ユ浛鎹㈢ $check@ -> \'\'銆� @check$ -> \'\'锛孍rrorCode绛変簬C鏃� $check@ -> /*銆� @check$ -> */銆傛敞锛�1銆侀渶浣跨敤绯荤粺鎺ュ彛 2銆佽璁剧疆涓衡�滈�夋嫨澶氳鈥濇椂鏃犳晥銆傝皟璇曟浛鎹㈢ /*$breakpoint_begin_xxxx@ 銆丂breakpoint_end_xxxx$*/'}> <QuestionCircleOutlined className="mk-form-tip" /> sql </Tooltip> diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 1c66177..2e4dedc 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -446,7 +446,6 @@ */ static getPrevQueryParams (setting, search = [], BID) { let param = null - if (setting.procMode !== 'inner') { param = this.getDefaultPrevQueryParam(setting, search, BID) } else { diff --git a/src/utils/utils.js b/src/utils/utils.js index aef66a2..94ac0a2 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -2091,6 +2091,11 @@ if (window.GLOB.breakpoint) { let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig') let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig') + + if (window.GLOB.breakpoint === 'all') { + start = /\/\*\$breakpoint_begin_[0-9a-z_]+@/ig + end = /@breakpoint_end_[0-9a-z_]+\$\*\//ig + } _sql = _sql.replace(start, '').replace(end, '') _sql += ` -- Gitblit v1.8.0