Merge remote-tracking branch 'origin/master'
| | |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | |
| | | //æå¨åæ¥ |
| | | export const syncSearch = (params) => { |
| | | return request({ |
| | | url: 'ubcs-code/dockingManagement/searchItemDataForERP', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | <el-dialog title="æå¨åæ¥" :visible.sync="syncDialogBox"append-to-body @close="syncClose" top="200px"> |
| | | <p style="display: inline-block">æåæ´æ°æ¶é´ï¼</p> |
| | | <el-date-picker |
| | | style="width: 300px" |
| | | v-model="SyncValue" |
| | | type="date" |
| | | placeholder="éæ©æ¥æ" |
| | | format="yyyy å¹´ MM æ dd æ¥ HH æ¶ mm å ss ç§" |
| | | value-format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="syncClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitSync">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | <div class="bottom"> |
| | |
| | | applyGroupCode, |
| | | receiveEditApply, |
| | | applySaveCode, |
| | | exportGroupCodeExcel |
| | | exportGroupCodeExcel, |
| | | syncSearch |
| | | } from "@/api/GetItem"; |
| | | import {processTS, changeStatus} from "@/api/template/setPersonnel" |
| | | import {listCodeAttributeByClassId} from "@/api/integration/integration.js"; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //æå¨åæ¥model |
| | | SyncValue:'', |
| | | syncDialogBox:false, |
| | | isTimeStatus: false, |
| | | isTimeName: '', |
| | | dateValue: "", |
| | |
| | | if (uniqueFlag === 'excelGroupCode') return this.excelGroupCode() |
| | | //éå¢ç 导å
¥ |
| | | if (uniqueFlag === 'importGroupCode') return this.importGroupCode("groupCode") |
| | | //æå¨åæ¥ |
| | | if (uniqueFlag === 'manualSyncing') return this.manualSyncing("groupCode") |
| | | }); |
| | | }, |
| | | //æå¨åæ¥ |
| | | manualSyncing(){ |
| | | this.syncDialogBox = true; |
| | | }, |
| | | //æå¨åæ¥å
³é |
| | | syncClose(){ |
| | | this.syncDialogBox = false; |
| | | }, |
| | | //æå¨åæ¥ç¡®å® |
| | | submitSync(){ |
| | | if(this.SyncValue){ |
| | | syncSearch({enDate:this.SyncValue}).then(res=>{ |
| | | this.$message.success('忥æåï¼') |
| | | this.syncDialogBox = false; |
| | | }) |
| | | }else { |
| | | this.$message.warning('è¯·éæ©æåæ´æ°æ¶é´ï¼') |
| | | } |
| | | }, |
| | | //éå¢ç 导å
¥ |
| | | importGroupCode(type) { |
| | | this.batchImportData.visible = true |
| | | this.batchImportData.type = type |
| | |
| | | }, |
| | | computed: {}, |
| | | mounted() {}, |
| | | created() {}, |
| | | created() { |
| | | this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1; |
| | | }, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ |
| | | visible() { |
| | |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,true); |
| | | }); |
| | | |
| | | //æ·»å âæ¥çå
¨é¨ç¦ç¨æ¡ä»¶â |
| | | if (item.code === "classify_view") { |
| | | this.$set(this.classifyAuthData[index].authButton, "allDisabled", true); |
| | | console.log(this.classifyAuthData[index].authButton.allDisabled) |
| | | } |
| | | |
| | | } else { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,false); |
| | | }); |
| | | |
| | | if(item.code === "classify_view"){ |
| | | this.classifyAuthData[index].authButton.allDisabled = false; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | //æ·»å âæ¥çå
¨é¨ç¦ç¨æ¡ä»¶â |
| | | if (this.classifyAuthData) { |
| | | this.classifyAuthData.forEach((classkey, classIndex) => { |
| | | if (classkey.authButton.classify_view) { |
| | | this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true); |
| | | } else { |
| | | this.classifyAuthData[classIndex].authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //强å¶å·æ°è¡¨æ ¼ |
| | | this.itemKey = uuidv4(); |
| | | }); |
| | |
| | | this.$message.warning("å½åç§æ·ä¸åå¨è§è²ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | // console.log('this.roleList', this.roleList) |
| | | this.addIndex++; //èªå®ä¹çææ·»å è¡ä¸æ |
| | | |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex); |
| | | this.addIndex++; //èªå®ä¹çææ·»å è¡ä¸æ |
| | | }, |
| | | // å é¤è¡ |
| | | subClassifyAuth() { |
| | |
| | | this.$message.warning("è§è²åå类已ç»åå¨ï¼è¯·éæ°é
ç½®ï¼"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | let flag = false; |
| | | this.classifyAuthData.forEach((item) => { |
| | | let itemButtonList = []; |
| | |
| | | Vue.set(item, data, true); |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //æ·»å è¡ä¸æ çäºclassifyAuthDataçé¿åº¦-1 |
| | | this.roleHandlerMethods(authData.roleId, "create", index); |
| | | // console.log('index', index) |
| | | }); |
| | |
| | | <el-checkbox |
| | | v-if="item.type === 'checkbox'" |
| | | v-model="row[item.prop]" |
| | | @change="checkBoxToChangeTheEvent(row[item.prop],item.code)" |
| | | :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]"> |
| | | :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]" |
| | | @change="checkBoxToChangeTheEvent(row[item.prop],item.code,row,item.prop)"> |
| | | </el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | default: false, |
| | | }, |
| | | // å½åç¹å»çèç¹ |
| | | TreeNode:{ |
| | | type:Object |
| | | TreeNode: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | this.loadAuthPage(); |
| | | } |
| | | }, |
| | | classifyAuthData(newval){ |
| | | |
| | | this.addIndex = newval.length <= 0 ? 0 :newval.length-1; |
| | | console.log(this.addIndex) |
| | | } |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | checkBoxToChangeTheEvent(check,code){ |
| | | // console.log(check,code) |
| | | // if(code === "data_view" && check){ |
| | | // |
| | | // } |
| | | checkBoxToChangeTheEvent(check, code, row, id) { |
| | | if (code === "data_view") { |
| | | row.checkTheStatus = check; |
| | | } else if (!row.checkTheStatus) { |
| | | this.$message.warning('请å
å¾éæ¥çæé®ï¼'); |
| | | // 卿¡ä»¶ä¸æ»¡è¶³æ¶å°å¤éæ¡ç¶æè®¾ç½®ä¸ºfalse |
| | | row[id] = false; |
| | | } |
| | | |
| | | if (!row.checkTheStatus) { |
| | | this.classifyAuthButton.forEach(key => { |
| | | // æ¥ç为falseæ¶å°ææå¤éæ¡ç¶æè®¾ç½®ä¸ºfalse |
| | | row[key.id] = false; |
| | | }); |
| | | } |
| | | }, |
| | | // å
³éå¯¹è¯æ¡ |
| | | closeDialog() { |
| | |
| | | const filteredItems = this.classifyAuthButton.filter(item => |
| | | !res.data.data.some(x => x.id === item.id) |
| | | ); |
| | | |
| | | //åè¡¨æ ¼åè¿è¡å¯¹æ¯ |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | const isMatched = filteredItems.some((x) => x.id === item.prop); |
| | |
| | | if (this.classifyAuthData[index]) { |
| | | if (isMatched) { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,true); |
| | | this.$set(this.classifyAuthData[index].authButton, item.code, true); |
| | | |
| | | //æ·»å âæ¥çå
¨é¨ç¦ç¨æ¡ä»¶â |
| | | if (item.code === "data_view") { |
| | | this.$set(this.classifyAuthData[index].authButton, "allDisabled", true); |
| | | } |
| | | }); |
| | | |
| | | } else { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,false); |
| | | this.$set(this.classifyAuthData[index].authButton, item.code, false); |
| | | }); |
| | | if(item.code === "data_view"){ |
| | | this.classifyAuthData[index].authButton.allDisabled = false; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //æ·»å âæ¥çâç¦ç¨ |
| | | if (this.classifyAuthData) { |
| | | this.classifyAuthData.forEach((classkey, classIndex) => { |
| | | if (classkey.authButton.classify_view) { |
| | | this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true); |
| | | } else { |
| | | this.classifyAuthData[classIndex].authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } |
| | | //强å¶å·æ°è¡¨æ ¼ |
| | | this.itemKey = uuidv4(); |
| | | }); |
| | |
| | | if (isMatched) { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = true; |
| | | if (!currentRow.authButton.classify_view) { |
| | | if (!currentRow.authButton.data_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } else { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = false; |
| | | if (!currentRow.authButton.classify_view) { |
| | | if (!currentRow.authButton.data_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | |
| | | this.$message.warning("å½åç§æ·ä¸åå¨è§è²ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | this.addIndex++; //èªå®ä¹çææ·»å è¡ä¸æ |
| | | |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | | authButton:{}, |
| | | authButton: {}, |
| | | uuid: uuidv4(),//çæå¯ä¸çid, |
| | | index: this.addIndex, |
| | | } |
| | |
| | | return; |
| | | } |
| | | // console.log(form) |
| | | }else{ |
| | | } else { |
| | | // ä¸ºç©ºè¯ææ¯æ¸
空ææå表 |
| | | form.isCLear = true; |
| | | } |
| | |
| | | roleData: authData.roleId, |
| | | classifyItem: this.classifyData.label, |
| | | index: index, |
| | | authButton:{}, |
| | | authButton: {}, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | //å°æé®è®¾ç½®è¿å» |
| | |
| | | Vue.set(item, data, true); |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //æ·»å è¡ä¸æ çäºclassifyAuthDataçé¿åº¦-1 |
| | | this.roleHandlerMethods(authData.roleId, 'create', index) |
| | | }) |
| | | } |
| | |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: 690px;overflow: auto"> |
| | | <div style="height: calc(100vh - 242px);overflow: auto"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | |
| | | import cloneOtherBasicSecDialog from "@/components/code-dialog-page/cloneOtherBasicSecDialog" |
| | | import advancedQuery from "@/components/advanced-query/advancedQuery" |
| | | import businessAdd from "@/views/modeling/BusinessAdd" |
| | | import businessEdit from "@/views/modeling/BusinessEdit" |
| | | import VciMasterCrud from "@/components/MasterCrud/VciMasterCrud" |
| | | import originalAdd from "@/views/modeling/originalAdd" |
| | | import FormTemplateDialog from "@/components/FormTemplate/index" |
| | |
| | | Vue.component('referConfigDialog',referConfigDialog) |
| | | Vue.component('advancedQuery',advancedQuery) |
| | | Vue.component('businessAdd',businessAdd) |
| | | Vue.component('businessEdit',businessEdit) |
| | | Vue.component('attrCrud',attrCrud) |
| | | Vue.component('VciMasterCrud',VciMasterCrud) |
| | | Vue.component('originalAdd',originalAdd) |
| | |
| | | <el-container> |
| | | <el-aside style="width: 300px"> |
| | | <basic-container class="businessTreeContainer"> |
| | | <div class="app"> |
| | | <div class="app"style="overflow: auto;height: 84.3vh;"> |
| | | <div style="display: flex;margin-bottom: 10px;justify-content: space-around;"> |
| | | <el-button v-if="permissionList.addBtn" plain size="mini" type="primary" |
| | | @click="businessAdd"> |
| | |
| | | type="primary" @click="selectFromTable"> ä»å·²æä¸è·å |
| | | </el-button> |
| | | </div> |
| | | <avue-tree :data="treeData" :option="treeOption" class="businessTree" style="height: 70.3vh" |
| | | <avue-tree :data="treeData" :option="treeOption" class="businessTree" style="height: 74.3vh" |
| | | @node-click="nodeClick"> |
| | | <template slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" |
| | |
| | | </template> |
| | | {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }} |
| | | </el-descriptions-item> |
| | | <!-- <el-descriptions-item :contentStyle="descriptionOption.contentStyle"--> |
| | | <!-- :labelStyle="descriptionOption.labelStyle">--> |
| | | <!-- <template slot="label">--> |
| | | <!-- <i :class="icons.view"></i>--> |
| | | <!-- è§å¾--> |
| | | <!-- </template>--> |
| | | <!-- <el-tag v-if="obj.viewText" size="small">--> |
| | | <!-- {{ obj.viewText }}--> |
| | | <!-- </el-tag>--> |
| | | <!-- <span v-else></span>--> |
| | | <!-- </el-descriptions-item>--> |
| | | <!-- <el-descriptions-item> |
| | | <template slot="label"> |
| | | <i class="el-icon-arrow-down"></i> |
| | | å®ç°ç±» |
| | | </template> |
| | | {{ obj.implClass }} |
| | | </el-descriptions-item> --> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog :visible="ref.visible" append-to-body title="仿°æ®åºä¸æ·»å " top="9vh" width="700px" |
| | | <el-dialog :visible="ref.visible" append-to-body title="仿°æ®åºä¸æ·»å " top="4vh" width="600px" |
| | | @close="dialoghandelfalse"> |
| | | éæ©é¢åï¼ |
| | | <el-select v-model="domain" placeholder="è¯·éæ©" size="small" @change="refOnLoad"> |
| | |
| | | <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type" |
| | | @refreshTable="initTreeOnLoad"> |
| | | </business-add> |
| | | <business-edit ref="btmEdit" :btmType="addOption.btmEditType" :domainOption="domainOptions" :icons="icons" :type="type" |
| | | @refreshTable="initTreeOnLoad"> |
| | | |
| | | </business-edit> |
| | | </el-container> |
| | | </template> |
| | | <script> |
| | |
| | | }, |
| | | addOption: { |
| | | btmType: {}, |
| | | btmEditType:{} |
| | | }, |
| | | loadOption: { |
| | | height: 'auto', |
| | |
| | | tabs: true, |
| | | addBtn: false, |
| | | menu: false, |
| | | refreshBtn:false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | |
| | | if (data.oid) { |
| | | getDetail(data.oid).then(res => { |
| | | this.obj = res.data.data; |
| | | this.addOption.btmEditType = res.data.data; |
| | | }) |
| | | } else { |
| | | this.$message.warning('请ç¹å»åèç¹'); |
| | |
| | | this.$message.warning("è¯·éæ©ä¸æ¡å¶åèç¹çä¸å¡ç±»å"); |
| | | return; |
| | | } |
| | | const json = JSON.stringify(this.obj); |
| | | this.$refs.btmAdd.btmType = JSON.parse(json); |
| | | this.$refs.btmAdd.showSubmitDialog = true; |
| | | // const json = JSON.stringify(this.obj); |
| | | // this.$refs.btmAdd.btmType = JSON.parse(json); |
| | | this.$refs.btmEdit.showSubmitDialog = true; |
| | | this.type = 'edit' |
| | | this.ifRefreshBtmAddRefresh(); |
| | | }, |
| | |
| | | } |
| | | |
| | | |
| | | .app { |
| | | overflow-y: auto; |
| | | height: 84.3vh; |
| | | } |
| | | |
| | | |
| | | // |
| | | //.app::-webkit-scrollbar { |
| | |
| | | <el-dialog |
| | | title="ä¸å¡ç±»å" |
| | | :visible.sync="showSubmitDialog" |
| | | v-loading="loading" |
| | | append-to-body |
| | | @close="closeSubmitDialog" |
| | | width="70%" |
| | |
| | | <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" |
| | | :rules="rules" @resetFields="resetForm" status-icon="true"> |
| | | <el-form-item label="è±æåç§°" label-width="100px" required="true" prop="id"> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="type !== 'add'"></el-input> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="false"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="䏿åç§°" label-width="100px"> |
| | | <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> |
| | |
| | | }, |
| | | type: { |
| | | type:String, |
| | | }, |
| | | btmEditType:{ |
| | | type:Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | watch: { |
| | | type: { |
| | | handler(newval, oldval) { |
| | | // console.log('çå¬', newval) |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | loading:false, |
| | | showSubmitDialog: false, |
| | | option: { |
| | | height: "330px", |
| | |
| | | // å
³éç»ä»¶å¼¹çª |
| | | closeSubmitDialog() { |
| | | this.showSubmitDialog = false; |
| | | this.btmType.attributes = []; |
| | | this.btmType = {}; |
| | | this.attrRef.selectData = []; |
| | | this.attrRef.queryNotIn = null; |
| | | this.resetForm(); |
| | | // this.btmType.attributes = []; |
| | | // this.btmType = {}; |
| | | // this.attrRef.selectData = []; |
| | | // this.attrRef.queryNotIn = null; |
| | | // this.resetForm(); |
| | | }, |
| | | // å
³é屿§æ± æ¥è¯¢å¼¹çª |
| | | closeAttrDialog() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | title="ä¸å¡ç±»å" |
| | | :visible.sync="showSubmitDialog" |
| | | v-loading="loading" |
| | | append-to-body |
| | | @close="closeSubmitDialog" |
| | | width="70%" |
| | | top="6vh" |
| | | style="height: 115vh;" |
| | | > |
| | | <el-form ref="form" :model="btmEditType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" |
| | | :rules="rules" @resetFields="resetForm" status-icon="true"> |
| | | <el-form-item label="è±æåç§°" label-width="100px" prop="id"> |
| | | <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="true"></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 label="æå±é¢å" label-width="100px" prop="domain" class="domainSelect"> |
| | | <el-select placeholder="è¯·éæ©é¢å" v-model="btmType.bizDomain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" |
| | | :label="item.label" :value="item.value" :key="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" |
| | | class="revisionRule" |
| | | @focus="openRevision" |
| | | clearable |
| | | @clear="clearRevision" |
| | | :suffix-icon="icons.referType" |
| | | placeholder="è¯·éæ©ï¼ç空åä¸è¿è¡ç®¡ç"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="çå½å¨æ" label-width="100px"> |
| | | <el-input v-model="btmType.lifeCycleName" |
| | | :prefix-icon="icons.lifeCycle" |
| | | class="lifeCycle" |
| | | @focus="openLifeCycle" |
| | | clearable |
| | | @clear="clearLifeCycle" |
| | | :suffix-icon="icons.referType" |
| | | placeholder="è¯·éæ©ï¼ç空åä¸è¿è¡ç®¡ç"> |
| | | </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 label="æè¿°" label-width="100px" class="description"> |
| | | <el-input v-model="btmType.description" |
| | | :prefix-icon="icons.desc" |
| | | class="descClass" |
| | | id="descId" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <avue-crud :option="option" |
| | | :data="btmType.attributes" |
| | | :page.sync="page" |
| | | ref="attrTable"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button type="danger" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | @click="rowAdd()">屿§éæ© |
| | | </el-button> |
| | | </template> |
| | | <template slot="attrDataTypeText" slot-scope="{row}"> |
| | | <el-tag>{{ row.attrDataTypeText }}</el-tag> |
| | | </template> |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row,index)">ç¼è¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit" |
| | | @click="removeFormAttrTable(row,index)">ç§»é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-check" size="small" type="text" v-if="row.$cellEdit" @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 title="屿§æ± " |
| | | :visible="attrRef.visible" |
| | | append-to-body |
| | | @close="closeAttrDialog" |
| | | width="80%" |
| | | > |
| | | <avue-crud class="attrRef" |
| | | :option="attrRef.option" |
| | | :data="attrRef.data" |
| | | :page.sync="attrRef.page" |
| | | ref="attrRef" |
| | | @on-load="attrRefOnLoad" |
| | | @search-change="attrRefSearch" |
| | | @selection-change="selectionChange" |
| | | v-loading="attrRef.loading"> |
| | | <template slot="typeValue" slot-scope="scope"> |
| | | <el-tag>{{ 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 title="è¯·éæ©çæ¬è§å" |
| | | :visible.sync="revisionRef.visible" |
| | | append-to-body |
| | | width="80%"> |
| | | |
| | | <avue-crud class="revisionRef" |
| | | :option="revisionRef.option" |
| | | :data="revisionRef.data" |
| | | :page.sync="revisionRef.page" |
| | | ref="revisionRef" |
| | | @row-click="revisionClick" |
| | | v-loading="revisionRef.loading" |
| | | @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 title="è¯·éæ©çå½å¨æ" |
| | | :visible.sync="lifeCycleRef.visible" |
| | | append-to-body |
| | | width="80%"> |
| | | |
| | | <avue-crud class="lifeCycleRef" |
| | | :option="lifeCycleRef.option" |
| | | :data="lifeCycleRef.data" |
| | | :page.sync="lifeCycleRef.page" |
| | | ref="lifeCycleRef" |
| | | @row-click="lifeCycleClick" |
| | | v-loading="lifeCycleRef.loading" |
| | | @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, 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, |
| | | }, |
| | | btmEditType:{ |
| | | type:Object, |
| | | default: {} |
| | | } |
| | | }, |
| | | watch: { |
| | | }, |
| | | 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 |
| | | } |
| | | ] |
| | | }, |
| | | 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'} |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | // å
³éç»ä»¶å¼¹çª |
| | | 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; |
| | | }); |
| | | setTimeout(() => { |
| | | this.attrRef.loading = false; |
| | | }, 600) |
| | | this.$nextTick(() => { |
| | | this.$refs.attrRef.refreshTable(); |
| | | }); |
| | | }, |
| | | // 屿§æ± æ£ç´¢ |
| | | 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.attrRef.data = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // 忶屿§æ± å¾é |
| | | cancleSelectAttr() { |
| | | this.attrRef.selectData = []; |
| | | this.closeAttrDialog(); |
| | | }, |
| | | // æ·»å ä¸å¡ç±»å |
| | | submitBtmType() { |
| | | // console.log(this.btmType); |
| | | if (!this.btmType.attributes){ |
| | | this.$message.warning("è¿æ²¡æä¸ºä¸å¡ç±»å鿩屿§"); |
| | | return; |
| | | }else{ |
| | | let nullFlag = false; |
| | | this.btmType.attributes.forEach(item => { |
| | | if (!item.name){ |
| | | this.$message.warning("第" + (item.$index+1) + "è¡ç䏿åç§°ä¸è½ä¸ºç©º"); |
| | | nullFlag = true; |
| | | return; |
| | | } |
| | | }) |
| | | if (nullFlag){ |
| | | return; |
| | | } |
| | | |
| | | } |
| | | add(this.btmType, true).then(res => { |
| | | // æ·»å 宿ï¼åè°ç¶ç»ä»¶çå·æ° |
| | | this.$message.success('ä¿åæå'); |
| | | 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; |
| | | }); |
| | | setTimeout(() => { |
| | | this.lifeCycleRef.loading = false; |
| | | }, 600) |
| | | 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; |
| | | this.cancelRevision(); |
| | | }, |
| | | // 确认éä¸çå½å¨æ |
| | | confirmLifeCycle() { |
| | | this.btmType.lifeCycleFlag = true; |
| | | this.btmType.lifeCycleId = this.lifeCycleRef.selectData.id; |
| | | this.btmType.lifeCycleName = this.lifeCycleRef.selectData.name; |
| | | 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; |
| | | }); |
| | | setTimeout(() => { |
| | | done(); |
| | | this.lifeCycleRef.loading = false; |
| | | }, 600); |
| | | this.$nextTick(() => { |
| | | this.$refs.lifeCycleRef.refreshTable(); |
| | | }); |
| | | }, |
| | | // åæ¶çæ¬è§åæç´¢ |
| | | 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> |
| | |
| | | <template> |
| | | <template> |
| | | <el-container> |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud v-model="form" ref="crud" :option="option" :data="data" @on-load="onLoad" :page.sync="page" :permission="permissionList" |
| | | @refresh-change="refreshChange" @row-click="rowClick" style="height: calc(100vh - 148px)"> |
| | | <avue-crud ref="crud" v-model="form" :data="data" :option="option" :page.sync="page" |
| | | :permission="permissionList" |
| | | style="height: calc(100vh - 148px)" |
| | | @on-load="onLoad" @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" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave(row,index)" v-if="permissionList.editBtn">ç¼è¾</el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave(row,index)" v-if="permissionList.delBtn">å é¤</el-button> |
| | | <el-button v-if="permissionList.editBtn" icon="el-icon-edit" size="small" type="text" |
| | | @click="updateSave(row,index)">ç¼è¾ |
| | | </el-button> |
| | | <el-button v-if="permissionList.delBtn" icon="el-icon-delete" size="small" type="text" |
| | | @click="deleteSave(row,index)">å é¤ |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave" v-if="permissionList.addBtn">æ° å¢ |
| | | </el-button> |
| | | <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen" v-if="permissionList.apply">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | <el-input placeholder="æå±æ§ç¼å·æ¥è¯¢" v-model="searchId" clearable prefix-icon="el-icon-search" class="attrSearch" |
| | | size="small" @change="doSearch" type="text"></el-input> |
| | | <el-button size="small" plain type="primary" icon="el-icon-search" @click="doSearch"> æç´¢</el-button> |
| | | <template slot="menuLeft"> |
| | | <div> |
| | | <el-button v-if="permissionList.addBtn" icon="el-icon-plus" size="small" type="primary" @click="addSave">æ° å¢ |
| | | </el-button> |
| | | <el-button v-if="permissionList.apply" icon="el-icon-zoom-in" plain size="small" type="primary" |
| | | @click="applyRangeOpen">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | <span style="width: 200px;display: inline-block"> |
| | | <el-select slot="prepend" v-model="oriValue" placeholder="è¯·éæ©" size="small"> |
| | | <el-option v-for="item in oriData" :key="item.prop" :label="item.label" :value="item.prop" |
| | | ></el-option> |
| | | </el-select> |
| | | </span> |
| | | <span> |
| | | <el-input v-model="searchId" class="attrSearch" clearable placeholder="请è¾å
¥å
容" |
| | | prefix-icon="el-icon-search" |
| | | size="small" type="text" @change="doSearch"></el-input> |
| | | <el-button icon="el-icon-search" plain size="small" type="primary" @click="doSearch"> æç´¢</el-button> |
| | | </span> |
| | | </div> |
| | | </template> |
| | | <template slot="typeValue" slot-scope="{row}"> |
| | | <el-tag>{{ row.typeValue }}</el-tag> |
| | |
| | | <avue-crud v-model="applyRange.model" :option="applyRange.option" :data="applyRange.data" class="applyRangeTable" |
| | | ></avue-crud> |
| | | </el-dialog> --> |
| | | <Versionpackage :rangeData="applyRangeData" ref="applyRange"></Versionpackage> |
| | | <Versionpackage ref="applyRange" :rangeData="applyRangeData"></Versionpackage> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-aside> |
| | | <basic-container class="itemForm"> |
| | | <div style="height: 44vh"> |
| | | <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> |
| | | {{ 'true' == 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> |
| | | <div style="height: 44vh"> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" 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> |
| | | {{ 'true' == 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> |
| | | <div style="height: 40vh"> |
| | | <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-descriptions :column="1" border class="margin-top" size="medium" title="屿§é
ç½®"></el-descriptions> |
| | | <el-tabs v-model="itemForm.activeName" stretch="true" style="height:235px" @tab-click="handleClick"> |
| | | <el-tab-pane label="åç
§" name="referTab"> |
| | | <el-descriptions class="margin-top" :column="1" size="medium" border> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium"> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | 使ç¨åç
§ |
| | |
| | | </el-descriptions> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="æä¸¾" name="enumTab"> |
| | | <el-descriptions class="margin-top" :column="1" :size="small" border> |
| | | <el-descriptions :column="1" :size="small" border class="margin-top"> |
| | | <el-descriptions-item> |
| | | <template slot="label"> |
| | | ä½¿ç¨æä¸¾ |
| | |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | <originalAdd ref="originalAdd" @refreshTable="refreshChange" :attribute="editAttribute"></originalAdd> |
| | | <originalAdd ref="originalAdd" :attribute="editAttribute" @refreshTable="refreshChange"></originalAdd> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | name: "original", |
| | | data() { |
| | | return { |
| | | oriData: [ |
| | | { |
| | | label: "屿§ç¼å·", |
| | | prop: "id", |
| | | align: "left", |
| | | display: false, |
| | | width: 200, |
| | | required: true |
| | | }, { |
| | | label: "屿§åç§°", |
| | | prop: "name", |
| | | align: "left", |
| | | display: false |
| | | } |
| | | ], |
| | | oriValue: "id", |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | editAttribute: {}, |
| | | applyRangeData: [], |
| | | option: { |
| | | height:'auto', |
| | | calcHeight:20, |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | headerAlign: "center", |
| | | border: true, |
| | | index: true, |
| | |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | column: [{ |
| | | label: "éæ©", |
| | | prop: "radio", |
| | |
| | | itemForm: { |
| | | itemData: {}, |
| | | activeName: "referTab", |
| | | enumInitFlag:false, |
| | | enumInitFlag: false, |
| | | referInitFlag: false, |
| | | form: {} |
| | | }, |
| | | searchId: '', |
| | | }; |
| | | }, |
| | | computed:{ |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList(){ |
| | | return{ |
| | | addBtn:this.vaildData(this.permission.modeling_original.original_add,false), |
| | | apply:this.vaildData(this.permission.modeling_original.original_applyopen,false), |
| | | delBtn:this.vaildData(this.permission.modeling_original.original_delete,false), |
| | | editBtn:this.vaildData(this.permission.modeling_original.original_edit,false), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.modeling_original.original_add, false), |
| | | apply: this.vaildData(this.permission.modeling_original.original_applyopen, false), |
| | | delBtn: this.vaildData(this.permission.modeling_original.original_delete, false), |
| | | editBtn: this.vaildData(this.permission.modeling_original.original_edit, false), |
| | | } |
| | | }, |
| | | }, |
| | |
| | | newAttr.nullable = true; |
| | | this.$refs.originalAdd.attribute = newAttr; |
| | | }, |
| | | updateSave(row,index) { |
| | | updateSave(row, index) { |
| | | this.selectRow = index; |
| | | var json = JSON.stringify(row); |
| | | this.editAttribute = JSON.parse(json); |
| | |
| | | this.$refs.originalAdd.referInitFlag = this.itemForm.referInitFlag; |
| | | // this.refreshChange() |
| | | }, |
| | | deleteSave(row,index) { |
| | | deleteSave(row, index) { |
| | | this.$confirm("å é¤å
æ°æ®å°æ æ³è¢«æ¢å¤, æ¯å¦ç»§ç»?", "æç¤º", { |
| | | iconClass: 'el-icon-question', |
| | | confirmButtonText: "ç¡®å®", |
| | |
| | | this.attribute = row; |
| | | this.checkUsingReferDict(row); |
| | | }, |
| | | checkUsingReferDict(row){ |
| | | if (row.referToId !== null && row.referToId !== ""){ |
| | | checkUsingReferDict(row) { |
| | | if (row.referToId !== null && row.referToId !== "") { |
| | | this.itemForm.activeName = 'referTab'; |
| | | this.itemForm.referInitFlag = true; |
| | | this.itemForm.enumInitFlag = false; |
| | | }else if (row.usingDict === 'true'){ |
| | | } else if (row.usingDict === 'true') { |
| | | this.itemForm.activeName = 'enumTab'; |
| | | this.itemForm.referInitFlag = false; |
| | | this.itemForm.enumInitFlag = true; |
| | |
| | | this.itemForm.itemData.dictValue = this.editAttribute.dictValue; |
| | | this.$refs.originalAdd.dictEnums = res.data.data; |
| | | }) |
| | | }else { |
| | | } else { |
| | | this.itemForm.activeName = 'referTab'; |
| | | this.itemForm.referInitFlag = true; |
| | | this.itemForm.enumInitFlag = false; |
| | |
| | | |
| | | }); |
| | | }, |
| | | doSearch(){ |
| | | var params = {"id_like":this.searchId}; |
| | | this.onLoad(this.page,params); |
| | | doSearch() { |
| | | |
| | | var params = {[this.oriValue + "_like"]: this.searchId}; |
| | | this.onLoad(this.page, params); |
| | | } |
| | | }, |
| | | components: { Versionpackage } |
| | | components: {Versionpackage} |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .applyRangeTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | .applyRangeTable > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | |
| | | .attrSearch { |
| | | width:201px; |
| | | width: 201px; |
| | | } |
| | | |
| | | .attrSearch > .el-input__inner { |
| | | width: 200px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.Scheduling; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | /** |
| | | * @author Vigi |
| | | */ |
| | | @Slf4j |
| | | public class NonWebRequestAttributes implements RequestAttributes { |
| | | |
| | | @Override |
| | | public Object getAttribute(String name, int scope) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void setAttribute(String name, Object value, int scope) { |
| | | // to do nothing |
| | | } |
| | | |
| | | @Override |
| | | public void removeAttribute(String name, int scope) { |
| | | // to do nothing |
| | | } |
| | | |
| | | @Override |
| | | public String[] getAttributeNames(int scope) { |
| | | return new String[0]; |
| | | } |
| | | |
| | | @Override |
| | | public void registerDestructionCallback(String name, Runnable callback, int scope) { |
| | | // to do nothing |
| | | } |
| | | |
| | | @Override |
| | | public Object resolveReference(String key) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getSessionId() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public Object getSessionMutex() { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.code.service.ICodeDuckingSyncService; |
| | | import com.vci.ubcs.code.service.UniversalInterfaceI; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import io.swagger.annotations.Scope; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | |
| | | @Value("${erp.item.isStart:false}") |
| | | public boolean ERP_ITEM_ISSTARE; |
| | | |
| | | @Value("${erp.item.btmName:XHDH}") |
| | | public String ERP_ITEM_BTMNAME; |
| | | |
| | | /** |
| | | * æ¯å¦åå§åå®æäº |
| | | */ |
| | |
| | | if(ERP_ITEM_ISSTARE && BooleanEnum.TRUE.getValue().equalsIgnoreCase(FINISH_INIT)) { |
| | | SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss."); |
| | | String time = formatter.format(new Date()); |
| | | codeDuckingSyncServiceI.saveItemDataSyncScheduing(ERP_ITEM_BTMNAME); |
| | | codeDuckingSyncServiceI.saveItemDataSyncScheduing(""); |
| | | String outInfo = "============ æ§è¡äºä»ERP项ç®ä»£å·/åå·ä»£å·æ°æ® end;"; |
| | | log.info(outInfo+time); |
| | | } |
| | |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import javafx.scene.control.TableRow; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * åæ¥éææå¡ |
| | | */ |
| | | private final ICodeDuckingSyncService codeDuckingSyncService; |
| | | |
| | | /*@Value("${erp.item.btmName:XHDH}") |
| | | private String ERP_ITEM_BTMNAME;*/ |
| | | |
| | | /**ç³»ç»éæçç³»ç»ä¿¡æ¯å表 |
| | | * @param queryObject åºç¡æ¥è¯¢å¯¹è±¡ï¼å
嫿¥è¯¢æ¡ä»¶ï¼åé¡µï¼æåºç |
| | |
| | | public R sendData(String oid){ |
| | | return codeDuckingSyncService.sendData(oid); |
| | | } |
| | | |
| | | /*** |
| | | * 项ç®åå·ä»£å·æ¥è¯¢åæ¥ |
| | | * @return |
| | | */ |
| | | @PostMapping("/searchItemDataForERP") |
| | | public R searchItemDataForERP(String endDate){ |
| | | try { |
| | | codeDuckingSyncService.saveItemDataSyncScheduing(endDate); |
| | | return R.success("忥æå"); |
| | | }catch (Throwable e){ |
| | | return R.fail("åæ¥å¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | R sendData(String oids); |
| | | |
| | | void saveItemDataSyncScheduing(String btmName); |
| | | void saveItemDataSyncScheduing(String endDate); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.thoughtworks.xstream.XStream; |
| | | import com.thoughtworks.xstream.io.xml.DomDriver; |
| | | import com.vci.ubcs.code.Scheduling.NonWebRequestAttributes; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.constant.MdmDuckingConstant; |
| | | import com.vci.ubcs.code.dto.CodeOrderDTO; |
| | |
| | | import com.vci.ubcs.code.webService.config.AttributeMapConfig; |
| | | import com.vci.ubcs.omd.feign.IBtmTypeClient; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.HttpUtils; |
| | |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import com.vci.ubcs.system.user.entity.User; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.map.CaseInsensitiveMap; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.BladeUser; |
| | |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.mock.web.MockHttpServletRequest; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.support.DefaultTransactionStatus; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.jws.WebMethod; |
| | |
| | | |
| | | @Value("${erp.item.systemId:ERP}") |
| | | public String systemId; |
| | | @Value("${erp.item.secName:åºå®ç 段}") |
| | | public String secName; |
| | | @Value("${erp.item.secValue:A}") |
| | | public String secValue; |
| | | |
| | | @Value("${erp.item.btmName:XHDH}") |
| | | public String btmName; |
| | | /** |
| | | * ä¸å¡ç±»åçæå¡ |
| | | */ |
| | |
| | | private MdmIOService mdmIOService; |
| | | @Resource |
| | | private IPasswordFreeLoginService passwordFreeLoginService; |
| | | @Resource |
| | | private WebServiceContext webServiceContext; |
| | | |
| | | @Resource |
| | | private IDockingLogeService dockingLogeService; |
| | | @Resource |
| | |
| | | private MdmSearchItemCodeProvider mdmSearchItemCodeProvider; |
| | | @Autowired |
| | | HttpServletRequest request; |
| | | |
| | | @Override |
| | | public void DockingDataSyncScheduing() { |
| | | |
| | |
| | | }); |
| | | return R.success("æå¨æ¨é宿,è¯·æ ¸å¯¹æ¯å¦æ¨éæå"); |
| | | } |
| | | private SearchItemDataVO initData(String status,String itemCode,String mmCode){ |
| | | SearchItemDataVO searchItemDataVO=new SearchItemDataVO(); |
| | | searchItemDataVO.setLastchangedon(new Date()); |
| | | searchItemDataVO.setLastchangedby("19831133"); |
| | | searchItemDataVO.setCreatby("19831133"); |
| | | searchItemDataVO.setCreatedon(new Date()); |
| | | searchItemDataVO.setIsenabled(status); |
| | | searchItemDataVO.setMaterialcode("XMDH0001"); |
| | | searchItemDataVO.setStatus("1"); |
| | | searchItemDataVO.setProjectcode("3333"); |
| | | searchItemDataVO.setProjectitem(itemCode); |
| | | searchItemDataVO.setMmodelcode(mmCode); |
| | | |
| | | return searchItemDataVO; |
| | | } |
| | | |
| | | public HttpServletRequest getRequest(){ |
| | | HttpServletRequest request =null; |
| | | RequestAttributes requestAttributes = null; |
| | | try{ |
| | | requestAttributes = RequestContextHolder.currentRequestAttributes(); |
| | | }catch (IllegalStateException e){ |
| | | //requestAttributes = new NonWebRequestAttributes(); |
| | | //RequestContextHolder.setRequestAttributes(requestAttributes, true); |
| | | request = new MockHttpServletRequest(); |
| | | RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request),true); |
| | | }finally { |
| | | if (requestAttributes instanceof ServletRequestAttributes) { |
| | | ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.currentRequestAttributes(); |
| | | request = servletRequestAttributes.getRequest(); |
| | | } |
| | | } |
| | | return request; |
| | | } |
| | | /*** |
| | | * 忥åå·ä»£å· |
| | | */ |
| | | @Override |
| | | public void saveItemDataSyncScheduing(String btmName) { |
| | | public void saveItemDataSyncScheduing(String endDate) { |
| | | String paramString=""; |
| | | String backString="æå"; |
| | | String msg="æå"; |
| | | boolean success=true; |
| | | SearchItemParam searchItemParam=new SearchItemParam(); |
| | | searchItemParam.setSystag("VCI"); //è°ç¨ç³»ç»æ è¯ |
| | | Calendar calendar= Calendar.getInstance(); |
| | | calendar.set(Calendar.HOUR_OF_DAY,0); |
| | | calendar.set(Calendar.MINUTE,0); |
| | | calendar.set(Calendar.SECOND,0); |
| | | log.info("æ¥è¯¢æ¶é´------->"+calendar.getTime()); |
| | | SimpleDateFormat dft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String lastchangedon= dft.format(calendar.getTime()); |
| | | String lastchangedon=""; |
| | | if(StringUtils.isBlank(endDate)) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | log.info("æ¥è¯¢æ¶é´------->"+calendar.getTime()); |
| | | lastchangedon= dft.format(calendar.getTime()); |
| | | }else{ |
| | | lastchangedon=endDate; |
| | | } |
| | | searchItemParam.setLastchangedon(lastchangedon); |
| | | searchItemParam.setStatus("1");// |
| | | Map<String,String>searchDataMap= VciBaseUtil.objectToMapString(searchItemParam); |
| | | SearchItemVO searchItemVO= mdmSearchItemCodeProvider.getppModelByElem(searchDataMap); |
| | | /*SearchItemVO searchItemVO=new SearchItemVO(); |
| | | List<SearchItemDataVO> data=new ArrayList<>(); |
| | | SearchItemDataVO searchItemDataVO1=initData("1","","pro-00001"); |
| | | SearchItemDataVO searchItemDataVO2=initData("0","item-00001",""); |
| | | data.add(searchItemDataVO1); |
| | | data.add(searchItemDataVO2); |
| | | searchItemVO.setData(data); |
| | | searchItemVO.setCode("200"); |
| | | searchItemVO.setMsg("");*/ |
| | | if(searchItemVO!=null) { |
| | | paramString = JSONObject.toJSON(searchItemVO).toString(); |
| | | try { |
| | | //å
å¯ç»å½ç³è¯·tokenï¼request䏿·»å ç¨æ·ä¿¡æ¯ |
| | | try { |
| | | passwordFreeLoginService.pwdFreeLoginByBoolean(systemId.toLowerCase(Locale.ROOT), request); |
| | | passwordFreeLoginService.pwdFreeLoginByBoolean(systemId.toLowerCase(Locale.ROOT),getRequest()); |
| | | }catch (Throwable e){ |
| | | throw new Throwable("ç¨æ·é´æå¤±è´¥."); |
| | | } |
| | |
| | | List<SearchItemDataVO> dataList = searchItemVO.getData(); |
| | | Map<String, SearchItemDataVO> dataVOMap = new HashMap<>(); |
| | | List<String> itemCodeList = new ArrayList<>(); |
| | | ApplyDatasVO allDatasVO = new ApplyDatasVO(); |
| | | List<ApplyDataVO> allObjectList=new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(dataList)) { |
| | | dataList.stream().forEach(searchItemDataVO -> { |
| | | String itemCode = StringUtils.isNotBlank(searchItemDataVO.getProjectitem()) ? searchItemDataVO.getProjectitem() : searchItemDataVO.getMmodelcode();//项ç®ä»£å· |
| | |
| | | itemCodeList.add(itemCode); |
| | | }); |
| | | String tableName = ""; |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(btmName); |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(codeClassify.getBtmTypeId()); |
| | | if (!r.isSuccess()) { |
| | | throw new Throwable(r.getMsg()); |
| | | } |
| | |
| | | throw new Throwable("æ ¹æ®ä¸å¡ç±»åæªæ¥è¯¢å°ä¸å¡ç±»å对象ï¼"); |
| | | } |
| | | tableName = btmTypeVO.getTableName(); |
| | | if (com.alibaba.nacos.common.utils.StringUtils.isBlank(tableName)) { |
| | | if (StringUtils.isBlank(tableName)) { |
| | | throw new Throwable("æ ¹æ®ä¸å¡ç±»åæªæ¥è¯¢å°ä¸å¡ç±»åç¸å
³èç表"); |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | |
| | | sb.append(" where 1=1"); |
| | | sb.append(" and lastr=1 and lastv=1"); |
| | | sb.append(" and codeclsfid = '" + codeClassify.getOid() + "' "); |
| | | sb.append( VciBaseUtil.toInSql(attrKey,VciBaseUtil.array2String(itemCodeList.toArray(new String[]{})))); |
| | | sb.append(" and "+ VciBaseUtil.toInSql(attrKey,itemCodeList.toArray(new String[]{}))); |
| | | List<Map<String, String>> newDataList = commonsMapper.queryByOnlySqlForMap(sb.toString()); |
| | | //List<BaseModel> baseModelList=new ArrayList<>(); |
| | | Map<String,BaseModel> baseModelMap=new HashMap<>(); |
| | | newDataList.stream().forEach(dataMap->{ |
| | | BaseModel baseModel=new BaseModel(); |
| | | DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(dataMap,baseModel,false,user); |
| | | Map<String,String> newDateMap=new CaseInsensitiveMap<>(dataMap); |
| | | DefaultAttrAssimtUtil.copplyDefaultAttrAssimt(newDateMap,baseModel,true,user); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(baseModel,user); |
| | | //baseModelList.add(baseModel); |
| | | String attrKeyValue=dataMap.getOrDefault(attrKey,""); |
| | | |
| | | String attrKeyValue=newDateMap.getOrDefault(attrKey,""); |
| | | baseModelMap.put(attrKeyValue,baseModel); |
| | | }); |
| | | ApplyDatasVO editDatasVO = new ApplyDatasVO(); |
| | | |
| | | List<ApplyDataVO> addObjectList=new ArrayList<>(); |
| | | List<ApplyDataVO> editObjectList=new ArrayList<>(); |
| | | dataVOMap.forEach((key,value)->{ |
| | |
| | | changeObjectToMap(value,"",user,"create",addObjectList); |
| | | } |
| | | }); |
| | | allObjectList.addAll(addObjectList); |
| | | allObjectList.addAll(editObjectList); |
| | | allDatasVO.setObject(allObjectList); |
| | | LinkedList<XMLResultDataObjectDetailDO> allResultDataObjectDetailDOS=new LinkedList<>(); |
| | | if(!CollectionUtils.isEmpty(addObjectList)){ |
| | | //è§åç主é®éè¦å»è·å |
| | | CodeClassifyFullInfoBO classifyFullInfo = codeClassifyService.getClassifyFullInfo(codeClassify.getOid()); |
| | |
| | | this.getConfigDatas(systemId, btmName, applyDatasVO, attrVOS, dataObjectVO); |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | | orderDTO.setCodeClassifyOid(codeClassify.getOid());//åç±»ä¸»é® |
| | | |
| | | //ç æ®µè®¾ç½® |
| | | List<SectionVO> section=new ArrayList<>(); |
| | | SectionVO sectionVO=new SectionVO(); |
| | | sectionVO.setValue(secValue); |
| | | sectionVO.setName(secName); |
| | | section.add(sectionVO); |
| | | log.info("endï¼è§åè·å宿¯"); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(null, ruleVO,classifyFullInfo); |
| | | List<CodeOrderSecDTO> codeOrderSecDTOList = getRuleCodeOrderSecDTOs(section, ruleVO,classifyFullInfo); |
| | | log.info("endï¼ç 段è·å宿¯"); |
| | | |
| | | orderDTO.setSecDTOList(codeOrderSecDTOList);//åç±»ç æ®µ |
| | | mdmIOService.batchSyncApplyCode(orderDTO, dataObjectVO, resultDataObjectDetailDOs,false); |
| | | allResultDataObjectDetailDOS.addAll(resultDataObjectDetailDOs); |
| | | } |
| | | |
| | | //æ´æ°æ°æ®ï¼æ´æ°ç¶æï¼ |
| | | if(!CollectionUtils.isEmpty(editObjectList)){ |
| | | DataObjectVO dataObjectVO = new DataObjectVO(); |
| | | ApplyDatasVO applyDatasVO = new ApplyDatasVO(); |
| | | applyDatasVO.setObject(editObjectList); |
| | | LinkedList<XMLResultDataObjectDetailDO> resultDataObjectDetailDOs = new LinkedList<>(); |
| | | CodeClassifyVO codeClassifyVO=new CodeClassifyVO(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassify, codeClassifyVO); |
| | | this.getConfigDatas(systemId, btmName, applyDatasVO, attrVOS, dataObjectVO); |
| | | mdmIOService.batchSyncEditDatas(codeClassifyVO,dataObjectVO, resultDataObjectDetailDOs,false); |
| | | |
| | | allResultDataObjectDetailDOS.addAll(resultDataObjectDetailDOs); |
| | | } |
| | | Object paramObject = JSONObject.toJSON(allDatasVO); |
| | | paramString=Func.isEmpty(paramObject)?"":paramObject.toString(); |
| | | Object backObject = JSONObject.toJSON(allResultDataObjectDetailDOS); |
| | | backString=Func.isEmpty(backObject)?"":backObject.toString(); |
| | | } |
| | | } |
| | | catch (Throwable e){ |
| | | e.printStackTrace();; |
| | | log.error("æ¥è¯¢å¤±è´¥--->"+e); |
| | | success=false; |
| | | backString="æ¥è¯¢å¤±è´¥--->"+e; |
| | | msg="æ¥è¯¢å¤±è´¥--->"+e; |
| | | throw new VciBaseException(e.getMessage()); |
| | | }finally { |
| | | try { |
| | | //è®°å½æ¥å¿ |
| | | this.saveLogs(systemId, systemId, paramString, backString, success, msg, "queryData"); |
| | | }catch (Throwable e){ |
| | | e.printStackTrace(); |
| | | log.error(e.getMessage()); |
| | | throw new VciBaseException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * è®°å½æ¥å¿ä¿¡æ¯ |
| | | * @param systemId |
| | | * @param parmaData |
| | | * @param result |
| | | * @return |
| | | */ |
| | | private void saveLogs(String systemId,String systemName,String parmaData, String result,boolean isSucess,String msg,String operation){ |
| | | //è®°å½æ¥å¿ä¿¡æ¯ |
| | | DockingLog dockingLoge=new DockingLog(); |
| | | //String oid=redisService.getUUIDEveryDay(); |
| | | dockingLoge.setSystemCode(StringUtils.isBlank(systemId)?"-":systemId);//è®¾ç½®ç³»ç»æ è¯ |
| | | dockingLoge.setSystemName(StringUtils.isBlank(systemName)?"-":systemName); |
| | | dockingLoge.setMsg(msg);//æ¥å¿æ¶æ¯ |
| | | dockingLoge.setClassifyId("-");//åç±»ç¼å· |
| | | dockingLoge.setClassifyName("-");//åç±»åç§° |
| | | dockingLoge.setClassifyOid("-");//åç±»ä¸»é® |
| | | dockingLoge.setUniqueCode("-");//å¯ä¸æ è¯ |
| | | dockingLoge.setSystemOid("-");//ç³»ç»æ è¯ |
| | | // dockingLogeDO.setName(operation); |
| | | //dockingLogeDO.setOid(oid);//æ¥å¿ä¸»é® |
| | | dockingLoge.setParamString(parmaData);//åæ°ä¿¡æ¯ |
| | | dockingLoge.setReturnString(result);//è¿åä¿¡æ¯ |
| | | dockingLoge.setType(operation);//æ¥å¿æä½ç±»å |
| | | dockingLoge.setCreateTime(new Date()); |
| | | if(isSucess) { |
| | | dockingLoge.setInterfaceStatus("true");//æ¥å£éæç¶æ |
| | | }else{ |
| | | dockingLoge.setInterfaceStatus("false");//æ¥å£éæç¶æ |
| | | } |
| | | dockingLogeService.save(dockingLoge); |
| | | log.info("éææ¨éæ°æ®æå,systemId:"+systemId+",systemname:"+systemName+",operation:"+operation+",param:"+parmaData); |
| | | } |
| | | |
| | | /*** |
| | | * æ ¹æ®ä¼ å
¥çåæ°ä¿¡æ¯æ ¡éªç 段è§å |
| | | */ |
| | |
| | | //String status= searchItemDataVO.getStatus();//æ°æ®ç¶æ å符åï¼æä¸¾å¼ï¼å¶åï¼0ï¼å®¡æ¹ä¸ï¼1ï¼éè¿ï¼2ï¼é©³åï¼3ï¼ |
| | | |
| | | String mmodelCode=searchItemDataVO.getMmodelcode();//å¶é åå·ä»£å· |
| | | initProperty("mmodelCode","","mmodelCode",propList); |
| | | initProperty("mmodelcode","",mmodelCode,propList); |
| | | String projectCode= searchItemDataVO.getProjectcode();//项ç®ç¼ç |
| | | initProperty("projectcode","","projectCode",propList); |
| | | initProperty("projectcode","",projectCode,propList); |
| | | String projectItem=searchItemDataVO.getProjectitem();//项ç®ä»£å· |
| | | initProperty("projectitem","","projectItem",propList); |
| | | initProperty("projectitem","",projectItem,propList); |
| | | String materialCode=searchItemDataVO.getMaterialcode();//产åç¼ç |
| | | initProperty("materialcode","","materialCode",propList); |
| | | initProperty("materialcode","",materialCode,propList); |
| | | //ç»å屿§çå¤ç |
| | | initProperty(attrKey,"",StringUtils.isNotBlank(projectItem)?projectItem:mmodelCode,propList); |
| | | String creatBy=searchItemDataVO.getCreatby();//å建è
|
| | | Date cretaeDon= searchItemDataVO.getCreatedon();//åå»ºæ¥æ æ¥æåï¼å¦ï¼2023-09-08 19:24:11 |
| | | String lastchangeBy=searchItemDataVO.getLastchangedby();//æ´æ¹è
|
| | |
| | | String isenabled= searchItemDataVO.getIsenabled();//å符åï¼æä¸¾å¼ï¼åç¨ï¼0ï¼å¯ç¨ï¼1ï¼ |
| | | applyDataVO.setOperate(operation); |
| | | applyDataVO.setCode(code); |
| | | if(isenabled.equals(0)){ |
| | | if(isenabled.equals("0")){ |
| | | applyDataVO.setStatus(CodeDefaultLC.DISABLE.getValue()); |
| | | }else{ |
| | | applyDataVO.setStatus(CodeDefaultLC.RELEASED.getValue()); |