提交 2db1ce5d authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

...@@ -5,7 +5,8 @@ import React, {Component} from 'react'; ...@@ -5,7 +5,8 @@ import React, {Component} from 'react';
import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom'; import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom';
import { getModal, getPopconfirm, isFromIframe } from '@/webPublic/one_stop_public/utils/utils'; import { getModal, getPopconfirm, isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer'); // const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer');
const FileViewer = null;
const Modal = getModal(); const Modal = getModal();
const Popconfirm = getPopconfirm(); const Popconfirm = getPopconfirm();
...@@ -130,12 +131,12 @@ export default class index extends Component { ...@@ -130,12 +131,12 @@ export default class index extends Component {
<a onClick={this.download}> <a onClick={this.download}>
下载文件 下载文件
</a> </a>
{FileViewer && ( {/* {FileViewer && (
<FileViewer <FileViewer
fileType={type} fileType={type}
filePath={path} filePath={path}
/> />
)} )}*/}
</div> </div>
)} )}
</Modal> </Modal>
......
...@@ -6,6 +6,7 @@ import styles from "./style.less"; ...@@ -6,6 +6,7 @@ import styles from "./style.less";
import { checkIsImage } from "./UploadCom"; import { checkIsImage } from "./UploadCom";
import Viewer from "react-viewer"; import Viewer from "react-viewer";
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { getHeaders } from '@/webPublic/zyd_public/utils/utils';
// 为黔南职院单独写的 上传组件 用于 bug 20576 个人就业信息/求职创业补贴申报,201801010006 119242 上传图片加限制,跟签约派遣上传图片加限制一样 // 为黔南职院单独写的 上传组件 用于 bug 20576 个人就业信息/求职创业补贴申报,201801010006 119242 上传图片加限制,跟签约派遣上传图片加限制一样
...@@ -101,6 +102,7 @@ export default class UploadComDiyForQnZy extends React.Component { ...@@ -101,6 +102,7 @@ export default class UploadComDiyForQnZy extends React.Component {
name: "file", name: "file",
multiple: isMultiple, multiple: isMultiple,
accept: accept, accept: accept,
...getHeaders(),
action: config.uploadUrl, action: config.uploadUrl,
showUploadList: false, showUploadList: false,
onChange: this.changeUrl, onChange: this.changeUrl,
......
...@@ -8,6 +8,7 @@ import { delCookie, setCookie } from '@/webPublic/one_stop_public/utils/cookie'; ...@@ -8,6 +8,7 @@ import { delCookie, setCookie } from '@/webPublic/one_stop_public/utils/cookie';
export function setToken(value, time) { export function setToken(value, time) {
if (getToken() !== value) { if (getToken() !== value) {
setCookie('token', value); setCookie('token', value);
sessionStorage.removeItem('cacheMobile');
localStorage.setItem('antd-pro-token-onestop', value); localStorage.setItem('antd-pro-token-onestop', value);
localStorage.setItem('antd-pro-token', value); localStorage.setItem('antd-pro-token', value);
localStorage.setItem('wisdom-school-token', value); localStorage.setItem('wisdom-school-token', value);
......
/**
*
* 一站式请勿使用此组件
* 2020年5月9日 拖拽组件
* 钟是志
* 黔南的 录取通知书打印 位置设置
* */
import React, { Fragment, Component } from 'react';
import styles from './index.less';
import { message } from 'antd';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '@/baseComponent/Shell';
import { ModalConfirm } from '@/baseComponent/Modal';
let startX = 0;
let startY = 0;
export default class FormatSetting extends Component {
constructor() {
super();
document.onmousedown = function(evt) {
startX = evt.offsetX;
startY = evt.offsetY;
};
}
dragEventList = () => {
const { updateFormatSettingObject } = this.props;
let draggedRef = null;
document.addEventListener(
'dragstart',
function(event) {
// 保存拖动元素的引用(ref.)
draggedRef = event.target;
// 使其半透明
event.target.style.opacity = 0.5;
},
false,
);
document.addEventListener(
'dragend',
function(event) {
// 重置透明度
event.target.style.opacity = '';
},
false,
);
/* 放下目标节点时触发事件 */
document.addEventListener(
'dragover',
function(event) {
// 阻止默认动作
event.preventDefault();
},
false,
);
document.addEventListener(
'drop',
function(event) {
// 阻止默认动作(如打开一些元素的链接)
event.preventDefault();
// 将拖动的元素到所选择的放置目标节点中
let infoClientRect = document.getElementById('dropZone').getBoundingClientRect();
let leftNew = Math.ceil(event.clientX - infoClientRect.left) - startX;
let topNew = Math.ceil(event.clientY - infoClientRect.top) - startY;
if (
leftNew < 0 ||
leftNew > infoClientRect.width ||
topNew < 0 ||
topNew > infoClientRect.height
) {
message.warn('拖拽到了图片区域外部!');
return false;
} else {
console.log(leftNew, topNew);
}
if (event.target.id === 'dropZone') {
// const left = event.offsetX;
// const top = event.offsetY;
updateFormatSettingObject(draggedRef.id, leftNew, topNew);
draggedRef.style.left = leftNew; // `${left}px`;
draggedRef.style.top = topNew; // `${top}px`;
}
},
false,
);
};
componentDidMount() {
this.dragEventList();
}
initConfig = () => {
ModalConfirm('您确定初始化打印录取通知书格式吗?', {
onOk: () => {
this.props.initConfig();
},
});
};
render() {
const { bgImage, formatSettingObject, saveConfig } = this.props;
return (
<Fragment>
<Shell
styleShell={{
marginTop: '0',
marginBottom: '20px',
}}>
<div
style={{
height: '54px',
padding: '12px 0 12px 12px',
}}>
<ButtonDiy name="保存" className="primary" handleClick={saveConfig} />
<ButtonDiy name={'初始化格式'} handleClick={this.initConfig} />
</div>
</Shell>
<div className={styles.outSideDiv}>
<div>
<img
src={bgImage}
id={'dropZone'}
draggable={false}
className={styles.bgimage}
alt={'背景图'}
/>
{formatSettingObject.map((x, index) => {
return (
<div
draggable={true}
className={styles.inSideItem}
key={index}
id={x.name}
style={x.style}>
{x.name}
</div>
);
})}
</div>
</div>
</Fragment>
);
}
}
/***
* formatSettingObject: {
* content_set: {
* font: "宋体"
isNeedConfig: true
key: "JjqCiRYamxs"
name: "content_set"
size: "12"
style: {top: 300, left: 50}
title: "--详细内容--"
* }
* }
*
* */
...@@ -148,8 +148,8 @@ export default function request( ...@@ -148,8 +148,8 @@ export default function request(
} }
const defaultOptions = { const defaultOptions = {
// credentials: 'omit', // credentials: 'omit', // 确保浏览器不在请求中包含凭据
credentials: 'include', credentials: 'include', // 为了让浏览器发送包含凭据的请求(即使是跨域源)
mode: 'cors', mode: 'cors',
}; };
let newOptions = { ...defaultOptions, ...options }; let newOptions = { ...defaultOptions, ...options };
......
...@@ -38,9 +38,10 @@ export const valueTypes = { ...@@ -38,9 +38,10 @@ export const valueTypes = {
}, // 编辑时,转换成可以在表单回显的格式 }, // 编辑时,转换成可以在表单回显的格式
render: (val) => { render: (val) => {
// 在列表上的显示方式 // 在列表上的显示方式
return JSON.parse(val).map((item, i) => ( return JSON.parse(val)
.map((item, i) => (
<> <>
{i > 0 && <Divider type="vertical" />} {i > 0 && <Divider type="vertical"/>}
<a <a
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
...@@ -59,7 +60,8 @@ export const valueTypes = { ...@@ -59,7 +60,8 @@ export const valueTypes = {
}; };
export function getSysConfig() { export function getSysConfig() {
return getInfo({ pageSize: 10000 }, '/WebConfigApi/getPage?oauthPub=true').then((res) => { return getInfo({ pageSize: 10000 }, '/WebConfigApi/getPage?oauthPub=true')
.then((res) => {
if (res && res.rows && res.rows.length) { if (res && res.rows && res.rows.length) {
const formattered = res.rows.reduce((acc, cur) => { const formattered = res.rows.reduce((acc, cur) => {
console.log(valueTypes, cur.valueType); console.log(valueTypes, cur.valueType);
...@@ -79,14 +81,15 @@ export function getSysConfig() { ...@@ -79,14 +81,15 @@ export function getSysConfig() {
} }
}); });
} }
export default async function setTokenAndInitSystem() {
export default function setTokenAndInitSystem() {
let token = getUrlInfo().token; let token = getUrlInfo().token;
if (token && token.length > 10 && getToken() !== token) { if (token && token.length > 10 && getToken() !== token) {
setToken(token); return new Promise((resolve, reject) => {
} resolve(Promise.all([setToken(token), getSysConfig(), getOneStopConfig()]));
if (!getSysConfigLocalStorage()) { });
getSysConfig();
} }
getOneStopConfig(); return new Promise((resolve, reject) => {
resolve(true);
});
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论