Commit f3704454 authored by Gwofoo's avatar Gwofoo

完善 大屏点击后只登录一次

parent 1c0a81d9
...@@ -20,10 +20,10 @@ const { ...@@ -20,10 +20,10 @@ const {
export const UrlConsts = { export const UrlConsts = {
deleteAgency: (url) => completePrefix(baseURI, 'atl/agency/relation/{agencyCode}/{sequenceNbrs}'), deleteAgency: (url) => completePrefix(gateWay.atl, 'agency/relation/{agencyCode}/{sequenceNbrs}'),
// exportAgency: (url) => completePrefix(baseURI, 'atl/agency/export/{agencyCode}/{sequenceNbrs}'), // exportAgency: (url) => completePrefix(baseURI, 'atl/agency/export/{agencyCode}/{sequenceNbrs}'),
exportAgency: (url) => completePrefix(baseURI, 'atl/agency/export/{agencyCode}/{ipSeq}/{sequenceNbrs}'), exportAgency: (url) => completePrefix()(gateWay.atl, 'agency/export/{agencyCode}/{ipSeq}/{sequenceNbrs}'),
generateSqlUrl: url => completePrefix(baseURI, 'atl/v1/dataApi/generateSQL'), // 通用导出SQL脚本 get generateSqlUrl: url => completePrefix(gateWay.atl, 'v1/dataApi/generateSQL'), // 通用导出SQL脚本 get
getSortSencesUrl: () => completePrefix()(gateWay.atl, 'scene/select/all'), // 查询场景案例列表 get getSortSencesUrl: () => completePrefix()(gateWay.atl, 'scene/select/all'), // 查询场景案例列表 get
getSceneLoginTokenUrl: () => 'atl/forward' // 查询场景案例大屏被点击后的登录token get getSceneLoginTokenUrl: () => 'atl/forward' // 查询场景案例大屏被点击后的登录token get
// getSceneLoginTokenUrl: () => completePrefix(gateWay.atl, 'forward') // 查询场景案例大屏被点击后的登录token get // getSceneLoginTokenUrl: () => completePrefix(gateWay.atl, 'forward') // 查询场景案例大屏被点击后的登录token get
...@@ -47,7 +47,7 @@ export const templateDownload = (params) => { ...@@ -47,7 +47,7 @@ export const templateDownload = (params) => {
* 导出机构 * 导出机构
*/ */
export const exportByAgencyCode = (agencyCode, ipSeq, sequenceNbrs) => { export const exportByAgencyCode = (agencyCode, ipSeq, sequenceNbrs) => {
return fileDownload({ url: formatUrl(UrlConsts.exportAgency(), { agencyCode, ipSeq, sequenceNbrs }) }); return fileDownload({ url: formatUrl(UrlConsts.exportAgency(), { agencyCode, ipSeq, sequenceNbrs }) });
}; };
/** /**
......
...@@ -19,7 +19,10 @@ import { LocationParam } from 'amos-tool'; ...@@ -19,7 +19,10 @@ import { LocationParam } from 'amos-tool';
// appSeq: '1688479372626911235', // appSeq: '1688479372626911235',
// mqttUrl: 'ws://172.16.3.18:8088/mqtt', // mqttUrl: 'ws://172.16.3.18:8088/mqtt',
// type: 'exportAgency', // type: 'exportAgency',
// position: 'header' // position: 'header',
// agencyCode: 'SUPER_ADMIN',
// ipSeq: '1731962333659037697'
} }
}) })
class DownloadView extends Component { class DownloadView extends Component {
...@@ -49,6 +52,10 @@ class DownloadView extends Component { ...@@ -49,6 +52,10 @@ class DownloadView extends Component {
let ipSeq = null; let ipSeq = null;
let agencyCode = null; let agencyCode = null;
let sequenceNbrs = null; let sequenceNbrs = null;
// 调试用
// selectedRowKeys = ['1', '2'];
switch (dataConfig.type) { switch (dataConfig.type) {
case 'deleteAgency': case 'deleteAgency':
agencyCode = LocationParam.getLocationParamByName('agencyCode'); agencyCode = LocationParam.getLocationParamByName('agencyCode');
...@@ -142,12 +149,12 @@ class DownloadView extends Component { ...@@ -142,12 +149,12 @@ class DownloadView extends Component {
<div> <div>
{dataConfig.position === 'header' ? {dataConfig.position === 'header' ?
<div className="ig-stage-toolbar-right"> <div className="ig-stage-toolbar-right">
<BarGroup label="导出脚本" mode="none" position="right"> <BarGroup label="导出脚本 默认" mode="none" position="right">
<IconButton colorful icon="export" title="导出SQL脚本" style={{ borderRadius: 4 }} onClick={() => this.handleItemClick()} /> <IconButton colorful icon="export" title="导出SQL脚本" style={{ borderRadius: 4 }} onClick={() => this.handleItemClick()} />
</BarGroup> </BarGroup>
</div> </div>
: :
<p onClick={this.handleItemClick}><Icon icon="download" />下载</p>} <p onClick={this.handleItemClick}><Icon icon="download" />默认下载</p>}
<ExecuteProgress visible={logsVisible} mqttUrl={dataConfig.mqttUrl} exeId={selectId} onClose={() => this.handleClose('logsVisible')} /> <ExecuteProgress visible={logsVisible} mqttUrl={dataConfig.mqttUrl} exeId={selectId} onClose={() => this.handleClose('logsVisible')} />
</div> </div>
); );
......
...@@ -86,14 +86,24 @@ class Scene extends Component { ...@@ -86,14 +86,24 @@ class Scene extends Component {
handleClick = (templateLink) => { handleClick = (templateLink) => {
const { token } = this.state; const { token } = this.state;
if (!token){ if (!token) {
getSceneLoginToken().then(d => { getSceneLoginToken().then(d => {
this.setState({ this.setState(
token: d {
}); token: d
},
() => {
window.open(templateLink + "&token=" + this.state.token);
}
);
})
.catch(e => {
window.open(templateLink);
}); });
} }
window.open(templateLink + "&token=" + token); else {
window.open(templateLink + "&token=" + token);
}
} }
renderListCards = (cardItems) => { renderListCards = (cardItems) => {
...@@ -101,7 +111,7 @@ class Scene extends Component { ...@@ -101,7 +111,7 @@ class Scene extends Component {
for (let i = 0; i < cardItems.length; i += 4) { for (let i = 0; i < cardItems.length; i += 4) {
const rowItems = cardItems.slice(i, i + 4); const rowItems = cardItems.slice(i, i + 4);
const cols = rowItems.map((item, index) => ( const cols = rowItems.map((cardItems, index) => (
<Col span={6} key={index}> <Col span={6} key={index}>
<div style={{ margin: 15, display: 'flex', justifyContent: 'center' }}> <div style={{ margin: 15, display: 'flex', justifyContent: 'center' }}>
<button style={{ width: '100%', height: '100%', border: 0, padding: 0 }} onClick={() => this.handleClick(cardItems.templateLink)}> <button style={{ width: '100%', height: '100%', border: 0, padding: 0 }} onClick={() => this.handleClick(cardItems.templateLink)}>
...@@ -110,10 +120,10 @@ class Scene extends Component { ...@@ -110,10 +120,10 @@ class Scene extends Component {
<img alt="example" width="100%" height="100%" style={{ objectFit: 'cover', borderRadius: 10 }} src={cardItems.sketch} /> <img alt="example" width="100%" height="100%" style={{ objectFit: 'cover', borderRadius: 10 }} src={cardItems.sketch} />
</div> </div>
<div style={{ padding: '10px 0px 10px 80px' }}> <div style={{ padding: '10px 0px 10px 80px' }}>
<h2 style={{ textAlign: 'left', margin: 0 }}>{item.templateName}</h2> <h2 style={{ textAlign: 'left', margin: 0 }}>{cardItems.templateName}</h2>
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<p style={{ textAlign: 'left', marginTop: '5px', fontSize: '16px' }}> <p style={{ textAlign: 'left', marginTop: '5px', fontSize: '16px' }}>
{item.agencyName} | 热度指数:{item.viewTimes} {cardItems.agencyName} | 热度指数:{cardItems.viewTimes}
</p> </p>
</div> </div>
</div> </div>
......
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