From 76251922200560a63d0703ce2f936246ce8bc46e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 28 九月 2023 09:42:38 +0800 Subject: [PATCH] 2023-09-28 --- src/menu/components/form/simple-form/index.jsx | 1 src/tabviews/zshare/mutilform/index.jsx | 86 +++++++++++++++------------- src/templates/zshare/modalform/index.jsx | 2 src/views/design/sidemenu/menuelement/index.scss | 14 ++++ src/menu/components/group/paste/index.jsx | 7 ++ src/tabviews/zshare/fileupload/index.jsx | 37 +++++++++--- src/templates/zshare/formconfig.jsx | 5 + src/tabviews/zshare/actionList/normalbutton/index.jsx | 1 src/menu/components/tabs/paste/index.jsx | 7 ++ src/utils/utils.js | 6 + 10 files changed, 110 insertions(+), 56 deletions(-) diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index de1c0ca..15527e3 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -539,6 +539,7 @@ _card.subcards[0].setting.align = _card.wrap.align _card.subcards[0].setting.enable = _card.wrap.enable _card.subcards[0].setting.verticalSpace = _card.wrap.verticalSpace + _card.subcards[0].subButton.enable = _card.wrap.enable if (_card.wrap.closeEnable === 'true' && !_card.subcards[0].closeButton) { _card.subcards[0].closeButton = {label: '鍏抽棴', enable: 'true', type: 'close', style: {backgroundColor: '#ffffff', color: 'rgba(0,0,0,0.65)', borderColor: '#d9d9d9', borderWidth: '1px', paddingLeft: '25px', paddingRight: '25px', paddingTop: '5px', paddingBottom: '5px', marginLeft: '10px'}} diff --git a/src/menu/components/group/paste/index.jsx b/src/menu/components/group/paste/index.jsx index fb491f3..8a9b436 100644 --- a/src/menu/components/group/paste/index.jsx +++ b/src/menu/components/group/paste/index.jsx @@ -20,7 +20,7 @@ pasteSubmit = () => { let appType = sessionStorage.getItem('appType') - let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'normaltable', 'tablecard', 'editor', 'line', 'bar', 'pie', 'scatter', 'sandbox'] + let options = ['datacard', 'propcard', 'balcony', 'timeline', 'simpleform', 'stepform', 'tabform', 'basetable', 'normaltable', 'tablecard', 'editor', 'line', 'bar', 'pie', 'scatter', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', @@ -53,6 +53,11 @@ return } + if (res.copyType === 'basetable') { + res.copyType = 'normaltable' + res.subtype = 'normaltable' + } + res = MenuUtils.resetComponentConfig(res, appType) delete res.copyType diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx index 733653d..db15490 100644 --- a/src/menu/components/tabs/paste/index.jsx +++ b/src/menu/components/tabs/paste/index.jsx @@ -53,7 +53,7 @@ pasteSubmit = () => { const { Tab } = this.props let appType = sessionStorage.getItem('appType') - let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'editor', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox'] + let options = ['tabs', 'group', 'datacard', 'propcard', 'timeline', 'balcony', 'basetable', 'normaltable', 'mainsearch', 'simpleform', 'stepform', 'tabform', 'editor', 'tablecard', 'line', 'bar', 'pie', 'scatter', 'sandbox'] let types = { login: '鐧诲綍', navbar: '瀵艰埅鏍�', @@ -83,6 +83,11 @@ return } + if (res.copyType === 'basetable') { + res.copyType = 'normaltable' + res.subtype = 'normaltable' + } + res = this.resetconfig(res, appType) delete res.copyType diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index e3a10b6..eeb24ce 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1604,6 +1604,7 @@ } if (window.GLOB.debugger === true) { + console.info('%c' + btn.logLabel + '(鍥炶皟)', 'color: blue') console.info(sql.replace(/\n\s{8}/ig, '\n')) } diff --git a/src/tabviews/zshare/fileupload/index.jsx b/src/tabviews/zshare/fileupload/index.jsx index cb0be7b..f7e9866 100644 --- a/src/tabviews/zshare/fileupload/index.jsx +++ b/src/tabviews/zshare/fileupload/index.jsx @@ -5,7 +5,9 @@ import { Upload, Button, Progress, notification } from 'antd' import { UploadOutlined } from '@ant-design/icons' import SparkMD5 from 'spark-md5' + import Api from '@/api' +import MKEmitter from '@/utils/events.js' import './index.scss' class FileUpload extends Component { @@ -129,7 +131,9 @@ this.props.onChange(vals.join(',')) } - onUpdate = (url) => { + onUpdate = (url, file_name) => { + const { config } = this.props + let filelist = fromJS(this.state.filelist).toJS() if (filelist[filelist.length -1]) { @@ -151,7 +155,20 @@ }) this.setState({filelist}) - this.props.onChange(vals.join(',')) + + if (config.subFields) { + let other = {} + config.subFields.forEach((n, i) => { + other[n.field] = file_name + setTimeout(() => { + MKEmitter.emit('mkFC', 'input', n.uuid, file_name) + }, i * 5) + }) + + this.props.onChange(vals.join(','), other) + } else { + this.props.onChange(vals.join(',')) + } } onFail = (msg) => { @@ -171,7 +188,7 @@ }) } - shardupload = (param) => { + shardupload = (param, file_name) => { let form = new FormData() form.append('file', param.binary) @@ -189,7 +206,7 @@ Api.getLargeFileUpload(form).then(res => { if (res.status) { if (res.urlPath) { - this.onUpdate(res.urlPath) + this.onUpdate(res.urlPath, file_name) } else { this.onFail() } @@ -253,6 +270,8 @@ percent: 0 }) + let file_name = file.name.replace(/\.{1}[^.]*$/ig, '') + if (compress === 'true' || compress === 'base64') { let reader = new FileReader() let fileSize = file.size / 1024 / 1024 @@ -292,7 +311,7 @@ let param = {Base64Img: cvs.toDataURL('image/jpeg', compressRate)} if (this.props.config.compress === 'base64') { - this.onUpdate(param.Base64Img) + this.onUpdate(param.Base64Img, file_name) this.setState({ percent: 100 @@ -317,7 +336,7 @@ url = rduri.replace(/webapi(.*)$/, '') + result.Images } - this.onUpdate(url) + this.onUpdate(url, file_name) this.setState({ percent: 100 @@ -358,7 +377,7 @@ if (res.status) { if (res.urlPath) { let path = (/^\/\//.test(res.urlPath) ? 'https:' : '') + res.urlPath - this.onUpdate(path) + this.onUpdate(path, file_name) this.setState({ percent: 100 }, () => { @@ -403,7 +422,7 @@ Api.getFilePreUpload(_param).then(res => { if (res.status && res.urlPath) { - this.onUpdate(res.urlPath) + this.onUpdate(res.urlPath, file_name) this.setState({ percent: 100 }, () => { @@ -415,7 +434,7 @@ }, 200) }) } else { - this.shardupload(param) + this.shardupload(param, file_name) } }) } diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 9f4ca38..e4f95d3 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -486,47 +486,42 @@ let item = fieldMap.get(cell.field) // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 - if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2')) && item.linkSubField) { - item.subFields = [] - item.linkSubField.forEach(m => { - let n = fieldMap.get(m) - if (n && ['text', 'number', 'textarea'].includes(n.type)) { - item.subFields.push({ - uuid: n.uuid, - field: m - }) - } - }) - - if (item.subFields.length === 0) { - item.subFields = null - } else if (item.oriOptions.length > 0) { - item.oriOptions = item.oriOptions.map(cell => { - item.subFields.forEach(m => { - cell[m.field] = cell[m.field] === undefined ? '' : cell[m.field] - }) - return cell + if (item.linkSubField && item.linkSubField.length > 0) { + if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2'))) { + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } }) - - item.options = fromJS(item.oriOptions).toJS() - } - item.linkSubField = null - } else if (item.type === 'switch' && item.linkSubField) { - item.options = [] - item.subFields = [] - item.linkSubField.forEach(m => { - let n = fieldMap.get(m) - if (n && ['text', 'number', 'textarea'].includes(n.type)) { - item.subFields.push({ - uuid: n.uuid, - field: m + + if (item.oriOptions.length > 0) { + item.oriOptions = item.oriOptions.map(cell => { + item.subFields.forEach(m => { + cell[m.field] = cell[m.field] === undefined ? '' : cell[m.field] + }) + return cell }) + + item.options = fromJS(item.oriOptions).toJS() } - }) - - if (item.subFields.length === 0) { - item.subFields = null - } else { + } else if (item.type === 'switch') { + item.options = [] + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } + }) + reFieldsVal = reFieldsVal || {} let val = item.initval === item.openVal ? item.openText : item.closeText @@ -534,7 +529,20 @@ item.subFields.forEach(n => { reFieldsVal[n.field] = val || '' }) + } else if (item.type === 'fileupload') { + item.options = [] + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } + }) } + item.linkSubField = null } @@ -1136,7 +1144,7 @@ } else if (item.type === 'fileupload') { className = item.readonly ? 'readonly' : '' className += item.fileType === 'picture-card' ? ' file-upload' : '' - content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />) + content = (<MKFileUpload config={item} onChange={(val, other = {}) => this.recordChange({[item.field]: val, ...other})} />) } else if (item.type === 'textarea') { content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>) } else if (item.type === 'rate') { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 7e207aa..752c7ec 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -4094,9 +4094,10 @@ type: 'multiselect', key: 'linkSubField', label: '濉厖琛ㄥ崟', - tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑锛屽紑鍏充細灏嗘彁绀烘枃鏈~鍏ユ琛ㄥ崟銆�', + tooltip: '鍦ㄥ垏鎹㈤�夐」鏃朵細鎶婁俊鎭嚜鍔ㄥ~鍏ュ叧鑱旂殑琛ㄥ崟锛堟枃鏈垨鏁板瓧琛ㄥ崟锛変腑锛屽紑鍏充細灏嗘彁绀烘枃鏈~鍏ユ琛ㄥ崟锛屾枃浠朵笂浼犱細灏嗗師鏂囦欢鍚嶅~鍏ユ琛ㄥ崟銆�', initVal: card.linkSubField || [], - options: inputfields + options: inputfields, + allowClear: true }, // { // type: 'number', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 42a2cb0..be0389c 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -27,7 +27,7 @@ checkcard: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'span', 'labelwidth', 'display', 'tooltip', 'extra', 'place', 'width', 'multiple', 'splitline', 'marginTop', 'marginBottom'], multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], - fileupload: ['readonly', 'required', 'hidden', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], + fileupload: ['readonly', 'required', 'hidden', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], diff --git a/src/utils/utils.js b/src/utils/utils.js index f7bd5ee..5f0598e 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1170,6 +1170,7 @@ sql = sql.replace(/\n\s{6}/ig, '\n') if (window.GLOB.debugger === true) { + console.info('%c' + item.logLabel, 'color: blue') console.info(sql) } } else { @@ -1376,6 +1377,7 @@ sql = sql.replace(/\n\s{6}/ig, '\n') if (window.GLOB.debugger === true) { + console.info('%c' + btn.logLabel, 'color: blue') console.info(sql) } } else { @@ -1580,7 +1582,7 @@ Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50),@ModularDetailCode nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@mk_deleted int,@bid nvarchar(50)${_declarefields} ` - let userName = sessionStorage.getItem('User_Name') || '' + let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' let RoleID = sessionStorage.getItem('role_id') || '' let departmentcode = sessionStorage.getItem('departmentcode') || '' @@ -2281,7 +2283,7 @@ } if (window.GLOB.debugger === true) { - // _sql = _sql.replace(/\n\s{8}/ig, '\n') + console.info('%c' + btn.logLabel, 'color: blue') console.info(_sql) } diff --git a/src/views/design/sidemenu/menuelement/index.scss b/src/views/design/sidemenu/menuelement/index.scss index 2ec4117..c5eff7e 100644 --- a/src/views/design/sidemenu/menuelement/index.scss +++ b/src/views/design/sidemenu/menuelement/index.scss @@ -21,7 +21,6 @@ width: 98%; div { padding: 0px 0px 0px 30px; - margin-right: 20px; height: 40px; line-height: 40px; cursor: move; @@ -57,3 +56,16 @@ } } } +.side-card div:first-child::before { + position: absolute; + content: ' '; + display: block; + width: 100%; + height: 8px; + top: -8px; + left: 0px; +} +.side-card:first-child div:first-child::before { + height: 15px; + top: -15px; +} -- Gitblit v1.8.0