| | |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | uploadattachment:{ |
| | | //是否显示上传附件 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | this.subitemName = col.field; |
| | | }else if(col.type === 'upload'){ |
| | | console.log('col',col) |
| | | }else if(col.type=="multiFile"){ |
| | | if(this.uploadattachment == "false" || this.uploadattachment == false){ |
| | | col.display=false |
| | | } |
| | | } |
| | | if (col.type === "select") { |
| | | if(col.data && col.data.length>0){ |
| | |
| | | :formItems="formItems" |
| | | :formData="form" |
| | | :initValue="paramVOS.initvalue" |
| | | :uploadattachment="paramVOS.uploadattachment || false" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | <ui-view ref="uiViewRef" v-else-if="paramVOS.context" |
| | |
| | | this.formDefineId=this.$refs.uiViewRef.data[key].DefineVO.id; |
| | | if (this.paramVOS.savebeforeevent) { |
| | | var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); |
| | | import("../"+urlobj.jsPath+".js").then(module => { |
| | | import(`./${urlobj.jsPath}.js`).then(module => { |
| | | module[urlobj.methodName]({ |
| | | paramVOS: this.paramVOS, |
| | | dataStore: this.dataStore, |
| | |
| | | this.formDefineId=this.paramVOS.form; |
| | | if (this.paramVOS.savebeforeevent) { |
| | | var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); |
| | | import("../"+urlobj.jsPath+".js").then(module => { |
| | | import(`./${urlobj.jsPath}.js`).then(module => { |
| | | module[urlobj.methodName]({ |
| | | paramVOS: this.paramVOS, |
| | | dataStore: this.dataStore, |
| | |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from 'vue'; |
| | | import {handlers} from '../handlers'; |
| | | import {handlerAction} from '../handlers'; |
| | | |
| | | /** |
| | | * 按钮的基础服务 |
| | |
| | | } |
| | | if (button.url && button.url != 'null') { |
| | | //有配置action路径,使用路径对应的js |
| | | import("../" + button.url + ".js").then(module => { |
| | | import(`../${button.url}`).then(module => { |
| | | module.doAction(options, callback); |
| | | }) |
| | | } else { |
| | | if (handlers[button.actionVO.id.toLowerCase()]) { |
| | | handlers[button.actionVO.id.toLowerCase()]() |
| | | } else { |
| | | Vue.prototype.$message.error('未找到对应action,请重新配置按钮!'); |
| | | } |
| | | //执行通用action |
| | | handlerAction(button.actionVO.id.toLowerCase(),options, callback) |
| | | } |
| | | }; |
| | | |
| | |
| | | fnTarget(buttonParse,callback); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | }) |
| | | } catch (error) { |
| | |
| | | fnTarget(buttonParse,callback,actionType); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback,actionType); |
| | | }) |
| | | } catch (error) { |
| | |
| | | //预置action |
| | | export const handlers = { |
| | | //查看 |
| | | view: () => {import("@/components/actions/base/ViewAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //创建 |
| | | add: () => {import("@/components/actions/base/AddAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //修改 |
| | | edit: () => {import("@/components/actions/base/EditAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //删除 |
| | | delete: () => {import("@/components/actions/base/DeleteAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, //删除 |
| | | del: () => {import("@/components/actions/base/DeleteAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | import Vue from "vue"; |
| | | |
| | | export const handlerAction=function (type,options, callback) { |
| | | const handlers = { |
| | | //查看 |
| | | view: () => {import("@/components/actions/base/ViewAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //创建 |
| | | add: () => {import("@/components/actions/base/AddAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //修改 |
| | | edit: () => {import("@/components/actions/base/EditAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //删除 |
| | | delete: () => {import("@/components/actions/base/DeleteAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, //删除 |
| | | del: () => {import("@/components/actions/base/DeleteAction").then(module => { |
| | | module.doAction(options,callback); |
| | | })}, |
| | | }; |
| | | if (handlers[type]) { |
| | | handlers[type]() |
| | | } else { |
| | | Vue.prototype.$message.error('未找到对应action,请重新配置按钮!'); |
| | | } |
| | | }; |
| | |
| | | :isEdit="canEdit" |
| | | :formData="form" |
| | | :initValue="paramVOS.initvalue" |
| | | :uploadattachment="paramVOS.uploadattachment || false" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | </div> |
| | |
| | | dataForm(this.params, this.paramVOS.getdataurl, this.paramVOS.getdatamethod).then(res => { |
| | | this.form = res.data.obj.data; |
| | | this.loading = false; |
| | | this.$emit("setDataStore", { |
| | | area: this.areasName, |
| | | type: this.componentVO.uiComponentType, |
| | | btmType: this.currentDefineVO.btmType, |
| | | dataStore: [this.form] |
| | | }); |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type: this.componentVO.uiComponentType, |
| | | currentDefineVO: this.currentDefineVO, |
| | | data: this.form |
| | | }); |
| | | }).catch(error => { |
| | | this.loading = false; |
| | | }); |
| | |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form; |
| | | this.$emit("setDataStore", { |
| | | area: this.areasName, |
| | | type: this.componentVO.uiComponentType, |
| | | btmType: this.currentDefineVO.btmType, |
| | | dataStore: [this.form] |
| | | }); |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type: this.componentVO.uiComponentType, |
| | | currentDefineVO: this.currentDefineVO, |
| | | data: this.form |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 参数可在参数列表配置,也可在按钮使用时配置。参数信息: |
| | | >* type:创建界面的业务类型,必填 |
| | | >* context:创建界面的UI上下文,有form参数时该值无效。若UI上下文仅配有表单展示,则添加弹窗会默认有保存按钮 |
| | | >* form:添加的表单对象,必须要配置form或者context,优先使用form |
| | | >* context:创建界面的UI上下文,有form参数时该值无效。若UI上下文仅配有表单展示,则添加弹窗会默认有保存按钮 |
| | | >* useDataType:使用UI上下文中的哪个类型数据,值有form、tree、table、TreeTable,不填时默认为form |
| | | >* initvalue:表单预设value,非必填。格式示例:rootoid=root.${oid}&rootname=root.${name}&name=${name}、sourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} |
| | | >* needselect:是否必须选择数据,与initvalue配合使用。 |
| | | 值为false时允许initvalue对应的属性值为空。 |
| | | 值为true或者未配置参数则必须有上下文的sourceData或dataStore,用以与initvalue建立映射关系 |
| | | |
| | | >* url: 创建界面的保存按钮请求路径,默认'uiDataController/addSave' |
| | | >* method: 创建界面的保存按钮请求路径类型,默认'post' |
| | | >* uploadfileurl: 有文件上传时可配置,默认'vciFileUploadController/uploadFile' |
| | | >* accept:有文件上传时可配置 |
| | | >* exts:有文件上传时可配置 |
| | | >* uploadattachment:有附件上传时须配置,是否显示上传附件,默认false |
| | | >* preevent:弹窗前置事件,配置前置事件的js地址,如"preevent.js"、“xxx/preevent.js”,文件放在src/components/actions下>* preevent:弹窗前置事件,配置前置事件的js地址,如"preevent.js"、“xxx/preevent.js”,文件放在src/components/actions下 |
| | | >* afterevent:弹窗后置事件,配置后置事件的js地址,如"afterevent.js"、“xxx/afterevent.js”,文件放在src/components/actions下 |
| | | >* |
| | | ### edit,修改 |
| | |  |
| | | >* type:修改界面的业务类型,必填 |
| | | >* form:修改的表单对象,必须要配置form或者context,优先使用form |
| | | >* context:修改界面的UI上下文,有form参数时该值无效。若UI上下文仅配有表单展示,则修改弹窗会默认有保存按钮 |
| | | >* useDataType:使用UI上下文中的哪个类型数据,值有form、tree、table、TreeTable,不填时默认为form |
| | | >* initvalue:表单预设value,非必填。格式示例:rootoid=root.${oid}&rootname=root.${name}&name=${name}、sourceoid=sourceData.${oid}&sourcename=sourceData.${name}&oid=${oid}&name=${name} |
| | | >* needselect:是否必须选择数据,与initvalue配合使用。 |
| | | 值为false时允许initvalue对应的属性值为空。 |
| | | 值为true或者未配置参数则必须有上下文的sourceData或dataStore,用以与initvalue建立映射关系 |
| | | |
| | | ### del,删除 |
| | | |
| | | ### view,查看 |