| | |
| | | <!-- 全屏编辑--> |
| | | <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">全屏编辑</el-button> |
| | | <!-- 验证规则--> |
| | | <el-button icon="el-icon-info" size="small" @click="rulesVisible=true">验证规则</el-button> |
| | | <el-button icon="el-icon-info" size="small" @click="rulesVisibleHandle">验证规则</el-button> |
| | | <!-- 属性分组--> |
| | | <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">属性分组</el-button> |
| | | </el-button-group> |
| | |
| | | </template> |
| | | </avue-crud> |
| | | <div style="display: flex;justify-content: flex-end;margin-top: 15px"> |
| | | <el-button size="small" type="primary" @click="busineAddHandle">保存</el-button> |
| | | <el-button size="small" type="primary" @click="busineAddHandle">确认选择</el-button> |
| | | <el-button size="small" type="primary" @click="addVisible=false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 参照配置--> |
| | | <refer-config-form-dialog |
| | | ref="referConfigFormDialog" |
| | | @echoReferConfig="echoReferConfig" |
| | | ></refer-config-form-dialog> |
| | | </div> |
| | | <el-table :data="ProData" |
| | | style="width: 100%" |
| | |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55"> |
| | | width="55" fixed> |
| | | </el-table-column> |
| | | <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>--> |
| | | <el-table-column v-for="item in this.option.column" :key="item.id" |
| | | <el-table-column v-for="(item,index) in this.option.column" :key="item.id" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :formatter="formAttr" |
| | | :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" |
| | | :show-overflow-tooltip="true" |
| | | :sortable="item.sortable" |
| | | :fixed="item.fixed" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer' )" v-model="row[item.prop]" |
| | | <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-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]" slot="prepend" v-if="editingRows === row && editShows== item.prop && item.prop == 'codeDateFormat' && row[item.prop] ==''" @focus="DataChangeHandler"> |
| | | <el-option label="餐厅名" value="1"></el-option> |
| | | <el-option label="订单号" value="2"></el-option> |
| | | <el-option label="用户电话" value="3"></el-option> |
| | | <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' " @focus="DataChangeHandler(item.editConfig,index)"> |
| | | <el-option |
| | | v-for="optionItem in item.data" |
| | | :key="optionItem.dictValue" |
| | | :label="optionItem.dictValue" |
| | | :value="optionItem.dictValue"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" |
| | |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作" |
| | | width="120"> |
| | | width="70"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="small" |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //参照 |
| | | referVisible:false, |
| | | crudArrayFlag:false, |
| | | editingRows: null, |
| | | editShows:"", |
| | |
| | | prop: "prefixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | width: 110, |
| | | editConfig: { |
| | | extraParams: { |
| | | code: 'codeclstempattr', |
| | | dictKey: 'prefix' |
| | | } |
| | | }, |
| | | cell: false, |
| | | }, |
| | | { |
| | |
| | | prop: "suffixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | width: 110, |
| | | editConfig: { |
| | | extraParams: { |
| | | code: 'codeclstempattr', |
| | | dictKey: 'suffix' |
| | | } |
| | | }, |
| | | cell: false, |
| | | }, |
| | | { |
| | |
| | | sortable: true, |
| | | width: 135, |
| | | edit: 'select', |
| | | editConfig: { |
| | | extraParams: { |
| | | code: 'codeclstempattr', |
| | | dictKey: 'dateFormates' |
| | | } |
| | | }, |
| | | cell: false, |
| | | }, |
| | | { |
| | |
| | | formAttr(row, column) { |
| | | console.log(row,column) |
| | | }, |
| | | //参照配置子组件 |
| | | echoReferConfig(val){ |
| | | console.log(val) |
| | | }, |
| | | //时间下拉格式 |
| | | DataChangeHandler(){ |
| | | debugger |
| | | listByFlag({comboxKey: 'codedateformat', |
| | | id: 'codedateformat', |
| | | namespace: 'codeclstempattr', |
| | | flag: 'dateFormates'}).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | DataChangeHandler(editConfig,index){ |
| | | if(!this.option.column[index].data){ |
| | | listByFlag(editConfig.extraParams).then(res=>{ |
| | | this.option.column[index].data=res.data; |
| | | }) |
| | | } |
| | | }, |
| | | //属性分组按钮 |
| | | attrVisibleHandle() { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.attrSelectList < 1) { |
| | | this.$message.warning('请选择一条模板属性') |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.attrVisible = true; |
| | | if(this.attrSelectList.length==0){ |
| | | this.$message.warning('请选择属性'); |
| | | return false; |
| | | } |
| | | this.attrVisible = true; |
| | | }, |
| | | //属性分组提交 |
| | | attrHandle() { |
| | | this.$set(this.attrRow, 'attributeGroup', this.attrModel) |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.$set(item, 'attributeGroup', this.attrModel) |
| | | }) |
| | | this.attrModel = "" |
| | | this.attrVisible = false |
| | | }, |
| | |
| | | precisionLength: (citem.precisionLength ? citem.precisionLength : '') + (citem.scaleLength ? '(' + citem.scaleLength + ')' : ''), |
| | | classifyTemplateOid: this.crudOid, |
| | | classifytemplateoid: this.crudOid, |
| | | formDisplayFlag: true, |
| | | tableDisplayFlag: true, |
| | | sortAttrFlag: false, |
| | | queryAttrFlag: true, |
| | | seniorQueryAttrFlag: true, |
| | | formDisplayFlag: 'true', |
| | | tableDisplayFlag: 'true', |
| | | sortAttrFlag: 'false', |
| | | queryAttrFlag: 'true', |
| | | seniorQueryAttrFlag: 'true', |
| | | attrTableWidth: 120 |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | console.log(row,column) |
| | | if(column.property == 'codeDateFormat' ){ |
| | | |
| | | if(column.property == 'referConfig' ){ |
| | | this.$refs.referConfigFormDialog.isShowReferConfigForm = true; |
| | | } |
| | | }, |
| | | saveRows() { |
| | |
| | | saveRow() { |
| | | this.editingRow = null; |
| | | }, |
| | | rulesVisibleHandle(){ |
| | | if(this.attrSelectList.length==0){ |
| | | this.$message.warning('请选择属性'); |
| | | return false; |
| | | } |
| | | this.rulesVisible = true; |
| | | }, |
| | | //规则校验,双击表单事件 |
| | | handleRulesRowDBLClick(row) { |
| | | this.RulesForm.expressionText = row.bds |
| | |
| | | }, |
| | | // 验证规则确定 |
| | | rulesHandle() { |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.$set(item, 'verifyRule', this.RulesForm.expressionText) |
| | | }) |
| | | this.rulesVisible = false |
| | | }, |
| | | //验证规则检查 |