| | |
| | | <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app"> |
| | | <el-button-group> |
| | | <!--新增--> |
| | | <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && (!checkStatus || crudLCStatus=='Editing')" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">添加 {{ msg }}</el-button> |
| | | <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=" attrEditVisible == false && attrFlagChiledren==false && (!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">全屏编辑</el-button> |
| | | <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && editOpenFlag&&(!checkStatus || crudLCStatus=='Editing')" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">全屏编辑</el-button> |
| | | <!-- 验证规则--> |
| | | <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-info" size="small" @click="ruleAddHandler">验证规则</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'" icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</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'" icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-magic-stick" size="small" @click="injectBtn">分类注入</el-button> |
| | | <!-- 组合规则--> |
| | | <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-film" size="small" @click="isShowHandler">组合规则</el-button> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-film" size="small" @click="isShowHandler">组合规则</el-button> |
| | | <!-- 枚举注入--> |
| | | <el-button v-if="!checkStatus || crudLCStatus=='Editing'" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">枚举注入</el-button> |
| | | <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-c-scale-to-original" size="small" @click="enmuVisHandle">枚举注入</el-button> |
| | | <!-- 级联属性--> |
| | | <el-button v-if="!checkStatus|| crudLCStatus=='Editing'" icon="el-icon-coin" size="small" @click="CascadeHandle">级联属性</el-button> |
| | | <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'" size="small" @click="addsHandler" icon="el-icon-check">保存</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'" size="small" @click="CrudRemove" icon="el-icon-delete">删除</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" icon="el-icon-view" @click="applicationHandle" style="">编码申请预览</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-group> |
| | | </div> |
| | | <!-- 弹窗--> |
| | | <div> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" :disabled="!editOpenFlag" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | |
| | | default: '' |
| | | }, |
| | | checkStatus:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | editOpenFlag:{ |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | |
| | | } |
| | | return ''; |
| | | }, |
| | | // ProData: { |
| | | // handler(newVal, oldVal) { |
| | | // if(this.initializing){ |
| | | // this.ProData = newVal.map((item) => { |
| | | // if (item.classifyInvokeAttr !=='') { // 检查classifyInvokeText属性是否存在 |
| | | // item = { |
| | | // ...item, |
| | | // classifyInvokeText: { |
| | | // classifyInvokeText: { |
| | | // "注入类型": item.classifyInvokeAttr, |
| | | // "注入类型名称": item.classifyInvokeAttrName, |
| | | // "层级设置": item.classifyInvokeLevel, |
| | | // "是否可修改": item.classifyInvokeEditFlag |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return item; |
| | | // }); |
| | | // } |
| | | // this.initializing = false; |
| | | // console.log('ProData',this.ProData) |
| | | // console.log('newVal',newVal) |
| | | // }, |
| | | // deep: true, |
| | | // immediate:true |
| | | // }, |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | //是否开启编辑 |
| | | initializing:false, |
| | | loading:false, |
| | | referConfigText:"", |
| | |
| | | |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell=row; |
| | | if(column.property == 'referConfig' ){ |
| | | this.referConfigVisble= true; |
| | | this.referConfigOption = { |
| | | referConfig: this.referConfigText || '', |
| | | } |
| | | if(this.CurrentCell.referConfig == ''){ |
| | | this.referConfigOption = { |
| | | referConfig:'', |
| | | } |
| | | } |
| | | console.log('--',this.referConfigOption) |
| | | // this.$refs.referConfigFormDialog.onloadAttrData(); |
| | | }else if(column.property == 'classifyInvokeText'){ |
| | | this.injectVisible=true; |
| | | }else if(column.property == 'componentRule'){ |
| | | if(this.CurrentCell){ |
| | | this.CurrentCell.componentRule=this.componentRuleText; |
| | | } |
| | | this.isShowformulaEdit = true; |
| | | }else if(column.property == 'enumString'){ |
| | | this.enumVisible=true; |
| | | if(this.attrSelectList[0].enumString != ""){ |
| | | this.tableData=JSON.parse(this.attrSelectList[0].enumString) |
| | | return |
| | | } |
| | | }else if(column.property == 'parentCode'){ |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible=true; |
| | | }else if(column.property == 'verifyRule'){ |
| | | this.RulesForm.expressionTextt=this.CurrentCell.verifyRule; |
| | | this.rulesVisible=true; |
| | | console.log(this.CurrentCell.verifyRule) |
| | | console.log(this.RulesForm.expressionText) |
| | | } |
| | | if(this.editOpenFlag){ |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.CurrentCell=row; |
| | | if(column.property == 'referConfig' ){ |
| | | this.referConfigVisble= true; |
| | | this.referConfigOption = { |
| | | referConfig: this.referConfigText || '', |
| | | } |
| | | if(this.CurrentCell.referConfig == ''){ |
| | | this.referConfigOption = { |
| | | referConfig:'', |
| | | } |
| | | } |
| | | console.log('--',this.referConfigOption) |
| | | // this.$refs.referConfigFormDialog.onloadAttrData(); |
| | | }else if(column.property == 'classifyInvokeText'){ |
| | | this.injectVisible=true; |
| | | }else if(column.property == 'componentRule'){ |
| | | if(this.CurrentCell){ |
| | | this.CurrentCell.componentRule=this.componentRuleText; |
| | | } |
| | | this.isShowformulaEdit = true; |
| | | }else if(column.property == 'enumString'){ |
| | | this.enumVisible=true; |
| | | if(this.attrSelectList[0].enumString != ""){ |
| | | this.tableData=JSON.parse(this.attrSelectList[0].enumString) |
| | | return |
| | | } |
| | | }else if(column.property == 'parentCode'){ |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CurrentCell.oid |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | this.CascadeVisible=true; |
| | | }else if(column.property == 'verifyRule'){ |
| | | this.RulesForm.expressionTextt=this.CurrentCell.verifyRule; |
| | | this.rulesVisible=true; |
| | | console.log(this.CurrentCell.verifyRule) |
| | | console.log(this.RulesForm.expressionText) |
| | | } |
| | | } |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | |
| | | this.CurrentCell.classifyInvokeEditFlag=this.injectOption.classifyInvokeEditFlag, |
| | | this.$set(this.CurrentCell, "classifyInvokeText", data); |
| | | this.injectHandleReset() |
| | | }else { |
| | | }else {add |
| | | //勾选操作 |
| | | for (const key in this.injectOption) { |
| | | this.attrSelectList[0][key] = this.injectOption[key]; |
| | |
| | | }else { |
| | | this.injectOption.classifyNumber=0; |
| | | } |
| | | this.editOpenFlag=true |
| | | this.injectVisible = false; |
| | | |
| | | }, |
| | |
| | | // 排序 |
| | | sortChange(val) { |
| | | console.log(val) |
| | | // switch (val.order) { |
| | | // // case "ascending": |
| | | // // this.data = this.data.sort((a,b) => { return b['name'].localeCompare(a['name']) }) |
| | | // // this.data = this.data.sort((a,b) => { return b['id'].localeCompare(a['id']) }) |
| | | // // break; |
| | | // // case "descending": |
| | | // // this.data = this.data.sort((a,b) => { return a['name'].localeCompare(b['name']) }) |
| | | // // this.data = this.data.sort((a,b) => { return a['id'].localeCompare(b['id']) }) |
| | | // // break; |
| | | // } |
| | | }, |
| | | editOpen(){ |
| | | this.editOpenFlag=true; |
| | | console.log('不等于',this.checkStatus) |
| | | console.log('等于',this.editOpenFlag) |
| | | console.log('等于',this.crudLCStatus) |
| | | } |
| | | } |
| | | } |