第12章 角色页的修改、添加

news2024/9/22 11:23:55

1 定义src\components\Users\EditRole.vue

<template>

    <el-dialog width="30%">

        <!-- <span>{{propParent}}</span> -->

        <template #header>

            <div class="my-header">

                <h1 style="margin: 0px; padding: 0px; ">

                    <el-icon style="margin-right:5px; font-size: 25px; color:#337ecc; vertical-align: middle">

                        <Edit />

                    </el-icon>

                    编辑角色

                </h1>

            </div>

        </template>

        <el-form :model="formRole" :rules="ruleRole" ref="refRule" label-width="100px" class="demo-ruleForm"

            label-position="left" status-icon>

            <el-form-item label="编号:" prop="id">

                <el-input v-model="formRole.id" disabled />

            </el-form-item>

            <el-form-item label="名称:" prop="name">

                <el-input v-model="formRole.name" />

            </el-form-item>

            <el-form-item label="状态:" prop="isActive">

                <el-select v-model="formRole.isActive" style="width: 100%;">

                    <!-- 注意:必须使用 :value=true,不能使用 value=true,否则会出现:

                    “ [Vue warn]: Invalid prop: type check failed for prop "modelValue". Expected String | Number | Object, got Boolean with value true. ”

                    警告信息 -->

                    <el-option label="启用" :value=true />

                    <el-option label="禁用" :value=false />

                </el-select>

            </el-form-item>

            <el-form-item label="备注:" prop="remark">

                <el-input v-model="formRole.remark" type="textarea" :rows="10" />

            </el-form-item>

        </el-form>

        <template #footer>

            <span class="dialog-footer">

                <el-button @click="this.formRole.centerDialogVisible = false"> </el-button>

                <el-button type="primary" @click="submitEdit"> </el-button>

            </span>

        </template>

    </el-dialog>

</template>

<script>

    import axios from 'axios'

    export default {

        name: 'EditRole',

        props: {

            propParent: {},

        },

        data() {

            return {

                //该实例用于指示,当前页面是否正在调用后端的API方法,获取当前页面渲染显示所需的数据源。

                isLoading: false,

                formRole: {

                    id: 0,

                    name: '',

                    isActive: true,

                    remark: '',

                    //该实例用于指示,当前页面角色编辑子页面是否在父窗口中显示出来。

                    centerDialogVisible: false,

                },

                ruleRole: {

                    name: [{

                        required: true,

                        message: '请输入角色名',

                        trigger: 'blur',

                    }, ],

                },

            };

        },

        //监视父窗口传递的参数实例,使当前子页面中的表单始终显示父窗口最新传递的参数实例。

        watch: {

            propParent(val) {

                //console.log(val);

                this.formRole = val;

            },

        },

        methods: {

            //编辑提交事件

            async submitEdit() {

                this.$refs.refRule.validate(async (valid) => {

                    if (valid) {

                        let para = {

                            id: this.formRole.id,

                            name: this.formRole.name,

                            isActive: this.formRole.isActive,

                            remark: this.formRole.remark,

                        };

                        this.isLoading = true;

                        let res = await axios.put('https://localhost:7043/Role/PutUpdateRole', JSON.stringify(para));

                        //console.log(res.data);

                        if (res.status == 200) {

                            this.$message.success("成功修改");

                            //"runParent":自定义事件名,= @runParent(父控件)

                            this.$emit("runParent");

                            this.formRole.centerDialogVisible = false;

                        } else {

                            this.$message.error(res.msg);

                            this.isLoading = false;

                            this.formRole.centerDialogVisible = true;

                        }

                    } else {

                        this.$message.error('输入不能通过验证 !');

                        this.formRole.centerDialogVisible = true;

                        return false;

                    }

                });

            },

        },

    }

</script>

<style scoped lang="scss">

    .my-header {

        display: flex;

        flex-direction: row;

        justify-content: space-between;

    }

</style>

2 定义src\components\Users\AddRole.vue

<template>

    <el-dialog width="30%">

        <!-- <span>{{propParent}}</span> -->

        <template #header>

            <div class="my-header">

                <h1 style="margin: 0px; padding: 0px; ">

                    <el-icon style="margin-right:5px; font-size: 25px; color:#337ecc; vertical-align: middle">

                        <CirclePlusFilled />

                    </el-icon>

                    添加角色

                </h1>

            </div>

        </template>

        <el-form :model="formRole" :rules="ruleRole" ref="refRule" label-width="100px" class="demo-ruleForm"

            label-position="left" status-icon>

            <el-form-item label="名称:" prop="name">

                <el-input v-model="formRole.name" />

            </el-form-item>

            <el-form-item label="状态:" prop="isActive">

                <el-select v-model="formRole.isActive" style="width: 100%;">

                    <!-- 注意:必须使用 :value=true,不能使用 value=true,否则会出现:

                    “ [Vue warn]: Invalid prop: type check failed for prop "modelValue". Expected String | Number | Object, got Boolean with value true. ”

                    警告信息 -->

                    <el-option label="启用" :value=true />

                    <el-option label="禁用" :value=false />

                </el-select>

            </el-form-item>

            <el-form-item label="备注:" prop="remark">

                <el-input v-model="formRole.remark" type="textarea" :rows="10" />

            </el-form-item>

        </el-form>

        <template #footer>

            <span class="dialog-footer">

                <el-button @click="this.formRole.centerDialogVisible = false"> </el-button>

                <el-button type="primary" @click="submitAdd"> </el-button>

            </span>

        </template>

    </el-dialog>

</template>

<script>

    import axios from 'axios'

    export default {

        name: 'AddRole',

        props: {

            propParent: {},

        },

        data() {

            return {

                //该实例用于指示,当前页面是否正在调用后端的API方法,获取当前页面渲染显示所需的数据源。

                isLoading: false,

                formRole: {

                    name: '',

                    isActive: true,

                    remark: '',

                    //该实例用于指示,当前页面角色编辑子页面是否在父窗口中显示出来。

                    centerDialogVisible: false,

                },

                ruleRole: {

                    name: [{

                        required: true,

                        message: '请输入角色名',

                        trigger: 'blur',

                    }, ],

                },

            };

        },

        //监视父窗口传递的参数实例,来监视弹出对话框的不显示。

        watch: {

            propParent(val) {

                //console.log(val);

                this.formRole = val;

                this.formRole.isActive = true;

            },

        },

        methods: {

            //添加提交事件

            async submitAdd() {

                this.$refs.refRule.validate(async (valid) => {

                    if (valid) {

                        let para = {

                            name: this.formRole.name,

                            isActive: this.formRole.isActive,

                            remark: this.formRole.remark,

                        };

                        this.isLoading = true;

                        let res = await axios.post('https://localhost:7043/Role/PostAddRole', JSON

                            .stringify(para));

                        //console.log(res.data);

                        if (res.status == 200) {

                            this.$message.success("成功添加");

                            //"runParent":自定义事件名,= @runParent(父控件)

                            this.$emit("runParent");

                            this.formRole.centerDialogVisible = false;

                        } else {

                            this.$message.error(res.msg);

                            this.isLoading = false;

                            this.formRole.centerDialogVisible = true;

                        }

                    } else {

                        this.$message.error('输入不能通过验证 !');

                        this.formRole.centerDialogVisible = true;

                        return false;

                    }

                });

            },

        },

    }

</script>

<style scoped lang="scss">

    .my-header {

        display: flex;

        flex-direction: row;

        justify-content: space-between;

    }

</style>

3 角色页的编辑、添加实现

<template>

    <!-- 查询表单 -->

    <el-form :model="formQuery" ref="ruleFormRef" label-width="120px" label-position="left" class="demo-form-inline">

        <el-row :gutter="20">

            <el-col :span="6">

                <el-form-item label="名称:">

                    <el-input v-model="formQuery.name" type="text" auto-complete="off" />

                </el-form-item>

            </el-col>

            <el-col :span="6">

                <el-form-item label="状态:">

                    <el-select v-model="formQuery.isActive">

                        <el-option label="不限" value="" />

                        <el-option label="启用" value=true />

                        <el-option label="禁用" value=false />

                    </el-select>

                </el-form-item>

            </el-col>

            <el-col :span="2">

                <el-form-item>

                    <el-button type="primary" size="large" @click="submitQuery">

                        <el-icon style="margin-right:5px; font-size: 22px;">

                            <Search />

                        </el-icon>

                       

                    </el-button>

                </el-form-item>

            </el-col>

            <el-col :span="2">

                <el-form-item>

                    <el-button type="info" size="large" @click="resertTable">

                        <el-icon style="margin-right:5px; font-size: 22px;">

                            <RefreshRight />

                        </el-icon>

                       

                    </el-button>

                </el-form-item>

            </el-col>

            <el-col :span="2">

                <el-form-item>

                    <el-button size="large" @click="addRole()" style="background-color: #79bbff; color: #FFFFFF;">

                        <el-icon style="margin-right:5px; font-size: 22px;">

                            <CirclePlusFilled />

                        </el-icon>

                       

                    </el-button>

                </el-form-item>

            </el-col>

            <el-col :span="2">

                <el-form-item>

                    <el-button type="danger" size="large" @click="deleteArrayRole()">

                        <el-icon style="margin-right:5px; font-size: 22px;">

                            <Delete />

                        </el-icon>

                        删除所选

                    </el-button>

                </el-form-item>

            </el-col>

        </el-row>

    </el-form>

    <!-- 指定页面 -->

    <el-table :data="rolePageList" style="width: 100%" :row-style="{height:'30px'}" @sort-change="handleTableSort"

        :default-sort="{'prop': JSON.parse(this.pagination.OrderByFiled).filed,'order':JSON.parse(this.pagination.OrderByFiled).type}"

        ref="refTable" @selection-change="selectionChangeRole">

        <el-table-column type="selection" width="50px" />

        <el-table-column property="id" label="编号" width="100px" sortable />

        <el-table-column property="name" label="名称" sortable />

        <el-table-column prop="isActive" label="启用?" width="200">

            <template #default="scope">

                <el-tag type="success" size="large" v-if="scope.row.isActive"> </el-tag>

                <el-tag type="danger" v-else> </el-tag>

            </template>

        </el-table-column>

        <el-table-column property="remark" label="备注" />

        <el-table-column label="操作" align="center">

            <template #default="scope">

                <el-button type="primary" @click="editRole(scope.row)" size="large" style="margin-right: 10px;">

                </el-button>

                <el-button type="danger" @click="deleteSingleRole(scope.row)" size="large"> </el-button>

            </template>

        </el-table-column>

    </el-table>

    <!--  “->”设定 “el-pagination”分页组件靠右显示。 -->

    <el-pagination v-model:current-page="this.pagination.pageIndex" v-model:page-size="this.pagination.pageSize"

        :page-sizes="[3, 10, 15, 20, 50]" :total="this.pagination.totalCount" prev-text="上一页" next-text="下一页" background

        layout="->, total, sizes, prev, pager, next" @size-change="handleSizeChange"

        @current-change="handleCurrentChange" />

    <!-- 注意: @runParent,不能与"editDialogClose"同名,否则会出现:

    “ [Vue warn]:emitted event "editDialogClose" but it is neither declared in the emits option nor as an "onEditDialogClose" prop. ”

    警告信息 -->

    <EditRole v-model="this.formEidt.centerDialogVisible" :propParent="this.formEidt" @runParent="editDialogClose">

    </EditRole>

    <AddRole v-model="this.formAdd.centerDialogVisible" :propParent="this.formAdd" @runParent="addDialogClose">

    </AddRole>

</template>

<script>

    import axios from 'axios'

    import EditRole from '@/components/Users/EditRole.vue'

    import AddRole from '@/components/Users/AddRole.vue'

    export default ({

        components: {

            EditRole,

            AddRole,

        },

        data() {

            return {

                //该实例用于指示,当前页面是否正在调用后端的API方法,获取当前页面渲染显示所需的数据源。

                listLoading: false,

                formQuery: {

                    name: '',

                    isActive: '',

                },

                //初始化当前页的渲染数据集列表实例。

                rolePageList: [],

                //分页初始化实例。

                pagination: {

                    pageIndex: 1, //初始化当前页,即第1页。

                    pageSize: 15, //初始化每页最多所包含的项数值,即每页最多所包含15项。

                    totalCount: 0, //初始化数据源的总计项数值,由于还没有加载数据源所以该值为:0

                    //初始化排序字段及其方式。

                    OrderByFiled: JSON.stringify({

                        filed: 'id',

                        type: 'descending',

                    }),

                    QueryCondition: ""

                },

                //用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

                timer: null,

                //编辑子页参数实例。

                formEidt: {

                    id: 0,

                    name: '',

                    isActive: true,

                    remark: '',

                    //该实例用于指示,当前页面角色编辑子页面是否在父窗口中显示出来。

                    centerDialogVisible: false,

                },

                //添加子页参数实例。

                formAdd: {

                    name: '',

                    isActive: true,

                    remark: '',

                    //该实例用于指示,当前页面角色编辑子页面是否在父窗口中显示出来。

                    centerDialogVisible: false,

                },

            };

        },

        methods: {

            //用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

            async initTimer() {

                //console.log(this.timer != null);

                //用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

                if (this.timer != null) {

                    await clearInterval(this.timer);

                    this.timer = null;

                }

            },

            //获取当前页面渲染显示所需的数据源。

            async getRolePageList() {

                this.listLoading = true;

                //"axios.post"方式没有加载“headers”参数实例,需要在后端进行相应的配置,否则访问后端的POST-API,否则会出现:"HTTP:415"错误。

                let res = await axios.post('https://localhost:7043/Role/PostRolePageByFromBody', JSON.stringify(

                    this.pagination));

                //console.log(res.data);

                this.pagination.totalCount = res.data.response.totalCount;

                this.rolePageList = res.data.response.data;

                this.listLoading = false;

                //用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

                await this.initTimer();

            },

            //该事件在改变每页最多所包含的项数值后,把数据源加载到当前页面中,并重新对当前页进行渲染显示。

            async handleSizeChange(size) {

                this.pagination.pagesize = size;

                //console.log(this.pagesize); //每页最多所包含的项数值。

                await this.getRolePageList();

            },

            //该事件在改变当前页的索引值后,把数据源加载到当前页面中,并重新对当前页进行渲染显示。

            async handleCurrentChange(currentPage) {

                this.pagination.PageIndex = currentPage;

                //console.log(this.PageIndex); //当前页的索引值。

                await this.getRolePageList();

            },

            // 点击三角图标时触发事件

            async handleTableSort({

                column

            }) {

                /* console.log(JSON.stringify({

                     filed: column.property,

                     type: column.order,

                 })); */

                this.pagination.OrderByFiled = JSON.stringify({

                    filed: column.property,

                    type: column.order,

                });

                await this.getRolePageList();

            },

            //重置页面样式及其数据。

            async resertTable() {

                //重置查询表单。

                this.formQuery = {

                    name: '',

                    isActive: '',

                };

                //重置排序字段试及其排序方式。

                this.pagination = {

                    pageIndex: 1, //初始化当前页,即第1页。

                    pageSize: 15, //初始化每页最多所包含的项数值,即每页最多所包含15项。

                    totalCount: 0, //初始化数据源的总计项数值,由于还没有加载数据源所以该值为:0

                    //初始化排序字段及其方式。

                    OrderByFiled: JSON.stringify({

                        filed: 'id',

                        type: 'descending',

                    }),

                    QueryCondition: ""

                }

                await this.$refs.refTable.sort(JSON.parse(this.pagination.OrderByFiled).filed, JSON.parse(this

                    .pagination.OrderByFiled).type);

                await this.getRolePageList();

            },

            //查询操作。

            async submitQuery() {

                var where = {};

                if (this.formQuery.name != '') {

                    where.name = this.formQuery.name;

                }

                if (this.formQuery.isActive != '') {

                    where.isActive = this.formQuery.isActive;

                }

                this.pagination.QueryCondition = JSON.stringify(where);

                await this.getRolePageList();

            },

            //从角色表中删除单行指定数据后,并重新渲染显示当前页面。

            async deleteSingleRole(row) {

                await this.$confirm(`确认删除记录:${row.id}!`, '提示', {

                        type: 'warning'

                    })

                    .then(async () => { // 确定操作

                        let para = {

                            "Id": row.id,

                        };

                        console.log(row.id);

                        this.listLoading = true;

                        let res = await axios.delete(

                            'https://localhost:7043/Role/DeleteRoleSingle', {

                                params: para

                            });

                        console.log(res.data);

                        this.listLoading = false;

                    })

                    .catch(() => { // 取消操作

                        this.$message({

                            type: 'info',

                            message: '已取消退出'

                        });

                    });

                this.$message.success(`成功删除记录:${row.id}!`);

                //this.timer:用于限定单个删操作中的除定时器实例,能且只能被触发执行1次。

                this.timer = await setInterval(

                    async () => {

                        return await this.getRolePageList();

                    }, 3000);

            },

            //获取将要被删除的编号值集,编号之间用隔开。

            async selectionChangeRole(selectArray) {

                //获取编号值集,编号之间用隔开;例如: 1,2,3 这种格式。

                this.idArray = selectArray.map(item => item.id);

                //console.log(this.idArray);

                //console.log(this.idArray.length);

            },

            //批量删除事件

            async deleteArrayRole() {

                if (this.idArray.length <= 0) {

                    this.$message.error("请选择要删除的一行数据!");

                    return;

                }

                await this.$confirm(`确认删除记录:${this.idArray}!`, '提示', {

                        type: 'warning'

                    })

                    .then(async () => { // 确定操作

                        let para = {

                            "idArray": this.idArray.join(),

                        };

                        this.listLoading = true;

                        let res = await axios.delete(

                            'https://localhost:7043/Role/DeleteRoleArray', {

                                params: para

                            });

                        console.log(res.data);

                        this.listLoading = false;

                    })

                    .catch(() => { // 取消操作

                        this.$message({

                            type: 'info',

                            message: '已取消退出'

                        });

                    });

                await this.$message.success(`成功删除记录:${this.idArray}!`);

                //this.timer:用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

                this.timer = await setInterval(

                    async () => {

                        return await this.getRolePageList();

                    }, 3000);

            },

            //编辑单击事件

            async editRole(row) {

                this.formEidt = Object.assign({}, row);

                this.formEidt.centerDialogVisible = true;

            },

            //子编辑页面提交成功时,自动刷新当前页。

            async editDialogClose() {

                await this.getRolePageList();

            },

            //添加单击事件

            async addRole() {

                this.formAdd = Object.assign({}, {});

                console.log(this.formAdd);

                this.formAdd.centerDialogVisible = true;

            },

            //子添加页面提交成功时,自动刷新当前页。

            async addDialogClose() {

                await this.resertTable();

            },

        },

        async mounted() {

            await this.getRolePageList();

        },

        async beforeUnmount() {

            //用于限定批量删操作中的除定时器实例,能且只能被触发执行1次。

            await this.initTimer();

        },

    });

</script>

<style scoped lang="scss">

    //表单“label”字体样式

    :deep(.el-form-item__label) {

        font-size: 120%;

        font-weight: 700;

    }

    // 修改表头样式。

    :deep(.el-table__header thead th) {

        background-color: #000000;

        color: #ffd04b;

        font-size: 150%;

        font-weight: 700;

        text-align: center;

    }

    //修改复选框控件样式。

    :deep(.el-checkbox) {

        display: flex;

        align-items: center;

        width: 25px;

        height: 25px;

        //修改选中框的大小

        .el-checkbox__inner {

            width: 20px;

            height: 20px;

            border: #409EFF solid 2px;

            //修改选中框中的对勾的大小和位置

            &::after {

                // 对号

                border: 4px solid #FFFFFF;

                // 不覆盖下面的 导致对号变形

                box-sizing: content-box;

                content: "";

                border-left: 0;

                border-top: 0;

                height: 15px;

                position: absolute;

                top: -3px;

            }

        }

        //修改点击文字颜色不变

        .el-checkbox__input.is-checked+.el-checkbox__label {

            color: #333333;

        }

        .el-checkbox__label {

            line-height: 25px;

            //padding-left: 8px;

        }

    }

    //表格隔行变换颜色。

    :deep(.el-table__body tbody tr:nth-child(odd)) {

        background-color: #FFFFFF;

        font-size: 120%;

        font-weight: 700;

    }

    :deep(.el-table__body tbody tr:nth-child(even) td) {

        background-color: #CCFFFF;

        font-size: 120%;

        font-weight: 700;

    }

    //标签控件字体样式。

    .el-tag {

        font-size: 100%;

        font-weight: 700;

    }

    //按钮控件字体样式。

    .el-button {

        font-size: 100%;

        font-weight: 700;

    }

    //“el-pagination”分页组件样式。

    .el-pagination {

        margin-top: 10px;

        font-size: 25px;

        //"上一页"样式。

        :deep(.btn-prev) {

            background-color: transparent;

            width: 40px;

            height: 40px;

            margin-right: 20px;

            font-size: 25px;

        }

        //"下一页"样式。

        :deep(.btn-next) {

            background-color: transparent;

            width: 40px;

            height: 40px;

            margin-left: 20px;

            font-size: 25px;

        }

        //分页索引样式。

        :deep(.number) {

            background-color: transparent;

            width: 40px;

            height: 40px;

            margin-right: 15px;

            font-size: 25px;

        }

    }

    //“el-pagination”分页组件中下拉框控件字体样式。

    :deep(.el-input__wrapper) {

        font-size: 25px;

    }

</style>

上功能更为具体实现和注释见:230105_007shopvue(角色页的修改、添加)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/141496.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

快速指南 :ESP-IDF 自定义以太网 PHY 驱动程序

“我想用我最喜欢的芯片开始新的产品设计&#xff0c;但它断货了&#xff01;哦&#xff0c;不&#xff01;我必须设计一个新的 PCB&#xff0c;并重新开发驱动程序&#xff01;”如今&#xff0c;每个设计师都非常清楚这种感觉…好消息是&#xff0c;至少在 ESP-IDF 以太网 PH…

[C语言]浮点型在内存中的存储

在上一篇文章&#xff0c;我们讲述了整型在内存中的存储&#xff0c;这篇文章我们就一起来看一下“浮点型在内存中的存储” 回顾&#xff1a;整型在内存中的存储[C语言]和我一起来认识“整型在内存中的存储”_HY_PIGIE的博客-CSDN博客 目录 1.浮点数家族 2.整型和浮点型的存储…

教你从零开始搭建自己的魔兽世界服务器

首先需要一份 WOW 的程序底包:1底包使用方法: 解压后,放到 d: 目录即可, 如下图 &#xff08;最好是D盘下 因为有很多东西都是D:/连接的 &#xff09;2运行http-mysql/下的文件INIT.CM_重命名为INIT.CMD 运行3设置登录器下载 &#xff0c;在http-mysql/htdocs下创建DOWNLOAD文件…

再次改进MBR(从磁盘读入Loader加载器)

文章目录前言前置知识代码说明实验操作前言 本博客记录《操作系统真象还原》第二章第2个实验操作~ 实验环境&#xff1a;ubuntu18.04VMware &#xff0c; Bochs下载安装 实验内容&#xff1a;从磁盘读入Loader加载器 实验思路&#xff1a; MBR 受到512字节大小的限制&#…

kernel pwn gdb调试

前言 对于Linux的二进制程序&#xff0c;gdb调试是十分重要的&#xff0c;可以清楚的了解程序是如何运行的&#xff0c;这里单独拉一篇记录我在kernel pwn中遇到的一些调试 GDB选择 在三大件pwndbg,gef,peda中&#xff0c;用了一圈下来感觉gef和pwndbg都挺好 gdb安装 简单…

PaddleNLP教程文档

文章目录一、快速开始1.1 安装PaddleNLP并 加载数据集1.2 数据预处理1.3 加载预训练模型1.4 设置评价指标和训练策略1.5 模型训练与评估1.6 模型预测二、数据处理2.1 整体介绍2.2 加载内置数据集2.3 自定义数据集2.3.1 从本地文件创建数据集2.3.2 paddle.io.Dataset/IterableDa…

OpenShift Security - 用 RHACS 为应用自动生成 NetworkPolicy

《OpenShift / RHEL / DevSecOps / Ansible 汇总目录》 说明&#xff1a;本文已经在 OpenShift 4.12 RHACS 3.73.1 环境中验证 文章目录什么是 NP-Guard用 NP-Guard 自动生成 NetworkPolicy参考什么是 NP-Guard NP-Guard 是 IBM 发起的一个开源项目&#xff0c;用来自动创建 …

WindowsTerminal 安装 oh-my-posh

文章目录1 前言2 安装过程3 Posh Themes 自定义主题参考1 前言 在Linux中&#xff0c;有非常好用的oh-my-zsh&#xff0c;最近使用WindowsTerminal时想想有没有和oh-my-zsh相同好用的插件呢&#xff0c;答案是&#xff1a;oh-my-posh 2 安装过程 进入最新版PowerShell&#…

干货 | 解决 App 自动化测试的常见痛点(弹框及首页启动加载完成判断处理)

1. 常见痛点App 自动化测试中有些常见痛点问题&#xff0c;如果框架不能很好的处理&#xff0c;就可能出现元素定位超时找不到的情况&#xff0c;自动化也就被打断终止了。很容易打消做自动化的热情&#xff0c;导致从入门到放弃。比如下面的两个问题&#xff1a;一是 App 启动…

【代码题】链表面试题

目录 1.链表分割 2.相交链表 3.环形链表 4.环形链表 II 1.链表分割 点击进入该题 现有一链表的头指针 ListNode* pHead&#xff0c;给一定值x&#xff0c;编写一段代码将所有小于x的结点排在其余结点之前&#xff0c;且不能改变原来的数据顺序&#xff0c;返回重新排列后的…

国内注册Steam账号的快捷方法

本文介绍在国内注册Steam账号的快速、简便方法。 目前&#xff0c;在国内注册新的Steam账号变得越来越麻烦&#xff1b;尤其在最近&#xff0c;无论是无休止的谷歌人机身份验证&#xff0c;还是无法收到的验证邮件&#xff0c;都使得新建一个Steam账号与原来相比变得更加困难。…

[Linux_]make/Makefile

[Linux_]make/Makefile 心有所向&#xff0c;日复一日&#xff0c;必有精进专栏&#xff1a;《Linux_》作者&#xff1a;沂沐沐目录 [Linux]make/Makefile 前言 一、Mikefile 二、如何写Mikefile文件 三、原理 四、项目清理 报错&#xff1a;missing separator 前言 一个工…

Linux 命令

最基础的命令 1.我是谁 我用什么账号登录 whoami 2.我在那 在那个目录下 pwd 3.环顾四周 1.ll展示详细信息 2.ls 展示文件名称 4.cd 想去那 改变目录 cd 回家 cd ./ 定位到当前目录 cd../ 上级目录 cd../../上两级目录。 5.切换用户 su 从普通用户切换到root用户的…

C#应用程序配置文件(XML序列化) - 开源研究系列文章

上次写了一个C#线程池及管理器的博文( C#开发的线程池和管理器 - 开源研究系列文章 )&#xff0c;收到了不小的浏览量&#xff0c;在此感谢各位网友的支持。这次将另一个功能放出来单独讲解&#xff1a;C#应用程序的配置文件&#xff0c;使用的是XML文件保存程序的配置信息&…

数据结构(栈、队列、链表)

文章目录前言数据结构(栈、队列、链表)1、栈2、队列3、链表3.1、单向链表结构3.2、双向链表结构前言 如果您觉得有用的话&#xff0c;记得给博主点个赞&#xff0c;评论&#xff0c;收藏一键三连啊&#xff0c;写作不易啊^ _ ^。   而且听说点赞的人每天的运气都不会太差&…

多边形点集排序

一、问题描述已知多边形点集P {P1, P2, ... , PN}&#xff0c;其排列顺序是杂乱&#xff0c;依次连接这N个点&#xff0c;无法形成确定的多边形&#xff0c;需要对点集P进行排序后&#xff0c;再绘制多边形。二、排序规则点集排序过程中&#xff0c;关键在于如何定义点的大小关…

STC32G 时钟系统

文章目录时钟系统代码配置总结时钟系统 系统时钟有4个时钟源可供选择&#xff1a; 内部高精度IRC内部32KHzIRC&#xff08;精度较低&#xff09;外部晶振内部PLL输出时钟 主要关心的是两个指标&#xff1a;SYSclk和HSCLK SYSclk是系统的时钟&#xff0c;决定了指令执行速度…

Android 深入系统完全讲解(三)

系统调用 操作系统提供了一些方法&#xff0c;让用户层可以调用&#xff0c;而为了安全起见&#xff0c;这些方法调用&#xff0c;都是在内核空间。于是&#xff0c;用户调用的时候&#xff0c;就会有个动作&#xff0c;叫做陷入内核。 当用户调用系统方法的时候&#xff0c;系…

【k8s-device plugin】如何编写 k8s device plugin

参考 Device Plugin 入门笔记&#xff08;一&#xff09; Device Plugin 入门笔记&#xff08;二&#xff09; 从零开始入门 K8s&#xff1a;GPU 管理和 Device Plugin 工作机制 Kubernetes开发知识–device-plugin的实现 https://github.com/oceanweave/cola-device-plugi…

基于springboot的智慧物业管理系统的设计与实现(前后端分离)

项目描述 临近学期结束&#xff0c;还是毕业设计&#xff0c;你还在做java程序网络编程&#xff0c;期末作业&#xff0c;老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下&#xff0c;你想解决的问…