| | |
| | | <basic-form ref="formRef" v-if="paramVOS.form" |
| | | :key="'dialog-'+paramVOS.form" |
| | | :span="span" |
| | | :style="fullscreen?'':'height:'+height" |
| | | :isEdit="true" |
| | | :formItems="formItems" |
| | | :formData="form"> |
| | | </basic-form> |
| | | <ui-view ref="uiViewRef" v-else-if="paramVOS.context" |
| | | :key="'AddEditDialog-'+type" |
| | | :style="fullscreen?'':'height:'+height" |
| | | :btmType="paramVOS.type" |
| | | :context="paramVOS.context" |
| | | :inDialog="true" |
| | | :canEdit="true" |
| | | :sourceData="sourceData" |
| | | :dataStore="dataStore" |
| | | :paramVOS="paramVOS" |
| | | ></ui-view> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <div v-if="showSave" class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="saveHandler">保 存</el-button> |
| | | <el-button size="small" @click="dialogClose">取 消</el-button> |
| | | <el-button size="small" @click="resetValue" v-if="paramVOS.form">重 置</el-button> |
| | |
| | | import uiView from "@/views/base/UIContentViewerInDialog" |
| | | import {getFormDefineById,dataForm} from "@/api/base/ui"; |
| | | import {addSave,editSave} from "@/api/base/actions" |
| | | import {validatenull} from "@/util/validate" |
| | | |
| | | export default { |
| | | name: "AddEditDialog", |
| | |
| | | return { |
| | | type:"add", |
| | | visible:false, |
| | | showSave:this.paramVOS.customBtn || true, |
| | | span:12, |
| | | formItems:[], |
| | | form:{} |
| | |
| | | title(){ |
| | | return this.paramVOS.title || (this.type=='add'?'添加':'修改') |
| | | }, |
| | | width(){ |
| | | return this.paramVOS.width || "60%" |
| | | width() { |
| | | if (!validatenull(this.paramVOS.width)) { |
| | | if (this.paramVOS.width.includes("px") || this.paramVOS.width.includes("%")) { |
| | | return this.paramVOS.width; |
| | | } else { |
| | | return this.paramVOS.width + "px"; |
| | | } |
| | | } else { |
| | | return "60%"; |
| | | } |
| | | }, |
| | | height(){ |
| | | return this.paramVOS.height || "500px" |
| | | if (!validatenull(this.paramVOS.height)) { |
| | | if (this.paramVOS.height.includes("px") || this.paramVOS.height.includes("%")) { |
| | | return this.paramVOS.height; |
| | | } else { |
| | | return this.paramVOS.height + "px"; |
| | | } |
| | | } else { |
| | | return "auto" |
| | | } |
| | | }, |
| | | fullscreen(){ |
| | | if(this.paramVOS.width || this.paramVOS.height){ |
| | |
| | | }else if(this.paramVOS.form){ |
| | | return false; |
| | | } |
| | | return false; |
| | | return true; |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }); |
| | | }else{ |
| | | //this.$refs.uiViewRef. |
| | | debugger; |
| | | if(this.saveCallback){ |
| | | this.saveCallback({}); |
| | | } |
| | |
| | | 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 || DefineVO.componentTitle || ''); |
| | | paramVOS['title'] = buttonitem.name + (DefineVO.title || this.componentVO.description || ''); |
| | | } |
| | | |
| | | if (!paramVOS['type']) { |
| | |
| | | let values = paramVOS['initvalue'].split(';'); |
| | | let initValues = {} |
| | | values.forEach((item,i) => { |
| | | item = item.replace(':', '='); |
| | | if (item.indexOf('${') > -1) { |
| | | if (item.split('=')[1].indexOf('.') > -1) { |
| | | if (this.sourceData.length < 1 || !this.sourceData.oid) { |
| | | isShow = false; |
| | | this.$message.error("请先选择一条来源数据"); |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].split('.')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = this.sourceData[name] |
| | | } else { |
| | | if (this.dataStore.length < 1) { |
| | | isShow = false; |
| | | this.$message.error("请先选择一条数据"); |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = this.dataStore[0][name]; |
| | | if(isShow){ |
| | | item = item.replace(':', '='); |
| | | if (item.indexOf('${') > -1) { |
| | | if (item.split('=')[1].indexOf('.') > -1) { |
| | | if (this.sourceData.length < 1 || !this.sourceData.oid) { |
| | | isShow = false; |
| | | this.$message.error("请先选择一条来源数据") |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].split('.')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = this.sourceData[name] |
| | | } else { |
| | | if (this.dataStore.length < 1) { |
| | | isShow = false; |
| | | this.$message.error("请先选择一条数据"); |
| | | return false; |
| | | } |
| | | let name = item.split('=')[1].replace('${', '').replace('}', ''); |
| | | initValues[item.split('=')[0]] = this.dataStore[0][name]; |
| | | |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | paramVOS['initvalue'] = initValues |
| | | if(isShow){ |
| | | paramVOS['initvalue'] = initValues |
| | | } |
| | | } |
| | | if(paramVOS['BSContent'] || paramVOS['BSContext']){ |
| | | paramVOS['context']=paramVOS['BSContext'] || paramVOS['BSContent'] |
| | |
| | | |
| | | const that=this; |
| | | if(isShow) { |
| | | //paramVOS.customBtn //弹窗默认有保存按钮,customBtn为true时内容展示自定义按钮 |
| | | //paramVOS.form="editknowledgefolderall" |
| | | doAction(buttonitem, { |
| | | paramVOS: paramVOS, |
| | | dataStore: this.dataStore || [], |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName: { |
| | | type: String, |
| | | default: '' |
| | |
| | | :span="this.componentVO.formDefineVO.columnOneRow?(24/this.componentVO.formDefineVO.columnOneRow) : 12" |
| | | :formItems="this.componentVO.formDefineVO && this.componentVO.formDefineVO.items" |
| | | :disabled="!inDialog" |
| | | :isEdit="inDialog" |
| | | :isEdit="canEdit" |
| | | :formData="form"> |
| | | </basic-form> |
| | | </div> |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName: { |
| | | type: String, |
| | | default: '' |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName: { |
| | | type: String, |
| | | default: ''//westArea导航区 |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName:{ |
| | | type:String, |
| | | default:'' |
| | |
| | | :uiContext="uiContext" |
| | | :key="areasName+'table-'+componentVO.oid" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="componentVO" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | :uiContext="uiContext" |
| | | :key="areasName+'form-'+componentVO.oid" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="componentVO" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | :uiContext="uiContext" |
| | | :key="areasName+'tree-'+componentVO.oid" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="componentVO" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | :uiBtmType="uiBtmType" |
| | | :uiContext="uiContext" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :key="areasName+'custom-'+componentVO.oid" |
| | | :componentVO="componentVO" |
| | | :sourceData="sourceData" |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName:{ |
| | | type:String, |
| | | default:'' |
| | |
| | | :uiBtmType="uiBtmType" |
| | | :uiContext="uiContext" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="areaItem.componentVOs[0]" |
| | | :sourceData="newSourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | :uiBtmType="uiBtmType" |
| | | :uiContext="uiContext" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="componentVO" |
| | | :sourceData="newSourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | :uiBtmType="uiBtmType" |
| | | :uiContext="uiContext" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :componentVO="newAreasData[0].componentVOs[0]" |
| | | :sourceData="newSourceData" |
| | | :sourceBtmType="sourceBtmType" |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | areasName:{ |
| | | type:String, |
| | | default:'' |
| | |
| | | :dataStore="checkedData.northAreaInDialog.data" |
| | | :paramVOS="paramVOS" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="btmType" |
| | | areas-name="northArea" |
| | |
| | | :dataStore="checkedData.westAreaInDialog.data" |
| | | :paramVOS="paramVOS" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :sourceData="sourceData" |
| | | :sourceBtmType="btmType" |
| | | areas-name="westArea" |
| | |
| | | :dataStore="checkedData.centerAreaInDialog.data" |
| | | :paramVOS="paramVOS" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :sourceData="checkedData.westAreaInDialog.data[checkedData.westAreaInDialog.data.length-1]" |
| | | :sourceBtmType="checkedData.westAreaInDialog.DefineVOBtmType" |
| | | areas-name="centerArea" |
| | |
| | | :dataStore="checkedData.southAreaInDialog.data" |
| | | :paramVOS="paramVOS" |
| | | :inDialog="inDialog" |
| | | :canEdit="canEdit" |
| | | :sourceData="checkedData.centerAreaInDialog.data[checkedData.centerAreaInDialog.data.length-1]" |
| | | :sourceBtmType="checkedData.centerAreaInDialog.DefineVOBtmType" |
| | | areas-name="southArea" |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | canEdit:{ |
| | | //内容是否可编辑 |
| | | type:Boolean, |
| | | default:false |
| | | }, |
| | | sourceData:{ |
| | | //所属区域的上一区域选中数据 |
| | | type:Object, |