对象建模模块,保存统一先进行正则校验(之间是失焦才进行校验)
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // 列表查询 |
| | | export function addLifeCycle(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/addBtmType", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | |
| | | linkTypeName: "", |
| | | rangeValue: "" |
| | | }; |
| | | if (this.dialogTitle === 'add') { |
| | | this.form.range = this.form.rangeValue.replace(/\n/g, ';'); |
| | | if (this.form.attributeSelectType === 'business') { |
| | | this.form.btmTypeId = this.form.referValue; |
| | | } else { |
| | | this.form.linkTypeName = this.form.referValue; |
| | | } |
| | | addAttribute(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.form = form; |
| | | this.addVisible = false; |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | if (this.dialogTitle === 'add') { |
| | | this.form.range = this.form.rangeValue.replace(/\n/g, ';'); |
| | | if (this.form.attributeSelectType === 'business') { |
| | | this.form.btmTypeId = this.form.referValue; |
| | | } else { |
| | | this.form.linkTypeName = this.form.referValue; |
| | | } |
| | | addAttribute(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.form = form; |
| | | this.addVisible = false; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (this.dialogTitle === 'edit') { |
| | | this.form.range = this.form.rangeValue.replace(/\n/g, ';'); |
| | | if (this.form.attributeSelectType === 'business') { |
| | | this.form.btmTypeId = this.form.referValue; |
| | | } else { |
| | | this.form.linkTypeName = this.form.referValue; |
| | | } |
| | | updateAttribute(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.form = form; |
| | | this.addVisible = false; |
| | | if (this.dialogTitle === 'edit') { |
| | | this.form.range = this.form.rangeValue.replace(/\n/g, ';'); |
| | | if (this.form.attributeSelectType === 'business') { |
| | | this.form.btmTypeId = this.form.referValue; |
| | | } else { |
| | | this.form.linkTypeName = this.form.referValue; |
| | | } |
| | | updateAttribute(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.form = form; |
| | | this.addVisible = false; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 导入 |
| | |
| | | class="avue-dialog" |
| | | width="75%" |
| | | @close="addDialogClose"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px"> |
| | | <div class="dialogForm"> |
| | | <div class="leftForm"> |
| | | <el-form-item label="类型名称:" prop="name"> |
| | | <el-form-item label="类型名称:" prop="id"> |
| | | <el-input v-model="form.id" :readOnly="title === 'edit'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="标签:"> |
| | |
| | | </el-form-item> |
| | | </div> |
| | | <div class="centerForm"> |
| | | <el-form-item label="版本规则:" label-width="100px" prop="revLevel"> |
| | | <el-form-item label="版本规则:" label-width="110px" prop="revLevel"> |
| | | <el-select v-model="form.revLevel"> |
| | | <el-option label="不可修订" value="0"></el-option> |
| | | <el-option label="采用一级版本管理" value="1"></el-option> |
| | | <el-option label="采用二级版本管理" value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="版本号规则:" label-width="100px" prop="revisionRuleName"> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="版本号规则:" label-width="110px" prop="revisionRuleName"> |
| | | <div style="display: flex;gap: 5px;align-items: center"> |
| | | <el-input v-model="form.revisionRuleId" :readOnly="true"></el-input> |
| | | <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success" @click="versionAddHandler">添加</el-button> |
| | | <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success" |
| | | @click="versionAddHandler">添加 |
| | | </el-button> |
| | | <el-switch |
| | | style="width: 300px" |
| | | v-model="form.inputRevisionFlag" |
| | | active-text="手工输入"> |
| | | active-text="手工输入" |
| | | style="width: 300px"> |
| | | </el-switch> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="分隔符:" label-width="100px" prop="delimiter"> |
| | | <el-form-item v-if="form.revLevel !== '0'" label="分隔符:" label-width="110px" prop="delimiter"> |
| | | <el-select v-model="form.delimiter" clearable> |
| | | <el-option label="." value="."></el-option> |
| | | <el-option label="-" value="-"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="100px" |
| | | <el-form-item v-if="form.revLevel !== '0' && form.revLevel !== '1'" label="版次号规则:" label-width="110px" |
| | | prop="revLevel"> |
| | | <el-select v-model="form.versionRule" clearable> |
| | | <el-option label="1.2.3..." value="1.2.3..."></el-option> |
| | | <el-option label="a.b.c..." value="a.b.c..."></el-option> |
| | | <el-option label="0.1.2..." value="0.1.2..."></el-option> |
| | | <el-option label="1.2.3..." value="0"></el-option> |
| | | <el-option label="a.b.c..." value="1"></el-option> |
| | | <el-option label="0.1.2..." value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="rightForm"> |
| | | <el-form-item label="生命周期:" label-width="138px" prop="revLevel"> |
| | | <el-form-item label="生命周期:" label-width="138px" prop="lifeCycleId"> |
| | | <div style="display: flex;gap: 5px;align-items: center"> |
| | | <el-input v-model="form.lifeCycleId" :readOnly="true"></el-input> |
| | | <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success" @click="lifeAddHandler('input')">添加</el-button> |
| | | <el-button plain size="small" style="margin-left: 5px;height: 30px" type="success" |
| | | @click="lifeAddHandler('input')">添加 |
| | | </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | |
| | |
| | | |
| | | <script> |
| | | import basicOption from '@/util/basic-option' |
| | | import {getBizTypes} from "@/api/modeling/businessType/api" |
| | | import {getBizTypes, addLifeCycle} from "@/api/modeling/businessType/api" |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | | import {getVersionRuleAllList} from "@/api/modeling/version/api"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | dialogLifeDefalutData:[], // 查询重置默认数据 |
| | | lifeType:'', |
| | | dialogLifeTable:[], |
| | | dialogLifeSaveRow:{}, |
| | | dialogLifeKey:Math.random(), |
| | | dialogLifeData:[], |
| | | dialogLifeOption:{ |
| | | dialogLifeDefalutData: [], // 查询重置默认数据 |
| | | lifeType: '', |
| | | dialogLifeTable: [], |
| | | dialogLifeSaveRow: {}, |
| | | dialogLifeKey: Math.random(), |
| | | dialogLifeData: [], |
| | | dialogLifeOption: { |
| | | ...basicOption, |
| | | addBtn:false, |
| | | selection:false, |
| | | refreshBtn:false, |
| | | menu:false, |
| | | height:450, |
| | | addBtn: false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | menu: false, |
| | | height: 450, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow:true, |
| | | column:[ |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label:'生命周期模板名', |
| | | prop:'id', |
| | | searchLabelWidth:120, |
| | | search:true |
| | | label: '生命周期模板名', |
| | | prop: 'id', |
| | | searchLabelWidth: 120, |
| | | search: true |
| | | } |
| | | ] |
| | | }, |
| | | dialogLifeLoading:false, |
| | | dialogLfeVisible:false, |
| | | dialogVersionDefalutData:[], // 查询重置默认数据 |
| | | dialogSwitchValue:false, |
| | | dialogVersionSaveRow:{}, |
| | | dialogVersionVisible:false, |
| | | dialogVersionKey:Math.random(), |
| | | dialogVersionData:[], |
| | | dialogVersionOption:{ |
| | | dialogLifeLoading: false, |
| | | dialogLfeVisible: false, |
| | | dialogVersionDefalutData: [], // 查询重置默认数据 |
| | | dialogSwitchValue: false, |
| | | dialogVersionSaveRow: {}, |
| | | dialogVersionVisible: false, |
| | | dialogVersionKey: Math.random(), |
| | | dialogVersionData: [], |
| | | dialogVersionOption: { |
| | | ...basicOption, |
| | | addBtn:false, |
| | | selection:false, |
| | | refreshBtn:false, |
| | | menu:false, |
| | | height:450, |
| | | addBtn: false, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | menu: false, |
| | | height: 450, |
| | | searchMenuSpan: 8, |
| | | highlightCurrentRow:true, |
| | | highlightCurrentRow: true, |
| | | // calcHeight: 100, |
| | | column:[ |
| | | column: [ |
| | | { |
| | | label:'版本号规则', |
| | | prop:'id', |
| | | searchLabelWidth:110, |
| | | search:true |
| | | label: '版本号规则', |
| | | prop: 'id', |
| | | searchLabelWidth: 110, |
| | | search: true |
| | | } |
| | | ] |
| | | }, |
| | | dialogVersionLoading:false, |
| | | dialogVersionLoading: false, |
| | | dialogAttrSelectList: [], |
| | | searchAttrParams: {}, |
| | | dialogAttrLoading: false, |
| | |
| | | }, |
| | | dialogAttrSaveData: [], |
| | | attrPollDialogVisible: false, |
| | | rules: [], |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请输类型名称', trigger: 'blur'}, |
| | | {validator: this.validateEnglishOnly, trigger: 'blur'} |
| | | ], |
| | | revLevel: [ |
| | | {required: true, message: '请选择版本规则', trigger: 'blur'}, |
| | | ], |
| | | lifeCycleId: [ |
| | | {required: true, message: '请选择生命周期', trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | dialogAttrData: [], |
| | | dialogAttrOption: { |
| | | ...basicOption, |
| | |
| | | ] |
| | | }, |
| | | form: { |
| | | id:'', // 类型名称 |
| | | name:'', // 标签 |
| | | fName:'', // 继承自 |
| | | implClass:'', // 实现类 |
| | | description:'', // 描述 |
| | | revLevel:'', // 版本规则 |
| | | revisionRuleId:'',// 版本号规则 |
| | | inputRevisionFlag:'', // 手工输入 |
| | | versionRule:'', // 版次号规则 |
| | | lifeCycleId:'', // 生命周期 |
| | | subLifeCycleId:'', // 生命周期备选列表 |
| | | id: '', // 类型名称 |
| | | name: '', // 标签 |
| | | fName: '', // 继承自 |
| | | implClass: '', // 实现类 |
| | | description: '', // 描述 |
| | | revLevel: '', // 版本规则 |
| | | revisionRuleId: '',// 版本号规则 |
| | | inputRevisionFlag: false, // 手工输入 |
| | | versionRule: '', // 版次号规则 |
| | | lifeCycleId: '', // 生命周期 |
| | | subLifeCycleId: '', // 生命周期备选列表, |
| | | apNameArray: "", // 属性池列表’,‘分隔 |
| | | }, |
| | | nodeRow: {}, |
| | | treeOption: { |
| | |
| | | }, |
| | | |
| | | // 版本规则管理添加 |
| | | versionAddHandler(){ |
| | | versionAddHandler() { |
| | | this.dialogVersionVisible = true; |
| | | this.dialogVersionKey = Math.random(); // 打开时刷新表格避免表格错行 |
| | | this.dialogVersionLoading = true; |
| | | getVersionRuleAllList().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id:item.id |
| | | id: item.id |
| | | } |
| | | }); |
| | | this.dialogVersionData = data; |
| | |
| | | }, |
| | | |
| | | // 版本规则行点击 |
| | | dialogVersionRowClick(row){ |
| | | dialogVersionRowClick(row) { |
| | | this.dialogVersionSaveRow = row; |
| | | }, |
| | | |
| | | // 版本规则搜索 |
| | | versionHandleSearch(params,done){ |
| | | versionHandleSearch(params, done) { |
| | | const {id} = params; |
| | | |
| | | if (!params.id) { |
| | |
| | | }, |
| | | |
| | | // 版本管理置空 |
| | | versionHandleReset(){ |
| | | versionHandleReset() { |
| | | this.dialogVersionData = this.dialogVersionDefalutData; |
| | | }, |
| | | |
| | | // 版本规则保存 |
| | | dialogVersionAddClickHandler(){ |
| | | if(func.isEmptyObject(this.dialogVersionSaveRow)){ |
| | | // 版本号规则保存 |
| | | dialogVersionAddClickHandler() { |
| | | if (func.isEmptyObject(this.dialogVersionSaveRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | this.form.revRuleName = this.dialogVersionSaveRow.id; |
| | | this.form.revisionRuleId = this.dialogVersionSaveRow.id; |
| | | this.dialogVersionVisible = false; |
| | | }, |
| | | |
| | | // 生命周期新增 |
| | | lifeAddHandler(val){ |
| | | lifeAddHandler(val) { |
| | | this.dialogLfeVisible = true; |
| | | this.dialogLifeKey = Math.random(); // 打开时刷新表格避免表格错行 |
| | | this.dialogLifeLoading = true; |
| | |
| | | gridLifeCycle().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id:item.id |
| | | id: item.id |
| | | } |
| | | }); |
| | | this.dialogLifeData = data; |
| | |
| | | }, |
| | | |
| | | // 生命周期行点击 |
| | | dialogLifeRowClick(row){ |
| | | dialogLifeRowClick(row) { |
| | | this.dialogLifeSaveRow = row; |
| | | }, |
| | | |
| | | // 生命周期保存 |
| | | dialogLifeAddClickHandler(){ |
| | | if(func.isEmptyObject(this.dialogLifeSaveRow)){ |
| | | dialogLifeAddClickHandler() { |
| | | if (func.isEmptyObject(this.dialogLifeSaveRow)) { |
| | | this.$message.error('请至少选择一条数据'); |
| | | return; |
| | | } |
| | | if(this.lifeType === 'input'){ |
| | | this.form.lifeCycle = this.dialogLifeSaveRow.id; |
| | | }else { |
| | | if (this.lifeType === 'input') { |
| | | this.form.lifeCycleId = this.dialogLifeSaveRow.id; |
| | | } else { |
| | | const flag = this.dialogLifeTable.some(item => item.id === this.dialogLifeSaveRow.id); |
| | | |
| | | if (flag) { |
| | |
| | | }, |
| | | |
| | | // 生命周期备选列表移除 |
| | | dialogDeleteLifeTable(index){ |
| | | this.dialogLifeTable.splice(index,1) |
| | | dialogDeleteLifeTable(index) { |
| | | this.dialogLifeTable.splice(index, 1) |
| | | }, |
| | | |
| | | // 生命周期搜索 |
| | | lifeHandleSearch(params,done){ |
| | | lifeHandleSearch(params, done) { |
| | | const {id} = params; |
| | | |
| | | if (!params.id) { |
| | |
| | | }, |
| | | |
| | | // 生命周期重置 |
| | | lifeHandleReset(){ |
| | | lifeHandleReset() { |
| | | this.dialogLifeData = this.dialogLifeDefalutData; |
| | | }, |
| | | |
| | | // 只能输入英文正则校验 |
| | | validateEnglishOnly(rule, value, callback) { |
| | | if (!value) { |
| | | return callback(new Error('请输入类型名称')); |
| | | } |
| | | if (!/^[A-Za-z]+$/.test(value)) { |
| | | return callback(new Error('只能输入英文字母')); |
| | | } |
| | | callback(); // 验证通过 |
| | | }, |
| | | |
| | | // 新增编辑保存 |
| | | addDialogSavaHandler(){ |
| | | addDialogSavaHandler() { |
| | | console.log(this.form) |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | addLifeCycle(this.form).then(res => { |
| | | console.log(res); |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .avue-dialog .el-dialog__body{ |
| | | .avue-dialog .el-dialog__body { |
| | | padding: 20px 20px 0px 20px; // 上右下左 |
| | | margin-bottom: 10px !important; |
| | | } |
| | |
| | | </el-form> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="rowSaveHandler">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </span> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="rowSaveHandler">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 查看使用范围 --> |
| | |
| | | dialogData: [], |
| | | dialogOption: { |
| | | ...basicOption, |
| | | calcHeight:50, |
| | | calcHeight: 50, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | column: [ |
| | |
| | | row, |
| | | this.$refs.userCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | |
| | | |
| | | // 对话框枚举保存 |
| | | rowSaveHandler() { |
| | | const lengthStatus = this.dialogData.some(item => item.value.length > this.form.length) |
| | | if (lengthStatus) { |
| | | this.$message.error('请检查枚举值是否超过最大长度!') |
| | | return; |
| | | } |
| | | |
| | | if (this.form.enumValueDataType === "Integer") { |
| | | // 判断是否包含非数字字符 |
| | | const integerStatus = this.dialogData.some(item => { |
| | | if (!/^\-?\d+$/.test(item.value)) { |
| | | return true; |
| | | const lengthStatus = this.dialogData.some(item => item.value.length > this.form.length); |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | if (lengthStatus) { |
| | | this.$message.error('请检查枚举值是否超过最大长度!') |
| | | return; |
| | | } |
| | | }) |
| | | |
| | | // 判断是否是integer格式 |
| | | const integerNumStatus = this.dialogData.some(item => { |
| | | let numValue = parseInt(item.value); |
| | | if (isNaN(numValue) || !Number.isInteger(numValue)) { |
| | | return true; |
| | | if (this.form.enumValueDataType === "Integer") { |
| | | // 判断是否包含非数字字符 |
| | | const integerStatus = this.dialogData.some(item => { |
| | | if (!/^\-?\d+$/.test(item.value)) { |
| | | return true; |
| | | } |
| | | }) |
| | | |
| | | // 判断是否是integer格式 |
| | | const integerNumStatus = this.dialogData.some(item => { |
| | | let numValue = parseInt(item.value); |
| | | if (isNaN(numValue) || !Number.isInteger(numValue)) { |
| | | return true; |
| | | } |
| | | }) |
| | | |
| | | if (integerStatus || integerNumStatus) { |
| | | this.$message.error('枚举值必须是Integer类型'); |
| | | return; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (integerStatus || integerNumStatus) { |
| | | this.$message.error('枚举值必须是Integer类型'); |
| | | return; |
| | | if (this.dialogType === 'add') { |
| | | let params = { |
| | | ...this.form, |
| | | items: this.dialogData |
| | | } |
| | | addEnumType(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.dialogVisible = false; |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | } else if (this.dialogType === 'edit') { |
| | | let params = { |
| | | ...this.form, |
| | | items: this.dialogData, |
| | | oid: this.editRow.oid, |
| | | ts: this.editRow.ts |
| | | } |
| | | updateEnumType(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.dialogVisible = false; |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | if (this.dialogType === 'add') { |
| | | let params = { |
| | | ...this.form, |
| | | items: this.dialogData |
| | | } |
| | | addEnumType(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.dialogVisible = false; |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | } else if (this.dialogType === 'edit') { |
| | | let params = { |
| | | ...this.form, |
| | | items: this.dialogData, |
| | | oid: this.editRow.oid, |
| | | ts: this.editRow.ts |
| | | } |
| | | updateEnumType(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.dialogVisible = false; |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 枚举项新增 |
| | |
| | | highlightCurrentRow: true, |
| | | searchMenuSpan: 8, |
| | | searchLabelWidth: 100, |
| | | calcHeight:30, |
| | | calcHeight: 30, |
| | | column: [ |
| | | { |
| | | label: '业务类型名', |
| | |
| | | this.bizFormData = []; |
| | | this.bizToData = []; |
| | | this.dialogBottomData = []; |
| | | console.log(this.form); |
| | | console.log('--', this.nodeRow) |
| | | }, |
| | | |
| | | // 添加属性池 保存 |
| | |
| | | this.$message.error('form端业务类型和to端类型均不能为空!') |
| | | return; |
| | | } |
| | | this.form.btmItemsFrom = this.bizFormData.map(item => item.name); |
| | | this.form.btmItemsTo = this.bizToData.map(item => item.name); |
| | | this.form.attributes = this.dialogBottomData.map(item => item.id); |
| | | let flag = this.title === 'add' ? true : false; |
| | | addAndEditLink(flag, this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.visible = false; |
| | | this.$message.success(res.data.msg); |
| | | this.resetForm(); |
| | | this.getTreeList(); |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.form.btmItemsFrom = this.bizFormData.map(item => item.name); |
| | | this.form.btmItemsTo = this.bizToData.map(item => item.name); |
| | | this.form.attributes = this.dialogBottomData.map(item => item.id); |
| | | let flag = this.title === 'add' ? true : false; |
| | | addAndEditLink(flag, this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.visible = false; |
| | | this.$message.success(res.data.msg); |
| | | this.resetForm(); |
| | | this.getTreeList(); |
| | | } |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | <basic-container> |
| | | <avue-crud |
| | | ref="useCrud" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler" |
| | | @refresh-change="handleRefresh" |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | loading:false, |
| | | loading: false, |
| | | data: [], |
| | | option: { |
| | | ...basicOption, |
| | |
| | | ] |
| | | }, |
| | | visible: false, |
| | | selectList:[], |
| | | lastIndex:null, |
| | | selectList: [], |
| | | lastIndex: null, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 15, |
| | |
| | | }, |
| | | |
| | | // 表格刷新 |
| | | handleRefresh(){ |
| | | handleRefresh() { |
| | | this.getTreeList(); |
| | | }, |
| | | |
| | | // 表格多选 |
| | | selectChange(row){ |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | |
| | | row, |
| | | this.$refs.useCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | // 行单个删除 |
| | | delRowClickHandler(row){ |
| | | delRowClickHandler(row) { |
| | | this.$confirm('您确定要删除所选择的数据吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | |
| | | // 创建或编辑保存 |
| | | addSaveHandler() { |
| | | const saveFunction = this.dialogTitle === 'add' ? addSave : editSave; |
| | | |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.loading = true; |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.loading = true; |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | return false; |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | }, |
| | | |
| | |
| | | // 新增 编辑 保存 |
| | | addSaveHandler() { |
| | | const saveFunction = this.dialogTitle === 'add' ? addVersionRule : updateVersionRule; |
| | | |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | return false; |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | }, |
| | | |