Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe_web
This commit is contained in:
commit
e3fd214f4a
@ -1,7 +1,7 @@
|
|||||||
import { message } from "antd/lib/index";
|
import { message } from "antd/lib/index";
|
||||||
import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal, Spin } from 'antd';
|
import { Button, Popconfirm, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader, Modal, Spin } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common";
|
import { initFilter, extendRule, extendInclude, extendSelectField, guid, initQueryFilter } from "../../../utils/common";
|
||||||
import ReactToPrint from "react-to-print";
|
import ReactToPrint from "react-to-print";
|
||||||
import styles from '../../CustomPages/HI/StepForm.css';
|
import styles from '../../CustomPages/HI/StepForm.css';
|
||||||
import SEstyles from './SE.css';
|
import SEstyles from './SE.css';
|
||||||
@ -55,12 +55,19 @@ class SE061PaperPage extends React.Component {
|
|||||||
this.props.data.onCancel();
|
this.props.data.onCancel();
|
||||||
}
|
}
|
||||||
getUsers = (dataid) => {
|
getUsers = (dataid) => {
|
||||||
debugger
|
|
||||||
let json = initFilter(this.props.login.OrgId);
|
let json = initFilter(this.props.login.OrgId);
|
||||||
|
json.Parameter22 = this.props.data.ORG_ID_HV;
|
||||||
json.OrgType = 2;
|
json.OrgType = 2;
|
||||||
// extendRule(json, 'RECORD_ID', 1, this.props.data.id);
|
// extendRule(json, 'RECORD_ID', 1, this.props.data.id);
|
||||||
extendRule(json, 'RECORD_ID', 1, dataid);
|
if (this.props.data.TaskID) {
|
||||||
|
extendRule(json, 'TEXT_ID', 1, dataid);//RECORD_ID 这个是哪里的 考试
|
||||||
|
} else {
|
||||||
|
extendRule(json, 'RECORD_ID', 1, dataid);// 标准化执行 > 安全教育与培训 > 新三级安全教育记录 小眼睛 查看 有数据
|
||||||
|
}
|
||||||
extendInclude(json, 'Nav_User');
|
extendInclude(json, 'Nav_User');
|
||||||
|
extendSelectField(json, 'Nav_User.ID');
|
||||||
|
extendSelectField(json, 'Nav_User.NAME');
|
||||||
|
extendSelectField(json, 'Nav_User.CODE');
|
||||||
this.state.loading = true;
|
this.state.loading = true;
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: 'app/getDataByPost',
|
type: 'app/getDataByPost',
|
||||||
@ -107,15 +114,23 @@ class SE061PaperPage extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let json = initFilter(this.props.login.OrgId, '', 'Nav_Test.TYPE', 1);
|
let json = initFilter(this.props.login.OrgId, '', 'Nav_Test.TYPE', 1);
|
||||||
|
json.Parameter22 = this.props.data.ORG_ID_HV;
|
||||||
json.OrgType = 2;
|
json.OrgType = 2;
|
||||||
extendRule(json, 'RECORD_ID', 1, this.props.data.id);
|
// extendRule(json, 'TEXT_ID', 1, this.props.data.id);//RECORD_ID 这个是哪个页面 考试
|
||||||
|
// extendRule(json, 'RECORD_ID', 1, this.props.data.id);// dataid 标准化执行 > 安全教育与培训 > 新三级安全教育记录 小眼睛 查看 有数据
|
||||||
|
|
||||||
|
if (this.props.data.TaskID) {
|
||||||
|
extendRule(json, 'TEXT_ID', 1, this.props.data.id);//RECORD_ID 这个是哪里的 考试
|
||||||
|
} else {
|
||||||
|
extendRule(json, 'RECORD_ID', 1, this.props.data.id);// 标准化执行 > 安全教育与培训 > 新三级安全教育记录 小眼睛 查看 有数据
|
||||||
|
}
|
||||||
|
|
||||||
extendRule(json, 'USER_ID', 1, SelUsrID);
|
extendRule(json, 'USER_ID', 1, SelUsrID);
|
||||||
extendInclude(json, 'Nav_Record');
|
extendInclude(json, 'Nav_Record');
|
||||||
|
|
||||||
extendInclude(json, 'Nav_Test');
|
extendInclude(json, 'Nav_Test');
|
||||||
extendInclude(json, 'Nav_User');
|
extendInclude(json, 'Nav_User');
|
||||||
|
extendInclude(json, 'Nav_Text');
|
||||||
this.state.loading = true;
|
this.state.loading = true;
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: 'app/getDataByPost',
|
type: 'app/getDataByPost',
|
||||||
@ -130,11 +145,17 @@ class SE061PaperPage extends React.Component {
|
|||||||
let notify = record ? record.Nav_Notify : null;
|
let notify = record ? record.Nav_Notify : null;
|
||||||
let NAME = record.NAME;
|
let NAME = record.NAME;
|
||||||
let hasAnswered = false;
|
let hasAnswered = false;
|
||||||
|
if (!this.props.data.TaskID) {
|
||||||
|
hasAnswered = true;
|
||||||
|
}
|
||||||
|
if (!hasAnswered) {
|
||||||
for (let i = 0; i < ret.Nav_Papers.length; i++) {
|
for (let i = 0; i < ret.Nav_Papers.length; i++) {
|
||||||
if (ret.Nav_Papers[i].ANSWER !== 0) {
|
if (ret.Nav_Papers[i].ANSWER !== 0) {
|
||||||
hasAnswered = true;
|
hasAnswered = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
papers,
|
papers,
|
||||||
config,
|
config,
|
||||||
@ -153,8 +174,25 @@ class SE061PaperPage extends React.Component {
|
|||||||
loadData = (dataid) => {
|
loadData = (dataid) => {
|
||||||
if (this.props.data.id == "")
|
if (this.props.data.id == "")
|
||||||
return;
|
return;
|
||||||
|
// this.getUsers(dataid);
|
||||||
|
//如果是待办进来 不要 getUsers 直接获取登录者的试卷进行答题
|
||||||
|
if (this.props.data.TaskID && (this.props.data.tableKey == '1' || this.props.data.tableKey == '2')) {
|
||||||
|
var UserList = []
|
||||||
|
UserList.push({
|
||||||
|
ID: this.props.login.user.ID,
|
||||||
|
CODE: this.props.login.user.CODE,
|
||||||
|
NAME: this.props.login.user.NAME,
|
||||||
|
})
|
||||||
|
this.setState({
|
||||||
|
SelUsrID: this.props.login.user.ID,
|
||||||
|
UserList: UserList
|
||||||
|
}, () => {
|
||||||
|
this.getPapers();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
this.getUsers(dataid);
|
this.getUsers(dataid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onSave = () => {
|
onSave = () => {
|
||||||
if (this.state.readonly) {
|
if (this.state.readonly) {
|
||||||
return;
|
return;
|
||||||
@ -175,8 +213,10 @@ class SE061PaperPage extends React.Component {
|
|||||||
Nav_Config: JSON.parse(JSON.stringify(this.state.config)),
|
Nav_Config: JSON.parse(JSON.stringify(this.state.config)),
|
||||||
Nav_Papers: JSON.parse(JSON.stringify(this.state.papers)),
|
Nav_Papers: JSON.parse(JSON.stringify(this.state.papers)),
|
||||||
TaskID: this.props.data.TaskID,
|
TaskID: this.props.data.TaskID,
|
||||||
|
TEXT_ID: this.props.data.id,
|
||||||
ORG_ID: this.props.login.OrgId,
|
ORG_ID: this.props.login.OrgId,
|
||||||
}
|
}
|
||||||
|
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: 'app/getDataByPost',
|
type: 'app/getDataByPost',
|
||||||
payload: data,
|
payload: data,
|
||||||
@ -185,6 +225,11 @@ class SE061PaperPage extends React.Component {
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
message.success('提交成功');
|
message.success('提交成功');
|
||||||
this.BtnClose();
|
this.BtnClose();
|
||||||
|
} else if (ret === false) {
|
||||||
|
//请重新考试
|
||||||
|
setTimeout(() => {
|
||||||
|
this.props.data.onCancel();
|
||||||
|
}, 3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -269,10 +314,18 @@ class SE061PaperPage extends React.Component {
|
|||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//分数计算
|
||||||
CalcScore = () => {
|
CalcScore = () => {
|
||||||
if (!this.state.readonly) {
|
if (!this.state.readonly) {
|
||||||
return "";
|
return "";
|
||||||
}
|
} else if (this.state.papers == null || this.state.papers.length < 1) {
|
||||||
|
return "";
|
||||||
|
} else if (this.state.papers[0].Nav_Text != null) {
|
||||||
|
//新增表单 有存分数 后台排序 最后的显示在最前面
|
||||||
|
return this.state.papers[0].Nav_Text.SCORE ? this.state.papers[0].Nav_Text.SCORE : "";
|
||||||
|
} else {
|
||||||
|
//按理不能来这边
|
||||||
let score = 0;
|
let score = 0;
|
||||||
let sscore = 1;
|
let sscore = 1;
|
||||||
let mscore = 1;
|
let mscore = 1;
|
||||||
@ -308,6 +361,7 @@ class SE061PaperPage extends React.Component {
|
|||||||
})
|
})
|
||||||
return score;
|
return score;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
getType(type) {
|
getType(type) {
|
||||||
let ret = '';
|
let ret = '';
|
||||||
const { config } = this.state
|
const { config } = this.state
|
||||||
@ -394,19 +448,19 @@ class SE061PaperPage extends React.Component {
|
|||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 0 ?
|
it.Nav_Test.TYPE === 0 ?
|
||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} >正确</Radio>
|
||||||
<span>正确</span>
|
{/* <span></span> */}
|
||||||
</td>
|
</td>
|
||||||
:
|
:
|
||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 1) != 0) ? styles.answer : null}>
|
||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 1 ?
|
it.Nav_Test.TYPE === 1 ?
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} >A.{it.Nav_Test.OPTION_A}</Radio>
|
||||||
:
|
:
|
||||||
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} />
|
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 1) != 0} onChange={evt => this.doOptionChange(it, idx, 1, evt)} >A.{it.Nav_Test.OPTION_A}</Checkbox>
|
||||||
}
|
}
|
||||||
<span>A.</span>
|
{/* <span>A.</span>
|
||||||
<span>{it.Nav_Test.OPTION_A}</span>
|
<span>{it.Nav_Test.OPTION_A}</span> */}
|
||||||
</td>
|
</td>
|
||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
@ -414,19 +468,19 @@ class SE061PaperPage extends React.Component {
|
|||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 0 ?
|
it.Nav_Test.TYPE === 0 ?
|
||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} >错误</Radio>
|
||||||
<span>错误</span>
|
{/* <span>错误</span> */}
|
||||||
</td>
|
</td>
|
||||||
:
|
:
|
||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 2) != 0) ? styles.answer : null}>
|
||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 1 ?
|
it.Nav_Test.TYPE === 1 ?
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} >B.{it.Nav_Test.OPTION_B}</Radio>
|
||||||
:
|
:
|
||||||
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} />
|
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 2) != 0} onChange={evt => this.doOptionChange(it, idx, 2, evt)} >B.{it.Nav_Test.OPTION_B}</Checkbox>
|
||||||
}
|
}
|
||||||
<span>B.</span>
|
{/* <span>B.</span>
|
||||||
<span>{it.Nav_Test.OPTION_B}</span>
|
<span>{it.Nav_Test.OPTION_B}</span> */}
|
||||||
</td>
|
</td>
|
||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
@ -436,12 +490,12 @@ class SE061PaperPage extends React.Component {
|
|||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 4) != 0) ? styles.answer : null}>
|
||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 1 ?
|
it.Nav_Test.TYPE === 1 ?
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} >C.{it.Nav_Test.OPTION_C}</Radio>
|
||||||
:
|
:
|
||||||
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} />
|
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 4) != 0} onChange={evt => this.doOptionChange(it, idx, 4, evt)} >C.{it.Nav_Test.OPTION_C}</Checkbox>
|
||||||
}
|
}
|
||||||
<span>C.</span>
|
{/* <span>C.</span>
|
||||||
<span>{it.Nav_Test.OPTION_C}</span>
|
<span>{it.Nav_Test.OPTION_C}</span> */}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@ -451,12 +505,12 @@ class SE061PaperPage extends React.Component {
|
|||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 8) != 0) ? styles.answer : null}>
|
||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 1 ?
|
it.Nav_Test.TYPE === 1 ?
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} >D.{it.Nav_Test.OPTION_D}</Radio>
|
||||||
:
|
:
|
||||||
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} />
|
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 8) != 0} onChange={evt => this.doOptionChange(it, idx, 8, evt)} >D.{it.Nav_Test.OPTION_D}</Checkbox>
|
||||||
}
|
}
|
||||||
<span>D.</span>
|
{/* <span>D.</span>
|
||||||
<span>{it.Nav_Test.OPTION_D}</span>
|
<span>{it.Nav_Test.OPTION_D}</span> */}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@ -466,12 +520,12 @@ class SE061PaperPage extends React.Component {
|
|||||||
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? styles.answer : null}>
|
<td colSpan={24} rowSpan={1} className={this.state.readonly && ((it.Nav_Test.ANSWER & 16) != 0) ? styles.answer : null}>
|
||||||
{
|
{
|
||||||
it.Nav_Test.TYPE === 1 ?
|
it.Nav_Test.TYPE === 1 ?
|
||||||
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
|
<Radio disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} >E.{it.Nav_Test.OPTION_E}</Radio>
|
||||||
:
|
:
|
||||||
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} />
|
<Checkbox disabled={this.state.readonly} checked={(it.ANSWER & 16) != 0} onChange={evt => this.doOptionChange(it, idx, 16, evt)} >E.{it.Nav_Test.OPTION_E}</Checkbox>
|
||||||
}
|
}
|
||||||
<span>E.</span>
|
{/* <span>E.</span>
|
||||||
<span>{it.Nav_Test.OPTION_E}</span>
|
<span>{it.Nav_Test.OPTION_E}</span> */}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { message } from "antd/lib/index";
|
import { message } from "antd/lib/index";
|
||||||
import { Button, Descriptions, Modal, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader } from 'antd';
|
import { Button, Descriptions, Modal, Row, Col, Checkbox, Radio, Form, Input, Select, Table, Upload, Icon, PageHeader } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { initFilter, extendRule, extendInclude, GetFileModel, guid, initQueryFilter, showFiles } from "../../../utils/common";
|
import { initFilter, extendRule, extendInclude, GetFileModel, guid, getArryPropShow, showFiles } from "../../../utils/common";
|
||||||
import ReactToPrint from "react-to-print";
|
import ReactToPrint from "react-to-print";
|
||||||
import styles from '../../CustomPages/HI/StepForm.css';
|
import styles from '../../CustomPages/HI/StepForm.css';
|
||||||
import XLSX from 'xlsx';
|
import XLSX from 'xlsx';
|
||||||
@ -48,6 +48,7 @@ class SE062ShowPrint extends React.Component {
|
|||||||
extendInclude(json, 'Nav_NewUser.Nav_User');
|
extendInclude(json, 'Nav_NewUser.Nav_User');
|
||||||
extendInclude(json, 'Nav_NewUser.Nav_Content');
|
extendInclude(json, 'Nav_NewUser.Nav_Content');
|
||||||
extendInclude(json, 'Nav_NewUser.Nav_Files.Nav_ImgFile');
|
extendInclude(json, 'Nav_NewUser.Nav_Files.Nav_ImgFile');
|
||||||
|
extendInclude(json, 'Nav_NewUser.Nav_Teachers.Nav_User');
|
||||||
|
|
||||||
extendInclude(json, 'Nav_User');
|
extendInclude(json, 'Nav_User');
|
||||||
extendInclude(json, 'Nav_Department');
|
extendInclude(json, 'Nav_Department');
|
||||||
@ -120,6 +121,7 @@ class SE062ShowPrint extends React.Component {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { data } = this.state;
|
const { data } = this.state;
|
||||||
const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums;
|
const enums = this.props.data.enums ? this.props.data.enums : this.props.app.enums;
|
||||||
@ -144,8 +146,10 @@ class SE062ShowPrint extends React.Component {
|
|||||||
<Descriptions.Item label="截止时间">{data ? data.Nav_NewUser.END_TIME : null}</Descriptions.Item>
|
<Descriptions.Item label="截止时间">{data ? data.Nav_NewUser.END_TIME : null}</Descriptions.Item>
|
||||||
<Descriptions.Item label="培训学时">{data ? data.Nav_NewUser.TRAINNING_TIME : null}</Descriptions.Item>
|
<Descriptions.Item label="培训学时">{data ? data.Nav_NewUser.TRAINNING_TIME : null}</Descriptions.Item>
|
||||||
<Descriptions.Item label="培训地点">{data ? data.Nav_NewUser.TAINNING_ADDR : null}</Descriptions.Item>
|
<Descriptions.Item label="培训地点">{data ? data.Nav_NewUser.TAINNING_ADDR : null}</Descriptions.Item>
|
||||||
<Descriptions.Item label="培训老师">{data ? data.Nav_NewUser.TEACHER : null}</Descriptions.Item>
|
{/* <Descriptions.Item label="培训老师">{data ? data.Nav_NewUser.TEACHER : null}</Descriptions.Item> */}
|
||||||
<Descriptions.Item label="培训形式">{data ? this.returnModel(data.Nav_NewUser.TRAIN_MODEL) : null}</Descriptions.Item>
|
<Descriptions.Item label="培训老师">{getArryPropShow(data.Nav_NewUser.Nav_Teachers, "Nav_User.NAME")}</Descriptions.Item>
|
||||||
|
{/* <Descriptions.Item label="培训形式">{data ? this.returnModel(data.Nav_NewUser.TRAIN_MODEL) : null}</Descriptions.Item> */}
|
||||||
|
<Descriptions.Item label="培训形式">{enums.TrainType.enums[data.Nav_NewUser?.TRAINTYPE]}</Descriptions.Item>
|
||||||
<Descriptions.Item label="培训内容" span="3">{data && data.Nav_NewUser.Nav_Content ? data.Nav_NewUser.Nav_Content.NAME : ''}</Descriptions.Item>
|
<Descriptions.Item label="培训内容" span="3">{data && data.Nav_NewUser.Nav_Content ? data.Nav_NewUser.Nav_Content.NAME : ''}</Descriptions.Item>
|
||||||
<Descriptions.Item label="附件">{showFiles(data.Nav_NewUser.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
<Descriptions.Item label="附件">{showFiles(data.Nav_NewUser.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
@ -163,7 +167,7 @@ class SE062ShowPrint extends React.Component {
|
|||||||
<Descriptions.Item label="分数">{data ? data.SCORE : null}</Descriptions.Item>
|
<Descriptions.Item label="分数">{data ? data.SCORE : null}</Descriptions.Item>
|
||||||
{/* <Descriptions.Item label="考核结果">{data ? data.EXAMINATION_RESULTS == 1 ? "合格" : "不合格" : null}</Descriptions.Item> */}
|
{/* <Descriptions.Item label="考核结果">{data ? data.EXAMINATION_RESULTS == 1 ? "合格" : "不合格" : null}</Descriptions.Item> */}
|
||||||
<Descriptions.Item label="考核结果">{(data && data.EXAMINATION_RESULTS && data.SCORE) ? enums.SEExaminationResultsEnum.enums[data.EXAMINATION_RESULTS] : ""}</Descriptions.Item>
|
<Descriptions.Item label="考核结果">{(data && data.EXAMINATION_RESULTS && data.SCORE) ? enums.SEExaminationResultsEnum.enums[data.EXAMINATION_RESULTS] : ""}</Descriptions.Item>
|
||||||
<Descriptions.Item label="培训形式">{data ? this.returnModel(data.Nav_NewUser.TRAIN_MODEL) : null}</Descriptions.Item>
|
{/* <Descriptions.Item label="培训形式">{data ? this.returnModel(data.Nav_NewUser.TRAIN_MODEL) : null}</Descriptions.Item> */}
|
||||||
<Descriptions.Item label="附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
<Descriptions.Item label="附件">{showFiles(data.Nav_Files, config.picServerHost, this)}</Descriptions.Item>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</div> : null
|
</div> : null
|
||||||
|
|||||||
467
src/files/edit/PF147 copy.js
Normal file
467
src/files/edit/PF147 copy.js
Normal file
@ -0,0 +1,467 @@
|
|||||||
|
import React, { useEffect, useState } from 'react'
|
||||||
|
import { message, Checkbox, Radio } from "antd/lib/index";
|
||||||
|
import { getPropertyData, guid, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, empty, onBeforeSaveHandleRecordLog, Format } from "../../utils/common";
|
||||||
|
import { connect } from 'dva';
|
||||||
|
import moment from 'moment';
|
||||||
|
import config from "../../config.js"
|
||||||
|
import { Button, Row, Col, Form, Input, Upload, Icon, Modal, Spin } from 'antd';
|
||||||
|
import storage from '../../utils/storage'
|
||||||
|
import MD5 from "js-md5"
|
||||||
|
// import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js";
|
||||||
|
/**
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
// 编辑 事故事件调查结果填报
|
||||||
|
export default {
|
||||||
|
|
||||||
|
onBeforeEdit: ({ isNew, login, stateData, data, setFieldEditable, getFieldValue, dispatch, ListCheckRiskArea, setFieldValueByBatch, setFieldVisible, setFieldValue }) => {
|
||||||
|
if (!isNew) {
|
||||||
|
setFieldEditable("CODE", false)
|
||||||
|
if (stateData.NAME != undefined && stateData.NAME != null && stateData.ISLOCAL == true && stateData.NAME.length > 0) {
|
||||||
|
setFieldEditable("Nav_Files", false)
|
||||||
|
}
|
||||||
|
if (stateData.ISLOCAL == false) {
|
||||||
|
setFieldEditable("Nav_Files", false)
|
||||||
|
}
|
||||||
|
// if (stateData.Nav_Files) {
|
||||||
|
// getFieldValue("Nav_Files", stateData.Nav_Files)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
//import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js"; //此处插入 如果直接导入 发布会报错
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.src = 'https://player.polyv.net/resp/vod-upload-js-sdk/latest/vod-upload-js-sdk.min.js';
|
||||||
|
document.body.appendChild(script);
|
||||||
|
},
|
||||||
|
handleRenderHeadControl(params) {
|
||||||
|
if (params.colConfig.field === 'NAME') {
|
||||||
|
var isEditFile = true//默认显示编辑按钮
|
||||||
|
var isShowFile = false//默认文件显示
|
||||||
|
// import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js";
|
||||||
|
|
||||||
|
// const script = document.createElement('script');
|
||||||
|
// script.src = 'https://websdk.videocc.net/vod-upload-js-sdk/latest/vod-upload-js-sdk.min.js';
|
||||||
|
// document.body.appendChild(script);
|
||||||
|
|
||||||
|
//如果显示 本地文件 isShowFile true isEditFile false
|
||||||
|
var p = document.getElementById('upload-info')
|
||||||
|
if (p != null) {
|
||||||
|
p.innerHTML = ' '
|
||||||
|
}
|
||||||
|
if (params.record.ISLOCAL != null && params.record.ISLOCAL == false && params.record.FILE_PATH != null && params.record.FILE_PATH.indexOf('http') > -1) {
|
||||||
|
isShowFile = true
|
||||||
|
isEditFile = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点播上传SDK 本地可以 发布不行
|
||||||
|
const uploadInput = {
|
||||||
|
key: 'fileBlv',
|
||||||
|
type: "file",
|
||||||
|
id: 'file',
|
||||||
|
accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
||||||
|
name: 'file',
|
||||||
|
multiple: true,
|
||||||
|
onChange(info) {
|
||||||
|
let uploadFiles = info.target.files
|
||||||
|
if (uploadFiles.length > 0) {
|
||||||
|
console.log('事件触发58')
|
||||||
|
// let PlvVideoUpload;
|
||||||
|
// try {
|
||||||
|
// PlvVideoUpload = require('@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js');
|
||||||
|
// // PlvVideoUpload = require('@polyv/vod-upload-js-sdk');
|
||||||
|
// } catch (e) {
|
||||||
|
// console.log(e)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// 授权验证信息3分钟内有效,当 sign 过期时需要调用该方法更新
|
||||||
|
const videoUpload = new PlvVideoUpload({
|
||||||
|
region: 'line1', // auto:自动选择。根据IP的地区自动选择,当IP解析不出时使用默认值。
|
||||||
|
// line1(默认值):华南OSS bucket,对应ab-upload.polyv.net。
|
||||||
|
// line2:华北OSS bucket,对应ab-upload2.polyv.net。
|
||||||
|
events: {
|
||||||
|
Error: (err) => { // 错误事件回调
|
||||||
|
message.error(`上传失败!`);
|
||||||
|
},
|
||||||
|
UploadComplete: (infoResult) => {
|
||||||
|
//数据处理
|
||||||
|
|
||||||
|
// message.success(`上传成功`);
|
||||||
|
} // 全部上传任务完成回调
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var userid = params.colConfig.column.VERIFY_MSG
|
||||||
|
var promptInfo = params.colConfig.column.PROMPT_INFO
|
||||||
|
var secretkey = ""
|
||||||
|
var writeToken = "";
|
||||||
|
if (promptInfo && promptInfo.length > 0 && promptInfo.indexOf('|') > -1) {
|
||||||
|
var promptInfoArr = promptInfo.split('|')
|
||||||
|
secretkey = promptInfoArr[0]
|
||||||
|
writeToken = promptInfoArr[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
var ts = (new Date()).getTime()
|
||||||
|
var sign = MD5(secretkey + ts)
|
||||||
|
var hash = MD5(ts + writeToken)
|
||||||
|
videoUpload.updateUserData({
|
||||||
|
userid: userid, // Polyv云点播账号的ID
|
||||||
|
ptime: ts, // 时间戳
|
||||||
|
sign: sign, // <sign>是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
||||||
|
hash: hash, // <hash> 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
||||||
|
});
|
||||||
|
var file = uploadFiles[0]
|
||||||
|
var cataid = '1746673652001'//每个公司对应的文件夹ID不一样 测试环境
|
||||||
|
// "47xlk": 1746673652001 "xlk": 1746673689001, "jd": 1746673724001, "yl": 1746673761001, "bb": 1746674077001, "xt": 1746674428001,
|
||||||
|
if (window.location.href.indexOf('localhost') == -1 && window.location.href.indexOf('47.122') == -1) { //不包含 localhost 正式环境
|
||||||
|
switch (params.record.ORG_ID) {
|
||||||
|
case 'B043B28B-BBC3-C452-6052-4FBA1457ABFA':
|
||||||
|
cataid = '1746673689001'//"xlk": 1746673689001,
|
||||||
|
break
|
||||||
|
case '8F1CF418-8BF3-EA3F-7A6D-FC5D61247008':
|
||||||
|
cataid = '1746674428001'//"xt": 1746674428001,
|
||||||
|
break
|
||||||
|
case 'D9871BA8-0EEC-9E4A-BB87-7D5A540D8913':
|
||||||
|
cataid = '1746673761001'//"yl": 1746673761001
|
||||||
|
break
|
||||||
|
case '8B3C41AA-51B1-7CE9-1879-248A038C1B5C':
|
||||||
|
cataid = '1746673724001'//"jd": 1746673724001
|
||||||
|
break
|
||||||
|
case '3EFD5276-632B-E379-9FF3-7A7546591FCA':
|
||||||
|
cataid = '1746674077001'// "bb": 1746674077001,
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
cataid = '1746673652001'//"47xlk": 1746673652001
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var fileSetting = { // 文件上传相关信息设置
|
||||||
|
title: file.name, // 标题
|
||||||
|
desc: 'jssdk插件上传', // 描述
|
||||||
|
cataid: cataid, // 上传分类目录ID
|
||||||
|
tag: '', // 标签
|
||||||
|
luping: 0, // 是否开启视频课件优化处理,对于上传录屏类视频清晰度有所优化:0为不开启,1为开启
|
||||||
|
keepsource: 0, // 是否源文件播放(不对视频进行编码):0为编码,1为不编码
|
||||||
|
state: '' //用户自定义信息,如果提交了该字段,会在服务端上传完成回调时透传返回。
|
||||||
|
}
|
||||||
|
var html = ''
|
||||||
|
var uploadManager = videoUpload.addFile(
|
||||||
|
file, // file 为待上传的文件对象
|
||||||
|
{
|
||||||
|
FileStarted: function (uploadInfo) { // 文件开始上传回调
|
||||||
|
html = ''
|
||||||
|
document.getElementById('upload-info').innerHTML = ''
|
||||||
|
html += "文件上传开始: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// console.log("文件上传开始: " + uploadInfo.fileData.title);
|
||||||
|
},
|
||||||
|
FileProgress: function (uploadInfo) { // 文件上传过程返回上传进度信息回调
|
||||||
|
html += "文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%' + "<br>"
|
||||||
|
// console.log("文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%');
|
||||||
|
document.getElementById('upload-info').innerHTML = html
|
||||||
|
},
|
||||||
|
FileStopped: function (uploadInfo) { // 文件暂停上传回调
|
||||||
|
html += "文件上传停止: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// console.log("文件上传停止: " + uploadInfo.fileData.title);
|
||||||
|
document.getElementById('upload-info').innerHTML = html
|
||||||
|
},
|
||||||
|
FileSucceed: function (uploadInfo) { // 文件上传成功回调
|
||||||
|
html += "文件上传成功: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// console.log("文件上传成功: " + uploadInfo.fileData.title);
|
||||||
|
document.getElementById('upload-info').innerHTML = html
|
||||||
|
if (params.record.NAME == undefined || params.record.NAME == null || params.record.NAME.length < 1) {
|
||||||
|
const temps = [];
|
||||||
|
// temps.push({ field: 'Nav_Files', value: navFiles })
|
||||||
|
// temps.push({ field: 'IMG_FILE_ID', value: IMG_FILE_ID })
|
||||||
|
temps.push({ field: 'FILE_PATH', value: `http://share.polyv.net/front/video/view?vid=${uploadInfo.fileData.vid}` })
|
||||||
|
temps.push({ field: 'NAME', value: uploadInfo.fileData.filename })
|
||||||
|
temps.push({ field: 'ISLOCAL', value: false })
|
||||||
|
temps.push({ field: 'Nav_Files', value: null })
|
||||||
|
params.setFieldValueByBatch(temps);
|
||||||
|
params.setFieldEditable("Nav_Files", false)
|
||||||
|
message.success(`${uploadInfo.fileData.filename} 上传成功!`);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
FileFailed: function (uploadInfo) { // 文件上传失败回调
|
||||||
|
html += "文件上传失败: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// console.log("文件上传失败: " + uploadInfo.fileData.title);
|
||||||
|
document.getElementById('upload-info').innerHTML = html
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fileSetting
|
||||||
|
);
|
||||||
|
videoUpload.startAll();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// const uploadInput = {
|
||||||
|
// key: 'fileBlv',
|
||||||
|
// type: "file",
|
||||||
|
// id: 'file',
|
||||||
|
// accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
||||||
|
// name: 'file',
|
||||||
|
// multiple: true,
|
||||||
|
// onChange(info) {
|
||||||
|
// let uploadFiles = info.target.files
|
||||||
|
// if (uploadFiles.length > 0) {
|
||||||
|
// // let PlvVideoUpload;
|
||||||
|
// // try {
|
||||||
|
// // PlvVideoUpload = require('@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js');
|
||||||
|
// // // PlvVideoUpload = require('@polyv/vod-upload-js-sdk');
|
||||||
|
// // } catch (e) {
|
||||||
|
// // console.log(e)
|
||||||
|
// // }
|
||||||
|
// //
|
||||||
|
// // 授权验证信息3分钟内有效,当 sign 过期时需要调用该方法更新
|
||||||
|
// const videoUpload = new PlvVideoUpload({
|
||||||
|
// region: 'line1', // auto:自动选择。根据IP的地区自动选择,当IP解析不出时使用默认值。
|
||||||
|
// // line1(默认值):华南OSS bucket,对应ab-upload.polyv.net。
|
||||||
|
// // line2:华北OSS bucket,对应ab-upload2.polyv.net。
|
||||||
|
// events: {
|
||||||
|
// Error: (err) => { // 错误事件回调
|
||||||
|
// message.error(`上传失败!`);
|
||||||
|
// },
|
||||||
|
// UploadComplete: (infoResult) => {
|
||||||
|
// //数据处理
|
||||||
|
|
||||||
|
// // message.success(`上传成功`);
|
||||||
|
// } // 全部上传任务完成回调
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// console.log('事件触发60')
|
||||||
|
// var userid = params.colConfig.column.VERIFY_MSG
|
||||||
|
// var promptInfo = params.colConfig.column.PROMPT_INFO
|
||||||
|
// var secretkey = ""
|
||||||
|
// var writeToken = "";
|
||||||
|
// if (promptInfo && promptInfo.length > 0 && promptInfo.indexOf('|') > -1) {
|
||||||
|
// var promptInfoArr = promptInfo.split('|')
|
||||||
|
// secretkey = promptInfoArr[0]
|
||||||
|
// writeToken = promptInfoArr[1]
|
||||||
|
// }
|
||||||
|
|
||||||
|
// var ts = (new Date()).getTime()
|
||||||
|
// var sign = MD5(secretkey + ts)
|
||||||
|
// var hash = MD5(ts + writeToken)
|
||||||
|
// videoUpload.updateUserData({
|
||||||
|
// userid: userid, // Polyv云点播账号的ID
|
||||||
|
// ptime: ts, // 时间戳
|
||||||
|
// sign: sign, // <sign>是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
||||||
|
// hash: hash, // <hash> 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
// var file = uploadFiles[0]
|
||||||
|
// var cataid = '1746673652001'//每个公司对应的文件夹ID不一样 测试环境
|
||||||
|
// // "47xlk": 1746673652001 "xlk": 1746673689001, "jd": 1746673724001, "yl": 1746673761001, "bb": 1746674077001, "xt": 1746674428001,
|
||||||
|
|
||||||
|
// if (window.location.href.indexOf('localhost') == -1 || window.location.href.indexOf('47.122') == -1) { //不包含 localhost 正式环境
|
||||||
|
// switch (params.record.ORG_ID) {
|
||||||
|
// case 'B043B28B-BBC3-C452-6052-4FBA1457ABFA':
|
||||||
|
// cataid = '1746673689001'//"xlk": 1746673689001,
|
||||||
|
// break
|
||||||
|
// case '8F1CF418-8BF3-EA3F-7A6D-FC5D61247008':
|
||||||
|
// cataid = '1746674428001'//"xt": 1746674428001,
|
||||||
|
// break
|
||||||
|
// case 'D9871BA8-0EEC-9E4A-BB87-7D5A540D8913':
|
||||||
|
// cataid = '1746673761001'//"yl": 1746673761001
|
||||||
|
// break
|
||||||
|
// case '8B3C41AA-51B1-7CE9-1879-248A038C1B5C':
|
||||||
|
// cataid = '1746673724001'//"jd": 1746673724001
|
||||||
|
// break
|
||||||
|
// case '3EFD5276-632B-E379-9FF3-7A7546591FCA':
|
||||||
|
// cataid = '1746674077001'// "bb": 1746674077001,
|
||||||
|
// break
|
||||||
|
// default:
|
||||||
|
// cataid = '1746673652001'//"47xlk": 1746673652001
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// console.log(cataid)
|
||||||
|
|
||||||
|
// var fileSetting = { // 文件上传相关信息设置
|
||||||
|
// title: file.name, // 标题
|
||||||
|
// desc: 'jssdk插件上传', // 描述
|
||||||
|
// cataid: cataid, // 上传分类目录ID
|
||||||
|
// tag: '', // 标签
|
||||||
|
// luping: 0, // 是否开启视频课件优化处理,对于上传录屏类视频清晰度有所优化:0为不开启,1为开启
|
||||||
|
// keepsource: 0, // 是否源文件播放(不对视频进行编码):0为编码,1为不编码
|
||||||
|
// state: '' //用户自定义信息,如果提交了该字段,会在服务端上传完成回调时透传返回。
|
||||||
|
// }
|
||||||
|
// var html = ''
|
||||||
|
// var uploadManager = videoUpload.addFile(
|
||||||
|
// file, // file 为待上传的文件对象
|
||||||
|
// {
|
||||||
|
// FileStarted: function (uploadInfo) { // 文件开始上传回调
|
||||||
|
// html = ''
|
||||||
|
// document.getElementById('upload-info').innerHTML = ''
|
||||||
|
// html += "文件上传开始: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// // console.log("文件上传开始: " + uploadInfo.fileData.title);
|
||||||
|
// },
|
||||||
|
// FileProgress: function (uploadInfo) { // 文件上传过程返回上传进度信息回调
|
||||||
|
// html += "文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%' + "<br>"
|
||||||
|
// // console.log("文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%');
|
||||||
|
// document.getElementById('upload-info').innerHTML = html
|
||||||
|
// },
|
||||||
|
// FileStopped: function (uploadInfo) { // 文件暂停上传回调
|
||||||
|
// html += "文件上传停止: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// // console.log("文件上传停止: " + uploadInfo.fileData.title);
|
||||||
|
// document.getElementById('upload-info').innerHTML = html
|
||||||
|
// },
|
||||||
|
// FileSucceed: function (uploadInfo) { // 文件上传成功回调
|
||||||
|
// html += "文件上传成功: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// // console.log("文件上传成功: " + uploadInfo.fileData.title);
|
||||||
|
// document.getElementById('upload-info').innerHTML = html
|
||||||
|
// if (params.record.NAME == undefined || params.record.NAME == null || params.record.NAME.length < 1) {
|
||||||
|
// const temps = [];
|
||||||
|
// // temps.push({ field: 'Nav_Files', value: navFiles })
|
||||||
|
// // temps.push({ field: 'IMG_FILE_ID', value: IMG_FILE_ID })
|
||||||
|
// temps.push({ field: 'FILE_PATH', value: `http://share.polyv.net/front/video/view?vid=${uploadInfo.fileData.vid}` })
|
||||||
|
// temps.push({ field: 'NAME', value: uploadInfo.fileData.filename })
|
||||||
|
// temps.push({ field: 'ISLOCAL', value: false })
|
||||||
|
// temps.push({ field: 'Nav_Files', value: null })
|
||||||
|
// params.setFieldValueByBatch(temps);
|
||||||
|
// params.setFieldEditable("Nav_Files", false)
|
||||||
|
// message.success(`${uploadInfo.fileData.filename} 上传成功!`);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// FileFailed: function (uploadInfo) { // 文件上传失败回调
|
||||||
|
// html += "文件上传失败: " + uploadInfo.fileData.title + "<br>"
|
||||||
|
// // console.log("文件上传失败: " + uploadInfo.fileData.title);
|
||||||
|
// document.getElementById('upload-info').innerHTML = html
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// fileSetting
|
||||||
|
// );
|
||||||
|
// videoUpload.startAll();
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// };
|
||||||
|
|
||||||
|
return <>
|
||||||
|
<div key="keyD1" className="ant-col ant-col-lg-12 ant-col-xxl-8">
|
||||||
|
<div key="keyD2">
|
||||||
|
<div key="keyD3" className="ant-col ant-col-24 ant-form-item-label">
|
||||||
|
<label key="LNAME">
|
||||||
|
<span key="keyS1">上传视频(保利威)</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div key="keyD4" className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
||||||
|
<Input {...uploadInput} style={{ height: '39px' }} key="keyI1" disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true} />
|
||||||
|
{isEditFile && <p key="keyP1" id="upload-info"> </p>}
|
||||||
|
{isShowFile && <a key="keyA1" href={params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
} else if (params.colConfig.field === 'Nav_Files') {
|
||||||
|
//重写 使只上传视频 并且控制按钮不可操作
|
||||||
|
const Tenant = storage('lacal').getItem('Tenant').val;
|
||||||
|
var isEditFile = true//默认显示编辑按钮
|
||||||
|
var isShowFile = false//默认文件显示
|
||||||
|
//如果显示 本地文件 isShowFile true isEditFile false
|
||||||
|
if (params.record.ISLOCAL == true && params.record.Nav_Files != null && params.record.Nav_Files.length > 0) {
|
||||||
|
isEditFile = false
|
||||||
|
isShowFile = true
|
||||||
|
}
|
||||||
|
// if (params.record.Nav_Files && params.record.Nav_Files.length > 0) {
|
||||||
|
// params.record['Files'] = params.record.Nav_Files
|
||||||
|
// }
|
||||||
|
//上传到本地服务器
|
||||||
|
const uploadSopProps = {
|
||||||
|
accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
||||||
|
name: 'file',
|
||||||
|
action: config.serviceHost('api/PF/File/UploadFile'),
|
||||||
|
data: { OrgId: params.login.OrgId },
|
||||||
|
fileList: params.record['Files'],//Files Nav_Files
|
||||||
|
headers: {
|
||||||
|
Tenant: Tenant,
|
||||||
|
},
|
||||||
|
onChange(info) {
|
||||||
|
params.record['Files'] = [...info.fileList];
|
||||||
|
// params.saveRowRecord(params.record);
|
||||||
|
// params.record.NAME = info.file.name;
|
||||||
|
// if (info.file.status !== 'uploading') {
|
||||||
|
// }
|
||||||
|
if (info.file.status === 'removed') {
|
||||||
|
if (info.file.response && info.file.response.file) {
|
||||||
|
info.file.response.file.IS_DELETED = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (info.file.status === 'done') {
|
||||||
|
let uploadFiles = [...info.fileList]
|
||||||
|
if (uploadFiles) {
|
||||||
|
let navFiles = [];
|
||||||
|
var IMG_FILE_ID = ''
|
||||||
|
var FILE_PATH = ''
|
||||||
|
uploadFiles.forEach(t => {
|
||||||
|
if (t.response) {
|
||||||
|
//附件信息赋值给数据库对象,多个附件需要遍历附件信息
|
||||||
|
IMG_FILE_ID = t.response.Data.imgFileID
|
||||||
|
FILE_PATH = t.response.Data.imgFilePath
|
||||||
|
navFiles.push({
|
||||||
|
FILE_DB_ID: params.record.ID,
|
||||||
|
ORG_ID: params.record.ORG_ID,
|
||||||
|
IMG_FILE_ID: IMG_FILE_ID, //附件表文件名称
|
||||||
|
ID: t.response.file ? t.uid : guid()//标记ID
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const temps = [];
|
||||||
|
temps.push({ field: 'Nav_Files', value: navFiles })
|
||||||
|
temps.push({ field: 'IMG_FILE_ID', value: IMG_FILE_ID })
|
||||||
|
temps.push({ field: 'FILE_PATH', value: FILE_PATH })
|
||||||
|
temps.push({ field: 'NAME', value: info.file.name })
|
||||||
|
params.setFieldValueByBatch(temps);
|
||||||
|
params.setFieldEditable("NAME", false)
|
||||||
|
}
|
||||||
|
// params.setFieldEditable("ISLOCAL", false)
|
||||||
|
message.success(`${info.file.name} 上传成功`);
|
||||||
|
} else if (info.file.status === 'error') {
|
||||||
|
message.error(`${info.file.name} 上传失败!`);
|
||||||
|
}
|
||||||
|
if (info.file.status != 'done') {
|
||||||
|
//上传成功回调不处理数据赋值
|
||||||
|
const temps2 = [];
|
||||||
|
temps2.push({ field: 'Nav_Files', value: params.record['Files'] })
|
||||||
|
temps2.push({ field: 'NAME', value: info.file.name })
|
||||||
|
params.setFieldValueByBatch(temps2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return <>
|
||||||
|
<div className="ant-col ant-col-lg-12 ant-col-xxl-8">
|
||||||
|
<div>
|
||||||
|
<div className="ant-col ant-col-24 ant-form-item-label">
|
||||||
|
<label>
|
||||||
|
<span>上传视频(本地服务)</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
||||||
|
{/* {isShowFile && <Attachment disabled={false} value={"附件上传"} colConfig={params.colConfig} record={params.record} />} */}
|
||||||
|
{isShowFile && <Input type="file" style={{ height: '39px' }} key="keyI1" disabled={true} />}
|
||||||
|
{isShowFile && <a key="keyA21" href={config.picServerHost + params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
||||||
|
{isEditFile && <Upload {...uploadSopProps}>
|
||||||
|
<Button disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true}>
|
||||||
|
<Icon type="upload" />上传视频
|
||||||
|
</Button>
|
||||||
|
</Upload>}
|
||||||
|
|
||||||
|
{/* <Upload {...uploadSopProps}>
|
||||||
|
<Button disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true}>
|
||||||
|
<Icon type="upload" />上传视频
|
||||||
|
</Button>
|
||||||
|
</Upload> */}
|
||||||
|
{/*
|
||||||
|
<div key="keyD4" className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
||||||
|
<Input {...uploadInput} style={{ height: '39px' }} key="keyI1" disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true} />
|
||||||
|
{isEditFile && <p key="keyP1" id="upload-info"> </p>}
|
||||||
|
{isShowFile && <a key="keyA1" href={params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
||||||
|
</div>
|
||||||
|
*/}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
@ -28,331 +28,13 @@ export default {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
//import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js"; //此处插入 如果直接导入 发布会报错
|
// //import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js"; //此处插入 如果直接导入 发布会报错
|
||||||
const script = document.createElement('script');
|
// const script = document.createElement('script');
|
||||||
script.src = 'https://player.polyv.net/resp/vod-upload-js-sdk/latest/vod-upload-js-sdk.min.js';
|
// script.src = 'https://player.polyv.net/resp/vod-upload-js-sdk/latest/vod-upload-js-sdk.min.js';
|
||||||
document.body.appendChild(script);
|
// document.body.appendChild(script);
|
||||||
},
|
},
|
||||||
handleRenderHeadControl(params) {
|
handleRenderHeadControl(params) {
|
||||||
if (params.colConfig.field === 'NAME') {
|
if (params.colConfig.field === 'Nav_Files') {
|
||||||
var isEditFile = true//默认显示编辑按钮
|
|
||||||
var isShowFile = false//默认文件显示
|
|
||||||
// import PlvVideoUpload from "@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js";
|
|
||||||
|
|
||||||
// const script = document.createElement('script');
|
|
||||||
// script.src = 'https://websdk.videocc.net/vod-upload-js-sdk/latest/vod-upload-js-sdk.min.js';
|
|
||||||
// document.body.appendChild(script);
|
|
||||||
|
|
||||||
//如果显示 本地文件 isShowFile true isEditFile false
|
|
||||||
var p = document.getElementById('upload-info')
|
|
||||||
if (p != null) {
|
|
||||||
p.innerHTML = ' '
|
|
||||||
}
|
|
||||||
if (params.record.ISLOCAL != null && params.record.ISLOCAL == false && params.record.FILE_PATH != null && params.record.FILE_PATH.indexOf('http') > -1) {
|
|
||||||
isShowFile = true
|
|
||||||
isEditFile = false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 点播上传SDK 本地可以 发布不行
|
|
||||||
const uploadInput = {
|
|
||||||
key: 'fileBlv',
|
|
||||||
type: "file",
|
|
||||||
id: 'file',
|
|
||||||
accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
|
||||||
name: 'file',
|
|
||||||
multiple: true,
|
|
||||||
onChange(info) {
|
|
||||||
let uploadFiles = info.target.files
|
|
||||||
if (uploadFiles.length > 0) {
|
|
||||||
console.log('事件触发58')
|
|
||||||
// let PlvVideoUpload;
|
|
||||||
// try {
|
|
||||||
// PlvVideoUpload = require('@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js');
|
|
||||||
// // PlvVideoUpload = require('@polyv/vod-upload-js-sdk');
|
|
||||||
// } catch (e) {
|
|
||||||
// console.log(e)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// 授权验证信息3分钟内有效,当 sign 过期时需要调用该方法更新
|
|
||||||
const videoUpload = new PlvVideoUpload({
|
|
||||||
region: 'line1', // auto:自动选择。根据IP的地区自动选择,当IP解析不出时使用默认值。
|
|
||||||
// line1(默认值):华南OSS bucket,对应ab-upload.polyv.net。
|
|
||||||
// line2:华北OSS bucket,对应ab-upload2.polyv.net。
|
|
||||||
events: {
|
|
||||||
Error: (err) => { // 错误事件回调
|
|
||||||
message.error(`上传失败!`);
|
|
||||||
},
|
|
||||||
UploadComplete: (infoResult) => {
|
|
||||||
//数据处理
|
|
||||||
|
|
||||||
// message.success(`上传成功`);
|
|
||||||
} // 全部上传任务完成回调
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var userid = params.colConfig.column.VERIFY_MSG
|
|
||||||
var promptInfo = params.colConfig.column.PROMPT_INFO
|
|
||||||
var secretkey = ""
|
|
||||||
var writeToken = "";
|
|
||||||
if (promptInfo && promptInfo.length > 0 && promptInfo.indexOf('|') > -1) {
|
|
||||||
var promptInfoArr = promptInfo.split('|')
|
|
||||||
secretkey = promptInfoArr[0]
|
|
||||||
writeToken = promptInfoArr[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
var ts = (new Date()).getTime()
|
|
||||||
var sign = MD5(secretkey + ts)
|
|
||||||
var hash = MD5(ts + writeToken)
|
|
||||||
videoUpload.updateUserData({
|
|
||||||
userid: userid, // Polyv云点播账号的ID
|
|
||||||
ptime: ts, // 时间戳
|
|
||||||
sign: sign, // <sign>是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
|
||||||
hash: hash, // <hash> 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
|
||||||
});
|
|
||||||
var file = uploadFiles[0]
|
|
||||||
var cataid = '1746673652001'//每个公司对应的文件夹ID不一样 测试环境
|
|
||||||
// "47xlk": 1746673652001 "xlk": 1746673689001, "jd": 1746673724001, "yl": 1746673761001, "bb": 1746674077001, "xt": 1746674428001,
|
|
||||||
if (window.location.href.indexOf('localhost') == -1 && window.location.href.indexOf('47.122') == -1) { //不包含 localhost 正式环境
|
|
||||||
switch (params.record.ORG_ID) {
|
|
||||||
case 'B043B28B-BBC3-C452-6052-4FBA1457ABFA':
|
|
||||||
cataid = '1746673689001'//"xlk": 1746673689001,
|
|
||||||
break
|
|
||||||
case '8F1CF418-8BF3-EA3F-7A6D-FC5D61247008':
|
|
||||||
cataid = '1746674428001'//"xt": 1746674428001,
|
|
||||||
break
|
|
||||||
case 'D9871BA8-0EEC-9E4A-BB87-7D5A540D8913':
|
|
||||||
cataid = '1746673761001'//"yl": 1746673761001
|
|
||||||
break
|
|
||||||
case '8B3C41AA-51B1-7CE9-1879-248A038C1B5C':
|
|
||||||
cataid = '1746673724001'//"jd": 1746673724001
|
|
||||||
break
|
|
||||||
case '3EFD5276-632B-E379-9FF3-7A7546591FCA':
|
|
||||||
cataid = '1746674077001'// "bb": 1746674077001,
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
cataid = '1746673652001'//"47xlk": 1746673652001
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var fileSetting = { // 文件上传相关信息设置
|
|
||||||
title: file.name, // 标题
|
|
||||||
desc: 'jssdk插件上传', // 描述
|
|
||||||
cataid: cataid, // 上传分类目录ID
|
|
||||||
tag: '', // 标签
|
|
||||||
luping: 0, // 是否开启视频课件优化处理,对于上传录屏类视频清晰度有所优化:0为不开启,1为开启
|
|
||||||
keepsource: 0, // 是否源文件播放(不对视频进行编码):0为编码,1为不编码
|
|
||||||
state: '' //用户自定义信息,如果提交了该字段,会在服务端上传完成回调时透传返回。
|
|
||||||
}
|
|
||||||
var html = ''
|
|
||||||
var uploadManager = videoUpload.addFile(
|
|
||||||
file, // file 为待上传的文件对象
|
|
||||||
{
|
|
||||||
FileStarted: function (uploadInfo) { // 文件开始上传回调
|
|
||||||
html = ''
|
|
||||||
document.getElementById('upload-info').innerHTML = ''
|
|
||||||
html += "文件上传开始: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// console.log("文件上传开始: " + uploadInfo.fileData.title);
|
|
||||||
},
|
|
||||||
FileProgress: function (uploadInfo) { // 文件上传过程返回上传进度信息回调
|
|
||||||
html += "文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%' + "<br>"
|
|
||||||
// console.log("文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%');
|
|
||||||
document.getElementById('upload-info').innerHTML = html
|
|
||||||
},
|
|
||||||
FileStopped: function (uploadInfo) { // 文件暂停上传回调
|
|
||||||
html += "文件上传停止: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// console.log("文件上传停止: " + uploadInfo.fileData.title);
|
|
||||||
document.getElementById('upload-info').innerHTML = html
|
|
||||||
},
|
|
||||||
FileSucceed: function (uploadInfo) { // 文件上传成功回调
|
|
||||||
html += "文件上传成功: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// console.log("文件上传成功: " + uploadInfo.fileData.title);
|
|
||||||
document.getElementById('upload-info').innerHTML = html
|
|
||||||
if (params.record.NAME == undefined || params.record.NAME == null || params.record.NAME.length < 1) {
|
|
||||||
const temps = [];
|
|
||||||
// temps.push({ field: 'Nav_Files', value: navFiles })
|
|
||||||
// temps.push({ field: 'IMG_FILE_ID', value: IMG_FILE_ID })
|
|
||||||
temps.push({ field: 'FILE_PATH', value: `http://share.polyv.net/front/video/view?vid=${uploadInfo.fileData.vid}` })
|
|
||||||
temps.push({ field: 'NAME', value: uploadInfo.fileData.filename })
|
|
||||||
temps.push({ field: 'ISLOCAL', value: false })
|
|
||||||
temps.push({ field: 'Nav_Files', value: null })
|
|
||||||
params.setFieldValueByBatch(temps);
|
|
||||||
params.setFieldEditable("Nav_Files", false)
|
|
||||||
message.success(`${uploadInfo.fileData.filename} 上传成功!`);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
FileFailed: function (uploadInfo) { // 文件上传失败回调
|
|
||||||
html += "文件上传失败: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// console.log("文件上传失败: " + uploadInfo.fileData.title);
|
|
||||||
document.getElementById('upload-info').innerHTML = html
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fileSetting
|
|
||||||
);
|
|
||||||
videoUpload.startAll();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// const uploadInput = {
|
|
||||||
// key: 'fileBlv',
|
|
||||||
// type: "file",
|
|
||||||
// id: 'file',
|
|
||||||
// accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
|
||||||
// name: 'file',
|
|
||||||
// multiple: true,
|
|
||||||
// onChange(info) {
|
|
||||||
// let uploadFiles = info.target.files
|
|
||||||
// if (uploadFiles.length > 0) {
|
|
||||||
// // let PlvVideoUpload;
|
|
||||||
// // try {
|
|
||||||
// // PlvVideoUpload = require('@polyv/vod-upload-js-sdk/vod-upload-js-sdk.min.js');
|
|
||||||
// // // PlvVideoUpload = require('@polyv/vod-upload-js-sdk');
|
|
||||||
// // } catch (e) {
|
|
||||||
// // console.log(e)
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // 授权验证信息3分钟内有效,当 sign 过期时需要调用该方法更新
|
|
||||||
// const videoUpload = new PlvVideoUpload({
|
|
||||||
// region: 'line1', // auto:自动选择。根据IP的地区自动选择,当IP解析不出时使用默认值。
|
|
||||||
// // line1(默认值):华南OSS bucket,对应ab-upload.polyv.net。
|
|
||||||
// // line2:华北OSS bucket,对应ab-upload2.polyv.net。
|
|
||||||
// events: {
|
|
||||||
// Error: (err) => { // 错误事件回调
|
|
||||||
// message.error(`上传失败!`);
|
|
||||||
// },
|
|
||||||
// UploadComplete: (infoResult) => {
|
|
||||||
// //数据处理
|
|
||||||
|
|
||||||
// // message.success(`上传成功`);
|
|
||||||
// } // 全部上传任务完成回调
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// console.log('事件触发60')
|
|
||||||
// var userid = params.colConfig.column.VERIFY_MSG
|
|
||||||
// var promptInfo = params.colConfig.column.PROMPT_INFO
|
|
||||||
// var secretkey = ""
|
|
||||||
// var writeToken = "";
|
|
||||||
// if (promptInfo && promptInfo.length > 0 && promptInfo.indexOf('|') > -1) {
|
|
||||||
// var promptInfoArr = promptInfo.split('|')
|
|
||||||
// secretkey = promptInfoArr[0]
|
|
||||||
// writeToken = promptInfoArr[1]
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var ts = (new Date()).getTime()
|
|
||||||
// var sign = MD5(secretkey + ts)
|
|
||||||
// var hash = MD5(ts + writeToken)
|
|
||||||
// videoUpload.updateUserData({
|
|
||||||
// userid: userid, // Polyv云点播账号的ID
|
|
||||||
// ptime: ts, // 时间戳
|
|
||||||
// sign: sign, // <sign>是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
|
||||||
// hash: hash, // <hash> 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值(小写)
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// var file = uploadFiles[0]
|
|
||||||
// var cataid = '1746673652001'//每个公司对应的文件夹ID不一样 测试环境
|
|
||||||
// // "47xlk": 1746673652001 "xlk": 1746673689001, "jd": 1746673724001, "yl": 1746673761001, "bb": 1746674077001, "xt": 1746674428001,
|
|
||||||
|
|
||||||
// if (window.location.href.indexOf('localhost') == -1 || window.location.href.indexOf('47.122') == -1) { //不包含 localhost 正式环境
|
|
||||||
// switch (params.record.ORG_ID) {
|
|
||||||
// case 'B043B28B-BBC3-C452-6052-4FBA1457ABFA':
|
|
||||||
// cataid = '1746673689001'//"xlk": 1746673689001,
|
|
||||||
// break
|
|
||||||
// case '8F1CF418-8BF3-EA3F-7A6D-FC5D61247008':
|
|
||||||
// cataid = '1746674428001'//"xt": 1746674428001,
|
|
||||||
// break
|
|
||||||
// case 'D9871BA8-0EEC-9E4A-BB87-7D5A540D8913':
|
|
||||||
// cataid = '1746673761001'//"yl": 1746673761001
|
|
||||||
// break
|
|
||||||
// case '8B3C41AA-51B1-7CE9-1879-248A038C1B5C':
|
|
||||||
// cataid = '1746673724001'//"jd": 1746673724001
|
|
||||||
// break
|
|
||||||
// case '3EFD5276-632B-E379-9FF3-7A7546591FCA':
|
|
||||||
// cataid = '1746674077001'// "bb": 1746674077001,
|
|
||||||
// break
|
|
||||||
// default:
|
|
||||||
// cataid = '1746673652001'//"47xlk": 1746673652001
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// console.log(cataid)
|
|
||||||
|
|
||||||
// var fileSetting = { // 文件上传相关信息设置
|
|
||||||
// title: file.name, // 标题
|
|
||||||
// desc: 'jssdk插件上传', // 描述
|
|
||||||
// cataid: cataid, // 上传分类目录ID
|
|
||||||
// tag: '', // 标签
|
|
||||||
// luping: 0, // 是否开启视频课件优化处理,对于上传录屏类视频清晰度有所优化:0为不开启,1为开启
|
|
||||||
// keepsource: 0, // 是否源文件播放(不对视频进行编码):0为编码,1为不编码
|
|
||||||
// state: '' //用户自定义信息,如果提交了该字段,会在服务端上传完成回调时透传返回。
|
|
||||||
// }
|
|
||||||
// var html = ''
|
|
||||||
// var uploadManager = videoUpload.addFile(
|
|
||||||
// file, // file 为待上传的文件对象
|
|
||||||
// {
|
|
||||||
// FileStarted: function (uploadInfo) { // 文件开始上传回调
|
|
||||||
// html = ''
|
|
||||||
// document.getElementById('upload-info').innerHTML = ''
|
|
||||||
// html += "文件上传开始: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// // console.log("文件上传开始: " + uploadInfo.fileData.title);
|
|
||||||
// },
|
|
||||||
// FileProgress: function (uploadInfo) { // 文件上传过程返回上传进度信息回调
|
|
||||||
// html += "文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%' + "<br>"
|
|
||||||
// // console.log("文件上传中: " + (uploadInfo.progress * 100).toFixed(2) + '%');
|
|
||||||
// document.getElementById('upload-info').innerHTML = html
|
|
||||||
// },
|
|
||||||
// FileStopped: function (uploadInfo) { // 文件暂停上传回调
|
|
||||||
// html += "文件上传停止: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// // console.log("文件上传停止: " + uploadInfo.fileData.title);
|
|
||||||
// document.getElementById('upload-info').innerHTML = html
|
|
||||||
// },
|
|
||||||
// FileSucceed: function (uploadInfo) { // 文件上传成功回调
|
|
||||||
// html += "文件上传成功: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// // console.log("文件上传成功: " + uploadInfo.fileData.title);
|
|
||||||
// document.getElementById('upload-info').innerHTML = html
|
|
||||||
// if (params.record.NAME == undefined || params.record.NAME == null || params.record.NAME.length < 1) {
|
|
||||||
// const temps = [];
|
|
||||||
// // temps.push({ field: 'Nav_Files', value: navFiles })
|
|
||||||
// // temps.push({ field: 'IMG_FILE_ID', value: IMG_FILE_ID })
|
|
||||||
// temps.push({ field: 'FILE_PATH', value: `http://share.polyv.net/front/video/view?vid=${uploadInfo.fileData.vid}` })
|
|
||||||
// temps.push({ field: 'NAME', value: uploadInfo.fileData.filename })
|
|
||||||
// temps.push({ field: 'ISLOCAL', value: false })
|
|
||||||
// temps.push({ field: 'Nav_Files', value: null })
|
|
||||||
// params.setFieldValueByBatch(temps);
|
|
||||||
// params.setFieldEditable("Nav_Files", false)
|
|
||||||
// message.success(`${uploadInfo.fileData.filename} 上传成功!`);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// FileFailed: function (uploadInfo) { // 文件上传失败回调
|
|
||||||
// html += "文件上传失败: " + uploadInfo.fileData.title + "<br>"
|
|
||||||
// // console.log("文件上传失败: " + uploadInfo.fileData.title);
|
|
||||||
// document.getElementById('upload-info').innerHTML = html
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// fileSetting
|
|
||||||
// );
|
|
||||||
// videoUpload.startAll();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
return <>
|
|
||||||
<div key="keyD1" className="ant-col ant-col-lg-12 ant-col-xxl-8">
|
|
||||||
<div key="keyD2">
|
|
||||||
<div key="keyD3" className="ant-col ant-col-24 ant-form-item-label">
|
|
||||||
<label key="LNAME">
|
|
||||||
<span key="keyS1">上传视频(保利威)</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div key="keyD4" className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
|
||||||
<Input {...uploadInput} style={{ height: '39px' }} key="keyI1" disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true} />
|
|
||||||
{isEditFile && <p key="keyP1" id="upload-info"> </p>}
|
|
||||||
{isShowFile && <a key="keyA1" href={params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
} else if (params.colConfig.field === 'Nav_Files') {
|
|
||||||
//重写 使只上传视频 并且控制按钮不可操作
|
//重写 使只上传视频 并且控制按钮不可操作
|
||||||
const Tenant = storage('lacal').getItem('Tenant').val;
|
const Tenant = storage('lacal').getItem('Tenant').val;
|
||||||
var isEditFile = true//默认显示编辑按钮
|
var isEditFile = true//默认显示编辑按钮
|
||||||
@ -369,11 +51,12 @@ export default {
|
|||||||
const uploadSopProps = {
|
const uploadSopProps = {
|
||||||
accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
accept: '.flv,.avi,.mpg,.mp4,.wmv,.mov,.3gp,.asf',
|
||||||
name: 'file',
|
name: 'file',
|
||||||
action: config.serviceHost('api/PF/File/UploadFile'),
|
action: config.serviceHost('api/PF/File/UploadVideo'),//UploadFile 方法分开 以免影响
|
||||||
data: { OrgId: params.login.OrgId },
|
data: { OrgId: params.login.OrgId },
|
||||||
fileList: params.record['Files'],//Files Nav_Files
|
fileList: params.record['Files'],//Files Nav_Files
|
||||||
headers: {
|
headers: {
|
||||||
Tenant: Tenant,
|
Tenant: Tenant,
|
||||||
|
PBN: "VIDEO"
|
||||||
},
|
},
|
||||||
onChange(info) {
|
onChange(info) {
|
||||||
params.record['Files'] = [...info.fileList];
|
params.record['Files'] = [...info.fileList];
|
||||||
@ -394,6 +77,7 @@ export default {
|
|||||||
var FILE_PATH = ''
|
var FILE_PATH = ''
|
||||||
uploadFiles.forEach(t => {
|
uploadFiles.forEach(t => {
|
||||||
if (t.response) {
|
if (t.response) {
|
||||||
|
if (t.response.IsSuccessful) {
|
||||||
//附件信息赋值给数据库对象,多个附件需要遍历附件信息
|
//附件信息赋值给数据库对象,多个附件需要遍历附件信息
|
||||||
IMG_FILE_ID = t.response.Data.imgFileID
|
IMG_FILE_ID = t.response.Data.imgFileID
|
||||||
FILE_PATH = t.response.Data.imgFilePath
|
FILE_PATH = t.response.Data.imgFilePath
|
||||||
@ -403,6 +87,9 @@ export default {
|
|||||||
IMG_FILE_ID: IMG_FILE_ID, //附件表文件名称
|
IMG_FILE_ID: IMG_FILE_ID, //附件表文件名称
|
||||||
ID: t.response.file ? t.uid : guid()//标记ID
|
ID: t.response.file ? t.uid : guid()//标记ID
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
message.error(`${info.file.name} 上传失败!报错详情:` + t.response.ErrorMessage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -412,7 +99,7 @@ export default {
|
|||||||
temps.push({ field: 'FILE_PATH', value: FILE_PATH })
|
temps.push({ field: 'FILE_PATH', value: FILE_PATH })
|
||||||
temps.push({ field: 'NAME', value: info.file.name })
|
temps.push({ field: 'NAME', value: info.file.name })
|
||||||
params.setFieldValueByBatch(temps);
|
params.setFieldValueByBatch(temps);
|
||||||
params.setFieldEditable("NAME", false)
|
// params.setFieldEditable("NAME", false)//让可修改
|
||||||
}
|
}
|
||||||
// params.setFieldEditable("ISLOCAL", false)
|
// params.setFieldEditable("ISLOCAL", false)
|
||||||
message.success(`${info.file.name} 上传成功`);
|
message.success(`${info.file.name} 上传成功`);
|
||||||
@ -433,7 +120,7 @@ export default {
|
|||||||
<div>
|
<div>
|
||||||
<div className="ant-col ant-col-24 ant-form-item-label">
|
<div className="ant-col ant-col-24 ant-form-item-label">
|
||||||
<label>
|
<label>
|
||||||
<span>上传视频(本地服务)</span>
|
<span>上传本地视频</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
<div className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
||||||
@ -442,22 +129,9 @@ export default {
|
|||||||
{isShowFile && <a key="keyA21" href={config.picServerHost + params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
{isShowFile && <a key="keyA21" href={config.picServerHost + params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
||||||
{isEditFile && <Upload {...uploadSopProps}>
|
{isEditFile && <Upload {...uploadSopProps}>
|
||||||
<Button disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true}>
|
<Button disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true}>
|
||||||
<Icon type="upload" />上传视频
|
<Icon type="upload" />上传视频(如果视频较大,请耐心等待上传完毕再保存)
|
||||||
</Button>
|
</Button>
|
||||||
</Upload>}
|
</Upload>}
|
||||||
|
|
||||||
{/* <Upload {...uploadSopProps}>
|
|
||||||
<Button disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true}>
|
|
||||||
<Icon type="upload" />上传视频
|
|
||||||
</Button>
|
|
||||||
</Upload> */}
|
|
||||||
{/*
|
|
||||||
<div key="keyD4" className="ant-col ant-col-18 ant-form-item-control-wrapper">
|
|
||||||
<Input {...uploadInput} style={{ height: '39px' }} key="keyI1" disabled={(params.record.NAME == null || params.record.NAME.length == 0) ? false : true} />
|
|
||||||
{isEditFile && <p key="keyP1" id="upload-info"> </p>}
|
|
||||||
{isShowFile && <a key="keyA1" href={params.record.FILE_PATH} target="_blank">{params.record.NAME}</a>}
|
|
||||||
</div>
|
|
||||||
*/}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export default {
|
|||||||
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
|
params.record.TaskID = params.data.TaskID //TaskID传递消息表ID
|
||||||
params.record.PUBLISH = params.customParams;
|
params.record.PUBLISH = params.customParams;
|
||||||
},
|
},
|
||||||
onBeforeEdit: ({ isNew, stateData, setFieldVisible, setFieldValue, setRowFieldVisible }) => {
|
onBeforeEdit: ({ isNew, stateData, setFieldVisible, setRowFieldLabel, setRowFieldVisible }) => {
|
||||||
if (stateData.IS_CREATETEST == 0) {
|
if (stateData.IS_CREATETEST == 0) {
|
||||||
setRowFieldVisible("T_SE_NEW_USER_DETAIL", { "SCORE": true, "EXAMINATION_RESULTS": true, "Nav_Files": true })
|
setRowFieldVisible("T_SE_NEW_USER_DETAIL", { "SCORE": true, "EXAMINATION_RESULTS": true, "Nav_Files": true })
|
||||||
} else if (stateData.IS_CREATETEST == 1) {
|
} else if (stateData.IS_CREATETEST == 1) {
|
||||||
@ -20,6 +20,21 @@ export default {
|
|||||||
if (stateData.TRAIN_STATUS == 3) {
|
if (stateData.TRAIN_STATUS == 3) {
|
||||||
setRowFieldVisible("T_SE_NEW_USER_DETAIL", { "Nav_DepartmentNext.NAME": false })
|
setRowFieldVisible("T_SE_NEW_USER_DETAIL", { "Nav_DepartmentNext.NAME": false })
|
||||||
}
|
}
|
||||||
|
// TRAIN_STATUS 公司级 = 0, 部门级 = 1, 车间级 = 2, 班组级 = 3,
|
||||||
|
// Nav_DepartmentNext.NAME
|
||||||
|
if (stateData.TRAIN_STATUS == 0) {
|
||||||
|
setRowFieldLabel(
|
||||||
|
"T_SE_NEW_USER_DETAIL", {
|
||||||
|
'Nav_DepartmentNext.NAME': '部门/车间级培训组织'
|
||||||
|
})
|
||||||
|
} else if (stateData.TRAIN_STATUS == 1) {
|
||||||
|
setRowFieldLabel(
|
||||||
|
"T_SE_NEW_USER_DETAIL", {
|
||||||
|
'Nav_DepartmentNext.NAME': '班组级培训组织'
|
||||||
|
})
|
||||||
|
} else if (stateData.TRAIN_STATUS == 2 || stateData.TRAIN_STATUS == 3) {
|
||||||
|
// 列不可见
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onChange: ({ isNew, stateData, setFieldVisible, setFieldValue, setRowFieldVisible }) => {
|
onChange: ({ isNew, stateData, setFieldVisible, setFieldValue, setRowFieldVisible }) => {
|
||||||
if (stateData.IS_CREATETEST == 0) {
|
if (stateData.IS_CREATETEST == 0) {
|
||||||
|
|||||||
@ -1938,3 +1938,18 @@ export function showEnum(enums, TRAIN_TYPE) {
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/****** 附件ListModel的某个二级属性 getArryPropShow(data.Nav_Teachers, "Nav_User.NAME") ******/
|
||||||
|
export function getArryPropShow(arry, propPath) {
|
||||||
|
var arryShow = ''
|
||||||
|
const [prop1, prop2] = propPath.split('.');
|
||||||
|
if (arry && arry.length > 0 && propPath) {
|
||||||
|
arry.map(function (item, index) {
|
||||||
|
var itemProp = item[prop1]?.[prop2]
|
||||||
|
if (itemProp && itemProp.length > 0)
|
||||||
|
arryShow += (index > 0 ? ',' : '') + itemProp;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return arryShow;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user