Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/axios'; |
| | | export const getLazyList = (current, size, params) => { |
| | | return request({ |
| | | url: '/blade-mdm/flow/todo-list', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | }, |
| | | }); |
| | | }; |
| | | export const add = (parentId, params) => { |
| | | |
| | | }; |
| | | export const remove = (parentId, params) => { |
| | | |
| | | }; |
| | | export const update = (parentId, params) => { |
| | | |
| | | }; |
| | | export const getMenu = (parentId, params) => { |
| | | |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #menu-left> |
| | | <el-button type="primary" plain @click="reassign">éæ°ææ´¾ |
| | | </el-button> |
| | | </template> |
| | | <!-- <template #source="{ row }"> |
| | | <div style="text-align: center"> |
| | | <i :class="row.source" /> |
| | | </div> |
| | | </template> --> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getLazyList, remove, update, add, getMenu } from '@/api/flow/todolist'; |
| | | import { mapGetters } from 'vuex'; |
| | | import iconList from '@/config/iconList'; |
| | | import func from '@/utils/func'; |
| | | import { getMenuTree } from '@/api/system/menu'; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | selectionList: [], |
| | | parentId: 0, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn: false, |
| | | tip: false, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: '60%', |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | // selection: true, |
| | | // viewBtn: true, |
| | | menuWidth: 320, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'time', |
| | | type: 'datetime', |
| | | search: true, |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: 'å
³é®å', |
| | | prop: 'keyWord', |
| | | width: 300, |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | dicData: [ |
| | | { |
| | | label: 'æ¶å¯ç½ç¨åº', |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: 'å·¥æ§ç½è½¦åºç¨åº', |
| | | value: 2, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | | label: 'ç¼å·', |
| | | prop: 'name', |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | width: 100, |
| | | prop: 'path', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥è·¯ç±å°å', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'å®ä¾ç¼å·', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'æµç¨å®ä¾å', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'æºåº', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'å°è¾¾æ¶é´', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'å°è¾¾æè¿°', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'æä»¶', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | { |
| | | label: 'å°è¾¾æ¶é´', |
| | | width: 100, |
| | | type: 'tree', |
| | | }, |
| | | |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | 'form.category'() { |
| | | const category = func.toInt(this.form.category); |
| | | this.$refs.crud.option.column.filter(item => { |
| | | if (item.prop === 'path') { |
| | | item.rules[0].required = category === 1; |
| | | } |
| | | if (item.prop === 'isOpen') { |
| | | item.disabled = category === 2; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo', 'permission']), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.validData(this.permission.menu_add, false), |
| | | viewBtn: this.validData(this.permission.menu_view, false), |
| | | delBtn: this.validData(this.permission.menu_delete, false), |
| | | editBtn: this.validData(this.permission.menu_edit, false), |
| | | }; |
| | | }, |
| | | }, |
| | | methods: { |
| | | reassign() {// éæ°ææ´¾ |
| | | |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.parentId = ''; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | |
| | | onLoad(page, params = {}) { |
| | | const query = { |
| | | ...this.query, |
| | | category: params.category ? flowCategory(params.category) : null, |
| | | mode: this.mode, |
| | | }; |
| | | this.loading = true; |
| | | getLazyList(page.currentPage, page.pageSize, Object.assign(params, query)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style></style> |