Merge remote-tracking branch 'origin/master'
| | |
| | | props: { |
| | | pageSize: { |
| | | type: String, |
| | | default: "10" |
| | | default: "100" |
| | | }, |
| | | currentPage: { |
| | | type: String, |
| | |
| | | <ResembleQueryDialog :codeClassifyOid="codeClassifyOid" :codeRuleOid="this.codeRuleOid" :rowOid="rowOid" |
| | | :templateOid="templateOid" :visible.sync="similarVisible"></ResembleQueryDialog> |
| | | <div class="block" style="display: flex; justify-content: flex-end"> |
| | | <el-pagination :current-page="page.currentPage" :page-size="page.pageSizes" :page-sizes="page.pageSizes" |
| | | <el-pagination :current-page="page.currentPage" :page-size="page.pageSize" :page-sizes="page.pageSizes" |
| | | :total="page.total" layout="total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | :visible.sync="cloneOtherCodeRuleSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | style="height: 100vh" |
| | | @close="closeCloneOtherBasicSecDialog" |
| | | title="å
éç¼ç è§åçåºç¡ä¿¡æ¯" |
| | | top="-3%" |
| | | width="800px"> |
| | | <div> |
| | | <el-row> |
| | | <p |
| | | style="margin-top: -20px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f;"> |
| | | ç¼ç è§å |
| | | </p> |
| | | <avue-crud |
| | | ref="crudCloneCodeRuleOther" |
| | | :data="codeRuleData" |
| | | :option="cloneCodeRuleOption" |
| | | :page.sync="codeRulePage" |
| | | :table-loading="codeRuleloading" |
| | | class="other-clone-coderule-crud" |
| | | @row-click="codeOtherCloneRuleRowClick" |
| | | @selection-change="selectionOtherCloneCodeRuleChange" |
| | | @search-change="searchOtherCloneChange" |
| | | @search-reset="searchOtherCloneReset" |
| | | @on-load="onLoad"> |
| | | <template #radio="{row}"> |
| | | <el-radio v-model="selectOtherCodeRuleRowIndex" |
| | | :label="row.$index"> </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px; border-top: 1px solid #ebeef5"> |
| | | <p |
| | | style=" |
| | | margin-top: 10px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f; |
| | | " |
| | | > |
| | | ç æ®µä¿¡æ¯ |
| | | </p> |
| | | <avue-crud |
| | | ref="crudCloneCodeBasicOther" |
| | | :data="cloneBasicData" |
| | | :option="cloneBasicOption" |
| | | :table-loading="codeBasicloading" |
| | | class="other-clone-codebasic-crud" |
| | | @row-click="codeOtherCloneBasicRowClick" |
| | | @selection-change="selectionOtherCloneCodeBasicChange"> |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer" style="height: 50px"> |
| | | <el-button type="primary" @click="saveOtherCodeBasic" :loading="cloneSaveLoding">ä¿ å</el-button> |
| | | <el-button @click="cloneOtherCodeRuleSettingBox = false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import cloneBasicOption from "@/const/code/cloneBasicDialogOption"; |
| | | import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption"; |
| | | import {gridCodeRule} from "@/api/code/mdmrule"; |
| | | import {gridCodeBasicSec,cloneCodeBasic} from "@/api/code/codebasic"; |
| | | export default { |
| | | name: "cloneRuleDialog", |
| | | props: { |
| | | // å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶ |
| | | visible: { |
| | | type: "Boolean", |
| | | default: false, |
| | | }, |
| | | // 被å
éçè§åoid |
| | | quiltCloneCodeRule:{ |
| | | type: "Object", |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | cloneOtherCodeRuleSettingBox: this.visible, |
| | | /*å
éç¼ç è§åå¯¹è¯æ¡æ§å¶åé*/ |
| | | cloneBasicOption: cloneBasicOption, |
| | | cloneCodeRuleOption: cloneCodeRuleOption, |
| | | selectionOtherCloneCodeBasicList: [], // æ¤çé¢å
å½åéä¸çåºç¡ç 段 |
| | | selectionOtherCloneCodeRuleList: {}, // æ¤çé¢å
å½åéä¸çç¼ç è§å |
| | | selectOtherCodeRuleRowIndex: '', |
| | | cloneOtherQuery: {}, // æ¥è¯¢æ¡ä»¶å¯¹è±¡ |
| | | codeRulePage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | codeRuleloading: false, |
| | | codeRuleData: [], |
| | | codeBasicloading: false, |
| | | cloneBasicData: [], |
| | | cloneSaveLoding: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ï¼ä»¥åå¼çåå¡« |
| | | visible() { |
| | | //console.log(this.visible); |
| | | if(this.visible){ |
| | | //console.log(this.quiltCloneCodeRule); |
| | | let conditionMap = {}; |
| | | conditionMap["conditionMap[oid_notequal]"] = this.quiltCloneCodeRule.oid.trim(); |
| | | this.cloneOtherQuery = conditionMap; |
| | | this.onLoad(this.codeRulePage); |
| | | }else{ |
| | | this.codeRuleData = []; |
| | | this.cloneBasicData = []; |
| | | } |
| | | this.cloneOtherCodeRuleSettingBox = this.visible; |
| | | }, |
| | | selectionOtherCloneCodeRuleList(){ |
| | | this.loadBasic(this.selectionOtherCloneCodeRuleList); |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | //å
³éçªå£æ¶è§¦å |
| | | closeCloneOtherBasicSecDialog(){ |
| | | this.$emit('update:visible',false); |
| | | }, |
| | | /** ä»å
¶ä»ç¼ç è§åä¸å
éç æ®µå¯¹è¯æ¡-åå»ç¼ç è§åå®ç°è¡éæ©*/ |
| | | codeOtherCloneRuleRowClick(row) { |
| | | this.selectOtherCodeRuleRowIndex = row.$index |
| | | this.selectionOtherCloneCodeRuleList = row; |
| | | this.loadBasic(row); |
| | | }, |
| | | /** ä»å
¶ä»ç¼ç è§åä¸å
éç æ®µå¯¹è¯æ¡-åå»åºç¡ç 段å®ç°è¡éæ©*/ |
| | | codeOtherCloneBasicRowClick(row) { |
| | | this.$refs.crudCloneCodeBasicOther.toggleSelection(); |
| | | this.selectionOtherCloneCodeBasicList = row; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow(row); |
| | | this.$refs.crudCloneCodeBasicOther.toggleRowSelection(row); //éä¸å½åè¡ |
| | | }, |
| | | selectionOtherCloneCodeBasicChange(list) { |
| | | this.selectionOtherCloneCodeBasicList = list; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow( |
| | | this.selectionOtherCloneCodeBasicList.slice(-1)[0] |
| | | ); |
| | | }, |
| | | /** ä»å
¶ä»è§åå
éç æ®µçé¢éç½®æç´¢åè½ */ |
| | | searchOtherCloneReset() { |
| | | let conditionMap = {}; |
| | | conditionMap["conditionMap[oid_notequal]"] = this.quiltCloneCodeRule.oid.trim(); |
| | | this.cloneOtherQuery = conditionMap; |
| | | this.onLoad(this.codeRulePage); |
| | | }, |
| | | /** ä»å
¶ä»è§åå
éç æ®µçé¢æç´¢åè½*/ |
| | | searchOtherCloneChange(params, done) { |
| | | this.codeRulePage.currentPage = 1; |
| | | // å¤ä¸ªconditionMapè¿æ ·ä¼ åï¼å¿«éæ¥è¯¢é»è®¤éç¨æ¨¡ç³æ¥è¯¢ |
| | | if (params) { |
| | | Object.keys(params).forEach((key) => { |
| | | this.cloneOtherQuery["conditionMap" + "[" + key + "_like]"] = |
| | | params[key].trim(); |
| | | }); |
| | | } |
| | | this.onLoad(this.codeRulePage,this.cloneOtherQuery); |
| | | done(); |
| | | }, |
| | | /** ä¿åä»å
¶ä»ç¼ç è§åä¸å
éç æ®µä¿¡æ¯*/ |
| | | async saveOtherCodeBasic() { |
| | | this.cloneSaveLoding = true; |
| | | let oid = this.quiltCloneCodeRule.oid; |
| | | let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; |
| | | if (fromDialogPkCodebasic.length <= 0) { |
| | | this.$message.warning("è¯·éæ©ç æ®µæ°æ®!"); |
| | | return; |
| | | } |
| | | let oidArr = []; |
| | | fromDialogPkCodebasic.forEach((ele) => { |
| | | oidArr.push(ele.oid); |
| | | }); |
| | | let data = { |
| | | pkCodeRule: oid, |
| | | oidArr: oidArr.join(","), |
| | | }; |
| | | //console.log(data); |
| | | await cloneCodeBasic(data).then( () => { |
| | | this.cloneOtherCodeRuleSettingBox = false; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | // è°ç¨ç¶ç»ä»¶æ¹æ³éæ°å è½½ç æ®µè¡¨ |
| | | this.$emit('refreshRuleTable',{"currentPage":1,"pageSize":10}); |
| | | },(error) => { |
| | | window.console.log(error); |
| | | }); |
| | | this.cloneSaveLoding = false; |
| | | }, |
| | | /** ç¹å»è§¦åå è½½åºç¡ç 段信æ¯*/ |
| | | loadBasic(row) { |
| | | this.codeBasicloading = true; |
| | | // console.log(row) |
| | | if (row != "" && row != null && row !="undefined") { |
| | | let conditionMap = {}; |
| | | conditionMap["conditionMap[pkCodeRule]"] = row.oid.trim(); |
| | | gridCodeBasicSec(1, -1, conditionMap).then((res) => { |
| | | const data = res.data.data; |
| | | this.cloneBasicData = data.records; |
| | | this.codeBasicloading = false; |
| | | }); |
| | | }else { |
| | | this.cloneBasicData = []; |
| | | this.codeBasicloading = false; |
| | | } |
| | | }, |
| | | // è§åè¡¨æ ¼ç¸å
³æ¹æ³ |
| | | onLoad(page, params = {}) { |
| | | this.codeRuleloading = true; |
| | | gridCodeRule(page.currentPage, page.pageSize, Object.assign({},this.cloneOtherQuery, params)).then((res) => { |
| | | // console.log(res.data); |
| | | const data = res.data.data; |
| | | this.codeRulePage.total = data.total; |
| | | this.codeRuleData = data.records; |
| | | this.codeRuleloading = false; |
| | | if(this.codeRuleData.length > 0) { |
| | | this.$nextTick(() => { |
| | | this.selectOtherCodeRuleRowIndex = this.codeRuleData[0].$index |
| | | this.selectionOtherCloneCodeRuleList = this.codeRuleData[0]; |
| | | }); |
| | | }else{ |
| | | this.cloneBasicData = []; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | :visible.sync="cloneSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | style="height: 100vh" |
| | | title="å
éç¼ç è§å" |
| | | top="-3%" |
| | | @close="closeCloneDialog" |
| | | width="800px"> |
| | | <div> |
| | | <el-row> |
| | | <el-form ref="form" :inline="true" :model="form" label-width="80px"> |
| | | <el-form-item label="ç¼å·" required> |
| | | <el-input v-model="cloneCodeRuleForm.id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åç§°" required> |
| | | <el-input v-model="cloneCodeRuleForm.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="便®" required> |
| | | <el-input v-model="cloneCodeRuleForm.accordingTo"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="clone-input-textarea" label="æè¿°"> |
| | | <el-input |
| | | v-model="cloneCodeRuleForm.description" |
| | | :autosize="{ minRows: 3, maxRows: 5 }" |
| | | type="textarea" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-row> |
| | | <el-row> |
| | | <p |
| | | style=" |
| | | margin: 0 0px 16px 50%; |
| | | font-weight: 500; |
| | | font-size: 20px; |
| | | color: #000;"> |
| | | ç æ®µç®¡ç |
| | | </p> |
| | | <avue-crud |
| | | :data="cloneData" |
| | | :option="cloneOption" |
| | | :table-loading="cloneTableLoading" |
| | | class="clone-avue-crud"> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button |
| | | v-show="scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >ä¸ç§» |
| | | </el-button> |
| | | <el-button |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >ä¸ç§» |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="saveCloneCodeRule" :loading="cloneCodeRuleLoading">ä¿ å</el-button> |
| | | <el-button @click="cloneSettingBox = false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import cloneOption from "@/const/code/cloneOption"; |
| | | import {clone} from "@/api/code/mdmrule"; |
| | | import {downOrderNum, upOrderNum, gridCodeBasicSec} from "@/api/code/codebasic"; |
| | | export default { |
| | | name: "cloneRuleDialog", |
| | | props: { |
| | | // å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶ |
| | | visible: { |
| | | type: "Boolean", |
| | | default: false, |
| | | }, |
| | | ruleData:{ |
| | | type: "Object", |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | cloneSettingBox: this.visible, |
| | | /*å
éç¼ç è§åå¯¹è¯æ¡æ§å¶åé*/ |
| | | cloneTableLoading: false, |
| | | cloneCodeRuleLoading: false, |
| | | cloneOption: cloneOption, |
| | | cloneData: [], |
| | | cloneCodeRuleForm: { |
| | | id: "", |
| | | name: "", |
| | | accordingTo: "", |
| | | description: "", |
| | | }, |
| | | }; |
| | | }, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ï¼ä»¥åå¼çåå¡« |
| | | visible() { |
| | | //console.log(this.visible); |
| | | if(this.visible){ |
| | | this.loadBasic(this.ruleData); |
| | | this.cloneCodeRuleForm.id = this.ruleData.id; |
| | | this.cloneCodeRuleForm.name = this.ruleData.name; |
| | | this.cloneCodeRuleForm.accordingTo = this.ruleData.accordingTo; |
| | | this.cloneCodeRuleForm.description = this.ruleData.description; |
| | | } |
| | | this.cloneSettingBox = this.visible; |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | //å
³éå¯¹è¯æ¡ |
| | | closeCloneDialog(){ |
| | | this.$emit('update:visible',false); |
| | | this.cloneData = []; |
| | | }, |
| | | /** ä¸ç§»ä¸ç§»åºç¡ç 段*/ |
| | | async upOrderNum(row) { |
| | | if (this.ruleData.lcStatus != "Editing") { |
| | | this.$message.warning( |
| | | "åªæç¼ç è§åçç¶ææ¯ [ç¼è¾ä¸] çæ¶åï¼æè½è°æ´ç 段顺åº!" |
| | | ); |
| | | return; |
| | | } |
| | | if (row.oid == null || row.oid == "") { |
| | | this.$message.warning("æªè·åå°å¿
å¡«åæ°!"); |
| | | return; |
| | | } |
| | | await upOrderNum(row.oid).then(() => { |
| | | this.loadBasic(this.ruleData); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | }); |
| | | }, |
| | | downOrderNum(row) { |
| | | let codeRuleOid = this.ruleData.oid; |
| | | if (this.ruleData.lcStatus != "Editing") { |
| | | this.$message.warning( |
| | | "åªæç¼ç è§åçç¶ææ¯ [ç¼è¾ä¸] çæ¶åï¼æè½è°æ´ç 段顺åº!" |
| | | ); |
| | | return; |
| | | } |
| | | if (row.oid == null || row.oid == "") { |
| | | this.$message.warning("æªè·åå°å¿
å¡«åæ°!"); |
| | | return; |
| | | } |
| | | downOrderNum(row.oid).then(() => { |
| | | this.loadBasic({ oid: codeRuleOid }); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | }); |
| | | }, |
| | | /** ç¹å»è§¦åå è½½åºç¡ç 段信æ¯*/ |
| | | loadBasic(row) { |
| | | this.cloneTableLoading = true; |
| | | if (row != "" || row != null) { |
| | | let conditionMap = {}; |
| | | conditionMap["conditionMap[pkCodeRule]"] = row.oid.trim(); |
| | | gridCodeBasicSec(1, -1, conditionMap).then((res) => { |
| | | const data = res.data.data; |
| | | this.cloneData = data.records; |
| | | this.cloneTableLoading = false; |
| | | }); |
| | | } |
| | | }, |
| | | /** å
éç¼ç è§åä¿ååè½*/ |
| | | saveCloneCodeRule() { |
| | | this.cloneCodeRuleLoading = true; |
| | | let form = this.cloneCodeRuleForm; |
| | | if (form.id.trim() == "") { |
| | | this.$message.warning("ç¼å·ä¸è½ä¸ºç©º!"); |
| | | return; |
| | | } |
| | | if (form.name.trim() == "") { |
| | | this.$message.warning("ç å¼ä¸è½ä¸ºç©º!"); |
| | | return; |
| | | } |
| | | let data = Object.assign({}, form, { |
| | | oid: "", |
| | | createTime: new Date().getTime(), |
| | | ts: new Date(this.ruleData.ts).getTime(), |
| | | lcStatus: "Editing", |
| | | elements: this.cloneData, |
| | | }); |
| | | // console.log(data); |
| | | this.cloneCodeRuleLoading = true; |
| | | clone(data).then(() => { |
| | | this.cloneSettingBox = false; |
| | | // è°ç¨ç¶ç»ä»¶æ¹æ³éæ°å è½½ç æ®µè¡¨ |
| | | this.$emit('refreshRuleTable',{"currentPage":1,"pageSize":10}); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="display: flex" > |
| | | <el-form :inline="true" :model="formInline" class="demo-form-inline"> |
| | | <el-form-item label="ç±»å:" size="small"> |
| | | <el-select v-model="formInline.type" placeholder="请è¾å
¥ç±»å" @change="SelectChange"> |
| | | <el-option :label="item.label" :value="item.value" v-for="item in SearchObject.searchData" ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item v-if="typeFlag" size="small"> |
| | | <el-select v-model="formInline.check" placeholder="è¯·éæ©åç±»"> |
| | | <el-option label="1" value="0"></el-option> |
| | | <el-option label="2" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item size="small" v-if="dateFlag"> |
| | | <el-date-picker |
| | | v-model="formInline.Date" |
| | | type="date" |
| | | placeholder="éæ©æ¥ææ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item size="small" > |
| | | <el-input v-model="formInline.text" placeholder="请è¾å
¥å
容" @keyup.enter.native="SaveHandler"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList} from "@/api/docking/loge"; |
| | | export default { |
| | | name: "VciDockingSearch", |
| | | props:['SearchObject','page'], |
| | | data() { |
| | | return { |
| | | typeFlag:false, |
| | | dateFlag:false, |
| | | formInline:{ |
| | | type:'', |
| | | check:'', |
| | | text:'', |
| | | Date:'' |
| | | }, |
| | | } |
| | | }, |
| | | methods:{ |
| | | SelectChange(val){ |
| | | if(this.SearchObject.type === 'loge'){ |
| | | if(val === 5){ |
| | | this.typeFlag=true; |
| | | }else { |
| | | this.typeFlag=false; |
| | | } |
| | | if(val === 6){ |
| | | this.dateFlag=true; |
| | | }else { |
| | | this.dateFlag=false; |
| | | } |
| | | } |
| | | }, |
| | | SaveHandler(){ |
| | | let name = this.SearchObject.searchData[this.formInline.type].prop; |
| | | getList(this.page.currentPage, this.page.pageSize, {[name]: this.formInline.text}).then(res => { |
| | | console.log(res); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | console.log('referer') |
| | | if (!this.referConfig.options) { |
| | | this.referConfig.options = { |
| | | isMuti: false |
| | | } |
| | | } |
| | | console.log('referConfig',this.referConfig) |
| | | }, |
| | | mounted() { |
| | | var title = this.referConfig.title || ''; |
| | |
| | | label: 'è±æåç§°', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | search: true, |
| | | formatter:function (d){ |
| | | return d.id || d.data.id |
| | | } |
| | | }, { |
| | | prop: 'name', |
| | | label: '䏿åç§°', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | search: true, |
| | | formatter:function (d){ |
| | | return d.name || d.data.name |
| | | } |
| | | }, { |
| | | prop: 'description', |
| | | label: 'æè¿°', |
| | | width: 250 |
| | | width: 250, |
| | | formatter:function (d){ |
| | | return d.description || d.data.description |
| | | } |
| | | }, { |
| | | prop: 'secretGradeText', |
| | | label: 'å¯çº§', |
| | | width: 60, |
| | | hidden: (!this.controllerSecret) |
| | | hidden: (!this.controllerSecret), |
| | | formatter:function (d){ |
| | | return d.secretGradeText || d.data.secretGradeText |
| | | } |
| | | }]; |
| | | } else { |
| | | this.option.column = this.options.tableConfig.cols.map(item => { |
| | |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | return d.data[item.field] |
| | | }else { |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | this.data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | |
| | | }, |
| | | created() { |
| | | this.getParams(); |
| | | |
| | | // console.log('referConfig:') |
| | | // console.log(this.referConfig) |
| | | }, |
| | | mounted() { |
| | | console.log('referrTable') |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.page.limit || this.referConfig.options.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.page.page || this.referConfig.options.page.currentPage; |
| | |
| | | message: "请è¾å
¥" + item.field, |
| | | trigger: "blur" |
| | | }]; |
| | | /*item.formatter=function(d,thisItem){ |
| | | var vciWebComboxStore = layui.vciWebComboxStore; |
| | | return vciWebComboxStore.getComboxText(thisItem.enumCode,d[thisItem.field]); |
| | | };*/ |
| | | item.formatter=function(d){ |
| | | return d.field || d.data.field |
| | | }; |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | return d.data[item.field] |
| | | }else { |
| | | return '' |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | this.params=paramsData; |
| | | }, |
| | | setValue(){ |
| | | console.log('ç¡®å®') |
| | | if(this.selectionList.length==0){ |
| | | this.$message.warning( '没æéæ©æ°æ®'); |
| | | return false; |
| | |
| | | this.data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | } |
| | | this.data=this.data.map(item => { |
| | | item.data=item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | |
| | | this.params=queryParams; |
| | | |
| | | }, |
| | | getTree(){ |
| | | getTree(this.params,this.treeUrl).then(res => { |
| | | this.treeData=res.data |
| | | getTree() { |
| | | getTree(this.params, this.treeUrl).then(res => { |
| | | res.data.map(item => { |
| | | if (!item.attribute) { |
| | | item.attribute = { |
| | | data: {} |
| | | } |
| | | } else { |
| | | item.attribute.data = item.attribute.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | | } |
| | | }) |
| | | this.treeData = res.data |
| | | }) |
| | | }, |
| | | treeLoad: function (treeNode, resolve) { |
| | | const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid; |
| | |
| | | } |
| | | getLazyTree(this.params,this.treeUrl).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | if(!item.attribute){ |
| | | item.attribute={ |
| | | data:{} |
| | | } |
| | | }else{ |
| | | item.attribute.data=item.attribute.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren |
| | |
| | | export default { |
| | | nodeKey: 'oid', |
| | | // nodeKey: 'oid', |
| | | border: true, |
| | | lazy: false, |
| | | defaultExpandAll: true, |
| | | defaultExpandAll: false, |
| | | treeLoad: function (node, resolve) { |
| | | // const parentId = (node.level === 0) ? 0 : node.data.id; |
| | | |
| | |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | selection: true, |
| | | selection: false, |
| | | menu: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, //è¡é䏿¶é«äº® |
| | | rowKey: "oid", //è¡æ°æ®ç Keyï¼ç¨æ¥ä¼å Table çæ¸²æ |
| | | align: 'center', |
| | | menuAlign: 'center', |
| | | column: [ |
| | | { |
| | | label: '', |
| | | prop: 'radio', |
| | | width: 60, |
| | | hide: false |
| | | }, |
| | | { |
| | | label: "ç¼å·", |
| | | prop: "id", |
| | | search: true, |
| | |
| | | import referConfigDialog from "@/components/code-dialog-page/referConfigDialog" |
| | | import referBtmTypeCrudDialog from "@/components/code-dialog-page/referBtmTypeCrudDialog" |
| | | import referSelectBtmAttrDialog from "@/components/code-dialog-page/referSelectBtmAttrDialog" |
| | | import cloneRuleDialog from "@/components/code-dialog-page/cloneRuleDialog" |
| | | import cloneOtherBasicSecDialog from "@/components/code-dialog-page/cloneOtherBasicSecDialog" |
| | | import advancedQuery from "@/components/advanced-query/advancedQuery" |
| | | import businessAdd from "@/views/modeling/BusinessAdd" |
| | | import VciMasterCrud from "@/components/MasterCrud/VciMasterCrud" |
| | |
| | | import MasterTransfer from "@/components/Master/MasterTransfer"; |
| | | import ThemeImport from "@/components/Theme/ThemeImport"; |
| | | import maxSerialnumDialog from '@/components/code-dialog-page/maxSerialnumDialog' |
| | | import VciDockingSearch from '@/components/dockingSearch/VciDockingSearch' |
| | | // å°å·¥å
·å½æ°æ·»å å°å
¨å± |
| | | import utilFunc from './util/func' |
| | | Vue.prototype.$utilFunc = utilFunc |
| | |
| | | Vue.component('originalAdd',originalAdd) |
| | | Vue.component('referBtmTypeCrudDialog',referBtmTypeCrudDialog) |
| | | Vue.component('referSelectBtmAttrDialog',referSelectBtmAttrDialog) |
| | | Vue.component('cloneOtherBasicSecDialog',cloneOtherBasicSecDialog) |
| | | Vue.component('cloneRuleDialog',cloneRuleDialog) |
| | | Vue.component('FormTemplateDialog',FormTemplateDialog) |
| | | Vue.component('LinkTypeAdd',linkTypeAdd) |
| | | Vue.component('MasterTree',MasterTree) |
| | |
| | | Vue.component('MasterTransfer', MasterTransfer) |
| | | Vue.component('ThemeImport', ThemeImport) |
| | | Vue.component('maxSerialnumDialog', maxSerialnumDialog) |
| | | Vue.component('VciDockingSearch', VciDockingSearch) |
| | | |
| | | // å è½½ç¸å
³urlå°å |
| | | Object.keys(urls).forEach(key => { |
| | |
| | | page: { |
| | | total: 0, |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | pageSize: 100, |
| | | pageSizes: [10, 30, 50, 100, 200], |
| | | }, |
| | | pageSize: "10", |
| | | pageSize: "100", |
| | | currentPage: "1", |
| | | codeClassifyOid: "", |
| | | coderuleoid: "", |
| | |
| | | > |
| | | </advanced-query> |
| | | |
| | | <!-- ç¼ç è§åç¸å
³å¯¹è¯æ¡ --> |
| | | <!-- 以䏿¯ç¼ç è§åç¸å
³å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :visible.sync="codeRangeSettingBox" |
| | | append-to-body |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- ç¼ç è§å,å
éå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | <clone-rule-dialog |
| | | :visible.sync="cloneSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | style="height: 100vh" |
| | | title="å
éç¼ç è§å" |
| | | top="-3%" |
| | | width="800px" |
| | | > |
| | | <div> |
| | | <el-row> |
| | | <el-form ref="form" :inline="true" :model="form" label-width="80px"> |
| | | <el-form-item label="ç¼å·" required> |
| | | <el-input v-model="cloneCodeRuleForm.id"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åç§°" required> |
| | | <el-input v-model="cloneCodeRuleForm.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="clone-input-textarea" label="æè¿°"> |
| | | <el-input |
| | | v-model="cloneCodeRuleForm.description" |
| | | :autosize="{ minRows: 3, maxRows: 5 }" |
| | | type="textarea" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-row> |
| | | <el-row> |
| | | <p |
| | | style=" |
| | | margin: 0 0px 16px 50%; |
| | | font-weight: 500; |
| | | font-size: 20px; |
| | | color: #000; |
| | | " |
| | | > |
| | | ç æ®µç®¡ç |
| | | </p> |
| | | <avue-crud |
| | | :data="cloneData" |
| | | :option="cloneOption" |
| | | :table-loading="cloneTableLoading" |
| | | class="clone-avue-crud" |
| | | @on-load="cloneDataOnLoad" |
| | | > |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button |
| | | v-show="scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >ä¸ç§» |
| | | </el-button> |
| | | <el-button |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >ä¸ç§» |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="saveCloneCodeRule">ä¿ å</el-button> |
| | | <el-button @click="cloneSettingBox = false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | :ruleData="selectionList[0]" |
| | | @refreshRuleTable="onLoad"> |
| | | </clone-rule-dialog> |
| | | |
| | | <!-- ç¼ç è§å,ä»å
¶ä»è§åå
éå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | <clone-other-basic-sec-dialog |
| | | :visible.sync="cloneOtherCodeRuleSettingBox" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | destroy-on-close |
| | | style="height: 100vh" |
| | | title="å
éç¼ç è§åçåºç¡ä¿¡æ¯" |
| | | top="-3%" |
| | | width="800px" |
| | | > |
| | | <div> |
| | | <el-row> |
| | | <p |
| | | style=" |
| | | margin-top: -20px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f; |
| | | " |
| | | > |
| | | ç¼ç è§å |
| | | </p> |
| | | <avue-crud |
| | | ref="crudCloneCodeRuleOther" |
| | | :data="data" |
| | | :option="cloneCodeRuleOption" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | class="other-clone-coderule-crud" |
| | | @row-click="codeOtherCloneRuleRowClick" |
| | | @size-change="sizeChange" |
| | | @selection-change="selectionOtherCloneCodeRuleChange" |
| | | @search-change="searchOtherCloneChange" |
| | | @search-reset="searchOtherCloneReset" |
| | | @on-load="onLoad" |
| | | > |
| | | </avue-crud> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px; border-top: 1px solid #ebeef5"> |
| | | <p |
| | | style=" |
| | | margin-top: 10px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f; |
| | | " |
| | | > |
| | | ç æ®µä¿¡æ¯ |
| | | </p> |
| | | <avue-crud |
| | | ref="crudCloneCodeBasicOther" |
| | | :data="basicData" |
| | | :option="cloneBasicOption" |
| | | :table-loading="loadingBasic" |
| | | class="other-clone-codebasic-crud" |
| | | @row-click="codeOtherCloneBasicRowClick" |
| | | @selection-change="selectionOtherCloneCodeBasicChange" |
| | | > |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer" style="height: 50px"> |
| | | <el-button type="primary" @click="saveOtherCodeBasic">ä¿ å</el-button> |
| | | <el-button @click="cloneOtherCodeRuleSettingBox = false" |
| | | >å æ¶</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | :quiltCloneCodeRule="selectionList[0]" |
| | | @refreshRuleTable="onLoad"> |
| | | </clone-other-basic-sec-dialog> |
| | | |
| | | <!-- ç¼ç è§å,转移ææè
å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | |
| | | remove, |
| | | listUseRange, |
| | | updateStatus, |
| | | clone, |
| | | clearAllCode, |
| | | checkLikeCodeRule, |
| | | } from "@/api/code/mdmrule"; |
| | |
| | | upOrderNum, |
| | | deleteData, |
| | | editSave, |
| | | cloneCodeBasic, |
| | | addSave, |
| | | refDataGridClassifySec, |
| | | } from "@/api/code/codebasic"; |
| | |
| | | } from "@/api/code/codeClassifyValue"; |
| | | import { getDictionary } from "@/api/omd/enum"; |
| | | import optionBasic from "@/const/code/codebasic"; |
| | | import cloneOption from "@/const/code/cloneOption"; |
| | | import cloneBasicOption from "@/const/code/cloneBasicDialogOption"; |
| | | import cloneCodeRuleOption from "@/const/code/cloneCodeRuleDialogOption"; |
| | | import optionRule from "@/const/code/mdmrule"; |
| | | import attrOption from "@/const/code/selectAttrOptionDialog"; |
| | | import treeOption from "@/const/code/classifyTreeOptionDialog"; |
| | |
| | | data: [], |
| | | currentRuleLcStatus: "", |
| | | |
| | | /*å
éå¯¹è¯æ¡æ§å¶åé*/ |
| | | /*å
éç¼ç è§åå¯¹è¯æ¡æ§å¶åé*/ |
| | | cloneSettingBox: false, |
| | | cloneTableLoading: false, |
| | | cloneOption: cloneOption, |
| | | cloneData: [], |
| | | cloneCodeRuleForm: { |
| | | id: "", |
| | | name: "", |
| | | description: "", |
| | | }, |
| | | |
| | | |
| | | /*ä»å
¶ä»è§åå
éç æ®µ*/ |
| | | cloneOtherCodeRuleSettingBox: false, |
| | | cloneBasicOption: cloneBasicOption, |
| | | cloneCodeRuleOption: cloneCodeRuleOption, |
| | | selectionOtherCloneCodeBasicList: [], // æ¤çé¢å
å½åéä¸çåºç¡ç 段 |
| | | selectionOtherCloneCodeRuleList: [], // æ¤çé¢å
å½åéä¸çç¼ç è§å |
| | | otherCloneQuery: {}, // æ¥è¯¢æ¡ä»¶å¯¹è±¡ |
| | | |
| | | /** 转移ææè
å¯¹è¯æ¡ */ |
| | | escapeOwnerVisible: false, |
| | |
| | | loadingBasic: false, |
| | | selectionBasicList: [], |
| | | addBasicCodeSettingBox: false, |
| | | showbtn: false, //åºç¡ç 段æ°å¢æ¯å¦æ¾ç¤ºåºç¡ç 段 |
| | | showbtn: false, //åºç¡ç 段æ°å¢æé®æ¯å¦ç¦ç¨ |
| | | isLoadingSecCodeAddBtn: false, |
| | | basicSecDialogTitle: "", //åºç¡ç 段第ä¸å±å¯¹è¯æ¡æ é¢ |
| | | basicSecOnlyRead: false, //æ°å¢åºç¡ç æ®µè¡¨åæ¯å¦åªè¯» |
| | |
| | | this.updateStatus(oid, update); |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** æå¼ç¼ç è§åå
éå¯¹è¯æ¡*/ |
| | | openCodeRuleDialog() { |
| | | if (!this.tipsMessage(this.selectionList)) { |
| | | return; |
| | | } |
| | | this.cloneSettingBox = true; |
| | | this.cloneCodeRuleForm.id = this.selectionList[0].id; |
| | | this.cloneCodeRuleForm.name = this.selectionList[0].name; |
| | | this.cloneCodeRuleForm.description = this.selectionList[0].description; |
| | | this.loadBasic({ oid: this.selectionList[0].oid }); |
| | | }, |
| | | /** å
éç¼ç è§åä¿ååè½*/ |
| | | saveCloneCodeRule() { |
| | | let form = this.cloneCodeRuleForm; |
| | | if (form.id.trim() == "") { |
| | | this.$message.warning("ç¼å·ä¸è½ä¸ºç©º!"); |
| | | return; |
| | | } |
| | | if (form.name.trim() == "") { |
| | | this.$message.warning("ç å¼ä¸è½ä¸ºç©º!"); |
| | | return; |
| | | } |
| | | this.selectionList[0].oid = ""; |
| | | this.selectionList[0].id = form.id; |
| | | this.selectionList[0].name = form.name; |
| | | this.selectionList[0].description = form.description; |
| | | this.selectionList[0].createTime = new Date().getTime(); |
| | | this.selectionList[0].ts = new Date(this.selectionList[0].ts).getTime(); |
| | | this.selectionList[0].lcStatus = "Editing"; |
| | | let data = Object.assign({}, this.selectionList[0], { |
| | | elements: this.cloneData, |
| | | }); |
| | | clone(data).then( |
| | | () => { |
| | | this.cloneSettingBox = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | //console.log(data); |
| | | }, |
| | | |
| | | /** æå¼ä»å
¶ä»ç¼ç è§åä¸å
éç æ®µå¯¹è¯æ¡*/ |
| | |
| | | return; |
| | | } |
| | | this.cloneOtherCodeRuleSettingBox = true; |
| | | }, |
| | | /** ä»å
¶ä»ç¼ç è§åä¸å
éç æ®µå¯¹è¯æ¡-åå»ç¼ç è§åå®ç°è¡éæ©*/ |
| | | codeOtherCloneRuleRowClick(row) { |
| | | this.$refs.crudCloneCodeRuleOther.toggleSelection(); |
| | | this.selectionOtherCloneCodeRuleList = row; |
| | | this.$refs.crudCloneCodeRuleOther.setCurrentRow(row); |
| | | this.$refs.crudCloneCodeRuleOther.toggleRowSelection(row); //éä¸å½åè¡ |
| | | this.loadBasic(row); |
| | | }, |
| | | /** ä»å
¶ä»ç¼ç è§åä¸å
éç æ®µå¯¹è¯æ¡-åå»åºç¡ç 段å®ç°è¡éæ©*/ |
| | | codeOtherCloneBasicRowClick(row) { |
| | | this.$refs.crudCloneCodeBasicOther.toggleSelection(); |
| | | this.selectionOtherCloneCodeBasicList = row; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow(row); |
| | | this.$refs.crudCloneCodeBasicOther.toggleRowSelection(row); //éä¸å½åè¡ |
| | | }, |
| | | /** ä»å
¶ä»è§åå
éç æ®µçé¢ä¸ç¼ç è§åå½åéä¸è¡ååçæ¶å触å*/ |
| | | selectionOtherCloneCodeRuleChange(list) { |
| | | //console.log(list); |
| | | this.selectionOtherCloneCodeRuleList = list; |
| | | this.$refs.crudBasic.setCurrentRow( |
| | | this.selectionBasicList[list.length - 1] |
| | | ); |
| | | if (list == "") { |
| | | this.basicData = []; |
| | | } |
| | | if (this.selectionOtherCloneCodeRuleList.length > 0) { |
| | | this.loadBasic(this.selectionOtherCloneCodeRuleList[list.length - 1]); |
| | | } |
| | | }, |
| | | selectionOtherCloneCodeBasicChange(list) { |
| | | this.selectionOtherCloneCodeBasicList = list; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow( |
| | | this.selectionOtherCloneCodeBasicList[list.length - 1] |
| | | ); |
| | | }, |
| | | /** ä»å
¶ä»è§åå
éç æ®µçé¢éç½®æç´¢åè½ */ |
| | | searchOtherCloneReset() { |
| | | this.otherCloneQuery = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | /** ä»å
¶ä»è§åå
éç æ®µçé¢æç´¢åè½*/ |
| | | searchOtherCloneChange(params, done) { |
| | | this.page.currentPage = 1; |
| | | // å¤ä¸ªconditionMapè¿æ ·ä¼ åï¼å¿«éæ¥è¯¢é»è®¤éç¨æ¨¡ç³æ¥è¯¢ |
| | | let requestData = {}; |
| | | if (params) { |
| | | Object.keys(params).forEach((key) => { |
| | | requestData["conditionMap" + "[" + key + "_like]"] = |
| | | params[key].trim(); |
| | | }); |
| | | } |
| | | this.otherCloneQuery = requestData; |
| | | this.onLoad(this.page,requestData); |
| | | done(); |
| | | }, |
| | | /** ä¿åä»å
¶ä»ç¼ç è§åä¸å
éç æ®µä¿¡æ¯*/ |
| | | saveOtherCodeBasic() { |
| | | let oid = this.selectionList[0].oid; |
| | | let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; |
| | | if (fromDialogPkCodebasic.length <= 0) { |
| | | this.$message.warning("è¯·éæ©ç æ®µæ°æ®!"); |
| | | return; |
| | | } |
| | | let res = fromDialogPkCodebasic.filter((item) => { |
| | | return item.pkCodeRule == oid; |
| | | }); |
| | | if (res != "") { |
| | | this.$message.warning("éè¦å
éçç¼ç è§åä¸è¢«å
éçç¼ç è§åç¸å!"); |
| | | return; |
| | | } |
| | | let oidArr = []; |
| | | fromDialogPkCodebasic.forEach((ele) => { |
| | | oidArr.push(ele.oid); |
| | | }); |
| | | let data = { |
| | | pkCodeRule: oid, |
| | | oidArr: oidArr.join(","), |
| | | }; |
| | | //console.log(data); |
| | | cloneCodeBasic(data).then( |
| | | () => { |
| | | this.cloneOtherCodeRuleSettingBox = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "æä½æå!", |
| | | }); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | /** æ¸
空ç å¼*/ |
| | |
| | | }, |
| | | /** ç¹å»è§¦åå è½½åºç¡ç 段信æ¯*/ |
| | | loadBasic(row) { |
| | | if (this.cloneSettingBox) { |
| | | this.cloneTableLoading = true; |
| | | } else { |
| | | this.loadingBasic = true; |
| | | } |
| | | this.loadingBasic = true; |
| | | // console.log(row.oid); |
| | | if (row != "" || row != null) { |
| | | //åå¨å½åå
³èçç¼ç è§åç¸å
³ä¿¡æ¯ |
| | |
| | | gridCodeBasicSec(1, -1, isAdancedQuery ? condition : conditionMaps).then( |
| | | (res) => { |
| | | const data = res.data.data; |
| | | if (this.cloneSettingBox) { |
| | | this.cloneData = data.records; |
| | | this.cloneTableLoading = false; |
| | | } else { |
| | | this.basicData = data.records; |
| | | // console.log(this.basicData); |
| | | this.loadingBasic = false; |
| | | } |
| | | this.basicData = data.records; |
| | | this.loadingBasic = false; |
| | | } |
| | | ); |
| | | }, |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <vci-docking-search :SearchObject="SearchObject" :page="page"></vci-docking-search> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | |
| | | name: "loge", |
| | | data(){ |
| | | return { |
| | | SearchObject:{ |
| | | type:'loge', |
| | | searchData:[ |
| | | { |
| | | label:'æ°æ®ç¼ç ', |
| | | prop: "id", |
| | | value:0 |
| | | }, |
| | | { |
| | | label:'å类代å·', |
| | | prop: 'classifyId', |
| | | value:1 |
| | | }, |
| | | { |
| | | label:'åç±»åç§°', |
| | | prop: 'classifyName', |
| | | value:2 |
| | | }, |
| | | { |
| | | label:'éæç³»ç»ç¼å·', |
| | | prop: 'systemCode', |
| | | value:3 |
| | | }, |
| | | { |
| | | label:'éæç³»ç»åç§°', |
| | | prop: 'systemName', |
| | | value:4 |
| | | }, |
| | | { |
| | | label:'ç±»å', |
| | | prop: 'typeText', |
| | | value:5 |
| | | }, |
| | | { |
| | | label:'è®°å½æ¶é´', |
| | | value:6, |
| | | prop: 'createTime', |
| | | }, |
| | | { |
| | | label:'æ¯å¦æå', |
| | | prop: 'interfaceStatus', |
| | | value:7 |
| | | }, |
| | | ], |
| | | }, |
| | | loading: false, |
| | | query: {}, |
| | | selectionList: [], |
| | |
| | | calcHeight: 0, |
| | | tip: false, |
| | | searchShow: false, |
| | | searchMenuSpan: 6, |
| | | // searchMenuSpan: 12, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | |
| | | { |
| | | label: "æ°æ®ç¼ç ", |
| | | prop: "id", |
| | | search: true, |
| | | sortable:true, |
| | | width:130 |
| | | }, |
| | | { |
| | | label: "å¾å·", |
| | | prop: "uniqueCode", |
| | | search: true, |
| | | hide:true, |
| | | sortable:true, |
| | | width:150 |
| | |
| | | { |
| | | label: 'å类代å·', |
| | | prop: 'classifyId', |
| | | search: true, |
| | | sortable:true, |
| | | overHidden:true, |
| | | width: 150 |
| | |
| | | { |
| | | label: 'åç±»åç§°', |
| | | prop: 'classifyName', |
| | | search: true, |
| | | sortable:true, |
| | | overHidden: true, |
| | | width: 140 |
| | |
| | | { |
| | | label: 'éæç³»ç»ç¼å·', |
| | | prop: 'systemCode', |
| | | search: true, |
| | | sortable:true, |
| | | width: 130 |
| | | }, |
| | | { |
| | | label: 'éæç³»ç»åç§°', |
| | | prop: 'systemName', |
| | | search: true, |
| | | sortable:true, |
| | | width: 150 |
| | | }, |
| | | { |
| | | label: 'ç±»å', |
| | | prop: 'typeText', |
| | | search: true, |
| | | sortable:true, |
| | | width: 150 |
| | | }, |
| | |
| | | label:'æ¥å£åæ°', |
| | | prop:'paramString', |
| | | overHidden:true, |
| | | search: true, |
| | | sortable:true, |
| | | width: 150 |
| | | }, |
| | |
| | | label:'è¿ååæ°', |
| | | prop:'returnString', |
| | | overHidden:true, |
| | | search: true, |
| | | sortable:true, |
| | | width: 150 |
| | | }, |
| | |
| | | { |
| | | label: 'æ¯å¦æå', |
| | | prop: 'interfaceStatus', |
| | | search: true, |
| | | sortable:true, |
| | | width: 120, |
| | | html:true, |
| | |
| | | */ |
| | | private String codeSecLength; |
| | | |
| | | |
| | | /** |
| | | * å±çº§ç±»å |
| | | */ |
| | |
| | | */ |
| | | private String filterSql ; |
| | | |
| | | |
| | | /** |
| | | * æµæ°´å·èµ·å§å¼ |
| | | */ |
| | |
| | | * æµæ°´çæ¥é¿ |
| | | */ |
| | | private Integer serialStep; |
| | | |
| | | |
| | | /** |
| | | * ç¼ç è¡¥ä½æ¹å¼ |
| | |
| | | */ |
| | | private String parentClassifySecText; |
| | | |
| | | |
| | | /** |
| | | * æ¯å¦å¯ä»¥ä¸ºç©º |
| | | */ |
| | |
| | | * éæ©ç æ®µä¿¡æ¯ç主é®éå |
| | | */ |
| | | private String oidArr; |
| | | |
| | | /** |
| | | * è·å ç æ®µç±»å |
| | | */ |
| | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CodeClassifyValue extends BaseModel { |
| | | |
| | | |
| | | /** |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 5238387322464830032L; |
| | | |
| | | /** |
| | | * åç±»ç æ®µä¸»é® |
| | | */ |
| | |
| | | * åºåå |
| | | */ |
| | | private static final long serialVersionUID = 3392365440606832597L; |
| | | |
| | | /** |
| | | * åºå®ç æ®µä¸»é® |
| | | */ |
| | |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | |
| | | |
| | | /** |
| | | * è·å åºå®ç æ®µä¸»é® |
| | | */ |
| | |
| | | using = ToStringSerializer.class |
| | | ) |
| | | @ApiModelProperty("主é®id") |
| | | @TableId(value = "OID",type = IdType.ASSIGN_UUID) |
| | | @TableId(value = "OID",type = IdType.ASSIGN_ID) |
| | | private String oid; |
| | | |
| | | @TableField(value = "id") |
| | |
| | | public static <T extends BaseModel> T addDefaultAttrAssimt(T object,String btmName) throws VciBaseException { |
| | | BaseModel baseModel = object; |
| | | try { |
| | | baseModel.setOid(VciBaseUtil.getPk().toUpperCase()); |
| | | baseModel.setOid(VciBaseUtil.getPk()); |
| | | baseModel.setCreateTime(new Date()); |
| | | baseModel.setNameOid(VciBaseUtil.getPk()); |
| | | baseModel.setLastModifyTime(new Date()); |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.rmi.ServerException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | |
| | | @PostMapping("/clone") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "å
éç æ®µä¿¡æ¯", notes = "codeBasicSecDTO") |
| | | public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO){ |
| | | public R cloneCodeBasicSec(@RequestBody CodeBasicSecDTO codeBasicSecDTO) throws ServerException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO.getOidArr(),"éæ©ç æ®µä¸»é®"); |
| | | List<String> oidArr = VciBaseUtil.str2List(codeBasicSecDTO.getOidArr()); |
| | | if (CollectionUtils.isEmpty(oidArr)){ |
| | |
| | | import javax.validation.Valid; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.rmi.ServerException; |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | |
| | |
| | | @PostMapping("/clone") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "å
éç¼ç è§å", notes = "ä¼ å
¥codeRuleDTO") |
| | | public R cloneCodeRule(@RequestBody CodeRuleDTO codeRuleDTO){ |
| | | public R cloneCodeRule(@RequestBody CodeRuleDTO codeRuleDTO) throws ServerException { |
| | | return codeRuleService.cloneCodeRule(codeRuleDTO); |
| | | } |
| | | |
| | |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.rmi.ServerException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | * @param codeRuleOid ç¼ç è§åä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | boolean batchDeleteSecByCodeRuleOid(String codeRuleOid); |
| | | boolean batchDeleteSecByCodeRuleOid(String codeRuleOid)throws VciBaseException; |
| | | |
| | | /** |
| | | * æ ¹æ®ç 段åç±»çç±»å夿屿§æ¯å¦æ¯ç©ºç |
| | |
| | | * @param pkCodeRule ç®æ ç¼ç è§å |
| | | * @return å
éç»æåé¦ï¼ï¼successï¼æåï¼failï¼å¤±è´¥ |
| | | */ |
| | | R cloneCodeBasicSec(List<String> oidList, String pkCodeRule); |
| | | R cloneCodeBasicSec(List<String> oidList, String pkCodeRule) throws ServerException; |
| | | |
| | | /** |
| | | * æ¹åç æ®µä¸ç¶åç±»ç æ®µåååç±»ç æ®µä¹é´çå
³èoid为æ°çoid,å¹¶ä¸ä¸ç ´ååç±»ç å¼çå
³èå
³ç³» |
| | | * @param basicSecs |
| | | * @return |
| | | * @throws ServerException |
| | | */ |
| | | boolean changeParentOidAssnOid(List<CodeBasicSec> basicSecs) throws ServerException; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®æ åç±»ç æ®µæå¨çæ ç»æ |
| | |
| | | public interface ICodeClassifyValueService extends IService<CodeClassifyValue> { |
| | | |
| | | /** |
| | | * å
éåç±»ç å¼ |
| | | * @param codeClassifyValues |
| | | * @return |
| | | */ |
| | | boolean cloneCodeClassifyVaue(List<CodeClassifyValue> codeClassifyValues); |
| | | |
| | | /** |
| | | * æ¥è¯¢åç±»ç æ®µçç å¼ æ |
| | | * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ |
| | | * @return åç±»ç æ®µçç å¼ æ¾ç¤ºæ |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeFixedValueVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.data.domain.Page; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | boolean batchDeleteBySecOid(String codefixedsecoid); |
| | | |
| | | /** |
| | | * æ ¹æ®codeFixedSecOidæ¥è¯¢ç å¼ |
| | | * @param codeFixedSecOids |
| | | * @return |
| | | */ |
| | | List<CodeFixedValue> listFixedValueByCodeFixedSecOid(List<String> codeFixedSecOids); |
| | | |
| | | } |
| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.rmi.ServerException; |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @param codeRuleDTO ä¸»æ°æ®ç¼ç è§åæ°æ®ä¼ è¾å¯¹è±¡ï¼oidåtséè¦ä¼ è¾ |
| | | * @return ä¸»æ°æ®ç¼ç è§åæ¾ç¤ºå¯¹è±¡ |
| | | */ |
| | | R cloneCodeRule(CodeRuleDTO codeRuleDTO) throws VciBaseException; |
| | | R cloneCodeRule(CodeRuleDTO codeRuleDTO) throws VciBaseException, ServerException; |
| | | |
| | | /** |
| | | * ç¼ç è§åæ¸
空ææå·²çæçç¼ç |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service; |
| | | |
| | | /** |
| | | * å
å¯ç»å½æå¡ |
| | | * @author ludc |
| | | * @date 2023/9/11 15:46 |
| | | */ |
| | | public interface IPasswordFreeLoginService { |
| | | |
| | | /** |
| | | * å
å¯ç»å½æ¹æ³ |
| | | * @param account è´¦å· |
| | | * @return |
| | | */ |
| | | boolean passwordFreeLogin(String account); |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.rmi.ServerException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | /** |
| | | * ä¸å±åç±»ç æ®µç屿§åç§° |
| | | */ |
| | | private static final String PARENT_FIELD_NAME = "parentclassifysecoid"; |
| | | private static final String PARENT_FIELD_NAME = "parentClassifySecOid"; |
| | | |
| | | /** |
| | | * ä¸çº§åç±»ç å¼ç屿§åç§° |
| | |
| | | // å°è¦ä½ä¸ºå 餿¡ä»¶ç弿¾å¨ä¸ä¸ªéåéé¢ |
| | | Set<String> fixedSecOidSet = fixedSecList.stream().map(CodeBasicSec::getOid).collect(Collectors.toSet()); |
| | | // éè¿å¤é®è¿è¡æ¥è¯¢ |
| | | List<CodeFixedValue> fixedValueS = fixedValueMapper.selectList(Wrappers.<CodeFixedValue>query().lambda().in(CodeFixedValue::getCodeFixedSecOid,fixedSecOidSet)); |
| | | if(!fixedValueS.isEmpty()){ |
| | | List<CodeFixedValue> fixedValues = fixedValueMapper.selectList(Wrappers.<CodeFixedValue>query().lambda().in(CodeFixedValue::getCodeFixedSecOid,fixedSecOidSet)); |
| | | if(!fixedValues.isEmpty()){ |
| | | // æ ¹æ®æ¥è¯¢åºæ¥çidæ§è¡åºå®ç 段æ§è¡å é¤ |
| | | deletFlag = fixedValueMapper.deleteBatchIds(fixedValueS.stream().map(CodeFixedValue::getOid).collect(Collectors.toSet()))>0; |
| | | deletFlag = fixedValueMapper.deleteBatchIds(fixedValues.stream().map(CodeFixedValue::getOid).collect(Collectors.toSet()))>0; |
| | | } |
| | | } |
| | | // 4ãåå é¤åç±»ç æ®µ |
| | |
| | | // å°è¦ä½ä¸ºå 餿¡ä»¶ç弿¾å¨ä¸ä¸ªéåéé¢ |
| | | Set<String> classifySecOidSet = classifySecList.stream().map(CodeBasicSec::getOid).collect(Collectors.toSet()); |
| | | // éè¿å¤é®è¿è¡æ¥è¯¢ |
| | | List<CodeClassifyValue> fixedValueS = codeClassifyValueMapper.selectList(Wrappers.<CodeClassifyValue>query().lambda().in(CodeClassifyValue::getCodeClassifySecOid,classifySecOidSet)); |
| | | if(!fixedValueS.isEmpty()){ |
| | | List<CodeClassifyValue> codeClassifyValues = codeClassifyValueMapper.selectList(Wrappers.<CodeClassifyValue>query().lambda().in(CodeClassifyValue::getCodeClassifySecOid,classifySecOidSet)); |
| | | if(!codeClassifyValues.isEmpty()){ |
| | | // æ ¹æ®æ¥è¯¢åºæ¥ç主é®idæ§è¡åºå®ç 段æ§è¡å é¤ |
| | | deletFlag = fixedValueMapper.deleteBatchIds(fixedValueS.stream().map(CodeClassifyValue::getOid).collect(Collectors.toSet()))>0; |
| | | deletFlag = codeClassifyValueMapper.deleteBatchIds(codeClassifyValues.stream().map(CodeClassifyValue::getOid).collect(Collectors.toSet()))>0; |
| | | } |
| | | } |
| | | return deletFlag; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R cloneCodeBasicSec(List<String> oidList, String pkCodeRule) throws ServiceException { |
| | | public R cloneCodeBasicSec(List<String> oidList, String pkCodeRule) throws ServiceException, ServerException { |
| | | boolean isLinked = checkIsLinked(pkCodeRule,null); |
| | | if (isLinked) { |
| | | return R.fail("ç¼ç è§å已被å¼ç¨ï¼ä¸å
许ç¼è¾æå é¤"); |
| | |
| | | if(basicSecDOS.isEmpty()){ |
| | | return R.fail("å
éçç æ®µä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | basicSecDOS.forEach(sec -> { |
| | | List<CodeBasicSec> codeClassifySec = new ArrayList<>(); |
| | | Map<String,List<CodeFixedValue>> codeFixedValueMaps = new HashMap<>(); |
| | | for (CodeBasicSec sec : basicSecDOS) { |
| | | CodeBasicSec newSecDO = new CodeBasicSec(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(sec,newSecDO); |
| | | newSecDO.setOid(VciBaseUtil.getPk()); |
| | | newSecDO.setNameOid(VciBaseUtil.getPk()); |
| | | newSecDO.setRevisionOid(VciBaseUtil.getPk()); |
| | | newSecDO.setId(newSecDO.getId() + "_copy"); |
| | | newSecDO.setName(newSecDO.getName() + "_copy"); |
| | | String oldBasicOid = newSecDO.getOid(); |
| | | newSecDO.setId(newSecDO.getId()); |
| | | newSecDO.setName(newSecDO.getName()); |
| | | newSecDO.setPkCodeRule(pkCodeRule); |
| | | // 夿æ¯å¦æ¯åç±»ç æ®µ,ä¸å¡é»è¾ç¨å¾®å¤æä¸ç¹æä»¥éè¦å
æåºæ¥åç¬å¤ç |
| | | if(newSecDO.getSecType().equals(CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue())){ |
| | | // å卿§çç æ®µoidåæ°çç æ®µçoidçå
³èå
³ç³» |
| | | codeClassifySec.add(newSecDO); |
| | | continue; |
| | | } |
| | | // æ´æ¹å建æ¶é´ï¼ä¿®æ¹æ¶é´çé»è®¤å¼ |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(newSecDO,MdmBtmTypeConstant.CODE_BASIC_SEC); |
| | | //åºå®ç 段 |
| | | if(newSecDO.getSecType().equals(CodeSecTypeEnum.CODE_FIXED_SEC.getValue())){ |
| | | // åºå®ç 段åå¨å¥½oidåç å¼çå
³èå
³ç³» |
| | | codeFixedValueMaps.put(newSecDO.getOid(),fixedValueService.list(Wrappers.<CodeFixedValue>query() |
| | | .lambda().eq(CodeFixedValue::getCodeFixedSecOid, oldBasicOid) |
| | | )); |
| | | } |
| | | createList.add(newSecDO); |
| | | }); |
| | | } |
| | | // å¤çåç±»ç æ®µçoidï¼å 为oidå
³èparentClassifyOidï¼ä¸ç å¼codeClassifyOidï¼ç å¼åéè¦éè¿æ§çç æ®µoidæ¥æ¥è¯¢ï¼æä»¥ä¸è½ç´æ¥æ¹åoid |
| | | boolean resChangeAssn = changeParentOidAssnOid(codeClassifySec); |
| | | // å°å¤çè¿çåç±»ç æ®µä¹æ·»å è¿è¦åæ°å¢å¤ççç æ®µéåä¸ |
| | | createList.addAll(codeClassifySec); |
| | | boolean resBoolean = saveBatch(createList); |
| | | //codeBasicSecMapper.insertBatch(createList); |
| | | return resBoolean ? R.data(resBoolean,"å
éç æ®µä¿¡æ¯æå"):R.fail("å
éç æ®µä¿¡æ¯å¤±è´¥ï¼"); |
| | | // æç»è¦åå
¥ç å¼è¡¨ä¸çï¼ç å¼å¯¹è±¡ |
| | | List<CodeFixedValue> codeFixedDOValues = new ArrayList<>(); |
| | | // æé ç å¼å¯¹è±¡ï¼ä¸ç 段主é®å
³èå
³ç³»ï¼ä»¥åæ¹ååºå®ç å¼çoid |
| | | codeFixedValueMaps.forEach((key, value) -> { |
| | | value.stream().forEach(item -> { |
| | | item.setOid(""); |
| | | item.setCodeFixedSecOid(key); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(item); |
| | | codeFixedDOValues.add(item); |
| | | }); |
| | | }); |
| | | // å
éåºå®ç å¼ |
| | | boolean resFixed = fixedValueService.saveBatch(codeFixedDOValues); |
| | | return (resBoolean&&resFixed&&resChangeAssn) ? R.data(resBoolean,"å
éç æ®µä¿¡æ¯æå"):R.fail("å
éç æ®µä¿¡æ¯å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹åç æ®µä¸ç¶åç±»ç æ®µåååç±»ç æ®µä¹é´çå
³èoid为æ°çoid,å¹¶ä¸ä¸ç ´ååç±»ç å¼çå
³èå
³ç³» |
| | | * @param basicSecs |
| | | * @return |
| | | * @throws ServerException |
| | | */ |
| | | @Override |
| | | public boolean changeParentOidAssnOid(List<CodeBasicSec> basicSecs) throws ServerException { |
| | | Map<String, List<CodeClassifyValue>> codeClassValues = new HashMap<>(); |
| | | List<CodeClassifyValue> codeClassifyDOValues = new ArrayList<>(); |
| | | HashMap<String, String> oidMap = new HashMap<>(); |
| | | boolean resClone = false; |
| | | try { |
| | | // éå对象æ°ç»ï¼ä¸ºæ¯ä¸ªå¯¹è±¡çææ°çoidï¼å¹¶å°åå§oidåæ°oidçæ å°å
³ç³»åå¨å°Mapä¸ |
| | | for (CodeBasicSec obj : basicSecs) { |
| | | String originalOid = obj.getOid(); |
| | | String newOid = VciBaseUtil.getPk(); |
| | | oidMap.put(originalOid, newOid); |
| | | } |
| | | // éå对象æ°ç»ï¼æ´æ°æ¯ä¸ªå¯¹è±¡çoidåcodeClassifySecOid屿§å¼ |
| | | for (CodeBasicSec obj : basicSecs) { |
| | | String originalOid = obj.getOid(); |
| | | String newOid = oidMap.get(originalOid); |
| | | // æ°çoidå
³èè¦å
éç å¼ |
| | | codeClassValues.put(newOid,codeClassifyValueService.list(Wrappers.<CodeClassifyValue>query() |
| | | .lambda().eq(CodeClassifyValue::getCodeClassifySecOid, originalOid))); |
| | | obj.setOid(newOid); |
| | | String originalParentClassifyValueOid = obj.getParentClassifySecOid(); |
| | | String newParentClassifyValueOid = oidMap.get(originalParentClassifyValueOid); |
| | | obj.setParentClassifySecOid(newParentClassifyValueOid); |
| | | } |
| | | codeClassValues.forEach((key, value) -> { |
| | | value.stream().forEach(item -> { |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(item); |
| | | item.setCodeClassifySecOid(key); |
| | | codeClassifyDOValues.add(item); |
| | | }); |
| | | }); |
| | | resClone = codeClassifyValueService.cloneCodeClassifyVaue(codeClassifyDOValues); |
| | | }catch (Exception e){ |
| | | throw new ServerException("ç¶åç±»ç æ®µåååç±»ç æ®µclone转æ¢oidæ¶åºéï¼"+e.getCause()); |
| | | } |
| | | return resClone; |
| | | } |
| | | |
| | | /** |
| | |
| | | private static final String PARENT_FIELD_NAME = "parentClassifyValueOid"; |
| | | |
| | | /** |
| | | * å
éåç±»ç å¼ |
| | | * @param codeClassifyValues |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean cloneCodeClassifyVaue(List<CodeClassifyValue> codeClassifyValues) { |
| | | // å建Map对象ï¼ç¨äºåå¨åå§oidåæ°oidçæ å°å
³ç³» |
| | | Map<String, String> oidMap = new HashMap<>(); |
| | | // éå对象æ°ç»ï¼ä¸ºæ¯ä¸ªå¯¹è±¡çææ°çoidï¼å¹¶å°åå§oidåæ°oidçæ å°å
³ç³»åå¨å°Mapä¸ |
| | | for (CodeClassifyValue obj : codeClassifyValues) { |
| | | String originalOid = obj.getOid(); |
| | | String newOid = VciBaseUtil.getPk(); |
| | | oidMap.put(originalOid, newOid); |
| | | } |
| | | // éå对象æ°ç»ï¼æ´æ°æ¯ä¸ªå¯¹è±¡çoidåcodeClassifySecOid屿§å¼ |
| | | for (CodeClassifyValue obj : codeClassifyValues) { |
| | | String originalOid = obj.getOid(); |
| | | String newOid = oidMap.get(originalOid); |
| | | obj.setOid(newOid); |
| | | String originalParentClassifyValueOid = obj.getParentClassifyValueOid(); |
| | | String newParentClassifyValueOid = oidMap.get(originalParentClassifyValueOid); |
| | | obj.setParentClassifyValueOid(newParentClassifyValueOid); |
| | | } |
| | | return this.saveBatch(codeClassifyValues); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åç±»ç æ®µçç å¼ æ |
| | | * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ |
| | | * @return åç±»ç æ®µçç å¼ æ¾ç¤ºæ |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.vci.ubcs.code.dto.CodeFixedValueDTO; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®codeFixedSecOidæ¥è¯¢ç å¼ |
| | | * @param codeFixedSecOids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<CodeFixedValue> listFixedValueByCodeFixedSecOid(List<String> codeFixedSecOids){ |
| | | if(codeFixedSecOids.isEmpty()){ |
| | | return new ArrayList<CodeFixedValue>(); |
| | | } |
| | | /*List<CodeFixedValue> codeFixedValues = codeFixedValueMapper.selectList( |
| | | Wrappers.<CodeFixedValue>query().lambda() |
| | | .in(CodeFixedValue::getCodeFixedSecOid, codeFixedSecOids) |
| | | );*/ |
| | | List<CodeFixedValue> codeFixedValues = codeFixedValueMapper.selectByPageByCodeFixedSecOid(codeFixedSecOids, new Page<>(1, -1)); |
| | | return codeFixedValues; |
| | | } |
| | | |
| | | /** |
| | | * å¢å åºå®ç 段çç å¼ |
| | | * @param codeFixedValueDTO åºå®ç 段çç 弿°æ®ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.WebUtil; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.rmi.ServerException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | @Resource |
| | | private RevisionModelUtil revisionModelUtil; |
| | | |
| | | @Value("${user-info.tenant-id}") |
| | | private String tenantId; |
| | | @Value("${user-info.id}") |
| | | private String userId; |
| | | @Resource |
| | | private NacosConfigCache nacosConfigCache; |
| | | |
| | | @Resource |
| | | private ICodeFixedValueService codeFixedValueService; |
| | | |
| | | @Resource |
| | | private ICodeClassifyValueService codeClassifyValueService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | |
| | | @Override |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) { |
| | | //妿çäºèªå·±é
ç½®ç管çç»ç§æ·idå管çç»è¶
管账å·ï¼å°±ä¸éè¦æç
§è§åææè
æ¥è¿è¡æ¥è¯¢ |
| | | if(!(AuthUtil.getTenantId().equals(this.tenantId) && AuthUtil.getUserId().toString().equals(this.userId))){ |
| | | if(!(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId()) |
| | | && AuthUtil.getUserId().toString().equals(nacosConfigCache.getAdminUserInfo().getUserId().toString())) |
| | | ){ |
| | | // æç
§è§åææè
æ¥æ¥è¯¢ |
| | | conidtionMap.put("owner",AuthUtil.getUserId()); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public boolean checkCodeRuleRepeat(CodeRuleDTO codeRuleDTO){ |
| | | LambdaQueryWrapper<CodeRule> wrapper = Wrappers.<CodeRule>query() |
| | | .lambda().eq(CodeRule::getId, codeRuleDTO.getId()); |
| | | if(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId())){ |
| | | wrapper.eq(CodeRule::getTenantId,codeRuleDTO.getTenantId()); |
| | | } |
| | | // æ ¹æ®è§åidæ¥è¯¢ç¼å· |
| | | List<CodeRule> codeRulesList = this.codeRuleMapper.selectList(Wrappers.<CodeRule>query() |
| | | .lambda().eq(CodeRule::getId, codeRuleDTO.getId()) |
| | | .eq(CodeRule::getTenantId,AuthUtil.getTenantId().equals(this.tenantId) ? "":codeRuleDTO.getTenantId())); |
| | | List<CodeRule> codeRulesList = this.codeRuleMapper.selectList(wrapper); |
| | | if(!codeRulesList.isEmpty()){ |
| | | return codeRulesList.parallelStream().anyMatch(codeRule -> { |
| | | if(StringUtils.isNotBlank(codeRuleDTO.getOid())){ |
| | | // 代表æ¯ä¿®æ¹ï¼ä¸æ¯å°ç¼å·ä¿®æ¹ç¸åçç¼å· |
| | | // 代表æ¯ä¿®æ¹è§åï¼ä¸æ¯å°ç¼å·ä¿®æ¹ä¸ºå·²åå¨ççç¼å· |
| | | return !codeRule.getOid().equals(codeRuleDTO.getOid()); |
| | | }else { |
| | | return true; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R cloneCodeRule(CodeRuleDTO codeRuleDTO) { |
| | | public R cloneCodeRule(CodeRuleDTO codeRuleDTO) throws ServerException { |
| | | if(checkCodeRuleRepeat(codeRuleDTO)){ |
| | | return R.fail("è§åç¼å·å·²åå¨ï¼"); |
| | | } |
| | | VciBaseUtil.alertNotNull(codeRuleDTO, "éè¦æ·»å çæ°æ®å¯¹è±¡"); |
| | | CodeRule codeRuleDO = new CodeRule(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeRuleDO,MdmBtmTypeConstant.CODE_RULE); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeRuleDTO, codeRuleDO); |
| | | boolean exFlag = codeRuleMapper.insert(codeRuleDO)>0; |
| | | List<CodeBasicSecDTO> secList = codeRuleDTO.getElements(); |
| | | List<CodeBasicSec> codeBasicSecs = new ArrayList<>(); |
| | | secList.forEach(codeBasicSecDTO -> { |
| | | List<CodeBasicSec> codeClassifySec = new ArrayList<>(); |
| | | // åºå®ç 弿 å°å
³ç³» |
| | | Map<String,List<CodeFixedValue>> codeFixedValueMaps = new HashMap<>(); |
| | | for (CodeBasicSecDTO codeBasicSecDTO : secList) { |
| | | codeBasicSecDTO.setPkCodeRule(codeRuleDO.getOid()); |
| | | KeyValue attrKv = codeBasicSecService.checkAttrNullableBySecType(codeBasicSecDTO); |
| | | if (!"success".equals(attrKv.getKey())) { |
| | |
| | | } |
| | | CodeBasicSec codeBasicSecDO = new CodeBasicSec(); |
| | | BeanUtilForVCI.copyPropertiesIgnoreCase(codeBasicSecDTO, codeBasicSecDO); |
| | | codeBasicSecDO.setOid(""); |
| | | codeBasicSecDO.setRevisionOid(""); |
| | | codeBasicSecDO.setNameOid(""); |
| | | String oldBasicOid = codeBasicSecDO.getOid(); //被å
éçç æ®µçoid |
| | | // 夿æ¯å¦æ¯åç±»ç æ®µ |
| | | if(codeBasicSecDO.getSecType().equals(CodeSecTypeEnum.CODE_CLASSIFY_SEC.getValue())){ |
| | | // å卿§çç æ®µoidåæ°çç æ®µçoidçå
³èå
³ç³» |
| | | codeClassifySec.add(codeBasicSecDO); |
| | | continue; |
| | | } |
| | | // æ´æ¹å建æ¶é´ï¼ä¿®æ¹æ¶é´çé»è®¤å¼ |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeBasicSecDO,MdmBtmTypeConstant.CODE_BASIC_SEC); |
| | | // åºå®ç 段 |
| | | if(codeBasicSecDO.getSecType().equals(CodeSecTypeEnum.CODE_FIXED_SEC.getValue())){ |
| | | // åºå®ç 段åå¨å¥½oidåç å¼çå
³èå
³ç³» |
| | | codeFixedValueMaps.put(codeBasicSecDO.getOid(),codeFixedValueService.list(Wrappers.<CodeFixedValue>query() |
| | | .lambda().eq(CodeFixedValue::getCodeFixedSecOid, oldBasicOid) |
| | | )); |
| | | } |
| | | codeBasicSecs.add(codeBasicSecDO); |
| | | }); |
| | | } |
| | | // å¤çåç±»ç æ®µçoidï¼å 为oidå
³èparentClassifyOidï¼ä¸ç å¼codeClassifyOidï¼ç å¼åéè¦éè¿æ§çç æ®µoidæ¥æ¥è¯¢ï¼æä»¥ä¸è½ç´æ¥æ¹åoid |
| | | boolean resChangeAssn = codeBasicSecService.changeParentOidAssnOid(codeClassifySec); |
| | | // å°å¤çè¿çåç±»ç æ®µä¹æ·»å è¿è¦åæ°å¢å¤ççç æ®µéåä¸ |
| | | codeBasicSecs.addAll(codeClassifySec); |
| | | // æ°å¢ç 段 |
| | | boolean exFlag1 = this.codeBasicSecService.saveBatch(codeBasicSecs); |
| | | return R.data(exFlag&&exFlag1); |
| | | // æç»è¦åå
¥ç å¼è¡¨ä¸çï¼ç å¼å¯¹è±¡ |
| | | List<CodeFixedValue> codeFixedDOValues = new ArrayList<>(); |
| | | // æé ç å¼å¯¹è±¡ï¼ä¸ç 段主é®å
³èå
³ç³»ï¼ä»¥åæ¹åç å¼çoid |
| | | codeFixedValueMaps.forEach((key, value) -> { |
| | | value.stream().forEach(item -> { |
| | | item.setOid(""); |
| | | item.setCodeFixedSecOid(key); |
| | | DefaultAttrAssimtUtil.updateDefaultAttrAssimt(item); |
| | | codeFixedDOValues.add(item); |
| | | }); |
| | | }); |
| | | boolean exFlag2 = codeFixedValueService.saveBatch(codeFixedDOValues) && resChangeAssn; |
| | | return R.data(exFlag&&exFlag1&&exFlag2); |
| | | } |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.vci.ubcs.code.service.IPasswordFreeLoginService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * å
å¯ç»å½æå¡ |
| | | * @author ludc |
| | | * @date 2023/9/11 15:45 |
| | | */ |
| | | @Service |
| | | public class PasswordFreeLoginServiceImpl implements IPasswordFreeLoginService { |
| | | |
| | | |
| | | /** |
| | | * å
å¯ç»å½æ¹æ³ |
| | | * @param account è´¦å· |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean passwordFreeLogin(String account) { |
| | | |
| | | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |