<template>
|
<el-dialog
|
v-loading="loading"
|
:visible.sync="showSubmitDialog"
|
append-to-body
|
style="height: 115vh;"
|
title="业务类型"
|
top="6vh"
|
width="70%"
|
@close="closeSubmitDialog"
|
>
|
<el-form ref="form" :model="btmType" :rules="rules" class="btmTypeForm" inline label-suffix=":"
|
show-message="true"
|
size="medium" status-icon="true" @resetFields="resetForm">
|
<el-form-item label="英文名称" label-width="100px" prop="id">
|
<el-input v-model="btmType.id" :disabled="true" :prefix-icon="icons.key"></el-input>
|
</el-form-item>
|
<el-form-item label="中文名称" label-width="100px">
|
<el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="数据库表名" label-width="100px">
|
<el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input>
|
</el-form-item> -->
|
<el-form-item class="domainSelect" label="所属领域" label-width="100px" prop="domain">
|
<el-select v-model="btmType.bizDomain" :prefix-icon="icons.domain" placeholder="请选择领域" @change="domainChange">
|
<el-option v-for="item in domainOption"
|
:key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="版本规则" label-width="100px">
|
<el-input v-model="btmType.revisionRuleName"
|
:prefix-icon="icons.revisionRule"
|
:suffix-icon="icons.referType"
|
class="revisionRule"
|
clearable
|
placeholder="请选择,留空则不进行管理"
|
@clear="clearRevision"
|
@focus="openRevision">
|
</el-input>
|
</el-form-item>
|
<el-form-item label="生命周期" label-width="100px">
|
<el-input v-model="btmType.lifeCycleName"
|
:prefix-icon="icons.lifeCycle"
|
:suffix-icon="icons.referType"
|
class="lifeCycle"
|
clearable
|
placeholder="请选择,留空则不进行管理"
|
@clear="clearLifeCycle"
|
@focus="openLifeCycle">
|
</el-input>
|
</el-form-item>
|
<!-- <div>-->
|
<!-- <el-form-item label="开启视图" label-width="100px" class="viewFlag">-->
|
<!-- <el-switch v-model="btmType.viewFlag" active-color="#13ce66" @change="viewChange"></el-switch>-->
|
<!-- </el-form-item>-->
|
<!-- <el-form-item label="视图语句" label-width="100px" class="viewInput">-->
|
<!-- <el-input v-model="btmType.view" :prefix-icon="icons.view" :disabled="!btmType.viewFlag"></el-input>-->
|
<!-- </el-form-item>-->
|
<!-- </div>-->
|
<el-form-item class="description" label="描述" label-width="100px">
|
<el-input id="descId"
|
v-model="btmType.description"
|
:prefix-icon="icons.desc"
|
class="descClass"
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<avue-crud ref="attrTable"
|
:data="btmType.attributes"
|
:option="option"
|
:page.sync="page">
|
<template slot="menuLeft" slot-scope="scope">
|
<el-button icon="el-icon-plus"
|
size="small"
|
type="danger"
|
@click="rowAdd()">属性选择
|
</el-button>
|
</template>
|
<template slot="attrDataTypeText" slot-scope="{row}">
|
<el-tag v-if="row.attrDataTypeText">{{ row.attrDataTypeText }}</el-tag>
|
</template>
|
<template slot="isDefaultAttr" slot-scope="{row}">
|
<el-tag v-if="row.isDefaultAttr" type="success">是</el-tag>
|
<el-tag v-else type="danger">否</el-tag>
|
</template>
|
<template slot="menu" slot-scope="{row,index}">
|
<el-button v-if="!row.$cellEdit" icon="el-icon-edit" size="small" type="text" @click="cellEditClick(row,index)">
|
编辑
|
</el-button>
|
<el-button v-if="!row.$cellEdit" icon="el-icon-delete" size="small" type="text"
|
@click="removeFormAttrTable(row,index)">移除
|
</el-button>
|
<el-button v-if="row.$cellEdit" icon="el-icon-check" size="small" type="text" @click="cellEditSave(row,index)">
|
保存
|
</el-button>
|
</template>
|
</avue-crud>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="submitBtmType">确定</el-button>
|
<el-button @click="cancleSubmitBtmType">取消</el-button>
|
</div>
|
|
<!-- 属性池的选择 -->
|
<el-dialog :visible="attrRef.visible"
|
append-to-body
|
title="属性池"
|
width="80%"
|
@close="closeAttrDialog"
|
>
|
<avue-crud ref="attrRef"
|
v-loading="attrRef.loading"
|
:data="attrRef.data"
|
:option="attrRef.option"
|
:page.sync="attrRef.page"
|
class="attrRef"
|
@on-load="attrRefOnLoad"
|
@search-change="attrRefSearch"
|
@selection-change="selectionChange">
|
<template slot="typeValue" slot-scope="scope">
|
<el-tag v-if="scope.row.typeValue">{{ scope.row.typeValue }}</el-tag>
|
</template>
|
</avue-crud>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="confirmSelectAttr">确定</el-button>
|
<el-button @click="cancleSelectAttr">取消</el-button>
|
</div>
|
</el-dialog>
|
<!-- 版本规则的参照 -->
|
<el-dialog :visible.sync="revisionRef.visible"
|
append-to-body
|
title="请选择版本规则"
|
width="80%">
|
|
<avue-crud ref="revisionRef"
|
v-loading="revisionRef.loading"
|
:data="revisionRef.data"
|
:option="revisionRef.option"
|
:page.sync="revisionRef.page"
|
class="revisionRef"
|
@row-click="revisionClick"
|
@search-change="searchRevisionRule"
|
@search-reset="clearSearchRevisionRule">
|
<template slot="radio"
|
slot-scope="{row}">
|
<el-radio v-model="revisionRef.selectRow"
|
:label="row.$index">
|
</el-radio>
|
</template>
|
</avue-crud>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="confirmRevision">确定</el-button>
|
<el-button @click="cancelRevision">取消</el-button>
|
</div>
|
</el-dialog>
|
|
<!-- 生命周期的参照 -->
|
<el-dialog :visible.sync="lifeCycleRef.visible"
|
append-to-body
|
title="请选择生命周期"
|
width="80%">
|
|
<avue-crud ref="lifeCycleRef"
|
v-loading="lifeCycleRef.loading"
|
:data="lifeCycleRef.data"
|
:option="lifeCycleRef.option"
|
:page.sync="lifeCycleRef.page"
|
class="lifeCycleRef"
|
@row-click="lifeCycleClick"
|
@search-change="searchLifeCycle"
|
@search-reset="clearSearchLifeCycle">
|
<template slot="radio"
|
slot-scope="{row}">
|
<el-radio v-model="lifeCycleRef.selectRow"
|
:label="row.$index">
|
</el-radio>
|
</template>
|
</avue-crud>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="confirmLifeCycle">确定</el-button>
|
<el-button @click="cancelLifeCycle">取消</el-button>
|
</div>
|
</el-dialog>
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
import {add, defaultRequestHandler, update} from '@/api/omd/btmType';
|
import {queryPage} from '@/api/omd/OmdAttribute';
|
import {getPage} from '@/api/omd/revisionRule';
|
import {getList} from '@/api/modeling/cycle';
|
|
export default {
|
name: 'BusinessEdit',
|
props: {
|
btmType: {
|
type: Object,
|
default: {}
|
},
|
domainOption: {
|
type: Array
|
},
|
icons: {
|
type: Array
|
},
|
type: {
|
type: String,
|
},
|
},
|
watch: {
|
btmType(newval) {
|
if (newval) {
|
//所属领域
|
if (newval.domainText) {
|
this.getDefaultData('defaultAttr', 'domainData', 'domainFirstSelection', 'get');
|
}else {
|
this.domainFirstValue = false;
|
}
|
//版本规则
|
if (newval.revisionRuleName && newval.revisionRuleId) {
|
this.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection', 'get');
|
}else {
|
this.ruleFirstValue = false;
|
}
|
//生命周期
|
if (newval.lifeCycleId && newval.lifeCycleName) {
|
this.getDefaultData('lifeCycle', 'lifeData', 'lifeCycleSelection', 'get');
|
}else {
|
this.lifeCycleValue = false;
|
}
|
}
|
}
|
},
|
data() {
|
return {
|
form: {},
|
loading: false,
|
showSubmitDialog: false,
|
option: {
|
height: "330px",
|
selection: false,
|
headerAlign: 'center',
|
border: true,
|
index: true,
|
rowKey: 'id',
|
tabs: true,
|
menu: true,
|
editBtn: false,
|
delBtn: false,
|
columnBtn: false,
|
menuWidth: 150,
|
refreshBtn: false,
|
addBtn: false,
|
highlightCurrentRow: true,
|
column: [
|
{
|
label: '英文名称',
|
prop: 'id',
|
align: 'center',
|
disabled: true
|
}, {
|
label: '中文名称',
|
prop: 'name',
|
align: 'center',
|
cell: true
|
}, {
|
label: "类型",
|
prop: "attrDataTypeText",
|
align: 'center',
|
slot: true
|
},
|
{
|
label: "默认值",
|
prop: "defaultValue",
|
align: 'center',
|
cell: true
|
},
|
{
|
label: "说明",
|
prop: "description",
|
align: 'center',
|
cell: true
|
},
|
{
|
label: '默认字段',
|
prop: 'isDefaultAttr',
|
align: 'center',
|
cell: true,
|
slot: true
|
}
|
]
|
},
|
attrRef: {
|
visible: false,
|
page: {
|
currentPage: 1,
|
pageSize: 10,
|
},
|
loading: false,
|
key: null,
|
option: {
|
height: 360,
|
addBtn: false,
|
refreshBtn: false,
|
columnBtn: false,
|
selection: true,
|
menu: false,
|
border: true,
|
reserveSelection: true,
|
searchMenuSpan: 8,
|
highlightCurrentRow: true,
|
rowKey: 'id',
|
column: [
|
{
|
label: '英文名称',
|
prop: 'id',
|
align: 'left',
|
search: true,
|
disabled: true,
|
width: 230
|
}, {
|
label: '中文名称',
|
prop: 'name',
|
align: 'center',
|
},
|
{
|
label: "类型",
|
prop: "typeValue",
|
align: 'center',
|
slot: true,
|
},
|
{
|
label: "默认值",
|
prop: "defaultValue",
|
align: 'center'
|
},
|
{
|
label: '允许为空',
|
prop: 'nullable',
|
type: 'switch',
|
display: false,
|
hide: true,
|
labelWidth: 132,
|
dicData: [{
|
label: '否',
|
value: 1
|
}, {
|
label: '是',
|
value: 0
|
}]
|
},
|
{
|
label: "说明",
|
prop: "description",
|
cell: true,
|
align: 'center'
|
}
|
]
|
},
|
data: [],
|
queryNotIn: ''
|
},
|
revisionRef: {
|
visible: false,
|
page: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
loading: false,
|
selectRow: '',
|
searchKey: null,
|
option: {
|
height: 360,
|
addBtn: false,
|
refreshBtn: false,
|
columnBtn: false,
|
menu: false,
|
border: true,
|
reserveSelection: true,
|
searchMenuSpan: 8,
|
searchShowBtn: false,
|
highlightCurrentRow: true,
|
column: [{
|
label: '选择',
|
prop: 'radio',
|
width: 60,
|
hide: false
|
},
|
{
|
label: '英文名称',
|
prop: 'id',
|
disabled: true,
|
search: true
|
},
|
{
|
label: "中文名称",
|
prop: "name",
|
search: true,
|
},
|
{
|
label: "跳跃字符",
|
prop: "skipCode"
|
},
|
{
|
label: "初始值",
|
prop: "startCode"
|
},
|
{
|
label: "步长",
|
prop: "serialStep"
|
},
|
{
|
label: "前缀",
|
prop: "prefixCode"
|
},
|
{
|
label: "后缀",
|
prop: "suffixCode"
|
},
|
{
|
label: "描述",
|
prop: "description",
|
type: "textarea"
|
}
|
]
|
},
|
},
|
lifeCycleRef: {
|
visible: false,
|
page: {
|
currentPage: 1,
|
pageSize: 10
|
},
|
loading: false,
|
selectRow: '',
|
searchKey: null,
|
option: {
|
height: 360,
|
addBtn: false,
|
refreshBtn: false,
|
columnBtn: false,
|
menu: false,
|
border: true,
|
reserveSelection: true,
|
searchMenuSpan: 8,
|
searchShowBtn: false,
|
highlightCurrentRow: true,
|
column: [{
|
label: '选择',
|
prop: 'radio',
|
width: 60,
|
hide: false
|
},
|
{
|
label: '英文名称',
|
prop: 'id',
|
disabled: true,
|
search: true
|
},
|
{
|
label: "中文名称",
|
prop: "name",
|
search: true,
|
},
|
{
|
label: "跳跃字符",
|
prop: "skipCode"
|
},
|
{
|
label: "初始值",
|
prop: "startCode"
|
},
|
{
|
label: "步长",
|
prop: "serialStep"
|
},
|
{
|
label: "前缀",
|
prop: "prefixCode"
|
},
|
{
|
label: "后缀",
|
prop: "suffixCode"
|
},
|
{
|
label: "描述",
|
prop: "description",
|
type: "textarea"
|
}
|
]
|
},
|
},
|
rules: {
|
id: [
|
{required: true, message: '请输入业务类型编号', trigger: 'blur'},
|
{pattern: /^[A-Za-z]+$/, message: '业务类型编号只能为英文', trigger: 'blur'},
|
{min: 2, max: 20, message: '长度在2到20个字符', trigger: 'blur'}
|
],
|
name: [
|
{required: true, message: '请输入业务类型中文名称', trigger: 'blur'}
|
],
|
domain: [
|
{required: true, message: '请选择所属领域', trigger: 'blur'}
|
]
|
},
|
domainData: [],
|
ruleData: [],
|
lifeData: [],
|
domainFirstSelection: true,
|
domainFirstValue: true,
|
ruleFirstSelection: true,
|
ruleFirstValue: true,
|
lifeCycleSelection: true,
|
lifeCycleValue: true,
|
}
|
},
|
created() {
|
},
|
methods: {
|
//所属领域change
|
domainChange(){
|
if(!this.domainFirstValue){
|
this.getDefaultData('defaultAttr', 'domainData', 'domainFirstSelection', 'detail');
|
this.domainFirstValue = true;
|
}
|
},
|
getDefaultData(requestType, dataName, selectionName, type) {
|
if (type === 'get') {
|
defaultRequestHandler(requestType).then(res => {
|
this[dataName] = res.data.data;
|
res.data.data.forEach(item => {
|
let data = {
|
id: item.id,
|
name: item.name,
|
attrDataType: item.attrDataType,
|
attrDataTypeText: item.attrDataTypeText,
|
defaultValue: item.defaultValue,
|
description: item.description,
|
attributeLength: item.attributeLength,
|
referBtmTypeId: item.referTypeCode,
|
referBtmTypeName: item.referToName,
|
enumId: item.dictCode,
|
isDefaultAttr: item.isDefaultAttr
|
}
|
if (!this.btmType.attributes) {
|
this.btmType.attributes = [];
|
}
|
// 获取重复的id
|
let isIds = this.btmType.attributes.filter(attr => attr.id === data.id);
|
if (isIds.length === 0) {
|
this.btmType.attributes.push(data);
|
}
|
})
|
this.attrRefOnLoad()
|
});
|
} else {
|
if (this[selectionName]) {
|
defaultRequestHandler(requestType).then(res => {
|
this[dataName] = res.data.data;
|
res.data.data.forEach(item => {
|
let data = {
|
id: item.id,
|
name: item.name,
|
attrDataType: item.attrDataType,
|
attrDataTypeText: item.attrDataTypeText,
|
defaultValue: item.defaultValue,
|
description: item.description,
|
attributeLength: item.attributeLength,
|
referBtmTypeId: item.referTypeCode,
|
referBtmTypeName: item.referToName,
|
enumId: item.dictCode,
|
isDefaultAttr: item.isDefaultAttr
|
}
|
if (!this.btmType.attributes) {
|
this.btmType.attributes = [];
|
}
|
this.btmType.attributes.push(data);
|
})
|
this.attrRefOnLoad()
|
this[selectionName] = false;
|
});
|
}
|
}
|
},
|
// 关闭组件弹窗
|
closeSubmitDialog() {
|
this.showSubmitDialog = false;
|
// this.btmType.attributes = [];
|
// this.btmType = {};
|
// this.attrRef.selectData = [];
|
// this.attrRef.queryNotIn = null;
|
// this.resetForm();
|
},
|
// 关闭属性池查询弹窗
|
closeAttrDialog() {
|
this.attrRef.visible = false;
|
},
|
// 属性选择添加
|
async rowAdd() {
|
await this.attrRefOnLoad();
|
this.attrRef.visible = true;
|
},
|
// 属性池加载
|
attrRefOnLoad() {
|
if (this.attrRef.queryNotIn != '' && this.btmType.attributes !== undefined && this.btmType.attributes.length > 0) {
|
this.attrRef.queryNotIn = '';
|
this.btmType.attributes.forEach(item => {
|
this.attrRef.queryNotIn += (item.id + ",")
|
})
|
}
|
this.attrRef.loading = true;
|
queryPage(this.attrRef.key, this.attrRef.queryNotIn, this.attrRef.page.currentPage, this.attrRef.page.pageSize).then(res => {
|
const data = res.data.data;
|
this.attrRef.page.total = data.total;
|
this.attrRef.data = data.records;
|
this.attrRef.loading = false;
|
});
|
},
|
// 属性池检索
|
attrRefSearch(form, done) {
|
this.attrRef.key = form.id;
|
this.attrRefOnLoad();
|
done();
|
this.attrRef.key = null;
|
},
|
// 从属性池中移除
|
removeFormAttrTable(row, index) {
|
this.btmType.attributes.splice(index, 1);
|
this.attrRef.queryNotIn = "";
|
this.btmType.attributes.forEach(item => {
|
this.attrRef.queryNotIn += (item.id + ",")
|
})
|
},
|
// 属性池勾选事件
|
selectionChange(list) {
|
this.attrRef.selectData = list;
|
},
|
// 确认属性池勾选
|
confirmSelectAttr() {
|
if (!this.btmType.attributes) {
|
this.btmType.attributes = [];
|
}
|
// console.log(this.attrRef.selectData);
|
this.attrRef.selectData.forEach(item => {
|
this.btmType.attributes.push({
|
id: item.id,
|
name: item.name,
|
attrDataType: item.typeKey,
|
attrDataTypeText: item.typeValue,
|
defaultValue: item.defaultValue,
|
description: item.description,
|
attributeLength: item.maxLength,
|
referBtmTypeId: item.referTypeCode,
|
referBtmTypeName: item.referToName,
|
enumId: item.dictCode,
|
});
|
this.attrRef.queryNotIn += (item.id + ",")
|
});
|
this.$refs.attrRef.selectClear();
|
this.attrRef.selectData = [];
|
this.attrRef.data = [];
|
this.closeAttrDialog();
|
},
|
// 取消属性池勾选
|
cancleSelectAttr() {
|
this.attrRef.selectData = [];
|
this.closeAttrDialog();
|
},
|
// 添加业务类型
|
submitBtmType() {
|
// console.log(this.btmType);
|
if (!this.btmType || !this.btmType.attributes) {
|
this.$message.warning("还没有为业务类型选择属性");
|
return;
|
}
|
const hasEmptyName = this.btmType.attributes.some(item => !item.name);
|
if (hasEmptyName) {
|
this.$message.warning('请检查表格中是否存在中文名称为空!')
|
return;
|
}
|
this.btmType.attributes = this.btmType.attributes.filter(item => !item.isDefaultAttr);
|
add(this.btmType,true).then(res => {
|
// console.log(res)
|
// 添加完成,回调父组件的刷新
|
this.$message.success(res.data.msg);
|
this.cancleSubmitBtmType();
|
this.$emit('refreshTable');
|
})
|
},
|
// 取消添加业务类型
|
cancleSubmitBtmType() {
|
this.btmType = {};
|
this.btmType.attributes = [];
|
this.showSubmitDialog = false;
|
},
|
// 刷新属性列表
|
refreshAttrTable() {
|
this.$nextTick(() => {
|
this.$refs.attrTable.refreshTable();
|
})
|
},
|
//
|
viewChange() {
|
|
},
|
// 列表编辑
|
cellEditClick(cell) {
|
// console.log(cell);
|
cell.$cellEdit = true;
|
},
|
// 列表编辑保存
|
cellEditSave(row, index) {
|
this.btmType.attributes[index].name = row.name
|
this.btmType.attributes[index].defaultValue = row.defaultValue;
|
this.btmType.attributes[index].description = row.description;
|
row.$cellEdit = false;
|
// console.log(this.btmType.attributes);
|
this.$refs.attrTable.refreshTable();
|
},
|
// 打开版本规则参照
|
openRevision() {
|
this.revisionRef.visible = true;
|
this.revisionRuleOnLoad();
|
},
|
// 版本参照列表的默认查询方法
|
revisionRuleOnLoad() {
|
this.revisionRef.loading = true;
|
getPage().then(res => {
|
this.revisionRef.data = res.data.data.records;
|
});
|
setTimeout(() => {
|
this.revisionRef.loading = false;
|
}, 600)
|
this.$nextTick(() => {
|
this.$refs.revisionRef.refreshTable();
|
});
|
},
|
// 打开版本规则参照
|
openLifeCycle() {
|
this.lifeCycleRef.visible = true;
|
this.lifeCycleOnLoad();
|
},
|
// 生命周期列表的默认查询方法
|
lifeCycleOnLoad() {
|
this.lifeCycleRef.loading = true;
|
getList().then(res => {
|
this.lifeCycleRef.data = res.data.data.records;
|
this.lifeCycleRef.loading = false;
|
});
|
this.$nextTick(() => {
|
this.$refs.lifeCycleRef.refreshTable();
|
});
|
},
|
// 关闭版本规则参照弹窗
|
closeRevisionDialog() {
|
this.revisionRef.visible = false;
|
},
|
// 关闭生命周期参照弹窗
|
closeLifeCycleDialog() {
|
this.lifeCycleRef.visible = false;
|
},
|
// 确认选中版本规则
|
confirmRevision() {
|
this.btmType.revisionFlag = true;
|
this.btmType.revisionRuleId = this.revisionRef.selectData.id;
|
this.btmType.revisionRuleName = this.revisionRef.selectData.name;
|
this.btmType.inputRevisionFlag = false;
|
if(!this.ruleFirstValue){
|
this.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection', 'detail');
|
this.ruleFirstValue = true;
|
}
|
this.cancelRevision();
|
},
|
// 确认选中生命周期
|
confirmLifeCycle() {
|
this.btmType.lifeCycleFlag = true;
|
this.btmType.lifeCycleId = this.lifeCycleRef.selectData.id;
|
this.btmType.lifeCycleName = this.lifeCycleRef.selectData.name;
|
if(!this.lifeCycleValue){
|
this.getDefaultData('lifeCycle', 'lifeData', 'lifeCycleSelection', 'detail');
|
this.lifeCycleValue = true;
|
}
|
this.cancelLifeCycle();
|
},
|
// 取消选中版本规则
|
cancelRevision() {
|
this.revisionRef.selectRow = '';
|
this.revisionRef.selectData = {};
|
this.closeRevisionDialog();
|
},
|
// 取消选中生命周期
|
cancelLifeCycle() {
|
this.lifeCycleRef.selectRow = '';
|
this.lifeCycleRef.selectData = {};
|
this.closeLifeCycleDialog();
|
},
|
// 版本规则单选
|
revisionClick(row) {
|
this.revisionRef.selectRow = row.$index;
|
this.revisionRef.selectData = {
|
id: row.id,
|
name: row.name,
|
};
|
},
|
// 生命周期单选
|
lifeCycleClick(row) {
|
this.lifeCycleRef.selectRow = row.$index;
|
this.lifeCycleRef.selectData = {
|
id: row.id,
|
name: row.name,
|
};
|
},
|
// 取消版本规则
|
clearRevision() {
|
this.$delete(this.btmType, 'revisionFlag');
|
this.$delete(this.btmType, 'revisionRuleId');
|
this.$delete(this.btmType, 'revisionRuleName');
|
this.$delete(this.btmType, 'inputRevisionFlag');
|
},
|
// 取消生命周期
|
clearLifeCycle() {
|
this.$delete(this.btmType, 'lifeCycleFlag');
|
this.$delete(this.btmType, 'lifeCycleId');
|
this.$delete(this.btmType, 'lifeCycleName');
|
},
|
// 表单重置
|
resetForm() {
|
this.btmType = {};
|
this.$refs.form.resetFields();
|
},
|
/**
|
* 搜索版本规则
|
* @param params 搜索框输入值 {id: '',name: ''} 直接获取就行
|
* @param done 执行完成后的回调
|
*/
|
searchRevisionRule(params, done) {
|
let condition = {};
|
if (params.id) {
|
condition['id_like'] = params.id;
|
}
|
if (params.name) {
|
condition['name_like'] = params.name;
|
}
|
this.revisionRef.loading = true;
|
getPage(this.revisionRef.page.currentPage, this.revisionRef.page.pageSize, condition).then(res => {
|
this.revisionRef.data = res.data.data.records;
|
});
|
setTimeout(() => {
|
done();
|
this.revisionRef.loading = false;
|
}, 600);
|
this.$nextTick(() => {
|
this.$refs.revisionRef.refreshTable();
|
});
|
},
|
/**
|
* 搜索生命周期
|
* @param params 搜索框输入值
|
* @param done 执行完成后的回调
|
*/
|
searchLifeCycle(params, done) {
|
let condition = {};
|
if (params.id) {
|
condition['id_like'] = params.id;
|
}
|
if (params.name) {
|
condition['name_like'] = params.name;
|
}
|
this.lifeCycleRef.loading = true;
|
getList(this.lifeCycleRef.page.currentPage, this.lifeCycleRef.page.pageSize, condition).then(res => {
|
this.lifeCycleRef.data = res.data.data.records;
|
this.lifeCycleRef.loading = false;
|
});
|
},
|
// 取消版本规则搜索
|
clearSearchRevisionRule(item) {
|
this.revisionRuleOnLoad();
|
},
|
// 取消生命周期搜索
|
clearSearchLifeCycle(item) {
|
this.lifeCycleOnLoad();
|
console.log(item);
|
}
|
}
|
}
|
</script>
|
|
<style>
|
/* 属性池参照列表 */
|
.attrRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
|
display: none !important;
|
}
|
|
.revisionRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
|
display: none !important;
|
}
|
|
.lifeCycleRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu {
|
display: none !important;
|
}
|
|
.btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner {
|
width: 260px;
|
}
|
|
.domainSelect > .el-form-item__content > .el-select > .el-input > .el-input__inner {
|
width: 260px;
|
}
|
|
.viewFlag {
|
width: 360px;
|
}
|
|
.viewInput > .el-form-item__content > .el-input > .el-input__inner {
|
width: 630px;
|
}
|
|
.descClass > .el-input__inner {
|
width: 1000px;
|
}
|
</style>
|