| | |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | | v-if="this.crudArrayFlag" |
| | | ref="referAttrCrud" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :formatter="formAttr" |
| | | :width="item.width||(item.label.length >=4 ?'150':item.label.length==3 ?'120':'90')" |
| | | :width="item.width||(item.label.length >=4 ?'160':item.label.length==3 ?'130':'100')" |
| | | :show-overflow-tooltip="true" |
| | | :sortable="item.sortable" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop && (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 == 'select' ||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-input-number controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input-number> |
| | | <el-switch |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" |
| | | v-if="item.edit === 'switch'" v-model="row[item.sortableprop]" active-value="true" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | |
| | | <el-table-column |
| | | fixed="right" |
| | | label="操作" |
| | | width="70"> |
| | | width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="small" |
| | |
| | | isShowformulaEdit: false, |
| | | // 级联单选 |
| | | selectRow: '', |
| | | //级联单选数组 |
| | | selectRowArr:[], |
| | | // 级联data |
| | | CascadeData: [], |
| | | // 级联option |
| | |
| | | label: '排序号', |
| | | sortable: true, |
| | | edit: 'number', |
| | | width: 100, |
| | | width: 90, |
| | | fixed: true |
| | | }, { |
| | | label: "属性英文编号", |
| | |
| | | prop: "name", |
| | | fixed: true, |
| | | cell: false, |
| | | width: 125, |
| | | width: 145, |
| | | edit: 'text', |
| | | sortable: true |
| | | }, |
| | |
| | | label: "时间格式", |
| | | prop: "codeDateFormat", |
| | | sortable: true, |
| | | width: 105, |
| | | width: 135, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | |
| | | VTInteger: "整形", |
| | | VTFilePath: "文件", |
| | | VTString: "字符串" |
| | | } |
| | | }, |
| | | //时间格式下拉框 |
| | | codeDataFlag:false, |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | }, |
| | | //属性分组按钮 |
| | | attrVisibleHandle() { |
| | | |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.attrSelectList < 1) { |
| | |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.attrOid |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | | } |
| | | }, |
| | | // 排序预览按钮 |
| | | orderHandle(){ |
| | | this.$refs.referAttrCrud.sort("orderNum"); |
| | | //级联保存 |
| | | CascadeAddHandle() { |
| | | let CascadeString = ""; |
| | | CascadeString = this.selectRowArr.id + (this.selectRowArr.name); |
| | | this.$set(this.attrRow, 'parentCode', CascadeString) |
| | | this.CascadeVisible = false; |
| | | }, |
| | | //级联属性清除 |
| | | casRemove() { |
| | | this.selectRow = "" |
| | | }, |
| | | // 级联属性行单选 |
| | | CascaderowClick(row) { |
| | | this.selectRow = row.$index; |
| | | this.selectRowArr=row |
| | | }, |
| | | //表格单选 |
| | | selectHandle(selection, row) { |
| | | this.attrOid = row.oid; |
| | | this.attrRow = row; |
| | | console.log(row) |
| | | }, |
| | | //表格选择 |
| | | selectionChange(list) { |
| | |
| | | this.$message.success('保存成功') |
| | | }) |
| | | }, |
| | | //级联保存 |
| | | CascadeAddHandle() { |
| | | let CascadeString = ""; |
| | | CascadeString = this.attrRow.id + (this.attrRow.name); |
| | | this.$set(this.attrRow, 'parentCode', CascadeString) |
| | | this.CascadeVisible = false; |
| | | }, |
| | | //级联属性清除 |
| | | casRemove() { |
| | | this.selectRow = "" |
| | | }, |
| | | // 级联属性行单选 |
| | | CascaderowClick(row) { |
| | | this.selectRow = row.$index |
| | | }, |
| | | |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | console.log(row,column) |
| | | if(column.property == 'codeDateFormat' ){ |
| | | |
| | | } |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | |
| | | this.injectVisible = false |
| | | }, |
| | | //属性模板表格单元格点击事件 |
| | | handleRowClick(row, column, cell, event) { |
| | | //判断点击不是操作栏才可执行 |
| | | if (column.property != "menu") { |
| | | // 当前行变为可编辑状态 |
| | | this.rowList = row |
| | | row.$cellEdit = true |
| | | // 每一个单元格加上cell为true才是编辑状态 |
| | | //拿到每个columnKey,点击时设置为true,就实现单元格编辑状态了 |
| | | this.rowCellList = this.findObject(this.option.column, column.columnKey) |
| | | this.rowCellList.cell = true |
| | | if (this.List.indexOf(column.columnKey) == -1) { |
| | | this.List.push(column.columnKey) |
| | | } |
| | | // if(this.List.length >= 2){ |
| | | // const cellName=this.List[0] |
| | | // |
| | | // } |
| | | } |
| | | }, |
| | | //表格操作栏删除 |
| | | CrudRowDel(row) { |
| | | this.ProData.splice(row.$index, 1) |
| | | }, |
| | | //表格删除 |
| | | CrudRemove() { |
| | | this.attrSelectList.forEach((item)=>{ |
| | | this.ProData.splice(item.$index, 1) |
| | | }) |
| | | |
| | | this.ProData.splice(this.attrRow.$index, 1) |
| | | }, |
| | | //表格重置 |
| | | reset() { |