| | |
| | | options.sourceData = options.sourceData || {}; |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doAdd(options, function () { |
| | | callPostEvent(options, doAfter, callback); |
| | | doAdd(options, function (type,formData) { |
| | | callPostEvent(options, doAfter, callback,type); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | * @param options 按钮的配置信息 |
| | | * @param callback 回调 |
| | | */ |
| | | export const doAfter = (options,callback)=> { |
| | | export const doAfter = (options,callback,actionType)=> { |
| | | Vue.prototype.$message.success('执行增加后置事件'); |
| | | if(callback){ |
| | | callback(options); |
| | | callback(actionType); |
| | | } |
| | | } |
| | |
| | | values.forEach((item,i) => { |
| | | if(isShow){ |
| | | item = item.replace(':', '='); |
| | | debugger; |
| | | if (item.indexOf('${') > -1) { |
| | | if (item.split('=')[1].indexOf('.') > -1) { |
| | | //initvaluenull=true允许初始值为空 |
| | |
| | | * @param callback 回调,如果存在后置事件,会在执行完成后执行回调,否则直接回调 |
| | | * @param preEventName 后置事件名称,默认 afterevent |
| | | */ |
| | | export const callPostEvent = (options,fnTarget,callback,postEventName)=>{ |
| | | export const callPostEvent = (options,fnTarget,callback,actionType,postEventName)=>{ |
| | | let afterEvent = options.paramVOS[postEventName || 'afterevent']; |
| | | if(afterEvent) { |
| | | let buttonParse = parseEventByUrl(afterEvent,options,false); |
| | | if(validatenull(buttonParse.jsPath)){ |
| | | fnTarget(buttonParse,callback); |
| | | fnTarget(buttonParse,callback,actionType); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | module[buttonParse.methodName](options,callback,actionType); |
| | | }) |
| | | } catch (error) { |
| | | Vue.prototype.$message.error('未找到后置事件执行js'); |
| | |
| | | } |
| | | }else{ |
| | | if(callback){ |
| | | callback(options); |
| | | callback(actionType); |
| | | } |
| | | } |
| | | }; |
| | |
| | | import Vue from "vue"; |
| | | import AddEditDialog from "@/components/actions/AddEditDialog"; |
| | | |
| | | export const doAction = (options) => { |
| | | export const doAction = (options,callback) => { |
| | | const paramVOS = Object.assign({ |
| | | getdataurl: '/api/uiDataController/dataFormQuery', |
| | | getdatamethod: 'post', |
| | |
| | | } |
| | | } |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doAdd(options, function () { |
| | | callPostEvent(options, doAfter, options.callback); |
| | | doAdd(options, function (type,formData) { |
| | | callPostEvent(options, doAfter,type, callback); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | * @param options 按钮的配置信息 |
| | | * @param callback 回调 |
| | | */ |
| | | export const doAfter = (options,callback)=> { |
| | | export const doAfter = (options,callback,actionType)=> { |
| | | Vue.prototype.$message.success('执行修改后置事件'); |
| | | if(callback){ |
| | | callback(options); |
| | | callback(actionType); |
| | | } |
| | | } |
| | |
| | | for(let key in this.$refs.uiViewRef.data){ |
| | | if(this.$refs.uiViewRef.data[key].type== useDataType){ |
| | | this.form=this.$refs.uiViewRef.data[key].data; |
| | | 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 => { |
| | |
| | | let that=this; |
| | | this.$refs.formRef.validate((valid, done) => { |
| | | if (valid) { |
| | | this.formDefineId=this.paramVOS.form; |
| | | if (this.paramVOS.savebeforeevent) { |
| | | var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); |
| | | import("../"+urlobj.jsPath+".js").then(module => { |
| | |
| | | formValues.defaultValues.btmname = this.paramVOS.type; |
| | | } |
| | | let datas = { |
| | | formDefineId: this.paramVOS.form || "", |
| | | formDefineId: this.formDefineId, |
| | | preEvent: this.paramVOS.preevent, |
| | | afterEvent: this.paramVOS.afterevent, |
| | | beforeServerEvent: this.paramVOS.beforeserverevent, |
| | |
| | | dataStore: this.dataStore || [], |
| | | sourceData: this.sourceData || {} |
| | | }, function (actionType,data) { |
| | | if (that.$parent.handleRefresh) { |
| | | that.$parent.handleRefresh(actionType,data) |
| | | } |
| | | that.$emit("afterMethod",actionType,data); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | //源数据有变化时变更当前区域数据 |
| | | console.log(this.areasName); |
| | | console.log(newval); |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | computed: {}, |
| | |
| | | <template> |
| | | <div :id="'UI-dynamic-'+areasName+componentVO.oid" class="UI-dynamic"> |
| | | <dynamic-button v-if="componentVO && componentVO.buttons" :key="areasName+'buttons-'+componentVO.oid" |
| | | :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" type="form"></dynamic-button> |
| | | :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="[form]" :sourceData="sourceData" |
| | | @afterMethod="handleRefresh" type="form"></dynamic-button> |
| | | <basic-form :key="areasName+'basicForm-'+componentVO.oid" |
| | | :span="this.componentVO.formDefineVO.columnOneRow?(24/this.componentVO.formDefineVO.columnOneRow) : 12" |
| | | :formItems="this.componentVO.formDefineVO && this.componentVO.formDefineVO.items" |
| | |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.currentDefineVO.btmType, |
| | | currentDefineVO:this.currentDefineVO, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | sourceData: { |
| | | handler(newval) { |
| | |
| | | this.sourceDataMapParams=this.sourceDataMap(); |
| | | this.getParams(); |
| | | this.handleRefresh(); |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | <dynamic-button :componentVO="componentVO" |
| | | :key="areasName+'buttons-'+componentVO.oid" |
| | | :butttonList="componentVO.buttons" :dataStore="selectList" LocationType="top" :sourceData="sourceData" |
| | | @afterMethod="handleRefresh" |
| | | type="table"></dynamic-button> |
| | | </template> |
| | | |
| | | <!--menu区域按钮--> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="selectList" :sourceData="sourceData" LocationType="menu" |
| | | <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="selectList" :sourceData="sourceData" |
| | | LocationType="menu" |
| | | @afterMethod="handleRefresh" |
| | | type="table"></dynamic-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.currentDefineVO.btmType, |
| | | currentDefineVO:this.currentDefineVO, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | 'sourceData':{ |
| | | handler(newval) { |
| | |
| | | this.getParams(); |
| | | this.handleRefresh(); |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | |
| | | } |
| | | }, |
| | | handleRefresh() { |
| | | handleRefresh(type) { |
| | | this.onLoad(this.page, this.query); |
| | | } |
| | | } |
| | |
| | | <dynamic-button v-if="componentVO.buttons && componentVO.buttons.length>0" :componentVO="componentVO" |
| | | :key="areasName+'buttons-'+componentVO.oid" |
| | | :butttonList="componentVO.buttons" :dataStore="checkDatas" |
| | | @afterMethod="handleRefresh" |
| | | :sourceData="sourceData" type="tree" style="margin-bottom: 5px;"></dynamic-button> |
| | | <el-input |
| | | placeholder="输入关键字进行过滤" |
| | |
| | | dataStore:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | data:{ |
| | | handler(newval) { |
| | |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.componentVO.treeDefineVO.btmType, |
| | | currentDefineVO:this.componentVO.treeDefineVO, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | sourceData:{ |
| | | handler(newval) { |
| | |
| | | this.sourceDataMapParams=this.sourceDataMap(); |
| | | this.getParams(); |
| | | this.handleRefresh(); |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | } |
| | | }) |
| | | this.newAreasData = newAreasData; |
| | | }else { |
| | | this.newAreasData=this.areasData; |
| | | } |
| | | }, |
| | | checkDisplayExpression(displayExpressionStr) { |
| | |
| | | data:{ |
| | | northAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | DefineVO:null, |
| | | data:null |
| | | }, |
| | | westAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | DefineVO:null, |
| | | data:null |
| | | }, |
| | | centerAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | DefineVO:null, |
| | | data:null |
| | | }, |
| | | southAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | DefineVO:null, |
| | | data:null |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | setData(value) { |
| | | this.data[value.area].btmType = value.btmType; |
| | | this.data[value.area].DefineVO = value.currentDefineVO; |
| | | this.data[value.area].data = value.data; |
| | | this.data[value.area].type = value.type; |
| | | }, |