diff --git a/src/uapbd/public/cssStyle/_button.less b/src/uapbd/public/cssStyle/_button.less new file mode 100644 index 00000000..0828cfcf --- /dev/null +++ b/src/uapbd/public/cssStyle/_button.less @@ -0,0 +1,11 @@ +// tab/tabPane按钮右上角绝对布局定位 +.uapbd-shoulder-button-area{ + max-height:max-content; + position:absolute; + right: 0; + top: 0px; + z-index: 5; +} +.u-tabs { + position: relative; +} \ No newline at end of file diff --git a/src/uapbd/public/cssStyle/common.less b/src/uapbd/public/cssStyle/common.less new file mode 100644 index 00000000..5ed4f17d --- /dev/null +++ b/src/uapbd/public/cssStyle/common.less @@ -0,0 +1,19 @@ +.uapbd-link-item { + color: "#007ace"; + cursor: "pointer"; +} +.uapbd-bill-tree-table{ + height: 100%; + background-color: #fff; +} +.uapbd-search-refer-item{ + width: 200px; +} +.uapbd-flex-contain{ + display: flex; + flex: 1; + flex-direction: column; +} +.uapbd-srcoll-ele-bot{ + margin-bottom: 4px; +} \ No newline at end of file diff --git a/src/uapbd/public/excomponents/CompUtils.js b/src/uapbd/public/excomponents/CompUtils.js index d4838e7d..16af598c 100644 --- a/src/uapbd/public/excomponents/CompUtils.js +++ b/src/uapbd/public/excomponents/CompUtils.js @@ -44,14 +44,16 @@ var CompUtils = { this.porinter = this.array.push(node) - 1; }, pop: function(){ - if(this.porinter < 0) + if(this.porinter < 0) { return undefined; + } this.porinter = this.porinter--; return this.array.pop(node); }, currect: function(){ - if(this.porinter < 0) + if(this.porinter < 0) { return undefined; + } return this.array[this.porinter]; } }; @@ -106,19 +108,23 @@ var CompUtils = { copyData.forEach(d => { var pid = d[pidname], pobj = dataObj[pid]; - if(pobj) + if(pobj) { pobj.children.push(d); - else + } + else { newDatas.push(d); + } }); var loop = (ds) =>{ ds.map(d => { - if(d.children.length == 0) + if(d.children.length == 0) { delete d.children; - else + } + else { loop(d.children); + } }); }; diff --git a/src/uapbd/public/excomponents/Dialog.js b/src/uapbd/public/excomponents/Dialog.js index 0defd55f..51ba05e5 100644 --- a/src/uapbd/public/excomponents/Dialog.js +++ b/src/uapbd/public/excomponents/Dialog.js @@ -107,20 +107,22 @@ export default class Dialog extends Component{ {this.state.sureButtonName || '确认'} {this.state.cancelButtonName || '取消'} diff --git a/src/uapbd/public/excomponents/Record.js b/src/uapbd/public/excomponents/Record.js index d2eb532d..2e253d72 100644 --- a/src/uapbd/public/excomponents/Record.js +++ b/src/uapbd/public/excomponents/Record.js @@ -3,8 +3,8 @@ * @version: * @Author: zhangzhbk * @Date: 2020-11-30 13:27:04 - * @LastEditors: Chendch - * @LastEditTime: 2021-02-23 11:15:57 + * @LastEditors: yanxbm + * @LastEditTime: 2023-01-09 15:16:21 */ //数据记录模型 import Utils, {BaseUtils} from '../utils'; @@ -14,6 +14,7 @@ var Record = function(data0, status0 = 'common', id){ rid = id || BaseUtils.id(), data = data0; + this.key = rid; this.getData = () => { return deepClone(data); }; @@ -31,8 +32,9 @@ var Record = function(data0, status0 = 'common', id){ //定义一些内部方法,写成监听工作量太大 this._setStatus = (status0) => { - if(status0 === 'add' || status0 === 'edit' || status0 === 'del' || status0 === 'common') + if(status0 === 'add' || status0 === 'edit' || status0 === 'del' || status0 === 'common') { status = status0; + } }; this._copySelf = () => { @@ -69,12 +71,15 @@ Record.converToVOData = (records) => { status = element.getStatus(), statusVal = 0; debugger; - if(status == 'add') + if(status == 'add') { statusVal = 2; - if(status == 'edit') + } + if(status == 'edit') { statusVal = 1; - if(status == 'del') + } + if(status == 'del') { statusVal = 3; + } var values = {}; for (let [key, val] of Object.entries(data)) { diff --git a/src/uapbd/public/excomponents/ReferLoader/index.less b/src/uapbd/public/excomponents/ReferLoader/index.less index aa96e50d..fcf4a890 100644 --- a/src/uapbd/public/excomponents/ReferLoader/index.less +++ b/src/uapbd/public/excomponents/ReferLoader/index.less @@ -1,6 +1,6 @@ .refer-wrapper { - padding:0 5px 0 0; + //padding:0 5px 0 0; position: relative; align-items: center; .required-star { diff --git a/src/uapbd/public/excomponents/ReferWraper/index.js b/src/uapbd/public/excomponents/ReferWraper/index.js new file mode 100644 index 00000000..5afb55a6 --- /dev/null +++ b/src/uapbd/public/excomponents/ReferWraper/index.js @@ -0,0 +1,52 @@ +import React, { Component } from 'react'; +import {base, deepClone } from 'nc-lightapp-front'; +import './index.less'; +const { NCFormControl: FormControl} = base; + +export default class ReferWraper extends Component { + constructor(props) { + super(props); + this.state = { + + } + } + onClick = () =>{ + let {onClick,disabled} = this.props + if(!disabled && onClick){ + onClick() + } + } + onClear = () => { + let {onClear} = this.props + if(onClear){ + onClear() + } + } + render(){ + let {display,disabled,placeholder,fieldid, ...other} = this.props + let outStyle = this.props.outStyle ? this.props.outStyle : {} + return( +
+ {}} + {...other} + // showClose={true} + /> + + {/*
+ {this.onClear}} + className="iconfont icon-qingkong" + /> +
*/} +
+ ) + } +} diff --git a/src/uapbd/public/excomponents/ReferWraper/index.less b/src/uapbd/public/excomponents/ReferWraper/index.less new file mode 100644 index 00000000..43a5e7c0 --- /dev/null +++ b/src/uapbd/public/excomponents/ReferWraper/index.less @@ -0,0 +1,44 @@ +.def-refer-input-wraper { + // position: relative; + // border: 1px solid #d0d0d0; + color: #424242; + width: 100%; + border-radius: 3px; + height: 26px; + position: relative; + overflow: hidden; + .def-refer-formcontrol { + padding-right: 28px; + } + .iconfont{ + font-size: 14px; + } + .icon-canzhaozuixin { + color: #9d9d9d; + position: absolute; + font-weight: normal; + cursor: pointer; + z-index: 0; + top: 0; + right: 0; + width: 18px; + height: 26px; + border-radius: 2px 2px 0 0; + display: flex; + align-items: center; + } + // &:hover { + // .del{ + // display: inline; + // } + // } + // .del{ + // position: absolute; + // right: 20px; + // top: 4px; + // z-index: 9; + // display: inline; + // } + +} + diff --git a/src/uapbd/public/excomponents/ScaTransfer.js b/src/uapbd/public/excomponents/ScaTransfer.js index c88e352c..d7213224 100644 --- a/src/uapbd/public/excomponents/ScaTransfer.js +++ b/src/uapbd/public/excomponents/ScaTransfer.js @@ -3,7 +3,7 @@ import { base, getSysFieldid } from 'nc-lightapp-front'; let { NCTree, NCFormControl, NCDiv, NCButton } = base; -import './Transfer.less'; +import './../../common/components/lrTransfer/index.less'; import '../uapbdstyle/uapbd_style_common.less'; var EMPTY_FN = function () { }; @@ -214,8 +214,9 @@ var TreeWapper = function (arbitraryHier) { var loopParentMove = function (n, move = false) { var pid = n.pid, pnode = dataMap[pid] || root; - if (pnode.root) + if (pnode.root) { return; + } pnode.move = move; loopParentMove(pnode, move); }; @@ -223,7 +224,9 @@ var TreeWapper = function (arbitraryHier) { this.moveRight = function (nodeid, incParent = false, incChild = false, incSelf = true, isAllChild = false, isOnlyLeaf = false, firstSelectedKey = null) { var curNode = dataMap[nodeid], move = true; - if (!curNode) return; + if (!curNode) { + return; + } if (incParent) { var parentNode = dataMap[curNode.pid]; if (parentNode) { @@ -238,21 +241,24 @@ var TreeWapper = function (arbitraryHier) { (curNode.children || []).forEach(item => { item.targetPid = firstSelectedKey ? firstSelectedKey : 'root' }) - } else if (isOnlyLeaf) { - } - if (incParent) - loopParentMove(curNode, move); - if (incChild) - loopChildMove(curNode.children || [], move, isAllChild); - if (isOnlyLeaf) - loopOnlyLeafMove([curNode], move, firstSelectedKey); + if (incParent) { + loopParentMove(curNode, move); + } + if (incChild) { + loopChildMove(curNode.children || [], move, isAllChild); + } + if (isOnlyLeaf) { + loopOnlyLeafMove([curNode], move, firstSelectedKey); + } }; this.moveLeft = function (nodeid, incParent = false, incChild = false, incSelf = true, isAllChild = false, isOnlyLeaf = false) { var curNode = dataMap[nodeid], move = false; - if (!curNode) return; + if (!curNode) { + return; + } // 循环查找 let loopChange = (root) => { @@ -279,12 +285,15 @@ var TreeWapper = function (arbitraryHier) { loopFind(targetTreeNode) } } - if (incParent) + if (incParent) { loopParentMove(curNode, move); - if (incChild) + } + if (incChild) { loopChildMove(curNode.children || [], move, isAllChild); - if (isOnlyLeaf) + } + if (isOnlyLeaf) { loopOnlyLeafMove([curNode], move); + } }; @@ -496,7 +505,9 @@ class Transfer extends Component { var moveToTaget = () => { if (this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function') { let result = this.state.onBeforeEvent('l2r', treeWapper.getData(false), treeWapper.getData(true), origin.selectedKeys); - if (!result) return; + if (!result) { + return; + } } origin.selectedKeys.forEach(key => { treeWapper.moveRight(key, this.state.moveType.incParent, this.state.moveType.incChild, this.state.moveType.incSelf, this.state.moveType.isAllChild, this.state.moveType.isOnlyLeaf, this.state.target.firstSelectedKey); @@ -514,7 +525,9 @@ class Transfer extends Component { var moveToTagetAll = () => { if (this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function') { let result = this.state.onBeforeEvent('all_l2r', treeWapper.getData(false), treeWapper.getData(true)); - if (!result) return; + if (!result) { + return; + } } treeWapper.moveRight('root', false, true, false, true, false); this.state.origin.selectedKeys = []; @@ -531,7 +544,9 @@ class Transfer extends Component { var moveToOrigin = () => { if (this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function') { let result = this.state.onBeforeEvent('r2l', treeWapper.getData(false), treeWapper.getData(true), origin.selectedKeys); - if (!result) return; + if (!result) { + return; + } } target.selectedKeys.forEach(key => { treeWapper.moveLeft(key, this.state.moveType.incParent, this.state.moveType.incChild, this.state.moveType.incSelf, this.state.moveType.isAllChild, this.state.moveType.isOnlyLeaf); @@ -549,7 +564,9 @@ class Transfer extends Component { var moveToOriginAll = () => { if (this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function') { let result = this.state.onBeforeEvent('all_r2l', treeWapper.getData(false), treeWapper.getData(true)); - if (!result) return; + if (!result) { + return; + } } treeWapper.moveLeft('root', false, true, false, true, false); this.state.origin.selectedKeys = []; diff --git a/src/uapbd/public/excomponents/Table.js b/src/uapbd/public/excomponents/Table.js index 64f8ba4a..79a2e540 100644 --- a/src/uapbd/public/excomponents/Table.js +++ b/src/uapbd/public/excomponents/Table.js @@ -3,26 +3,20 @@ * @version: * @Author: Chendch * @Date: 2020-11-30 13:27:04 - * @LastEditors: yanxbm - * @LastEditTime: 2022-06-20 11:19:14 + * @LastEditors: Chendch + * @LastEditTime: 2023-11-30 10:23:44 */ import React, { Component } from 'react'; import ReactDOM, { findDOMNode } from 'react-dom'; -// import BTable from 'bee-table'; - import Utils, {BaseUtils} from '../utils' import {base} from 'nc-lightapp-front'; let { NCCheckbox ,NCDiv,NCTooltip, NCIcon, NCTable: BTable} = base; -// import {component} from '../platwapper/index'; const sort = BTable.sort; -// import sort from "bee-table/build/lib/sort.js"; -import dragColumn from 'bee-table/build/lib/dragColumn'; - +const dragColumn = BTable.dragColumn; import Record from './Record.js'; let DragColumnTable = dragColumn(BTable); -let NCTable = sort(DragColumnTable, NCIcon); +let NCTable = sort(DragColumnTable); var EMPTY_FN = function(){}; -// const {NCTable} = component; //行选择模型 var SelectedModel = function(table,config){ var table = table, @@ -47,8 +41,9 @@ var SelectedModel = function(table,config){ this.selected = (record0, suppressEvent = true) => { var recordid0 = record0 ? record0.getId() : undefined; - if(recordid == recordid0) + if(recordid == recordid0) { return; + } handerSelected(record0, suppressEvent); }; @@ -210,37 +205,61 @@ class Table extends Component { checkedModel = state.checkedModel = new CheckBoxSelectModel(this, checkedModelConfig); //state.columns = state.columns.concat(checkedModel.createCheckBoxColumn()); } - var tooltipcfg = {className:'tooltip-word-color',placement:'top',delay:1}; + var tooltipcfg = {className:'tooltip-word-color',placement:'topLeft',delay:1}; //init column var cfgColumns = props.columns || [], - initColumns = () => { - // var {wappercols} = this.state; - // if(wappercols && wappercols.length>0){ - // return wappercols; - // } - var cols = cfgColumns.map( (col) => { - var dataIndex = col.dataIndex || function(){}, - render = (text, record, index) => { - var value = BaseUtils.isFunction(dataIndex) ? dataIndex(record, index) : record.getData()[dataIndex], - mode = this.getMode(), - editer = !col.editer ? undefined : (BaseUtils.isFunction(col.editer) ? col.editer: createEditer(col.editer)); - if( !(mode==='edit' && editer ) && dataIndex!="controlflag"){ - return ( - {col.render ? col.render(value, record, index) : value} - - ); - } - return {editer(record, index, this, mode)}; - }; - var title = col.require && this.getMode() == 'edit' ? *{col.title} : {col.title}; - return { ...col ,...{dataIndex: dataIndex,attrcode:dataIndex,render:render}, title: title}; - }); - if(state.checkedModel) - cols.unshift(checkedModel.createCheckBoxColumn()); + // initColumns = () => { + // var cols = cfgColumns.map( (col) => { + // var dataIndex = col.dataIndex || function(){}, + // render = (text, record, index) => { + // var value = BaseUtils.isFunction(dataIndex) ? dataIndex(record, index) : record.getData()[dataIndex], + // mode = this.getMode(), + // editer = !col.editer ? undefined : (BaseUtils.isFunction(col.editer) ? col.editer: createEditer(col.editer)); + // if( !(mode==='edit' && editer ) && dataIndex!="controlflag"){ + // return ( + // {col.render ? col.render(value, record, index) : value} + // + // ); + // } + // return {editer(record, index, this, mode)}; + // }; + // var title = col.require && this.getMode() == 'edit' ? *{col.title} : {col.title}; + // return { ...col ,...{dataIndex: dataIndex,attrcode:dataIndex,render:render}, title: title}; + // }); + // if(state.checkedModel) + // cols.unshift(checkedModel.createCheckBoxColumn()); - // this.setState({wappercols:cols}); - return cols; - }; + // // this.setState({wappercols:cols}); + // return cols; + // }; + initColumns = () => { + var cols = cfgColumns.map( (col) => { + var dataIndex = col.dataIndex || function(){}, + render = (text, record, index) => { + var value = BaseUtils.isFunction(dataIndex) ? dataIndex(record, index) : record.getData()[dataIndex], + mode = this.getMode(), + editer = !col.editer ? undefined : (BaseUtils.isFunction(col.editer) ? col.editer: createEditer(col.editer)); + if( !(mode==='edit' && editer ) && dataIndex!="controlflag" && dataIndex!="isfinanceorg" && dataIndex!="isstockorg"){ + return ( + {col.render ? col.render(value, record, index) : value} + + ); + } else if (!(mode==='edit' && editer ) && dataIndex =="isfinanceorg" || dataIndex =="isstockorg") { + return {col.render ? col.render(value, record, index) : value} + + } + return {editer(record, index, this, mode)}; + }; + var title = col.require && this.getMode() == 'edit' ? *{col.title} : {col.title}; + return { ...col ,...{dataIndex: dataIndex,attrcode:dataIndex,render:render}, title: title}; + }); + if(state.checkedModel) { + cols.unshift(checkedModel.createCheckBoxColumn()); + } + + // this.setState({wappercols:cols}); + return cols; + }; state.initColumns = initColumns; let curRowClassName = (record, index) => { var state = this.state, @@ -276,11 +295,11 @@ class Table extends Component { return new Record(data); }); this.state.records = records; + this.state.selectedRowIndex = null; this.state.selectedModel.clearSelected(); this.state.checkedModel && this.state.checkedModel.decheckedAll(); this.setState(this.state, () =>{ this.state.listeners['load'](this, this.state.records); - }); } @@ -293,9 +312,12 @@ class Table extends Component { beforeListener = state.listeners['beforemodechange'], afterListener = state.listeners['modechange'] ; - if(oldMode === 'edit') return; - if( beforeListener(this, oldMode, newMode) === false) + if(oldMode === 'edit') { return; + } + if( beforeListener(this, oldMode, newMode) === false) { + return; + } state.dirtyRecords = Record.copyRecords(state.records) state.mode = newMode; //清理选中行 @@ -314,9 +336,12 @@ class Table extends Component { beforeListener = state.listeners['beforemodechange'], afterListener = state.listeners['modechange'] ; - if(oldMode === 'browse') return; //相同状态改变退出 - if( beforeListener(this, oldMode, newMode) === false) + if(oldMode === 'browse') { + return; //相同状态改变退出 + } + if( beforeListener(this, oldMode, newMode) === false) { return; + } state.dirtyRecords = [] state.mode = newMode; this.setState(state, () => { @@ -334,9 +359,12 @@ class Table extends Component { beforeListener = state.listeners['beforemodechange'], afterListener = state.listeners['modechange'] ; - if(oldMode === 'browse') return; //相同状态改变退出 - if( beforeListener(this, oldMode, newMode) === false) + if(oldMode === 'browse') { + return; //相同状态改变退出 + } + if( beforeListener(this, oldMode, newMode) === false) { return; + } state.records = Record.copyRecords(state.dirtyRecords); state.records = state.records.filter( rcd => rcd.getStatus() !== 'del'); @@ -361,7 +389,9 @@ class Table extends Component { } findRecordById(id){ - if(!id) return undefined; + if(!id) { + return undefined; + } var records = this.findRecordByIds([id]); return records === undefined || records.length == 0 ? undefined : records[0]; } @@ -369,8 +399,9 @@ class Table extends Component { findRecordByIds(ids){ var results = []; this.state.records.forEach((r) => { - if(ids.indexOf(r.getId() ) !== -1) + if(ids.indexOf(r.getId() ) !== -1) { results.push(r); + } }); return results; @@ -395,10 +426,14 @@ class Table extends Component { getDirtyOperation(){ var state = this.state, me = this; - if(state.mode !== 'edit' && state.mode !== 'add') return; + if(state.mode !== 'edit' && state.mode !== 'add') { + return; + } return { findRecordById: (id) => { - if(!id) return undefined; + if(!id) { + return undefined; + } var records = me.getDirtyOperation().findRecordByIds([id]); return records === undefined || records.length == 0 ? undefined : records[0]; }, @@ -421,7 +456,9 @@ class Table extends Component { addData: ( datas ) =>{ var datas = BaseUtils.isArray(datas) ? datas : [datas]; - if(datas.length == 0) return; + if(datas.length == 0) { + return; + } state.dirtyRecords = state.dirtyRecords.concat( datas.map(d =>new Record(d, 'add') ) ); this.setState(state, () => { state.listeners['addDirtyRecord']();//参数以后再加 @@ -479,14 +516,15 @@ class Table extends Component { overflow: "auto" }; return ( - this.myComponent = findDOMNode(component)} fieldid={this.tableConfig.fieldid || "common"} areaCode={NCDiv.config.TableCom}> + this.myComponent = findDOMNode(component)} fieldid={this.tableConfig.fieldid || "common"} areaCode={NCDiv.config.TableCom} + className='uapbd-self-table'> e.getStatus() !== 'del') } {...this.tableConfig} - bodyStyle={bodyStyle} - + bodyStyle={bodyStyle} + rowKey="key" {...this.props.defineColumnConf} sort={sortObj} /> @@ -494,4 +532,4 @@ class Table extends Component { ) } } -export default Table; \ No newline at end of file +export default Table; diff --git a/src/uapbd/public/excomponents/Table.less b/src/uapbd/public/excomponents/Table.less index fa2d4928..abf29557 100644 --- a/src/uapbd/public/excomponents/Table.less +++ b/src/uapbd/public/excomponents/Table.less @@ -1,6 +1,3 @@ -.extable-selected-row{ - background: #ebedf2 -} .excom-table{ .u-form-control-wrapper{ width: 200px diff --git a/src/uapbd/public/excomponents/Transfer.js b/src/uapbd/public/excomponents/Transfer.js index 3ea01afc..c65c1678 100644 --- a/src/uapbd/public/excomponents/Transfer.js +++ b/src/uapbd/public/excomponents/Transfer.js @@ -1,590 +1,2 @@ -import React, { Component } from 'react'; -import {base, getSysFieldid } from 'nc-lightapp-front'; -let {NCTree,NCFormControl ,NCDiv,NCButton } = base; - - -import './Transfer.less'; -import '../uapbdstyle/uapbd_style_common.less'; -var EMPTY_FN = function(){}; -// 2207版本 树的展开收起比较卡顿 已和组件部同事沟通 如项目中有问题 可将 showLine 设置为 false 并且将树的动画关闭 openAnimation={{}}, -// 2207版走遗留 钉耙说是在下版会优化 -var TreeWapper = function(arbitraryHier){ - var datas = [], - dataMap = {}, - root = { - root: true, - key: 'root', - code:'', - title: '' - }; - var targetTreeNode = {} - // 右树是否允许任意调整层次结构,true为允许 - this.arbitraryHier = arbitraryHier - - this.setRootTitle = function(title){ - root.title = title; - //为了适配恶心的自动化测试 - root.code = title; - } - - this.initData = function(ds){ - datas = ds; - var loop = (nodes) => { - nodes.forEach(node => { - if(node.key != 'root' && !node.pid){ - node.pid = 'root'; - } - dataMap[node.key] = node; - loop(node.children||[]); - }); - }; - loop(datas); - dataMap[root.key] = {...root, children: ds}; - }.bind(this); - - var buildNodeTreeNode = function(move = true, firstSelectedKey = null){ - var newRoot = { ...root}, - loop = (nodes, pnode) => { - nodes.map( node => { - var movesign = node.move && !(node.nodeData && !!node.nodeData.isFix) ? true: false, - n = movesign == move ? {... node, children: []} : undefined , - childs = node.children || []; - if(n){ - pnode.children = pnode.children || []; - pnode.children.push(n); - } - loop(childs, n || newRoot); - }); - }; - - // 如果是右树的渲染,重新根据targetPid构造一棵树 - if(this.arbitraryHier && move) { - loop = (nodes, newRoot) => { - nodes.forEach((node, index, attr) => { - let movesign = node.move && !(node.nodeData && !!node.nodeData.isFix) ? true: false, - n = movesign == move ? {... node, children: []} : undefined; - if(n && n.targetPid && n.targetPid == newRoot.key) { - newRoot.children = newRoot.children || [] - newRoot.children.push(n) - //attr.splice(index, 1) - } - }) - - if(newRoot.children) { - newRoot.children.forEach((root) => { - loop(nodes, root); - }) - } - }; - - let newNodesList = [] - for(let nodeKey in dataMap) { - newNodesList.push(dataMap[nodeKey]) - } - loop(newNodesList, newRoot) - targetTreeNode = newRoot - return newRoot - } - loop(datas, newRoot); - return newRoot; - }.bind(this); - - this.renderNode = (move = false, textValue,flag,keys, firstSelectedKey = null) => { - var root = buildNodeTreeNode(move, firstSelectedKey); - var nodeComps, expandKeys = []; - - if(textValue){ - const loopsearch = (nodes = []) => { - var parendExpand = false; - (nodes || [] ).forEach(child => { - var expand = loopsearch( child.children || [] ); - child.needExpand = expand; - child.needShow = expand ? true: (child.code && child.code.indexOf(textValue) != -1 || (child.title.indexOf(textValue) != -1)? true: false); - parendExpand = parendExpand ? parendExpand :child.needShow; - if(expand){ - expandKeys.push(child.key); - } - }); - return parendExpand; - } - var rootExpand = loopsearch([root]); - expandKeys.push('root'); - } - - if(!flag){ - expandKeys = keys; - } - - var renderTreeTitle = (item, pitem) => { - let child = item.children || []; - let isLeaf = !child.length; - var drawTitleString = (title) =>{ - if(textValue && textValue.length > 0 && title && title.length > 0 && title.indexOf(textValue) != -1 ){ - var start = title.indexOf(textValue) , end = start + textValue.length; - return {title.substring(0, start)}{textValue}{title.substring(end, title.length)} - }else{ - return ({title}); - } - }; - // {title} 样例子 - // let titleInfo = -1 ? 'icon iconfont icon-wenjianjiadakai tree-wenjian':'icon iconfont icon-wenjianjia tree-wenjian'}> {item.key != 'root' && drawTitleString(item.code)}  {drawTitleString(item.name || item.title)} - let titleInfo = {item.key != 'root' && drawTitleString(item.code)}  {drawTitleString(item.name || item.title)} - return (
{titleInfo}
); - }; - - const loopdraw = (datas, pdata) => { - return datas.filter( item => { - return (item.needShow == undefined && item.needExpand == undefined) || item.needShow || item.needExpand || item.key == 'root'; - }).map((item) => { - var children = item.children || []; - let isLeaf = !children.length; - let switcherName = isLeaf ? 'isLeaf_hiden_point_line':'isLeaf_show_point_line'; - return ({loopdraw(children)}) - }); - } - nodeComps = loopdraw([root]); - return { - nodeComps: nodeComps, - expandKeys: expandKeys - }; - }; - - var loopChildMove = function(nodes, move = false,isAllChild = true){ - nodes.forEach( n => { - n.move = move; - if(move && !n.targetPid) { - // 如果是子节点的话,右树会保持原有的节点层次结构,故而targetPid为原先的pid - n.targetPid = n.pid - } - else if(!move) { - n.targetPid = null - } - isAllChild && loopChildMove(n.children || [], move); - }); - }; - - var loopOnlyLeafMove = function(nodes,move=false, firstSelectedKey = null){ - nodes.forEach( n => { - if(!n.children || n.children.length === 0){ - n.move = move; - if(move) { - n.targetPid = firstSelectedKey ? firstSelectedKey : 'root' - } - else { - n.targetPid = null - } - } - loopOnlyLeafMove(n.children || [], move); - }); - } - - var loopParentMove = function(n, move = false){ - var pid = n.pid, - pnode = dataMap[pid] || root; - if(pnode.root) - return; - pnode.move = move; - loopParentMove(pnode,move); - }; - - this.moveRight = function(nodeid, incParent = false, incChild = false, incSelf = true,isAllChild=false,isOnlyLeaf=false, firstSelectedKey = null){ - var curNode = dataMap[nodeid], - move = true; - if(!curNode) return; - if(incParent){ - var parentNode = dataMap[curNode.pid]; - if(parentNode){ - parentNode.targetPid = firstSelectedKey ? firstSelectedKey : 'root' - } - }else if(incSelf){ - curNode.move = move; - curNode.targetPid = firstSelectedKey ? firstSelectedKey : 'root' - }else if(incChild || isAllChild){ - (curNode.children || []).forEach(item=>{ - item.targetPid = firstSelectedKey ? firstSelectedKey : 'root' - }) - }else if(isOnlyLeaf){ - - } - if(incParent) - loopParentMove(curNode, move); - if(incChild) - loopChildMove(curNode.children || [], move,isAllChild); - if(isOnlyLeaf) - loopOnlyLeafMove([curNode],move,firstSelectedKey); - }; - - this.moveLeft = function(nodeid, incParent = false, incChild = false, incSelf = true,isAllChild=false,isOnlyLeaf=false){ - var curNode = dataMap[nodeid], - move = false; - if(!curNode) return; - - // 循环查找 - let loopChange = (root) => { - let tempNode = dataMap[root.key] - tempNode.targetPid = null - tempNode.move = false - root.children.forEach(item => { - loopChange(item) - }) - } - let loopFind = (root) => { - if(root.key == curNode.key) { - loopChange(root) - } - root.children.forEach(item => { - loopFind(item) - }) - } - // NC端如果右树是可随便调整层次结构的话,那么左移的时候是将选中节点及其子节点都移到左边来 - // 不管下面配置的节点移动方式 - if(incSelf) { - curNode.move = move; - if(arbitraryHier) { - loopFind(targetTreeNode) - } - } - if(incParent) - loopParentMove(curNode, move); - if(incChild) - loopChildMove(curNode.children ||[], move,isAllChild); - if(isOnlyLeaf) - loopOnlyLeafMove([curNode],move); - - }; - - this.getData = function(move){ - var resultNodes = [], - rootNode = dataMap['root']; - - var loopChild = function(nodes){ - nodes.forEach( n => { - if(!!n.move === move && !(n.nodeData && !!n.nodeData.isFix)){ - let resultNode = {... n, children: []} - // 如果是右树可任意调整层次结构的话,那么就需要更正一下原有的层次结构 - if(arbitraryHier) { - resultNode.pid = resultNode.targetPid - } - resultNodes.push(resultNode); - } - loopChild(n['children'] || []); - }); - }; - loopChild((rootNode && rootNode['children']) || []); - return resultNodes; - }; -}; - - -class Transfer extends Component { - constructor(props) { - super(props); - this.state = { - lang : props.lang, - treeWapper: new TreeWapper(this.props.arbitraryHier ? true : false), - showSearch:!!props.showSearch, - onBeforeEvent:props.onBeforeEvent, - onAfterEvent:props.onAfterEvent, - hideAllMoveBtn:props.hideAllMoveBtn, - treesearchorigin:{ - type: 'search', - fieldid:'originsearch', - value: undefined, - onChange:(value) =>{ - this.state.treesearchorigin.value = value; - this.setState(this.state); - }, - onSearch: () =>{ - this.state.origin.searchValue = this.state.treesearchorigin.value; - this.state.origin.autoExpandParent = true; - this.state.origin.searchExpand = false; - this.setState(this.state); - } - }, - origin: { - searchValue: undefined, - selectedKeys:[], - fieldid:'origintree', - expandedKeys:['root'], - multiple: true, - autoExpandParent: true, - searchExpand:true, - showLine:true, - onSelect: (selectedKeys) => { - this.state.origin.selectedKeys = selectedKeys; - this.setState(this.state); - }, - onExpand : (expandedKeys) => { - this.state.origin.expandedKeys = expandedKeys; - this.state.origin.autoExpandParent = false; - this.state.origin.searchExpand = true; - this.setState(this.state); - } - }, - treesearchtarget:{ - type: 'search', - fieldid:'targetsearch', - value: undefined, - onChange:(value) =>{ - this.state.treesearchtarget.value = value; - this.setState(this.state); - }, - onSearch: () =>{ - this.state.target.searchValue = this.state.treesearchtarget.value; - this.state.target.autoExpandParent = true; - this.state.target.searchExpand = false; - this.setState(this.state); - } - }, - target: { - searchValue: undefined, - selectedKeys:[], - showLine:true, - fieldid:'targettree', - expandedKeys:['root'], - multiple: true, - autoExpandParent: true, - searchExpand:true, - firstSelectedKey: null, - onSelect: (selectedKeys) => { - if(selectedKeys == null || selectedKeys.length == 0) { - this.state.target.firstSelectedKey = null - } - else if(!this.state.target.firstSelectedKey) { - this.state.target.firstSelectedKey = selectedKeys[0] - } - this.state.target.selectedKeys = selectedKeys; - this.setState(this.state); - }, - onExpand : (expandedKeys) => { - this.state.target.expandedKeys = expandedKeys; - this.state.target.autoExpandParent = false; - this.state.target.searchExpand = true; - this.setState(this.state); - } - }, - incChild:{ - checked: false, - onChange: (v) => { - this.state.incChild.checked = v; - this.setState(this.state); - } - }, - moveType:{ - ncParent: false, - incChild: true, - incSelf: true, - isAllChild:true, - isOnlyLeaf:false - } - }; - if(this.state.lang && this.state.lang.rootName){ - this.setRootTitle(this.state.lang.rootName); - } - } - - /** - * 设置树节点移动类型 - */ - setMoveType=(type)=>{ - switch(type){ - case '0'://包含所有下级 - this.state.moveType.incParent=false; - this.state.moveType.incChild=true; - this.state.moveType.incSelf=true; - this.state.moveType.isAllChild=true; - this.state.moveType.isOnlyLeaf = false; - this.setState(this.state); - break; - case '1'://仅自己 - this.state.moveType.incParent=false; - this.state.moveType.incChild=false; - this.state.moveType.incSelf=true; - this.state.moveType.isAllChild=false; - this.state.moveType.isOnlyLeaf=false; - this.setState(this.state); - break; - case '2'://仅直接下级 - this.state.moveType.incParent = false; - this.state.moveType.incChild = true; - this.state.moveType.incSelf = false; - this.state.moveType.isAllChild = false; - this.state.moveType.isOnlyLeaf=false; - this.setState(this.state); - break; - case '3'://仅末级 - this.state.moveType.incParent = false; - this.state.moveType.incChild = false; - this.state.moveType.incSelf = false; - this.state.moveType.isAllChild = false; - this.state.moveType.isOnlyLeaf = true; - - } - } - - /** - * 设置根节点名称 - */ - setRootTitle = (title) =>{ - this.state.treeWapper.setRootTitle(title); - this.setState(this.state); - } - - /** - * 设置树数据 - * @param {*} data - */ - reset(data){ - this.state.treeWapper.initData(data); - this.setState(this.state); - } - - getData(move = true){ - return this.state.treeWapper.getData(move); - } - render() { - var treeWapper = this.state.treeWapper, - origin = this.state.origin, - target = this.state.target; - - var moveToTaget = () => { - if(this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function'){ - let result = this.state.onBeforeEvent('l2r',treeWapper.getData(false),treeWapper.getData(true),origin.selectedKeys); - if(!result) return; - } - origin.selectedKeys.forEach(key => { - treeWapper.moveRight(key, this.state.moveType.incParent, this.state.moveType.incChild, this.state.moveType.incSelf,this.state.moveType.isAllChild,this.state.moveType.isOnlyLeaf,this.state.target.firstSelectedKey); - }); - this.state.origin.selectedKeys=[]; - this.state.target.selectedKeys=[]; - this.state.target.firstSelectedKey = null - this.setState(this.state,()=>{ - if(this.state.onAfterEvent && typeof this.state.onAfterEvent === 'function'){ - this.state.onAfterEvent('l2r',treeWapper.getData(false),treeWapper.getData(true),origin.selectedKeys); - } - }); - }; - - var moveToTagetAll = () => { - if(this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function'){ - let result = this.state.onBeforeEvent('all_l2r',treeWapper.getData(false),treeWapper.getData(true)); - if(!result) return; - } - treeWapper.moveRight('root', false, true, false,true,false ); - this.state.origin.selectedKeys=[]; - this.state.target.selectedKeys=[]; - this.state.target.firstSelectedKey = null - this.setState(this.state,()=>{ - if(this.state.onAfterEvent && typeof this.state.onAfterEvent === 'function'){ - this.state.onAfterEvent('all_l2r',treeWapper.getData(false),treeWapper.getData(true)); - } - }); - }; - - - var moveToOrigin = () =>{ - if(this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function'){ - let result = this.state.onBeforeEvent('r2l',treeWapper.getData(false),treeWapper.getData(true),origin.selectedKeys); - if(!result) return; - } - target.selectedKeys.forEach(key =>{ - treeWapper.moveLeft(key, this.state.moveType.incParent, this.state.moveType.incChild, this.state.moveType.incSelf,this.state.moveType.isAllChild,this.state.moveType.isOnlyLeaf); - }); - this.state.origin.selectedKeys=[]; - this.state.target.selectedKeys=[]; - this.state.target.firstSelectedKey = null - this.setState(this.state,()=>{ - if(this.state.onAfterEvent && typeof this.state.onAfterEvent === 'function'){ - this.state.onAfterEvent('r2l',treeWapper.getData(false),treeWapper.getData(true),origin.selectedKeys); - } - }); - }; - - var moveToOriginAll = () =>{ - if(this.state.onBeforeEvent && typeof this.state.onBeforeEvent === 'function'){ - let result = this.state.onBeforeEvent('all_r2l',treeWapper.getData(false),treeWapper.getData(true)); - if(!result) return; - } - treeWapper.moveLeft('root', false, true, false,true,false); - this.state.origin.selectedKeys=[]; - this.state.target.selectedKeys=[]; - this.state.target.firstSelectedKey = null - this.setState(this.state,()=>{ - if(this.state.onAfterEvent && typeof this.state.onAfterEvent === 'function'){ - this.state.onAfterEvent('all_r2l',treeWapper.getData(false),treeWapper.getData(true)); - } - }); - } - - var orignRender = treeWapper.renderNode(false, origin.searchValue,!!(origin.searchValue && !this.state.origin.searchExpand),origin.expandedKeys); - var targetRender = treeWapper.renderNode(true, target.searchValue,!!(target.searchValue && !this.state.target.searchExpand),target.expandedKeys, this.state.target.firstSelectedKey); - - var orignExpandKeys = origin.searchValue && !this.state.origin.searchExpand ? orignRender.expandKeys : origin.expandedKeys; - var targetExpandKeys = target.searchValue && !this.state.target.searchExpand ? targetRender.expandKeys : target.expandedKeys; - - var originTree = { - ...origin, - expandedKeys: orignExpandKeys - }; - - var targetTree = { - ...target, - expandedKeys: targetExpandKeys - }; - - return ( -
- -
-
{this.state.lang&&this.state.lang.leftTreeName?this.state.lang.leftTreeName:''}
- {this.state.showSearch&&(
- -
)} -
- - } - openIcon={} - {...originTree}>{orignRender.nodeComps} - -
- {/*
*/} -
- -
-
- > -
-
- {!this.state.hideAllMoveBtn && >>} -
-
- < -
-
- {!this.state.hideAllMoveBtn && <<} -
-
- -
-
{this.state.lang&&this.state.lang.rightTreeName?this.state.lang.rightTreeName:''}
- {this.state.showSearch&&(
- -
)} -
- - } - openIcon={} - {...targetTree}>{targetRender.nodeComps} - -
-
- -
- ) - } -} +import Transfer from "../../common/components/lrTransfer"; export default Transfer; \ No newline at end of file diff --git a/src/uapbd/public/excomponents/TransferForMulti.js b/src/uapbd/public/excomponents/TransferForMulti.js index 7e973501..f45efbca 100644 --- a/src/uapbd/public/excomponents/TransferForMulti.js +++ b/src/uapbd/public/excomponents/TransferForMulti.js @@ -159,7 +159,9 @@ export default class TransferForMulti extends Component{ return this.TransferTreeMethods.getNodeByKey(rightTree, key); }); let result = this.props.beforeMove(nodes,this.state.value,'br2l');//从右树到左树移动前事件 - if(!result) return; + if(!result) { + return; + } } let nodes = this.TransferTreeMethods.addToTree(this.state.treeType, rightTree,leftTree, checkedKeys, halfCheckedKeys,this.rightDataList, this.leftDataList, this.props.rightFixed, this.state.selectType,this.props.referLeftTree); // nodes = this.TransferTreeMethods.delParents(nodes, rightTree); @@ -218,7 +220,9 @@ export default class TransferForMulti extends Component{ return this.TransferTreeMethods.getNodeByKey(leftTree, key); }); let result = this.props.beforeMove(nodes,this.state.value,'bl2r');//从右树到左树移动前事件 - if(!result) return; + if(!result) { + return; + } } //删除左树节点 let nodes = this.TransferTreeMethods.addToTree(this.state.treeType, leftTree,rightTree, checkedKeys, halfCheckedKeys,this.leftDataList, this.rightDataList, false, this.state.selectType); @@ -271,12 +275,7 @@ export default class TransferForMulti extends Component{ let moveNodes=[]; // 不通过合并算法 左树是右树的子集 if(this.props.allToLeft_without_merge){ - // TODO - if(this.props.leftFixed){ - - }else{ - - } + // TODO do nothing }else{ let checkedKeys = this.TransferTreeMethods.getAllNodeKeys(rightTree); checkedKeys = this.state.treeType == 'VRFusion' ? checkedKeys.reverse() : checkedKeys; @@ -319,7 +318,9 @@ export default class TransferForMulti extends Component{ return this.TransferTreeMethods.getNodeByKey(rightTree, key); }); let result = this.props.beforeMove(nodes,this.state.value,'br2l');//从右树到左树移动前事件 - if(!result) return; + if(!result) { + return; + } } nodes = this.TransferTreeMethods.addToTree(this.state.treeType, rightTree,leftTree, checkedKeys, halfCheckedKeys,this.rightDataList, this.leftDataList, false, this.state.selectType); // nodes = this.TransferTreeMethods.delParents(nodes, rightTree); @@ -390,7 +391,9 @@ export default class TransferForMulti extends Component{ return this.TransferTreeMethods.getNodeByKey(leftTree, key); }); let result = this.props.beforeMove(nodes,this.state.value,'bl2r');//从右树到左树移动前事件 - if(!result) return; + if(!result) { + return; + } } //删除左树节点 nodes = this.TransferTreeMethods.addToTree(this.state.treeType,leftTree,rightTree, checkedKeys, halfCheckedKeys,this.leftDataList, this.rightDataList, false, this.state.selectType); @@ -834,7 +837,9 @@ export default class TransferForMulti extends Component{ if (node.children && node.children.length>0) { this.generateList(node.children, dataList,hash, list,listWithoutChildren, fixedList, unfixedList); }else{ - if(!hash || hash[keyid]) continue; + if(!hash || hash[keyid]) { + continue; + } listWithoutChildren && (listWithoutChildren.push({id: keyid, pid})); if(fixed){ diff --git a/src/uapbd/public/excomponents/Trtree.js b/src/uapbd/public/excomponents/Trtree.js index 52dd8381..9250edd8 100644 --- a/src/uapbd/public/excomponents/Trtree.js +++ b/src/uapbd/public/excomponents/Trtree.js @@ -48,7 +48,9 @@ const filterChildrens = (tree) => { */ function getTreeDataById(treeId){ let tree = this.state.TransfertreeData[treeId].data; - if(!tree) tree = this.state.TransfertreeData[treeId].data = []; + if(!tree) { + tree = this.state.TransfertreeData[treeId].data = []; + } return tree; } diff --git a/src/uapbd/public/excomponents/pubUtils/dealCardData.js b/src/uapbd/public/excomponents/pubUtils/dealCardData.js index 9caf2ab4..5222faa7 100644 --- a/src/uapbd/public/excomponents/pubUtils/dealCardData.js +++ b/src/uapbd/public/excomponents/pubUtils/dealCardData.js @@ -1,37 +1,29 @@ -/* - * @Descripttion: - * @version: - * @Author: Chendch - * @Date: 2020-11-30 13:28:43 - * @LastEditors: Chendch - * @LastEditTime: 2020-12-03 19:04:32 - */ /** * hanzhhm * 主子表清除表格表单数据,为了数据上行流量,减少压缩时间 */ // tableIds 一主多子传tableIds数组 -// 一组一子不用传 -let dealCardData = (that,cardData,tableIds) =>{ +// 一主一子不用传 +let dealCardData = (that, cardData, tableIds) => { let newCardData = JSON.parse(JSON.stringify(cardData)); let head = newCardData.head[that.formId].rows[0]; - dealHead(head ,newCardData); + let pageid = cardData.pageid; + dealHead(head); - if(tableIds){ + if (tableIds) { tableIds.forEach(tableId => { - let bodys = newCardData.bodys[tableId].rows; - dealbodys(bodys,newCardData); + let bodys = newCardData.bodys[tableId].rows; + dealbodys(bodys, pageid); }); - }else{ - let bodys = newCardData.body[that.tableId].rows; - dealbodys(bodys,newCardData); - } + } else { + let bodys = newCardData.body[that.tableId].rows; + dealbodys(bodys, pageid); + } return newCardData; } - -let dealHead = (head, newCardData) =>{ +let dealHead = (head) => { let values = head.values; Object.keys(values).map((key, index) => { //清空value和display @@ -41,6 +33,10 @@ let dealHead = (head, newCardData) =>{ if (!valueFlag && (scale == '-1' || !scale)) { values[key] = {}; + } else if (key.indexOf('.name') > -1) { + // values[key] ={}; + //直接删除,不传后台 + Reflect.deleteProperty(values, key); } else { //去掉display if (scale && valueFlag) { @@ -50,52 +46,78 @@ let dealHead = (head, newCardData) =>{ } else if (!scale && valueFlag) { values[key] = { value: value }; } - } return key; }); } -let dealbodys = (bodys, newCardData) =>{ +let dealbodys = (bodys, pageid) => { let length = bodys.length; - for(let i = 0 ;i < length ; i ++){ + for (let i = 0; i < length; i++) { let body = bodys[i]; - if(!body){ + if (!body) { continue; } + //增行的数据body中,会多出来一个value字段,且复制的行没有value数据,跟values字段数据重复,替换成null减少上行数据量 + if (body.value) { + body.value = null; + } + Reflect.deleteProperty(body, 'pid'); + Reflect.deleteProperty(body, 'isleaf'); + Reflect.deleteProperty(body, 'depth'); + Reflect.deleteProperty(body, 'height'); + Reflect.deleteProperty(body, 'selected'); + Reflect.deleteProperty(body, 'range'); + // Reflect.deleteProperty(body, 'path'); + Reflect.deleteProperty(body, 'viewIndex'); + Reflect.deleteProperty(body, 'leafIndex'); + Reflect.deleteProperty(body, 'rowId'); + Reflect.deleteProperty(body, 'key'); + Reflect.deleteProperty(body, 'dataIndex'); + let values = body.values; Object.keys(values).map((key) => { //清空value和display let value = values[key].value; let scale = values[key].scale; let valueFlag = getValueFlag(value); - - if(!valueFlag&& (scale == '-1'||!scale)){ - values[key] ={}; - }else{ - //去掉display - if(scale && valueFlag){ - values[key] ={value:value,scale:scale}; - }else if(scale && !valueFlag){ - values[key] ={scale:scale}; - }else if(!scale && valueFlag){ - values[key] ={value:value}; + //name字段清空 + if (key.indexOf('.name') > -1 || key.indexOf('path') > -1) { + // values[key] ={}; + //直接删除,不传后台 + Reflect.deleteProperty(values, key); + } else if (pageid.indexOf('10140CECA') > -1 || pageid.indexOf('10140CECG') > -1) { + // 成本组件与要素对照删除要素和组件名称,减小上行流量 + if (key.indexOf('.factorname') > -1 || key.indexOf('.vcostcomponentname') > -1) { + Reflect.deleteProperty(values, key); } - + } + else if (!valueFlag && (scale == '-1' || !scale)) { + values[key] = {}; + } else { + //去掉display + if (scale && valueFlag) { + values[key] = { value: value, scale: scale }; + } else if (scale && !valueFlag) { + values[key] = { scale: scale }; + } else if (!scale && valueFlag) { + values[key] = { value: value }; + } + } return key; }); } } //false 代表value不存在 true代表value存在 -let getValueFlag = (value)=>{ +let getValueFlag = (value) => { //因为value可能为布尔类型,布尔类型为false的话也认为是有值的 - if(value===null || value===undefined || value === ''){ + if (value === null || value === undefined || value === '') { return false; - }else{ + } else { return true; } } -export { dealCardData}; \ No newline at end of file +export { dealCardData }; \ No newline at end of file diff --git a/src/uapbd/public/getRandom/index.js b/src/uapbd/public/getRandom/index.js index a4bf71ca..249b10f6 100644 --- a/src/uapbd/public/getRandom/index.js +++ b/src/uapbd/public/getRandom/index.js @@ -1,4 +1,3 @@ -/*sJ5w0OLWWzHCTOs1SA5XRP3ky4NVsCl1Wb/Z+hsZYmY=*/ /** * @ Author: yanxbm * @ Create Time: 2021-02-20 15:42:46 @@ -14,5 +13,4 @@ const getRandom = () => { } return window.crypto.getRandomValues(new Uint32Array(1))[0] / 4294967296; } -export default getRandom; -/*sJ5w0OLWWzHCTOs1SA5XRP3ky4NVsCl1Wb/Z+hsZYmY=*/ \ No newline at end of file +export default getRandom; \ No newline at end of file diff --git a/src/uapbd/public/image/enterpriseRiskOverview/bussCount_img.png b/src/uapbd/public/image/enterpriseRiskOverview/bussCount_img.png new file mode 100644 index 00000000..dc431d07 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/bussCount_img.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/head_bg.png b/src/uapbd/public/image/enterpriseRiskOverview/head_bg.png new file mode 100644 index 00000000..71cacc79 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/head_bg.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/manageCount_img.png b/src/uapbd/public/image/enterpriseRiskOverview/manageCount_img.png new file mode 100644 index 00000000..00c780c3 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/manageCount_img.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/nodata.png b/src/uapbd/public/image/enterpriseRiskOverview/nodata.png new file mode 100644 index 00000000..8b135aa8 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/nodata.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/noreg.png b/src/uapbd/public/image/enterpriseRiskOverview/noreg.png new file mode 100644 index 00000000..2e81443d Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/noreg.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/proRightCount_img.png b/src/uapbd/public/image/enterpriseRiskOverview/proRightCount_img.png new file mode 100644 index 00000000..b28ed641 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/proRightCount_img.png differ diff --git a/src/uapbd/public/image/enterpriseRiskOverview/riskCount_img.png b/src/uapbd/public/image/enterpriseRiskOverview/riskCount_img.png new file mode 100644 index 00000000..dc37c327 Binary files /dev/null and b/src/uapbd/public/image/enterpriseRiskOverview/riskCount_img.png differ diff --git a/src/uapbd/public/image/impdata/help-img-black.png b/src/uapbd/public/image/impdata/help-img-black.png new file mode 100644 index 00000000..deca7c9a Binary files /dev/null and b/src/uapbd/public/image/impdata/help-img-black.png differ diff --git a/src/uapbd/public/image/impdata/help-img.png b/src/uapbd/public/image/impdata/help-img.png new file mode 100644 index 00000000..8e651f96 Binary files /dev/null and b/src/uapbd/public/image/impdata/help-img.png differ diff --git a/src/uapbd/public/image/matterial/no-picture.png b/src/uapbd/public/image/matterial/no-picture.png new file mode 100644 index 00000000..99884d7b Binary files /dev/null and b/src/uapbd/public/image/matterial/no-picture.png differ diff --git a/src/uapbd/public/image/org/helpgif.gif b/src/uapbd/public/image/org/helpgif.gif new file mode 100644 index 00000000..302a86b1 Binary files /dev/null and b/src/uapbd/public/image/org/helpgif.gif differ diff --git a/src/uapbd/public/image/orgrapaidcopy/arrow.png b/src/uapbd/public/image/orgrapaidcopy/arrow.png new file mode 100644 index 00000000..70df72f3 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/arrow.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/copyed.png b/src/uapbd/public/image/orgrapaidcopy/copyed.png new file mode 100644 index 00000000..c4eab894 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/copyed.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/copying.png b/src/uapbd/public/image/orgrapaidcopy/copying.png new file mode 100644 index 00000000..fe0aa358 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/copying.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/copytoastbg.png b/src/uapbd/public/image/orgrapaidcopy/copytoastbg.png new file mode 100644 index 00000000..4e73602c Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/copytoastbg.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/helptip.png b/src/uapbd/public/image/orgrapaidcopy/helptip.png new file mode 100644 index 00000000..a84be220 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/helptip.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/helptipbg.png b/src/uapbd/public/image/orgrapaidcopy/helptipbg.png new file mode 100644 index 00000000..7c294616 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/helptipbg.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/noData.png b/src/uapbd/public/image/orgrapaidcopy/noData.png new file mode 100644 index 00000000..da5717f7 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/noData.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/orgchoosebg.png b/src/uapbd/public/image/orgrapaidcopy/orgchoosebg.png new file mode 100644 index 00000000..653ad4ca Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/orgchoosebg.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/orgtipbg.png b/src/uapbd/public/image/orgrapaidcopy/orgtipbg.png new file mode 100644 index 00000000..62783bfb Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/orgtipbg.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgc.png b/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgc.png new file mode 100644 index 00000000..deec21e8 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgc.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgcblack.png b/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgcblack.png new file mode 100644 index 00000000..4605d402 Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/orgwedigetbgcblack.png differ diff --git a/src/uapbd/public/image/orgrapaidcopy/tableNoData.png b/src/uapbd/public/image/orgrapaidcopy/tableNoData.png new file mode 100644 index 00000000..a658171d Binary files /dev/null and b/src/uapbd/public/image/orgrapaidcopy/tableNoData.png differ diff --git a/src/uapbd/public/image/widget/boot_widget_arrow.png b/src/uapbd/public/image/widget/boot_widget_arrow.png new file mode 100644 index 00000000..a77952b7 Binary files /dev/null and b/src/uapbd/public/image/widget/boot_widget_arrow.png differ diff --git a/src/uapbd/public/image/widget/boot_widget_arrows.png b/src/uapbd/public/image/widget/boot_widget_arrows.png new file mode 100644 index 00000000..4060483d Binary files /dev/null and b/src/uapbd/public/image/widget/boot_widget_arrows.png differ diff --git a/src/uapbd/public/image/widget/boot_widget_import.png b/src/uapbd/public/image/widget/boot_widget_import.png new file mode 100644 index 00000000..34022f41 Binary files /dev/null and b/src/uapbd/public/image/widget/boot_widget_import.png differ diff --git a/src/uapbd/public/image/widget/boot_widget_point1.png b/src/uapbd/public/image/widget/boot_widget_point1.png new file mode 100644 index 00000000..f043e3aa Binary files /dev/null and b/src/uapbd/public/image/widget/boot_widget_point1.png differ diff --git a/src/uapbd/public/image/widget/boot_widget_point2.png b/src/uapbd/public/image/widget/boot_widget_point2.png new file mode 100644 index 00000000..6705b84c Binary files /dev/null and b/src/uapbd/public/image/widget/boot_widget_point2.png differ diff --git a/src/uapbd/public/image/widget/datainit_widget_bg.png b/src/uapbd/public/image/widget/datainit_widget_bg.png new file mode 100644 index 00000000..a227195b Binary files /dev/null and b/src/uapbd/public/image/widget/datainit_widget_bg.png differ diff --git a/src/uapbd/public/image/widget/datainit_widget_black_bg.png b/src/uapbd/public/image/widget/datainit_widget_black_bg.png new file mode 100644 index 00000000..3f0310fe Binary files /dev/null and b/src/uapbd/public/image/widget/datainit_widget_black_bg.png differ diff --git a/src/uapbd/public/image/widget/datainit_widget_inner_bg.png b/src/uapbd/public/image/widget/datainit_widget_inner_bg.png new file mode 100644 index 00000000..b425b047 Binary files /dev/null and b/src/uapbd/public/image/widget/datainit_widget_inner_bg.png differ diff --git a/src/uapbd/public/image/widget/error.png b/src/uapbd/public/image/widget/error.png new file mode 100644 index 00000000..05c57d86 Binary files /dev/null and b/src/uapbd/public/image/widget/error.png differ diff --git a/src/uapbd/public/image/widget/someerror.png b/src/uapbd/public/image/widget/someerror.png new file mode 100644 index 00000000..c610d6a7 Binary files /dev/null and b/src/uapbd/public/image/widget/someerror.png differ diff --git a/src/uapbd/public/packages/StrongReminder/index.less b/src/uapbd/public/packages/StrongReminder/index.less new file mode 100644 index 00000000..2906ad35 --- /dev/null +++ b/src/uapbd/public/packages/StrongReminder/index.less @@ -0,0 +1,30 @@ +.strongreminder { + padding: 0 20px 0 14px; + height: 30px; + width: fit-content; + max-width: 100%; + line-height: 30px; + color: #F96262; + font-size: 12px; + border-radius:3px; + border:1px solid #FFD1D1; + background-color: #FFF5F5; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + .iconfont { + display: inline-block; + vertical-align: top; + padding-left: 0px; + } + .uf { + color: #F45656 !important; + font-size: 15px; + font-weight: normal; + } + .des { + font-size: 12px; + padding-left: 8px; + font-weight: normal; + } +} diff --git a/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/StructTree.js b/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/StructTree.js index b85262f3..99e2e673 100644 --- a/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/StructTree.js +++ b/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/StructTree.js @@ -195,7 +195,9 @@ export default class StructTree extends Component { let titledis=item.values[displayKey].value+" "+item.values['name'].value; return ; }); - if(!this.state.treeData) return null; + if(!this.state.treeData) { + return null; + } const treeNodes = loop(this.state.treeData); return { let {success, data} = res; - if(!success) return ; + if(!success) { + return ; + } that.begMemberTree(pk_member); }, error: (res) => { @@ -79,7 +81,9 @@ export default class StructuralAdjustModal extends Component{ data: queryParams, success: (res) => { const {success, data} = res; - if(!success) return ; + if(!success) { + return ; + } let grid = data.grid || {}, tableKey = Object.keys(grid)[1]; let memberTreeTable = data.grid ? data.grid[tableKey] : {}, diff --git a/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/index.less b/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/index.less new file mode 100644 index 00000000..38ddd0f1 --- /dev/null +++ b/src/uapbd/public/packages/StructuralAdjust/StructuralAdjustModal/index.less @@ -0,0 +1,42 @@ + +.structural-adjust{ + .u-modal-content { + height: calc(~'100vh'); + } + .u-modal-body { + height: calc(~'100vh - 40px'); + } + .structural-adjustment-contain{ + display: flex; + min-height: 300px; + height: calc(~'100% - 20px'); + position: relative; + + .opr-btn{ + margin-bottom: 5px; + display: block; + } + .struct-tree-contain{ + flex: 1; + overflow: auto; + height: 100%; + } + .btn-group{ + width: 120px; + height: 100%; + padding-left: 10px; + border-left: 1px solid #ddd; + } + } + .struct-modal-footer{ + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 8px 10px; + overflow: hidden; + text-align: right; + border-top: 1px solid #ddd; + background-color: #fff; + } +} diff --git a/src/uapbd/public/packages/StructuralAdjust/index.js b/src/uapbd/public/packages/StructuralAdjust/index.js index 5ea8fd38..92595fd1 100644 --- a/src/uapbd/public/packages/StructuralAdjust/index.js +++ b/src/uapbd/public/packages/StructuralAdjust/index.js @@ -23,7 +23,9 @@ export default function structuralAdjust( call ) { let callback = (json, status, inlt) => { - if(!status) return ; + if(!status) { + return ; + } newProps.modal.show("structural-adjust", { title: params.title || json['stru-001'],//结构调整 size: "lg", diff --git a/src/uapbd/public/packages/StructuralAdjustAllTrue/StructuralAdjustModal/index.less b/src/uapbd/public/packages/StructuralAdjustAllTrue/StructuralAdjustModal/index.less new file mode 100644 index 00000000..3d6006a6 --- /dev/null +++ b/src/uapbd/public/packages/StructuralAdjustAllTrue/StructuralAdjustModal/index.less @@ -0,0 +1,37 @@ +.structural-adjust{ + .structural-adjustment-contain{ + margin-bottom: 40px; + display: flex; + height: 100%; + min-height: 300px; + max-height: 400px; + .opr-btn{ + margin-bottom: 5px; + display: block; + } + .struct-tree-contain{ + flex: 1; + } + .btn-group{ + width: 120px; + height: 100%; + padding-left: 10px; + border-left: 1px solid #ddd; + } + .u-modal-body{ + position: relative; + } + + } + .struct-modal-footer{ + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 8px 10px; + overflow: hidden; + text-align: right; + border-top: 1px solid #ddd; + background-color: #fff; + } +} diff --git a/src/uapbd/public/packages/StructuralAdjustAllTrue/index.js b/src/uapbd/public/packages/StructuralAdjustAllTrue/index.js index ad9a822f..13590a58 100644 --- a/src/uapbd/public/packages/StructuralAdjustAllTrue/index.js +++ b/src/uapbd/public/packages/StructuralAdjustAllTrue/index.js @@ -20,7 +20,9 @@ export default function structuralAdjust( call ) { let callback = (json, status, inlt) => { - if(!status) return ; + if(!status) { + return ; + } newProps.modal.show("structural-adjust", { title: params.title || json['stru-001'],//结构调整 size: "lg", @@ -44,7 +46,9 @@ const besureModalEve = (info, newProps, params, call) => { data: Object.assign({}, params.reqParams, {memberTreeTable: info}), success: (res) => { const {success, data} = res; - if(!success) return ; + if(!success) { + return ; + } if(params.beforeSure && isFunction(params.beforeSure)) { params.beforeSure(); return ; diff --git a/src/uapbd/public/packages/TreeTableSetting/ContextRowMenu.js b/src/uapbd/public/packages/TreeTableSetting/ContextRowMenu.js index 902acff6..2b8697d9 100644 --- a/src/uapbd/public/packages/TreeTableSetting/ContextRowMenu.js +++ b/src/uapbd/public/packages/TreeTableSetting/ContextRowMenu.js @@ -22,7 +22,9 @@ export default class TableMenu extends Component{ componentDidMount() { const that = this; let callback = function(json, status, lang) { - if(!status) return ; + if(!status) { + return ; + } that.setState({ json, ItemList: [ @@ -54,7 +56,9 @@ export default class TableMenu extends Component{ gerItemList = () => { const {ItemList} = this.state; - if(!ItemList.length) return null; + if(!ItemList.length) { + return null; + } return ItemList.map( (item, index) => { let ItemType = null; switch(item.type) { diff --git a/src/uapbd/public/packages/TreeTableSetting/index.js b/src/uapbd/public/packages/TreeTableSetting/index.js index 616b8afa..bfba9d0e 100644 --- a/src/uapbd/public/packages/TreeTableSetting/index.js +++ b/src/uapbd/public/packages/TreeTableSetting/index.js @@ -27,7 +27,9 @@ function removeCustomRightMenu(ev) { function tableRowSetting(includeCallback) { const treeTable = document.querySelector(".org-unit-table"); - if(!treeTable) return ; + if(!treeTable) { + return ; + } treeTable.addEventListener( "contextmenu", createMouseRightMenu.bind(this, includeCallback, true) @@ -67,7 +69,9 @@ function createMouseRightMenu(includeCallback) { // if(!treelist || !treelist.data || !treelist.data.length) return ; let ev = ev || window.event; // window.getSelection().toString() 存在选中文本,使用浏览器默认菜单 - if (window.getSelection().toString()) return; + if (window.getSelection().toString()) { + return; + } //若选中文本是空字符串,则自定义列设置菜单 ev.preventDefault(); removeCustomRightMenu(ev); @@ -104,10 +108,18 @@ function getMouseRightMenuPosition(ev, section) { const left = !right; const bottom = screenH - clickY > rootH; const top = !bottom; - if(right) section.style.left = `${clickX}px`; - if(left) section.style.left = `${clickX - rootW}px`; - if(bottom) section.style.top = `${clickY}px`; - if(top) section.style.top = `${clickY - rootH}px`; + if(right) { + section.style.left = `${clickX}px`; + } + if(left) { + section.style.left = `${clickX - rootW}px`; + } + if(bottom) { + section.style.top = `${clickY}px`; + } + if(top) { + section.style.top = `${clickY - rootH}px`; + } if(screenX - clickX < 110 + 32) { section.classList.add("nearRight"); } diff --git a/src/uapbd/public/packages/TreeTableSetting/index.less b/src/uapbd/public/packages/TreeTableSetting/index.less new file mode 100644 index 00000000..a51b2978 --- /dev/null +++ b/src/uapbd/public/packages/TreeTableSetting/index.less @@ -0,0 +1,38 @@ +.uapbd-table-menu-container{ + // width:90px; + // height:320px; + background:#fff; + box-shadow:0px 2px 4px 1px rgba(0,0,0,0.18); + border-radius:3px; + padding: 10px 0; + p{ + height: 30px; + line-height: 30px; + font-size:12px; + color: #111; + cursor: pointer; + padding: 0 10px; + } + .sepearte-line{ + margin: 8px 0; + height: 1px; + line-height: 1; + border-top: 1px solid #e4e4e4; + } + .side-tree-correct{ + color: #FF6600; + } + p:hover{ + background-color: #f3f3f3; + } + .include-checkbox { + width: 14px; + height: 14px; + } + .u-checkbox { + margin: 0 !important; + } + .nc-checkbox.u-checkbox .u-checkbox-label { + padding-left: 18px; + } +} \ No newline at end of file diff --git a/src/uapbd/public/packages/TreeTableSetting/method.js b/src/uapbd/public/packages/TreeTableSetting/method.js index 791118a8..b46a892e 100644 --- a/src/uapbd/public/packages/TreeTableSetting/method.js +++ b/src/uapbd/public/packages/TreeTableSetting/method.js @@ -78,11 +78,15 @@ function formatTree2List(treeData, min = 1) { for(let i=0; i< treeData.length; i++) { let item = treeData[i]; list.push({refpk: item.refpk, level: depth}); - if(item.children && item.children.length) cloneArr = cloneArr.concat(item.children); + if(item.children && item.children.length) { + cloneArr = cloneArr.concat(item.children); + } } depth += 1; maxDepth = maxDepth > depth ? maxDepth : depth; - if(cloneArr.length) loop(cloneArr, depth); + if(cloneArr.length) { + loop(cloneArr, depth); + } } loop(treeData, 1); return list; diff --git a/src/uapbd/public/pubComponent/AttrSelect.js b/src/uapbd/public/pubComponent/AttrSelect.js index 04c78683..da486fad 100644 --- a/src/uapbd/public/pubComponent/AttrSelect.js +++ b/src/uapbd/public/pubComponent/AttrSelect.js @@ -3,18 +3,16 @@ * @version: * @Author: zhenmx * @Date: 2021-11-20 14:52:24 - * @LastEditors: Chendch - * @LastEditTime: 2022-05-28 10:49:51 + * @LastEditors: xiadling xiadling@yonyou.com + * @LastEditTime: 2023-08-20 15:59:44 */ -import React, {Fragment, useState, Component} from 'react'; +import React, {Component} from 'react'; import {base, getBusinessInfo, high} from 'nc-lightapp-front'; const {NCSelect} = base; const {NCOption} = NCSelect; import OrgtypeSelector from './OrgtypeSelector'; import BatchEditAttrRefer from './batchEditRefer/BatchEditAttrRefer/index'; -const {Refer} = high; -require("./index.less"); - +import './attrSelect.less' class AttrSelect extends Component { constructor(props) { @@ -86,6 +84,14 @@ class AttrSelect extends Component { } } } + let custAreaclItem = meta[this.state.batchFormId]['items'].find(item => item['attrcode'] === 'pk_areacl'); + if(!!custAreaclItem){ + custAreaclItem.queryCondition = ()=>{ + return{ + pk_org:'GLOBLE00000000000000' + } + } + } }else if(this.props.config.NODE_TYPE === 'ORG_NODE'){ custclassitem = meta[this.state.batchFormId]['items'].find(item => item['attrcode'] === 'pk_custclass'); @@ -96,8 +102,6 @@ class AttrSelect extends Component { } } } - }else{ - } //外币汇率类型参照 let ratetypeitem = meta[this.state.batchFormId]['items'].find(item => item['attrcode'] === 'ratetype'); @@ -243,18 +247,10 @@ class AttrSelect extends Component { }); this.state.selectedAttrs = realSelectedAttrs this.props.form.setFormStatus(batchFormId, 'edit'); - //处理购买方开户行字段 - if(realSelectedAttrs.includes('buyerbankname')) { - this.props.renderItem('form', batchFormId, 'buyerbankname', ); - } - //处理购买方银行账户字段 - if(realSelectedAttrs.includes('buyerbanknum')) { - this.props.renderItem('form', batchFormId, 'buyerbanknum', ); - } + + //选择完成要修改的属性点击确定之后清空表单,确保没有缓存数据 + this.props.form.EmptyAllFormValue(batchFormId); + let meta = this.props.meta.getMeta(); meta[batchFormId]['items'].map((item) => { if (realSelectedAttrs.includes(item.attrcode)) { @@ -271,6 +267,25 @@ class AttrSelect extends Component { this.state.attr_valueMap[item.attrcode] = false; this.setState(this.state); } + if(item.attrcode == 'buyerbankname') { //处理购买方开户行字段 + item.itemtype = "refer"; + item.refcode = "uapbd/refer/bankacc/BankDocDefaultGridTreeRef/index"; + item.checkStrictly = false; + item.fieldDisplayed = "refname"; + item.fieldValued = "refpk"; + } + if(item.attrcode == 'buyerbanknum') { //处理购买方银行账户字段 + item.itemtype = "refer"; + item.refcode = "uapbd/refer/pub/CustBankAccGridRef/index"; + item.checkStrictly = false; + item.fieldDisplayed = "refname"; + item.fieldValued = "refpk"; + item.queryCondition = () => { + return{ + pk_cust: this.state.pk_customer + } + } + } } else { item.visible = false; } @@ -283,7 +298,13 @@ class AttrSelect extends Component { let transValue = value.value; if(key == "buyername") { transValue = value[key].value; - } + } + if(key == "buyerbankname") { //处理购买方开户行字段 + transValue = value.display; + } + if(key == "buyerbanknum") { //处理购买方银行账户字段 + transValue = value.display; + } this.state.attr_valueMap[key] = transValue; this.setState(this.state); } @@ -327,6 +348,17 @@ class AttrSelect extends Component { pk_org:props.config.NODE_TYPE === 'GLOBE_NODE'?'GLOBLE00000000000000':props.config.NODE_TYPE === 'ORG_NODE'?currentOrg:'' } } + //批改 地区分类参照过滤 + if(props.config.NODE_TYPE === 'GLOBE_NODE') { + let custAreaclItem = meta[moduleId]['items'].find(item => item['attrcode'] === 'pk_areacl'); + if(!!custAreaclItem){ + custAreaclItem.queryCondition = ()=>{ + return{ + pk_org:'GLOBLE00000000000000' + } + } + } + } props.meta.setMeta(meta); return true; } @@ -361,7 +393,7 @@ class AttrSelect extends Component { render() { const {selectedAttrs = []} = this.state; return ( -
+
{this.props.json['batchedit-000002']} @@ -384,7 +416,7 @@ class AttrSelect extends Component { this.props.config.NODE_TYPE === 'ORG_NODE' && this.props.oprFlag === 'directEdit' && this.state.tabVal.refcode === this.state.tabArr[3].refcode ? - 'none' : '' + 'none' : '', overflow: 'hidden' }}> this.orgSelect = item} @@ -408,7 +440,7 @@ class AttrSelect extends Component { queryCondition: function () { return { //选择组织的个数不通查到的批改属性不一样,或者列表选择行数的所属组织的个数 - NODE_TYPE: this.props.config.NODE_TYPE, + NODE_TYPE: this.props.config.NODE_TYPE == 'ORG_NODE' ? 'GROUP_NODE': this.props.config.NODE_TYPE, checkedOrgLenth: this.state.tabVal.refcode !=='baseinfo' ? this.orgSelect.state.checkedOrg.length : @@ -433,98 +465,4 @@ class AttrSelect extends Component { } } - -//银行档案参照 -function ReferLoader(props = {}) { - var conf = { - multiLang: { - domainName: 'uapbd', - currentLocale: 'zh-CN', - moduleId: 'refer_uapbd', - }, - refType: 'gridTree', - refName: 'refer-000546',/* 国际化处理: 银行档案*/ - refCode: 'uapbd.refer.bankacc.BankDocDefaultGridTreeRef', - queryGridUrl: '/nccloud/uapbd/ref/BankDocDefaultGridRef.do', - queryTreeUrl: '/nccloud/uapbd/ref/BankDocDefaultTreeRef.do', - isMultiSelectedEnabled: false, - columnConfig: [{ name: ['refer-000047', 'refer-000547', 'refer-000548', 'refer-000250', 'refer-000549', 'refer-000550', 'refer-000551', 'refer-000015'], - code: ['org_name', 'refcode', 'refname', 'shortname', 'pk_fatherbank', 'province', 'city', 'ttname'],checked:{'ttname':false} }], - checkStrictly: false - }; - return -} - -//客户银行账户参照 -function CustBankRefer(props = {}) { - var conf = { - multiLang: { - domainName: 'uapbd', - currentLocale: 'zh-CN', - moduleId: 'refer_uapbd', - }, - refType: 'grid', - refName: 'refer-000393',/* 国际化处理: 客户银行账户*/ - refCode: 'uapbd.refer.pub.CustBankAccGridRef', - queryGridUrl: '/nccloud/uapbd/ref/CustBankAccGridRef.do', - isMultiSelectedEnabled: false, - columnConfig:[{ -         name: [ 'refer-000012', 'refer-000013','refer-000381','refer-000015','refer-000384' ],/* 国际化处理: 账号,户名,开户银行,银行类别,币种*/ -         code: [ "accnum", "accname", "bankdoc_name", "banktype_name", "currtype_name" ] -        }], - checkStrictly: false, - fieldDisplayed: 'refcode' - }; - return -} - -//购买方开户行字段输入框与参照的交互 -function RenderCus(props) { - const [name, setName] = useState(""); - const changeBuyerbankname = (val) => { - const {form} = props; - setName(val); - form.setFormItemsValue("custBatchEditForm", { - buyerbankname: { - display: val.refname, - value: val.refname - } - }); - props.onFormAfterEdit(props, "custBatchEditForm", "buyerbankname", { - display: val.refname, - value: val.refname - }); - } - return ( - - {changeBuyerbankname(value)}}/> - - ) -} - -//购买方银行账户字段输入框与参照的交互 -function RenderCustBank(props) { - const [name, setName] = useState(""); - const changeBuyerbanknum = (val) => { - const {form} = props; - setName(val); - //手动输入时refcode为null,故取refname - form.setFormItemsValue("custBatchEditForm", { - buyerbanknum: { - display: val.refcode, - value: val.refcode === null ? val.refname : val.refcode - } - }); - props.onFormAfterEdit(props, "custBatchEditForm", "buyerbanknum", { - display: val.refcode, - value: val.refcode === null ? val.refname : val.refcode - }); - } - return ( - - {changeBuyerbanknum(value)}}/> - - ) -} - export default AttrSelect \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/HeaderArea/index.less b/src/uapbd/public/pubComponent/HeaderArea/index.less index e0dba6b9..9091eb48 100644 --- a/src/uapbd/public/pubComponent/HeaderArea/index.less +++ b/src/uapbd/public/pubComponent/HeaderArea/index.less @@ -15,4 +15,9 @@ display: inline-block; } } + .BillHeadInfoWrap { + .back-btn{ + margin-top:0 + } + } } \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/OrgSelect.js b/src/uapbd/public/pubComponent/OrgSelect.js index 92626510..e12fabc9 100644 --- a/src/uapbd/public/pubComponent/OrgSelect.js +++ b/src/uapbd/public/pubComponent/OrgSelect.js @@ -3,8 +3,8 @@ * @version: * @Author: Chendch * @Date: 2020-09-30 13:27:04 - * @LastEditors: Chendch - * @LastEditTime: 2022-05-08 18:18:54 + * @LastEditors: xiadling xiadling@yonyou.com + * @LastEditTime: 2023-10-27 16:22:35 */ import React, {Component} from 'react'; import {base, ajax} from 'nc-lightapp-front'; @@ -43,7 +43,9 @@ class OrgSelect extends Component { reset(beforeName = "code") { this.beforeName = beforeName; let callback = (json,status,inlt) => { - if(!status) return ; + if(!status) { + return ; + } let renderState = this.gerState(json); this.loadAssignTreeData(renderState, json); } @@ -123,7 +125,7 @@ class OrgSelect extends Component { main: this, rowKey: 'id', fielid:'lefttable', - lazyload: false, + // lazyload: false, columns: [{ title: codeDisplay || json['orgselect-000001'],/* 国际化处理: 组织编码*/ dataIndex: 'code', @@ -168,7 +170,9 @@ class OrgSelect extends Component { this.props.syncTree.setNodeChecked(this.treeId,"") } expandFirstNode = (treeData, id, that) => { - if(!treeData || !id || !that) return ; + if(!treeData || !id || !that) { + return ; + } let pks = []; treeData.map( (item, index) => { @@ -183,7 +187,7 @@ class OrgSelect extends Component { if (Array.isArray(data)) { data.forEach((e) => { list.push(e); - if (e && e.hasOwnProperty('children') && e.children.length>0 ) { + if (e && e.hasOwnProperty('children') && Array.isArray(e.children) && e.children.length>0 ) { this.treeToList(e.children, list); } }); @@ -244,7 +248,7 @@ class OrgSelect extends Component { result.push( item.id ); - if(item.hasOwnProperty('children') && item.children.length>0 ){ + if(item.hasOwnProperty('children') && Array.isArray(item.children) && item.children.length>0 ){ getcheckedKeys(item.children,result); } }) @@ -285,16 +289,17 @@ class OrgSelect extends Component { refname:item.name }); } - if(item.hasOwnProperty('children') && item.children.length>0 ){ + if(item.hasOwnProperty('children') && Array.isArray(item.children) && item.children.length>0 ){ getItem(item.children,pks,result); } }) return result; - } + }; let tableDatas = getItem(this.state.tree.datas,checkedKeys,new Array()); - tableDatas = tableDatas.filter(d => {return d.nodeData && (d.root || d.nodeData.orgclazz != 'orgtype')}) + tableDatas = tableDatas.filter(d => {return d.nodeData && (d.root || d.nodeData.orgclazz != 'orgtype')}); this.state.selectData.datas=tableDatas; - this.setState({tableDatas, selectData: this.state.selectData}) + this.setState({tableDatas, selectData: this.state.selectData}); + } resetOrgSelect = () => { @@ -418,13 +423,18 @@ class OrgSelect extends Component {
{Object.keys(json).length > 0 &&
this.dom = dom} style={{marginLeft:30,height:'100%',pbackground:'rgba(249,249,249,1)',width:'calc(50% - 15px)',overflow:'hidden'}}> 10 ? (this.dom.clientHeight-31) + "px" : 413, - maxHeight: this.dom && this.dom.clientHeight > 10 ? (this.dom.clientHeight-31) + "px" : 413, - minHeight: 120 - }, addBlankCol: false, useFixedHeader: true, + bodyStyle: { + height: this.dom && this.dom.clientHeight > 10 ? (this.dom.clientHeight-31) + "px" : 409, + maxHeight: this.dom && this.dom.clientHeight > 10 ? (this.dom.clientHeight-31) + "px" : 409, + minHeight: 120, + }, + scroll:{ + y: this.dom && this.dom.clientHeight > 10 ? (this.dom.clientHeight-31) : 409, + }, + inModal: true, + lazyload: true }}>
}
diff --git a/src/uapbd/public/pubComponent/OrgtypeSelector.js b/src/uapbd/public/pubComponent/OrgtypeSelector.js index 53df4dcb..3c40dc10 100644 --- a/src/uapbd/public/pubComponent/OrgtypeSelector.js +++ b/src/uapbd/public/pubComponent/OrgtypeSelector.js @@ -3,8 +3,8 @@ * @version: * @Author: zhenmx * @Date: 2021-11-20 14:52:24 - * @LastEditors: Chendch - * @LastEditTime: 2022-06-14 10:26:32 + * @LastEditors: xiadling xiadling@yonyou.com + * @LastEditTime: 2023-10-19 16:36:14 */ import React, {Component} from 'react'; import FinanceOrgTreeRef from '../../refer/org/FinanceOrgTreeRef'; @@ -91,110 +91,128 @@ class OrgtypeSelector extends Component { }); } - renderRef = () => { - let {currentOrgType} = this.state; - let {table} = this.state; - let {datas} = this.state.selectData; - let {NODE_TYPE} = this.props.config; - let {oprFlag, height} = this.props; - const bodyStyle = height ? {bodyHeight: height} : {adaptionHeight:true, inModal:true}; - return ( -
-
- - {currentOrgType === 'sale_info' ? - this.props.json['OrgtypeSelector-004'] : currentOrgType === 'credit_info' ? - this.props.json['OrgtypeSelector-005'] : currentOrgType === 'finance_info' ? - this.props.json['OrgtypeSelector-006'] : currentOrgType === 'tax_info' ? - this.props.json['OrgtypeSelector-006'] : this.props.json['OrgtypeSelector-007']} - -
- {currentOrgType === 'sale_info' ? SaleOrgTreeRef({ - fieldid:"SaleOrgTreeRef", - value: this.state.checkedOrg, - isMultiSelectedEnabled: true, - onChange: this.onChange.bind(this), - queryCondition: () => { - return { - AppCode : this.props.config.appcode, - orgType : 'SALEORGTYPE000000000', - TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' - } - } - }) : currentOrgType === 'credit_info' ? CreditCtlRegionGridRef({ - fieldid:"CreditCtlRegionGridRef", - value: this.state.checkedOrg, - isMultiSelectedEnabled: true, - onChange: this.onChange.bind(this), - queryCondition: () => { - return { - AppCode : this.props.config.appcode, - orgType : 'CREDITCTLREGION00000', - GridRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' - } - } - - }) : currentOrgType === 'finance_info' ? FinanceOrgTreeRef({ - fieldid:"FinanceOrgTreeRef", - value: this.state.checkedOrg, - isMultiSelectedEnabled: true, - onChange: this.onChange.bind(this), - isShowUnit: this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? true : false, - defaultUnitValue: { - refname: businessInfo.groupName, - refpk: businessInfo.groupId - }, - queryCondition: () => { - return this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? - {}: - { - AppCode : this.props.config.appcode, - orgType : 'FINANCEORGTYPE000000', - TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' - } - } - }) : currentOrgType === 'tax_info' ? FinanceOrgTreeRef({ - fieldid:"FinanceOrgTreeRef", - value: this.state.checkedOrg, - isMultiSelectedEnabled: true, - onChange: this.onChange.bind(this), - isShowUnit: this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? true : false, - defaultUnitValue: { - refname: businessInfo.groupName, - refpk: businessInfo.groupId - }, - queryCondition: () => { - return this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? - {}: - { - AppCode : this.props.config.appcode, - orgType : 'FINANCEORGTYPE000000', - TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' - } - } - }) : currentOrgType === 'baseinfo' && NODE_TYPE === 'ORG_NODE' && oprFlag === 'stepEdit' ? BusinessUnitTreeRef({ - fieldid:"BusinessUnitTreeRef", - value: this.state.checkedOrg, - isMultiSelectedEnabled: true, - onChange: this.onChange.bind(this), - queryCondition: () => { - return { - TreeRefActionExt: 'nccloud.web.uapbd.rateschema.action.PrimaryOrgSQLBuilderData' - } - } - }) : ''} -
-
- -
- - ); - } + // renderRef = () => { + + // } getData() { return this.state.selectData.datas.map(n => n.id); } render() { + let {currentOrgType} = this.state; + let {table} = this.state; + let {datas} = this.state.selectData; + let {NODE_TYPE} = this.props.config; + let {oprFlag, height} = this.props; + const bodyStyle = {adaptionHeight:true, inModal:true}; + return ( +
+
+ + {currentOrgType === 'sale_info' ? + this.props.json['OrgtypeSelector-004'] : currentOrgType === 'credit_info' ? + this.props.json['OrgtypeSelector-005'] : currentOrgType === 'finance_info' ? + this.props.json['OrgtypeSelector-006'] : currentOrgType === 'tax_info' ? + this.props.json['OrgtypeSelector-006'] : this.props.json['OrgtypeSelector-007']} + +
+ {currentOrgType === 'sale_info' ? SaleOrgTreeRef({ + fieldid:"SaleOrgTreeRef", + value: this.state.checkedOrg, + isMultiSelectedEnabled: true, + onChange: this.onChange.bind(this), + queryCondition: () => { + return { + AppCode : this.props.config.appcode, + orgType : 'SALEORGTYPE000000000', + TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' + } + } + }) : currentOrgType === 'credit_info' ? CreditCtlRegionGridRef({ + fieldid:"CreditCtlRegionGridRef", + value: this.state.checkedOrg, + isMultiSelectedEnabled: true, + onChange: this.onChange.bind(this), + queryCondition: () => { + return { + AppCode : this.props.config.appcode, + orgType : 'CREDITCTLREGION00000', + GridRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' + } + } + + }) : currentOrgType === 'finance_info' ? FinanceOrgTreeRef({ + fieldid:"FinanceOrgTreeRef", + value: this.state.checkedOrg, + isMultiSelectedEnabled: true, + onChange: this.onChange.bind(this), + isShowUnit: this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? true : false, + defaultUnitValue: { + refname: businessInfo.groupName, + refpk: businessInfo.groupId + }, + queryCondition: () => { + return this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? + {}: + { + AppCode : this.props.config.appcode, + orgType : 'FINANCEORGTYPE000000', + TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' + } + } + }) : currentOrgType === 'tax_info' ? FinanceOrgTreeRef({ + fieldid:"FinanceOrgTreeRef", + value: this.state.checkedOrg, + isMultiSelectedEnabled: true, + onChange: this.onChange.bind(this), + isShowUnit: this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? true : false, + defaultUnitValue: { + refname: businessInfo.groupName, + refpk: businessInfo.groupId + }, + queryCondition: () => { + return this.props.config.appcode === '10140BACCG' || this.props.config.appcode === '10140BACCO' ? + {}: + { + AppCode : this.props.config.appcode, + orgType : 'FINANCEORGTYPE000000', + TreeRefActionExt:'nccloud.web.uapbd.material.action.PrimaryOrgSQLBuilderByOrgType' + } + } + }) : currentOrgType === 'baseinfo' && NODE_TYPE === 'ORG_NODE' && oprFlag === 'stepEdit' ? BusinessUnitTreeRef({ + fieldid:"BusinessUnitTreeRef", + value: this.state.checkedOrg, + isMultiSelectedEnabled: true, + onChange: this.onChange.bind(this), + queryCondition: () => { + return { + TreeRefActionExt: 'nccloud.web.uapbd.rateschema.action.PrimaryOrgSQLBuilderData' + } + } + }) : ''} +
+
+
this.dom = dom}> + 10 ? (this.dom.clientHeight-10) + "px" : 200, + maxHeight: this.dom && this.dom.clientHeight > 10 ? (this.dom.clientHeight-10) + "px" : 200, + }} + /> +
+ + +
+ + ); + + // return ( + + // ) + } +} +export default OrgtypeSelector; diff --git a/src/uapbd/public/pubComponent/ResultGrid.js b/src/uapbd/public/pubComponent/ResultGrid.js index 3f019b8a..3165683a 100644 --- a/src/uapbd/public/pubComponent/ResultGrid.js +++ b/src/uapbd/public/pubComponent/ResultGrid.js @@ -24,7 +24,7 @@ class ResultGrid extends Component { } onSelected = (props, moduleId, record, index, status) => { - this.state.selectedPKs = []; + // this.state.selectedPKs = []; if(status){ this.state.selectedPKs.push(record.pk_customer.value); }else{ @@ -36,50 +36,66 @@ class ResultGrid extends Component { this.setState(this.state); } onSelectedAll = (props, moduleId, status, length) => { - + debugger; if(status){ let tablecheckrows = props.table.getCheckedRows(moduleId); tablecheckrows.map((e)=>{ - this.state.selectedPKs.push(e.data.values.pk_customer.value); + let index = this.state.selectedPKs.indexOf(e.data.values.pk_customer.value); + if (index < 0) { + this.state.selectedPKs.push(e.data.values.pk_customer.value); + } + }); }else{ let alltabledata = props.table.getAllTableData(moduleId); alltabledata.rows.map((e)=>{ let index = this.state.selectedPKs.indexOf(e.values.pk_customer.value); - if(index> -1){ this.state.selectedPKs.splice(index,1); } }) } - this.setState(this.state); + // this.setState(this.state); } getCurrPageSelArr = () => { const {getTablePageInfo, getPks} = this.props.pageprops.table; const pageInfo = getTablePageInfo(this.state.gridId); const {pageIndex, pageSize} = pageInfo; - const pks = getPks(this.state.gridId, pageIndex, pageSize); + const pks = getPks(this.state.gridId, pageIndex, pageSize) || []; const selIndexArr = Array.from(new Array(pks.length + pageIndex*pageSize).keys()); + // const temp = pageIndex * pageSize; selIndexArr.splice(0, pageIndex* pageSize); - return selIndexArr; + const finalArr = []; + selIndexArr.map((item,index) => finalArr.push(index)); + const data = { + pks: pks, + selIndexArr: finalArr + } + return data; } handlePageCheck =()=>{ - const {getCheckedRows, selectTableRows} = this.props.pageprops.table; - const selIndexArr = this.getCurrPageSelArr(); - selectTableRows(this.state.gridId,selIndexArr, true); - getCheckedRows(this.state.gridId).map((e)=>{ - this.state.selectedPKs.push(e.data.values.pk_customer.value); + debugger; + const gridId = this.state.gridId; + const {pks,selIndexArr}= this.getCurrPageSelArr(); + this.props.pageprops.table.selectTableRows(this.state.gridId,selIndexArr, true); + // const checkedRows = getCheckedRows(gridId); + pks.map((pk)=>{ + let index = this.state.selectedPKs.indexOf(pk); + if (index < 0) { + this.state.selectedPKs.push(pk); + } + }) - this.setState(this.state); + // this.setState(this.state); } handlePageCancel = ()=>{ - const selIndexArr = this.getCurrPageSelArr(); + const {pks,selIndexArr}= this.getCurrPageSelArr(); this.props.pageprops.table.selectTableRows(this.state.gridId,selIndexArr,false); - let alltabledata = this.props.pageprops.table.getAllTableData(this.state.gridId); - alltabledata.rows.map((e)=>{ - var index = this.state.selectedPKs.indexOf(e.values.pk_customer.value); + // let alltabledata = this.props.pageprops.table.getAllTableData(this.state.gridId); + pks.map((pk)=>{ + var index = this.state.selectedPKs.indexOf(pk); if(index > -1){ this.state.selectedPKs.splice(index,1); } @@ -90,10 +106,13 @@ class ResultGrid extends Component { handleAllCheck=()=>{ this.props.pageprops.table.selectAllRows(this.state.gridId,true); let alltabledata = this.props.pageprops.table.getAllTableData(this.state.gridId); - this.state.selectedPKs = alltabledata.allpks; - this.state.selectAllFlag = true; - this.setState(this.state); - + // this.state.selectedPKs = alltabledata.allpks; + // this.state.selectAllFlag = true; + // this.setState(this.state); + this.setState({ + selectedPKs: alltabledata.allpks, + selectAllFlag: true + }) } //先临时这样搞,后面有需求让适配跨页全选了再改 @@ -115,10 +134,20 @@ class ResultGrid extends Component { } onClickPageInfo =(props,config,pks)=>{ + debugger; this.props.loadResutlGridData(pks,()=>{ - if(this.state.selectAllFlag){ - this.props.pageprops.table.selectAllRows(this.state.gridId,true); - } + // if(this.state.selectAllFlag){ + // this.props.pageprops.table.selectAllRows(this.state.gridId,true); + // } + // this.props.pageprops.table.selectTableRows(this.state.gridId, ) + const {pks, selIndexArr}= this.getCurrPageSelArr(); + const checkedArr = [] + pks.map((pk, index) => { + if (this.state.selectedPKs.includes(pk)) { + checkedArr.push(selIndexArr[index]) + } + }) + this.props.pageprops.table.selectTableRows(this.state.gridId, checkedArr, true); }); } diff --git a/src/uapbd/public/pubComponent/attrSelect.less b/src/uapbd/public/pubComponent/attrSelect.less new file mode 100644 index 00000000..d269cf34 --- /dev/null +++ b/src/uapbd/public/pubComponent/attrSelect.less @@ -0,0 +1,40 @@ +.batch-felx-container { + display: flex; + flex-direction: column; + flex: auto; + overflow: hidden; +} +.uapbd-form-flex-container{ + margin-bottom: 6px; + min-height: 26px; + align-items: center; + font-size: 14px; + display: flex; + // flex: 1; + width: 33%; + .uapbd-form-flex-label{ + width: 140px; + max-width: 140px; + min-width: 140px; + line-height: 18px; + padding-right: 16px; + text-align: right; + box-sizing: border-box; + color: #2b3441; + position: relative; + display: inline-block; + vertical-align: middle; + overflow-wrap: break-word; + white-space: pre-wrap; + } + .uapbd-form-flex-input{ + width: calc(~"100% - 140px"); + text-align: left; + padding-right: 8px; + position: relative; + box-sizing: border-box; + color: #2b344b; + display: inline-block; + vertical-align: middle; + } + } \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/batchEditRefer/BatchEditAttrRefer/index.js b/src/uapbd/public/pubComponent/batchEditRefer/BatchEditAttrRefer/index.js index 1e55103b..699d7ca4 100644 --- a/src/uapbd/public/pubComponent/batchEditRefer/BatchEditAttrRefer/index.js +++ b/src/uapbd/public/pubComponent/batchEditRefer/BatchEditAttrRefer/index.js @@ -11,11 +11,16 @@ const { Refer } = high; export default function (props = {}) { return } diff --git a/src/uapbd/public/pubComponent/confirmUtil/confirmUtil.js b/src/uapbd/public/pubComponent/confirmUtil/confirmUtil.js index 53736937..89086718 100644 --- a/src/uapbd/public/pubComponent/confirmUtil/confirmUtil.js +++ b/src/uapbd/public/pubComponent/confirmUtil/confirmUtil.js @@ -1,4 +1,3 @@ -/*H5STJxafweQy3FG627aMfTI6gilU55u9elaLu01UDvA=*/ /* * @Descripttion: * @version: @@ -32,5 +31,4 @@ export default function ({ closeByClickBackDrop:false,//点击遮罩关闭提示框,默认是true点击关闭,阻止关闭是false }) -} -/*H5STJxafweQy3FG627aMfTI6gilU55u9elaLu01UDvA=*/ \ No newline at end of file +} \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/datatemplet/importTempletDlg.js b/src/uapbd/public/pubComponent/datatemplet/importTempletDlg.js index 9f5df606..e22f6705 100644 --- a/src/uapbd/public/pubComponent/datatemplet/importTempletDlg.js +++ b/src/uapbd/public/pubComponent/datatemplet/importTempletDlg.js @@ -20,6 +20,7 @@ class ImportTempletDlg extends Component { show: false, modalDropup: true, size: 'lg', + includeTable: true, backdrop: true / false //是否弹出遮罩层/点击遮罩层是否触发关闭事件 }, modalTitle: { @@ -77,7 +78,6 @@ class ImportTempletDlg extends Component { //默认模板行记数据 defaultDataTemp: {}, codeIsEdit: '' - } this.initPage = this.props.initPage; @@ -122,6 +122,9 @@ class ImportTempletDlg extends Component { }); toast({color: 'success', content: this.props.json['dataTemplet-000003']});/* 国际化处理: 设置默认模板成功!*/ } else { + this.setState({ + defaultExtBillcard: {} + }); toast({color: 'success', content: this.props.json['dataTemplet-000004']});/* 国际化处理: 取消默认模板成功!*/ } @@ -436,7 +439,7 @@ class ImportTempletDlg extends Component { render() { var modalCfg = {...this.state.modal} return ( - + {this.state.modalTitle.display} @@ -468,7 +471,7 @@ class ImportTempletDlg extends Component {
- + {this.props.json['dataTemplet-000017']+":"}{/* 国际化处理: 默认*/} diff --git a/src/uapbd/public/pubComponent/index.less b/src/uapbd/public/pubComponent/index.less new file mode 100644 index 00000000..34d19585 --- /dev/null +++ b/src/uapbd/public/pubComponent/index.less @@ -0,0 +1,40 @@ +.uapbd-form-flex-container{ + margin-bottom: 6px; + min-height: 26px; + align-items: center; + font-size: 14px; + display: flex; + // flex: 1; + width: 33%; + .uapbd-form-flex-label{ + width: 140px; + max-width: 140px; + min-width: 140px; + line-height: 18px; + padding-right: 16px; + text-align: right; + box-sizing: border-box; + color: #2b3441; + position: relative; + display: inline-block; + vertical-align: middle; + overflow-wrap: break-word; + white-space: pre-wrap; + } + .uapbd-form-flex-input{ + width: calc(~"100% - 140px"); + text-align: left; + padding-right: 8px; + position: relative; + box-sizing: border-box; + color: #2b344b; + display: inline-block; + vertical-align: middle; + } +} +.flex-container { + display: flex; + flex-direction: column; + flex: auto; + overflow: hidden; +} \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/modal/index.less b/src/uapbd/public/pubComponent/modal/index.less new file mode 100644 index 00000000..24d51d49 --- /dev/null +++ b/src/uapbd/public/pubComponent/modal/index.less @@ -0,0 +1,6 @@ +// .u-modal-backdrop{ +// z-index: 251 !important; +// } +// .u-modal { +// z-index: 252 !important; +// } \ No newline at end of file diff --git a/src/uapbd/public/pubComponent/titleComponent/index.less b/src/uapbd/public/pubComponent/titleComponent/index.less new file mode 100644 index 00000000..7046491a --- /dev/null +++ b/src/uapbd/public/pubComponent/titleComponent/index.less @@ -0,0 +1,17 @@ +.nc-bill-header-area{ + .statusDiv_nobuild, .statusDiv_build{ + width: 60px; + height: 30px; + line-height: 30px; + margin: 0 10px; + text-align: center; + } + .statusDiv_nobuild{ + background-color: rgba(255, 153, 153, 1); + color: #FF0000 + } + .statusDiv_build{ + background-color: rgba(51, 204, 255, 1); + color: #0099FF; + } +} \ No newline at end of file diff --git a/src/uapbd/public/referExtend/index.js b/src/uapbd/public/referExtend/index.js index f9566215..63b02a45 100644 --- a/src/uapbd/public/referExtend/index.js +++ b/src/uapbd/public/referExtend/index.js @@ -3,10 +3,11 @@ * @version: * @Author: Chendch * @Date: 2020-10-14 10:01:59 - * @LastEditors: Chendch - * @LastEditTime: 2021-09-28 15:43:50 + * @LastEditors: xiadling xiadling@yonyou.com + * @LastEditTime: 2023-11-27 12:18:55 */ -import {ajax, base, pageTo} from "nc-lightapp-front"; +import {ajax, base, pageTo, viewModel} from "nc-lightapp-front"; +let { getGlobalStorage } = viewModel; const {NCTooltip, NCButton, NCHotKeys, NCPopover} = base; function checkAddButtons(params) { @@ -24,7 +25,9 @@ function checkAddButtons(params) { }, success: (res) => { const {success, data} = res; - if(!success) return; + if(!success) { + return; + } this.setState({ addButtonList: data.AppRegisterVOs.map((item) => { return {...buttonsMap[item.code], name: item.name}; @@ -39,7 +42,9 @@ function checkAddButtons(params) { function renderAddButtons(params = "") { const {addButtonList = [], isAddButtonShow, currentButtonIndex, selectedValues} = this.state; - if(!addButtonList) return null; + if(!addButtonList) { + return null; + } let additionParams = {}; if(selectedValues.size) { for(let [k,v] of selectedValues) { @@ -76,18 +81,19 @@ function renderAddButtons(params = "") { ); default: let length = addButtonList.length; + let ncc_automated = getGlobalStorage('localStorage', '_ncc_automated_'); return ( { this.setState({ isAddButtonShow }) }} content={
{addButtonList.map(({ name, appcode, pagecode }, i) => { - return
{ + return
-1 && ((currentButtonIndex % length) + length) % length === i ? 'selected' : '' }`} key={name} onClick={() => { pageTo.openTo(null, { appcode, pagecode, @@ -97,10 +103,6 @@ function renderAddButtons(params = "") { }}>{name}
; })}
} fieldid="more_btn_menu" - show={isAddButtonShow} - onVisibleChange={isAddButtonShow => { - this.setState({ isAddButtonShow }) - }} > { this.setState(({ isAddButtonShow }) => ({ isAddButtonShow: !isAddButtonShow })) }}> - {this.state.jsonInsideRefer["containers-refer-0046"]} + + {this.state.jsonInsideRefer["containers-refer-0046"]} (/) - + + @@ -124,7 +128,9 @@ function renderAddButtons(params = "") { //自定义档案参照调用此方法 function renderAddButtonsDef(params = "") { const {addButtonList = [], isAddButtonShow, currentButtonIndex, selectedValues} = this.state; - if(!addButtonList) return null; + if(!addButtonList) { + return null; + } let additionParams = {}; if(selectedValues.size) { for(let [k,v] of selectedValues) { @@ -216,10 +222,6 @@ function renderAddButtonsDef(params = "") { }}>{name}
; })}
} fieldid="more_btn_menu" - show={isAddButtonShow} - onVisibleChange={isAddButtonShow => { - this.setState({ isAddButtonShow }) - }} > { + const {success, data} = res; + if(!success) { + return ; + } + console.log("111=",data); + userJSON = data; + let addButtonList = props.addButtonList || []; + if(userJSON && userJSON.mngctlmode) { + let org; + let glb; + let grp; + for(let i = 0; i < addButtonList.length; i++) { + if(addButtonList[i].pagecode == '10140UDDO_org') { + org = addButtonList[i]; + } else if(addButtonList[i].pagecode == '10140UDDB_glb') { + glb = addButtonList[i]; + } else { + grp = addButtonList[i]; + } + } + let mngctlmode = userJSON.mngctlmode; + if(mngctlmode == 0 || mngctlmode == 4) { //可以显示全局 + if(glb) { + temp.push(glb); + } + } + if(mngctlmode == 1 || mngctlmode == 2 || mngctlmode == 4) { //可以显示集团 + if(grp) { + temp.push(grp); + } + } + if(mngctlmode == 2 || mngctlmode == 3 || mngctlmode == 4) { //可以显示业务单元 + if(org) { + temp.push(org); + } + } + } + // delete temp[0].name; + temp.forEach(item => { + item.urlParam = ()=>{ + return { + status: 'browse', + params: JSON.stringify({userJSON}) + } + }; + return item; + }) + + } + }); + return temp; +} export { checkAddButtons, renderAddButtons, - renderAddButtonsDef + renderAddButtonsDef, + getAddButtonDropDown } \ No newline at end of file diff --git a/src/uapbd/public/testJSON/getEnterpriseRiskOverviewData.json b/src/uapbd/public/testJSON/getEnterpriseRiskOverviewData.json new file mode 100644 index 00000000..7b944c18 --- /dev/null +++ b/src/uapbd/public/testJSON/getEnterpriseRiskOverviewData.json @@ -0,0 +1,104 @@ +{ + "status": 1, + "data": { + "result": { + "baseinfo": { + "name": "乐视网信息技术(北京)股份有限公司", + "regStatus": "存续(在营、开业、在册)", + "stock": "A股 | 乐视退 300104 | 退市", + "dishonestTag": "失信被执行人", + "legalPersonName": "刘延峰", + "estiblishTime": "2004-11-10", + "regCapital": "398944.019200万人民币", + "address": "北京市朝阳区朝阳北路102号楼-1层-101内220", + "contactTel": "01050962333", + "contactEmail": "maweichen@le.com", + "website": "www.le.com", + "companyId": "30a303f98072f8e6fae82cf5959aed7e", + "url": "https://bip-test.yyuap.com/iuap-data-ep/intellid/portrait/info/10/30a303f98072f8e6fae82cf5959aed7e", + "companyOrgType": "股份有限公司(非上市、自然人投资或控股)", + "creditCode": "911100007693890511", + "industryName": "科技推广和应用服务业", + "introduction": "乐视网信息技术(北京)股份有限公司是国家级高新技术企业,于2010年8月12日在中国深交所创业板上市(股票代码300104),是行业内全球IPO上市公司。" + }, + "groupRisk": { + "riskCount": { + "ktnotice": "10", + "equityFreeze": "0", + "xianxiao": "5", + "zhixing": "7", + "lawsuit": "208", + "courtNotice": "149", + "dishonest": "2" + }, + "bussCount": { + "punishment": "0", + "mortgage": "0", + "abnormal": "0", + "equityPledge": "0", + "taxPunish": "0", + "envPunish": "0", + "liquidating": "0", + "intellProperty": "0", + "illegal": "0", + "ownTax": "0", + "auction": "227" + }, + "manageCount": { + "certificate": "0", + "licence": "2", + "appbk": "0", + "bid": "0", + "taxCredit": "0" + }, + "proRightCount": { + "tm": "0", + "copyRegSoftware": "0", + "patent": "0", + "copyRegWorks": "0", + "icp": "21" + } + }, + "groupNames": { + "licence": "行政许可", + "appbk": "产品信息", + "patent": "专利信息", + "lawsuit": "法律诉讼", + "dishonest": "失信被执行人", + "taxPunish": "税收违法", + "certificate": "资质证书", + "copyRegSoftware": "转件著作权", + "liquidating": "清算信息", + "envPunish": "环保处罚", + "intellProperty": "知识产权出质", + "illegal": "严重违法", + "copyRegWorks": "作品著作权", + "taxCredit": "税务评级", + "ownTax": "欠税公告", + "auction": "司法拍卖", + "punishment": "行政处罚", + "equityFreeze": "股权冻结", + "abnormal": "经营异常", + "mortgage": "动产抵押", + "equityPledge": "股权出质", + "zhixing": "被执行人", + "courtNotice": "法院公告", + "icp": "网站备案", + "ktnotice": "开庭公告", + "tm": "商标信息", + "xianxiao": "限制高消费", + "bid": "招投标" + }, + "groupUrls": { + "riskCount": "https://bip-test.yyuap.com/iuap-data-ep/intellid/portrait/info/10/30a303f98072f8e6fae82cf5959aed7e?defaultActiveTab=3&funct=nccCount", + "bussCount": "https://bip-test.yyuap.com/iuap-data-ep/intellid/portrait/info/10/30a303f98072f8e6fae82cf5959aed7e?defaultActiveTab=4&funct=nccCount", + "manageCount": "https://bip-test.yyuap.com/iuap-data-ep/intellid/portrait/info/10/30a303f98072f8e6fae82cf5959aed7e?defaultActiveTab=5&funct=nccCount", + "proRightCount": "https://bip-test.yyuap.com/iuap-data-ep/intellid/portrait/info/10/30a303f98072f8e6fae82cf5959aed7e?defaultActiveTab=7&funct=nccCount" + } + } + }, + + "msg": "执行成功", + "ext": "success", + "success": true +} \ No newline at end of file diff --git a/src/uapbd/public/testJSON/getImportLog.json b/src/uapbd/public/testJSON/getImportLog.json new file mode 100644 index 00000000..01f5b6da --- /dev/null +++ b/src/uapbd/public/testJSON/getImportLog.json @@ -0,0 +1,149 @@ +{ + "data": [ + { + "pk_group_app": "1001Z01000000004P42I", + "appname": "人行联行信息", + "appcode": "10140CBCN", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:22", + "dr": "0", + "idx": "-1", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42M", + "appname": "银行账户-集团", + "appcode": "10140BACCG", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:46:09", + "dr": "0", + "idx": "-5", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42P", + "appname": "结算方式", + "appcode": "10140BALT", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:46:50", + "dr": "0", + "idx": "-8", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局", + "appcode": "10140BANK", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局1", + "appcode": "10140BANK1", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局1", + "appcode": "10140BANK1", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局12", + "appcode": "10140BANK12", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局13", + "appcode": "10140BANK13", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局14", + "appcode": "10140BANK14", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局15", + "appcode": "10140BANK15", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局16", + "appcode": "10140BANK16", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + }, + { + "pk_group_app": "1001Z01000000004P42J", + "appname": "银行-全局17", + "appcode": "10140BANK17", + "pk_excel_group": "1001Z01000000004P3ZB", + "ts": "2022-12-07 10:45:39", + "dr": "0", + "idx": "-2", + "valueIndex": {}, + "status": "0", + "m_isDirty": false + } + ], + "success": true +} \ No newline at end of file diff --git a/src/uapbd/public/testJSON/parseLog.json b/src/uapbd/public/testJSON/parseLog.json new file mode 100644 index 00000000..ec981867 --- /dev/null +++ b/src/uapbd/public/testJSON/parseLog.json @@ -0,0 +1,38 @@ +{ + "data": [ + { + "failnum": "0", + "importobj": "人行联行信息1", + "importsign": "1692011441654", + "progress": "20", + "runstatus": "异常", + "runstatusvalue": "1", + "successnum": "0", + "taskname": "1业务单元基本信息_财务成本域_部门_基本信息_账簿类型_temp.xlsx", + "totalnum": "0" + }, + { + "failnum": "0", + "importobj": "人行联行信息2", + "importsign": "3692011441654", + "progress": "100", + "runstatus": "成功", + "runstatusvalue": "3", + "successnum": "0", + "taskname": "2业务单元基本信息_财务成本域_部门_基本信息_账簿类型_temp.xlsx", + "totalnum": "0" + }, + { + "failnum": "5", + "importobj": "人行联行信息3", + "importsign": "3692011441654", + "progress": "100", + "runstatus": "异常", + "runstatusvalue": "5", + "successnum": "0", + "taskname": "3业务单元基本信息_财务成本域_部门_基本信息_账簿类型_temp.xlsx", + "totalnum": "0" + } + ], + "success": true +} \ No newline at end of file diff --git a/src/uapbd/public/uapbdstyle/uapbd_style_common.less b/src/uapbd/public/uapbdstyle/uapbd_style_common.less index e5339221..ed5a5911 100644 --- a/src/uapbd/public/uapbdstyle/uapbd_style_common.less +++ b/src/uapbd/public/uapbdstyle/uapbd_style_common.less @@ -63,7 +63,7 @@ display: inline-block; vertical-align: middle; padding-top: 30px; - text-align: center; + // text-align: center; .opr-botton{ padding-top: 25px; display: block; @@ -254,15 +254,15 @@ // .node-item-edit-point-style-self > a { // background-color: #ebedf2; // } -.node-item-edit-point-style-self { - background-color: #ebedf2; -} +// .node-item-edit-point-style-self { +// background-color: #ebedf2; +// } .node-item-edit-point-style-self>a span { color: #e14c46!important; } .table-slef-set-long span { - margin-right: 0px!important; + // margin-right: 0px!important; } //jin //jin \ No newline at end of file diff --git a/src/uapbd/public/utils/BDCreateUIDom.js b/src/uapbd/public/utils/BDCreateUIDom.js index 146131d3..6df1a690 100644 --- a/src/uapbd/public/utils/BDCreateUIDom.js +++ b/src/uapbd/public/utils/BDCreateUIDom.js @@ -1,4 +1,3 @@ -/*cPb1BQxEZ8c0dGZlqiLjAJKTlSifwM65G8+DnY/bWPc=*/ /* * @Descripttion: 多语&&模板资源统一查询 * @version: @@ -61,5 +60,4 @@ export default function BDCreateUIDom(props){ callback && callback(virMap.get("templateData"), virMap.get("langData"), virMap.get("inlt")) }) }; -}; -/*cPb1BQxEZ8c0dGZlqiLjAJKTlSifwM65G8+DnY/bWPc=*/ \ No newline at end of file +}; \ No newline at end of file diff --git a/src/uapbd/public/utils/billCodeUtil.js b/src/uapbd/public/utils/billCodeUtil.js index 67d40f59..daf1a05d 100644 --- a/src/uapbd/public/utils/billCodeUtil.js +++ b/src/uapbd/public/utils/billCodeUtil.js @@ -1,4 +1,3 @@ -/*VT7XaALxKej2A6t6BeV5q/ruDgBosvwzshj0Oh43hcs=*/ import {ajax,toast} from 'nc-lightapp-front'; let urls = { queryCurrOrg : "/nccloud/uapbd/bankacc/querycurrorg.do", @@ -69,13 +68,16 @@ class BillCodeUtil{ */ convertFormData(formData){ var me = this; - if(!formData) + if(!formData){ return; + } let obj = {}; let values = formData.rows[0].values; for(let [key,value] of Object.entries(values)){ - if(value.value) + if(value.value){ obj[key] = value.value; + } + } me.config.object = obj; } @@ -92,8 +94,9 @@ class BillCodeUtil{ toast({content:'props和回调函数必须至少传一个',color:'error'}); return; } - if(values) + if(values){ me.convertFormData(values); + } let requestparam = { pk_org:me.config.pk_org, pk_group:me.config.pk_group, @@ -124,22 +127,29 @@ class BillCodeUtil{ if(['add','edit'].includes(me.config.type)) { //若后置编码且可编辑,并且有输入的值,则以输入值为准 let inputVal = me.config.props.form.getFormItemsValue(me.config.formId,me.config.itemcode); - if(!inputVal.value) + if(!inputVal.value){ me.config.props.form.setFormItemsValue(me.config.formId, { - [me.config.itemcode]: {value:data.code,display:data.code} + [me.config.itemcode]: {value:data.code=""} }); + } + me.config.props.form.setFormItemsRequired(me.config.formId, { + [me.config.itemcode]: false + }); } - if(me.config.type != 'delete') + if(me.config.type != 'delete'){ me.config.props.form.setFormItemsDisabled(me.config.formId,{ [me.config.itemcode]:!data.isEdit }); + } } }else{ if(me.config.props){ - if(me.config.type == 'add') + if(me.config.type == 'add'){ me.config.props.form.setFormItemsValue(me.config.formId,{[me.config.itemcode]:{value:data.code}}); - if(me.config.type != 'delete') + } + if(me.config.type != 'delete'){ me.config.props.form.setFormItemsDisabled(me.config.formId,{[me.config.itemcode]:!data.isEdit}); + } } } if(data.code || data.code == ''){ @@ -155,5 +165,4 @@ class BillCodeUtil{ }) } } -export default BillCodeUtil -/*VT7XaALxKej2A6t6BeV5q/ruDgBosvwzshj0Oh43hcs=*/ \ No newline at end of file +export default BillCodeUtil \ No newline at end of file diff --git a/src/uapbd/public/utils/controlEnableBtnStatusUtil.js b/src/uapbd/public/utils/controlEnableBtnStatusUtil.js new file mode 100644 index 00000000..0cad884b --- /dev/null +++ b/src/uapbd/public/utils/controlEnableBtnStatusUtil.js @@ -0,0 +1,65 @@ +// 表格选择多行以后 控制停启用按钮状态 +function controlEnableBtnStatus(info) { + let { tableId = '', tableType = 'table', tableEnableCode = 'enablestate', enableBtnCode = "Enable", enableVal = "", disableBtnCode = "Disable", disableVal = "" } = info; + let checkedRows = []; + if (!tableId) { + return; + } + checkedRows = this.props[tableType].getCheckedRows(tableId); + let checkedRowsLength = checkedRows.length;//获取列表页选择数据的行数 + let enableLen = 0; + let disableLen = 0; + if (checkedRowsLength == 0) { + this.props.button.setDisabled({ + [enableBtnCode]: true, + [disableBtnCode]: true + }); + return; + } + checkedRows.forEach((item) => { + if (item.data.values[tableEnableCode].value === disableVal) {//停用 + disableLen++; + } else { + enableLen++; + } + }); + //选择多行数据 + if (enableLen === checkedRowsLength) { + this.props.button.setDisabled({ + [enableBtnCode]: true, + [disableBtnCode]: false + }); + } else if (disableLen === checkedRowsLength) { + this.props.button.setDisabled({ + [enableBtnCode]: false, + [disableBtnCode]: true + }); + } else { + this.props.button.setDisabled({ + [enableBtnCode]: false, + [disableBtnCode]: false + }); + } +} +// 获取停启用状态数据 +function getEnableData(info = {}) { + let { tableId = '', tableType = 'table', tableEnableCode = "enablestate", filterVal = '' } = info; + let returnRows = []; + let checkedRows = []; + // 获取勾选数据 + if (!tableId) { + return []; + } + checkedRows = this.props[tableType].getCheckedRows(tableId); + if (checkedRows && checkedRows.length > 0) { + returnRows = checkedRows.filter((item, index) => { + return item.data.values[tableEnableCode].value === filterVal; + }) + } + return returnRows; +} + +export { + getEnableData, + controlEnableBtnStatus +} \ No newline at end of file diff --git a/src/uapbd/public/utils/deviceUtil.js b/src/uapbd/public/utils/deviceUtil.js index 6ccd0414..74de7fe7 100644 --- a/src/uapbd/public/utils/deviceUtil.js +++ b/src/uapbd/public/utils/deviceUtil.js @@ -23,12 +23,24 @@ export const getExplore = () => { (s = ua.match(/chrome\/([\d\.]+)/)) ? sys.chrome = s[1] : (s = ua.match(/version\/([\d\.]+).*safari/)) ? sys.safari = s[1] : 0; // 根据关系进行判断 - if (sys.ie) return ('IE: ' + sys.ie) - if (sys.edge) return ('EDGE: ' + sys.edge) - if (sys.firefox) return ('Firefox: ' + sys.firefox) - if (sys.chrome) return ('Chrome: ' + sys.chrome) - if (sys.opera) return ('Opera: ' + sys.opera) - if (sys.safari) return ('Safari: ' + sys.safari) + if (sys.ie) { + return ('IE: ' + sys.ie) + } + if (sys.edge) { + return ('EDGE: ' + sys.edge) + } + if (sys.firefox) { + return ('Firefox: ' + sys.firefox) + } + if (sys.chrome) { + return ('Chrome: ' + sys.chrome) + } + if (sys.opera) { + return ('Opera: ' + sys.opera) + } + if (sys.safari) { + return ('Safari: ' + sys.safari) + } return 'Unkonwn' } @@ -41,12 +53,24 @@ export const getOS = () => { var vendor = 'navigator' in window && 'vendor' in navigator && navigator.vendor.toLowerCase() || ''; var appVersion = 'navigator' in window && 'appVersion' in navigator && navigator.appVersion.toLowerCase() || ''; - if (/mac/i.test(appVersion)) return 'MacOSX' - if (/win/i.test(appVersion)) return 'windows' - if (/linux/i.test(appVersion)) return 'linux' - if (/iphone/i.test(userAgent) || /ipad/i.test(userAgent) || /ipod/i.test(userAgent)) 'ios' - if (/android/i.test(userAgent)) return 'android' - if (/win/i.test(appVersion) && /phone/i.test(userAgent)) return 'windowsPhone' + if (/mac/i.test(appVersion)) { + return 'MacOSX' + } + if (/win/i.test(appVersion)) { + return 'windows' + } + if (/linux/i.test(appVersion)) { + return 'linux' + } + if (/iphone/i.test(userAgent) || /ipad/i.test(userAgent) || /ipod/i.test(userAgent)) { + 'ios' + } + if (/android/i.test(userAgent)) { + return 'android' + } + if (/win/i.test(appVersion) && /phone/i.test(userAgent)) { + return 'windowsPhone' + } } /** @@ -152,7 +176,9 @@ function formatDate(fmt) { if (len) { // Compact form - for (i = 0; i < len; i++) uuid[i] = chars[0 | getRandom()*radix]; + for (i = 0; i < len; i++) { + uuid[i] = chars[0 | getRandom()*radix]; + } } else { // rfc4122, version 4 form let r; diff --git a/src/uapbd/public/utils/index.js b/src/uapbd/public/utils/index.js index be28739e..bdd8e211 100644 --- a/src/uapbd/public/utils/index.js +++ b/src/uapbd/public/utils/index.js @@ -65,7 +65,8 @@ import { dealTreeData, createTreeData, addVirtualRootNode, - expandFirstNode + expandFirstNode, + checkDataHasCurrentSelectNode } from './treeUtil'; import {checkHasProps,convertEnableState, filterFormEmptyVal} from './formUtil'; import BillCodeUtil from './billCodeUtil.js'; @@ -83,10 +84,12 @@ import { } from "./metaUtil"; import BDCreateUIDom from "./BDCreateUIDom"; import {checkPropExist} from "./objectUtil"; +import {controlEnableBtnStatus, getEnableData} from "./controlEnableBtnStatusUtil"; import deepClone from './deepClone'; import BDselect from './bdselected.js'; import initPage from './initPage.js'; - +import PluginLoader from "./pluginLoader"; +import {setInnerStorage, getInnerStorage} from "./uapbdStorage"; var mergeData = function(values, areaitems){ @@ -107,6 +110,7 @@ var Utils = { filterDelRows, handleTableReData, checkHasChildren, + checkDataHasCurrentSelectNode, checkHasProps, dealTreeData, createTreeData, @@ -134,7 +138,13 @@ var Utils = { deleteQueryCondition, filterEmtyOptionItem, BDCreateUIDom, - checkPropExist + checkPropExist, + PluginLoader, + controlEnableBtnStatus,//表格多选行控制停启用按钮状态 + getEnableData,//表格多选行获取停用或者启用数据 + setInnerStorage, + getInnerStorage, + }; export default Utils; diff --git a/src/uapbd/public/utils/pluginLoader.js b/src/uapbd/public/utils/pluginLoader.js new file mode 100644 index 00000000..c3d3b098 --- /dev/null +++ b/src/uapbd/public/utils/pluginLoader.js @@ -0,0 +1,112 @@ +/* + * @Descripttion: + * @version: + * @Author: Chendch + * @Date: 2019-06-08 15:55:18 + * @LastEditors: Chendch + * @LastEditTime: 2021-06-10 16:01:28 + */ +import React, {Component} from "react"; + +export default class PluginLoader extends Component { + constructor(props) { + super(props); + this.state = { + plugin: null + } + } + + componentDidMount() { + this.createScript(this.props.url); + } + + componentWillReceiveProps(nextProps) { + if(this.props.url !== nextProps.url) { + this.createScript(nextProps.url); + } + } + + componentWillUnmount() { + if(this.script) { + this.script.removeEventListener('load', this.a); + this.script.removeEventListener('error', this.b); + delete this.a; + delete this.b; + delete this.script; + } + } + + refCodeToRefKey = (refcode) => { + var s = refcode.split('/'), + refKey; + refKey = s.slice(s.length - 5).join('/'); + refKey.includes('.js') && (refKey = refKey.substring(0, refKey.length - 3)); + return refKey; + }; + + createScript = (src) => { + if(!src) { + this.setState({ + url: "" + }); + return ; + } + let scripts = Array.from(document.getElementsByTagName('script')), + flag, + refKey = this.refCodeToRefKey(src); + flag = scripts.find((e) => { + return e.src.includes(refKey); + }); + this.a = this.handleLoad.bind(null, refKey, true); + this.b = this.handError.bind(null, src); + if(window[refKey]) { + this.handleLoad(refKey); + }else { + this.setState({ + url: "" + }, () => { + let script; + if(flag) { + script = flag; + }else { + script = document.createElement('script'); + script.src = '../../../../' + refKey + '.js'; + script.type = 'text/javascript'; + document.body.appendChild(script); + } + this.script = script; + script.addEventListener('load', this.a); + script.addEventListener('error', this.b); + }) + } + } + + handError = (src) => { + this.setState({ + url: null + }); + console.error(`找不到${src}这个文件,请检查引用路径`); + } + + handleLoad = (refKey, async = false) => { + let that = this; + try{ + if (!(async && refKey !== that.refCodeToRefKey(that.props.url))) { + that.setState({ + url: window[refKey].default + }); + } + }catch(err) { + this.setState({ + url: null + }); + console.error(err.message); + } + } + + render() { + let App = this.state.url; + console.log(App) + return typeof App === 'function' && ; + } +} \ No newline at end of file diff --git a/src/uapbd/public/utils/stringUtil.js b/src/uapbd/public/utils/stringUtil.js index 64cfffc4..435207f3 100644 --- a/src/uapbd/public/utils/stringUtil.js +++ b/src/uapbd/public/utils/stringUtil.js @@ -4,7 +4,7 @@ * @Author: Chendch * @Date: 2020-10-10 17:36:07 * @LastEditors: Chendch - * @LastEditTime: 2021-03-30 14:58:27 + * @LastEditTime: 2023-10-10 15:59:15 */ import { pageTo, metaCache, viewModel, gzip} from "nc-lightapp-front"; const {getMetaCache} = metaCache; @@ -93,7 +93,9 @@ export const copyToClipboard = (elem) => { * 获取字符在指定字符串中存在的个数 * **/ export const getStrNum = (str, papStr) => { - if(!str || !papStr) return false; + if(!str || !papStr) { + return false; + } const regex = new RegExp(papStr, 'g'); // 使用g表示整个字符串都要匹配 const result = str.match(regex); const count = !result ? 0 : result.length; @@ -126,7 +128,7 @@ function isJSON(str) { return false; } } - return false; + return true; } /* @@ -151,7 +153,9 @@ export function checkBtnAuthInModule(moduleId, btnKey, props = {}) { if(!!props.noControlPermission) {//不需要控制权限 return true; } - if(!appcode || !pagecode) return status; + if(!appcode || !pagecode) { + return status; + } let tempalteCache = getMetaCache(appcode, pagecode); // console.log("tempalteCache---", {tempalteCache}) try{ @@ -163,13 +167,17 @@ export function checkBtnAuthInModule(moduleId, btnKey, props = {}) { tempalteCache = tempalteCache; } - if(!tempalteCache) return status; + if(!tempalteCache) { + return status; + } buttonData = typeof(tempalteCache) === "string" ? JSON.parse(tempalteCache).button : tempalteCache.button; //特殊处理下button.button取值 if(Object.prototype.toString.call(buttonData).slice(8, -1).toLowerCase() == "object" && Object.keys(buttonData).length) { buttonData = buttonData.button; } - if(!buttonData || !buttonData.length) return status; + if(!buttonData || !buttonData.length) { + return status; + } btnList = buttonData.filter( item => { return item.area === moduleId }).map( list => { diff --git a/src/uapbd/public/utils/tableUtil.js b/src/uapbd/public/utils/tableUtil.js index 4c92b845..2ce83f27 100644 --- a/src/uapbd/public/utils/tableUtil.js +++ b/src/uapbd/public/utils/tableUtil.js @@ -9,7 +9,9 @@ * @param reDataRows 保存后返回的行 */ export function filterResult(allData,reDataRows){ - if(!reDataRows) return; + if(!reDataRows) { + return; + } if(allData.rows){ allData.rows.forEach((item,index) => { reDataRows.forEach((it,i) => { diff --git a/src/uapbd/public/utils/treeUtil.js b/src/uapbd/public/utils/treeUtil.js index 775ffdc0..2323fc4a 100644 --- a/src/uapbd/public/utils/treeUtil.js +++ b/src/uapbd/public/utils/treeUtil.js @@ -142,12 +142,16 @@ const createTreeData = (data, sortKey="") => { * @return */ const expandFirstNode = (treeData, id, that, limit = null) => { - if(!treeData || !id || !that) return ; + if(!treeData || !id || !that) { + return ; + } let pks = []; for(let index = 0; index limit) break; + if(!!limit && index > limit) { + break; + } if(item && item.key) { pks.push(item.key); } @@ -177,11 +181,34 @@ function addVirtualRootNode(params, childrens) { } ] } +// 检查新数据中是否包含以前选中的树节点 +function checkDataHasCurrentSelectNode(tree, pk){ + let flag = false; + if(!!!tree || !!!pk){ + //树组件没有数据 + // flag = false; + return false; + } + let i = tree.length; + while (i--){ + let data = tree[i]; + if (data.refpk === pk) { + return true; + } else { + if (data.hasOwnProperty('children') && data.children.length > 0) { + if(checkDataHasCurrentSelectNode(data.children, pk)){ + return true; + } + } + } + } +}; export { checkHasChildren, dealTreeData, createTreeData, addVirtualRootNode, - expandFirstNode + expandFirstNode, + checkDataHasCurrentSelectNode } \ No newline at end of file diff --git a/src/uapbd/public/utils/typeRegUtil.js b/src/uapbd/public/utils/typeRegUtil.js index cd63433e..d60680d5 100644 --- a/src/uapbd/public/utils/typeRegUtil.js +++ b/src/uapbd/public/utils/typeRegUtil.js @@ -87,13 +87,16 @@ export const lunCheck = (bankno) => { var arrOuShu=new Array(); //偶数位数组 for(var j=0;j9 的分割之后的数组个位数 diff --git a/src/uapbd/public/utils/uapbdStorage.js b/src/uapbd/public/utils/uapbdStorage.js new file mode 100644 index 00000000..a5ba4599 --- /dev/null +++ b/src/uapbd/public/utils/uapbdStorage.js @@ -0,0 +1,17 @@ +import {createPage, base, toast, getBusinessInfo, viewModel} from 'nc-lightapp-front'; +let { setGlobalStorage, getGlobalStorage, removeGlobalStorage } = viewModel; + +export function setInnerStorage(key, value) { + let uapbdCacheStr = getGlobalStorage('localStorage', 'uapbdCache'); + if(!uapbdCacheStr) { + setGlobalStorage('localStorage', 'uapbdCache', JSON.stringify({[key]: value})); + }else { + setGlobalStorage('localStorage', 'uapbdCache', JSON.stringify({...JSON.parse(uapbdCacheStr), [key]: value})); + } + +} + +export function getInnerStorage(key) { + let uapbdCacheStr = getGlobalStorage('localStorage', 'uapbdCache'); + return uapbdCacheStr ? JSON.parse(uapbdCacheStr)[key] : undefined; +}