From a10868e96c5c66bfb06e812760100a9377f2fe31 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 28 七月 2021 10:26:51 +0800 Subject: [PATCH] 2021-07-28 --- src/templates/zshare/editTable/index.jsx | 17 ++ src/menu/popview/index.scss | 162 +++++++++++++++++++++++++++ src/views/appmanage/index.jsx | 10 src/views/menudesign/index.scss | 2 src/views/pcdesign/index.jsx | 6 src/views/appmanage/submutilform/index.jsx | 4 src/views/mobdesign/index.jsx | 2 src/templates/zshare/editTable/index.scss | 4 src/menu/popview/index.jsx | 90 +++++++------- src/utils/utils.js | 8 + 10 files changed, 247 insertions(+), 58 deletions(-) diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx index 2cae8b8..55a0f13 100644 --- a/src/menu/popview/index.jsx +++ b/src/menu/popview/index.jsx @@ -19,6 +19,7 @@ const { confirm } = Modal const MenuForm = asyncComponent(() => import('./menuform')) +const Header = asyncComponent(() => import('@/menu/header')) const SourceWrap = asyncComponent(() => import('@/menu/modulesource')) const MenuShell = asyncComponent(() => import('@/menu/menushell')) const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) @@ -564,50 +565,53 @@ const { activeKey, MenuType, dict, config, menuloading, customComponents } = this.state return ( - <DndProvider backend={HTML5Backend}> - <div className="menu-body"> - <div className="menu-setting"> - <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> - {/* 鍩烘湰淇℃伅 */} - <Panel header={dict['mob.basemsg']} key="basedata"> - {/* 鑿滃崟淇℃伅 */} - {config ? <MenuForm dict={dict} config={config} btn={btn} updateConfig={this.updateConfig}/> : null} - {/* 琛ㄥ悕娣诲姞 */} - {config ? <TableComponent config={config} updatetable={this.updatetable}/> : null} - </Panel> - {/* 缁勪欢娣诲姞 */} - <Panel header={dict['mob.component']} key="component"> - <SourceWrap MenuType={MenuType} /> - </Panel> - {customComponents && customComponents.length ? <Panel header="鑷畾涔夌粍浠�" key="cuscomponent"> - <SourceWrap components={customComponents} MenuType={MenuType} /> - </Panel> : null} - <Panel header={'椤甸潰鑳屾櫙'} key="background"> - {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} - </Panel> - <Panel header={'椤甸潰鍐呰竟璺�'} key="padding"> - {config ? <PaddingController config={config} updateConfig={this.updateConfig} /> : null} - </Panel> - </Collapse> + <div className="pc-poper-view"> + <Header /> + <DndProvider backend={HTML5Backend}> + <div className="menu-body"> + <div className="menu-setting"> + <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> + {/* 鍩烘湰淇℃伅 */} + <Panel header={dict['mob.basemsg']} key="basedata"> + {/* 鑿滃崟淇℃伅 */} + {config ? <MenuForm dict={dict} config={config} btn={btn} updateConfig={this.updateConfig}/> : null} + {/* 琛ㄥ悕娣诲姞 */} + {config ? <TableComponent config={config} updatetable={this.updatetable}/> : null} + </Panel> + {/* 缁勪欢娣诲姞 */} + <Panel header={dict['mob.component']} key="component"> + <SourceWrap MenuType={MenuType} /> + </Panel> + {customComponents && customComponents.length ? <Panel header="鑷畾涔夌粍浠�" key="cuscomponent"> + <SourceWrap components={customComponents} MenuType={MenuType} /> + </Panel> : null} + <Panel header={'椤甸潰鑳屾櫙'} key="background"> + {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} + </Panel> + <Panel header={'椤甸潰鍐呰竟璺�'} key="padding"> + {config ? <PaddingController config={config} updateConfig={this.updateConfig} /> : null} + </Panel> + </Collapse> + </div> + <div className={'menu-view ' + (menuloading ? 'saving' : '')}> + <Card title={ + <div> {config && config.MenuName} </div> + } bordered={false} extra={ + <div> + <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> + <StyleCombControlButton menu={config} /> + <PasteController type="menu" Tab={null} insert={this.insert} /> + {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} + <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> + <Button type="default" onClick={this.closeView}>{dict['mob.return']}</Button> + </div> + } style={{ width: '100%' }}> + {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} + </Card> + </div> </div> - <div className={'menu-view ' + (menuloading ? 'saving' : '')}> - <Card title={ - <div> {config && config.MenuName} </div> - } bordered={false} extra={ - <div> - <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> - <StyleCombControlButton menu={config} /> - <PasteController type="menu" Tab={null} insert={this.insert} /> - {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} - <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> - <Button type="default" onClick={this.closeView}>{dict['mob.return']}</Button> - </div> - } style={{ width: '100%' }}> - {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} - </Card> - </div> - </div> - </DndProvider> + </DndProvider> + </div> ) } } diff --git a/src/menu/popview/index.scss b/src/menu/popview/index.scss index e69de29..d1a7fda 100644 --- a/src/menu/popview/index.scss +++ b/src/menu/popview/index.scss @@ -0,0 +1,162 @@ +.pc-poper-view { + background: #000; + min-height: 100vh; + >.menu-body { + width: 100vw; + height: 100vh; + overflow-x: hidden; + position: relative; + background: #ffffff; + padding: 50px 0px 0px 0px; + + .menu-setting { + position: fixed; + left: 0; + top: 48px; + z-index: 10; + height: calc(100vh - 48px); + width: 300px; + background: #ffffff; + box-shadow: 0px 2px 5px #bcbcbc; + overflow-y: auto; + overflow-x: hidden; + + > .ant-collapse { + background-color: #ffffff; + .ant-collapse-item.ant-collapse-item-active { + border-bottom: 1px solid #d9d9d9; + } + .ant-collapse-header { + padding: 11px 16px 10px 40px; + border-bottom: 1px solid #d9d9d9; + background: #1890ff; + color: #ffffff; + } + .ant-collapse-content-box { + .ant-form-item { + margin-bottom: 10px; + } + .model-table-tablemanage-view { + >.ant-list { + margin-top: 20px; + .ant-list-item { + display: -webkit-box; + padding-right: 20px; + position: relative; + padding-left: 5px; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + min-height: 55px; + width: 100%; + .anticon { + position: absolute; + top: 0px; + right: 0px; + padding: 3px 3px 10px 10px; + cursor: pointer; + } + } + } + >.tables { + width: 66.66666667%!important; + } + >.ant-form-item-label { + width: 33.33333333%; + } + } + } + } + + >.ant-tabs { + >.ant-tabs-bar { + border-bottom: 1px solid #181F29; + margin-bottom: 0px; + min-height: 48px; + .ant-tabs-tab { + padding: 14px 16px; + color: rgba(255, 255, 255, 0.85); + } + .ant-tabs-tab-active.ant-tabs-tab { + color: #1890ff; + } + } + } + } + .menu-setting::-webkit-scrollbar { + width: 4px; + } + .menu-setting::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); + background: rgba(0, 0, 0, 0.08); + } + .menu-setting::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + } + + .menu-view { + position: relative; + width: calc(100vw - 300px); + margin-left: 300px; + height: calc(100vh - 50px); + overflow-y: auto; + + > .ant-card { + >.ant-card-head { + margin-bottom: 0px; + position: relative; + .ant-card-head-title { + color: #1890ff; + padding: 5px 0; + } + .ant-card-extra { + padding: 5px 0; + button { + margin-left: 20px; + } + .ant-switch.big { + min-width: 60px; + height: 28px; + line-height: 28px; + margin-top: -2px; + .ant-switch-inner { + font-size: 14px; + } + } + .ant-switch.big:after { + width: 24px; + height: 24px; + } + } + } + >.ant-card-body { + padding: 0px; + } + } + } + .menu-view.saving { + .anticon-tool { + display: none; + } + } + .menu-view::-webkit-scrollbar { + width: 7px; + } + .menu-view::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); + background: rgba(0, 0, 0, 0.08); + } + .menu-view::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + } + } +} \ No newline at end of file diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index da3ee13..5e1d00b 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -502,7 +502,7 @@ moveprops.moveRow = this.moveRow } - const columns = this.state.columns.map(col => { + let columns = this.state.columns.map(col => { if (col.copy) { col.render = (text) => (<Paragraph copyable>{text}</Paragraph>) } @@ -525,6 +525,19 @@ } }) + columns.unshift({ + title: '搴忓彿', + dataIndex: '$index', + className: 'mk-index', + width: '60px', + }) + + const data = this.state.data.map((item, index) => { + item.$index = index + 1 + + return item + }) + return ( <EditableContext.Provider value={this.props.form}> <div className="modal-edit-table"> @@ -533,7 +546,7 @@ bordered rowKey="uuid" components={components} - dataSource={this.state.data} + dataSource={data} columns={columns} rowClassName="editable-row" pagination={false} diff --git a/src/templates/zshare/editTable/index.scss b/src/templates/zshare/editTable/index.scss index 5943f34..8713c7f 100644 --- a/src/templates/zshare/editTable/index.scss +++ b/src/templates/zshare/editTable/index.scss @@ -20,6 +20,10 @@ padding: 0px; } } + .mk-index { + text-align: center; + white-space: nowrap; + } thead tr th:last-child { text-align: center; diff --git a/src/utils/utils.js b/src/utils/utils.js index 9c928e7..93d0120 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -826,6 +826,11 @@ // 鎺у埗鍙版墦鍗版暟鎹� let conLtext = [] + let cols = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + for (let i = 0; i < 26; i++) { + cols.push('A' + cols[i]) + } + let _Ltext = data.map((item, lindex) => { let vals = [] let convals = [] @@ -833,7 +838,8 @@ if (col.import === 'false') return let val = item[col.Column] !== undefined ? item[col.Column] : '' - let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + (cindex + 1) + dict['main.excel.column'] + ' ' + let _colindex = cols[cindex] || (cindex + 1) + let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + _colindex + dict['main.excel.column'] + ' ' if (/^Nvarchar/ig.test(col.type)) { if (typeof(val) === 'number') { diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 91fb606..c238f65 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -586,7 +586,7 @@ sublist = sublist.filter(item => item.ID !== record.ID) // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -793,7 +793,7 @@ if (visible === 'edit') { // param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) } @@ -878,7 +878,7 @@ } // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -1027,8 +1027,8 @@ </Col> <Col span={12}> <div className="app-item"> - <div className="label">鐧诲綍:</div> - <div className="content">{item.login_types === 'false' ? '涓嶉渶瑕�' : '闇�瑕�'}</div> + {/* <div className="label">鐧诲綍:</div> + <div className="content">{item.login_types === 'false' ? '涓嶉渶瑕�' : '闇�瑕�'}</div> */} </div> </Col> <Col span={12}> diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index 6241ca3..137c862 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -109,7 +109,7 @@ )} </Form.Item> </Col> - <Col span={12}> + {/* <Col span={12}> <Form.Item label="鐧诲綍"> {getFieldDecorator('login_types', { initialValue: card ? card.login_types || 'true' : 'true' @@ -120,7 +120,7 @@ </Radio.Group> )} </Form.Item> - </Col> + </Col> */} <Col span={12}> <Form.Item label="鏉冮檺绠$悊"> {getFieldDecorator('role_type', { diff --git a/src/views/menudesign/index.scss b/src/views/menudesign/index.scss index 65fadca..b9b5812 100644 --- a/src/views/menudesign/index.scss +++ b/src/views/menudesign/index.scss @@ -1,7 +1,7 @@ .pc-menu-view { background: #000; min-height: 100vh; - .menu-body { + >.menu-body { width: 100vw; height: 100vh; overflow-x: hidden; diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 007e6dc..e983907 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -80,7 +80,7 @@ sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.setItem('kei_no', param.kei_no || '') sessionStorage.setItem('role_type', param.role_type || 'true') - sessionStorage.setItem('login_types', param.login_types || 'true') + sessionStorage.setItem('login_types', param.login_types || 'false') sessionStorage.setItem('typename', param.typename || 'mob') this.setState({ diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index ade6709..bde0d56 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -24,7 +24,7 @@ const MenuForm = asyncComponent(() => import('./menuform')) const Transfer = asyncComponent(() => import('@/pc/transfer')) -// const PopviewController = asyncComponent(() => import('@/menu/popview')) +const PopviewController = asyncComponent(() => import('@/menu/popview')) const MenuShell = asyncComponent(() => import('@/pc/menushell')) const SourceWrap = asyncComponent(() => import('@/pc/modulesource')) const CreateView = asyncComponent(() => import('@/pc/createview')) @@ -84,7 +84,7 @@ sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.setItem('kei_no', param.kei_no || '') sessionStorage.setItem('role_type', param.role_type || 'true') - sessionStorage.setItem('login_types', param.login_types || 'true') + sessionStorage.setItem('login_types', param.login_types || 'false') this.setState({ localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, @@ -1588,7 +1588,7 @@ {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} </div> </DndProvider> : null} - {/* {popBtn && visible ? <PopviewController btn={popBtn} handleBack={this.handleBack}/> : null} */} + {popBtn && visible ? <PopviewController btn={popBtn} handleBack={this.handleBack}/> : null} <StyleController /> <StyleCombController /> <ModalController /> -- Gitblit v1.8.0