| | |
| | | <template> |
| | | <div> |
| | | <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app"> |
| | | |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag && (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">添加 {{ msg }}</el-button> |
| | |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">验证规则</el-button> |
| | | <!-- 属性分组--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 保存--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click="addsHandler" icon="el-icon-check">保存</el-button> |
| | | <!-- 预览排序--> |
| | | <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button> |
| | | <!-- 删除--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button> |
| | | <!-- 重置--> |
| | | <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!--新增--> |
| | |
| | | <!-- 级联属性--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">级联属性</el-button> |
| | | </el-button-group> |
| | | <el-button-group> |
| | | <!-- 预览排序--> |
| | | <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">预览排序</el-button> |
| | | <!--新增--> |
| | | <!-- 保存--> |
| | | <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" @click="addsHandler" icon="el-icon-check">保存</el-button> |
| | | <!-- 删除--> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" size="small" @click="CrudRemove" icon="el-icon-delete">删除</el-button> |
| | | <!-- 重置--> |
| | | <el-button size="small" @click="reset" icon="el-icon-refresh-right">重置</el-button> |
| | | </el-button-group> |
| | | |
| | | <el-button-group> |
| | | <!-- 同步到其他模板--> |
| | | <el-button size="small"@click="syncHandle" icon="el-icon-share">同步到其他模板</el-button> |
| | |
| | | </el-button-group> |
| | | <!-- 是否开启编辑 --> |
| | | <el-button-group> |
| | | <el-button size="small" plain icon="el-icon-view" v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag" @click="editOpen" >开启编辑</el-button> |
| | | <el-button size="small" plain icon="el-icon-view" v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" @click="editOpen" >开启编辑</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | <!-- 弹窗--> |
| | |
| | | </el-dialog> |
| | | <!-- 全屏编辑--> |
| | | <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true"> |
| | | <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud> |
| | | <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud> |
| | | </el-dialog> |
| | | <!-- 组合规则--> |
| | | <formula-editor :systemVariableTableData="systemVariableTableData" |
| | |
| | | </div> |
| | | <el-table :data="ProData" |
| | | style="width: 100%" |
| | | height="400" |
| | | :height="!this.editStyleFlag ? 450 : 900" |
| | | @cell-click="handleCellClicks" |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | |
| | | v-if="item.edit !='referName'" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" |
| | | @blur="saveRows" ></el-input> |
| | | <el-input ref="inputRef" v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' ||item.edit == 'refer' )" v-model="row[item.prop]" |
| | | @blur="saveRows" autofocus ></el-input> |
| | | <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number> |
| | | <el-select v-model="row[item.prop]" filterable allow-create default-first-option slot="prepend" v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " @blur="selectChangeHandler(item.editConfig,index)"> |
| | |
| | | deep:true, |
| | | immediate:true |
| | | }, |
| | | Formlist:{ |
| | | handler(newval,oldval){ |
| | | if(newval.length === 0){ |
| | | this.crudArrayFlag=false |
| | | return |
| | | } |
| | | } |
| | | }, |
| | | ProData:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | this.loading=true; |
| | | setTimeout(() => { |
| | | this.loading=false |
| | | }, 1000); |
| | | } |
| | | } |
| | | }, |
| | | 'injectOption.classifyInvokeAttr': function(newVal) { |
| | | console.log('newVal',newVal) |
| | | if (newVal === "name") { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //全屏编辑高度状态 |
| | | editStyleFlag:false, |
| | | loading:false, |
| | | referConfigText:"", |
| | | referConfigVisble:false, |
| | |
| | | desc: "当前用户的姓名" |
| | | }, |
| | | { |
| | | formula: "#CURRENTUSER.SECRETGRADE#", |
| | | formula: "#CURRENTUSER.SECRETARIAT#", |
| | | desc: "当前用户密级" |
| | | }, |
| | | { |
| | |
| | | //属性分组提交 |
| | | attrHandle() { |
| | | console.log(this.attrSelectList) |
| | | // this.$set(this.attrRow, 'attributeGroup', this.attrModel) |
| | | // this.attrSelectList.attributeGroup=this.attrModel |
| | | this.attrSelectList.forEach(item=>{ |
| | | item.attributeGroup=this.attrModel |
| | | }) |
| | | if(this.CurrentCell){ |
| | | this.$set(this.CurrentCell, 'attributeGroup', this.attrModel) |
| | | }else { |
| | | this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel) |
| | | } |
| | | this.attrModel = ""; |
| | | this.attrVisible = false; |
| | | }, |
| | |
| | | //表格数据 |
| | | CrudRend() { |
| | | if (this.crudOid != '') { |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid}).then(res => { |
| | | gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid,limit:-1}).then(res => { |
| | | this.loading=true |
| | | setTimeout(() => { |
| | | this.ProData = res.data.data; |
| | |
| | | } |
| | | }) |
| | | this.addVisible = false; |
| | | |
| | | }, |
| | | //业务类型选择 |
| | | businessSelect(selection, row) { |
| | |
| | | addsHandler() { |
| | | batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => { |
| | | this.$message.success('保存成功') |
| | | this.editOpenFlag=false |
| | | }).catch(()=>{ |
| | | this.$message.warning('保存失败,请查看控制台输出!') |
| | | }) |
| | | }, |
| | | |
| | |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell=row; |
| | | if(column.property == 'referConfig' ){ |
| | | console.log( this.CurrentCell.referConfig) |
| | | this.referConfigVisble= true; |
| | | this.referConfigOption = { |
| | | referConfig: this.referConfigText || '', |
| | | referConfig: this.CurrentCell.referConfig || '', |
| | | } |
| | | if(this.CurrentCell.referConfig == ''){ |
| | | this.referConfigOption = { |
| | |
| | | }else if(column.property == 'parentCode'){ |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid, |
| | | limit:-1 |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.CascadeData = res.data.data; |
| | |
| | | }else if(column.property == 'verifyRule'){ |
| | | this.RulesForm.expressionTextt=this.CurrentCell.verifyRule; |
| | | this.rulesVisible=true; |
| | | console.log(this.CurrentCell.verifyRule) |
| | | console.log(this.RulesForm.expressionText) |
| | | }else if(column.property == 'attributeGroup'){ |
| | | this.attrVisible = true; |
| | | } |
| | | } |
| | | }, |
| | |
| | | // noinspection JSCheckFunctionSignatures |
| | | if(this.CurrentCell){ |
| | | //如果是指定层赋值为数字 |
| | | if(this.CurrentCell.classifyInvokeLevel!== 'min'){ |
| | | if(this.injectOption.classifyInvokeLevel!== 'min'){ |
| | | this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber |
| | | }else { |
| | | this.CurrentCell.classifyInvokeLevel='min' |
| | | } |
| | | //其余正常赋值 |
| | | this.CurrentCell.classifyInvokeAttr=this.injectOption.classifyInvokeAttr, |
| | |
| | | //如果是指定层赋值为数字 |
| | | if(this.injectOption.classifyInvokeLevel !== 'min'){ |
| | | this.attrSelectList[0].classifyInvokeLevel=this.injectOption.classifyNumber |
| | | }else { |
| | | this.attrSelectList[0].classifyInvokeLevel='min' |
| | | } |
| | | this.$set(this.attrSelectList[0],'classifyInvokeText',data) |
| | | } |
| | |
| | | if (this.crudArray.length < 1) { |
| | | this.$message.warning('请选择一个模板') |
| | | } else { |
| | | this.editStyleFlag=true; |
| | | // this.editOpenFlag=true; |
| | | this.attrEditVisible = true; |
| | | this.attrFlag = true; |
| | | } |
| | |
| | | escEdit() { |
| | | this.attrFlagChiledren = false; |
| | | this.attrEditVisible = false; |
| | | this.editStyleFlag=false; |
| | | }, |
| | | //组合规则确定 |
| | | updataFormlaContent(val) { |
| | |
| | | sortChange(val) { |
| | | console.log(val) |
| | | }, |
| | | //开启编辑 |
| | | editOpen(){ |
| | | this.editOpenFlag=true; |
| | | console.log('不等于',this.checkStatus) |
| | | console.log('等于',this.editOpenFlag) |
| | | console.log('等于',this.crudLCStatus) |
| | | } |
| | | } |
| | | } |