Merge remote-tracking branch 'origin/master'
| | |
| | | }) |
| | | } |
| | | |
| | | export const gridCodeRule = (params) => { |
| | | export const getRegexStr = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/mdmRule/gridCodeRule', |
| | | url: '/api/ubcs-code/codeRuleCharacterController/getRegexStr', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | }, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getSelectList = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/codeRuleCharacterController/selectList', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getDataList = (page, limit, params) => { |
| | | export const getDataList = (page, limit,sort,order, params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/dockingManagement/gridDockingData', |
| | | method: 'get', |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getTaskList = (page, limit, params) => { |
| | | export const getTaskList = (page, limit,sort,order, params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/dockingManagement/gridDockingTask', |
| | | method: 'get', |
| | |
| | | } |
| | | }) |
| | | } |
| | | //èåè§è²æé®æé |
| | | export const getButtonsByRoleId = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/menu/getButtonsByRoleId', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | import request from "@/router/axios"; |
| | | |
| | | //è·åæ å½¢ç»ä»¶æ°æ® |
| | | export const getAtrrList = () => { |
| | | export const getAtrrList = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/codeClassify/treeCodeClassify', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | //æ èç¹æ·»å |
| | |
| | | <el-select v-model="SelectValue" placeholder="è¯·éæ©" style="width: 135px"> |
| | | <el-option |
| | | v-for="item in SelectOption" |
| | | :key="item.value" |
| | | :key="item.key" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | style="width: 150px"> |
| | |
| | | <el-button plain size="small" style="margin-left: 20px" type="primary" @click="SelectSearchHandler">æ¥è¯¢ |
| | | </el-button> |
| | | </template> |
| | | <avue-crud :data="TableData" :option="this.codeType === 'btmCode' ? this.btmOption : this.option" @row-click="rowHandlerClick"> |
| | | <avue-crud :data="TableData" :option="this.codeType === 'btmCode' ? this.btmOption : this.option" @row-click="rowHandlerClick" :table-loading="loading"> |
| | | <template slot="radio" slot-scope="{row}"> |
| | | <el-radio v-model="radioValue" :label="row.$index" style="padding-left: 10px !important;">{{ '' }} |
| | | </el-radio> |
| | |
| | | crudName: '', |
| | | crudOid: '', |
| | | TableData: [], |
| | | loading:false, |
| | | option: { |
| | | addBtn: false, |
| | | index: true, |
| | |
| | | border: true, |
| | | menu: false, |
| | | height: 380, |
| | | rowKey: "oid", |
| | | column: [ |
| | | { |
| | | label: '', |
| | |
| | | border: true, |
| | | menu: false, |
| | | height:380, |
| | | rowKey: "oid", |
| | | column:[ |
| | | { |
| | | label: '', |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.loading = true; |
| | | }, |
| | | mounted() { |
| | | }, |
| | |
| | | }, |
| | | // æ¨¡ç³æ¥è¯¢ |
| | | SelectSearchHandler() { |
| | | if (!this.SelectOption) { |
| | | return; // 妿SelectOptionæ°æ®ä¸åå¨ç´æ¥è¿å é¿å
æ¥é |
| | | this.loading = true; |
| | | if (!this.SelectOption || this.SelectOption.length === 0) { |
| | | this.loading = false; |
| | | return; |
| | | } |
| | | |
| | | const Parameter = {}; |
| | | Parameter[`conditionMap['${this.SelectValue}']`] = this.SelectSearchValue; |
| | | |
| | | if(this.codeType === "btmCode"){ |
| | | this.btmDefaultRend(Parameter) |
| | | }else { |
| | |
| | | ...Parameter |
| | | }).then(res => { |
| | | this.TableData = res.data.records; |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | btmDefaultRend(Parameter) { |
| | | referDataGrid({valueField: 'id', isMuti: 'false', 'limit': '-1', ...Parameter}).then(res => { |
| | | this.TableData = res.data.data.records |
| | | this.TableData = res.data.data.records; |
| | | this.loading = false; |
| | | }) |
| | | }, |
| | | } |
| | |
| | | const result = this.$route.query.id.substring(0, index); |
| | | this.idData = result; |
| | | this.removeList(); |
| | | getTreeList({'conditionMap[id]': this.idData}).then(res => { |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[id]"] = this.idData; |
| | | conditionMaps["conditionMap[authType]"] = "data_auth"; |
| | | conditionMaps["conditionMap[buttonCode]"] = this.idData; |
| | | // æ°æ®ææä¸æ¯å¦å
·å¤æ¥çæé |
| | | conditionMaps["conditionMap[menuCode]"] = "data_view"; |
| | | getTreeList(conditionMaps).then(res => { |
| | | if (res) { |
| | | if (res.data.length === 0) { |
| | | this.$message.error("ä¸»æ°æ®åç±»æ¥è¯¢ä¸ºç©ºï¼"); |
| | |
| | | <style lang="scss" scoped> |
| | | .app { |
| | | overflow: auto; |
| | | height: calc(100vh - 150px); |
| | | height: calc(100vh - 145px); |
| | | } |
| | | |
| | | .app::-webkit-scrollbar { |
| | |
| | | .main { |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: calc(100vh - 150px); |
| | | height: calc(100vh - 145px); |
| | | min-height: 400px; |
| | | } |
| | | |
| | |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | title="åç±»ææ" |
| | | top="-45px" @close="closeDialog"> |
| | | top="-45px" |
| | | @close="closeDialog" |
| | | > |
| | | <el-table |
| | | :key="itemKey" |
| | | ref="dataTable" |
| | | v-loading="isLoading" |
| | | :data="classifyAuthData" |
| | |
| | | :height="tableHeight" |
| | | border |
| | | class="cus-table" |
| | | @select="handleSelection" |
| | | @row-click="handleRowClick" |
| | | @select-all="handleSelectionAll" |
| | | @selection-change="handleSelectionChange" |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | ></el-table-column> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in classifyAuthHeader" |
| | | v-if="classifyAuthHeader.length !== 0" |
| | |
| | | v-if="item.type === 'select'" |
| | | slot="prepend" |
| | | v-model="row[item.prop]" |
| | | @change="selectChange(row.roleData, row)" |
| | | > |
| | | <el-option |
| | | v-for="optionItem in roleList" |
| | |
| | | </el-input> |
| | | <el-checkbox |
| | | v-if="item.type === 'checkbox'" |
| | | v-model="row[item.prop]"> |
| | | v-model="row[item.prop]" |
| | | :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]" |
| | | > |
| | | </el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="info" plain @click="selectAllButton">æé®å
¨é</el-button> |
| | | <el-button class="el-icon-plus" type="success" plain @click="addClassifyAuth"></el-button> |
| | | <el-button class="el-icon-minus" type="warning" plain @click="subClassifyAuth"></el-button> |
| | | <el-button type="primary" plain @click="submit">æ 交</el-button> |
| | | <el-button type="danger" plain @click="isShowDialog = false">å
³ é</el-button> |
| | | <el-button plain type="info" @click="selectAllButton">æé®å
¨é</el-button> |
| | | <el-button |
| | | class="el-icon-plus" |
| | | plain |
| | | type="success" |
| | | @click="addClassifyAuth" |
| | | ></el-button> |
| | | <el-button |
| | | class="el-icon-minus" |
| | | plain |
| | | type="warning" |
| | | @click="subClassifyAuth" |
| | | ></el-button> |
| | | <el-button plain type="primary" @click="submit">æ 交</el-button> |
| | | <el-button plain type="danger" @click="isShowDialog = false" |
| | | >å
³ é</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getButtonByParentCode} from "@/api/system/menu" |
| | | import {getPage} from "@/api/system/role" |
| | | import {saveOrUpdate, getClassifyAuthList} from "@/api/system/classifyAuth" |
| | | import {v4 as uuidv4} from 'uuid'; |
| | | import { getButtonByParentCode } from "@/api/system/menu"; |
| | | import { getPage } from "@/api/system/role"; |
| | | import { |
| | | saveOrUpdate, |
| | | getClassifyAuthList, |
| | | getButtonsByRoleId, |
| | | } from "@/api/system/classifyAuth"; |
| | | import { v4 as uuidv4 } from "uuid"; |
| | | |
| | | export default { |
| | | name: "classifyAuthDialog.vue", |
| | |
| | | // å¯¹è¯æ¡æ¾ç¤ºæ§å¶ |
| | | isShowDialog: this.visible, |
| | | isLoading: false, |
| | | tableHeight: 'calc(100vh - 550px)', |
| | | tableHeight: "calc(100vh - 550px)", |
| | | classifyAuthData: [], |
| | | //å头 |
| | | classifyAuthHeader: [], |
| | |
| | | roleList: [], |
| | | //å½åéä¸çè¡¨æ ¼è¡ |
| | | selectList: [], |
| | | itemKey: "", |
| | | addIndex: Number, |
| | | currentRow: {}, |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | mounted() {}, |
| | | created() {}, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ |
| | | visible() { |
| | | if (this.visible) { |
| | | this.isShowDialog = this.visible; |
| | | return new Promise((resolve, reject) => { |
| | | getButtonByParentCode({code: "classifyTree"}).then(res => { |
| | | getButtonByParentCode({ code: "classifyTree" }) |
| | | .then((res) => { |
| | | // è®°å½æé®æ°æ® |
| | | this.classifyAuthButton = res.data.data; |
| | | const list = res.data.data; |
| | |
| | | type: "text", |
| | | width: 180, |
| | | }); |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | let columnItem = { |
| | | label: item.name, |
| | | prop: item.id, |
| | | code: item.code, |
| | | type: "checkbox", |
| | | width: 180, |
| | | }; |
| | | tempData.push(columnItem); |
| | | }) |
| | | this.classifyAuthHeader = tempData |
| | | }); |
| | | this.classifyAuthHeader = tempData; |
| | | resolve(); |
| | | }).catch(err => { |
| | | reject(err) |
| | | }) |
| | | .catch((err) => { |
| | | reject(err); |
| | | }); |
| | | // è·åè§è²å表 |
| | | getPage(1, -1, null).then(res => { |
| | | getPage(1, -1, null).then((res) => { |
| | | this.roleList = res.data.data.records; |
| | | }); |
| | | // è·å该åç±»ä¸å·²ææçåç±»ææä¿¡æ¯ |
| | | getClassifyAuthList({classifyId: this.classifyData.oid}).then(res => { |
| | | getClassifyAuthList({ |
| | | classifyId: this.classifyData.oid, |
| | | authType: "classify_auth", |
| | | }).then((res) => { |
| | | //console.log(res.data.data); |
| | | let authDatas = res.data.data; |
| | | if (authDatas.length > 0) { |
| | | authDatas.forEach(authData => { |
| | | authDatas.forEach((authData, index) => { |
| | | let item = { |
| | | oid: authData.oid, |
| | | roleData: authData.roleId, |
| | | classifyItem: this.classifyData.label, |
| | | authButton:{}, |
| | | index: index, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | }; |
| | | //å°æé®è®¾ç½®è¿å» |
| | | authData.buttonIdList.forEach(data => { |
| | | authData.buttonIdList.forEach((data) => { |
| | | Vue.set(item, data, true); |
| | | }); |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item); |
| | | }) |
| | | this.addIndex = this.classifyAuthData.length - 1; //æ·»å è¡ä¸æ çäºclassifyAuthDataçé¿åº¦-1 |
| | | this.roleHandlerMethods(authData.roleId, "create", index); |
| | | // console.log('index', index) |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | roleHandlerMethods(id, type, index) { |
| | | if (this.classifyAuthData.length < 0) { |
| | | return; |
| | | } |
| | | |
| | | getButtonsByRoleId({ roleId: id, code: "classifyTree" }).then((res) => { |
| | | // æ¾å°this.classifyAuthButton䏿²¡æå¯¹åºç屿§ |
| | | const filteredItems = this.classifyAuthButton.filter((item) => { |
| | | return !res.data.data.find((x) => x.id === item.id); |
| | | }); |
| | | |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | const isMatched = filteredItems.some((x) => x.id === item.prop); |
| | | this.$nextTick(() => { |
| | | if (this.classifyAuthData[index]) { |
| | | if (isMatched) { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,true); |
| | | }); |
| | | } else { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,false); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //æ·»å âæ¥çå
¨é¨ç¦ç¨æ¡ä»¶â |
| | | if (this.classifyAuthData.authButton) { |
| | | 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(); |
| | | }); |
| | | }, |
| | | async selectChange(row, currentRow) { |
| | | try { |
| | | this.currentRow = currentRow; |
| | | const res = await getButtonsByRoleId({ |
| | | roleId: row, |
| | | code: "classifyTree", |
| | | }); |
| | | |
| | | const filteredItems = this.classifyAuthButton.filter((item) => { |
| | | return !res.data.data.find((x) => x.id === item.id); |
| | | }); |
| | | |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | const isMatched = filteredItems.some((x) => x.id === item.prop); |
| | | this.$nextTick(() => { |
| | | if (currentRow) { |
| | | if (isMatched) { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = true; |
| | | if (!currentRow.authButton.classify_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } else { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = false; |
| | | if (!currentRow.authButton.classify_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | this.itemKey = uuidv4(); // 强å¶å·æ°è¡¨æ ¼ |
| | | }); |
| | | }); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }, |
| | | // å
³éå¯¹è¯æ¡ |
| | | closeDialog() { |
| | | this.$emit('update:visible', false); |
| | | this.$emit("update:visible", false); |
| | | this.classifyAuthData = []; |
| | | }, |
| | | // å¢å è¡ |
| | |
| | | this.$message.warning("å½åç§æ·ä¸åå¨è§è²ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | // console.log('this.roleList', this.roleList) |
| | | this.addIndex++; //èªå®ä¹çææ·»å è¡ä¸æ |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | | authButton:{}, |
| | | index: this.addIndex, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | }; |
| | | //å°æé®è®¾ç½®è¿å» |
| | | this.classifyAuthButton.forEach(data => { |
| | | this.classifyAuthButton.forEach((data) => { |
| | | Vue.set(item, data.id, false); |
| | | }) |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item) |
| | | // console.log(this.classifyAuthData); |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex); |
| | | }, |
| | | // å é¤è¡ |
| | | subClassifyAuth() { |
| | | for (let item of this.selectList) { |
| | | let index = this.classifyAuthData.findIndex(data => data.index === item.index); |
| | | let index = this.classifyAuthData.findIndex( |
| | | (data) => data.index === item.index |
| | | ); |
| | | if (index !== -1) { |
| | | this.classifyAuthData.splice(index, 1); |
| | | } |
| | |
| | | // ä¿ååç±»ææä¿¡æ¯ |
| | | submit() { |
| | | if (this.classifyAuthData.length <= 0) { |
| | | this.$message.warning('ææå表为空ï¼') |
| | | this.$message.warning("ææå表为空ï¼"); |
| | | return; |
| | | } |
| | | let isRepeat = false; |
| | |
| | | } |
| | | let form = []; |
| | | let flag = false; |
| | | this.classifyAuthData.forEach(item => { |
| | | this.classifyAuthData.forEach((item) => { |
| | | let itemButtonList = []; |
| | | //çéåºæé®å¾é为trueçå |
| | | for (let key in item) { |
| | |
| | | roleId: item.roleData, |
| | | classifyId: this.classifyData.oid, |
| | | buttonIds: itemButtonList.join(","), |
| | | } |
| | | authType: "classify_auth", |
| | | }; |
| | | form.push(data); |
| | | }); |
| | | if (flag) { |
| | | this.$message.warning('ææªå¾éæä½çæéï¼ä¸å
许ææ') |
| | | this.$message.warning("ææªå¾éæä½çæéï¼ä¸å
许ææ"); |
| | | return; |
| | | } |
| | | // console.log(form) |
| | | // è°ç¨ä¿ååç±»ææçæ¥å£ |
| | | saveOrUpdate(form).then(res => { |
| | | saveOrUpdate(form).then( |
| | | (res) => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: res.data.msg, |
| | | }); |
| | | // this.isShowDialog = false |
| | | }, (error) => { |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | }) |
| | | } |
| | | ); |
| | | }, |
| | | // å
¨éæé® |
| | | selectAllButton(){ |
| | |
| | | this.$message.warning("请åªéæ©ä¸è¡éè¦å
¨éçæé®çæ°æ®è¡ï¼"); |
| | | return; |
| | | } |
| | | this.classifyAuthButton.forEach(item => { |
| | | this.classifyAuthButton.forEach((item) => { |
| | | //console.log("item",item); |
| | | Vue.set(this.selectList[0], item.id, true); |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | // æ»å¨æ¡æ ·å¼ä¿®æ¹ |
| | | // æ»å¨æ¡ç宽度 |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar { |
| | |
| | | background: white; |
| | | border: white; |
| | | width: 10px; |
| | | |
| | | } |
| | | |
| | | // æ»å¨æ¡çæ»å |
| | |
| | | /deep/ .el-table__body-wrapper { |
| | | height: calc(100% - 50px) !important; |
| | | } |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :close-on-click-modal="false" |
| | | :visible.sync="isShowDialog" |
| | | append-to-body |
| | | class="avue-dialog avue-dialog--top" |
| | | title="æ°æ®ææ" |
| | | top="-45px" @close="closeDialog"> |
| | | <el-table |
| | | ref="dataTable" |
| | | v-loading="isLoading" |
| | | :data="classifyAuthData" |
| | | :header-cell-style="{ background: '#FAFAFA', color: '#505050' }" |
| | | :height="tableHeight" |
| | | border |
| | | class="cus-table" |
| | | @select="handleSelection" |
| | | @row-click="handleRowClick" |
| | | @select-all="handleSelectionAll" |
| | | @selection-change="handleSelectionChange" |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | ></el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in classifyAuthHeader" |
| | | v-if="classifyAuthHeader.length !== 0" |
| | | :key="index" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :show-overflow-tooltip="true" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-select |
| | | v-if="item.type === 'select'" |
| | | slot="prepend" |
| | | v-model="row[item.prop]" |
| | | @change="roleChange(row.roleData,row)" |
| | | > |
| | | <el-option |
| | | v-for="optionItem in roleList" |
| | | :key="optionItem.id" |
| | | :label="optionItem.roleName" |
| | | :value="optionItem.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | <el-input |
| | | v-if="item.type === 'text'" |
| | | v-model="row[item.prop]" |
| | | readonly |
| | | type="text" |
| | | > |
| | | </el-input> |
| | | <el-checkbox |
| | | v-if="item.type === 'checkbox'" |
| | | v-model="row[item.prop]" |
| | | :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]"> |
| | | </el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button plain type="info" @click="selectAllButton">æé®å
¨é</el-button> |
| | | <el-button class="el-icon-plus" plain type="success" @click="addClassifyAuth"></el-button> |
| | | <el-button class="el-icon-minus" plain type="warning" @click="subClassifyAuth"></el-button> |
| | | <el-button plain type="primary" @click="submit">æ 交</el-button> |
| | | <el-button plain type="danger" @click="isShowDialog = false">å
³ é</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getButtonByParentCode} from "@/api/system/menu" |
| | | import {getPage} from "@/api/system/role" |
| | | import {saveOrUpdate, getClassifyAuthList, getButtonsByRoleId} from "@/api/system/classifyAuth" |
| | | import {v4 as uuidv4} from 'uuid'; |
| | | |
| | | export default { |
| | | name: "dataAuthDialog.vue", |
| | | props: { |
| | | classifyData: { |
| | | type: "Object", |
| | | default: "", |
| | | }, |
| | | /**å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶*/ |
| | | visible: { |
| | | type: "Boolean", |
| | | default: false, |
| | | }, |
| | | TreeNode:{ |
| | | type:Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | // å¯¹è¯æ¡æ¾ç¤ºæ§å¶ |
| | | isShowDialog: this.visible, |
| | | isLoading: false, |
| | | tableHeight: 'calc(100vh - 550px)', |
| | | classifyAuthData: [], |
| | | //å头 |
| | | classifyAuthHeader: [], |
| | | //æé®æ°æ® |
| | | classifyAuthButton: [], |
| | | //è§è²å表 |
| | | roleList: [], |
| | | //å½åéä¸çè¡¨æ ¼è¡ |
| | | selectList: [], |
| | | itemKey: '', |
| | | addIndex: Number, |
| | | currentRow: {} |
| | | }; |
| | | }, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ |
| | | visible() { |
| | | if (this.visible) { |
| | | this.isShowDialog = this.visible; |
| | | return new Promise((resolve, reject) => { |
| | | getButtonByParentCode({code: this.classifyData.attributes.id}).then(res => { |
| | | // è®°å½æé®æ°æ® |
| | | this.classifyAuthButton = res.data.data; |
| | | const list = res.data.data; |
| | | let tempData = []; |
| | | // è§è²å |
| | | tempData.push({ |
| | | label: "è§è²", |
| | | prop: "roleData", |
| | | type: "select", |
| | | width: 150, |
| | | }); |
| | | // ç¼ç 项åç±»ææ |
| | | tempData.push({ |
| | | label: "ç¼ç é¡¹æ°æ®ææ", |
| | | prop: "classifyItem", |
| | | type: "text", |
| | | width: 180, |
| | | }); |
| | | list.forEach(item => { |
| | | let columnItem = { |
| | | label: item.name, |
| | | prop: item.id, |
| | | code: item.code, |
| | | type: "checkbox", |
| | | width: 180, |
| | | }; |
| | | tempData.push(columnItem); |
| | | }) |
| | | this.classifyAuthHeader = tempData |
| | | resolve(); |
| | | }).catch(err => { |
| | | reject(err) |
| | | }); |
| | | // è·åè§è²å表 |
| | | getPage(1, -1, null).then(res => { |
| | | this.roleList = res.data.data.records; |
| | | }); |
| | | // è·å该åç±»ä¸å·²ææçåç±»ææä¿¡æ¯ |
| | | getClassifyAuthList({classifyId: this.classifyData.oid, authType: "data_auth"}).then(res => { |
| | | //console.log(res.data.data); |
| | | let authDatas = res.data.data; |
| | | if (authDatas.length > 0) { |
| | | authDatas.forEach((authData, index) => { |
| | | let item = { |
| | | oid: authData.oid, |
| | | roleData: authData.roleId, |
| | | classifyItem: this.classifyData.label, |
| | | index: index, |
| | | authButton:{}, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | //å°æé®è®¾ç½®è¿å» |
| | | authData.buttonIdList.forEach(data => { |
| | | Vue.set(item, data, true); |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //æ·»å è¡ä¸æ çäºclassifyAuthDataçé¿åº¦-1 |
| | | this.roleHandlerMethods(authData.roleId, 'create', index) |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | // å
³éå¯¹è¯æ¡ |
| | | closeDialog() { |
| | | this.$emit('update:visible', false); |
| | | this.classifyAuthData = []; |
| | | }, |
| | | roleHandlerMethods(id, type, index) { |
| | | if (this.classifyAuthData.length === 0) { |
| | | return; |
| | | } |
| | | //filteredItems æªæææ°ç» |
| | | getButtonsByRoleId({roleId: id, code: this.TreeNode.id}).then(res => { |
| | | 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); |
| | | this.$nextTick(() => { |
| | | if (this.classifyAuthData[index]) { |
| | | if (isMatched) { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,true); |
| | | }); |
| | | } else { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,false); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | //æ·»å âæ¥çâç¦ç¨ |
| | | if (this.classifyAuthData.authButton) { |
| | | 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(); |
| | | }); |
| | | }, |
| | | // è§è²æ¹åæ¶ |
| | | async roleChange(row, currentRow) { |
| | | try { |
| | | this.currentRow = currentRow; |
| | | const res = await getButtonsByRoleId({roleId: row, code: this.TreeNode.id}); |
| | | |
| | | const filteredItems = this.classifyAuthButton.filter(item => { |
| | | return !res.data.data.find(x => x.id === item.id); |
| | | }); |
| | | |
| | | this.classifyAuthHeader.forEach(item => { |
| | | const isMatched = filteredItems.some(x => x.id === item.prop); |
| | | this.$nextTick(() => { |
| | | if (currentRow) { |
| | | if (isMatched) { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = true; |
| | | if (!currentRow.authButton.classify_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } else { |
| | | Object.keys(currentRow).forEach((key) => { |
| | | currentRow.authButton[item.code] = false; |
| | | if (!currentRow.authButton.classify_view) { |
| | | currentRow.authButton.allDisabled = false; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | this.itemKey = uuidv4(); // 强å¶å·æ°è¡¨æ ¼ |
| | | }); |
| | | }); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } |
| | | }, |
| | | // å¢å è¡ |
| | | addClassifyAuth() { |
| | | if (this.roleList.length <= 0) { |
| | | this.$message.warning("å½åç§æ·ä¸åå¨è§è²ä¿¡æ¯ï¼"); |
| | | return; |
| | | } |
| | | this.addIndex++; //èªå®ä¹çææ·»å è¡ä¸æ |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | | authButton:{}, |
| | | uuid: uuidv4(),//çæå¯ä¸çid, |
| | | index: this.addIndex, |
| | | } |
| | | //å°æé®è®¾ç½®è¿å» |
| | | this.classifyAuthButton.forEach(data => { |
| | | Vue.set(item, data.id, false); |
| | | }) |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item) |
| | | this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex) |
| | | }, |
| | | // å é¤è¡ |
| | | subClassifyAuth() { |
| | | for (let item of this.selectList) { |
| | | let index = this.classifyAuthData.findIndex(data => data.index === item.index); |
| | | if (index !== -1) { |
| | | this.classifyAuthData.splice(index, 1); |
| | | } |
| | | } |
| | | }, |
| | | handleRowClick(row, column) { |
| | | this.selectList.push(row); |
| | | this.$refs.dataTable.toggleRowSelection(row); |
| | | }, |
| | | // å¤é |
| | | handleSelectionChange(list) { |
| | | this.selectList = list; |
| | | //console.log("å¤é"); |
| | | }, |
| | | // éæ©å
¨é¨ |
| | | handleSelectionAll(list) { |
| | | this.selectList = list; |
| | | }, |
| | | // ä¿ååç±»ææä¿¡æ¯ |
| | | submit() { |
| | | if (this.classifyAuthData.length <= 0) { |
| | | this.$message.warning('ææå表为空ï¼') |
| | | return; |
| | | } |
| | | let isRepeat = false; |
| | | // éåæ°ç»ï¼æ¯è¾åé¢ç对象çroleDataæ¯å¦ä¸åé¢ç对象ç¸ç |
| | | for (let i = 0; i < this.classifyAuthData.length - 1; i++) { |
| | | let currentRoleId = this.classifyAuthData[i].roleData; |
| | | for (let j = i + 1; j < this.classifyAuthData.length; j++) { |
| | | if (currentRoleId === this.classifyAuthData[j].roleData) { |
| | | isRepeat = true; |
| | | break; |
| | | } |
| | | } |
| | | if (isRepeat) { |
| | | break; |
| | | } |
| | | } |
| | | if (isRepeat) { |
| | | this.$message.warning("è§è²åå类已ç»åå¨ï¼è¯·éæ°é
ç½®ï¼"); |
| | | return; |
| | | } |
| | | let form = []; |
| | | let flag = false; |
| | | this.classifyAuthData.forEach(item => { |
| | | let itemButtonList = []; |
| | | //çéåºæé®å¾é为trueçå |
| | | for (let key in item) { |
| | | if (item[key] === true) { |
| | | itemButtonList.push(key); |
| | | } |
| | | } |
| | | /**妿itemButtonListä¸ºç©ºè¯ææ¯ï¼ |
| | | æ·»å äºè§è²ä½æ¯æ²¡å¾éä»»ä½çæé®*/ |
| | | if (itemButtonList.length <= 0) { |
| | | flag = true; |
| | | return; |
| | | } |
| | | let data = { |
| | | oid: item.oid, |
| | | roleId: item.roleData, |
| | | classifyId: this.classifyData.oid, |
| | | buttonIds: itemButtonList.join(","), |
| | | authType: "data_auth", |
| | | } |
| | | form.push(data); |
| | | }); |
| | | if (flag) { |
| | | this.$message.warning('ææªå¾éæä½çæéï¼ä¸å
许ææ') |
| | | return; |
| | | } |
| | | // console.log(form) |
| | | // è°ç¨ä¿ååç±»ææçæ¥å£ |
| | | saveOrUpdate(form).then(res => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: res.data.msg, |
| | | }); |
| | | // this.isShowDialog = false |
| | | }, (error) => { |
| | | window.console.log(error); |
| | | }) |
| | | }, |
| | | // å
¨éæé® |
| | | selectAllButton() { |
| | | if (this.selectList.length !== 1) { |
| | | this.$message.warning("请åªéæ©ä¸è¡éè¦å
¨éçæé®çæ°æ®è¡ï¼"); |
| | | return; |
| | | } |
| | | this.classifyAuthButton.forEach(item => { |
| | | //console.log("item",item); |
| | | Vue.set(this.selectList[0], item.id, true); |
| | | }); |
| | | //console.log("this.selectList",this.selectList); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | // æ»å¨æ¡æ ·å¼ä¿®æ¹ |
| | | // æ»å¨æ¡ç宽度 |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar { |
| | | height: 15px; // çºµåæ»å¨æ¡ å¿
å |
| | | background: white; |
| | | border: white; |
| | | width: 10px; |
| | | |
| | | } |
| | | |
| | | // æ»å¨æ¡çæ»å |
| | | /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | background-color: #ececec; |
| | | border-radius: 20px; |
| | | border: #ececec; |
| | | } |
| | | |
| | | /deep/ .el-table__body-wrapper { |
| | | height: calc(100% - 50px) !important; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <!-- å
¨å±ç¼è¾--> |
| | | <el-dialog :before-close="escEdit" :visible.sync="attrEditVisible" append-to-body fullscreen="true"> |
| | | <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :crudArrayFlag="this.crudArrayFlag" |
| | | :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" |
| | | :editOpenFlag="editOpenFlag" :editStyleFlag="editStyleFlag" :btnAuthList="btnAuthList" |
| | | @editCloseChildren="editClose"></attrCrud> |
| | | </el-dialog> |
| | | <!-- ç»åè§å--> |
| | |
| | | <basic-container> |
| | | <div style="height: calc(100vh - 142px);!important;"> |
| | | <div class="headerCon" style="display: flex; flex-wrap: wrap;margin-bottom: 5px"> |
| | | <el-button v-if="permissionList.TreeAddStatus" plain size="small" type="primary" @click="TreeAdd">æ·»å |
| | | <el-button plain size="small" type="primary" @click="TreeAdd">æ·»å |
| | | </el-button> |
| | | <el-button v-if="permissionList.TreeEditStatus" plain size="small" type="primary" @click="TreeEdit">ä¿®æ¹ |
| | | </el-button> |
| | |
| | | <el-button v-if="permissionList.classifyAuth" plain size="small" |
| | | style="width: 56px;text-align: center;padding-left: 3px" type="primary" |
| | | @click="classifyAuthHandler">åç±»ææ |
| | | </el-button> |
| | | <el-button v-if="permissionList.classifyAuth" plain size="small" |
| | | style="width: 56px;text-align: center;padding-left: 3px" type="primary" |
| | | @click="dataAuthHandler">æ°æ®ææ |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | |
| | | :classifyData="classifyData" |
| | | :visible.sync="classifyAuthVisible" |
| | | ></classify-auth-dialog> |
| | | <!-- æ°æ®ææå¯¹è¯æ¡ --> |
| | | <data-auth-dialog |
| | | :classifyData="classifyData" |
| | | :visible.sync="dataAuthVisible" |
| | | :TreeNode="TreeEditObj" |
| | | ></data-auth-dialog> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | |
| | | BtmdialogVisible: false, |
| | | SelectOption: [ |
| | | { |
| | | value: 'name', |
| | | label: '䏿åç§°' |
| | | value: 'id', |
| | | label: 'è±æåç§°', |
| | | }, |
| | | { |
| | | value: 'id', |
| | | label: 'è±æåç§°' |
| | | value: 'name', |
| | | label: '䏿åç§°' |
| | | } |
| | | |
| | | ], |
| | | btmSelectOption: [ |
| | | { |
| | |
| | | TreeAddFormVisible: false, |
| | | //åç±»ææå¯¹è¯æ¡ |
| | | classifyAuthVisible: false, |
| | | //æ°æ®ææå¯¹è¯æ¡ |
| | | dataAuthVisible: false, |
| | | //å½åç¹å»é¡¹ |
| | | nodeClickList: "", |
| | | ClonenodeClickList: "", |
| | |
| | | this.classifyData = this.nodeClickList; |
| | | this.classifyAuthVisible = true; |
| | | }, |
| | | // æ°æ®ææå¯¹è¯æ¡æå¼ |
| | | dataAuthHandler() { |
| | | if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®ï¼') |
| | | return; |
| | | } |
| | | this.classifyData = this.nodeClickList; |
| | | this.dataAuthVisible = true; |
| | | }, |
| | | flowingDependHandler() { |
| | | if (this.nodeClickList.length <= 0) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®ï¼') |
| | |
| | | getAttr() { |
| | | this.loading = true; |
| | | return new Promise((resolve, reject) => { |
| | | getAtrrList() |
| | | let conditionMaps = {}; |
| | | conditionMaps["conditionMap[authType]"] = "classify_auth"; |
| | | conditionMaps["conditionMap[buttonCode]"] = "classifyTree"; |
| | | // åç±»ææä¸æ¯å¦å
·å¤æ¥çæé |
| | | conditionMaps["conditionMap[menuCode]"] = "classify_view"; |
| | | getAtrrList(conditionMaps) |
| | | .then(res => { |
| | | this.Treedata = res.data; |
| | | this.CloneTreedata = res.data; |
| | |
| | | }, |
| | | //æ ç¹å»äºä»¶ |
| | | async nodeClick(data) { |
| | | getAuthButtonList({classifyId: data.oid}).then(res => { |
| | | getAuthButtonList({classifyId: data.oid,code: "classifyTree",authType: "classify_auth"}).then(res => { |
| | | this.btnAuthList = res.data.data; |
| | | }).catch(error => { |
| | | console.log(error) |
| | |
| | | @echoSelectedAttr="echoSelectedAttr"> |
| | | </refer-select-btm-attr-dialog> |
| | | |
| | | <el-dialog title="éæ©æ¾ç¤ºå段" |
| | | <el-dialog title="éåINæNOTINæ¡ä»¶" |
| | | append-to-body |
| | | :visible.sync="isShowShowField" |
| | | :visible.sync="isShowInOrNotInCondition" |
| | | width="70%" |
| | | destroy-on-close |
| | | style="height: 110vh; margin-top: -12vh; overflow-y: hidden"> |
| | | <avue-crud :option="selectionShowFieldOption" |
| | | :table-loading="selectShowFieldLoading" |
| | | :data="selectShowFieldData" |
| | | ref="selectShowFieldCrud" |
| | | @row-click="showFieldRowClick" |
| | | @selection-change="selectionShowFieldDataChange" |
| | | @search-change="showFieldSearchChange" |
| | | @search-reset="showFieldSearchReset"> |
| | | <avue-crud :option="selectInOrNotInCondOption" |
| | | :page.sync="inOrNotInPage" |
| | | @current-change="inOrNotInCurrentChange" |
| | | @size-change="inOrNotInSizeChange" |
| | | @selection-change="selectionInOrNotInChange" |
| | | @row-click="rowInOrNotInClick" |
| | | @search-change="selectInOrNotInSearchChange" |
| | | @search-reset="searchInOrNotInReset" |
| | | :data="selectInOrNotInCondData" |
| | | ref="inOrNotInConditionCrud"> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="selectedShowField">ç¡® å®</el-button> |
| | | <el-button @click="isShowShowField = false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="éæ©æ¥è¯¢æ¡ä»¶" |
| | | append-to-body |
| | | :visible.sync="isShowSearchCondition" |
| | | width="70%" |
| | | destroy-on-close |
| | | style="height: 110vh; margin-top: -12vh; overflow-y: hidden"> |
| | | <avue-crud :option="selectionSearchConditionOption" |
| | | :table-loading="selectSearchConditionLoading" |
| | | :data="selectSearchConditionData" |
| | | ref="selectSearchConditionCrud" |
| | | @row-click="searchConditionRowClick" |
| | | @selection-change="searchConditionDataChange" |
| | | @search-change="searchConditionSearchChange" |
| | | @search-reset="searchConditionSearchReset"> |
| | | </avue-crud> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="selectedSearchCondition">ç¡® å®</el-button> |
| | | <el-button @click="isShowSearchCondition = false">å æ¶</el-button> |
| | | <!-- <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> --> |
| | | <el-button type="primary" @click="selectedInOrNotInCond">ç¡® å®</el-button> |
| | | <el-button @click="isShowInOrNotInCondition = false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | |
| | | |
| | | <script> |
| | | import func from "@/util/func"; |
| | | import {getList} from "@/api/refer/table"; |
| | | export default { |
| | | name: "referConfigFormDialog", |
| | | props: { |
| | |
| | | //ä¸ä¸æ¬¡ç¹å»çè¡ç¼è¾æ°æ® |
| | | preClickAttrRow: '', |
| | | preClickAddSearchConditionRow: '', |
| | | |
| | | //ç¹å»è¡å¼¹åºinænotinçå¼ |
| | | isShowInOrNotInCondition: false, |
| | | selectInOrNotInCondData: [], |
| | | selectInOrNotInCondOption: { |
| | | height:'220', |
| | | tip: false, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | disablePage: false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | menu: false, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | column: [] |
| | | }, |
| | | inOrNotInPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | selectionInOrNotInList: [], |
| | | inOrNotInParam: {}, |
| | | |
| | | }; |
| | | }, |
| | |
| | | //console.log(this.codeShowFieldConfigVOS[this.preClickAttrRow.$index]); |
| | | this.form.codeSrchCondConfigVOS[this.preClickAddSearchConditionRow.$index].$cellEdit = false; |
| | | } |
| | | if(row.filterType === '_in' || row.filterType === '_notin'){ |
| | | //console.log(row); |
| | | this.selectInOrNotInCondOption.column = [{ |
| | | prop: row.filterField, |
| | | label: row.filterTypeText, |
| | | search: true, |
| | | searchLabelWidth: 45, |
| | | searchSpan: 8, |
| | | sortable: true, |
| | | }] |
| | | this.initPageData.pageSize = 10; |
| | | this.initPageData.currentPage = 1; |
| | | this.loadInOrNotInConditionData(this.initPageData); |
| | | this.isShowInOrNotInCondition = true; |
| | | } |
| | | row.$cellEdit = true; |
| | | this.preClickAddSearchConditionRow = row; |
| | | }, |
| | | loadInOrNotInConditionData(page, params = {}){ |
| | | let mustParams = { |
| | | referType: this.form.referType, |
| | | referBo: this.form.referType, |
| | | }; |
| | | getList(Object.assign(mustParams,params),page.currentPage,page.pageSize,'/api/ubcs-code/mdmEngineController/defaultReferDataGrid','GET').then(res=>{ |
| | | //console.log(res.data); |
| | | this.selectInOrNotInCondData = res.data.records; |
| | | this.inOrNotInPage.total = res.data.total; |
| | | }); |
| | | }, |
| | | inOrNotInCurrentChange(currentPage) { |
| | | this.inOrNotInPage.currentPage = currentPage; |
| | | }, |
| | | inOrNotInSizeChange(pageSize) { |
| | | this.inOrNotInPage.pageSize = pageSize; |
| | | }, |
| | | rowInOrNotInClick(row){ |
| | | this.$refs.inOrNotInConditionCrud.toggleSelection(); |
| | | this.$refs.inOrNotInConditionCrud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | }, |
| | | selectionInOrNotInChange(list){ |
| | | if (this.isMuti && list.length > 1) { |
| | | const nowVal = list.shift(); |
| | | this.$refs.inOrNotInConditionCrud.toggleRowSelection(nowVal, false); |
| | | } |
| | | this.selectionInOrNotInList = list |
| | | }, |
| | | selectedInOrNotInCond(){ |
| | | if(this.selectionInOrNotInList && this.selectionInOrNotInList.length > 0){ |
| | | // console.log(this.selectionInOrNotInList) |
| | | this.preClickAddSearchConditionRow.filterValue = this.selectionInOrNotInList.map(item => item[this.selectInOrNotInCondOption.column[0].prop]).join(','); |
| | | this.isShowInOrNotInCondition = false; |
| | | } |
| | | }, |
| | | /** ç¹å»æç´¢å触å该äºä»¶ */ |
| | | selectInOrNotInSearchChange(params, done) { |
| | | this.initPageData.currentPage = 1; |
| | | let requestData = {}; |
| | | if(params) { |
| | | Object.keys(params).forEach((key)=>{ |
| | | requestData["conditionMap" + "["+ key +"_like]"] = params[key].trim(); |
| | | }) |
| | | } |
| | | this.inOrNotInParam = requestData; |
| | | this.loadInOrNotInConditionData(this.initPageData,this.inOrNotInParam); |
| | | done(); |
| | | }, |
| | | /** éç½®ä½å±æ§éåå¼è¡¨æ ¼çæç´¢æ¡ä¹åçåè° */ |
| | | searchInOrNotInReset() { |
| | | this.inOrNotInParam = {}; |
| | | this.loadInOrNotInConditionData(this.initPageData); |
| | | }, |
| | | |
| | | //ä¸ä¸ä¸ªé¡µé¢å·²ç»éä¸åç
§åºç¨çä¸å¡ç±»åçæ
åµï¼åä¸ä¸æ¬¡å·²ç»é
ç½®è¿åç
§é
ç½®çæ
åµä¸è¿è¡é¡µé¢åå§å渲æ |
| | | initPageData(val){ |
| | | // console.log(val.referConfig); |
| | |
| | | transition:opacity .0s !important; |
| | | } |
| | | |
| | | /* .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | padding: 9px 15px; |
| | | line-height: 1; |
| | | } */ |
| | | |
| | | </style> |
| | |
| | | import classifyTrees from "@/components/Theme/ThemeClassifyTrees" |
| | | import classifyTreeform from "@/components/Theme/ThemeClassifyTreeform" |
| | | import classifyAuthDialog from "@/components/Theme/ClassifyAuthDialog" |
| | | import dataAuthDialog from "@/components/Theme/DataAuthDialog" |
| | | import TemplatePro from "@/components/Theme/ThemeTemplatePro" |
| | | import attrCrud from "@/components/Theme/ThemeAttrCrud" |
| | | import formulaEditor from "@/components/code-dialog-page/formulaEditor" |
| | |
| | | Vue.component('originalLink',originalLink) |
| | | Vue.component('classifyTrees',classifyTrees) |
| | | Vue.component('classifyAuthDialog',classifyAuthDialog) |
| | | Vue.component('dataAuthDialog',dataAuthDialog) |
| | | Vue.component('classifyTreeform',classifyTreeform) |
| | | Vue.component('TemplatePro',TemplatePro) |
| | | Vue.component('formulaEditor',formulaEditor) |
| | |
| | | export const optionParent = { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | export default { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | option: { |
| | | height: "auto", |
| | | tip: false, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | |
| | | findvisible: false, |
| | | selectRow: [], |
| | | option: { |
| | | height: 700, |
| | | calcHeight: 80, |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | margin-top: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | " |
| | | > |
| | | justify-content: center;"> |
| | | <el-button |
| | | class="button" |
| | | icon="el-icon-circle-plus" |
| | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="åç¼:"> |
| | | <el-input |
| | | <!-- <el-input |
| | | v-model="form.prefixCode" |
| | | :readonly="basicSecOnlyRead" |
| | | ></el-input> |
| | | ></el-input> --> |
| | | <el-select v-model="form.prefixCode" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="(option, index) in preFixOrSuffixChars" |
| | | :key="index" |
| | | :label="option.label" |
| | | :value="option.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="åç¼:"> |
| | | <el-input |
| | | <!-- <el-input |
| | | v-model="form.suffixCode" |
| | | :readonly="basicSecOnlyRead"> |
| | | </el-input> |
| | | </el-input> --> |
| | | <el-select v-model="form.suffixCode" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="(option, index) in preFixOrSuffixChars" |
| | | :key="index" |
| | | :label="option.label" |
| | | :value="option.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item :label-width="leftFormLabelWidth" label="æè¿°:"> |
| | |
| | | :disabled="basicSecOnlyRead" |
| | | filterable |
| | | placeholder="è¯·éæ©" |
| | | @blur="inputSelectBlur" |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | :key="item.lable" |
| | | :label="item.lable" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | :disabled="basicSecOnlyRead" |
| | | filterable |
| | | placeholder="è¯·éæ©" |
| | | @blur="inputSelectBlur" |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | :key="item.lable" |
| | | :label="item.lable" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | deleteCodeClassifyValue, |
| | | saveCodeClassifyValueOrder, |
| | | } from "@/api/code/codeClassifyValue"; |
| | | import { getSelectList, getRegexStr } from "@/api/code/codeCharcter" |
| | | import {getDictionary} from "@/api/omd/enum"; |
| | | import {getDictionaryBiz} from "@/api/system/dictbiz"; |
| | | // import {getDictionaryBiz} from "@/api/system/dictbiz"; |
| | | import optionBasic from "@/const/code/codebasic"; |
| | | import optionRule from "@/const/code/mdmrule"; |
| | | import attrOption from "@/const/code/selectAttrOptionDialog"; |
| | |
| | | //å¼ç¨ç 段ä¸åç
§é
ç½®ç»ä»¶ç¸å
³åæ° |
| | | referConfigOption: {}, |
| | | referConfigVisble: false, |
| | | |
| | | preFixOrSuffixChars: [], //ååç¼å符å表 |
| | | |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | this.codeFixdForm.codeFixedSecOid = row.codefixedsecoid; |
| | | }, |
| | | /** æ°å¢ç å¼*/ |
| | | addCodeSecValue(condition) { |
| | | async addCodeSecValue(condition) { |
| | | if (condition === "codefixedsec") { |
| | | if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeFixdForm.id)){ |
| | | return; |
| | | } |
| | | this.codeFixdForm.codeFixedSecOid = this.codefixedsecOrCodeclassifysec.oid; |
| | |
| | | if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeClassifyForm.id)){ |
| | | return; |
| | | } |
| | | this.codeClassifyForm.codeClassifySecOid = |
| | | this.codefixedsecOrCodeclassifysec.oid; |
| | | addSaveCodeClassifyValue(this.codeClassifyForm).then( |
| | |
| | | ); |
| | | } |
| | | }, |
| | | /** æ¸
空ç å¼è¡¨å */ |
| | | clearFixedOrClassifyForm(condition) { |
| | | //ç¹å»åæ¶æ¶æ¸
空表åä¸å½åéä¸çç å¼ï¼å¹¶ç¦ç¨æé® |
| | | this.selectedFixedOrCodeclassifyValue = ""; |
| | | if (condition === "close") { |
| | | this.codeFixdForm = this.$options.data().codeFixdForm; |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | if (condition === "codefixedsec") { |
| | | this.codeFixdForm.description = ""; |
| | | this.codeFixdForm.codeFixedSecOid = ""; |
| | | } else { |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | }, |
| | | /** æ·»å æä¿®æ¹ç å¼ä¹å对ç å¼é¿åº¦æ ¹æ®è§åè¿è¡æ ¡éª */ |
| | | tipsCodeSecValueMessage(id) { |
| | | if (id.trim() == "") { |
| | | this.$message.warning("ç å¼ä¸è½ä¸ºç©ºï¼"); |
| | | return false; |
| | | } |
| | | if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) { |
| | | this.$message.warning( |
| | | "ç å¼é¿åº¦ä¸è½å¤§äº" + this.codefixedsecOrCodeclassifysec.codeSecLength |
| | | ); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** ä¿®æ¹ç å¼ */ |
| | | editCodeSecValue(condition) { |
| | | async editCodeSecValue(condition) { |
| | | if (condition == "codefixedsec") { |
| | | if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeFixdForm.id)){ |
| | | return; |
| | | } |
| | | //ä»¥åæ¯ç´æ¥æå½åéä¸è¡çæææ°æ®é½è¿è¡æäº¤ï¼ä½å
¶å®åªéè¦ä¼ è¾ä¸äºå¿
è¦åæ°å³å¯ï¼è¿å¿åäºä¿®æ¹ï¼éè¦ä¼ å
¶ä»åæ°ç请èªè¡æ·»å |
| | |
| | | if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeFixdForm.id)){ |
| | | return; |
| | | } |
| | | this.codeClassifyForm.oid = |
| | | this.selectedFixedOrCodeclassifyValue.attributes.oid; |
| | | // åç±»ç æ®µï¼ååç±»åç¶åç±»ä¹é´ä¸è½ç¸äºæ´æ¹ |
| | |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | /** |
| | | * å¯ç¨å符éç 弿£åæ ¡éª |
| | | * @return true:满足éå¶ï¼falseï¼ä¸æ»¡è¶³éå¶ |
| | | */ |
| | | async regexCharacter(str){ |
| | | var regex = null; |
| | | // è·åå°é
置好çå¯ç¨å符æ£å |
| | | await getRegexStr({codeRuleId: this.selectionList[0].oid,chartType: "charset"}).then(res=>{ |
| | | // console.log(res.data.data); |
| | | regex = new RegExp(res.data.data); |
| | | }); |
| | | // console.log(regex); |
| | | // console.log(regex.test(str)); |
| | | if(regex != "" && !regex.test(str)){ |
| | | this.$message.warning("æ·»å çç 弿ªå¨å¯ç¨å符éä¸é
ç½®ï¼"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** æ¸
空ç å¼è¡¨å */ |
| | | clearFixedOrClassifyForm(condition) { |
| | | //ç¹å»åæ¶æ¶æ¸
空表åä¸å½åéä¸çç å¼ï¼å¹¶ç¦ç¨æé® |
| | | this.selectedFixedOrCodeclassifyValue = ""; |
| | | if (condition === "close") { |
| | | this.codeFixdForm = this.$options.data().codeFixdForm; |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | if (condition === "codefixedsec") { |
| | | this.codeFixdForm.description = ""; |
| | | this.codeFixdForm.codeFixedSecOid = ""; |
| | | } else { |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | }, |
| | | /** æ·»å æä¿®æ¹ç å¼ä¹å对ç å¼é¿åº¦æ ¹æ®è§åè¿è¡æ ¡éª */ |
| | | tipsCodeSecValueMessage(id) { |
| | | if (id.trim() == "") { |
| | | this.$message.warning("ç å¼ä¸è½ä¸ºç©ºï¼"); |
| | | return false; |
| | | } |
| | | if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) { |
| | | this.$message.warning( |
| | | "ç å¼é¿åº¦ä¸è½å¤§äº" + this.codefixedsecOrCodeclassifysec.codeSecLength |
| | | ); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** å é¤ç å¼ */ |
| | | delCodeSecValue(condition) { |
| | |
| | | }, |
| | | /** ä¸ç§»ä¸ç§»çæä½çä¿å*/ |
| | | async saveCodeFixedOrClassifyValueOption(condition, editOrderNumdata) { |
| | | |
| | | //ä¿å对åºå®ç 段ç å¼çä¸ç§»ä¸ç§»ç§»åºçæä½ |
| | | if (condition == "fixedValue") { |
| | | let data = { |
| | |
| | | //console.log(this.form); |
| | | //为formç»å®å¼ |
| | | this.changeSectypeFormItems(condition == "add" ? null : row); |
| | | // è·åååç¼å¯ç¨å符 |
| | | this.loadPreOrSuffixChars(); |
| | | // è¡¥ä½æ¶å符 |
| | | // this.loadCodeFillSeparator(); |
| | | this.addBasicCodeSettingBox = true; |
| | | }, |
| | | /** è·åååç¼å符 */ |
| | | loadPreOrSuffixChars(){ |
| | | getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "prefix"}).then(res=>{ |
| | | this.preFixOrSuffixChars = res.data.data; |
| | | // console.log(this.preFixOrSuffixChars); |
| | | }) |
| | | }, |
| | | /** æ°å¢åºç¡ç 段*/ |
| | | async saveOrEditBasicCode() { |
| | |
| | | this.form.referConfig = ""; |
| | | } |
| | | }, |
| | | /** è¡¥ä½æ¶çå符ï¼å®ç°å¯è¾å¯é*/ |
| | | inputSelectBlur(e) { |
| | | /** è¡¥ä½æ¶çå符ï¼å®ç°å¯è¾å¯é TODO:å 为å¢å äºå¯ç¨åç¬¦éæ§å¶ï¼æä»¥è¿å¿å¼ç¨äºå¯ç¨å符éçææ*/ |
| | | /*inputSelectBlur(e) { |
| | | if (e.target.value) { |
| | | this.form.codeFillSeparator = e.target.value; |
| | | } |
| | | }, |
| | | },*/ |
| | | /** ç æ®µç±»åæ¹åæ¶ï¼å¢å 对åºçform表åä¸ç屿§*/ |
| | | changeSectypeFormItems(row) { |
| | | //console.log(row) |
| | |
| | | if (enumCach == null) { |
| | | getDictionary({code: enumKey}).then((res) => { |
| | | enumCach = res.data.data; |
| | | localStorage.setItem(enumKey, JSON.stringify(res.data.data)); |
| | | localStorage.setItem(enumKey, JSON.stringify(enumCach)); |
| | | }); |
| | | } |
| | | return enumCach; |
| | |
| | | this.loadCodeSecType(); |
| | | this.loadCodeSecLength(); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | | // this.loadCodeFillSeparator(); |
| | | this.loadCodeLevelType(); |
| | | this.loadCodeCutType(); |
| | | this.loadCodeGetValueType(); |
| | |
| | | loadCodeFillSeparator() { |
| | | //let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | //if (enumCach == null) { |
| | | getDictionaryBiz({code: "codeFillSeparator"}).then((res) => { |
| | | getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "fillerChar"}).then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | //console.log(this.enumParam.codeFillSeparator); |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | // localStorage.setItem( |
| | | // "codeFillSeparator", |
| | | // JSON.stringify(res.data.data) |
| | | // ); |
| | | }); |
| | | //} |
| | | }, |
| | | loadCodeLevelType() { |
| | | this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") || []; |
| | |
| | | selectionList: [], |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | dialogWidth: 950, |
| | | columnBtn:false, |
| | | tip: false, |
| | |
| | | data:[], |
| | | option: { |
| | | height:'auto', |
| | | calcHeight: 0, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: false, |
| | |
| | | deleteReason: '', |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | }], |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | flowBox: false, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | form: {}, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | border: true, |
| | |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | }, |
| | | option: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | columnBtn:false, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | option: { |
| | | columnBtn:false, |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | option: { |
| | | columnBtn:false, |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | |
| | | <script> |
| | | import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/mdmrule" |
| | | |
| | | export default { |
| | | name: "usableCharacter", |
| | |
| | | async getCodeRule() { |
| | | try { |
| | | // ç¼ç è§åå·²å叿°æ®æº |
| | | const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"}); |
| | | const res = await gridCodeRule(1,-1); |
| | | this.characterReleasedList = res.data.data.records; |
| | | this.queryReleasedList = this.characterReleasedList; |
| | | this.select = this.characterReleasedList[0].oid; |
| | |
| | | |
| | | <script> |
| | | import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/mdmrule" |
| | | |
| | | export default { |
| | | name: "usableCharacter", |
| | |
| | | async getCodeRule() { |
| | | try { |
| | | // ç¼ç è§åå·²å叿°æ®æº |
| | | const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"}); |
| | | const res = await gridCodeRule(1,-1); |
| | | this.characterReleasedList = res.data.data.records; |
| | | this.queryReleasedList = this.characterReleasedList; |
| | | this.select = this.characterReleasedList[0].oid; |
| | |
| | | // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue); |
| | | // const chartValue = targetObject.name; |
| | | getList({codeRuleId: this.select, chartType: "fillerChar", chartValue: this.characterValue}).then(res => { |
| | | console.log(res.data.data); |
| | | // console.log(res.data.data); |
| | | this.tableData = res.data.data; |
| | | this.loading = false; |
| | | }); |
| | |
| | | @change="selectHandler"> |
| | | <el-option v-for="(item,index) in queryReleasedList" |
| | | :key="item.oid" |
| | | :label="item.name" |
| | | :label="item.name + ' (' + item.id + ')'" |
| | | :value="item.oid"></el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/mdmrule" |
| | | |
| | | export default { |
| | | name: "usableCharacter", |
| | |
| | | }, |
| | | async getCodeRule() { |
| | | try { |
| | | // ç¼ç è§åå·²å叿°æ®æº |
| | | const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"}); |
| | | // ç¼ç è§åå·²åå¸ï¼TODO:2024/1/22æ¹ï¼æç
§éæ±åºè¯¥æ¯é½æ¥è¯¢ï¼æ°æ®æº |
| | | const res = await gridCodeRule(1,-1); |
| | | this.characterReleasedList = res.data.data.records; |
| | | this.queryReleasedList = this.characterReleasedList; |
| | | this.select = this.characterReleasedList[0].oid; |
| | |
| | | // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue); |
| | | // const chartValue = targetObject.name; |
| | | getList({codeRuleId: this.select, chartType: "prefix", chartValue: this.characterValue}).then(res => { |
| | | console.log(res.data.data); |
| | | // console.log(res.data.data); |
| | | this.tableData = res.data.data; |
| | | this.loading = false; |
| | | }); |
| | |
| | | |
| | | <script> |
| | | import {getList, addSave, editSave, deleteSave} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/codeCharcter" |
| | | import {gridCodeRule} from "@/api/code/mdmrule" |
| | | |
| | | export default { |
| | | name: "usableCharacter", |
| | |
| | | async getCodeRule() { |
| | | try { |
| | | // ç¼ç è§åå·²å叿°æ®æº |
| | | const res = await gridCodeRule({["conditionMap" + "[lcStatus_like]"]: "Released"}); |
| | | const res = await gridCodeRule(1,-1); |
| | | this.characterReleasedList = res.data.data.records; |
| | | this.queryReleasedList = this.characterReleasedList; |
| | | this.select = this.characterReleasedList[0].oid; |
| | |
| | | }, |
| | | option() { |
| | | return { |
| | | height: 'auto', |
| | | calcHeight: 20, |
| | | headerAlign: 'center', |
| | | align: 'center', |
| | | columnBtn: false, |
| | |
| | | rowKey: 'id', |
| | | addBtn: this.permissionList.addBtn, |
| | | editBtn: false, |
| | | height: 700, |
| | | delBtn: false, |
| | | refreshBtn: false, |
| | | column: [ |
| | |
| | | option: { |
| | | height: 'auto', |
| | | columnBtn:false, |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | lazy: true, |
| | | tip: false, |
| | | height:'auto', |
| | | calcHeight: 20, |
| | | maxHeight:600, |
| | | columnBtn:false, |
| | | //simplePage: true, |
| | |
| | | return{ |
| | | height: 'auto', |
| | | columnBtn:false, |
| | | calcHeight: 30, |
| | | calcHeight: 20, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | option() { |
| | | return{ |
| | | height:'auto', |
| | | calcHeight: 80, |
| | | calcHeight: 70, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | |
| | | // target: 'http://192.168.1.51:37000', |
| | | // target: 'http://dev.vci-tech.com:37000', |
| | | //yxc |
| | | // target: 'http:// 192.168.43.131:37000', |
| | | //ldc |
| | | // target: 'http:// 192.168.0.100:37000', |
| | | // target: 'http://192.168.0.105:37000', |
| | | // target: 'http://192.168.0.103:37000', |
| | | // target: 'http://192.168.1.63:37000', |
| | | // target: 'http://192.168.3.7:37000', |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åç±»ææåæ°å¯¹è±¡ |
| | | * åç±»ææï¼æ°æ®ææåæ°å¯¹è±¡ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:36 |
| | | */ |
| | |
| | | */ |
| | | private String buttonIds; |
| | | |
| | | /** |
| | | * ææç±»å |
| | | */ |
| | | private String authType; |
| | | |
| | | } |
| | |
| | | * @return List<Menu> |
| | | */ |
| | | @GetMapping(MENU_BUTTON) |
| | | R<List<Menu>> getMenuButtonByType(@RequestParam("btmType") String btmType); |
| | | R<List<Menu>> getMenuButtonByType(@RequestParam("classifyId") String classifyId,@RequestParam("btmType") String btmType,@RequestParam("authType") String authType); |
| | | |
| | | /** |
| | | * è·åé¨é¨ |
| | |
| | | R<List<String>> getRegexByList(@RequestBody List<String> combinationIds); |
| | | |
| | | @GetMapping(GETVIEWCLASSIFY) |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds); |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds,@RequestParam("authType") String authType,@RequestParam("buttonCode") String buttonCode,@RequestParam("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Menu>> getMenuButtonByType(String btmType) { |
| | | public R<List<Menu>> getMenuButtonByType(String classifyId, String btmType, String authType) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds) { |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.rmi.ServerException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/codeRuleCharacterController") |
| | | public class CodeRuleCharacterController { |
| | | |
| | | @Resource |
| | | private ICodeRuleCharacterService iCodeRuleCharacterService; |
| | | |
| | | /** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId è§åoid |
| | |
| | | public R<List<Map<String,String>>> getDataByOid(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType){ |
| | | return R.data(iCodeRuleCharacterService.getDataByRuleId(codeRuleId,chartType)); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ®ä¸ææ°æ®æº |
| | | * @param codeRuleId è§åoid |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @GetMapping("/selectList") |
| | | public R<List<Map<String, String>>> getSelectListByRuleId(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType) throws ServerException { |
| | | return R.data(iCodeRuleCharacterService.getSelectListByRuleId(codeRuleId,chartType)); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ®ä¸ææ°æ®æº |
| | | * @param codeRuleId è§åoid |
| | | * @return æ°æ®å
容 |
| | | */ |
| | | @GetMapping("/getRegexStr") |
| | | public R<String> getRegexStrByCodeRuleId(@RequestParam("codeRuleId")String codeRuleId,@RequestParam("chartType")String chartType) throws ServerException { |
| | | return R.data(iCodeRuleCharacterService.getRegexStrByCodeRuleId(codeRuleId,chartType)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿åè§å对象 |
| | | * @param codeRuleCharacterVO è§åå符对象 |
| | |
| | | public R addSave(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){ |
| | | return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO,1); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è§å对象 |
| | | * @param codeRuleCharacterVO è§åå符对象 |
| | |
| | | public R delete(@RequestBody CodeRuleCharacterVO codeRuleCharacterVO){ |
| | | return iCodeRuleCharacterService.saveOrUpdate(codeRuleCharacterVO,3); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ |
| | | * @return 主é¢åºåç±»æ¾ç¤ºæ |
| | | */ |
| | | List<Tree> referTree(TreeQueryObject treeQueryObject); |
| | | List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¸»é¢åºåç±» æ |
| | | * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ |
| | | * @return 主é¢åºåç±» æ¾ç¤ºæ |
| | | */ |
| | | List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject); |
| | | List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException; |
| | | |
| | | /** |
| | | * 导åºåç±» |
| | |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.rmi.ServerException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | List<Map<String,String>> getDataByRuleId(String codeRuleId,String chartType)throws VciBaseException; |
| | | |
| | | /** |
| | | * ä¸ææ°æ®æº |
| | | * @param codeRuleId |
| | | * @param chartType |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | List<Map<String, String>> getSelectListByRuleId(String codeRuleId,String chartType) throws ServerException; |
| | | |
| | | /** |
| | | * åç¬¦éæ£åæ¼è£
|
| | | * @param codeRuleId |
| | | * @param chartType |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | String getRegexStrByCodeRuleId(String codeRuleId,String chartType) throws ServerException; |
| | | |
| | | /*** |
| | | * ä¿åç¼ç è§åå符é |
| | | * @param codeRuleCharacterVO |
| | |
| | | import java.awt.event.ItemEvent; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | import java.util.concurrent.ForkJoinPool; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private CodeBasicSecMapper codeBasicSecMapper; |
| | | |
| | | /** |
| | | * ä¸çº§èç¹ç屿§åç§° |
| | | */ |
| | |
| | | * @return 主é¢åºåç±»æ¾ç¤ºæ |
| | | */ |
| | | @Override |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) { |
| | | public List<Tree> referTree(TreeQueryObject treeQueryObject) throws ServiceException{ |
| | | if(treeQueryObject == null){ |
| | | treeQueryObject = new TreeQueryObject(); |
| | | } |
| | |
| | | * @return 主é¢åºåç±» æ¾ç¤ºæ |
| | | */ |
| | | @Override |
| | | public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) { |
| | | public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) throws ServiceException{ |
| | | List<CodeClassify> doList = null; |
| | | String id = null; |
| | | String lcStatus = null; |
| | |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" ãåç¨ã ") : ""); |
| | | }); |
| | | //è¶
管æ¾ç¤ºææåç±» |
| | | if(VciBaseUtil.checkAdminTenant()){ |
| | | Iterator var6 = tree.listIterator(); |
| | | while(var6.hasNext()){ |
| | | Tree trees = (Tree) var6.next(); |
| | | boolean checkHasChild=codeClassifyMapper.checkHasChild(trees.getOid()); |
| | | if(checkHasChild){ |
| | | trees.setLeaf(false); |
| | | }else{ |
| | | trees.setLeaf(true); |
| | | } |
| | | } |
| | | }else { |
| | | // éè¶
ç®¡è¿æ»¤æªææçåç±» |
| | | if(!VciBaseUtil.checkAdminTenant()){ |
| | | // é£äºåç±»å
·å¤æ¥çæé |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(","))); |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds( |
| | | Arrays.asList(AuthUtil.getUser().getRoleId().split(",")), |
| | | treeQueryObject.getConditionMap().getOrDefault("authType","classify_auth"), |
| | | treeQueryObject.getConditionMap().getOrDefault("buttonCode","classify_view"), |
| | | treeQueryObject.getConditionMap().getOrDefault("menuCode","classifyTree") |
| | | ); |
| | | // 请æ±å¤±è´¥æè
请æ±å¾å°çå
·å¤æ¥çæéçåç±»idéå为空 |
| | | if(!viewClassByRoleIds.isSuccess() && !viewClassByRoleIds.getData().isEmpty()){ |
| | | return new ArrayList<>(); |
| | | if(!viewClassByRoleIds.isSuccess() && viewClassByRoleIds.getData().isEmpty()){ |
| | | throw new ServiceException("ä¸»æ°æ®æ¥çæéæªé
ç½®ï¼æé
ç½®æè¯¯ï¼"); |
| | | } |
| | | long startTime = System.currentTimeMillis(); |
| | | // è¿æ»¤ |
| | | filterTreeNodes(tree,viewClassByRoleIds.getData()); |
| | | long endTime = System.currentTimeMillis(); |
| | | System.out.println(("æ§è¡æ¶é´ï¼"+(endTime-startTime)/1000)+"s"); |
| | | } |
| | | // å è½½åç±»æ¯å¦å
·æååç±» |
| | | tree.parallelStream().forEach(item -> { |
| | | boolean checkHasChild = checkHasChild(item.getOid()); |
| | | item.setLeaf(!checkHasChild); |
| | | }); |
| | | return tree; |
| | | } |
| | | |
| | |
| | | Iterator<Tree> iterator = trees.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Tree tree = iterator.next(); |
| | | Boolean checkHasChild = codeClassifyMapper.checkHasChild(tree.getOid()); |
| | | tree.setLeaf(!checkHasChild); |
| | | /*Boolean checkHasChild = checkHasChild(tree.getOid()); |
| | | tree.setLeaf(!checkHasChild);*/ |
| | | if (classifyIds.contains(tree.getOid())) { |
| | | // 妿顶å±èç¹åå¨äº classifyIds ä¸ï¼ç´æ¥ä¿çå
¶åèç¹éå |
| | | continue; |
| | |
| | | List<CodeFixedValue> doList = codeFixedValueMapper.selectList(Wrappers.<CodeFixedValue>query() |
| | | .lambda().eq(CodeFixedValue::getCodeFixedSecOid,codefixedsecoid) |
| | | ); |
| | | if(doList.isEmpty()){ |
| | | return false; |
| | | } |
| | | boolean resBoolean = codeFixedValueMapper.deleteBatchIds(doList.stream().map(CodeFixedValue::getOid).collect(Collectors.toList())) > 0; |
| | | return resBoolean; |
| | | } |
| | |
| | | package com.vci.ubcs.code.service.impl; |
| | | |
| | | import com.alibaba.nacos.common.utils.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.vci.ubcs.code.service.ICodeRuleCharacterService; |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeRuleCharacterVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.poi.bo.SheetRowData; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.rmi.ServerException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * @date 2023-11-30 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class CodeRuleCharacterServiceImpl extends ServiceImpl<CodeRuleCharacterMapper, CodeRuleCharacter> implements ICodeRuleCharacterService { |
| | | |
| | | @Autowired |
| | | private CodeRuleCharacterMapper codeRuleCharacterMapper; |
| | | private final CodeRuleCharacterMapper codeRuleCharacterMapper; |
| | | |
| | | /*** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId |
| | |
| | | charValueList.add(chartMap); |
| | | } |
| | | } |
| | | |
| | | return charValueList; |
| | | } |
| | | |
| | | /*** |
| | | * 使ç¨ç¼ç è§åoidè·åæ°æ® |
| | | * @param codeRuleId |
| | | * @param chartType |
| | | * @return |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getSelectListByRuleId(String codeRuleId,String chartType) throws ServerException { |
| | | List<Map<String, String>> charValueMap = new ArrayList<>(); |
| | | CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleId).eq(CodeRuleCharacter::getChartType,chartType)); |
| | | if(codeRuleCharacter!=null&&StringUtils.isNotBlank(codeRuleCharacter.getOid())){ |
| | | List<Character> characterList=codeRuleCharacter.getChartValue().chars().mapToObj(c -> (char) c).collect(Collectors.toList()); |
| | | characterList.stream().forEach(item->{ |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("lable",item.toString()); |
| | | map.put("value",item.toString()); |
| | | charValueMap.add(map); |
| | | }); |
| | | } |
| | | return charValueMap; |
| | | } |
| | | |
| | | @Override |
| | | public String getRegexStrByCodeRuleId(String codeRuleId, String chartType) throws ServerException { |
| | | StringBuilder regexStr = new StringBuilder(); |
| | | CodeRuleCharacter codeRuleCharacter=codeRuleCharacterMapper.selectOne(Wrappers.<CodeRuleCharacter>query().lambda().eq(CodeRuleCharacter::getCodeRuleId,codeRuleId).eq(CodeRuleCharacter::getChartType,chartType)); |
| | | if(codeRuleCharacter!=null&&StringUtils.isNotBlank(codeRuleCharacter.getOid())){ |
| | | regexStr.append("^["); |
| | | regexStr.append(codeRuleCharacter.getChartValue()); |
| | | regexStr.append("]+$"); |
| | | } |
| | | return regexStr.toString(); |
| | | } |
| | | |
| | | /*** |
| | | * åç¬¦éæ°æ®ä¿å |
| | | * @param codeRuleCharacterVO |
| | |
| | | /** |
| | | * æ ¹æ®å½åç³è¯·ç¼ç çåç±»ï¼éå±å¾ä¸æ ¡éªæ¯å¦ç¬¦åå±äºé
ç½®çä¸çåç±»åèç¹çå |
| | | * ç±»ï¼å¦æç¬¦åï¼å该åç±»ç³è¯·çç¼ç 为éå¢ç è¿åtrueï¼åä¹å为ä¼ä¸ç¼ç è¿åfalse |
| | | * |
| | | * @param parameter ä¼ å
¥æ°æ®,classifyGroupCode:é
ç½®çä¸çå类顶èç¹ï¼oidï¼éæ©èç¹çoid |
| | | */ |
| | | @Override |
| | |
| | | return createDataBZ(orderDTO,ruleVO,authUser); |
| | | } |
| | | } |
| | | |
| | | private String createDataBZ(CodeOrderDTO orderDTO, CodeRuleVO ruleVO,boolean authUser) throws Exception { |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | |
| | | return codeList.size() > 0 ? codeList.get(0) : ""; |
| | | |
| | | } |
| | | |
| | | /*** |
| | | * æ ¹æ®ç¼å·è·åç æ®µç å¼ |
| | | * @param secDTOList |
| | |
| | | throw new Exception("æ ¹æ®åæ åç¼å·ï¼å¨ç³»ç»ä¸æªæ¥è¯¢å°ç¸åºçä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * å¶å®ï¼åä¸éè¦äº§çæ´æ¹åç´æ¥çæç¼ç |
| | | * @param codeBZApplyDTO |
| | |
| | | return ""; |
| | | |
| | | } |
| | | |
| | | /*** |
| | | * éæå¯åç æ®µç³è¯·æ¥å£ |
| | | * @param codeBZApplyDTO ç³è¯·çä¿¡æ¯ï¼éè¦å
å«å±æ§çå
容åç æ®µç¸å
³çå
容 |
| | |
| | | |
| | | /** |
| | | * è·åç»è®¡åææ°æ® |
| | | * |
| | | * @param btmNames ä¸å¡ç±»å |
| | | * @return æ°æ®é |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å°è£
å¼å
³çå
容ï¼å¸¸ç¨äºå¯¼åº |
| | | * |
| | | * @param dataMap æ°æ®çå
容 |
| | | * @param templateVO 模æ¿çæ¾ç¤º |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å°referconfig转æ¢ä¸ºJSONæ ¼å¼çUIFormReferVO |
| | | * |
| | | * @param codeReferConfigVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ç¼ç ç³è¯·è¡¨åï¼éèãå¯è¾ãåªè¯»è½¬æ¢ |
| | | * |
| | | * @param codeRuleVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 使ç¨åç±»ç主é®è·åè¡¨æ ¼çå®ä¹-ubcsåä¿®æ¹è·åæµç¨é¶æ®µçæè·åæ¹æ³ |
| | | * |
| | | * @param codeClassifyOid |
| | | * @param templateId |
| | | * @param taskId |
| | |
| | | @Override |
| | | public MdmUIInfoVO getUIInfoByClassifyOid(String codeClassifyOid, String functionId) { |
| | | VciBaseUtil.alertNotNull(codeClassifyOid, "主é¢åºå类主é®"); |
| | | |
| | | MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid)); |
| | | uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0); |
| | | if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) { |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(uiInfoVO.getTemplateVO().getBtmTypeId()).getData(); |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, uiInfoVO.getTemplateVO().getBtmTypeId(), "data_auth").getData(); |
| | | // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // if (operationVOS == null) { |
| | | // operationVOS = new ArrayList<>(); |
| | |
| | | |
| | | /** |
| | | * å¤çº¿ç¨æ¹å¼åæ¹æ§è¡insertè¯å¥ |
| | | * |
| | | * @param tableName |
| | | * @param maps |
| | | * @throws ServiceException |
| | |
| | | |
| | | /** |
| | | * åçº¿ç¨æ¹å¼åæ¹æ§è¡ |
| | | * |
| | | * @param tableName |
| | | * @param maps |
| | | */ |
| | |
| | | |
| | | return R.success("æ´æ°æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¸å¡æ°æ®åæ¶å¯¹ç å¼è¡¨æ°æ®æä½æ¥å£ |
| | | * |
| | |
| | | |
| | | List<Map> maps = commonsMapper.selectBySql("select * from (select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName() + SPACE |
| | | + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString()) |
| | | + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 and " |
| | | + whereSqlByMap + ") t "+ (baseQueryObject.getLimit()==-1?")": ("where rownum <=" + num1 + ") where rn >=" + num2) |
| | | + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 " |
| | | + (Func.isNotBlank(whereSqlByMap) ? "and " + whereSqlByMap : "") + ") t " + (baseQueryObject.getLimit() == -1 ? ")" : ("where rownum <=" + num1 + ") where rn >=" + num2) |
| | | )); |
| | | List<BaseModel> baseModels = new ArrayList<>(); |
| | | //å°æ¥è¯¢å°çæ°æ®è½¬æ¢ä¸ºbasemodelï¼ä½¿ç¨çåå°æ¹å¼æ¥è¿è¡å建ç |
| | |
| | | } |
| | | int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName() + SPACE |
| | | + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString()) |
| | | + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 and " |
| | | + whereSqlByMap |
| | | + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 " |
| | | + (Func.isNotBlank(whereSqlByMap) ? "and " + whereSqlByMap : "") |
| | | ); |
| | | IPage<BaseModelVO> objectDataGrid = new Page<>(); |
| | | objectDataGrid.setPages(baseQueryObject.getPage()); |
| | |
| | | |
| | | /** |
| | | * æµç¨ä¸åæ´ç¶æå¼ |
| | | * |
| | | * @param flowDTO |
| | | * @return |
| | | */ |
| | |
| | | package com.vci.ubcs.system.controller; |
| | | |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.service.IClassifyAuthService; |
| | | import com.vci.ubcs.system.vo.ClassifyAuthVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * åç±»ææ,æ°æ®ææ |
| | | * @author ludc |
| | | * @date 2023/12/20 11:33 |
| | | */ |
| | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @param menuCode |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAuthButtonList") |
| | | public R<Map<String,Boolean>> getAuthButtonList(@RequestParam("classifyId") String classifyId){ |
| | | return R.data(classifyAuthService.getAuthButtonList(classifyId)); |
| | | public R<Map<String,Boolean>> getAuthButtonList(@Valid @RequestParam("classifyId") String classifyId,@Valid @RequestParam("code") String menuCode,@Valid @RequestParam("authType") String authType){ |
| | | return R.data(classifyAuthService.getAuthButtonList(classifyId,menuCode,authType)); |
| | | } |
| | | |
| | | } |
| | |
| | | return menuService.cloneMenuButton(buttonCloneVO.getMenuId(), buttonCloneVO.getButtonIds()); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idè·åå·²ææçæé®ä¿¡æ¯ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | @GetMapping("/getButtonsByRoleId") |
| | | public R<List<Menu>> getButtonsByRoleId(@Valid @RequestParam("roleId") String roleId,@Valid @RequestParam("code") String menuCode){ |
| | | return R.data(menuService.getButtonsByRoleId(roleId,menuCode)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import com.vci.ubcs.system.cache.SysCache; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.entity.Role; |
| | | import com.vci.ubcs.system.service.IRoleService; |
| | | import com.vci.ubcs.system.user.cache.UserCache; |
| | |
| | | |
| | | @Override |
| | | @GetMapping(MENU_BUTTON) |
| | | public R<List<Menu>> getMenuButtonByType(String btmType) { |
| | | return R.data(menuService.getMenuButtonByType(btmType, AuthUtil.getUserId())); |
| | | public R<List<Menu>> getMenuButtonByType(String classifyId,String btmType,String authType) { |
| | | return R.data(menuService.getMenuButtonByType(classifyId,btmType,authType)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return R.data(mdmCountConfigService.getMdmCountConfig(userId)); |
| | | } |
| | | |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds)); |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds,authType,buttonCode,menuCode)); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åç±»ææ,æ°æ®ææ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:50 |
| | | */ |
| | |
| | | |
| | | List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId); |
| | | |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds); |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds,@Param("authType") String authType,@Param("buttonCode") String buttonCode,@Param("menuCode") String menuCode); |
| | | |
| | | } |
| | |
| | | List<Menu> selectMenuChildByBtnType(String btmType,List<String> roleIds); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶èåcodeæ¥è¯¢èåçåæé® |
| | | * æ ¹æ®ç¶èåcodeåè§è²idè·åå·²ææçæé®ä¿¡æ¯ |
| | | * |
| | | * @return |
| | | */ |
| | | List<Menu> getButtonByParentCode(@Param("code") String code); |
| | | List<Menu> getButtonsByRoleIdAndCode(@Param("roleId") String roleId, @Param("code") String code); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶èåcodeåè§è²idè·åå·²ææçæé®ä¿¡æ¯ |
| | | * |
| | | * @return |
| | | */ |
| | | List<Menu> getButtonByIdsOrByParentCode(@Param("roleIds") String roleIds, @Param("code") String code,@Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * æéé
ç½®èå |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * åç±»ææ,æ°æ®ææ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:34 |
| | | */ |
| | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @param menuCode |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | Map<String,Boolean> getAuthButtonList(String classifyId); |
| | | Map<String,Boolean> getAuthButtonList(String classifyId,String menuCode,String authType); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¥ä¸»æ°æ®ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @param menuCode |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | List<Menu> getAuthMenuButtonList(String classifyId,String menuCode,String authType); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idæ¥çæåªäºåç±»å
·å¤æ¥çæé |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | List<String> getViewClassByRoleIds(List<String> roleIds); |
| | | List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode); |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åèåä¸é¢çæé® |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return List<Menu> |
| | | * @param classifyId |
| | | * @param btmType |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | List<Menu> getMenuButtonByType(String btmType,Long userId); |
| | | List<Menu> getMenuButtonByType(String classifyId,String btmType, String authType); |
| | | |
| | | /** |
| | | * æ ¹æ®codeåç¨æ·idæ¥è¯¢èåä¿¡æ¯ |
| | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·åèåä¿¡æ¯ |
| | | * @param ids |
| | | * @param menuCode |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | List<Menu> getMenuListById(List<String> ids,String parentId); |
| | | List<Menu> getMenuListByCode(List<String> ids,String menuCode,String roleIds); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idè·åå·²ææçæé®ä¿¡æ¯ |
| | | * @param roleId |
| | | * @param menuCode |
| | | * @return |
| | | */ |
| | | List<Menu> getButtonsByRoleId(String roleId, String menuCode); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.entity.Role; |
| | | import com.vci.ubcs.system.vo.RoleVO; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * åç±»ææ,æ°æ®ææ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:35 |
| | | */ |
| | |
| | | throw new ServiceException("缺å°å¿
ä¼ åæ°åç±»id"); |
| | | } |
| | | LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query() |
| | | .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId()); |
| | | .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId()) |
| | | .eq(ClassifyAuth::getAuthType,classifyAuthVO.getAuthType()); |
| | | List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper); |
| | | if(classifyAuths.isEmpty()){ |
| | | return new ArrayList<ClassifyAuthVO>(); |
| | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @param menuCode |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | public Map<String,Boolean> getAuthButtonList(String classifyId){ |
| | | public Map<String,Boolean> getAuthButtonList(String classifyId,String menuCode,String authType){ |
| | | List<Menu> menuList = this.getButtonList(classifyId, menuCode, authType); |
| | | if(menuList.isEmpty()){ |
| | | return new HashMap<>(); |
| | | } |
| | | Map<String, Boolean> buttonMaps = menuList.stream() |
| | | .collect(Collectors.toMap(Menu::getCode, menu -> true)); |
| | | return buttonMaps; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¥ä¸»æ°æ®ä¸ï¼å½åç»å½çè§è²æåªäºæé®èåæé |
| | | * @param classifyId |
| | | * @param menuCode |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | public List<Menu> getAuthMenuButtonList(String classifyId,String menuCode,String authType){ |
| | | List<Menu> buttonList = getButtonList(classifyId, menuCode, authType); |
| | | return buttonList; |
| | | } |
| | | |
| | | private List<Menu> getButtonList(String classifyId,String menuCode,String authType){ |
| | | if(Func.isBlank(classifyId)){ |
| | | throw new ServiceException("å¿
ä¼ åæ°åç±»oidä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | |
| | | // å
æ¥è¯¢æé®idå表 |
| | | LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query() |
| | | .lambda().eq(ClassifyAuth::getClassifyId, classifyId) |
| | | .eq(ClassifyAuth::getAuthType,authType) |
| | | .in(ClassifyAuth::getRoleId, roleIds); |
| | | List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper); |
| | | //妿å½ååç±»æ²¡ææ¾å°ææé
ç½®ï¼å°±ä¾æ¬¡ä»å½åèç¹å¾ä¸å±èç¹æ¾ææé
ç½®ï¼æ¾å°äºå°±åæ¢ï¼æ²¡æ¾å°å°±ä¸ç´æ¾å°æå |
| | |
| | | Boolean isAdmin = VciBaseUtil.checkAdminTenant(); |
| | | // æªé
ç½®æé®æé |
| | | if(!isAdmin && (classifyAuths.isEmpty() || Func.isBlank(classifyAuths.get(0).getButtonIds()))){ |
| | | return new HashMap<>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | List<String> condition1 = new ArrayList<>(); |
| | | List<String> ids = new ArrayList<>(); |
| | | // 妿䏿¯è¶
ç®¡ç¨æ· |
| | | if(!isAdmin){ |
| | | condition1.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(","))); |
| | | ids.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(","))); |
| | | } |
| | | List<Menu> menuList = menuService.getMenuListById(condition1,"1648879284590858241"); |
| | | if(menuList.isEmpty()){ |
| | | return new HashMap<>(); |
| | | } |
| | | Map<String, Boolean> buttonMaps = menuList.stream() |
| | | .collect(Collectors.toMap(Menu::getCode, menu -> true)); |
| | | return buttonMaps; |
| | | return menuService.getMenuListByCode(ids,menuCode,roleIds); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds) { |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds,String authType,String buttonCode,String menuCode) { |
| | | if(roleIds.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds); |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds, authType,buttonCode,menuCode); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.code.feign.ICodeClassifyClient; |
| | | import com.vci.ubcs.starter.util.MybatisParameterUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import com.vci.ubcs.system.cache.SysCache; |
| | | import com.vci.ubcs.system.dto.MenuDTO; |
| | | import com.vci.ubcs.system.entity.*; |
| | | import com.vci.ubcs.system.mapper.ClassifyAuthMapper; |
| | | import com.vci.ubcs.system.service.*; |
| | | import com.vci.ubcs.system.vo.MenuVO; |
| | | import com.vci.ubcs.system.mapper.MenuMapper; |
| | | import com.vci.ubcs.system.service.IMenuService; |
| | | import com.vci.ubcs.system.service.IRoleMenuService; |
| | | import com.vci.ubcs.system.service.IRoleScopeService; |
| | | import com.vci.ubcs.system.service.ITopMenuSettingService; |
| | | import com.vci.ubcs.system.wrapper.MenuWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | |
| | | private final IRoleScopeService roleScopeService; |
| | | private final MenuMapper menuMapper; |
| | | private final ITopMenuSettingService topMenuSettingService; |
| | | private final ICodeClassifyClient codeClassifyClient; |
| | | private final ClassifyAuthMapper classifyAuthMapper; |
| | | private final static String PARENT_ID = "parentId"; |
| | | private final static Integer MENU_CATEGORY = 1; |
| | | |
| | |
| | | List<Menu> allMenus = baseMapper.allMenu(); |
| | | List<Menu> roleMenus; |
| | | // è¶
级管çåå¹¶ä¸ä¸æ¯é¡¶é¨èå请æ±åè¿åå
¨é¨èå |
| | | // if (AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) { |
| | | if (VciBaseUtil.checkAdminTenant() && Func.isEmpty(topMenuId)) { |
| | | roleMenus = allMenus; |
| | | } |
| | |
| | | * ç§æ·èåæéèªå®ä¹çé |
| | | */ |
| | | private List<Menu> tenantPackageMenu(List<Menu> menu) { |
| | | // ç§æ·å
é
ç½®æ¥è¯¢ |
| | | TenantPackage tenantPackage = SysCache.getTenantPackage(AuthUtil.getTenantId()); |
| | | if (Func.isNotEmpty(tenantPackage) && tenantPackage.getId() > 0L) { |
| | | List<Long> menuIds = Func.toLongList(tenantPackage.getMenuId()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åèåä¸é¢çæé® |
| | | * è·åèåä¸é¢çæé®ï¼å«ä¹±è°ç¨ï¼è¿ä¸ªæ¹æ³æ¯éå¯¹ä¸»æ°æ®ç®¡çæé®æ¥è¯¢ç |
| | | * @param classifyId |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return List<Menu> |
| | | * @param authType |
| | | * @return |
| | | */ |
| | | @Override |
| | | //@Cacheable(cacheNames = MENU_CACHE, key = "'auth:menuButton:'+ #btmType +':'+ #userId ") |
| | | public List<Menu> getMenuButtonByType(String btmType,Long userId) { |
| | | List<String> roleIds = null; |
| | | if(!VciBaseUtil.checkAdminTenant()){ |
| | | roleIds = Arrays.asList(AuthUtil.getUser().getRoleId().split(",")); |
| | | public List<Menu> getMenuButtonByType(String classifyId,String btmType,String authType) { |
| | | // baseMapper.selectMenuChildByBtnType(btmType,roleIds); |
| | | if(Func.isBlank(classifyId)){ |
| | | throw new ServiceException("å¿
ä¼ åæ°åç±»oidä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | return baseMapper.selectMenuChildByBtnType(btmType,roleIds); |
| | | //æ¥è¯¢åç±»èç¹çææç¶çº§èç¹ |
| | | R<List<String>> listR = codeClassifyClient.selectAllParentOid(classifyId); |
| | | if (!listR.isSuccess() && !listR.getData().isEmpty()) { |
| | | throw new ServiceException("è·åå类信æ¯å¤±è´¥ï¼"); |
| | | } |
| | | // è¿åçåç±»oidæ¯å½åèç¹ä¸ºç¬¬ä¸ä¸ªï¼åé¢ä¾æ¬¡æ¯ä»çä¸å±èç¹ |
| | | List<String> classifyOidList = listR.getData(); |
| | | final String roleIds = AuthUtil.getUser().getRoleId(); |
| | | // å
æ¥è¯¢æé®idå表 |
| | | LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query() |
| | | .lambda().eq(ClassifyAuth::getClassifyId, classifyId) |
| | | .eq(ClassifyAuth::getAuthType,authType) |
| | | .in(ClassifyAuth::getRoleId, roleIds); |
| | | List<ClassifyAuth> classifyAuths = classifyAuthMapper.selectList(wrapper); |
| | | //妿å½ååç±»æ²¡ææ¾å°ææé
ç½®ï¼å°±ä¾æ¬¡ä»å½åèç¹å¾ä¸å±èç¹æ¾ææé
ç½®ï¼æ¾å°äºå°±åæ¢ï¼æ²¡æ¾å°å°±ä¸ç´æ¾å°æå |
| | | if(classifyAuths.isEmpty()){ |
| | | // 䏿 ä»1å¼å§å 为å½åèç¹0å·²ç»æ¥è¯¢è¿ |
| | | for (int i = 1; i < classifyOidList.size(); i++) { |
| | | classifyAuths = classifyAuthMapper.selectList( |
| | | Wrappers.<ClassifyAuth>query() |
| | | .lambda().eq(ClassifyAuth::getClassifyId, classifyOidList.get(i)) |
| | | .in(ClassifyAuth::getRoleId, roleIds) |
| | | ); |
| | | if(!classifyAuths.isEmpty()){ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | //åºç°äºéè¯¯æ°æ®ï¼åä¸ä¸ªè§è²ååä¸ä¸ªåç±»idåå¨å¤æ¡ææè®°å½ |
| | | if(classifyAuths.size()>1){ |
| | | throw new ServiceException("è§è²ååç±»é
ç½®åå¨å¤æ¡è®°å½ï¼è¯·è系管çäººåæ¸
çé误é
ç½®ï¼"); |
| | | } |
| | | // æ¯å¦ä¸ºè¶
管 |
| | | Boolean isAdmin = VciBaseUtil.checkAdminTenant(); |
| | | // æªé
ç½®æé®æé |
| | | if(!isAdmin && (classifyAuths.isEmpty() || Func.isBlank(classifyAuths.get(0).getButtonIds()))){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<String> ids = new ArrayList<>(); |
| | | // 妿䏿¯è¶
ç®¡ç¨æ· |
| | | if(!isAdmin){ |
| | | ids.addAll(Arrays.asList(classifyAuths.get(0).getButtonIds().split(","))); |
| | | } |
| | | return this.getMenuListByCode(ids,btmType,roleIds); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<Menu> getButtonByParentCode(String code) { |
| | | List<Menu> buttonList = menuMapper.getButtonByParentCode(code); |
| | | return buttonList; |
| | | return menuMapper.getButtonsByRoleIdAndCode(null,code); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·åèåä¿¡æ¯ |
| | | * @param ids |
| | | * @param menuCode |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Menu> getMenuListById(List<String> ids,String parentId) { |
| | | LambdaQueryWrapper<Menu> wrapper = Wrappers.<Menu>query() |
| | | .lambda().eq(Menu::getCategory, "2") |
| | | .eq(Menu::getIsDeleted,BladeConstant.DB_NOT_DELETED); |
| | | public List<Menu> getMenuListByCode(List<String> ids,String menuCode,String roleIds){ |
| | | List<Menu> menuButtonList = null; |
| | | if(VciBaseUtil.checkAdminTenant()){ |
| | | wrapper.eq(Menu::getParentId,parentId); |
| | | // æ£å¸¸æ
åµä¸æ¥è¯´è¿ä¸ªä¸åå¨ä¸ºç©ºçæ
åµ |
| | | // æ¥è¯¢è¯¥èåä¸çæææé® |
| | | menuButtonList = menuMapper.getButtonByIdsOrByParentCode(null, menuCode, null); |
| | | }else { |
| | | wrapper.in(Menu::getId, ids); |
| | | menuButtonList = menuMapper.getButtonByIdsOrByParentCode(roleIds,null,ids); |
| | | } |
| | | List<Menu> menuList = this.list(wrapper); |
| | | return menuList; |
| | | return menuButtonList; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idè·åå·²ææçæé®ä¿¡æ¯ |
| | | * @param roleId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Menu> getButtonsByRoleId(String roleId, String menuCode) { |
| | | return menuMapper.getButtonsByRoleIdAndCode(roleId,menuCode); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.mapper.RoleMapper; |
| | | import com.vci.ubcs.system.service.IMenuService; |
| | | import com.vci.ubcs.system.service.IRoleMenuService; |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID |
| | | FROM PL_SYS_MENU |
| | | WHERE CODE = 'classify_view'), '%')) |
| | | |
| | | AND AUTH_TYPE = #{authType} |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT(( |
| | | SELECT |
| | | pm.ID |
| | | FROM |
| | | PL_SYS_MENU ps, |
| | | PL_SYS_MENU pm |
| | | WHERE |
| | | ps.CODE = #{buttonCode} |
| | | AND ps.ID = pm.PARENT_ID |
| | | AND pm.CODE = #{menuCode} |
| | | ), '%')) |
| | | </select> |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="tree" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where is_deleted = 0 and category = 1 |
| | | select id, parent_id, name as title, id as "value", id as "key" |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and category = 1 |
| | | </select> |
| | | |
| | | <select id="allMenu" resultMap="menuResultMap"> |
| | | select * from pl_sys_menu where is_deleted = 0 and category = 1 |
| | | select * |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and category = 1 |
| | | </select> |
| | | |
| | | <select id="roleMenu" resultMap="menuResultMap"> |
| | |
| | | </select> |
| | | |
| | | <select id="roleMenuByTopMenuId" resultMap="menuResultMap"> |
| | | select * from pl_sys_menu where is_deleted = 0 and id IN |
| | | select * |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | and id IN |
| | | ( |
| | | SELECT menu_id FROM pl_sys_top_menu_setting WHERE top_menu_id = #{param1} |
| | | SELECT menu_id |
| | | FROM pl_sys_top_menu_setting |
| | | WHERE top_menu_id = #{param1} |
| | | ) |
| | | </select> |
| | | |
| | |
| | | and id IN ( SELECT menu_id FROM pl_org_role_menu WHERE role_id IN |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | </select> |
| | | |
| | | <select id="allButtons" resultMap="menuResultMap"> |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | parent_id, |
| | | CODE, |
| | | NAME, |
| | |
| | | pl_sys_menu |
| | | WHERE |
| | | ( |
| | | category = 2 OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0 AND category = 2 ) |
| | | category = 2 |
| | | OR id IN ( SELECT parent_id FROM pl_sys_menu WHERE is_deleted = 0 |
| | | AND category = 2 ) |
| | | ) |
| | | AND is_deleted = 0 |
| | | ORDER BY sort |
| | |
| | | ) menu ORDER BY sort |
| | | </select> |
| | | |
| | | <select id="getButtonByParentCode" resultMap="menuResultMap"> |
| | | SELECT |
| | | id, |
| | | parent_id, |
| | | code, |
| | | name, |
| | | alias, |
| | | PATH, |
| | | SOURCE, |
| | | ACTION, |
| | | sort |
| | | FROM |
| | | PL_SYS_MENU |
| | | <select id="getButtonsByRoleIdAndCode" resultMap="menuResultMap"> |
| | | SELECT pm.* |
| | | FROM PL_SYS_MENU ps, |
| | | PL_SYS_MENU pm |
| | | <if test="roleId != null and roleId != ''"> |
| | | ,PL_ORG_ROLE_MENU prom |
| | | </if> |
| | | WHERE |
| | | "CATEGORY" = '2' |
| | | AND IS_DELETED = 0 |
| | | AND PARENT_ID IN ( |
| | | SELECT |
| | | ID |
| | | FROM |
| | | PL_SYS_MENU |
| | | WHERE |
| | | CODE = #{code}) |
| | | ORDER BY SORT |
| | | ps."CATEGORY" = 1 |
| | | <if test="roleId != null and roleId != ''"> |
| | | AND pm.ID = prom.MENU_ID |
| | | AND prom.ROLE_ID = #{roleId} |
| | | </if> |
| | | AND pm.IS_DELETED = 0 |
| | | <if test="code != null and code != ''"> |
| | | AND ps.ID = pm.PARENT_ID |
| | | AND ps.CODE = #{code} |
| | | </if> |
| | | ORDER BY pm.SORT ASC |
| | | </select> |
| | | |
| | | <select id="grantTree" resultMap="treeNodeResultMap"> |
| | | select |
| | | id, |
| | | select id, |
| | | parent_id, |
| | | name as title, |
| | | id as "value", |
| | | id as "key" |
| | | from pl_sys_menu where is_deleted = 0 order by sort |
| | | from pl_sys_menu |
| | | where is_deleted = 0 |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTreeByRole" resultMap="treeNodeResultMap"> |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | or id in ( |
| | | select parent_id from pl_sys_menu where is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTopTree" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0 order by sort |
| | | select id, parent_id, name as title, id as "value", id as "key" |
| | | from pl_sys_menu |
| | | where category = 1 |
| | | and is_deleted = 0 |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantTopTreeByRole" resultMap="treeNodeResultMap"> |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and is_deleted = 0 |
| | | select id, parent_id, name as title, id as "value", id as "key" from pl_sys_menu where category = 1 and |
| | | is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | or id in ( |
| | | select parent_id from pl_sys_menu where is_deleted = 0 |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | order by sort |
| | | </select> |
| | | |
| | | <select id="grantDataScopeTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id, |
| | | SELECT * |
| | | FROM ( |
| | | SELECT id, |
| | | parent_id, |
| | | NAME AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_sys_menu |
| | | WHERE |
| | | category = 1 |
| | | FROM pl_sys_menu |
| | | WHERE category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_data WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | menu_id AS parent_id, |
| | | scope_name AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_auth_scope_data |
| | | WHERE |
| | | is_deleted = 0 |
| | | FROM pl_auth_scope_data |
| | | WHERE is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | | </select> |
| | | |
| | | <select id="grantApiScopeTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | id, |
| | | SELECT * |
| | | FROM ( |
| | | SELECT id, |
| | | parent_id, |
| | | NAME AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_sys_menu |
| | | WHERE |
| | | category = 1 |
| | | FROM pl_sys_menu |
| | | WHERE category = 1 |
| | | AND is_deleted = 0 |
| | | AND id IN ( SELECT menu_id FROM pl_auth_scope_api WHERE is_deleted = 0 AND menu_id IS NOT NULL ) |
| | | ) menu |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | id, |
| | | SELECT id, |
| | | menu_id AS parent_id, |
| | | scope_name AS title, |
| | | id AS "value", |
| | | id AS "key" |
| | | FROM |
| | | pl_auth_scope_api |
| | | WHERE |
| | | is_deleted = 0 |
| | | FROM pl_auth_scope_api |
| | | WHERE is_deleted = 0 |
| | | AND menu_id IS NOT NULL |
| | | </select> |
| | | |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | ) menu |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | AND menu_id IS NOT NULL |
| | |
| | | select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | ) menu |
| | |
| | | and id in ( select menu_id from pl_org_role_menu where role_id in |
| | | <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> ) |
| | | </foreach> |
| | | ) |
| | | ) |
| | | ) |
| | | AND menu_id IS NOT NULL |
| | |
| | | and ps.CODE = #{btmType} |
| | | and ps.ID = pm.PARENT_ID |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | and ps.ID in ( |
| | | and ps.ID in |
| | | SELECT menu_id FROM pl_org_role_menu WHERE role_id IN |
| | | <foreach collection="roleIds" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | order by pm.sort asc |
| | | </select> |
| | | |
| | | <select id="getButtonByIdsOrByParentCode" resultMap="menuResultMap"> |
| | | SELECT |
| | | pm.* |
| | | FROM |
| | | PL_SYS_MENU pm |
| | | <if test="code != null and code != ''"> |
| | | ,PL_SYS_MENU ps |
| | | </if> |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | ,PL_ORG_ROLE_MENU prom |
| | | </if> |
| | | WHERE |
| | | pm.IS_DELETED = 0 |
| | | AND pm."CATEGORY" = 2 |
| | | <if test="code != null and code != ''"> |
| | | AND ps."CATEGORY" = 1 |
| | | AND ps.ID = pm.PARENT_ID |
| | | AND ps.CODE = #{code} |
| | | </if> |
| | | <if test="roleIds != null and roleIds != ''"> |
| | | AND pm.ID = prom.MENU_ID |
| | | AND prom.ROLE_ID in (#{roleIds}) |
| | | </if> |
| | | <if test="ids != null and ids != ''"> |
| | | AND pm.ID IN |
| | | <foreach collection="ids" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | ORDER BY SORT ASC |
| | | </select> |
| | | |
| | | </mapper> |