李喆(开发组)
2025-06-13 f23fd4147487672ea4f5fcdc8ebd8912e05ec9c5
Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
已添加2个文件
253 ■■■■■ 文件已修改
src/api/flow/todolist.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/flow/todolist.vue 229 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/flow/todolist.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,24 @@
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) => {
};
src/views/flow/todolist.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,229 @@
<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>