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

铁道问题修改

上级 3b6caec3
...@@ -24,7 +24,7 @@ import { setOneStopConfig } from '@/webPublic/zyd_public/utils/utils'; ...@@ -24,7 +24,7 @@ import { setOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
export const fetchTemplateByCode = code => export const fetchTemplateByCode = code =>
uaaRequest('/UnifiedServicePatternApi/getDetail', { code }); uaaRequest('/UnifiedServicePatternApi/getDetail', { code });
export const fetchTemplateById = id => uaaRequest('/UnifiedAppApi/getDetail', { id }); export const fetchTemplateById = id => uaaRequest('/UnifiedAppApi/getDetail', { id, });
/** /**
* 查询表格中某条数据 * 查询表格中某条数据
......
...@@ -51,18 +51,18 @@ export default class ZdyTable extends Component { ...@@ -51,18 +51,18 @@ export default class ZdyTable extends Component {
isChild, // 是否为子表单 isChild, // 是否为子表单
isQRCode = false, // 是否为二维码快捷发起 isQRCode = false, // 是否为二维码快捷发起
formDeafault = '', // 为二维码快捷发起默认值 formDeafault = '', // 为二维码快捷发起默认值
} = this.props; } = this.props;
if (isPreview || isChild) { if (isPreview || isChild) {
this.setState({ this.setState({
...this.state, ...this.state,
...this.props, ...this.props,
isReady: true, isReady: true,
formConfig: { ...this.state.formConfig, style: this.props.style }, formConfig: { ...this.state.formConfig, style: this.props.style },
},()=> this.initExcel({ datas: this.props.datas, trees: this.props.trees })); },()=> this.initExcel({ datas: this.props.datas, trees: this.props.trees }));
return; return;
} }
...@@ -247,10 +247,10 @@ export default class ZdyTable extends Component { ...@@ -247,10 +247,10 @@ export default class ZdyTable extends Component {
} }
importExcel = (res) => { importExcel = (res) => {
const{datas,trees} = this.configs const{datas,trees} = this.configs
const sheets = res.sheets const sheets = res.sheets
for (var s = 0; s < sheets.length; s++) { for (var s = 0; s < sheets.length; s++) {
const uuid = sheets[s].key; const uuid = sheets[s].key;
const items = [] const items = []
...@@ -309,7 +309,7 @@ export default class ZdyTable extends Component { ...@@ -309,7 +309,7 @@ export default class ZdyTable extends Component {
isBorder: true, isBorder: true,
items: items, items: items,
}; };
} }
this.initExcel({ datas, trees },()=>this.setState({isChange:!this.state.isChange})) this.initExcel({ datas, trees },()=>this.setState({isChange:!this.state.isChange}))
console.log("公式导入excel成功") console.log("公式导入excel成功")
...@@ -347,11 +347,11 @@ childExcel = (sheetData, datas, tr) => { ...@@ -347,11 +347,11 @@ childExcel = (sheetData, datas, tr) => {
} }
configs configs
initExcel = (configs, callback) => { initExcel = (configs, callback) => {
if (configs == null || configs.trees == null) return if (configs == null || configs.trees == null) return
if(configs.trees!=null) this.configs=configs if(configs.trees!=null) this.configs=configs
const sheetData = {} const sheetData = {}
for (var key in configs.trees) { for (var key in configs.trees) {
...@@ -366,7 +366,7 @@ initExcel = (configs, callback) => { ...@@ -366,7 +366,7 @@ initExcel = (configs, callback) => {
} }
getCellValue = (i, j, currentTitle) => { getCellValue = (i, j, currentTitle) => {
let hfInstance = this.props.hfInstance||this.hfInstance let hfInstance = this.props.hfInstance||this.hfInstance
if (hfInstance && currentTitle) { if (hfInstance && currentTitle) {
let x = hfInstance.getCellValue({ col: j, row: i, sheet: hfInstance.getSheetId(currentTitle) }) let x = hfInstance.getCellValue({ col: j, row: i, sheet: hfInstance.getSheetId(currentTitle) })
...@@ -375,7 +375,7 @@ getCellValue = (i, j, currentTitle) => { ...@@ -375,7 +375,7 @@ getCellValue = (i, j, currentTitle) => {
} }
return x; return x;
} }
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { const {
...@@ -384,7 +384,7 @@ componentWillReceiveProps(nextProps) { ...@@ -384,7 +384,7 @@ componentWillReceiveProps(nextProps) {
isForm, isForm,
isPreview, // 是否为预览模式 isPreview, // 是否为预览模式
isChild, // 是否为子表单 isChild, // 是否为子表单
} = nextProps; } = nextProps;
if (isPreview || isChild) { if (isPreview || isChild) {
...@@ -396,7 +396,7 @@ componentWillReceiveProps(nextProps) { ...@@ -396,7 +396,7 @@ componentWillReceiveProps(nextProps) {
},()=>this.initExcel({ datas: nextProps.datas, trees: nextProps.trees })); },()=>this.initExcel({ datas: nextProps.datas, trees: nextProps.trees }));
return; return;
} }
...@@ -559,7 +559,7 @@ countMax = items => { ...@@ -559,7 +559,7 @@ countMax = items => {
return max; return max;
}; };
getCurrentFormTitle = (obj, key) => { getCurrentFormTitle = (obj, key) => {
if(obj==null) return if(obj==null) return
const { trees } = obj const { trees } = obj
if(trees==null) return if(trees==null) return
...@@ -575,14 +575,14 @@ getCurrentFormTitle2 = ( key) => { ...@@ -575,14 +575,14 @@ getCurrentFormTitle2 = ( key) => {
} }
getT=(trees,key)=>{ getT=(trees,key)=>{
for (var i = 0; i < trees.length; i++) { for (var i = 0; i < trees.length; i++) {
if(trees[i].children==null||trees[i].children.length==0){ if(trees[i].children==null||trees[i].children.length==0){
if (trees[i].key == key) { if (trees[i].key == key) {
return trees[i].title return trees[i].title
} }
}else{ }else{
return this.getT(trees[i].children,key) return this.getT(trees[i].children,key)
} }
} }
...@@ -757,7 +757,7 @@ render() { ...@@ -757,7 +757,7 @@ render() {
return ( return (
<tr key={i}> <tr key={i}>
{row.map((cell, j) => { {row.map((cell, j) => {
if (!cell.content) { if (!cell.content) {
return; return;
} }
...@@ -948,7 +948,7 @@ render() { ...@@ -948,7 +948,7 @@ render() {
concealModel={concealModel || {}} // 场景设计器内置路由跳转函数 concealModel={concealModel || {}} // 场景设计器内置路由跳转函数
isDynamic={isDynamic} // 是否为场景配置器调用 isDynamic={isDynamic} // 是否为场景配置器调用
/> />
</Form> </Form>
)} )}
</> </>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论