Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs
| | |
| | | method: 'post', |
| | | data: btmType |
| | | }) |
| | | } |
| | | |
| | | export const btmPage = (current,size,params) => { |
| | | return request ({ |
| | | url: '/api/ubcs-omd/btm-type/page', |
| | | method: 'get', |
| | | params: { |
| | | current, |
| | | size, |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | import referConfigFormDialog from "@/components/code-dialog-page/referConfigFormDialog" |
| | | import businessAdd from "@/views/modeling/BusinessAdd" |
| | | import TableCrud from "@/components/Crud/Crud" |
| | | import originalAdd from "@/views/modeling/originalAdd" |
| | | |
| | | // å°å·¥å
·å½æ°æ·»å å°å
¨å± |
| | | import utilFunc from './util/func' |
| | |
| | | Vue.component('businessAdd',businessAdd) |
| | | Vue.component('attrCrud',attrCrud) |
| | | Vue.component('TableCrud',TableCrud) |
| | | Vue.component('originalAdd',originalAdd) |
| | | |
| | | |
| | | // å è½½ç¸å
³urlå°å |
| | |
| | | <el-container> |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud v-model="form" :option="option" :data="data" ref="crud" @on-load="onLoad" @row-save="rowSave" |
| | | @row-update="rowUpdate" :before-open="beforeOpen" @row-del="rowDel" :page.sync="page" |
| | | @refresh-change="refreshChange" @row-click="rowClick" |
| | | @selection-change="selectChange"> |
| | | <template slot-scope="{row,index,type}" slot="selInputForm"> |
| | | <div style="margin-left: 75px"> |
| | | <el-input v-model="form.text" :size="size" style="width: 210px" :readonly="true" @focus="selectBtmType" :disabled="referType.disable"></el-input> |
| | | </div> |
| | | </template> |
| | | <template slot="radio" |
| | | slot-scope="{row}"> |
| | | <el-radio v-model="selectRow" |
| | | :label="row.$index"> |
| | | </el-radio> |
| | | <avue-crud v-model="form" |
| | | ref="crud" |
| | | :option="option" |
| | | :data="data" |
| | | @on-load="onLoad" |
| | | :page.sync="page" |
| | | @refresh-change="refreshChange" |
| | | @row-click="rowClick"> |
| | | <template slot="radio" |
| | | slot-scope="{row}"> |
| | | <el-radio v-model="selectRow" |
| | | :label="row.$index"> |
| | | </el-radio> |
| | | </template> |
| | | <template slot="menu"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave">å é¤</el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="addSave">æ° å¢ |
| | | </el-button> |
| | | <el-button size="small" |
| | | plain |
| | | type="primary" |
| | |
| | | <avue-crud v-model="applyRange.model" :option="applyRange.option" :data="applyRange.data" class="applyRangeTable" |
| | | ></avue-crud> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="referType.display" append-to-body :title="referType.title" width="1000px"> |
| | | <original-range @rowchange="rowchange"></original-range> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialoghandelfalse">å æ¶</el-button> |
| | | <el-button type="primary" @click="dialoghandeltrue">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- <el-dialog :visible.sync="packageLinkBox" append-to-body title="æ¥ç龿¥ç±»å" width="1000px"> |
| | | <original-link @rowLinkchange="rowLinkchange"></original-link> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="Linkdialoghandelfalse">å æ¶</el-button> |
| | | <el-button type="primary" @click="Linkdialoghandeltrue">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> --> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-aside> |
| | | <basic-container class="itemForm"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="屿§é¡¹" name="attrTab"> |
| | | <el-form ref="form" :model="itemData" label-width="80px" style="height: 656px;"> |
| | | <el-form-item label="屿§ç¼ç "> |
| | | <el-input v-model="itemData.id" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="屿§åç§°"> |
| | | <el-input v-model="itemData.name" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="屿§ç±»å"> |
| | | <el-input v-model="itemData.typeValue" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ ç¾"> |
| | | <el-input v-model="itemData.hashtag" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é»è®¤å¼"> |
| | | <el-input v-model="itemData.defaultValue" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å
许为空"> |
| | | <el-switch v-model="itemData.nullable" :disabled="true"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦"> |
| | | <el-input v-model="itemData.maxLength" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°"> |
| | | <el-input v-model="itemData.description" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="åç
§" name="valueTab"> |
| | | <el-form ref="form" :model="itemData" label-width="80px" style="height: 656px;"> |
| | | <el-form-item label="åç
§ç±»å"> |
| | | <el-input v-model="itemData.referTypeValue" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åç
§åç§°"> |
| | | <el-input v-model="itemData.referToName" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-descriptions class="margin-top" :column="1" size="medium" border title="屿§é¡¹"> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | 屿§ç¼å· |
| | | </template> |
| | | {{ itemForm.itemData.id }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | 屿§åç§° |
| | | </template> |
| | | {{ itemForm.itemData.name }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | 屿§ç±»å |
| | | </template> |
| | | {{ itemForm.itemData.typeValue }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | æ ç¾ |
| | | </template> |
| | | {{ itemForm.itemData.hashtag }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | é»è®¤å¼ |
| | | </template> |
| | | {{ itemForm.itemData.defaultValue }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | å
许为空 |
| | | </template> |
| | | {{ itemForm.itemData.nullable }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | é¿åº¦ |
| | | </template> |
| | | {{ itemForm.itemData.maxLength }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | æè¿° |
| | | </template> |
| | | {{ itemForm.itemData.description }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <div style="height:15px"></div> |
| | | <el-descriptions class="margin-top" :column="1" size="medium" border title="屿§é
ç½®"></el-descriptions> |
| | | <el-tabs v-model="itemForm.activeName" @tab-click="handleClick" stretch="true" style="height:235px"> |
| | | <el-tab-pane label="åç
§" name="referTab"> |
| | | <el-descriptions class="margin-top" :column="1" size="medium" border> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | 使ç¨åç
§ |
| | | </template> |
| | | {{ itemForm.itemData.referTypeValue ? 'æ¯' : 'å¦' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | åç
§ç±»å |
| | | </template> |
| | | {{ itemForm.itemData.referTypeValue }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | åç
§åç§° |
| | | </template> |
| | | {{ itemForm.itemData.referToName }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æä¸¾" name="enumTab"> |
| | | <el-form ref="form" :model="itemData" label-width="80px" style="height: 656px;"> |
| | | <el-form-item label="ä½¿ç¨æä¸¾"> |
| | | <el-switch v-model="itemData.usingDict" :disabled="true"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="æä¸¾ç±»å"> |
| | | <el-input v-model="form.dictCode" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-descriptions class="margin-top" :column="1" :size="small" border> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | ä½¿ç¨æä¸¾ |
| | | </template> |
| | | {{ itemForm.itemData.usingDict ? 'æ¯' : 'å¦' }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | æä¸¾ç±»å |
| | | </template> |
| | | {{ itemForm.itemData.dictCode }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </basic-container> |
| | | </el-aside> |
| | | <originalAdd ref="originalAdd" :attribute="attribute" @refreshTable="refreshChange"></originalAdd> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | update, getPage, getApplyRange |
| | | } from "@/api/omd/OmdAttribute"; |
| | | |
| | | import { getDictionary } from "@/api/omd/enum"; |
| | | |
| | | export default { |
| | | name: "original", |
| | | data() { |
| | | return { |
| | | datas: [], |
| | | itemData: {}, |
| | | activeName: 'attrTab', |
| | | formAtrr: {}, |
| | | rouname: "", |
| | | referType: { |
| | | code: 'referType', |
| | | key: '', |
| | | value: '', |
| | | display: false, |
| | | title: '', |
| | | disable: true |
| | | }, |
| | | //å¼åä¸ææ¡æ°æ® |
| | | Typelist: [], |
| | | //çæ¬æ°æ® |
| | | banList: [], |
| | | // 屿§ç±»åä¸ææ¡æ°æ® |
| | | typeSelectList: [ |
| | | { |
| | | label: "ååå", |
| | | value: 0 |
| | | },], |
| | | // æ¯å¦ä¸ºç©º |
| | | nullable: [], |
| | | form: { |
| | | text: "" |
| | | }, |
| | | detailForm: { |
| | | text: "" |
| | | }, |
| | | return { |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 100 |
| | | }, |
| | | selectRow: '', |
| | | data: [ |
| | | |
| | | ], |
| | | data: [], |
| | | form:{}, |
| | | attribute: { |
| | | nullable: true |
| | | }, |
| | | option: { |
| | | height: "550px", |
| | | headerAlign: 'center', |
| | |
| | | index: true, |
| | | rowKey: 'id', |
| | | tabs: true, |
| | | stripe:true, |
| | | indexFixed: false, |
| | | menuWidth: 150, |
| | | highlightCurrentRow: true, |
| | | addBtn:false, |
| | | editBtn:false, |
| | | delBtn:false, |
| | | column: [{ |
| | | label: 'éæ©', |
| | | prop: 'radio', |
| | |
| | | prop: 'id', |
| | | align: 'left', |
| | | display: false, |
| | | width: 200 |
| | | width: 200, |
| | | required: true |
| | | }, { |
| | | label: '屿§åç§°', |
| | | prop: 'name', |
| | |
| | | display: false, |
| | | dicData: [{ |
| | | label: 'æ¯', |
| | | value: 0 |
| | | value: 'true' |
| | | }, { |
| | | label: 'å¦', |
| | | value: 1 |
| | | value: 'false' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | labelWidth: 132, |
| | | dicData: [{ |
| | | label: 'å¦', |
| | | value: 1 |
| | | value: 'false' |
| | | }, { |
| | | label: 'æ¯', |
| | | value: 0 |
| | | value: 'true' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | type: "textarea", |
| | | display: false |
| | | }, |
| | | ], |
| | | group: [ |
| | | { |
| | | label: '屿§é¡¹', |
| | | prop: "index", |
| | | column: [ |
| | | { |
| | | label: '屿§ç¼å·', |
| | | prop: 'id', |
| | | align: 'left', |
| | | }, |
| | | { |
| | | label: '屿§åç§°', |
| | | prop: 'name', |
| | | align: 'left', |
| | | }, |
| | | { |
| | | label: 'æ ç¾', |
| | | prop: 'hashtag', |
| | | hide: true |
| | | }, { |
| | | label: '屿§ç±»ååå
¸ç ', |
| | | prop: 'typeCode', |
| | | display: false, |
| | | value: 'attributeType' |
| | | }, |
| | | { |
| | | label: '屿§ç±»å', |
| | | prop: 'typeKey', |
| | | type: "select", |
| | | dicUrl: '/api/ubcs-omd/dict-biz/dictionary?code=attributeType', |
| | | dicType: 'String', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey' |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "è¯·éæ©å±æ§ç±»å", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'é»è®¤å¼', |
| | | prop: 'defaultValue', |
| | | }, |
| | | { |
| | | label: 'å
许为空', |
| | | prop: 'nullable', |
| | | type: 'switch', |
| | | hide: true, |
| | | labelWidth: 132, |
| | | dicData: [{ |
| | | label: 'å¦', |
| | | value: 1 |
| | | }, { |
| | | label: 'æ¯', |
| | | value: 0 |
| | | }] |
| | | }, |
| | | { |
| | | label: "é¿åº¦", |
| | | prop: "maxLength", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'description', |
| | | type: "textarea" |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | label: 'åç
§', |
| | | column: [ |
| | | { |
| | | label: 'åç
§ç±»å«', |
| | | prop: 'referTypeCode', |
| | | display: false, |
| | | hide: true |
| | | },{ |
| | | span: 12, |
| | | label: 'åç
§ç±»å«', |
| | | prop: 'referTypeKey', |
| | | type: "select", |
| | | change: this.selectChange, |
| | | dicUrl: '/api/ubcs-omd/dict-biz/dictionary?code=referType', |
| | | dicType: 'String', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey' |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "è¯·éæ©åç
§ç±»å«", |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | prop: "selInput", |
| | | placeholder: false, |
| | | readonly: true, |
| | | display: true, |
| | | formslot: true, |
| | | }, |
| | | // { |
| | | // label: "éæ©çæ¬", |
| | | // prop: "banben", |
| | | // type: 'select', |
| | | // value: 0, |
| | | // change: this.selchange, |
| | | // display: true, |
| | | // dicData: [ |
| | | // { |
| | | // label: 'å½åçæ¬æ¬¡', |
| | | // value: 0 |
| | | // }, |
| | | // { |
| | | // label: 'ææ°çæ¬æ¬¡', |
| | | // value: 1 |
| | | // } |
| | | // ] |
| | | // }, |
| | | { |
| | | //é»è®¤è¡¨æ ¼ææ§½ |
| | | prop: "default", |
| | | span: 24, |
| | | display: false |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'æä¸¾', |
| | | column: [ |
| | | { |
| | | label: 'æ¯å¦ä½¿ç¨æä¸¾', |
| | | prop: 'isnot', |
| | | type: 'switch', |
| | | hide: true, |
| | | labelWidth: 132, |
| | | span: 8, |
| | | dicData: [{ |
| | | label: 'å¦', |
| | | value: 1 |
| | | }, { |
| | | label: 'æ¯', |
| | | value: 0 |
| | | }] |
| | | }, |
| | | { |
| | | prop: 'text', |
| | | type: 'input', |
| | | placeholder: '请è¾å
¥å
容', |
| | | hide: true, |
| | | display: false |
| | | }, |
| | | { |
| | | prop: 'enumerationSelect', |
| | | type: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | hide: true, |
| | | span: 12, |
| | | dicData: [ |
| | | { |
| | | label: 'a', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: 'b', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: 'c', |
| | | value: 2 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'endesc', |
| | | type: "textarea", |
| | | labelWidth: 132, |
| | | }, |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | applyRange: { |
| | |
| | | }, |
| | | data: [], |
| | | display: false, |
| | | }, |
| | | itemForm:{ |
| | | itemData: {}, |
| | | activeName: 'referTab', |
| | | form:{} |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | created() { |
| | | const column =this.findObject(this.option.group,"referTypeKey") |
| | | console.log(column); |
| | | |
| | | }, |
| | | methods: { |
| | | rowLinkchange(row) { |
| | | this.form.text = row.name |
| | | }, |
| | | rowchange(row) { |
| | | this.form.text = row.name |
| | | }, |
| | | //å¼åç±»åéæ© |
| | | addHandle() { |
| | | this.packageBox = true |
| | | if (this.Typelist.value == 0) { |
| | | this.packageBox = true |
| | | this.packageLinkBox = false |
| | | } else if (this.Typelist.value == 1) { |
| | | this.packageBox = false |
| | | this.packageLinkBox = true |
| | | } |
| | | }, |
| | | // å¼åä¸å¡ç±»åå¯¹è¯æ¡åæ¶ |
| | | dialoghandelfalse() { |
| | | this.packageBox = false; |
| | | this.form.text = "" |
| | | }, |
| | | //å¼åä¸å¡ç±»åå¯¹è¯æ¡ç¡®å® |
| | | dialoghandeltrue() { |
| | | this.packageBox = false |
| | | }, |
| | | // å¼å龿¥ç±»åå¯¹è¯æ¡åæ¶ |
| | | Linkdialoghandelfalse() { |
| | | this.packageLinkBox = false; |
| | | this.form.text = "" |
| | | }, |
| | | //å¼å龿¥ç±»åå¯¹è¯æ¡ç¡®å® |
| | | Linkdialoghandeltrue() { |
| | | this.packageLinkBox = false |
| | | }, |
| | | selectChange(val) { |
| | | this.referType.key = val.value |
| | | if (val.value == 'businessType'){ |
| | | this.referType.value = 'ä¸å¡ç±»å' |
| | | } |
| | | if (val.value == 'linkType'){ |
| | | this.referType.value = '龿¥ç±»å' |
| | | } |
| | | if(val.value){ |
| | | this.referType.disable = false |
| | | } |
| | | }, |
| | | selchange(val) { |
| | | this.banList = val |
| | | console.log(val); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.pageParent, this.query); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | |
| | | done(); |
| | | |
| | | addSave(){ |
| | | this.$refs.originalAdd.showSubmitDialog = true; |
| | | this.$refs.originalAdd.attribute = {}; |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("ç¡®å®å°éæ©æ°æ®å é¤?", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!" |
| | | }); |
| | | this.onLoad(); |
| | | }); |
| | | updateSave(){ |
| | | this.$refs.originalAdd.showSubmitDialog = true; |
| | | this.$refs.originalAdd.attribute = this.attribute; |
| | | }, |
| | | rowSave(row, done) { |
| | | add(row).then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!" |
| | | }); |
| | | done(row) |
| | | this.onLoad() |
| | | }).catch((res) => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: res |
| | | }); |
| | | }) |
| | | }, |
| | | rowUpdate(row, index, done) { |
| | | update(row).then(() => { |
| | | this.onLoad() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "ä¿®æ¹æå!" |
| | | }); |
| | | done(row) |
| | | deleteSave(){ |
| | | remove(this.itemForm.itemData).then(res => { |
| | | this.$message.success("å 餿å"); |
| | | }) |
| | | }, |
| | | onLoad(page, params = {}) { |
| | |
| | | }) |
| | | }, |
| | | rowClick(row) { |
| | | this.itemData = row; |
| | | this.itemForm.itemData = row; |
| | | this.selectRow = row.$index; |
| | | |
| | | this.attribute = row; |
| | | } |
| | | ,selectBtmType(){ |
| | | this.referType.display = true; |
| | |
| | | }) |
| | | } |
| | | var oid = this.data[this.selectRow].oid; |
| | | console.log(oid); |
| | | getApplyRange(oid).then(res => { |
| | | this.applyRange.data = res.data.data; |
| | | }) |
| | | console.log("success"); |
| | | this.applyRange.display = true; |
| | | }, |
| | | applyRangeClose(){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-dialog title="å
æ°æ®" :visible.sync="showSubmitDialog" append-to-body @close="closeSubmitDialog" width="50%" |
| | | style="height: 115vh;"> |
| | | <!-- å
æ°æ®ç墿¹å¼¹çª --> |
| | | <el-form ref="form" :model="attribute" show-message="true" inline size="medium" label-suffix=":" |
| | | class="attributeForm" :rules="rules" @resetFields="resetAttributeForm" status-icon="true"> |
| | | <el-form-item label="屿§ç¼å·" label-width="100px" prop="id"> |
| | | <el-input v-model="attribute.id" maxlength="15" show-word-limit type="text"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="屿§åç§°" label-width="100px" prop="name"> |
| | | <el-input v-model="attribute.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="屿§ç±»å" label-width="100px" prop="typeValue"> |
| | | <el-select v-model="attribute.typeValue" placeholder="è¯·éæ©å±æ§ç±»å" @change="typeSelectChange"> |
| | | <el-option v-for="item in typeList" :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="attribute.hashtag"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é»è®¤å¼" label-width="100px"> |
| | | <el-input v-model="attribute.defaultValue"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å
许为空" label-width="100px"> |
| | | <el-switch v-model="attribute.nullable" active-text="å
许" inactive-text="ä¸å
许"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦" label-width="100px" prop="maxLength"> |
| | | <el-input-number v-model="attribute.maxLength" :min="1" :max="4000" :step="1" controls-position="right"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="精度" label-width="100px" v-if="attribute.typeValue == 'VTDouble'"> |
| | | <el-input-number v-model="attribute.precision" :min="1" :max="20" :step="1" controls-position="right" @change="changeNumber"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" label-width="100px"> |
| | | <el-input v-model="attribute.description" type="text"></el-input> |
| | | </el-form-item> |
| | | |
| | | <el-tabs v-model="activeName" @tab-click="handleClick" stretch="true"> |
| | | <el-tab-pane label="åç
§" name="referTab"> |
| | | <el-form-item label="åç
§ç±»å" label-width="100px"> |
| | | <el-select v-model="attribute.referTypeKey" @change="referTypeSelectChange"> |
| | | <el-option v-for="item in btmRefer.referTypeList" :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="attribute.referToName" @focus="openReferConfig" clearable="true" |
| | | :disabled="referToFlag" @clear="clearReferTo"> |
| | | <i slot="suffix" class="el-input__icon el-icon-search"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æä¸¾" name="enumTab"> |
| | | <el-form-item label="æä¸¾" label-width="100px"> |
| | | <el-input v-model="attribute.dictValue" @focus="openEnumConfig" clearable="true"> |
| | | <i slot="suffix" class="el-input__icon el-icon-search"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æä¸¾é¡¹" label-width="100px"> |
| | | |
| | | </el-form-item> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitAttribute">ç¡®å®</el-button> |
| | | <el-button @click="cancleSubmit">åæ¶</el-button> |
| | | </div> |
| | | <!-- éæ©åç
§æ¶çå¼¹çª --> |
| | | <el-dialog title="åç
§å表" :visible.sync="btmRefer.show" append-to-body @close="closeReferDialog" width="80%" |
| | | style="height: 115vh;"> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <span class="el-dialog__title"> {{ domain.treeOption.title }} </span> |
| | | <div style="height:20px;"></div> |
| | | <avue-tree id="domain" :data="domain.data" :option="domain.treeOption" @node-click="nodeClick" |
| | | class="businessTree" style="height: 418px"> |
| | | <span class="el-tree-node__label" slot-scope="{ node, data }"> |
| | | <span> |
| | | <i class="el-icon-star-on"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="btmTable" :option="btmRefer.option" :data="btmRefer.data" class="btmTable" @row-click="btmReferClick"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="btmRefer.selectRow" :label="row.$index"> |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | </el-container> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmBtm" size="small">ç¡®å®</el-button> |
| | | <el-button @click="cancleBtm" size="small">åæ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- éæ©æä¸¾æ¶çå¼¹çª --> |
| | | <el-dialog title="æä¸¾å表" :visible.sync="enumRefer.show" append-to-body @close="closeEnumDialog" width="70%" |
| | | style="height: 115vh;"> |
| | | <avue-crud ref="eunmTable" :option="enumRefer.option" :data="enumRefer.data" class="enumTable" @row-click="enumReferClick" :page.sync="enumRefer.enumPage"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="enumRefer.selectRow" :label="row.$index"> |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmEnum" size="small">ç¡®å®</el-button> |
| | | <el-button @click="cancleEnum" size="small">åæ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getDictionary,getParentList } from '@/api/omd/enum' |
| | | import { initTree,btmPage } from '@/api/omd/btmType' |
| | | import { add} from '@/api/omd/OmdAttribute' |
| | | export default { |
| | | name: 'originalAdd', |
| | | props: { |
| | | attribute: { |
| | | type: Object |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | showSubmitDialog: false, |
| | | // é»è®¤çé¡µç¾ |
| | | activeName: 'referTab', |
| | | // 屿§ç±»åä¸ææ¡æ°æ® |
| | | typeList: [], |
| | | // åç
§ä¸ææ¡æ¯å¦å¯ç¨ |
| | | referToFlag: true, |
| | | // è¡¨åæ ¡éªè§å |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: '请è¾å
¥å±æ§ç¼å·', trigger: 'blur' }, |
| | | { pattern: /^[A-Za-z]+$/, message: '屿§ç¼å·åªè½ä¸ºè±æ', trigger: 'blur' }, |
| | | { min: 2, max: 15, message: 'é¿åº¦å¨2å°15个å符', trigger: 'blur' } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '请è¾å
¥å±æ§åç§°', trigger: 'blur' } |
| | | ], |
| | | typeValue: [ |
| | | { required: true, message: 'è¯·éæ©å±æ§ç±»å', trigger: 'change' } |
| | | ], |
| | | maxLength: [ |
| | | { required: true, message: 'éè¦æå®é¿åº¦', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | // åç
§é¡µé¢è¡¨æ ¼é
ç½® |
| | | btmRefer: { |
| | | show: false, |
| | | btmPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 100 |
| | | }, |
| | | option: { |
| | | height: 405, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan: 32, |
| | | searchShowBtn: false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: '', |
| | | prop: 'radio', |
| | | width: 60, |
| | | hide: false |
| | | }, |
| | | { |
| | | label: 'è±æåç§°', |
| | | prop: 'id', |
| | | align: 'center', |
| | | searchSpan:8, |
| | | search: true, |
| | | }, { |
| | | label: '䏿åç§°', |
| | | prop: 'name', |
| | | align: 'center', |
| | | searchSpan:8, |
| | | search: true, |
| | | }] |
| | | }, |
| | | // åç
§é¡µé¢è¡¨æ ¼æ°æ® |
| | | data: [], |
| | | selectRow: '', |
| | | selectItem: {}, |
| | | referTypeList: [] |
| | | }, |
| | | // æä¸¾åç
§è¡¨æ ¼é
ç½® |
| | | enumRefer: { |
| | | show: false, |
| | | enumPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 100 |
| | | }, |
| | | option: { |
| | | height: 360, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | border: true, |
| | | reserveSelection: true, |
| | | searchMenuSpan: 32, |
| | | searchShowBtn: false, |
| | | highlightCurrentRow: true, |
| | | column: [{ |
| | | label: '', |
| | | prop: 'radio', |
| | | width: 60, |
| | | hide: false |
| | | },{ |
| | | label: 'æä¸¾ä»£å·', |
| | | prop: 'name', |
| | | align: 'center', |
| | | searchSpan:8, |
| | | search: true, |
| | | }, { |
| | | label: 'æä¸¾åç§°', |
| | | prop: 'label', |
| | | align: 'center', |
| | | searchSpan:8, |
| | | search: true, |
| | | }] |
| | | }, |
| | | // æä¸¾åç
§è¡¨æ ¼æ°æ® |
| | | data: [], |
| | | enumDictionary: [], |
| | | // éå®è¡ |
| | | selectRow: '', |
| | | selectItem: {} |
| | | }, |
| | | domain: { |
| | | data: [], |
| | | treeOption: { |
| | | defaultExpandAll: true, |
| | | title: 'é¢åæå¡æ ', |
| | | props: { |
| | | labelText: '', |
| | | label: 'name', |
| | | value: 'oid', |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.initAttributeTypeList(); |
| | | this.initAttributeReferTypeList(); |
| | | }, |
| | | methods: { |
| | | closeSubmitDialog() { |
| | | this.resetAttributeForm(); |
| | | this.showSubmitDialog = false; |
| | | }, |
| | | resetAttributeForm() { |
| | | this.attribute = { |
| | | nullable: true, |
| | | referTypeKey: '', |
| | | }; |
| | | this.referToFlag = true; |
| | | this.$refs.form.resetFields(); |
| | | }, |
| | | submitAttribute() { |
| | | add(this.attribute).then(res => { |
| | | this.$message.success("ä¿åæå"); |
| | | this.showSubmitDialog = false; |
| | | this.attribute = {}; |
| | | this.$emit('refreshTable'); |
| | | }); |
| | | |
| | | }, |
| | | cancleSubmit() { |
| | | this.closeSubmitDialog(); |
| | | }, |
| | | closeEnumDialog() { |
| | | this.cancleEnum(); |
| | | }, |
| | | closeReferDialog() { |
| | | this.cancleBtm(); |
| | | }, |
| | | confirmBtm() { |
| | | this.attribute.referToId = this.btmRefer.selectItem.oid; |
| | | this.attribute.referToName = this.btmRefer.selectItem.name; |
| | | this.btmRefer.show = false; |
| | | }, |
| | | cancleBtm() { |
| | | this.btmRefer.selectItem = {}; |
| | | this.btmRefer.show = false; |
| | | this.btmRefer.selectRow = ''; |
| | | }, |
| | | confirmEnum() { |
| | | this.attribute.usingDict = true; |
| | | this.attribute.dictCode = this.enumRefer.selectItem.name; |
| | | this.attribute.dictValue = this.enumRefer.selectItem.label; |
| | | this.enumRefer.show = false; |
| | | }, |
| | | cancleEnum() { |
| | | this.enumRefer.selectItem = {}; |
| | | this.enumRefer.show = false; |
| | | this.enumRefer.selectRow = ''; |
| | | }, |
| | | // åç
§åç§°è¾å
¥æ¡è·åç¦ç¹æ¶çäºä»¶ |
| | | openReferConfig() { |
| | | if (!this.attribute.referTypeKey) { |
| | | this.$message.warning('请å
éæ©åç
§çç±»å'); |
| | | this.referToFlag = true; |
| | | return; |
| | | } |
| | | this.domain.data = []; |
| | | this.btmRefer.data = []; |
| | | initTree().then(res => { |
| | | this.domain.data = res.data.data; |
| | | }) |
| | | this.btmRefer.show = true; |
| | | |
| | | }, |
| | | // åç
§ç±»åæ çç¹å»äºä»¶ |
| | | nodeClick(data) { |
| | | // åºåä¸å¡ç±»åçæ¥è¯¢å龿¥ç±»åçæ¥è¯¢ |
| | | if(this.attribute.referTypeKey == 'btmType'){ |
| | | btmPage(this.btmRefer.btmPage.currentPage,this.btmRefer.btmPage.pageSize,{domain:data.id}).then(res => { |
| | | this.btmRefer.data = res.data.data.records; |
| | | this.btmRefer.btmPage.total = res.data.data.total; |
| | | }) |
| | | } |
| | | if(this.attribute.referTypeKey == 'linkType'){ |
| | | |
| | | } |
| | | }, |
| | | // æä¸¾ç±»åè¾å
¥æ¡è·å¾ç¦ç¹æ¶çäºä»¶ |
| | | openEnumConfig() { |
| | | getParentList(this.enumRefer.enumPage.currentPage,this.enumRefer.enumPage.pageSize).then(res => { |
| | | this.enumRefer.enumPage.total = res.data.data.total; |
| | | this.enumRefer.data = res.data.data.records; |
| | | }) |
| | | this.enumRefer.show = true; |
| | | }, |
| | | // 屿§ç±»å䏿æ¡éæ©äºä»¶ |
| | | typeSelectChange(value) { |
| | | if (value == 'VTString') { |
| | | this.$set(this.attribute,"maxLength",150) |
| | | } else if (value == 'VTInteger') { |
| | | this.$set(this.attribute,"maxLength",50) |
| | | } else if (value == 'VTBoolean') { |
| | | this.$set(this.attribute,"maxLength",5) |
| | | } else if (value == 'VTDouble') { |
| | | this.$set(this.attribute,"maxLength",26) |
| | | this.$set(this.attribute,"precision",8) |
| | | } else if (value == 'VTLong') { |
| | | this.$set(this.attribute,"maxLength",150) |
| | | } else if (value == 'VTDate' || value == 'VTTime' || value == 'VTDateTime') { |
| | | this.$set(this.attribute,"maxLength",6) |
| | | } else { |
| | | this.$set(this.attribute,"maxLength",50) |
| | | } |
| | | this.attribute.typeCode = 'attributeType'; |
| | | this.attribute.typeKey = value; |
| | | }, |
| | | referTypeSelectChange(value) { |
| | | this.attribute.referTypeCode = 'attributeReferType'; |
| | | this.attribute.referTypeKey = value; |
| | | this.referToFlag = false; |
| | | }, |
| | | initAttributeTypeList() { |
| | | getDictionary({ code: 'attributeType' }).then(res => { |
| | | res.data.data.forEach(element => { |
| | | this.typeList.push( |
| | | { value: element.itemValue, label: element.itemName } |
| | | ) |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('屿§ç±»å没æ¾å°æè
æªå®ä¹') |
| | | }) |
| | | }, |
| | | initAttributeReferTypeList(){ |
| | | getDictionary({ code: 'attributeReferType' }).then(res => { |
| | | res.data.data.forEach(element => { |
| | | this.btmRefer.referTypeList.push( |
| | | { value: element.itemValue, label: element.itemName } |
| | | ) |
| | | }); |
| | | }).catch(() => { |
| | | this.$message.error('åç
§ç±»å没æ¾å°æè
æªå®ä¹') |
| | | }) |
| | | }, |
| | | btmReferClick(row){ |
| | | this.btmRefer.selectItem = row; |
| | | this.btmRefer.selectRow = row.$index; |
| | | }, |
| | | enumReferClick(row){ |
| | | this.enumRefer.selectItem = row; |
| | | this.enumRefer.selectRow = row.$index; |
| | | }, |
| | | // åç
§åç§°ç¹å»æ¸
餿°æ® |
| | | clearReferTo(){ |
| | | this.$delete(this.attribute,'referToId'); |
| | | this.$delete(this.attribute,'referToName'); |
| | | this.btmRefer.selectItem = {}; |
| | | this.btmRefer.selectRow = ''; |
| | | }, |
| | | handleClick(tab){ |
| | | // å 为åªè½åç
§åæä¸¾äºéä¸ãæä»¥å¨åæ¢çæ¶åæå±æ§ç»æ¸
空ã |
| | | this.$delete(this.attribute,'referTypeCode'); |
| | | this.$delete(this.attribute,'referTypeKey'); |
| | | this.$delete(this.attribute,'referTypeValue'); |
| | | this.$delete(this.attribute,'referToId'); |
| | | this.$delete(this.attribute,'referToName'); |
| | | this.$delete(this.attribute,'dictCode'); |
| | | this.$delete(this.attribute,'dictKey'); |
| | | this.$delete(this.attribute,'dictValue'); |
| | | this.$delete(this.attribute,'usingDict'); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .btmTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | |
| | | .enumTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | |
| | | .attributeForm>.el-form-item>.el-form-item__content>.el-input>.el-input__inner { |
| | | width: 200px; |
| | | } |
| | | </style> |
| | |
| | | * nacos dev å°å |
| | | */ |
| | | //String NACOS_DEV_ADDR = "dev.vci-tech.com:38848"; |
| | | String NACOS_DEV_ADDR = "localhost:8848"; |
| | | String NACOS_DEV_ADDR = "127.0.0.1:8848"; |
| | | |
| | | /** |
| | | * nacos prod å°å |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | |
| | | */ |
| | | @ApiModelProperty(value = "主é®") |
| | | @NotNull |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»ååç§° |
| | | */ |
| | | private String btmname; |
| | | private String btmName; |
| | | |
| | | /** |
| | | * æ¥æè
|
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId |
| | | private String oid; |
| | | |
| | | /** |
| | |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥å
æ°æ®å¯¹è±¡") |
| | | public R submit(@Valid @RequestBody AttributeDTO dto) { |
| | | public R submit(@RequestBody AttributeDTO dto) { |
| | | CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); |
| | | return R.status(attributeService.submit(dto)); |
| | | } |
| | |
| | | |
| | | private final String REGEXP = "^[A-Za-z]+$"; |
| | | |
| | | @Resource |
| | | private BtmTypeMapper btmTypeMapper; |
| | | |
| | | @Override |
| | | public boolean deleteLogic(@NotEmpty List<Long> ids) { |
| | | return false; |
| | |
| | | */ |
| | | @Override |
| | | public boolean submit(AttributeDTO dto) { |
| | | if (Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ |
| | | if (!Pattern.compile(REGEXP).matcher(dto.getId()).matches()){ |
| | | throw new VciBaseException("屿§åç§°{0}åªè½æ¯è±æ",new Object[]{dto.getId()}); |
| | | } |
| | | LambdaQueryWrapper<Attribute> wrapper = Wrappers.<Attribute>query().lambda().eq(Attribute::getId, dto.getId()); |
| | | Long count = baseMapper.selectCount((Func.isEmpty(dto.getId())) ? wrapper : wrapper.notIn(Attribute::getId, dto.getId())); |
| | | Long count = baseMapper.selectCount((Func.isEmpty(dto.getOid())) ? wrapper : wrapper.notIn(Attribute::getOid, dto.getOid())); |
| | | if (count > 0L) { |
| | | throw new ServiceException("屿§åå·²åå¨!"); |
| | | } |
| | | Attribute omdAttribute = BeanUtil.copy(dto, Attribute.class); |
| | | Attribute attribute = AttributeWrapper.build().copyBeforeSave(dto); |
| | | CacheUtil.clear(OmdCacheConstant.ATTR_CACHE); |
| | | return saveOrUpdate(omdAttribute); |
| | | return saveOrUpdate(attribute); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.vci.ubcs.omd.wrapper; |
| | | |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.dto.AttributeDTO; |
| | | import com.vci.ubcs.omd.entity.Attribute; |
| | | import com.vci.ubcs.omd.vo.*; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.cache.DictBizCache; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Override |
| | | public AttributeVO entityVO(Attribute entity) { |
| | | AttributeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, AttributeVO.class)); |
| | | vo.setTypeValue(DictBizCache.getValue(vo.getTypeCode(),vo.getTypeKey())); |
| | | vo.setTypeValue(EnumCache.getValue(vo.getTypeCode(),vo.getTypeKey())); |
| | | if (StringUtil.isNotBlank(vo.getReferTypeCode())){ |
| | | vo.setReferTypeValue(DictBizCache.getValue(vo.getReferTypeCode(),vo.getReferTypeKey())); |
| | | vo.setReferTypeValue(EnumCache.getValue(vo.getReferTypeCode(),vo.getReferTypeKey())); |
| | | } |
| | | vo.setDictValue(vo.getDictKey()); |
| | | vo.setTypeValue(vo.getTypeKey()); |
| | | if (StringUtil.isNotBlank(vo.getDictCode())) { |
| | | vo.setDictValue(EnumCache.getValue(vo.getDictCode(),vo.getDictKey())); |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | |
| | | public List<AttributeVO> listEntityVO(List<Attribute> list) { |
| | | return list.stream().map(this::entityVO).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * å¨ä¿åä¹åè¦è®¾ç½®é»è®¤å±æ§ |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | public Attribute copyBeforeSave(AttributeDTO dto) { |
| | | Attribute attribute = BeanUtil.copy(dto, Attribute.class); |
| | | Objects.requireNonNull(attribute); |
| | | String currentUser = AuthUtil.getUserAccount(); |
| | | Date now = new Date(); |
| | | if (StringUtil.isBlank(dto.getOid())) { |
| | | attribute.setBtmName(BtmTypeConstant.ATTRIBUTE); |
| | | attribute.setCreator(currentUser); |
| | | attribute.setCreateTime(now); |
| | | attribute.setOwner(currentUser); |
| | | attribute.setOid(VciBaseUtil.getPk()); |
| | | } |
| | | attribute.setLastModifier(currentUser); |
| | | attribute.setLastModifyTime(now); |
| | | attribute.setTs(now); |
| | | return attribute; |
| | | } |
| | | } |