| | |
| | | |
| | | let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | | let DateCount = `select count(1) as total from ${_dataresource} ${_search}` |
| | | console.log(LText) |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | |
| | | const SubTabTable = asyncComponent(() => import('@/tabviews/subtabtable')) |
| | | |
| | | export default class NormalTable extends Component { |
| | | export default class SubTabViewTable extends Component { |
| | | static propTpyes = { |
| | | Tab: PropTypes.object, // 标签信息 |
| | | BID: PropTypes.string, // 上级数据ID |
| | |
| | | */ |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) { |
| | | this.loadmaindata() |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 子表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | async loadmaindata (bid, type) { |
| | | const { setting } = this.state |
| | | let param = '' |
| | | let _BID = this.props.BID |
| | | |
| | | if (type === 'refresh') { |
| | | _BID = bid |
| | | } |
| | | |
| | | if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { |
| | | param = this.getCustomParam() |
| | | param = this.getCustomParam(_BID) |
| | | } else { |
| | | param = this.getDefaultParam() |
| | | param = this.getDefaultParam(_BID) |
| | | } |
| | | |
| | | this.handleTableId('') |
| | |
| | | /** |
| | | * @description 获取用户自定义存储过程传参 |
| | | */ |
| | | getCustomParam = () => { |
| | | getCustomParam = (BID) => { |
| | | const { pageIndex, pageSize, orderColumn, orderType, search, setting } = this.state |
| | | |
| | | let _search = Utils.formatCustomMainSearch(search) |
| | |
| | | PageSize: pageSize, |
| | | OrderCol: orderColumn, |
| | | OrderType: orderType, |
| | | BID: BID, |
| | | ..._search |
| | | } |
| | | |
| | |
| | | /** |
| | | * @description 获取系统存储过程 sPC_Get_TableData 的参数 |
| | | */ |
| | | getDefaultParam = () => { |
| | | getDefaultParam = (BID) => { |
| | | const { arr_field, pageIndex, pageSize, orderColumn, orderType, search, setting } = this.state |
| | | |
| | | let _search = Utils.joinMainSearchkey(search) |
| | |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field, |
| | | BID: this.props.BID |
| | | BID: BID |
| | | } |
| | | |
| | | let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order |
| | |
| | | |
| | | let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows` |
| | | let DateCount = `select count(1) as total from ${_dataresource} ${_search}` |
| | | |
| | | console.log(LText) |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = Utils.formatOptions(DateCount) |
| | | |
| | | console.log(param) |
| | | return param |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let _sql = Utils.getSelectQuerySql(item) |
| | | console.log(_sql) |
| | | _sql = Utils.formatOptions(_sql) |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: _sql, |
| | |
| | | this.setState({ |
| | | confirmLoading: true |
| | | }) |
| | | console.log(res) |
| | | // this.execSubmit(this.state.execAction, this.state.tabledata, () => { |
| | | // this.setState({ |
| | | // confirmLoading: false |
| | | // }) |
| | | // }, res) |
| | | |
| | | this.execSubmit(this.state.execAction, this.state.tabledata, () => { |
| | | this.setState({ |
| | | confirmLoading: false |
| | | }) |
| | | }, res) |
| | | }, () => {}) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | getExtraData = file => { |
| | | const param = new FormData() |
| | | param.append('file', file) |
| | | param.append('RootPath', 'Content/images/upload/') |
| | | |
| | | return param |
| | | getExtraData = () => { |
| | | return { |
| | | RootPath: 'Content/images/upload/' |
| | | } |
| | | } |
| | | |
| | | shardupload = (file, shardSize, shardCount, i) => { |
| | |
| | | if (i < shardCount) { |
| | | i++ |
| | | Api.getFileUpload(file).then(res => { |
| | | console.log(res) |
| | | if (res) { |
| | | this.setState({ |
| | | percent: Math.floor(100 * (i / shardCount)) |
| | |
| | | |
| | | beforeUpload = (file, fileList) => { |
| | | let shardSize = 200 * 1024 * 1024 |
| | | console.log(file) |
| | | // console.log(file) |
| | | |
| | | if (file.size > shardSize) { |
| | | this.setState({ |
| | |
| | | fileList: value, |
| | | action: baseUrl, |
| | | method: 'post', |
| | | multiple: true, |
| | | // headers: {'RootPath': 'Content/images/upload/'}, |
| | | onChange: this.onChange, |
| | | onRemove: this.onRemove, |
| | | data: this.getExtraData, |
| | |
| | | return ( |
| | | <Upload {...props}> |
| | | <Button> |
| | | <Icon type="upload" /> Click to Upload |
| | | <Icon type="upload" /> 点击上传 |
| | | </Button> |
| | | {showprogress ? <Progress percent={percent} size="small" /> : null} |
| | | </Upload> |
| | |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'fileupload') { |
| | | // let filelist = this.props.data ? this.props.data[item.field] : item.initval |
| | | let filelist = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png,https://img.alicdn.com/tfs/TB1Ly5oS3HqK1RjSZFPXXcwapXa-238-54.png' |
| | | let filelist = this.props.data ? this.props.data[item.field] : item.initval |
| | | if (filelist) { |
| | | try { |
| | | filelist = filelist.split(',').map((url, index) => { |
| | |
| | | import zhCN from '@/locales/zh-CN/share.js' |
| | | import enUS from '@/locales/en-US/share.js' |
| | | import nortable from '@/assets/img/normaltable.jpg' |
| | | import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | | |
| | | const _dict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | |
| | | { |
| | | title: '主子表表格', |
| | | type: 'CommonTable', |
| | | url: nortable, |
| | | url: mainsubtable, |
| | | baseconfig: '', |
| | | isSystem: true, |
| | | isSubtable: true |
| | |
| | | } else { |
| | | baseurl = 'http://qingqiumarket.cn/' + service |
| | | } |
| | | if (!/Content\/images\/upload\//.test(url)) { |
| | | baseurl = baseurl + 'Content/images/upload/' |
| | | } |
| | | // if (!/Content\/images\/upload\//.test(url)) { |
| | | // baseurl = baseurl + 'Content/images/upload/' |
| | | // } |
| | | let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url |
| | | return realurl |
| | | } |
| | |
| | | keys = keys.join(',') |
| | | values = values.join(',') |
| | | |
| | | _sql = `insert into ${btn.sql} (${keys}, createuserid) select ${values},@userid` |
| | | _sql = `insert into ${btn.sql} (${keys}, createuserid, BID) select ${values},@BID,@userid` |
| | | } else if (btn.OpenType === 'pop' && btn.sqlType === 'update') { |
| | | let _form = [] |
| | | formdata.forEach(item => { |