| | |
| | | item = item.replace(':', '='); |
| | | if (item.indexOf('${') > -1) { |
| | | if (item.split('=')[1].indexOf('.') > -1) { |
| | | if (options.sourceData.length < 1 || !options.sourceData.oid) { |
| | | //initvaluenull=true允许初始值为空 |
| | | if ((options.sourceData.length < 1 || !options.sourceData.oid) && options.paramVOS['initvaluenull']!=true && options.paramVOS['initvaluenull']!="true") { |
| | | isShow = false; |
| | | Vue.prototype.$message.error("请先选择一条来源数据") |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].split('.')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = options.sourceData[name] |
| | | if(options.sourceData){ |
| | | initValues[item.split('=')[0]] = options.sourceData[name] |
| | | }else { |
| | | initValues[item.split('=')[0]]="" |
| | | } |
| | | } else { |
| | | if (options.dataStore.length < 1) { |
| | | if (options.dataStore.length < 1 && options.paramVOS['initvaluenull'] != true && options.paramVOS['initvaluenull'] != "true") { |
| | | isShow = false; |
| | | Vue.prototype.$message.error("请先选择一条数据"); |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = options.dataStore[0][name]; |
| | | |
| | | if (options.dataStore[0]) { |
| | | initValues[item.split('=')[0]] = options.dataStore[0][name]; |
| | | } else { |
| | | initValues[item.split('=')[0]] = ""; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //表单是否可编辑 |
| | | type:Boolean, |
| | | default:true |
| | | } |
| | | }, |
| | | initValue:{ |
| | | type: Object, |
| | | default: () => {}, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | watch: { |
| | | formItems: { |
| | | handler(val) { |
| | | if(val[0] &&val[0].column && val[0].column.isArray()){ |
| | | if (val[0] && val[0].column && val[0].column.isArray()) { |
| | | this.getInitGroup(val); |
| | | }else{ |
| | | } else { |
| | | this.getInit(val); |
| | | } |
| | | if (this.initValue) { |
| | | Object.assign(this.form, this.initValue); |
| | | } |
| | | }, |
| | | immediate: true, |
| | |
| | | code = this.initItem(code); |
| | | column.push(code); |
| | | this.allColumn.push(code); |
| | | console.log('allColumn',this.allColumn) |
| | | } |
| | | this.option.column = column; |
| | | }, |
| | |
| | | if(col.data && col.data.length>0){ |
| | | col.dicData = col.data.map((d) => { |
| | | return { |
| | | label: d.value, |
| | | key: d.key, |
| | | value: d.key, |
| | | label: d.key, |
| | | key: d.value, |
| | | value: d.value, |
| | | attributes:d.attributes |
| | | }; |
| | | }); |
| | |
| | | :isEdit="true" |
| | | :formItems="formItems" |
| | | :formData="form" |
| | | :initValue="paramVOS.initvalue" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | <ui-view ref="uiViewRef" v-else-if="paramVOS.context" |
| | |
| | | created() { |
| | | }, |
| | | watch: { |
| | | sourceData: { |
| | | paramVOS: { |
| | | handler(val) { |
| | | if (this.paramVOS.form) { |
| | | this.onLoad(); |
| | |
| | | getFormDefineById(this.paramVOS.type,this.paramVOS.form).then(result => { |
| | | this.formItems=result.data.obj.items; |
| | | this.span=result.data.obj.columnOneRow?(24/result.data.obj.columnOneRow) : 12; |
| | | |
| | | if (this.paramVOS.initvalue) { |
| | | this.form=this.paramVOS.initvalue; |
| | | } |
| | |
| | | formDefineId: this.paramVOS.form, |
| | | oid: this.dataStore[0].oid |
| | | }, sourceDataMap), this.paramVOS.getdataurl, this.paramVOS.getdatamethod).then(res => { |
| | | this.form = res.data.obj; |
| | | this.form=res.data.obj; |
| | | this.loading = false; |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | |
| | | } |
| | | }, |
| | | contextSave(){ |
| | | debugger; |
| | | if(this.saveCallback){ |
| | | this.saveCallback({}); |
| | | const useDataType=this.paramVOS["useDataType"] || "form";//使用ui上下文中的哪个类型数据,默认form。值:form、tree、table、TreeTable |
| | | for(let key in this.$refs.uiViewRef.data){ |
| | | if(this.$refs.uiViewRef.data[key].type== useDataType){ |
| | | this.form=this.$refs.uiViewRef.data[key].data; |
| | | if (this.paramVOS.savebeforeevent) { |
| | | var urlobj = parseEventByUrl(this.paramVOS.savebeforeevent,null,null,'doAction'); |
| | | import("../"+urlobj.jsPath+".js").then(module => { |
| | | module[urlobj.methodName]({ |
| | | paramVOS: this.paramVOS, |
| | | dataStore: this.dataStore, |
| | | sourceData:this.sourceData |
| | | },this.formSaveHandle); |
| | | }) |
| | | } else { |
| | | this.formSaveHandle(); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | }, |
| | | formSave() { |
| | |
| | | formValues.defaultValues.btmname = this.paramVOS.type; |
| | | } |
| | | let datas = { |
| | | formDefineId: this.paramVOS.form, |
| | | formDefineId: this.paramVOS.form || "", |
| | | preEvent: this.paramVOS.preevent, |
| | | afterEvent: this.paramVOS.afterevent, |
| | | beforeServerEvent: this.paramVOS.beforeserverevent, |
| | |
| | | message: "保存成功!" |
| | | }); |
| | | if(that.saveCallback){ |
| | | that.saveCallback(that.form); |
| | | that.saveCallback(that.type,that.form); |
| | | } |
| | | that.dialogClose(); |
| | | }); |
| | |
| | | message: "修改成功!" |
| | | }); |
| | | if(that.saveCallback){ |
| | | that.saveCallback(that.form); |
| | | that.saveCallback(that.type,that.form); |
| | | } |
| | | that.dialogClose(); |
| | | }); |
| | |
| | | const paramVOS = buttonitem.paramVOS; |
| | | const DefineVO = this.componentVO.treeDefineVO || this.componentVO.tableDefineVO || this.componentVO.treeTableDefineVO || this.componentVO.formDefineVO; |
| | | if (!paramVOS['title']) { |
| | | paramVOS['title'] = buttonitem.name + (DefineVO.title || this.componentVO.description || ''); |
| | | paramVOS['title'] = buttonitem.name + (DefineVO.title || ''); |
| | | } |
| | | |
| | | if (!paramVOS['type']) { |
| | |
| | | |
| | | const that = this; |
| | | //paramVOS.customBtn //弹窗默认有保存按钮,customBtn为true时内容展示自定义按钮 |
| | | paramVOS.form = "editknowledgefolderall" |
| | | doAction(buttonitem, { |
| | | paramVOS: paramVOS, |
| | | dataStore: this.dataStore || [], |
| | | sourceData: this.sourceData || {} |
| | | }, function () { |
| | | }, function (actionType,data) { |
| | | if (that.$parent.handleRefresh) { |
| | | that.$parent.handleRefresh() |
| | | that.$parent.handleRefresh(actionType,data) |
| | | } |
| | | }); |
| | | } |
| | |
| | | :disabled="!inDialog" |
| | | :isEdit="canEdit" |
| | | :formData="form" |
| | | :initValue="paramVOS.initvalue" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | </div> |
| | |
| | | this.$emit("setDataStore", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.componentVO.treeDefineVO.btmType, |
| | | btmType:this.currentDefineVO.btmType, |
| | | dataStore:[newval] |
| | | }); |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.currentDefineVO.btmType, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | |
| | | const sourceDataMapList = this.sourceDataMapParams; |
| | | |
| | | this.params = Object.assign({},formParams, sourceDataMapList); |
| | | console.log(this.params) |
| | | }, |
| | | onLoad:function () { |
| | | debugger; |
| | | if (this.paramVOS.initvalue) { |
| | | this.form=this.paramVOS.initvalue; |
| | | } |
| | | if (Object.keys(this.sourceData).length>0 && this.isShow) { |
| | | this.loading = true; |
| | | dataForm(this.params).then(res => { |
| | |
| | | } |
| | | } |
| | | }, |
| | | tableList:{ |
| | | handler(newval) { |
| | | if(newval) { |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.currentDefineVO.btmType, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | 'sourceData':{ |
| | | handler(newval) { |
| | | if(newval) { |
| | |
| | | } |
| | | } |
| | | }, |
| | | data:{ |
| | | handler(newval) { |
| | | if(newval) { |
| | | this.$emit("setData", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | btmType:this.componentVO.treeDefineVO.btmType, |
| | | data:newval |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | sourceData:{ |
| | | handler(newval) { |
| | | //源数据有变化时变更当前区域数据 |
| | |
| | | parentOid = parentOid.split('@vcitreesep@')[1]; |
| | | } |
| | | const parentBtmName = (node.level === 0) ? '' : node.data.attributes.btmname; |
| | | const params=this.params; |
| | | if(node.level === 0){ |
| | | params.queryRoot= true; |
| | | }else { |
| | | const params = this.params; |
| | | if (node.level === 0) { |
| | | params.queryRoot = true; |
| | | } else { |
| | | delete params.queryRoot; |
| | | } |
| | | getTree(parentOid, parentBtmName, params).then(res => { |
| | | resolve(res.data.treeData) |
| | | this.$nextTick(()=>{ |
| | | if (this.isRefresh) { |
| | | this.$refs.tree.setCurrentKey(this.currentClickNode.data.oid); |
| | | this.isRefresh=false; |
| | | } |
| | | }) |
| | | |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }) |
| | | }, |
| | | checkNode(checkedNode, checkedData) { |
| | | if (this.isMuti) { |
| | | this.checkDatas = checkedData.checkedNodes; |
| | | let checkDatas = []; |
| | | checkedData.checkedNodes.forEach(item=>{ |
| | | checkDatas.push(item.attributes) |
| | | }) |
| | | this.checkDatas=checkDatas; |
| | | } |
| | | }, |
| | | changeNode(data, node) { |
| | | if (!this.isMuti) { |
| | | this.checkDatas = [data]; |
| | | this.checkDatas = [data.attributes]; |
| | | } |
| | | }, |
| | | clickNode(data, node) { |
| | | this.currentClickNode = node; |
| | | }, |
| | | handleRefresh() { |
| | | if (!this.lazy) { |
| | | this.initData(); |
| | | } else { |
| | | if (this.currentClickNode) { |
| | | let node = this.currentClickNode.parent; |
| | | node.loaded = false; |
| | | node.expand(); |
| | | handleRefresh(type,data) { |
| | | //type:add\edit\delete |
| | | if(type=="delete"){ |
| | | this.$refs.tree.remove(this.currentClickNode); |
| | | this.currentClickNode=null; |
| | | }else{ |
| | | if (!this.lazy) { |
| | | this.initData(); |
| | | } else { |
| | | if (this.currentClickNode) { |
| | | let node = this.currentClickNode.parent; |
| | | node.loaded = false; |
| | | node.expand(); |
| | | this.isRefresh=true; |
| | | } |
| | | } |
| | | } |
| | | this.checkDatas = []; |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="isShow"> |
| | | |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="isShow"> |
| | | |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="isShow"> |
| | | </dynamic-tree> |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="isShow"> |
| | | |
| | |
| | | setDataStore(value) { |
| | | this.$emit("setDataStore", value); |
| | | this.dataStore = value.dataStore; |
| | | }, |
| | | setData(value) { |
| | | this.$emit("setData", value); |
| | | } |
| | | } |
| | | } |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="activeName==(areasName+'-Tab-'+index)?true:false"></compoent-index> |
| | | </div> |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="collapseActiveNames.indexOf(areasName+'-collapse-'+componentIndex)!=-1?true:false"></compoent-index> |
| | | </div> |
| | |
| | | :dataStore="dataStore" |
| | | :areasName="areasName" |
| | | :paramVOS="paramVOS" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore" |
| | | :isShow="true"></compoent-index> |
| | | </div> |
| | |
| | | handleChange(val) { |
| | | //console.log(val); |
| | | }, |
| | | setData(value) { |
| | | this.$emit("setData", value); |
| | | }, |
| | | setDataStore(value) { |
| | | this.$emit("setDataStore", value); |
| | | this.dataStore = value.dataStore; |
| | |
| | | :canEdit="canEdit" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="btmType" |
| | | areas-name="northArea" |
| | | areas-name="northAreaInDialog" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-header> |
| | |
| | | :canEdit="canEdit" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="btmType" |
| | | areas-name="westArea" |
| | | areas-name="westAreaInDialog" |
| | | cradStyle="" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-aside> |
| | |
| | | :canEdit="canEdit" |
| | | :sourceData="checkedData.westAreaInDialog.data[checkedData.westAreaInDialog.data.length-1]" |
| | | :sourceBtmType="checkedData.westAreaInDialog.DefineVOBtmType" |
| | | areas-name="centerArea" |
| | | areas-name="centerAreaInDialog" |
| | | cradStyle="" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-main> |
| | |
| | | :canEdit="canEdit" |
| | | :sourceData="checkedData.centerAreaInDialog.data[checkedData.centerAreaInDialog.data.length-1]" |
| | | :sourceBtmType="checkedData.centerAreaInDialog.DefineVOBtmType" |
| | | areas-name="southArea" |
| | | areas-name="southAreaInDialog" |
| | | cradStyle="" |
| | | @setData="setData" |
| | | @setDataStore="setDataStore"> |
| | | </UIContentArea> |
| | | </el-footer> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //各区域的选中数据 |
| | | checkedData:{ |
| | | //各区域选中数据 |
| | | northAreaInDialog:{ |
| | | DefineVOBtmType:'', |
| | | data:[{}] |
| | |
| | | southAreaInDialog:{ |
| | | DefineVOBtmType:'', |
| | | data:[{}] |
| | | } |
| | | }, |
| | | //各区域数据 |
| | | data:{ |
| | | northAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | data:null |
| | | }, |
| | | westAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | data:null |
| | | }, |
| | | centerAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | data:null |
| | | }, |
| | | southAreaInDialog:{ |
| | | type:'', |
| | | btmType:'', |
| | | data:null |
| | | } |
| | | }, |
| | | uiDefineVO: {}, |
| | |
| | | this.centerHeight = '100%'; |
| | | } |
| | | }, |
| | | setData(value) { |
| | | this.data[value.area].btmType = value.btmType; |
| | | this.data[value.area].data = value.data; |
| | | this.data[value.area].type = value.type; |
| | | }, |
| | | setDataStore(value) { |
| | | this.checkedData[value.area].DefineVOBtmType = value.btmType; |
| | | this.checkedData[value.area].data = value.dataStore; |