Merge remote-tracking branch 'origin/master'
已修改47个文件
已删除93个文件
已添加10个文件
| | |
| | | "portfinder": "1.0.23", |
| | | "save": "2.9.0", |
| | | "script-loader": "0.7.2", |
| | | "uuid": "^9.0.1", |
| | | "vue": "2.6.10", |
| | | "vue-axios": "^2.1.2", |
| | | "vue-clipboard2": "^0.3.3", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getClassifyAuthList = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/classifyAuth/list', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const saveOrUpdate = (data) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/classifyAuth/saveOrUpdate', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export const getAuthButtonList = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/classifyAuth/getAuthButtonList', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export const getButtonByParentCode = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/menu/getButtonByParentCode', |
| | | method: 'get', |
| | | params: { |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getMenuList = (current, size, params) => { |
| | | return request({ |
| | | url: '/api/ubcs-system/menu/menu-list', |
| | |
| | | <template v-for="item in slotColumnList" :slot="item.prop + ''"> |
| | | <vciWebRefer |
| | | v-if="item.type == 'refer'" :key="item.dataKey" |
| | | referType="master" |
| | | :data-key="item.dataKey" |
| | | :disabled="item.disabled" |
| | | :display="item.display" |
| | |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" |
| | | :option="Treeoption" style="width: fit-content;" @node-click="nodeClick"> |
| | | <template slot-scope="{ node }"> |
| | | <el-tooltip class="item" effect="dark" open-delay="350" :content="$createElement('div', { domProps: { innerHTML: node.label } })" placement="right-start"> |
| | | <span id="labelSize" v-html="node.label" ></span> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" |
| | | open-delay="350" placement="right-start"> |
| | | <span id="labelSize" v-html="node.label"></span> |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-tree> |
| | |
| | | const index = this.$route.query.id.indexOf('@'); |
| | | const result = this.$route.query.id.substring(0, index); |
| | | this.idData = result; |
| | | this.removeList(); |
| | | getTreeList({'conditionMap[id]': this.idData}).then(res => { |
| | | if (res) { |
| | | if (res.data.length === 0) { |
| | |
| | | this.$message.error(res) |
| | | }); |
| | | }, |
| | | |
| | | removeList() { |
| | | this.$emit('tableHeadDataFateher', []); |
| | | this.$emit('tableHeadFindData', []); |
| | | this.$emit('tableHeadBttoms', []); |
| | | this.$emit('tableDataArray', []) |
| | | this.$emit('total', null) |
| | | }, |
| | | //å®ä¹ä¸ä¸ªä¿®æ¹æ°æ®å±æ§åçæ¹æ³ |
| | | ModifyProperties(obj, oldName, newName) { |
| | | for (let key in obj) { |
| | |
| | | List.forEach(item => { |
| | | let columnItem = { |
| | | label: item.title, |
| | | prop: item.queryField, |
| | | prop: item.field, |
| | | // type: this.columnType[item.type], |
| | | sortable: item.sort, |
| | | width: item.minWidth |
| | | width: item.minWidth, |
| | | query: item.queryField |
| | | }; |
| | | this.tableHeadFindData.push(Object.assign(item, columnItem)) |
| | | }) |
| | |
| | | margin-left: 6px; |
| | | font-size: 18px; |
| | | } |
| | | #labelSize{ |
| | | |
| | | #labelSize { |
| | | font-size: 14px !important; |
| | | } |
| | | </style> |
| | |
| | | </el-button> |
| | | <span v-if="tableHeadFindData.length > 0 "> |
| | | <el-select slot="prepend" v-model="keyWordFind" placeholder="è¯·éæ©" size="small" @change="searchChange"> |
| | | <el-option v-for="item in tableHeadFindData" :key="item.id" :label="item.label" :value="item.prop" ></el-option> |
| | | <el-option v-for="item in tableHeadFindData" :key="item.id" :label="item.label" |
| | | :value="item.query"></el-option> |
| | | </el-select> |
| | | <el-input v-model="WupinFindValue" placeholder="请è¾å
¥å
³é®åæå车æ¥è¯¢" |
| | | size="small" style="width: 180px; margin-left: 5px; margin-top: 10px" v-if="!isTimeStatus" |
| | | <el-input v-if="!isTimeStatus" v-model="WupinFindValue" |
| | | placeholder="请è¾å
¥å
³é®åæå车æ¥è¯¢" size="small" style="width: 180px; margin-left: 5px; margin-top: 10px" |
| | | @keyup.enter.native="tableFindInp"></el-input> |
| | | </span> |
| | | <span class="block" v-if="tableHeadFindData.length > 0 && isTimeStatus"> |
| | | <span v-if="tableHeadFindData.length > 0 && isTimeStatus" class="block"> |
| | | <el-date-picker |
| | | v-model="dateValue" |
| | | placeholder="éæ©æ¥æ" |
| | | size="small" |
| | | type="date" |
| | | style="margin-left: 5px" |
| | | @change="dateChange" |
| | | placeholder="éæ©æ¥æ"> |
| | | type="date" |
| | | @change="dateChange"> |
| | | </el-date-picker> |
| | | </span> |
| | | <span v-if="tableHeadFindData.length > 0" style="margin-left: 10px"> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | isTimeStatus:false, |
| | | isTimeName:'', |
| | | dateValue:"", |
| | | isTimeStatus: false, |
| | | isTimeName: '', |
| | | dateValue: "", |
| | | //æ¹éç¼è¾å¯¹è¯æ¡ |
| | | bulkeditvisible: false, |
| | | LinkVisible: false, |
| | |
| | | key: "oid", |
| | | label: "name", |
| | | }, |
| | | tableHeadFindDatas: [], |
| | | applyvisible: false, |
| | | amendvisible: false, |
| | | addvisible: false, |
| | |
| | | }, |
| | | tableHeadDataFateher: { |
| | | handler(newval, oldval) { |
| | | this.options = newval.tableDefineVO.seniorQueryColumns |
| | | // console.log(newval) |
| | | if (newval.length > 0) { |
| | | this.options = newval.tableDefineVO.seniorQueryColumns |
| | | } |
| | | } |
| | | }, |
| | | codeClassifyOid: { |
| | |
| | | tableDataArray: { |
| | | handler(newval, oldval) { |
| | | this.tableData = newval; |
| | | this.searchResults = newval |
| | | this.searchResults = newval; |
| | | this.doLayout(); |
| | | this.fileOptions = { |
| | | ownbizOid: "0", |
| | | ownbizBtm: "0", |
| | | fileDocClassify: '!=processAuditSuggest', |
| | | fileDocClassifyName: '', |
| | | hasDownload: true, |
| | | hasUpload: true, |
| | | height: 'auto' |
| | | if (newval.length > 0) { |
| | | this.fileOptions = { |
| | | ownbizOid: "0", |
| | | ownbizBtm: "0", |
| | | fileDocClassify: '!=processAuditSuggest', |
| | | fileDocClassifyName: '', |
| | | hasDownload: true, |
| | | hasUpload: true, |
| | | height: 'auto' |
| | | } |
| | | } else { |
| | | this.fileOptions = {}; |
| | | } |
| | | }, |
| | | }, |
| | |
| | | |
| | | if (_index == 0) { |
| | | this.keyWordFind = record.queryField; |
| | | }; |
| | | } |
| | | ; |
| | | // if(record.fieldType === "datetime"){ |
| | | // this.isTimeStatus = true; |
| | | // console.log(this.isTimeStatus) |
| | | // console.log(record) |
| | | // } |
| | | }) |
| | | this.tableHeadFindDatas = newval; |
| | | if (newval) { |
| | | this.CodeArray = []; |
| | | if (newval.find(item => item.prop === 'id')) { |
| | |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | ...val, |
| | | page: this.page.currentPage = 1,/** æ¯æ¬¡ç¹å»é«çº§æ¥è¯¢é½åºè¯¥ä»ç¬¬ä¸é¡µå¼å§*/ |
| | | page: this.page.currentPage = 1, /** æ¯æ¬¡ç¹å»é«çº§æ¥è¯¢é½åºè¯¥ä»ç¬¬ä¸é¡µå¼å§*/ |
| | | limit: this.page.pageSize |
| | | }); |
| | | this.tableData = res.data.data; |
| | |
| | | }); |
| | | // console.log(this.isTimeStatus) |
| | | }, |
| | | dateChange(val){ |
| | | if(val){ |
| | | dateChange(val) { |
| | | if (val) { |
| | | const momentDate = moment(this.dateValue); |
| | | const dateString = momentDate.format("yyyy-MM-DD"); |
| | | this.isLoading = true; |
| | |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | ['conditionMap[' + this.keyWordFind + ']']: dateString |
| | | ['conditionMap[' + this.keyWordFind + ']']: dateString |
| | | }).then(res => { |
| | | this.tableData = res.data.data; |
| | | this.page.total = res.data.total; |
| | |
| | | tableFindInp() { |
| | | this.isLoading = true; |
| | | try { |
| | | this.conditionMap = {}; |
| | | // å卿¥è¯¢æ¡ä»¶ï¼ä¸»è¦æ¯ä¸ºäºç¹å»é¡µç æ¶å¸¦ä¸è¿ä¸ªæ¡ä»¶ |
| | | this.conditionMap["conditionMap[" + this.keyWordFind + "]"] = '*' + this.WupinFindValue + '*'; |
| | | console.log(this.conditionMap) |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | |
| | | <basic-container> |
| | | <v-chart id="chart" :auto-resize="true" :options="chartOptions"></v-chart> |
| | | <div style="display: inline-block;float: right;margin-bottom: 10px;margin-right: 60px"> |
| | | <el-button size="small" type="primary" plain @click="delHandler">å é¤</el-button> |
| | | <el-button size="small" type="danger" plain @click="delHandler">å é¤</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | |
| | | import 'echarts/lib/component/tooltip' |
| | | import 'echarts/lib/component/title' |
| | | import 'echarts/lib/component/legend' |
| | | import {deleteChartId} from "@/api/statistic/chart" |
| | | import { deleteChartId } from "@/api/statistic/chart" |
| | | |
| | | export default { |
| | | name: "ColumnarChart", |
| | | props:{ |
| | | columnarData:{ |
| | | type:Array, |
| | | default:[] |
| | | props: { |
| | | columnarData: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | chartName:{ |
| | | type:String, |
| | | chartName: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | btmname :{ |
| | | btmname: { |
| | | type: String |
| | | } |
| | | }, |
| | | watch:{ |
| | | columnarData:{ |
| | | immediate:true, |
| | | handler(newval,oldval){ |
| | | if(newval && newval.length > 0){ |
| | | const minValues = newval[0].map(function (_, i) { |
| | | return Math.min.apply( |
| | | null, |
| | | newval.map(function (item) { |
| | | return item[i]; |
| | | }) |
| | | ); |
| | | }); |
| | | |
| | | let colors = ['#84C9E5', '#F68686']; |
| | | |
| | | const seriesData = []; |
| | | for (let i = 0; i < newval.length; i++) { |
| | | let curSeriesData = []; |
| | | for (let j = 0; j < newval[i].length; j++) { |
| | | let borderRadius = [0, 0, 0, 0]; |
| | | if (newval[i][j] === minValues[j]) { |
| | | borderRadius = [50, 50, 0, 0]; |
| | | } |
| | | curSeriesData.push({ |
| | | value: newval[i][j], |
| | | itemStyle: { |
| | | normal: { |
| | | // barBorderRadius: borderRadius, // 设置åè§ |
| | | color: colors[i], |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | let seriesName = (i === 0 ? "æ»é" : "æ°å¢") |
| | | seriesData.push({ |
| | | name: seriesName, |
| | | type: "bar", |
| | | stack: "æ»é", |
| | | barWidth: 60, |
| | | data: curSeriesData, |
| | | watch: { |
| | | columnarData: { |
| | | immediate: true, |
| | | handler(newval, oldval) { |
| | | if (newval && newval.length > 0) { |
| | | let seriesData = newval.map((data, index) => { |
| | | let name = index === 0 ? "æ»é" : "æ°å¢"; |
| | | return { |
| | | name: name, |
| | | type: 'bar', |
| | | data: data, |
| | | barWidth: '40%', |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function (params) { |
| | | return params.value === 0 ? '' : params.value; // å¼ä¸º 0 䏿¾ç¤ºï¼å
¶ä»æ
嵿¾ç¤º |
| | | } |
| | | // formatter: function (params) { |
| | | // if (params.value !== 0) { |
| | | // return params.value; |
| | | // } else { |
| | | // return ''; |
| | | // } |
| | | // } |
| | | }, |
| | | emphasis: { |
| | | focus: "series", |
| | | }, |
| | | }); |
| | | this.chartOptions.series=seriesData |
| | | } |
| | | }; |
| | | }); |
| | | this.chartOptions.series = seriesData; |
| | | } |
| | | } |
| | | }, |
| | | chartName:{ |
| | | handler(newval,oldval){ |
| | | if(newval){ |
| | | chartName: { |
| | | handler(newval, oldval) { |
| | | if (newval) { |
| | | this.chartOptions.title.text = newval + "æ°æ®ç»è®¡" |
| | | } |
| | | }, |
| | | immediate:true, |
| | | deep:true |
| | | immediate: true, |
| | | deep: true |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chartOptions: { |
| | | color:['#84C9E5', '#F68686'], |
| | | color: ['#84C9E5', '#F68686'], |
| | | title: { |
| | | text: "", |
| | | }, |
| | |
| | | }, |
| | | created() { |
| | | }, |
| | | methods:{ |
| | | delHandler(){ |
| | | deleteChartId({btmname:this.btmname,chartId:'2'}).then(res=>{ |
| | | this.$message.success('å 餿å') |
| | | methods: { |
| | | delHandler() { |
| | | deleteChartId({ btmname: this.btmname, chartId: '2' }).then(res => { |
| | | this.$message.success(this.chartName+'æ±ç¶å¾ï¼å 餿åï¼') |
| | | this.$emit('refresh'); |
| | | }).catch(error=>{ |
| | | }).catch(error => { |
| | | this.$message.error(error) |
| | | }) |
| | | } |
| | |
| | | <basic-container> |
| | | <v-chart id="chart" :auto-resize="true" :options="chartOptions"></v-chart> |
| | | <div style="display: inline-block;float: right;margin-bottom: 10px;margin-right: 60px"> |
| | | <el-button size="small" type="primary" plain @click="delHandler">å é¤</el-button> |
| | | <el-button size="small" type="danger" plain @click="delHandler">å é¤</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </div> |
| | |
| | | methods:{ |
| | | delHandler(){ |
| | | deleteChartId({btmname:this.btmname,chartId:'0'}).then(res=>{ |
| | | this.$message.success('å 餿å') |
| | | this.$message.success(this.chartName+'æçº¿å¾ï¼å 餿åï¼') |
| | | this.$emit('refresh'); |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
| | |
| | | <basic-container> |
| | | <v-chart id="chart" :auto-resize="true" :options="chartOptions"></v-chart> |
| | | <div style="display: inline-block;float: right;margin-bottom: 10px;margin-right: 60px"> |
| | | <el-button size="small" type="primary" plain @click="delHandler">å é¤</el-button> |
| | | <el-button size="small" type="danger" plain @click="delHandler">å é¤</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | |
| | | methods:{ |
| | | delHandler(){ |
| | | deleteChartId({btmname:this.btmname,chartId:'3'}).then(res=>{ |
| | | this.$message.success('å 餿å') |
| | | this.$message.success(this.chartName+'å å æçº¿å¾ï¼å 餿åï¼') |
| | | this.$emit('refresh'); |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
| | |
| | | <basic-container style="width: 100%"> |
| | | <v-chart :options="chartOptions" :auto-resize="true" id="chart"></v-chart> |
| | | <div style="display: inline-block;float: right;margin-bottom: 10px;margin-right: 60px"> |
| | | <el-button size="small" type="primary" plain @click="delHandler">å é¤</el-button> |
| | | <el-button size="small" type="danger" plain @click="delHandler">å é¤</el-button> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | |
| | | methods:{ |
| | | delHandler(){ |
| | | deleteChartId({btmname:this.btmname,chartId:'1'}).then(res=>{ |
| | | this.$message.success('å 餿å') |
| | | this.$message.success(this.chartName+'饼ç¶å¾ï¼å 餿åï¼') |
| | | this.$emit('refresh'); |
| | | }).catch(error=>{ |
| | | this.$message.error(error) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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]" |
| | | > |
| | | <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]"> |
| | | </el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <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> |
| | | </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'; |
| | | |
| | | export default { |
| | | name: "classifyAuthDialog.vue", |
| | | props: { |
| | | classifyData: { |
| | | type: "Object", |
| | | default: "", |
| | | }, |
| | | /**å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶*/ |
| | | visible: { |
| | | type: "Boolean", |
| | | default: false, |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | // å¯¹è¯æ¡æ¾ç¤ºæ§å¶ |
| | | isShowDialog: this.visible, |
| | | isLoading: false, |
| | | tableHeight: 'calc(100vh - 550px)', |
| | | classifyAuthData: [], |
| | | //å头 |
| | | classifyAuthHeader: [], |
| | | //æé®æ°æ® |
| | | classifyAuthButton: [], |
| | | //è§è²å表 |
| | | roleList: [], |
| | | //å½åéä¸çè¡¨æ ¼è¡ |
| | | selectList: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | // çå¬ç¶ç»ä»¶ä¼ ççªå£æ¾ç¤ºéèçå¼ |
| | | visible() { |
| | | if (this.visible) { |
| | | this.isShowDialog = this.visible; |
| | | return new Promise((resolve, reject) => { |
| | | getButtonByParentCode({code: "classifyTree"}).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, |
| | | 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}).then(res => { |
| | | //console.log(res.data.data); |
| | | let authDatas = res.data.data; |
| | | if (authDatas.length > 0) { |
| | | authDatas.forEach(authData => { |
| | | let item = { |
| | | oid: authData.oid, |
| | | roleData: authData.roleId, |
| | | classifyItem: this.classifyData.label, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | //å°æé®è®¾ç½®è¿å» |
| | | authData.buttonIdList.forEach(data => { |
| | | Vue.set(item, data, true); |
| | | }); |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item); |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | // å
³éå¯¹è¯æ¡ |
| | | closeDialog() { |
| | | this.$emit('update:visible', false); |
| | | this.classifyAuthData = []; |
| | | }, |
| | | // å¢å è¡ |
| | | addClassifyAuth() { |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | | uuid: uuidv4(),//çæå¯ä¸çid |
| | | } |
| | | //å°æé®è®¾ç½®è¿å» |
| | | this.classifyAuthButton.forEach(data => { |
| | | Vue.set(item, data.id, false); |
| | | }) |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item) |
| | | // console.log(this.classifyAuthData); |
| | | }, |
| | | // å é¤è¡ |
| | | 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(","), |
| | | } |
| | | 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); |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | </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> |
| | |
| | | </div> |
| | | </div> |
| | | <div style="display: flex;margin-top: 5px;margin-bottom: 5px"> |
| | | <el-button v-if="permissionList.flowingBtnStuatus" plain size="mini" type="primary" @click="testHandler">æµæ°´å¤ç |
| | | <el-button v-if="permissionList.flowingBtnStuatus" plain size="mini" type="primary" |
| | | @click="flowingDependHandler">æµæ°´å¤ç |
| | | </el-button> |
| | | <el-button v-if="permissionList.classifyAuth" plain size="mini" type="primary" |
| | | @click="classifyAuthHandler">åç±»ææ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 230px);overflow: auto"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | class="classifyTree" |
| | | style="height: calc(100vh - 290px)" |
| | | @node-click="nodeClick" |
| | | > |
| | | <template slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark" |
| | | open-delay="500" |
| | | placement="right-start"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 230px);overflow: auto"> |
| | | <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" |
| | | :defaultExpandAll="false" |
| | | :option="Treeoption" |
| | | class="classifyTree" |
| | | style="height: calc(100vh - 290px)" |
| | | @node-click="nodeClick" |
| | | > |
| | | <template slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" |
| | | effect="dark" |
| | | open-delay="500" |
| | | placement="right-start"> |
| | | <span style="font-size: 14px;"> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-tree> |
| | | </div> |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-tree> |
| | | </div> |
| | | |
| | | <!-- æ èç¹æ·»å å¯¹è¯æ¡--> |
| | | <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler" |
| | | :title="this.TreeFlag ? 'æ·»å åç±»' :'æ·»å 主é¢åº'" :visible.sync="TreeAddFormVisible" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form ref="myForm" :model="TreeAddform" :rules= "rules"> |
| | | <el-form-item :label="this.TreeFlag ? 'åç±»ç¼å·ï¼' :'主é¢åºç¼å·ï¼'" label-width="150px" prop="id" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="this.TreeFlag ? 'åç±»åç§°ï¼' :'主é¢åºåç§°ï¼'" label-width="110px" prop="name" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="TreeFlagCode" label="åå¨çä¸å¡ç±»åï¼" label-width="150px" prop="btmTypeName"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" |
| | | @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼ç è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å
³é®å±æ§æ¥è¯¢è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px" |
| | | @focus="Keyfouce"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦åä¸å
³é®å±æ§æ ¡éªï¼" label-width="170px"> |
| | | <el-switch |
| | | v-model="TreeAddform.codeKeyAttrValue" |
| | | active-color="#13ce66" |
| | | active-text="æ¯" |
| | | inactive-color="#ff4949" |
| | | inactive-text="å¦" |
| | | @change="switchChange"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="ç¸ä¼¼æ¥è¯¢è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="simFouce"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="TreeEscHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="TreeAddHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- ä¿®æ¹å¯¹è¯æ¡--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="ä¿®æ¹åç±»"> |
| | | <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" |
| | | :flag="'edit'" |
| | | :loneTreeNewForm="TreeList" :nodeClickList="nodeClickList" |
| | | :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed" |
| | | @referTreeForm="referTreeForm"></classifyTreeform> |
| | | </el-dialog> |
| | | <!-- æ èç¹æ·»å å¯¹è¯æ¡--> |
| | | <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler" |
| | | :title="this.TreeFlag ? 'æ·»å åç±»' :'æ·»å 主é¢åº'" :visible.sync="TreeAddFormVisible" append-to-body |
| | | style="width: 1700px;margin: auto"> |
| | | <el-form ref="myForm" :model="TreeAddform" :rules="rules"> |
| | | <el-form-item :label="this.TreeFlag ? 'åç±»ç¼å·ï¼' :'主é¢åºç¼å·ï¼'" label-width="150px" prop="id" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label="this.TreeFlag ? 'åç±»åç§°ï¼' :'主é¢åºåç§°ï¼'" label-width="110px" prop="name" |
| | | style="display: inline-block"> |
| | | <el-input v-model="TreeAddform.name" autocomplete="off" style="width: 170px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="TreeFlagCode" label="åå¨çä¸å¡ç±»åï¼" label-width="150px" prop="btmTypeName"> |
| | | <el-input v-model="TreeAddform.btmTypeName" autocomplete="off" style="width: 585px" |
| | | @focus="btmFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.description" autocomplete="off" style="width: 585px"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼ç è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="CodeFoucus"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å
³é®å±æ§æ¥è¯¢è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeKeyAttrRepeatOidName" autocomplete="off" style="width: 585px" |
| | | @focus="Keyfouce"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦åä¸å
³é®å±æ§æ ¡éªï¼" label-width="170px"> |
| | | <el-switch |
| | | v-model="TreeAddform.codeKeyAttrValue" |
| | | active-color="#13ce66" |
| | | active-text="æ¯" |
| | | inactive-color="#ff4949" |
| | | inactive-text="å¦" |
| | | @change="switchChange"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="ç¸ä¼¼æ¥è¯¢è§åï¼" label-width="150px"> |
| | | <el-input v-model="TreeAddform.codeResembleRuleOidName" autocomplete="off" style="width: 585px" |
| | | @focus="simFouce"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="TreeEscHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="TreeAddHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- ä¿®æ¹å¯¹è¯æ¡--> |
| | | <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="ä¿®æ¹åç±»"> |
| | | <classifyTreeform ref="childForm" :Editclose=" ()=>{TreeEditFormVisible=false}" :TreeFlag="editTreeFLagCode" |
| | | :flag="'edit'" |
| | | :loneTreeNewForm="TreeEditObj" :nodeClickList="nodeClickList" |
| | | :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed" |
| | | @referTreeForm="referTreeForm"></classifyTreeform> |
| | | </el-dialog> |
| | | <!-- åç±»ææå¯¹è¯æ¡--> |
| | | <classify-auth-dialog |
| | | :classifyData="classifyData" |
| | | :visible.sync="classifyAuthVisible" |
| | | ></classify-auth-dialog> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | |
| | | <!-- å³ä¾§è¡¨æ ¼--> |
| | | <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs> |
| | | <span v-if="type.prop==='tab1'"> |
| | | <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeList" |
| | | <classifyTreeform ref="childForm" :flag="'renonly'" :loneTreeNewForm="TreeEditObj" |
| | | :nodeList="nodeList"></classifyTreeform> |
| | | </span> |
| | | <span v-else-if="type.prop==='tab2'"> |
| | |
| | | import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master' |
| | | import func from "@/util/func"; |
| | | import {mapGetters} from "vuex"; |
| | | import ClassifyAuth from './ClassifyAuthDialog.vue'; |
| | | |
| | | export default { |
| | | components: {ClassifyAuth}, |
| | | name: "classifyTrees.vue", |
| | | data() { |
| | | return { |
| | |
| | | masterOption: { |
| | | addBtn: false, |
| | | index: true, |
| | | refreshBtn:false, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | border: true, |
| | | menu: false, |
| | |
| | | addBtn: false, |
| | | index: true, |
| | | columnBtn: false, |
| | | refreshBtn:false, |
| | | refreshBtn: false, |
| | | border: true, |
| | | menu: false, |
| | | height: 380, |
| | |
| | | TreeEditFormVisible: false, |
| | | //æ·»å å¯¹è¯æ¡ |
| | | TreeAddFormVisible: false, |
| | | //åç±»ææå¯¹è¯æ¡ |
| | | classifyAuthVisible: false, |
| | | //å½åç¹å»é¡¹ |
| | | nodeClickList: "", |
| | | ClonenodeClickList: "", |
| | |
| | | } |
| | | ], |
| | | //ä¼ éç»åç»ä»¶å¨ææ¸²æçæ°æ® |
| | | TreeList: {}, |
| | | TreeEditObj: {}, |
| | | codeClassifyOid: "", |
| | | upAndStopAndStartData: { |
| | | upVersion: { |
| | |
| | | }, |
| | | //模æ¿ç®¡çç¼è¾ |
| | | showEditBtn: false, |
| | | //ä¼ éç»åç±»ææåç»ä»¶å¯¹è¯æ¡çå½åéä¸çåç±»èç¹ä¿¡æ¯ |
| | | classifyData: "", |
| | | } |
| | | }, |
| | | watch: {}, |
| | |
| | | const treeEle = this.$refs.tree.$el |
| | | treeEle.addEventListener('click', (e) => { |
| | | if (e.target.nodeName !== 'SPAN') { |
| | | this.$refs.tree.setCurrentKey(null) |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {}; |
| | | this.TreeFlagCode = true; |
| | | } |
| | | }, true) |
| | |
| | | TemRefreshStatus: this.vaildData(this.permission.classifyTree.manage_break, false), |
| | | CloneBtnStuatus: this.vaildData(this.permission.classifyTree.manage_clone, false), |
| | | flowingBtnStuatus: this.vaildData(this.permission.classifyTree.tree_flowing, false), |
| | | classifyAuth: this.vaildData(this.permission.classifyTree.classify_auth, false), |
| | | } |
| | | }, |
| | | crudTreeOption() { |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | handleTabClick(){ |
| | | |
| | | // åç±»ææå¯¹è¯æ¡æå¼ |
| | | classifyAuthHandler() { |
| | | if (this.nodeClickList.oid === '' || this.nodeClickList.oid === undefined) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®ï¼') |
| | | return; |
| | | } |
| | | this.classifyData = this.nodeClickList; |
| | | this.classifyAuthVisible = true; |
| | | }, |
| | | testHandler(){ |
| | | if(this.nodeClickList.length <=0 ){ |
| | | flowingDependHandler() { |
| | | if (this.nodeClickList.length <= 0) { |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®ï¼') |
| | | return; |
| | | } |
| | |
| | | }, |
| | | //åä¼ ç¶ |
| | | MasterHandler(val) { |
| | | this.TreeList = val; |
| | | this.TreeEditObj = val; |
| | | }, |
| | | rowHandle(row, column) { |
| | | this.selectRow = row.$index; |
| | |
| | | }, |
| | | //æ å·æ° |
| | | async flushed() { |
| | | await this.getAttr() |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {} |
| | | this.TreeList = [] |
| | | this.TreeFlagCode = true; |
| | | await this.getAttr() |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.nodeClickList = {}; |
| | | this.TreeEditObj = {}; |
| | | this.TreeFlagCode = true; |
| | | }, |
| | | //å¯ç¨ååç¨é½å
å¤æç¶æ |
| | | //å¯ç¨ |
| | |
| | | this.ProData = []; |
| | | this.crudOid = '' |
| | | } |
| | | this.TreeList = res3.data.data; |
| | | if (this.TreeList.isParticipateCheck === null || this.TreeList.isParticipateCheck === undefined || this.TreeList.isParticipateCheck === "") { |
| | | this.$set(this.TreeList, "isParticipateCheck", 1) |
| | | this.TreeEditObj = res3.data.data; |
| | | if (this.TreeEditObj.isParticipateCheck === null || this.TreeEditObj.isParticipateCheck === undefined || this.TreeEditObj.isParticipateCheck === "") { |
| | | this.$set(this.TreeEditObj, "isParticipateCheck", 1) |
| | | return |
| | | } |
| | | } catch (error) { |
| | |
| | | //åºæ¬ä¿¡æ¯è¡¨åå·æ° |
| | | referTreeForm() { |
| | | getObjectByOid(this.nodeClickList.oid).then(res => { |
| | | this.TreeList = res.data.data; |
| | | this.TreeEditObj = res.data.data; |
| | | }).catch(res => { |
| | | this.$message.error(res) |
| | | }) |
| | |
| | | condtionParam['conditionMap['+searchConditions[index].queryField+searchConditions[index].condition+']'] = searchConditions[index].fieldValue; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | // æ¥è¯¢æ¡ä»¶æ²¡æåºç°éå¤å±æ§ï¼å¹¶ä¸è¿æ»¤æäºç©ºå¼ï¼å°±ä¼ éç»ç¶ç»ä»¶ |
| | | //console.log(condtionParam); |
| | |
| | | <template> |
| | | <div v-if="display"> |
| | | <vciWebReferTree :key="key" :data-key="key" ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> |
| | | <vciWebReferTable :key="key" :data-key="key" v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> |
| | | <vciWebReferDefalut :key="key" :data-key="key" v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> |
| | | <vciWebReferTree |
| | | v-if="refertype=='tree'" |
| | | :key="key" ref="vciWebReferTree" |
| | | :data-key="key" |
| | | :disabled="disabled" |
| | | :referConfig="referConfig" |
| | | :text="text" |
| | | :title="title" |
| | | :value="value" |
| | | @setValue="setValue"> |
| | | </vciWebReferTree> |
| | | |
| | | <vciWebReferTable |
| | | v-else-if="refertype=='table'" |
| | | :key="key" :data-key="key" |
| | | :disabled="disabled" |
| | | :referConfig="referConfig" |
| | | :referType="referType" |
| | | :text="text" |
| | | :title="title" |
| | | :value="value" |
| | | @setValue="setValue"> |
| | | </vciWebReferTable> |
| | | |
| | | <vciWebReferDefalut |
| | | v-else |
| | | :key="key" |
| | | :data-key="key" |
| | | :disabled="disabled" |
| | | :referConfig="referConfig" |
| | | :referType="referType" |
| | | :text="text" :title="title" |
| | | :value="value" |
| | | @setValue="setValue"> |
| | | </vciWebReferDefalut> |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | import vciWebReferTree from "./vciWebReferTree.vue"; |
| | | import vciWebReferTable from "./vciWebReferTable.vue"; |
| | | import vciWebReferDefalut from "./vciWebReferDefalut.vue"; |
| | | |
| | | export default { |
| | | name: "vciWebRefer", |
| | | props: ["referConfig","value","text","disabled","display",'key'], |
| | | props: ["referConfig", "value", "text", "disabled", "display", 'key', 'referType'], |
| | | components: {vciWebReferTree, vciWebReferTable, vciWebReferDefalut}, |
| | | data() { |
| | | return { |
| | | reterTypeLeavl:'213', |
| | | reterTypeLeavl: '213', |
| | | refertype: this.referConfig.options.type, |
| | | emitData:{}, |
| | | title:'', |
| | | display:this.display || true, |
| | | disabled:this.disabled || false |
| | | emitData: {}, |
| | | title: '', |
| | | display: this.display || true, |
| | | disabled: this.disabled || false |
| | | }; |
| | | }, |
| | | created() { |
| | | if (!this.referConfig.options && this.referConfig.options.isMuti==undefined) { |
| | | if (!this.referConfig.options && this.referConfig.options.isMuti == undefined) { |
| | | this.referConfig.options = { |
| | | isMuti: this.referConfig.options.muti || false |
| | | } |
| | |
| | | var title = this.referConfig.title || ''; |
| | | title = title.replace(":", ""); |
| | | title = title ? ('为ã' + title + 'ãéåå¼') : ('为ã' + this.referConfig.showField + 'ãéåå¼'); |
| | | this.title=title; |
| | | this.title = title; |
| | | }, |
| | | methods: { |
| | | setValue(value) { |
| | | this.emitData = value; |
| | | } |
| | | }, |
| | | watch:{ |
| | | watch: { |
| | | // ä¿®æ¹åé¦å°ç¶ç»ä»¶ |
| | | emitData: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newV) { |
| | | this.text=newV.text; |
| | | this.value=newV.value; |
| | | this.text = newV.text; |
| | | this.value = newV.value; |
| | | this.$emit("setReferValue", newV); |
| | | } |
| | | }, |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :title="title" |
| | | v-dialogDrag append-to-body="true" |
| | | <el-dialog v-dialogDrag |
| | | :height="options.height|| 'auto'" :title="title" |
| | | :visible.sync="visible" |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | append-to-body="true" |
| | | class="avue-dialog avue-dialog--top" |
| | | top="0" |
| | | @close="dialogClose"> |
| | | <avue-crud ref="referDefalutCrud" |
| | | v-model="value" |
| | | ref="referDefalutCrud" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | </avue-crud> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> |
| | | <el-button @click="visible=false">å æ¶</el-button> |
| | | <el-button @click="setValue" type="primary">ç¡® å®</el-button> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="setValue">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :readonly="true" :placeholder="title" @click="!disabled && (visible=true)" ></avue-input> |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" :readonly="true" |
| | | @click="!disabled && (visible=true)"></avue-input> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { validatenull } from "@/util/validate"; |
| | | import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import {getList, getLazyList, getTableDefinedUrl} from "@/api/refer/table"; |
| | | |
| | | export default { |
| | | name: "vciWebReferDefalut", |
| | | props:["referConfig","value","text","title","disabled"], |
| | | props: ["referConfig", "value", "text", "title", "disabled", "referType"], |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | options: this.referConfig.options||{}, |
| | | options: this.referConfig.options || {}, |
| | | isMuti: ("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false, |
| | | props: { |
| | | value: this.referConfig.valueField || this.referConfig.options.valueField || 'oid', |
| | |
| | | }, |
| | | url: this.referConfig.options.url || '/api/ubcs-code/mdmEngineController/defaultReferDataGrid', |
| | | method: this.referConfig.options.method || 'GET', |
| | | tableDefinedUrl:'',//å¹³å°è¡¨æ ¼å°å |
| | | copyParam: ['referBo', 'textField', 'valueField', 'displayTable', 'whereSql', 'queryScheme'], |
| | | tableDefinedUrl: '',//å¹³å°è¡¨æ ¼å°å |
| | | copyParam: ['referBo', 'textField', 'valueField', 'displayTable', 'whereSql', 'queryScheme'], |
| | | query: {}, |
| | | loading: false, |
| | | page: { |
| | | layout: this.referType === "master" ? "total,pager,prev, next,jumper" : "total,pager,prev, next,jumper,sizes", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data?this.referConfig.options.data.length :0 |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | | }, |
| | | data:this.referConfig.options.data || [], |
| | | data: this.referConfig.options.data || [], |
| | | selectionList: [], |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | //height: this.referConfig.options.height ? this.referConfig.options.height : 475, |
| | | calcHeight: 30, |
| | | tip: false, |
| | | menu:false, |
| | | menu: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | searchLabelWidth: 90, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | reserveSelection:true, |
| | | reserveSelection: true, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | column: [] |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.tableConfig.page){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | }else if(!validatenull(this.referConfig.options.tableConfig.limit)){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.limit |
| | | if (this.referConfig.options.tableConfig && this.referConfig.options.tableConfig.page) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage = this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | } else if (!validatenull(this.referConfig.options.limit)) { |
| | | this.page.pageSize = this.referConfig.options.limit; |
| | | } else if (this.referConfig.options.tableConfig && !validatenull(this.referConfig.options.tableConfig.limit)) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.limit; |
| | | } |
| | | }, |
| | | computed:{ |
| | | valueInfo:function (){ |
| | | return this.text ? ("已设置çå¼ä¸º[" + this.text + "]"): 'æªè®¾ç½®å¼' |
| | | computed: { |
| | | valueInfo: function () { |
| | | return this.text ? ("已设置çå¼ä¸º[" + this.text + "]") : 'æªè®¾ç½®å¼' |
| | | } |
| | | }, |
| | | methods: { |
| | | getParams:function () { |
| | | escHandler() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | dialogClose() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | getParams: function () { |
| | | var queryParams = {}; |
| | | if (this.options.extraParams) { |
| | | queryParams = this.options.extraParams; |
| | |
| | | queryParams['order'] = this.options.initSort.type;//æ¹æ³ |
| | | queryParams['sort'] = this.options.initSort.field;//åæ®µ |
| | | } |
| | | if(this.options.sortField){ |
| | | if (this.options.sortField) { |
| | | queryParams['sort'] = this.options.sortField;//åæ®µ |
| | | } |
| | | if(this.options.sortType){ |
| | | if (this.options.sortType) { |
| | | queryParams['order'] = this.options.sortType;//æ¹æ³ |
| | | } |
| | | if (this.options.conditionParams) { |
| | |
| | | sortable: true, |
| | | width: 150, |
| | | search: true, |
| | | formatter:function (d){ |
| | | formatter: function (d) { |
| | | return d.id || d.data.id |
| | | } |
| | | }, { |
| | |
| | | sortable: true, |
| | | width: 150, |
| | | search: true, |
| | | formatter:function (d){ |
| | | formatter: function (d) { |
| | | return d.name || d.data.name |
| | | } |
| | | }, { |
| | | prop: 'description', |
| | | label: 'æè¿°', |
| | | width: 250, |
| | | formatter:function (d){ |
| | | formatter: function (d) { |
| | | return d.description || d.data.description |
| | | } |
| | | }, { |
| | |
| | | width: 60, |
| | | hidden: (!this.controllerSecret), |
| | | hide: (!this.controllerSecret), |
| | | formatter:function (d){ |
| | | formatter: function (d) { |
| | | return d.secretGradeText || d.data.secretGradeText |
| | | } |
| | | }]; |
| | | } else { |
| | | this.option.column = this.options.tableConfig.cols.map(item => { |
| | | if (item.field != 'LAY_TABLE_INDEX' && item.field != 'LAY_CHECKED') { |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | let formatter = item.template || item.templet; |
| | | if (typeof formatter == "string" && formatter != '') { |
| | | formatter = eval("(" + formatter + ")") |
| | | } else { |
| | | formatter = function (d) { |
| | | if (d[item.field] != undefined) { |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | } else if (d.data[item.field] != undefined) { |
| | | return d.data[item.field] |
| | | }else { |
| | | } else { |
| | | return '' |
| | | } |
| | | } |
| | |
| | | ...item, |
| | | label: item.title, |
| | | prop: item.field, |
| | | formatter:formatter, |
| | | sortable:item.sort, |
| | | hide:item.hidden, |
| | | search:this.options.tableConfig.queryColumns.some(qItem=>{ |
| | | return qItem.field==item.field |
| | | formatter: formatter, |
| | | sortable: item.sort, |
| | | hide: item.hidden, |
| | | search: this.options.tableConfig.queryColumns.some(qItem => { |
| | | return qItem.field == item.field |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | this.params = paramsData; |
| | | }, |
| | | setValue(){ |
| | | if(this.selectionList.length==0){ |
| | | this.$message.warning( '没æéæ©æ°æ®'); |
| | | setValue() { |
| | | if (this.selectionList.length == 0) { |
| | | this.$message.warning('没æéæ©æ°æ®'); |
| | | return false; |
| | | }else if(this.selectionList.length>1 && !this.isMuti){ |
| | | this.$message.warning( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | } else if (this.selectionList.length > 1 && !this.isMuti) { |
| | | this.$message.warning('æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | return false; |
| | | } |
| | | |
| | | var value = []; |
| | | var text = []; |
| | | var isMutiValue = (this.props.value.indexOf(",")>-1); |
| | | var isMutiRaw = (this.props.label.indexOf(",")>-1); |
| | | var _that=this |
| | | this.selectionList.forEach((item,_index) =>{ |
| | | if(isMutiValue){ |
| | | var isMutiValue = (this.props.value.indexOf(",") > -1); |
| | | var isMutiRaw = (this.props.label.indexOf(",") > -1); |
| | | var _that = this |
| | | this.selectionList.forEach((item, _index) => { |
| | | if (isMutiValue) { |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | let itemValue=item[_itemField]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_itemField] |
| | | valueFieldArray.forEach((_itemField, _indexField) => { |
| | | let itemValue = item[_itemField]; |
| | | if (itemValue == undefined || itemValue == null) { |
| | | itemValue = item['data'][_itemField] |
| | | } |
| | | value.push( itemValue + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | value.push(itemValue + (_that.referConfig.valueSep ? _that.referConfig.valueSep : ' ')); |
| | | }) |
| | | }else { |
| | | let itemValue=item[_that.props.value]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_that.props.value] |
| | | } else { |
| | | let itemValue = item[_that.props.value]; |
| | | if (itemValue == undefined || itemValue == null) { |
| | | itemValue = item['data'][_that.props.value] |
| | | } |
| | | value.push(itemValue); |
| | | } |
| | | if(isMutiRaw) { |
| | | if (isMutiRaw) { |
| | | var rawFieldArray = _that.props.label.split(","); |
| | | rawFieldArray.forEach((_itemField,_indexField)=>{ |
| | | let itemText=item[_itemField]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_itemField] |
| | | rawFieldArray.forEach((_itemField, _indexField) => { |
| | | let itemText = item[_itemField]; |
| | | if (itemText == undefined || itemText == null) { |
| | | itemText = item['data'][_itemField] |
| | | } |
| | | text.push(itemText + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | text.push(itemText + (_that.referConfig.textSep ? _that.referConfig.textSep : ' ')); |
| | | }) |
| | | }else{ |
| | | let itemText=item[_that.props.label]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_that.props.label] |
| | | } else { |
| | | let itemText = item[_that.props.label]; |
| | | if (itemText == undefined || itemText == null) { |
| | | itemText = item['data'][_that.props.label] |
| | | } |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | let mapFields = this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | if (!validatenull(this.options.mapFields)) { |
| | | mapFields = Object.assign(this.referConfig.fieldMap, JSON.parse(this.options.mapFields)); |
| | | } |
| | | }catch (e) { |
| | | } catch (e) { |
| | | |
| | | } |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | | this.visible=false; |
| | | this.value = value.join(','); |
| | | this.text = text.join(',') |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text, |
| | | rawData: this.selectionList, |
| | | fieldMap: mapFields |
| | | }); |
| | | this.visible = false; |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | |
| | | this.onLoad(this.page); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | rowClick (row) { |
| | | rowClick(row) { |
| | | this.$refs.referDefalutCrud.toggleSelection(); |
| | | this.$refs.referDefalutCrud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | this.selectionList=[row] |
| | | this.selectionList = [row] |
| | | }, |
| | | selectionChange(list) { |
| | | if (!this.isMuti && list.length > 1) { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params={}) { |
| | | if(this.url){ |
| | | onLoad(page, params = {}) { |
| | | if (this.url) { |
| | | this.loading = true; |
| | | var query={} |
| | | var query = {} |
| | | if (this.query) { |
| | | for (var key in this.query) { |
| | | query['conditionMap["' + key + '"]'] = this.query[key]; |
| | | } |
| | | } |
| | | getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url, this.method).then(res => { |
| | | let data=[] |
| | | if(res.data.records){ |
| | | getList(Object.assign(params, this.params, this.query, query), page.currentPage, page.pageSize, this.url, this.method).then(res => { |
| | | let data = [] |
| | | if (res.data.records) { |
| | | data = res.data.records |
| | | this.page.total=res.data.total ; |
| | | }else{ |
| | | this.page.total = res.data.total; |
| | | } else { |
| | | data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | this.page.total = res.data.data.total; |
| | | } |
| | | this.data=data.map(item => { |
| | | item.data=item.data || {} |
| | | this.data = data.map(item => { |
| | | item.data = item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | this.loading = false; |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .valueInfo{ |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :title="title" |
| | | v-dialogDrag append-to-body="true" |
| | | <el-dialog v-dialogDrag |
| | | :height="options.height|| 'auto'" :title="title" |
| | | :visible.sync="visible" |
| | | top="0" |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="options.width|| '80%'" |
| | | :height="options.height|| 'auto'"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | append-to-body="true" |
| | | class="avue-dialog avue-dialog--top" |
| | | top="0" |
| | | @close="dialogClose"> |
| | | <avue-crud ref="referCrud" |
| | | v-model="value" |
| | | ref="referCrud" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | </template> |
| | | </avue-crud> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }} </div> |
| | | <el-button @click="visible=false">å æ¶</el-button> |
| | | <el-button @click="setValue" type="primary">ç¡® å®</el-button> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="setValue">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <avue-input v-model="text" :disabled="disabled" :readonly="true" :placeholder="title" @click="!disabled && (visible=true)"></avue-input> |
| | | <avue-input v-model="text" :disabled="disabled" :placeholder="title" :readonly="true" |
| | | @click="!disabled && (visible=true)"></avue-input> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { validatenull } from "@/util/validate"; |
| | | import {getList,getLazyList,getTableDefinedUrl} from "@/api/refer/table"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import {getList, getLazyList, getTableDefinedUrl} from "@/api/refer/table"; |
| | | |
| | | export default { |
| | | name: "vciWebReferTable", |
| | | props:["referConfig","value","text","title","disabled"], |
| | | props: ["referConfig", "value", "text", "title", "disabled", "referType"], |
| | | data() { |
| | | return { |
| | | visible: false, |
| | |
| | | label: this.referConfig.textField || this.referConfig.options.textField || "name" |
| | | }, |
| | | url: this.referConfig.options.url || '/api/ubcs-code/mdmEngineController/defaultReferDataGrid', |
| | | tableDefinedUrl:'',//å¹³å°è¡¨æ ¼å°å |
| | | copyParam: ['referBo', 'textField', 'valueField', 'displayTable', 'whereSql', 'queryScheme'], |
| | | tableDefinedUrl: '',//å¹³å°è¡¨æ ¼å°å |
| | | copyParam: ['referBo', 'textField', 'valueField', 'displayTable', 'whereSql', 'queryScheme'], |
| | | query: {}, |
| | | loading: false, |
| | | page: { |
| | | layout: this.referType === "master" ? "total,pager,prev, next,jumper" : "total,pager,prev, next,jumper,sizes", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data?this.referConfig.options.data.length :0 |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | | }, |
| | | data:this.referConfig.options.data || [], |
| | | data: this.referConfig.options.data || [], |
| | | selectionList: [], |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn:false, |
| | | columnBtn: false, |
| | | height: this.referConfig.options.height ? this.referConfig.options.height : 475, |
| | | calcHeight: 30, |
| | | tip: false, |
| | | menu:false, |
| | | menu: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | searchLabelWidth: 90, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | reserveSelection:true, |
| | | reserveSelection: true, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | rowKey:'oid', |
| | | rowParentKey:'parentSaleProduct', |
| | | rowKey: 'oid', |
| | | rowParentKey: 'parentSaleProduct', |
| | | column: [] |
| | | } |
| | | }; |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(this.referConfig.options.page){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage=this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | }else if(!validatenull(this.referConfig.options.limit)){ |
| | | this.page.pageSize=this.referConfig.options.limit |
| | | }else if(!validatenull(this.referConfig.options.tableConfig.limit)){ |
| | | this.page.pageSize=this.referConfig.options.tableConfig.limit |
| | | if (this.referConfig.options.tableConfig && this.referConfig.options.tableConfig.page) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.page.limit || this.referConfig.options.tableConfig.page.pageSize; |
| | | this.page.currentPage = this.referConfig.options.tableConfig.page.page || this.referConfig.options.tableConfig.page.currentPage; |
| | | } else if (!validatenull(this.referConfig.options.limit)) { |
| | | this.page.pageSize = this.referConfig.options.limit; |
| | | } else if (this.referConfig.options.tableConfig && !validatenull(this.referConfig.options.tableConfig.limit)) { |
| | | this.page.pageSize = this.referConfig.options.tableConfig.limit; |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.referCrud.doLayout() |
| | | }) |
| | | }, |
| | | |
| | | computed:{ |
| | | valueInfo:function (){ |
| | | return this.text ? ("已设置çå¼ä¸º[" + this.text + "]"): 'æªè®¾ç½®å¼' |
| | | computed: { |
| | | valueInfo: function () { |
| | | return this.text ? ("已设置çå¼ä¸º[" + this.text + "]") : 'æªè®¾ç½®å¼' |
| | | } |
| | | }, |
| | | methods: { |
| | | getParams:function (){ |
| | | escHandler() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | dialogClose() { |
| | | this.visible = false; |
| | | this.$refs.referDefalutCrud.refreshTable() |
| | | }, |
| | | getParams: function () { |
| | | var queryParams = {}; |
| | | if(this.options.extraParams){ |
| | | if (this.options.extraParams) { |
| | | queryParams = this.options.extraParams; |
| | | } |
| | | if(this.options.useFormKey && this.options.formValues){ |
| | | if (this.options.useFormKey && this.options.formValues) { |
| | | //使ç¨è¡¨åä¸çåæ®µæ¥è¿æ»¤ |
| | | queryParams['conditionMap["' + (this.options.paramForFormKey?this.options.paramForFormKey:this.options.useFormKey) + '"]'] = this.options.formValues[this.options.useFormKey]; |
| | | queryParams['conditionMap["' + (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey) + '"]'] = this.options.formValues[this.options.useFormKey]; |
| | | } |
| | | if(this.options.where ) { |
| | | if (this.options.where) { |
| | | for (var key in this.options.where) { |
| | | queryParams['conditionMap["' + key + '"]'] = this.options.where[key];//æ° |
| | | } |
| | | } |
| | | for(var i= 0 ; i < this.copyParam.length ; i ++){ |
| | | for (var i = 0; i < this.copyParam.length; i++) { |
| | | queryParams[this.copyParam[i]] = this.options[this.copyParam[i]]; |
| | | } |
| | | queryParams["isMuti"]=this.isMuti; |
| | | queryParams.muti =this.isMuti; |
| | | if(!queryParams['referBo']){ |
| | | queryParams["isMuti"] = this.isMuti; |
| | | queryParams.muti = this.isMuti; |
| | | if (!queryParams['referBo']) { |
| | | queryParams['referBo'] = this.options['referBo'] || this.options['referType']; |
| | | } |
| | | queryParams['referType']= queryParams['referBo'] |
| | | queryParams['referType'] = queryParams['referBo'] |
| | | if (this.options.initSort) { |
| | | queryParams['order'] = this.options.initSort.type;//æ¹æ³ |
| | | queryParams['sort'] = this.options.initSort.field;//åæ®µ |
| | | } |
| | | if(this.options.sortField){ |
| | | if (this.options.sortField) { |
| | | queryParams['sort'] = this.options.sortField;//åæ®µ |
| | | } |
| | | if(this.options.sortType){ |
| | | if (this.options.sortType) { |
| | | queryParams['order'] = this.options.sortType;//æ¹æ³ |
| | | } |
| | | if (this.options.conditionParams) { |
| | |
| | | } |
| | | var paramsData = {}; |
| | | //为äºå¤çåå¼å·ååå¼å·ç |
| | | if(queryParams){ |
| | | for (var key in queryParams){ |
| | | if (queryParams) { |
| | | for (var key in queryParams) { |
| | | paramsData[key.replace(/"/g, "'")] = queryParams[key]; |
| | | } |
| | | } |
| | | |
| | | if(this.options.displayTable){ |
| | | if (this.options.displayTable) { |
| | | //è¯´ææ¯ä½¿ç¨å¹³å°çè¡¨æ ¼ |
| | | getTableDefinedUrl({btmType:(this.options.referBo||this.options.referType),code:this.options.displayTable,isMuti:this.isMuti},this.tableDefinedUrl).then(result => { |
| | | console.log('result',result) |
| | | if(result.success){ |
| | | getTableDefinedUrl({ |
| | | btmType: (this.options.referBo || this.options.referType), |
| | | code: this.options.displayTable, |
| | | isMuti: this.isMuti |
| | | }, this.tableDefinedUrl).then(result => { |
| | | console.log('result', result) |
| | | if (result.success) { |
| | | var queryScheme = result.querySchema; |
| | | if(!validatenull(queryScheme) && validatenull(this.options.queryScheme)){ |
| | | if (!validatenull(queryScheme) && validatenull(this.options.queryScheme)) { |
| | | this.options.queryScheme = queryScheme; |
| | | } |
| | | paramsData['queryScheme'] = this.options.queryScheme; |
| | | if(result.showIndex){ |
| | | if (result.showIndex) { |
| | | this.option.index = true; |
| | | } |
| | | if(result.showCheckbox){ |
| | | if (result.showCheckbox) { |
| | | this.option.selection = true |
| | | } |
| | | var referColumn = ""; |
| | | if(result.columns){ |
| | | this.option.column= result.columns.map(item => { |
| | | if(item.field.indexOf(".")>-1){ |
| | | if (result.columns) { |
| | | this.option.column = result.columns.map(item => { |
| | | if (item.field.indexOf(".") > -1) { |
| | | referColumn += item.field + ","; |
| | | item.field = item.field.replace(".","_"); |
| | | item.field = item.field.replace(".", "_"); |
| | | } |
| | | if(!validatenull(item.enumCode)) { |
| | | if (!validatenull(item.enumCode)) { |
| | | //æ¯æä¸¾çå
容 |
| | | item.type = 'select'; |
| | | item.dicUrl = "/api/ubcs-omd/enum/dictionary?code=" + item.enumCode; |
| | |
| | | trigger: "blur" |
| | | }]; |
| | | } |
| | | item.formatter=function(d){ |
| | | if(d[item.field]!=undefined){ |
| | | item.formatter = function (d) { |
| | | if (d[item.field] != undefined) { |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | } else if (d.data[item.field] != undefined) { |
| | | return d.data[item.field] |
| | | }else { |
| | | } else { |
| | | return '' |
| | | } |
| | | }; |
| | |
| | | }) |
| | | } |
| | | paramsData['referColumn'] = referColumn; |
| | | if(result.limit>0){ |
| | | if (result.limit > 0) { |
| | | this.page.pageSize = result.limit; |
| | | this.page.currentPage=1 |
| | | this.page.currentPage = 1 |
| | | } |
| | | if(this.options.isTreeGrid){ |
| | | if (this.options.isTreeGrid) { |
| | | //è¡¨æ ¼æ å ä¸é
ç½® |
| | | } |
| | | this.params=paramsData; |
| | | }else{ |
| | | this.params = paramsData; |
| | | } else { |
| | | this.$message.error(result.msg); |
| | | } |
| | | |
| | | }); |
| | | }else{ |
| | | } else { |
| | | //è¯´ææ¯èªå®ä¹çè¡¨æ ¼ |
| | | var tableConfig = this.options.tableConfig; |
| | | if(!tableConfig){ |
| | | this.$message.error( '没æå®ä¹åç
§çè¡¨æ ¼é
ç½®'); |
| | | if (!tableConfig) { |
| | | this.$message.error('没æå®ä¹åç
§çè¡¨æ ¼é
ç½®'); |
| | | } |
| | | if(!paramsData){ |
| | | if (!paramsData) { |
| | | paramsData = { |
| | | currentUserReferModelKey:this.options.currentUserReferModelKey, |
| | | currentUserReferMethodKey:this.options.currentUserReferMethodKey |
| | | currentUserReferModelKey: this.options.currentUserReferModelKey, |
| | | currentUserReferMethodKey: this.options.currentUserReferMethodKey |
| | | }; |
| | | }else{ |
| | | } else { |
| | | paramsData['currentUserReferModelKey'] = this.options.currentUserReferModelKey; |
| | | paramsData['currentUserReferMethodKey'] = this.options.currentUserReferMethodKey; |
| | | } |
| | | if(this.options.tableConfig && this.options.tableConfig.cols && this.options.tableConfig.cols.length>0) { |
| | | if (this.options.tableConfig && this.options.tableConfig.cols && this.options.tableConfig.cols.length > 0) { |
| | | //说æä¼ éäºç |
| | | this.option.column= this.options.tableConfig.cols.map(item => { |
| | | this.option.column = this.options.tableConfig.cols.map(item => { |
| | | if (item.field != 'LAY_TABLE_INDEX' && item.field != 'LAY_CHECKED') { |
| | | let formatter=item.template || item.templet; |
| | | if(typeof formatter == "string" && formatter !=''){ |
| | | formatter=eval("(" + formatter + ")") |
| | | }else{ |
| | | formatter=function (d){ |
| | | if(d[item.field]!=undefined){ |
| | | let formatter = item.template || item.templet; |
| | | if (typeof formatter == "string" && formatter != '') { |
| | | formatter = eval("(" + formatter + ")") |
| | | } else { |
| | | formatter = function (d) { |
| | | if (d[item.field] != undefined) { |
| | | return d[item.field] |
| | | }else if(d.data[item.field] !=undefined){ |
| | | } else if (d.data[item.field] != undefined) { |
| | | return d.data[item.field] |
| | | }else { |
| | | } else { |
| | | return '' |
| | | } |
| | | } |
| | |
| | | ...item, |
| | | label: item.title, |
| | | prop: item.field, |
| | | formatter:formatter, |
| | | sortable:item.sort, |
| | | hide:item.hidden, |
| | | search: this.options.tableConfig.queryColumns.some(qItem=>{ |
| | | return qItem.field==item.field |
| | | formatter: formatter, |
| | | sortable: item.sort, |
| | | hide: item.hidden, |
| | | search: this.options.tableConfig.queryColumns.some(qItem => { |
| | | return qItem.field == item.field |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | if(this.options.isTreeGrid){ |
| | | if (this.options.isTreeGrid) { |
| | | //è¡¨æ ¼æ å ä¸é
ç½® |
| | | } |
| | | } |
| | | this.params=paramsData; |
| | | this.params = paramsData; |
| | | }, |
| | | setValue(){ |
| | | if(this.selectionList.length==0){ |
| | | this.$message.warning( '没æéæ©æ°æ®'); |
| | | setValue() { |
| | | if (this.selectionList.length == 0) { |
| | | this.$message.warning('没æéæ©æ°æ®'); |
| | | return false; |
| | | }else if(this.selectionList.length>1 && !this.isMuti){ |
| | | this.$message.warning( 'æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | } else if (this.selectionList.length > 1 && !this.isMuti) { |
| | | this.$message.warning('æ¯æ¬¡åªè½éæ©ä¸æ¡æ°æ®'); |
| | | return false; |
| | | } |
| | | |
| | | var value = []; |
| | | var text = []; |
| | | var isMutiValue = (this.props.value.indexOf(",")>-1); |
| | | var isMutiRaw = (this.props.label.indexOf(",")>-1); |
| | | var _that=this |
| | | this.selectionList.forEach((item,_index) =>{ |
| | | if(isMutiValue){ |
| | | var isMutiValue = (this.props.value.indexOf(",") > -1); |
| | | var isMutiRaw = (this.props.label.indexOf(",") > -1); |
| | | var _that = this |
| | | this.selectionList.forEach((item, _index) => { |
| | | if (isMutiValue) { |
| | | var valueFieldArray = _that.props.value.split(","); |
| | | valueFieldArray.forEach((_itemField,_indexField)=>{ |
| | | let itemValue=item[_itemField]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_itemField] |
| | | valueFieldArray.forEach((_itemField, _indexField) => { |
| | | let itemValue = item[_itemField]; |
| | | if (itemValue == undefined || itemValue == null) { |
| | | itemValue = item['data'][_itemField] |
| | | } |
| | | value.push( itemValue + (_that.referConfig.valueSep?_that.referConfig.valueSep:' ')); |
| | | value.push(itemValue + (_that.referConfig.valueSep ? _that.referConfig.valueSep : ' ')); |
| | | }) |
| | | }else { |
| | | let itemValue=item[_that.props.value]; |
| | | if(itemValue==undefined || itemValue == null){ |
| | | itemValue=item['data'][_that.props.value] |
| | | } else { |
| | | let itemValue = item[_that.props.value]; |
| | | if (itemValue == undefined || itemValue == null) { |
| | | itemValue = item['data'][_that.props.value] |
| | | } |
| | | value.push(itemValue); |
| | | } |
| | | if(isMutiRaw) { |
| | | if (isMutiRaw) { |
| | | var rawFieldArray = _that.props.label.split(","); |
| | | rawFieldArray.forEach((_itemField,_indexField)=>{ |
| | | let itemText=item[_itemField]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_itemField] |
| | | rawFieldArray.forEach((_itemField, _indexField) => { |
| | | let itemText = item[_itemField]; |
| | | if (itemText == undefined || itemText == null) { |
| | | itemText = item['data'][_itemField] |
| | | } |
| | | text.push(itemText + (_that.referConfig.textSep?_that.referConfig.textSep:' ')) ; |
| | | text.push(itemText + (_that.referConfig.textSep ? _that.referConfig.textSep : ' ')); |
| | | }) |
| | | }else{ |
| | | let itemText=item[_that.props.label]; |
| | | if(itemText==undefined || itemText == null){ |
| | | itemText=item['data'][_that.props.label] |
| | | } else { |
| | | let itemText = item[_that.props.label]; |
| | | if (itemText == undefined || itemText == null) { |
| | | itemText = item['data'][_that.props.label] |
| | | } |
| | | text.push(itemText); |
| | | } |
| | | }) |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | let mapFields = this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | if (!validatenull(this.options.mapFields)) { |
| | | mapFields = Object.assign(this.referConfig.fieldMap, JSON.parse(this.options.mapFields)); |
| | | } |
| | | }catch (e) { |
| | | } catch (e) { |
| | | |
| | | } |
| | | this.value=value.join(','); |
| | | this.text=text.join(',') |
| | | this.$emit("setValue", {field:this.referConfig.field,showField:this.referConfig.showField,value:this.value,text:this.text,rawData:this.selectionList,fieldMap:mapFields}); |
| | | this.visible=false; |
| | | this.value = value.join(','); |
| | | this.text = text.join(',') |
| | | this.$emit("setValue", { |
| | | field: this.referConfig.field, |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text, |
| | | rawData: this.selectionList, |
| | | fieldMap: mapFields |
| | | }); |
| | | this.visible = false; |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | |
| | | this.onLoad(this.page); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage){ |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize){ |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | rowClick (row) { |
| | | rowClick(row) { |
| | | this.$refs.referCrud.toggleSelection(); |
| | | this.$refs.referCrud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | this.selectionList=[row] |
| | | this.selectionList = [row] |
| | | }, |
| | | selectionChange(list) { |
| | | if (!this.isMuti && list.length > 1) { |
| | |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params={}) { |
| | | if(this.url){ |
| | | onLoad(page, params = {}) { |
| | | if (this.url) { |
| | | this.loading = true; |
| | | var query={} |
| | | var query = {} |
| | | if (this.query) { |
| | | for (var key in this.query) { |
| | | query['conditionMap["' + key + '"]'] = this.query[key]; |
| | | } |
| | | } |
| | | getList(Object.assign(params,this.params,this.query, query),page.currentPage, page.pageSize, this.url).then(res => { |
| | | let data=[] |
| | | if(res.data.records){ |
| | | getList(Object.assign(params, this.params, this.query, query), page.currentPage, page.pageSize, this.url).then(res => { |
| | | let data = [] |
| | | if (res.data.records) { |
| | | data = res.data.records |
| | | this.page.total=res.data.total ; |
| | | }else{ |
| | | this.page.total = res.data.total; |
| | | } else { |
| | | data = res.data.data.records; |
| | | this.page.total=res.data.data.total; |
| | | this.page.total = res.data.data.total; |
| | | } |
| | | this.data=data.map(item => { |
| | | item.data=item.data || {} |
| | | this.data = data.map(item => { |
| | | item.data = item.data || {} |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }).catch(error=>{ |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | this.loading = false; |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .valueInfo{ |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
| | |
| | | <template> |
| | | <avue-input-tree ref="referTree" :props="props" :disabled="disabled" :lazy="lazy" :tree-load="treeLoad" :node-click="nodeClick" :checked="checked" |
| | | :leaf-only="referConfig.onlyLeaf" :multiple="isMuti" v-model="value" :placeholder="title" :dic="treeData"></avue-input-tree> |
| | | <avue-input-tree ref="referTree" |
| | | v-model="value" |
| | | :checked="checked" |
| | | :dic="treeData" |
| | | :disabled="disabled" |
| | | :lazy="lazy" |
| | | :leaf-only="referConfig.onlyLeaf" |
| | | :multiple="isMuti" |
| | | :node-click="nodeClick" |
| | | :placeholder="title" |
| | | :props="props" |
| | | :tree-load="treeLoad"></avue-input-tree> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getTree,getLazyTree} from "@/api/refer/tree"; |
| | | import {getTree, getLazyTree} from "@/api/refer/tree"; |
| | | import {validatenull} from "@/util/validate"; |
| | | |
| | | export default { |
| | | name: "vciWebReferTree", |
| | | props:["referConfig","value","text","title","disabled"], |
| | | props: ["referConfig", "value", "text", "title", "disabled"], |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | options: this.referConfig.options, |
| | | lazy: this.referConfig.options.loadType == 'node', |
| | | isMuti:("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false, |
| | | isMuti: ("true" == this.referConfig.options.isMuti || this.referConfig.options.isMuti == true || this.referConfig.options.muti == true) ? true : false, |
| | | props: { |
| | | value: 'oid', |
| | | label: "name" |
| | | }, |
| | | config:{ |
| | | config: { |
| | | valueField: this.referConfig.valueField || this.referConfig.options.valueField || 'oid', |
| | | textField:this.referConfig.textField || this.referConfig.options.textField || "name", |
| | | textSep:this.referConfig.textSep || ' ' |
| | | textField: this.referConfig.textField || this.referConfig.options.textField || "name", |
| | | textSep: this.referConfig.textSep || ' ' |
| | | }, |
| | | treeUrl: this.referConfig.options.url || '/api/ubcs-code/mdmEngineController/defaultReferTree', |
| | | treeData: [], |
| | | checkedData:[], |
| | | currentNode:{}, |
| | | checkedData: [], |
| | | currentNode: {}, |
| | | params: {}, |
| | | loadType: {'all': 'all', 'node': 'node'}, |
| | | copyParam: ['btmType', 'lnType', 'toBtmType', 'textField', 'valueField', 'parentFieldName', 'parentValue', 'sort', 'order', 'isDirection', 'whereSql', 'isMuti', 'queryScheme', 'isQueryAllColumn', 'queryColumn', 'split', 'loadType', 'onlyLeaf', 'onlyLeafText', 'parentUsedField'] |
| | |
| | | this.getParams(); |
| | | }, |
| | | mounted() { |
| | | if(!this.lazy){ |
| | | if(this.options.data){//妿æ¯åºå®æ°æ®çæ
åµä¸ |
| | | this.treeData=this.options.data |
| | | }else{ |
| | | if (!this.lazy) { |
| | | if (this.options.data) {//妿æ¯åºå®æ°æ®çæ
åµä¸ |
| | | this.treeData = this.options.data |
| | | } else { |
| | | this.getTree() |
| | | } |
| | | } |
| | | }, |
| | | computed:{}, |
| | | computed: {}, |
| | | methods: { |
| | | getParams:function (){ |
| | | getParams: function () { |
| | | var queryParams = {}; |
| | | if(this.options.extraParams){ |
| | | if (this.options.extraParams) { |
| | | queryParams = this.options.extraParams; |
| | | } |
| | | for(var i= 0 ; i < this.copyParam.length ; i ++){ |
| | | if(this.copyParam[i] == "btmType") { |
| | | for (var i = 0; i < this.copyParam.length; i++) { |
| | | if (this.copyParam[i] == "btmType") { |
| | | queryParams[this.copyParam[i]] = this.options['referBo'] || this.options['referType']; |
| | | }else if(this.copyParam[i] in this.options){ |
| | | } else if (this.copyParam[i] in this.options) { |
| | | queryParams[this.copyParam[i]] = this.options[this.copyParam[i]]; |
| | | } |
| | | } |
| | | queryParams['referBo'] = this.options['referBo'] || this.options['referType']; |
| | | queryParams['referType']= queryParams['referBo'] |
| | | queryParams['selectAllLevel'] = (this.options.loadType == this.loadType.all?true:false);//trueæ¶åå°ä¼æ¥é |
| | | queryParams['referType'] = queryParams['referBo'] |
| | | queryParams['selectAllLevel'] = (this.options.loadType == this.loadType.all ? true : false);//trueæ¶åå°ä¼æ¥é |
| | | |
| | | queryParams.muti =this.isMuti; |
| | | if(queryParams.isQueryAllColumn =="true"){ |
| | | queryParams.muti = this.isMuti; |
| | | if (queryParams.isQueryAllColumn == "true") { |
| | | queryParams.isQueryAllColumn = true; |
| | | } |
| | | if(this.options.useFormKey && this.options.formValues){ |
| | | if (this.options.useFormKey && this.options.formValues) { |
| | | //使ç¨è¡¨åä¸çåæ®µæ¥è¿æ»¤ |
| | | queryParams['conditionMap["' + (this.options.paramForFormKey?this.options.paramForFormKey:this.options.useFormKey) + '"]'] = this.options.formValues[this.options.useFormKey]; |
| | | queryParams['conditionMap["' + (this.options.paramForFormKey ? this.options.paramForFormKey : this.options.useFormKey) + '"]'] = this.options.formValues[this.options.useFormKey]; |
| | | } |
| | | if (!this.options.loadType) { |
| | | this.options.loadType = this.loadType.node; |
| | | } |
| | | queryParams['queryAllLevel'] = this.options.loadType == this.loadType.node? false : true;//é»è®¤é级å±å¼ |
| | | queryParams['queryAllLevel'] = this.options.loadType == this.loadType.node ? false : true;//é»è®¤é级å±å¼ |
| | | queryParams['loadType'] = this.options.loadType; |
| | | queryParams['multipleSelect'] = this.isMuti; |
| | | queryParams['isMuti'] = queryParams['multipleSelect']; |
| | |
| | | queryParams['order'] = this.options.initSort.type;//æ¹æ³ |
| | | queryParams['sort'] = this.options.initSort.field;//åæ®µ |
| | | } |
| | | if(this.options.sortField){ |
| | | if (this.options.sortField) { |
| | | queryParams['sort'] = this.options.sortField;//åæ®µ |
| | | } |
| | | if(this.options.sortType){ |
| | | if (this.options.sortType) { |
| | | queryParams['order'] = this.options.sortType;//æ¹æ³ |
| | | } |
| | | if (this.options.rootParams) { |
| | |
| | | queryParams['conditionMap["' + key + '"]'] = this.options.conditionParams[key];//æ°çæ¹å¼ |
| | | } |
| | | } |
| | | if(this.options.where ) { |
| | | if (this.options.where) { |
| | | for (var key in this.options.where) { |
| | | queryParams['conditionMap["' + key + '"]'] = this.options.where[key];//æ° |
| | | } |
| | |
| | | queryParams['replaceMap["' + key + '"]'] = this.options.replaceParams[key];//æ°çæ¹å¼ |
| | | } |
| | | } |
| | | this.params=queryParams; |
| | | this.params = queryParams; |
| | | |
| | | }, |
| | | getTree() { |
| | |
| | | treeLoad: function (treeNode, resolve) { |
| | | //é级å è½½ |
| | | const parentOid = (treeNode.level === 0) ? 0 : treeNode.data.oid; |
| | | this.params.parentOid=parentOid.indexOf('@vcitreesep@') > -1 ? parentOid.split('@vcitreesep@')[1] : parentOid; |
| | | this.params.parentValue=this.params.parentOid; |
| | | this.params.parentBtmName=treeNode.data.attributes.btmName || treeNode.data.attributes.btmname; |
| | | this.params.parentBtmType=this.params.parentBtmName; |
| | | this.params.parentOid = parentOid.indexOf('@vcitreesep@') > -1 ? parentOid.split('@vcitreesep@')[1] : parentOid; |
| | | this.params.parentValue = this.params.parentOid; |
| | | this.params.parentBtmName = treeNode.data.attributes.btmName || treeNode.data.attributes.btmname; |
| | | this.params.parentBtmType = this.params.parentBtmName; |
| | | |
| | | if (this.options.rootParams && treeNode.level !== 0) { |
| | | for (var key in this.options.rootParams) { |
| | | delete this.params[key] |
| | | } |
| | | } |
| | | getLazyTree(this.params,this.treeUrl).then(res => { |
| | | getLazyTree(this.params, this.treeUrl).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | | if(!item.attributes){ |
| | | item.attributes={ |
| | | data:{} |
| | | if (!item.attributes) { |
| | | item.attributes = { |
| | | data: {} |
| | | } |
| | | }else{ |
| | | item.attributes.data=item.attributes.data || {} |
| | | } else { |
| | | item.attributes.data = item.attributes.data || {} |
| | | } |
| | | return { |
| | | ...item, |
| | |
| | | })) |
| | | }); |
| | | }, |
| | | nodeClick(data, node, nodeComp){ |
| | | if(!this.isMuti) { |
| | | this.setValue({checkedNodes:[data]}) |
| | | nodeClick(data, node, nodeComp) { |
| | | if (!this.isMuti) { |
| | | this.setValue({checkedNodes: [data]}) |
| | | } |
| | | }, |
| | | checked(checkedNode, checkedData) { |
| | | this.setValue(checkedData) |
| | | }, |
| | | setValue:function (checkedData){ |
| | | this.checkedData=checkedData |
| | | setValue: function (checkedData) { |
| | | this.checkedData = checkedData |
| | | var value = []; |
| | | var text = []; |
| | | const textSep =this.config.textSep; |
| | | for(var j =0;j<checkedData.checkedNodes.length;j++){ |
| | | const item=checkedData.checkedNodes[j]; |
| | | var v=this.config.valueField.indexOf("attribute.")>=0?(item.attributes[this.config.valueField.replace("attribute.","")] || item.attributes.data[this.config.valueField.replace("attribute.","")]):(item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField]) |
| | | const textSep = this.config.textSep; |
| | | for (var j = 0; j < checkedData.checkedNodes.length; j++) { |
| | | const item = checkedData.checkedNodes[j]; |
| | | var v = this.config.valueField.indexOf("attribute.") >= 0 ? (item.attributes[this.config.valueField.replace("attribute.", "")] || item.attributes.data[this.config.valueField.replace("attribute.", "")]) : (item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField]) |
| | | value.push(v); |
| | | var tempRaw = []; |
| | | var textFieldArray = this.config.textField.split(","); |
| | | for (var i = 0; i < textFieldArray.length; i++) {//æ¾ç¤ºçåæ®µå¯è½æå¤ä¸ª |
| | | if (!validatenull(textFieldArray[i])) { |
| | | var t=textFieldArray[i].indexOf("attribute.")>=0?(item.attributes[textFieldArray[i].replace("attribute.","")] ||item.attributes.data[textFieldArray[i].replace("attribute.","")]):(item.attributes[textFieldArray[i]] || item[textFieldArray[i]] || item.attributes.data[textFieldArray[i]]) |
| | | var t = textFieldArray[i].indexOf("attribute.") >= 0 ? (item.attributes[textFieldArray[i].replace("attribute.", "")] || item.attributes.data[textFieldArray[i].replace("attribute.", "")]) : (item.attributes[textFieldArray[i]] || item[textFieldArray[i]] || item.attributes.data[textFieldArray[i]]) |
| | | tempRaw.push(t); |
| | | } |
| | | } |
| | | text.push(tempRaw.join(textSep)); |
| | | } |
| | | let mapFields =this.referConfig.fieldMap || {}; |
| | | let mapFields = this.referConfig.fieldMap || {}; |
| | | try { |
| | | if(!validatenull(this.options.mapFields)){ |
| | | mapFields =Object.assign(this.referConfig.fieldMap,JSON.parse(this.options.mapFields)) ; |
| | | if (!validatenull(this.options.mapFields)) { |
| | | mapFields = Object.assign(this.referConfig.fieldMap, JSON.parse(this.options.mapFields)); |
| | | } |
| | | }catch (e) { |
| | | } catch (e) { |
| | | |
| | | } |
| | | this.value = value.join(','); |
| | |
| | | showField: this.referConfig.showField, |
| | | value: this.value, |
| | | text: this.text || '', |
| | | isTreeMuti:this.isMuti, |
| | | isTreeMuti: this.isMuti, |
| | | rawData: checkedData.checkedNodes, |
| | | fieldMap:mapFields |
| | | fieldMap: mapFields |
| | | }); |
| | | } |
| | | } |
| | |
| | | trigger: "blur" |
| | | }], |
| | | }, |
| | | { |
| | | required: true, |
| | | label: 'æ··æ·å符转æ¢', |
| | | prop:'confound', |
| | | labelWidth : 110, |
| | | search: false, |
| | | formslot:true, |
| | | display:true |
| | | } |
| | | ] |
| | | } |
| | |
| | | import originalLink from "@/views/modeling/originalLink" |
| | | import classifyTrees from "@/components/Theme/ThemeClassifyTrees" |
| | | import classifyTreeform from "@/components/Theme/ThemeClassifyTreeform" |
| | | import classifyAuthDialog from "@/components/Theme/ClassifyAuthDialog" |
| | | import TemplatePro from "@/components/Theme/ThemeTemplatePro" |
| | | import attrCrud from "@/components/Theme/ThemeAttrCrud" |
| | | import formulaEditor from "@/components/code-dialog-page/formulaEditor" |
| | |
| | | Vue.component('originalRange',originalRange) |
| | | Vue.component('originalLink',originalLink) |
| | | Vue.component('classifyTrees',classifyTrees) |
| | | Vue.component('classifyAuthDialog',classifyAuthDialog) |
| | | Vue.component('classifyTreeform',classifyTreeform) |
| | | Vue.component('TemplatePro',TemplatePro) |
| | | Vue.component('formulaEditor',formulaEditor) |
| | |
| | | @closed="closehandle"> |
| | | <el-form :model="form" :rules="rules"> |
| | | <el-form-item :label-width="formLabelWidth" label="åå¯ç " prop="oldPassword"> |
| | | <el-input v-model="form.oldPassword" autocomplete="off"></el-input> |
| | | <el-input v-model="form.oldPassword" autocomplete="off" type="password"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label-width="formLabelWidth" label="æ°å¯ç " prop="newPassword"> |
| | | <el-input v-model="form.newPassword" autocomplete="off"></el-input> |
| | | <el-input v-model="form.newPassword" autocomplete="off" type="password"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label-width="formLabelWidth" label="确认å¯ç " prop="newPassword1"> |
| | | <el-input v-model="form.newPassword1" autocomplete="off"></el-input> |
| | | <el-input v-model="form.newPassword1" autocomplete="off" type="password"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | addHandler() { |
| | | this.dialogFormVisible = false |
| | | updatePassword(md5(this.form.oldPassword), this.form.newPassword, this.form.newPassword1).then(res => { |
| | | console.log(res) |
| | | //console.log(res) |
| | | if (res.data.code == 200) { |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | </refer-config-dialog> |
| | | </el-dialog> |
| | | |
| | | <!-- èªå®ä¹æµæ°´åç
§ç»ä»¶--> |
| | | |
| | | <!--èªå®ä¹æµæ°´åç
§ç»ä»¶--> |
| | | |
| | | </basic-container> |
| | | </template> |
| | |
| | | @click="handleDelete">å é¤ |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="confoundForm"> |
| | | <el-input placeholder="请è¾å
¥æ··æ·å符以éå·éå¼" v-model="confoundValue"></el-input> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: option, |
| | | data: [] |
| | | data: [], |
| | | confoundValue:'' |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | // æ¥å£è·åéå¢åç±»æ |
| | | async referTree(oid, checked) { |
| | | this.groupTreeData = [] |
| | | const response = await referTree({'conditionMap[codeclsfid]': oid, parentOid: null}) |
| | | const response = await referTree({'conditionMap[codeclsfid]': oid, parentOid:'0'}) |
| | | if (response.status === 200) { |
| | | if (checked) { |
| | | let items = response.data.map(item => { |
| | |
| | | const findRow = that.mappingData.findIndex(item => item.metaListId === that.mappingForm.metaListId) |
| | | that.mappingData[findRow].targetAttrName = transferValue[0].name |
| | | that.mappingData[findRow].targetAttrId = transferValue[0].oid |
| | | this.dialogPush = false |
| | | this.dialogPush = false; |
| | | } |
| | | |
| | | }, |
| | |
| | | dialogVisible(n) { |
| | | this.$emit('update:visible', n) |
| | | }, |
| | | data(n) { |
| | | console.log('n', n) |
| | | }, |
| | | newdata(n) { |
| | | console.log('newdata', n) |
| | | } |
| | | }, |
| | | computed: { |
| | | newdata() { |
| | |
| | | <!--æ°å¢å¯¹è¯æ¡--> |
| | | <el-dialog :visible.sync="addVisible" append-to-body class="avue-dialog avue-dialog--top" title="é
ç½®æ°æ®ç»è®¡åæ" |
| | | top="-50px"> |
| | | <el-table ref="table" :data="tableData" border style="width: 100%" @selection-change="selectChange"> |
| | | <el-table ref="table" :data="tableData" border style="width: 100%" @selection-change="selectChange" @row-click="rowHandlerClick"> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column align="center" label="ä¸»æ°æ®åºå" prop="menuName" width="300"></el-table-column> |
| | | <el-table-column align="center" label="ç±»å" prop="codeType"> |
| | |
| | | import pieChart from "../../components/StatisticsComponent/pieChart" |
| | | import ColumnarChart from "../../components/StatisticsComponent/ColumnarChart" |
| | | import mixCart from "../../components/StatisticsComponent/mixCart" |
| | | import {getStatisticAnalysis, getBtmAndChart, saveStatisticAnalysis, deleteChartId} from "@/api/statistic/chart" |
| | | import {getStatisticAnalysis, getBtmAndChart, saveStatisticAnalysis} from "@/api/statistic/chart" |
| | | //é
置表åä¸»æ°æ®å表æ¥å£ |
| | | import {getList} from "@/api/system/statistic"; |
| | | |
| | | export default { |
| | |
| | | async getEcharts() { |
| | | try { |
| | | const firstResponse = await getBtmAndChart(); |
| | | this.ResponseData = await getBtmAndChart(); |
| | | this.loading = false; |
| | | const btmNames = Object.keys(firstResponse.data.data).join(','); |
| | | const btmValue = Object.values(firstResponse.data.data); |
| | | if (!btmNames) { |
| | |
| | | this.pieList = []; |
| | | this.columnarList = []; |
| | | this.mixList = []; |
| | | this.loading = false; |
| | | return; |
| | | } |
| | | for (const value of btmValue) { |
| | | if (value.includes('0')) { |
| | | await this.handleStatisticAnalysis('lineList', btmNames, firstResponse); |
| | | } else { |
| | | this.lineList = []; |
| | | } |
| | | if (value.includes('1')) { |
| | | await this.handleStatisticAnalysis('pieList', btmNames, firstResponse); |
| | | } else { |
| | | this.pieList = []; |
| | | } |
| | | if (value.includes('2')) { |
| | | await this.handleStatisticAnalysis('columnarList', btmNames, firstResponse); |
| | | } else { |
| | | this.columnarList = []; |
| | | } |
| | | if (value.includes('3')) { |
| | | await this.handleStatisticAnalysis('mixList', btmNames, firstResponse); |
| | | } else { |
| | | this.mixList = []; |
| | | } |
| | | } |
| | | const typeList = { |
| | | '0': 'lineList', |
| | | '1': 'pieList', |
| | | '2': 'columnarList', |
| | | '3': 'mixList' |
| | | }; |
| | | await this.handleStatisticAnalysis(btmNames, firstResponse); |
| | | this.loading = false; |
| | | } catch (error) { |
| | | this.loading = false; |
| | | console.error('Error:', error); |
| | | // console.error('Error:', error); |
| | | } |
| | | }, |
| | | async handleStatisticAnalysis(type, btmNames, firstResponse) { |
| | | async handleStatisticAnalysis(btmNames, firstResponse) { |
| | | const secondResponse = await getStatisticAnalysis({btmNames}); |
| | | const secondData = secondResponse.data.data; |
| | | const typeList = { |
| | |
| | | "2": "columnarList", |
| | | "3": "mixList" |
| | | }; |
| | | this.lineList = []; |
| | | this.pieList = []; |
| | | this.columnarList = []; |
| | | this.mixList = []; |
| | | const firstData = firstResponse.data.data; |
| | | //Object.keys导è´å¯¹è±¡é¡ºåºä¸ä¸è´ï¼ä½¿ç¨sortæåºä¸å端è¿åæ ¼å¼ä¸è´ |
| | | Object.keys(firstData).sort().forEach((key, index) => { |
| | |
| | | btmname: key |
| | | }; |
| | | }); |
| | | this[listType] = []; |
| | | this.$nextTick(() => { |
| | | list.forEach((i, j) => { |
| | | if (index === j) { |
| | |
| | | this.$message.warning('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | let codeStatus = this.selectData.every(key => key.codeType) |
| | | let codeStatus = this.selectData.every(key => key.codeType.length > 0); |
| | | |
| | | if (!codeStatus) { |
| | | this.$message.warning("è¯·æ£æ¥å·²å¾éæ°æ®ç±»åæ¯å¦ä¸ºç©ºï¼"); |
| | | return; |
| | | } |
| | | |
| | | const newArray = this.selectData.map(item => { |
| | | return { |
| | | btmname: item.code, |
| | |
| | | }, |
| | | //è¡¨æ ¼å¤é |
| | | selectChange(selection) { |
| | | console.log('selection', selection) |
| | | this.selectData = selection; |
| | | }, |
| | | rowHandlerClick(row){ |
| | | this.selectData = row; |
| | | this.$refs.table.toggleRowSelection(row); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | updateInfo(form).then(res => { |
| | | if (res.data.success) { |
| | | if( form.oldPassword != undefined || form.newPassword1 != undefined || form.newPassword != undefined){ |
| | | updatePassword(form.oldPassword, form.newPassword, form.newPassword1).then(res => { |
| | | updatePassword(md5(form.oldPassword), form.newPassword, form.newPassword1).then(res => { |
| | | if (res.data.success) { |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <excludes> |
| | | <exclude>bootstrap.yml</exclude> |
| | | <!-- <exclude>bootstrap.yml</exclude> |
| | | <exclude>application.yml</exclude> |
| | | <exclude>application-dev.yml</exclude> |
| | | <exclude>application-test.yml</exclude> |
| | | <exclude>application-prop.yml</exclude> |
| | | <exclude>application-prop.yml</exclude>--> |
| | | </excludes> |
| | | </resource> |
| | | <resource> |
| | |
| | | /*** |
| | | * å½±åç¼ç é¡¹çæ°æ® |
| | | */ |
| | | private String impactList; |
| | | private List<List<String>> impactList; |
| | | |
| | | /** |
| | | * 模åè§å¾å±æ§éå |
| | |
| | | public void setMetaList(List<DockingClassifyMetaAttrVO> metaList) { |
| | | this.metaList = metaList; |
| | | } |
| | | public String getImpactList() { |
| | | public List<List<String>> getImpactList() { |
| | | return impactList; |
| | | } |
| | | public void setImpactList(String impactList) { |
| | | public void setImpactList(List<List<String>> impactList) { |
| | | this.impactList = impactList; |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.code.vo.pagemodel.CodeClassifyTemplateAttrVO; |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.mp.support.BladePage; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | * @since 2023-04-06 |
| | | */ |
| | | @FeignClient( |
| | | value = "ubcs-code" |
| | | value = AppConstant.APPLICATION_NAME_CODE |
| | | ) |
| | | public interface ICodeClassifyClient { |
| | | |
| | |
| | | String TOP = API_PREFIX + "/top"; |
| | | String CODE_CLASSIFY_TREE=API_PREFIX+"/referCodeClassifyTree"; |
| | | String CODE_ATTRIBUTE_LIST=API_PREFIX+"/listCodeAttributeByClassId"; |
| | | String CODE_ALL_PARENT_OID=API_PREFIX+"/selectAllParentOid"; |
| | | String CODE_GETBYID="/getById"; |
| | | |
| | | /** |
| | | * è·å主é¢åºå®ä¹è¡¨å表 |
| | | * |
| | |
| | | @PostMapping(CODE_CLASSIFY_TREE) |
| | | public List<Tree> referCodeClassifyTree(@RequestBody TreeQueryObject treeQueryObject); |
| | | |
| | | /** |
| | | * è·åææä¸çº§èç¹çoid |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | @PostMapping(CODE_ALL_PARENT_OID) |
| | | public R<List<String> > selectAllParentOid(@RequestParam("oid") String oid); |
| | | |
| | | /*** |
| | | * è·åä¸»æ°æ®æ¨¡æ¿å±æ§ä¿¡æ¯ |
| | | * @param codeClassifyId |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åç±»ææåæ°å¯¹è±¡ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:36 |
| | | */ |
| | | @Data |
| | | @TableName("PL_ORG_CLASSIFYAUTH") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ClassifyAuth { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId("oid") |
| | | private String oid; |
| | | |
| | | /** |
| | | * è§è²id |
| | | */ |
| | | private String roleId; |
| | | |
| | | /** |
| | | * åç±»id |
| | | */ |
| | | private String classifyId; |
| | | |
| | | /** |
| | | * åç±»ä¸çæé® |
| | | */ |
| | | private String buttonIds; |
| | | |
| | | } |
| | |
| | | String STRATEGYBYID = API_PREFIX + "/query-userid"; |
| | | String REGEX = API_PREFIX + "/combination-regex"; |
| | | String REGEXONE = API_PREFIX + "/combination-regex-one"; |
| | | String GETVIEWCLASSIFY = API_PREFIX + "/get-view-classify"; |
| | | |
| | | /** |
| | | * è·åèå |
| | |
| | | @PostMapping(REGEXONE) |
| | | R<List<String>> getRegexByList(@RequestBody List<String> combinationIds); |
| | | |
| | | @GetMapping(GETVIEWCLASSIFY) |
| | | R<List<String>> getViewClassByRoleIds(@RequestParam("roleIds") List<String> roleIds); |
| | | |
| | | } |
| | |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.vo; |
| | | |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åç±»ææå¯¹è±¡ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:41 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ClassifyAuthVO extends ClassifyAuth { |
| | | |
| | | /** |
| | | * è§è²å |
| | | */ |
| | | private String roleIdName; |
| | | |
| | | /** |
| | | * åç±»å |
| | | */ |
| | | private String classifyName; |
| | | |
| | | /** |
| | | * åç±»ä¸çæé® |
| | | */ |
| | | private List<String> buttonIdList; |
| | | |
| | | } |
| | |
| | | |
| | | for (DockingClassifyViewVO viewInfo : list) { |
| | | String viewName =StringUtils.isBlank(viewInfo.getViewName())?"":viewInfo.getViewName(); |
| | | String impactList = StringUtils.isBlank(viewInfo.getImpactList())?"":viewInfo.getImpactList(); |
| | | String impactList = viewInfo.getImpactList() == null ? "" : viewInfo.getImpactList().get(0).get(0); |
| | | log.info("VilewMode:-------------->è§å¾åç§°:"+viewName); |
| | | log.info("VilewMode:-------------->å½±åç¼ç 项:"+impactList); |
| | | log.info("VilewMode:--------------> éå¢å类主é®:"+jclassId); |
| | |
| | | //List<BaseModelVO> codeWupins=mdmEngineService.listByIds(VciBaseUtil.str2List(oids)); |
| | | List<BaseModel> dataModelList = new ArrayList<>(); |
| | | try { |
| | | R<List<BaseModel>> listR = mdmEngineClient.selectByTypeAndOid(btmName, oids); |
| | | if(listR.getData().size() == 0){ |
| | | return R.fail("为æ¥è¯¢å°ç¸å
³ä¸å¡æ°æ®ï¼"); |
| | | } |
| | | dataModelList = listR.getData(); |
| | | if (!CollectionUtils.isEmpty(dataModelList)) { |
| | | DockingGroupDataVO dockingGroupDataVO = new DockingGroupDataVO(); |
| | | //ç³è¯·ååç³è¯·å对象å
³ç³» |
| | |
| | | */ |
| | | private boolean saveDatas(DockingQueryClassModelVO dockingQueryClassifyModelVO) throws Throwable { |
| | | try { |
| | | DockingClassifyMainVO mainData = dockingQueryClassifyModelVO.getMainData(); |
| | | List<DockingClassifyVO> classList = mainData.getClassList(); |
| | | Map<String,List<DockingClassifyViewVO>>classInfoMap = mainData.getClassInfos(); |
| | | DockingClassifyMainVO data = dockingQueryClassifyModelVO.getData(); |
| | | List<DockingClassifyVO> classList = data.getClassList(); |
| | | Map<String,List<DockingClassifyViewVO>>classInfoMap = data.getClassInfos(); |
| | | ////initVCIInvocationInfo("1"); |
| | | List<DockingPreClassify> dockingPreClassifyArrayList=new ArrayList<>(); |
| | | for (DockingClassifyVO jclassObject : classList) { |
| | |
| | | Map<String, DockingPreViewModel> jviewmodelMap = new HashMap<String, DockingPreViewModel>(); |
| | | //Map<String, String> condtionMa = new HashMap<String, String>(); |
| | | // condtionMa.put("jsourceclsfid", jclassId); |
| | | List<DockingPreViewModel> dockingPreViewModelList= dockingPreViewModelService.list(Wrappers.<DockingPreViewModel>query().lambda().eq(DockingPreViewModel::getSourceClassifyId,false));// æ ¹æ®åç±»æ¥è¯¢æ¨¡åè§å¾å¯¹è±¡ |
| | | List<DockingPreViewModel> dockingPreViewModelList= dockingPreViewModelService.list(Wrappers.<DockingPreViewModel>query().lambda().eq(DockingPreViewModel::getSourceClassifyId,jclassId));// æ ¹æ®åç±»æ¥è¯¢æ¨¡åè§å¾å¯¹è±¡ |
| | | for (DockingPreViewModel dockingPreViewModel : dockingPreViewModelList) { |
| | | jviewmodelMap.put(dockingPreViewModel.getViewName(),dockingPreViewModel); |
| | | } |
| | | |
| | | for (DockingClassifyViewVO viewInfo : list) { |
| | | String viewName = com.alibaba.cloud.commons.lang.StringUtils.isBlank(viewInfo.getViewName())?"":viewInfo.getViewName(); |
| | | String impactList = com.alibaba.cloud.commons.lang.StringUtils.isBlank(viewInfo.getImpactList())?"":viewInfo.getImpactList(); |
| | | String impactList = viewInfo.getImpactList() == null ? "" : viewInfo.getImpactList().get(0).get(0); |
| | | log.info("VilewMode:-------------->è§å¾åç§°:"+viewName); |
| | | log.info("VilewMode:-------------->å½±åç¼ç 项:"+impactList); |
| | | log.info("VilewMode:--------------> éå¢å类主é®:"+jclassId); |
| | |
| | | List<DockingClassifyMetaAttrVO> childMetaList = new ArrayList<>(); |
| | | childMetaList.add(compositeMeta); |
| | | getMetaAttrObject(childMetaList, jclassId,jviewModelObject, pid,allDockingPreMetaAttrList); |
| | | }else{ |
| | | allDockingPreMetaAttrList.add(dockingPreMetaAttr); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import com.vci.ubcs.code.service.ICodeClassifyService; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @AllArgsConstructor |
| | | public class CodeClassifyClient implements ICodeClassifyClient { |
| | | |
| | | private final ICodeClassifyService plCodeClassifyService; |
| | | private final ICodeClassifyTemplateAttrService codeClassifyTemplateAttrService; |
| | | |
| | | private final ICodeClassifyService codeClassifyService; |
| | | private final MdmEngineService engineService; |
| | | CodeClassifyMapper codeClassifyMapper; |
| | | private final CodeClassifyMapper codeClassifyMapper; |
| | | |
| | | @Override |
| | | @GetMapping(TOP) |
| | |
| | | return BladePage.of(page); |
| | | } |
| | | |
| | | /** |
| | | * è·åææä¸çº§èç¹çoid |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | public R<List<String>> selectAllParentOid(String oid){ |
| | | return R.data(codeClassifyService.selectAllParentOid(oid)); |
| | | } |
| | | |
| | | /*** |
| | | * è·å主é¢åºåç±»å±çº§æ |
| | | * @param treeQueryObject |
| | |
| | | @Override |
| | | @PostMapping(CODE_CLASSIFY_TREE) |
| | | public List<Tree> referCodeClassifyTree(TreeQueryObject treeQueryObject) { |
| | | return plCodeClassifyService.treeCodeClassify(treeQueryObject); |
| | | return codeClassifyService.treeCodeClassify(treeQueryObject); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | @GetMapping(CODE_GETBYID) |
| | | public CodeClassify getById(String classifyId) { |
| | | return plCodeClassifyService.getById(classifyId); |
| | | return codeClassifyService.getById(classifyId); |
| | | } |
| | | |
| | | |
| | |
| | | Map<String,String> selectAllLevelChildOid(@Param("oid") String oid); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææä¸å±ç¶èç¹çoid |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | List<String> selectAllParentOid(@Param("oid") String oid); |
| | | |
| | | /** |
| | | * æ ¡éªæ¯å¦å
å«åèç¹ |
| | | * |
| | | * @param oid åç±»çä¸»é® |
| | |
| | | List<CodeClassify> selectAllLevelParents(String oid); |
| | | |
| | | /** |
| | | * è·åææä¸çº§èç¹çoid |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | List<String> selectAllParentOid(String oid); |
| | | |
| | | /** |
| | | * 主é®è·å主é¢åºåç±» |
| | | * @param oid ä¸»é® |
| | | * @return 主é¢åºåç±»æ¾ç¤ºå¯¹è±¡ |
| | |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import com.vci.ubcs.system.feign.ISysClient; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | private IBtmTypeClient btmTypeClient; |
| | | |
| | | @Resource |
| | | private CommonsMapper commonsMapper; |
| | | private ISysClient sysClient; |
| | | |
| | | /** |
| | | * æ¥å¿ |
| | |
| | | return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s |
| | | .getLcStatus()) ? (" ãåç¨ã ") : ""); |
| | | }); |
| | | |
| | | 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); |
| | | //è¶
管æ¾ç¤ºææåç±» |
| | | 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 { |
| | | // é£äºåç±»å
·å¤æ¥çæé |
| | | R<List<String>> viewClassByRoleIds = sysClient.getViewClassByRoleIds(Arrays.asList(AuthUtil.getUser().getRoleId().split(","))); |
| | | // 请æ±å¤±è´¥æè
请æ±å¾å°çå
·å¤æ¥çæéçåç±»idéå为空 |
| | | if(!viewClassByRoleIds.isSuccess() && !viewClassByRoleIds.getData().isEmpty()){ |
| | | return new ArrayList<>(); |
| | | } |
| | | // è¿æ»¤ |
| | | filterTreeNodes(tree,viewClassByRoleIds.getData()); |
| | | } |
| | | return tree; |
| | | } |
| | | |
| | | /** |
| | | * åç±»ææè¿æ»¤ææ²¡ææéçåç±» |
| | | * @param trees |
| | | * @param classifyIds |
| | | */ |
| | | private void filterTreeNodes(List<Tree> trees, List<String> classifyIds) { |
| | | Iterator<Tree> iterator = trees.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Tree tree = iterator.next(); |
| | | Boolean checkHasChild = codeClassifyMapper.checkHasChild(tree.getOid()); |
| | | tree.setLeaf(!checkHasChild); |
| | | if (classifyIds.contains(tree.getOid())) { |
| | | // 妿顶å±èç¹åå¨äº classifyIds ä¸ï¼ç´æ¥ä¿çå
¶åèç¹éå |
| | | continue; |
| | | } |
| | | if (tree.getChildren() != null && !tree.getChildren().isEmpty()) { |
| | | filterTreeNodes(tree.getChildren(), classifyIds); |
| | | } |
| | | if (!hasMatchingChild(tree, classifyIds)) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private boolean hasMatchingChild(Tree tree, List<String> classifyIds) { |
| | | if (classifyIds.contains(tree.getOid())) { |
| | | return true; |
| | | } |
| | | if (tree.getChildren() != null) { |
| | | for (Tree child : tree.getChildren()) { |
| | | if (hasMatchingChild(child, classifyIds)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææä¸å±ç¶èç¹çoid |
| | | * @param oid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> selectAllParentOid(String oid){ |
| | | if(Func.isBlank(oid)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return this.codeClassifyMapper.selectAllParentOid(oid); |
| | | } |
| | | |
| | | /** |
| | | * 使ç¨å类主é®è·ååç±»ç¸å
³çææä¿¡æ¯ |
| | | * |
| | | * @param codeClassifyOid åç±»çä¸»é® |
| | |
| | | if(i>nowmonth){ |
| | | monthCount.add(0); |
| | | month.add(0); |
| | | continue; |
| | | } |
| | | //å½åæä»½ä¹åä¹å |
| | | Integer count = 0; |
| | |
| | | //cboOidMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(codeDataMap.keySet().toArray(new String[0])) + ")"); |
| | | String tableName =""; |
| | | try { |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId()); |
| | | R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | if(!r.isSuccess()) { |
| | | throw new Throwable(r.getMsg()); |
| | | } |
| | |
| | | cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription())?"":orderDTO.getDescription()); |
| | | cbo.setName(orderDTO.getName()); |
| | | try { |
| | | cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription()); |
| | | //主è¦å¤ç大å°åé®é¢ï¼å°dataéé¢çæ°æ®çkeyé½è½¬ä¸ºå°å |
| | | HashMap<String,String> lowerData = new HashMap<>(); |
| | | Iterator<Map.Entry<String, String>> iterator = cbo.getData().entrySet().iterator(); |
| | | while (iterator.hasNext()){ |
| | | Map.Entry<String, String> next = iterator.next(); |
| | | lowerData.put(next.getKey().toLowerCase(Locale.ROOT),next.getValue()); |
| | | } |
| | | cbo.getData().clear(); |
| | | cbo.getData().putAll(lowerData); |
| | | cbo.setAttributeValueWithNoCheck("description", (StringUtil.isNotBlank(orderDTO.getData() |
| | | .get("description")) ? orderDTO.getData().get("description") : orderDTO.getDescription() )); |
| | | // cbo.setAttributeValue("name", orderDTO.getName()); |
| | | // if(finalIsProcess){//卿µç¨ä¸ä¸å
è®¸æ´æ¹ |
| | | // errorMap.put(code,errorMap.getOrDefault(code, errorMap.getOrDefault(code,"")+";æ°æ®"+code+"卿µç¨ä¸ï¼ä¸å
è®¸æ´æ¹!")); |
| | |
| | | |
| | | List<CodeAllCode>newCodeAllCodeList= codeAllCodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCreateCodeOid, cbo.getOid())); |
| | | if (!CollectionUtils.isEmpty(newCodeAllCodeList)) { |
| | | CodeAllCode codeCbo = codeAllCodeList.get(0); |
| | | CodeAllCode codeCbo = newCodeAllCodeList.get(0); |
| | | log.info("codeCbos code:" + codeCbo.getId()); |
| | | codeCbo.setLcStatus(status); |
| | | codeAllCodeList.add(codeCbo); |
| | |
| | | engineService.updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(),updateList); |
| | | codeAllCodeService.saveOrUpdateBatch(codeAllCodeList); |
| | | if(deleteList.size()>0) { |
| | | commonsMapper.deleteByTaleAndOid(tableName, VciBaseUtil.array2String(deleteList.toArray(new String[]{}))); |
| | | commonsMapper.deleteByTaleAndOid(tableName, VciBaseUtil.toInSql(deleteList.toArray(new String[]{}))); |
| | | } |
| | | //æ¯å¦è°ç¨é墿¥å£ç³è¯·æ¥å£ |
| | | if(isCodeOrGroupCode){ |
| | |
| | | xmlResultDataObjectDetailDO.setCode(""); |
| | | xmlResultDataObjectDetailDO.setId(applyDataVO.getId()); |
| | | xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | xmlResultDataObjectDetailDO.setMsg("ç¼ç ç³è¯·å¤±è´¥:" + e.getMessage()); |
| | | xmlResultDataObjectDetailDO.setMsg("ç¼ç ç»´æ¤å¤±è´¥:" + e.getMessage()); |
| | | resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | }); |
| | | }else{ |
| | |
| | | xmlResultDataObjectDetailDO.setCode(""); |
| | | xmlResultDataObjectDetailDO.setId(""); |
| | | xmlResultDataObjectDetailDO.setErrorid(objerrorCode); |
| | | xmlResultDataObjectDetailDO.setMsg("ç¼ç ç³è¯·å¤±è´¥:" + e.getMessage()); |
| | | xmlResultDataObjectDetailDO.setMsg("ç¼ç ç»´æ¤å¤±è´¥:" + e.getMessage()); |
| | | resultDataObjectDetailDOs.add(xmlResultDataObjectDetailDO); |
| | | } |
| | | e.printStackTrace(); |
| | |
| | | PRIOR OID = parentCodeClassifyOid |
| | | </select> |
| | | |
| | | <select id="selectAllParentOid" resultType="java.lang.String"> |
| | | SELECT oid |
| | | FROM PL_CODE_CLASSIFY |
| | | START WITH oid = #{oid} |
| | | CONNECT BY PRIOR PARENTCODECLASSIFYOID = oid |
| | | </select> |
| | | |
| | | <select id="checkHasChild" resultType="java.lang.Boolean"> |
| | | <![CDATA[select count(oid) |
| | | from PL_CODE_CLASSIFY |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.vci.ubcs</groupId> |
| | | <artifactId>ubcs-code-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 lombok.AllArgsConstructor; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * @author ludc |
| | | * @date 2023/12/20 11:33 |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/classifyAuth") |
| | | @ApiIgnore |
| | | @Api(value = "åç±»ææ", tags = "æ¥å£") |
| | | public class ClassifyAuthController { |
| | | |
| | | private final IClassifyAuthService classifyAuthService; |
| | | |
| | | /** |
| | | * åç±»ææä¿åæ¥å£ |
| | | * @param classifyAuthList |
| | | * @return |
| | | */ |
| | | @PostMapping("saveOrUpdate") |
| | | public R saveOrUpdate(@RequestBody List<ClassifyAuth> classifyAuthList) { |
| | | return classifyAuthService.submit(classifyAuthList); |
| | | } |
| | | |
| | | /** |
| | | * è·ååç±»ææéå |
| | | * @param classifyAuthVO |
| | | * @return |
| | | */ |
| | | @GetMapping("list") |
| | | public R<List<ClassifyAuthVO>> getClassifyAuthList(ClassifyAuthVO classifyAuthVO) { |
| | | return R.data(classifyAuthService.getClassifyAuthList(classifyAuthVO)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | @GetMapping("getAuthButtonList") |
| | | public R<Map<String,Boolean>> getAuthButtonList(String classifyId){ |
| | | return R.data(classifyAuthService.getAuthButtonList(classifyId)); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.BladeUser; |
| | |
| | | public R<List<MenuVO>> list(@ApiIgnore @RequestParam Map<String, Object> menu) { |
| | | List<Menu> list = menuService.list(Condition.getQueryWrapper(menu, Menu.class).lambda().orderByAsc(Menu::getSort)); |
| | | return R.data(MenuWrapper.build().listNodeVO(list)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶èåçcodeè·åï¼ä¸é¢çæé® |
| | | * @param menu |
| | | * @return |
| | | */ |
| | | @GetMapping("/getButtonByParentCode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "code", value = "èåç¼å·", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "category", value = "èåç±»å", paramType = "query", dataType = "string") |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "å表", notes = "ä¼ å
¥menu") |
| | | public R<List<MenuVO>> getButtonByParentCode(@ApiIgnore @RequestParam Map<String, Object> menu){ |
| | | if(Func.isBlank(menu.getOrDefault("code","").toString())){ |
| | | throw new ServiceException("å¿
å¡«åæ°èåcodeä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | return R.data(MenuWrapper.build().listNodeVO(menuService.getButtonByParentCode(menu.getOrDefault("code","").toString()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return R.fail("æä½å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å é¤ |
| | |
| | | |
| | | private final IMdmCountConfigService mdmCountConfigService; |
| | | |
| | | private final IClassifyAuthService classifyAuthService; |
| | | |
| | | @Override |
| | | @GetMapping(MENU) |
| | | public R<Menu> getMenu(Long id) { |
| | |
| | | return R.data(mdmCountConfigService.getMdmCountConfig(userId)); |
| | | } |
| | | |
| | | public R<List<String>> getViewClassByRoleIds(List<String> roleIds){ |
| | | return R.data(classifyAuthService.getViewClassByRoleIds(roleIds)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ludc |
| | | * @date 2023/12/25 15:50 |
| | | */ |
| | | public interface ClassifyAuthMapper extends BaseMapper<ClassifyAuth> { |
| | | |
| | | List<ClassifyAuth> getClassifyAuthList(@Param("classifyId") String classifyId); |
| | | |
| | | List<String> getViewClassByRoleIds(@Param("roleIds") List<String> roleIds); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.tool.node.TreeNode; |
| | | import com.vci.ubcs.system.dto.MenuDTO; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | |
| | | List<Menu> selectMenuChildByBtnType(String btmType,List<String> roleIds); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶èåcodeæ¥è¯¢èåçåæé® |
| | | * |
| | | * @return |
| | | */ |
| | | List<Menu> getButtonByParentCode(@Param("code") String code); |
| | | |
| | | /** |
| | | * æéé
ç½®èå |
| | | * |
| | | * @param roleId |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.vo.ClassifyAuthVO; |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:34 |
| | | */ |
| | | public interface IClassifyAuthService extends IService<ClassifyAuth> { |
| | | |
| | | /** |
| | | * åç±»ææä¿åæ¥å£ |
| | | * @param classifyAuthList |
| | | * @return |
| | | */ |
| | | R submit(List<ClassifyAuth> classifyAuthList); |
| | | |
| | | /** |
| | | * è·ååç±»ææéå |
| | | * @param classifyAuthVO |
| | | * @return |
| | | */ |
| | | List<ClassifyAuthVO> getClassifyAuthList(ClassifyAuthVO classifyAuthVO); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | Map<String,Boolean> getAuthButtonList(String classifyId); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idæ¥çæåªäºåç±»å
·å¤æ¥çæé |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | List<String> getViewClassByRoleIds(List<String> roleIds); |
| | | |
| | | } |
| | |
| | | List<Menu> getMenuByCodes(List<String> codes,Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶çº§èåçcodeæ¥è¯¢æé®ä¿¡æ¯ |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<Menu> getButtonByParentCode(String code); |
| | | |
| | | /** |
| | | * 对KeepAliveå¼è½¬æ¢æå¸å°ç±»åè¿è¡å°è£
|
| | | * |
| | | * @param childMenu |
| | |
| | | */ |
| | | R cloneMenuButton(Long menuId, List<String> buttonIds); |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·åèåä¿¡æ¯ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<Menu> getMenuListById(List<String> ids,String parentId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | 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.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import com.vci.ubcs.system.entity.Menu; |
| | | import com.vci.ubcs.system.mapper.ClassifyAuthMapper; |
| | | import com.vci.ubcs.system.service.IClassifyAuthService; |
| | | import com.vci.ubcs.system.service.IMenuService; |
| | | import com.vci.ubcs.system.vo.ClassifyAuthVO; |
| | | import com.vci.ubcs.system.vo.MenuVO; |
| | | import com.vci.ubcs.system.wrapper.ClassifyAuthWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * åç±»ææ |
| | | * @author ludc |
| | | * @date 2023/12/25 15:35 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ClassifyAuthServiceImpl extends ServiceImpl<ClassifyAuthMapper,ClassifyAuth> implements IClassifyAuthService { |
| | | |
| | | private final ClassifyAuthMapper classifyAuthMapper; |
| | | |
| | | private final IMenuService menuService; |
| | | |
| | | private final ICodeClassifyClient codeClassifyClient; |
| | | |
| | | /** |
| | | * åç±»ææä¿åæ¥å£ |
| | | * @param classifyAuthList |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R submit(List<ClassifyAuth> classifyAuthList) { |
| | | if(classifyAuthList.isEmpty()){ |
| | | R.fail("ææå表ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | // å¤éï¼æ¥çæ¯å¦åå¨åä¸ä¸ªclassidä¸é
ç½®äºç¸åçè§è² |
| | | Map<String, Long> roleidCounts = classifyAuthList.stream() |
| | | .collect(Collectors.groupingBy(ClassifyAuth::getRoleId, Collectors.counting())); |
| | | |
| | | // æ£æ¥æ¯å¦æroleidåºç°æ¬¡æ°å¤§äº1çæ
åµ |
| | | boolean hasDuplicateRoleid = roleidCounts.values().stream() |
| | | .anyMatch(count -> count > 1); |
| | | if(hasDuplicateRoleid){ |
| | | R.fail("è§è²åå类已ç»åå¨ï¼è¯·éæ°é
ç½®ï¼"); |
| | | } |
| | | |
| | | // å¦æä¼ è¿æ¥çéåä¸è¯¥åç±»idä¸å é¤äºé¨åè§è²çææï¼å°±éè¦å°è¯¥åºä¸classifyIdä¸ä¸åå¨çæ°æ®å æ |
| | | List<String> roleIds = classifyAuthList.stream().map(ClassifyAuth::getRoleId).collect(Collectors.toList()); |
| | | // å é¤ |
| | | LambdaUpdateWrapper<ClassifyAuth> updateWrapper = Wrappers.<ClassifyAuth>update() |
| | | .lambda().eq(ClassifyAuth::getClassifyId, classifyAuthList.get(0).getClassifyId()) |
| | | .notIn(ClassifyAuth::getRoleId, roleIds); |
| | | try { |
| | | this.classifyAuthMapper.delete(updateWrapper); |
| | | }catch (Exception e){ |
| | | throw new ServiceException("åç±»ææè¿ç¨ä¸åºç°é误ï¼é误åå ï¼"+e.getMessage()); |
| | | } |
| | | return R.status(saveOrUpdateBatch(classifyAuthList)); |
| | | } |
| | | |
| | | /** |
| | | * è·ååç±»ææéå |
| | | * @param classifyAuthVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ClassifyAuthVO> getClassifyAuthList(ClassifyAuthVO classifyAuthVO) { |
| | | if(Func.isBlank(classifyAuthVO.getClassifyId())){ |
| | | throw new ServiceException("缺å°å¿
ä¼ åæ°åç±»id"); |
| | | } |
| | | LambdaQueryWrapper<ClassifyAuth> wrapper = Wrappers.<ClassifyAuth>query() |
| | | .lambda().eq(ClassifyAuth::getClassifyId,classifyAuthVO.getClassifyId()); |
| | | List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper); |
| | | if(classifyAuths.isEmpty()){ |
| | | return new ArrayList<ClassifyAuthVO>(); |
| | | } |
| | | return ClassifyAuthWrapper.build().listVO(classifyAuths); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¥åç±»ä¸ï¼å½åç»å½çè§è²æåªäºæé®æé |
| | | * @param classifyId |
| | | * @return |
| | | */ |
| | | public Map<String,Boolean> getAuthButtonList(String classifyId){ |
| | | if(Func.isBlank(classifyId)){ |
| | | return new HashMap<>(); |
| | | } |
| | | //æ¥è¯¢åç±»èç¹çææç¶çº§èç¹ |
| | | 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) |
| | | .in(ClassifyAuth::getRoleId, roleIds); |
| | | List<ClassifyAuth> classifyAuths = this.classifyAuthMapper.selectList(wrapper); |
| | | //妿å½ååç±»æ²¡ææ¾å°ææé
ç½®ï¼å°±ä¾æ¬¡ä»å½åèç¹å¾ä¸å±èç¹æ¾ææé
ç½®ï¼æ¾å°äºå°±åæ¢ï¼æ²¡æ¾å°å°±ä¸ç´æ¾å°æå |
| | | if(classifyAuths.isEmpty()){ |
| | | // 䏿 ä»1å¼å§å 为å½åèç¹0å·²ç»æ¥è¯¢è¿ |
| | | for (int i = 1; i < classifyOidList.size(); i++) { |
| | | classifyAuths = this.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 HashMap<>(); |
| | | } |
| | | List<String> condition1 = new ArrayList<>(); |
| | | // 妿䏿¯è¶
ç®¡ç¨æ· |
| | | if(!isAdmin){ |
| | | condition1.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; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²idæ¥çæåªäºåç±»å
·å¤æ¥çæé |
| | | * @param roleIds |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getViewClassByRoleIds(List<String> roleIds) { |
| | | if(roleIds.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return this.classifyAuthMapper.getViewClassByRoleIds(roleIds); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private final IRoleMenuService roleMenuService; |
| | | private final IRoleScopeService roleScopeService; |
| | | private final MenuMapper menuMapper; |
| | | private final ITopMenuSettingService topMenuSettingService; |
| | | private final static String PARENT_ID = "parentId"; |
| | | private final static Integer MENU_CATEGORY = 1; |
| | |
| | | return baseMapper.lazyMenuPage(parentId, param, Condition.getPage(query)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<MenuVO> routes(String roleId, Long topMenuId) { |
| | | if (StringUtil.isBlank(roleId)) { |
| | |
| | | roleMenus = allMenus; |
| | | } |
| | | // éè¶
级管çåå¹¶ä¸ä¸æ¯é¡¶é¨èå请æ±åè¿å对åºè§è²æéèå |
| | | else if (!AuthUtil.isAdministrator() && Func.isEmpty(topMenuId)) { |
| | | else if (!VciBaseUtil.checkAdminTenant() && Func.isEmpty(topMenuId)) { |
| | | roleMenus = tenantPackageMenu(baseMapper.roleMenuByRoleId(Func.toLongList(roleId))); |
| | | } |
| | | // é¡¶é¨èå请æ±è¿å对åºè§è²æéèå |
| | |
| | | LambdaQueryWrapper<Menu> wrapper = Wrappers.<Menu>query() |
| | | .lambda() |
| | | .in(Menu::getCode, codes) |
| | | .eq(Menu::getIsDeleted,0) /*æªè¢«å é¤*/ |
| | | .eq(Menu::getIsDeleted,BladeConstant.DB_NOT_DELETED) /*æªè¢«å é¤*/ |
| | | .eq(Menu::getCategory,1) /*èåç±»åä¸è½ä¸ºæé®*/ |
| | | .orderByAsc(Menu::getCode); /*æ ¹æ®codeæåºä¸classifyçbtmtypeid对åº*/ |
| | | // è¶
管ä¸ç¨æ ¹æ®è§è²æ¥æ¥è¯¢ |
| | |
| | | } |
| | | } |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶çº§èåçcodeæ¥è¯¢æé®ä¿¡æ¯ |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Menu> getButtonByParentCode(String code) { |
| | | List<Menu> buttonList = menuMapper.getButtonByParentCode(code); |
| | | return buttonList; |
| | | } |
| | | |
| | | /** |
| | |
| | | return this.saveBatch(newButtons) ? R.success("æé®å
éæåï¼"):R.fail("æé®å
é失败ï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä¸»é®è·åèåä¿¡æ¯ |
| | | * @param ids |
| | | * @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); |
| | | if(VciBaseUtil.checkAdminTenant()){ |
| | | wrapper.eq(Menu::getParentId,parentId); |
| | | }else { |
| | | wrapper.in(Menu::getId, ids); |
| | | } |
| | | List<Menu> menuList = this.list(wrapper); |
| | | return menuList; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill åºéª (smallchill@163.com) |
| | | */ |
| | | package com.vci.ubcs.system.wrapper; |
| | | |
| | | import com.vci.ubcs.system.cache.DictCache; |
| | | import com.vci.ubcs.system.entity.ApiScope; |
| | | import com.vci.ubcs.system.entity.ClassifyAuth; |
| | | import com.vci.ubcs.system.enums.DictEnum; |
| | | import com.vci.ubcs.system.vo.ApiScopeVO; |
| | | import com.vci.ubcs.system.vo.ClassifyAuthVO; |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | | * å
è£
ç±»,è¿åè§å¾å±æéçåæ®µ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | public class ClassifyAuthWrapper extends BaseEntityWrapper<ClassifyAuth, ClassifyAuthVO> { |
| | | |
| | | public static ClassifyAuthWrapper build() { |
| | | return new ClassifyAuthWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public ClassifyAuthVO entityVO(ClassifyAuth classifyAuth) { |
| | | ClassifyAuthVO classifyAuthVO = Objects.requireNonNull(BeanUtil.copy(classifyAuth, ClassifyAuthVO.class)); |
| | | classifyAuthVO.setButtonIdList(Arrays.asList(classifyAuth.getButtonIds().split(","))); |
| | | return classifyAuthVO; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vci.ubcs.system.mapper.ClassifyAuthMapper"> |
| | | <resultMap id="classifyAuthMap" type="com.vci.ubcs.system.entity.ClassifyAuth"> |
| | | <result column="oid" property="oid"/> |
| | | <result column="ROLE_ID" property="roleId"/> |
| | | <result column="CLASSIFY_ID" property="classifyId"/> |
| | | <result column="BUTTON_IDS" property="buttonIds"/> |
| | | </resultMap> |
| | | |
| | | <select id="getClassifyAuthList" resultMap="classifyAuthMap"> |
| | | SELECT * |
| | | FROM PL_ORG_CLASSIFYAUTH |
| | | WHERE CLASSIFY_ID = #{classifyId}; |
| | | </select> |
| | | |
| | | |
| | | <select id="getViewClassByRoleIds" resultType="java.lang.String"> |
| | | SELECT CLASSIFY_ID |
| | | FROM PL_ORG_CLASSIFYAUTH |
| | | WHERE |
| | | <if test="roleIds != null and ! roleIds.isEmpty() and roleIds.size() > 0"> |
| | | ROLE_ID IN |
| | | <foreach item="item" index="index" collection="roleIds" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | AND BUTTON_IDS LIKE CONCAT('%', CONCAT((SELECT ID |
| | | FROM PL_SYS_MENU |
| | | WHERE CODE = 'classify_view'), '%')) |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | #{item} |
| | | </foreach> |
| | | ) ) ) |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | |
| | | ) 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 |
| | | WHERE |
| | | "CATEGORY" = '2' |
| | | AND IS_DELETED = 0 |
| | | AND PARENT_ID IN ( |
| | | SELECT |
| | | ID |
| | | FROM |
| | | PL_SYS_MENU |
| | | WHERE |
| | | CODE = #{code}) |
| | | ORDER BY SORT |
| | | </select> |
| | | |
| | | <select id="grantTree" resultMap="treeNodeResultMap"> |
| | | select |
| | | id, |
| | |
| | | throw new ServiceException("å¯ç ä¸å¿
须嫿ã"+strategy.getCombinationNames()+"ãä¸çã"+strategy.getRequiredType()+"ãç§å¯ç ç»åæ¹å¼ï¼ä¸å¯ç é¿åº¦å¿
é¡»å¨ã"+strategy.getMinPwdLen()+"-"+strategy.getMaxPwdLen()+"ãèå´å
"); |
| | | } |
| | | |
| | | oldPassword = DigestUtil.hex(DigestUtils.md5DigestAsHex((oldPassword).getBytes())); |
| | | if (!user.getPassword().equals(oldPassword)) { |
| | | String hexOldPassword = DigestUtil.hex(oldPassword); |
| | | if (!user.getPassword().equals(hexOldPassword)) { |
| | | throw new ServiceException("åå¯ç 䏿£ç¡®!"); |
| | | } |
| | | List<String> regexs = sysClient.getRegexByList(Arrays.asList(strategy.getCombinationIds().split(","))).getData(); |