| | |
| | | 使用枚举 |
| | | </template> |
| | | <div> |
| | | <el-tag :type="lastItem.enumFlag ? 'success' : 'danger'"> |
| | | {{ lastItem.enumFlag ? '是' : '否' }} |
| | | <el-tag :type="lastItem.enumId ? 'success' : 'danger'"> |
| | | {{ lastItem.enumId ? '是' : '否' }} |
| | | </el-tag> |
| | | </div> |
| | | </el-descriptions-item> |
| | |
| | | 枚举类型 |
| | | </template> |
| | | <div> |
| | | {{ lastItem.enumFlag }} |
| | | {{ lastItem.enumId }} |
| | | </div> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="选择参照类型:" prop="referValue"> |
| | | <el-input v-model="form.referValue" :clearable="true" @focus="referFormFocusHandler"></el-input> |
| | | <avue-input-tree key="businessReferValue" v-if="form.attributeSelectType === 'business'" default-expand-all :clearable="true" v-model="form.referValue" placeholder="请选择内容" :dic="businessData" @change="referValueChange"></avue-input-tree> |
| | | <avue-input-tree key="linkReferValue" v-else default-expand-all v-model="form.referValue" placeholder="请选择内容" :clearable="true" :dic="linkTypeData" @change="referValueChange"></avue-input-tree> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item v-if="form.attributeSelectType === 'link'" label="版本次:" prop="version"> |
| | | <el-form-item v-show="form.attributeSelectType === 'link'" label="版本次:" prop="version"> |
| | | <el-select v-model="form.version" placeholder="请选择版本次"> |
| | | <el-option :value="1" label="当前版本次"></el-option> |
| | | <el-option :value="3" label="最新版本次"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <div v-if="!form.referValue" style="clear: both"> |
| | | <div v-show="showEnumSwitch" style="clear: both"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="使用枚举:" prop="enumSwitch"> |
| | | <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch> |
| | |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <!-- 业务类型对话框 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="businessVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="业务类型选择" |
| | | width="70%" |
| | | > |
| | | <avue-crud |
| | | ref="businessCrud" |
| | | :data="businessData" |
| | | :option="businessOption" |
| | | :table-loading="businessLoading" |
| | | @search-change="businessHandleSearch" |
| | | @search-reset="businessHandleReset" |
| | | @row-click="businessRowClick" |
| | | > |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="businessSaveHandler">确 定</el-button> |
| | | <el-button @click="businessEmpty">清 空</el-button> |
| | | <el-button @click="businessVisible = false">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 链接类型对话框 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="linkTypeVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="链接类型选择" |
| | | width="70%" |
| | | > |
| | | <avue-crud |
| | | ref="linkTypeCrud" |
| | | :data="linkTypeData" |
| | | :option="linkTypeOption" |
| | | :table-loading="linkTypeLoading" |
| | | @search-change="linkHandleSearch" |
| | | @search-reset="linkHandleReset" |
| | | @row-click="linkRowClick" |
| | | > |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="linkEmpty">清 空</el-button> |
| | | <el-button @click="linkTypeVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="linkSaveHandler">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="addSaveHandler">确 定</el-button> |
| | |
| | | ] |
| | | }, |
| | | dialogTitle: "", |
| | | businessRow: {}, |
| | | linkRow: {}, |
| | | linkDataSearch: [], |
| | | businessSearchParams: {}, |
| | | linkTypeSearchParams: {}, |
| | | businessLoading: false, |
| | | linkTypeLoading: false, |
| | | businessVisible: false, |
| | | linkTypeVisible: false, |
| | | businessData: [], |
| | | linkTypeData: [], |
| | | businessOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | searchMenuSpan: 8, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | searchLabelWidth: 100, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '业务类型名', |
| | | prop: 'name', |
| | | sortable: true, |
| | | search: true |
| | | }, |
| | | { |
| | | label: '标签', |
| | | prop: 'label', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '父类', |
| | | prop: 'fName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '版本规则', |
| | | prop: 'revRuleName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '生命周期', |
| | | prop: 'lifeCycle', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | linkTypeOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | searchMenuSpan: 8, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | searchLabelWidth: 100, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '链接类型名', |
| | | prop: 'name', |
| | | sortable: true, |
| | | search: true |
| | | }, |
| | | ] |
| | | }, |
| | | tableData: [], |
| | | option: { |
| | | ...basicOption, |
| | |
| | | }, |
| | | addVisible: false, |
| | | addLoading: false, |
| | | referValueDic:[], |
| | | showEnumSwitch:false, |
| | | form: { |
| | | id: "", |
| | | name: "", |
| | |
| | | this.tableData = data; |
| | | this.page.total = res.data.total; |
| | | this.tableLoading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }); |
| | | //获取业务类型数据 |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => ({ |
| | | label: item.name, |
| | | value:item.name, |
| | | desc:item.label |
| | | })); |
| | | this.businessData = data; |
| | | }) |
| | | //获取链接类型数据 |
| | | getAllLtName().then(res => { |
| | | const data = res.data.data.map(item => ({ |
| | | label: item, |
| | | value:item |
| | | })); |
| | | this.linkTypeData = data; |
| | | }) |
| | | }, |
| | | |
| | | // 表格头部刷新 |
| | |
| | | }, |
| | | |
| | | // 搜索 |
| | | handleSearch(params, done) { |
| | | handleSearch(params, done) {debugger; |
| | | this.searchParams = { |
| | | "conditionMap[id]": "*" + params.id + "*" |
| | | }; |
| | |
| | | }, |
| | | // 值域类型切换 |
| | | attributeSelectTypeChange() { |
| | | this.form.referValue = ''; // 切换值域类型 清空当前参照 |
| | | this.$forceUpdate(); // 强制更新form组件 |
| | | this.form.referValue = null; // 切换值域类型 清空当前参照 |
| | | }, |
| | | |
| | | // 选择参照 |
| | | referFormFocusHandler() { |
| | | const handlers = { |
| | | business: () => { |
| | | this.businessVisible = true; |
| | | this.businessLoading = true; |
| | | this.businessGetTable(); |
| | | }, |
| | | link: () => { |
| | | this.linkTypeVisible = true; |
| | | this.linkTypeLoading = true; |
| | | this.linkGetTable(); |
| | | } |
| | | }; |
| | | |
| | | const {attributeSelectType} = this.form; |
| | | const handler = handlers[attributeSelectType]; |
| | | |
| | | if (handler) { |
| | | handler(); |
| | | } |
| | | ; |
| | | //参照类型数据变化 |
| | | referValueChange(data){ |
| | | this.showEnumSwitch=!data.value; |
| | | }, |
| | | |
| | | // 业务类型表格数据请求 |
| | | businessGetTable() { |
| | | getBizTypes(this.businessSearchParams).then(res => { |
| | | const data = res.data.data; |
| | | this.businessData = data; |
| | | this.businessLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 业务类型参照搜索 |
| | | businessHandleSearch(val, done) { |
| | | this.businessSearchParams = { |
| | | btmName: val.name |
| | | } |
| | | this.businessGetTable(); |
| | | done() |
| | | }, |
| | | |
| | | // 业务类型参照清空搜索 |
| | | businessHandleReset() { |
| | | this.businessSearchParams = {}; |
| | | this.businessGetTable(); |
| | | }, |
| | | |
| | | // 链接类型表格数据请求 |
| | | linkGetTable() { |
| | | getAllLtName(this.linkTypeSearchParams).then(res => { |
| | | const data = res.data.data.map(item => ({name: item})); |
| | | ; |
| | | this.linkTypeData = data; |
| | | this.linkDataSearch = data; |
| | | this.linkTypeLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 链接类型参照搜索 |
| | | linkHandleSearch(params, done) { |
| | | const {name} = params; |
| | | |
| | | if (!params.name) { |
| | | this.linkTypeData = this.linkDataSearch; |
| | | return done(); |
| | | } |
| | | ; |
| | | |
| | | this.linkTypeData = this.linkDataSearch.filter(item => { |
| | | console.log(item) |
| | | return item.name && item.name.includes(name); |
| | | }); |
| | | |
| | | done(); |
| | | }, |
| | | |
| | | // 链接类型参照清空搜索 |
| | | linkHandleReset() { |
| | | this.linkTypeData = this.linkDataSearch; |
| | | }, |
| | | |
| | | // 业务类型表格行点击 |
| | | businessRowClick(row) { |
| | | this.businessRow = row; |
| | | }, |
| | | |
| | | // 业务类型确定保存 |
| | | businessSaveHandler() { |
| | | if (func.isEmptyObject(this.businessRow)) { |
| | | this.$message.error('请选择一条数据!') |
| | | return; |
| | | } |
| | | |
| | | this.form.referValue = this.businessRow.name; |
| | | this.businessVisible = false; |
| | | }, |
| | | |
| | | // 业务类型清空 |
| | | businessEmpty() { |
| | | this.form.referValue = null; |
| | | this.businessVisible = false; |
| | | }, |
| | | |
| | | // 链接类型确定保存 |
| | | linkRowClick(row) { |
| | | this.linkRow = row; |
| | | }, |
| | | |
| | | // 业务类型确定保存 |
| | | linkSaveHandler() { |
| | | if (func.isEmptyObject(this.linkRow)) { |
| | | this.$message.error('请选择一条数据!') |
| | | return; |
| | | } |
| | | |
| | | this.form.referValue = this.linkRow.name; |
| | | this.linkTypeVisible = false; |
| | | }, |
| | | |
| | | // 链接类型清空 |
| | | linkEmpty() { |
| | | this.form.referValue = null; |
| | | this.linkTypeVisible = false; |
| | | }, |
| | | |
| | | // 关闭新增对话框 |
| | | addEscHandler() { |
| | | this.addVisible = false; |
| | |
| | | attributeSelectType: "business", |
| | | version: 1, |
| | | defaultValue: "",//默认值 |
| | | referValue: "", |
| | | referValue: null, |
| | | btmTypeId: "", |
| | | linkTypeName: "", |
| | | rangeValue: "" |
| | |
| | | addSaveHandler() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | if(this.form.attributeDataType === 'VTString'){ |
| | | if(!this.form.referValue){ |
| | | //参照类型没有值 |
| | | |
| | | }else { |
| | | this.form.enumSwitch=false; |
| | | this.form.rangeValue='' |
| | | } |
| | | } |
| | | |
| | | this.form.range = this.form.rangeValue ? this.form.rangeValue.replace(/\n/g, ';') : ''; |
| | | if (this.form.attributeSelectType === 'business') { |
| | | this.form.btmTypeId = this.form.referValue; |