| | |
| | | :icon="item.paramVOS.webUiButtonIcon ? item.paramVOS.webUiButtonIcon : (item.paramVOS.webUiButtonMethods === 'edit' ? 'el-icon-edit' : (item.paramVOS.webUiButtonMethods === 'delete' ? 'el-icon-delete' : ''))" |
| | | :type="item.paramVOS.webUiButtonType || 'text'" plain |
| | | size="small" |
| | | @click="buttonClick(item,scope)"> |
| | | @click="buttonClick(item)"> |
| | | {{ item.name }} |
| | | </el-button> |
| | | <!-- 表格内按钮操作对话框表单 --> |
| | |
| | | <el-button v-for="item in basicButtonList" |
| | | :key="item.oid" |
| | | :icon="item.paramVOS.webUiButtonIcon" |
| | | :type="(item.paramVOS.webUiButtonType !== 'text' ? item.paramVOS.buttonType : 'primary') || 'primary'" |
| | | :type="(item.paramVOS.webUiButtonType !== 'text' ? item.paramVOS.webUiButtonType : 'primary') || 'primary'" |
| | | plain |
| | | size="small" |
| | | @click="buttonClick(item)"> |
| | |
| | | type: Object, |
| | | }, |
| | | butttonList: { |
| | | type: Array |
| | | }, |
| | | selectList: { |
| | | type: Array |
| | | } |
| | | }, |
| | |
| | | }, |
| | | computed: { |
| | | basicButtonList() { |
| | | // const basicColumn = this.butttonList.filter(item => item.id !== 'launchworkflow'); // 首先过滤出来基础表单事件的按钮 |
| | | const basicColumn = this.butttonList; |
| | | |
| | | if (this.type === 'form') { |
| | | |
| | | return basicColumn; |
| | | |
| | | } else if (this.type === 'table') { |
| | | |
| | | const top = basicColumn.filter(item => item.paramVOS.webUiButtonLocation === 'top' || func.isEmpty(item.paramVOS.webUiButtonLocation)); // 过滤出来表格上面区域展示的按钮 |
| | | const menu = basicColumn.filter(item => item.paramVOS.webUiButtonLocation === 'menu'); // 过滤出来操作栏展示的按钮 |
| | | |
| | |
| | | } |
| | | |
| | | function handleEdit() { |
| | | this.visible = true; |
| | | this.$refs.dynamicForm.form = this.scope.row; |
| | | const location = item.paramVOS.webUiButtonLocation; |
| | | if (location === 'menu') { |
| | | this.visible = true; |
| | | this.$refs.dynamicForm.form = this.scope.row; |
| | | } else if (location === 'top' && this.selectList.length === 1) { |
| | | this.visible = true; |
| | | this.$refs.dynamicForm.form = this.selectList[0]; |
| | | } else { |
| | | const messageText = this.selectList.length > 1 ? '只能选择一条数据进行编辑!' : '请选择一条数据进行编辑!'; |
| | | this.$message.warning(messageText); |
| | | } |
| | | } |
| | | |
| | | function handleDelete() { |
| | | this.$message.success('删除成功!'); |
| | | const location = item.paramVOS.webUiButtonLocation; |
| | | if (location === 'top') { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('请至少选择一条数据!') |
| | | } else { |
| | | this.$message.success('删除成功!'); |
| | | } |
| | | } else if (location === 'menu') { |
| | | this.$message.success('删除成功!'); |
| | | } |
| | | } |
| | | |
| | | const methodHandlers = { |