Cron 选择器

news2024/11/17 23:25:39

在这里插入图片描述

// 定义一个名为 cron 的新组件
Vue.component('cron', {
    name: 'cron',
    props: ['data'],
    data() {
        return {
            second: {
                cronEvery: '',
                incrementStart: '3',
                incrementIncrement: '5',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
            },
            minute: {
                cronEvery: '',
                incrementStart: '3',
                incrementIncrement: '5',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
            },
            hour: {
                cronEvery: '',
                incrementStart: '3',
                incrementIncrement: '5',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
            },
            day: {
                cronEvery: '',
                incrementStart: '1',
                incrementIncrement: '1',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
                cronLastSpecificDomDay: 1,
                cronDaysBeforeEomMinus: '',
                cronDaysNearestWeekday: '',
            },
            week: {
                cronEvery: '',
                incrementStart: '1',
                incrementIncrement: '1',
                specificSpecific: [],
                cronNthDayDay: 1,
                cronNthDayNth: '1',
            },
            month: {
                cronEvery: '',
                incrementStart: '3',
                incrementIncrement: '5',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
            },
            year: {
                cronEvery: '',
                incrementStart: '2017',
                incrementIncrement: '1',
                rangeStart: '',
                rangeEnd: '',
                specificSpecific: [],
            },
            output: {
                second: '',
                minute: '',
                hour: '',
                day: '',
                month: '',
                Week: '',
                year: '',
            }
        }
    },
    watch: {
        data() {
            this.rest(this.$data);
        }
    },
    computed: {
        text() {
            return {
                Seconds: {
                    name: "秒",
                    every: "每一秒钟",
                    interval: ["每隔", "秒执行 从", "秒开始"],
                    specific: "具体秒数(可多选)",
                    cycle: ["周期从", "到", "秒"]
                },
                Minutes: {
                    name: "分",
                    every: "每一分钟",
                    interval: ["每隔", "分执行 从", "分开始"],
                    specific: "具体分钟数(可多选)",
                    cycle: ["周期从", "到", "分"]
                },
                Hours: {
                    name: "时",
                    every: "每一小时",
                    interval: ["每隔", "小时执行 从", "小时开始"],
                    specific: "具体小时数(可多选)",
                    cycle: ["周期从", "到", "小时"]
                },
                Day: {
                    name: "天",
                    every: "每一天",
                    intervalWeek: ["每隔", "周执行 从", "开始"],
                    intervalDay: ["每隔", "天执行 从", "天开始"],
                    specificWeek: "具体星期几(可多选)",
                    specificDay: "具体天数(可多选)",
                    lastDay: "在这个月的最后一天",
                    lastWeekday: "在这个月的最后一个工作日",
                    lastWeek: ["在这个月的最后一个"],
                    beforeEndMonth: ["在本月底前", "天"],
                    nearestWeekday: ["最近的工作日(周一至周五)至本月", "日"],
                    someWeekday: ["在这个月的第", "个"]
                },
                Week: ["天", "一", "二", "三", "四", "五", "六"].map(function (e) {
                    return "星期" + e
                }),
                Month: {
                    name: "月",
                    every: "每一月",
                    interval: ["每隔", "月执行 从", "月开始"],
                    specific: "具体月数(可多选)",
                    cycle: ["从", "到", "月之间的每个月"]
                },
                Year: {
                    name: "年",
                    every: "每一年",
                    interval: ["每隔", "年执行 从", "年开始"],
                    specific: "具体年份(可多选)",
                    cycle: ["从", "到", "年之间的每一年"]
                },
                Save: "保存",
                Close: "关闭"
            }
        },
        secondsText() {
            let seconds = '';
            let cronEvery = this.second.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    seconds = '*';
                    break;
                case '2':
                    seconds = this.second.incrementStart + '/' + this.second.incrementIncrement;
                    break;
                case '3':
                    this.second.specificSpecific.map(val => {
                        seconds += val + ','
                    });
                    seconds = seconds.slice(0, -1);
                    break;
                case '4':
                    seconds = this.second.rangeStart + '-' + this.second.rangeEnd;
                    break;
            }
            return seconds;
        },
        minutesText() {
            let minutes = '';
            let cronEvery = this.minute.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    minutes = '*';
                    break;
                case '2':
                    minutes = this.minute.incrementStart + '/' + this.minute.incrementIncrement;
                    break;
                case '3':
                    this.minute.specificSpecific.map(val => {
                        minutes += val + ','
                    });
                    minutes = minutes.slice(0, -1);
                    break;
                case '4':
                    minutes = this.minute.rangeStart + '-' + this.minute.rangeEnd;
                    break;
            }
            return minutes;
        },
        hoursText() {
            let hours = '';
            let cronEvery = this.hour.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    hours = '*';
                    break;
                case '2':
                    hours = this.hour.incrementStart + '/' + this.hour.incrementIncrement;
                    break;
                case '3':
                    this.hour.specificSpecific.map(val => {
                        hours += val + ','
                    });
                    hours = hours.slice(0, -1);
                    break;
                case '4':
                    hours = this.hour.rangeStart + '-' + this.hour.rangeEnd;
                    break;
            }
            return hours;
        },
        daysText() {
            let days = '';
            let cronEvery = this.day.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    break;
                case '2':
                case '4':
                case '11':
                    days = '?';
                    break;
                case '3':
                    days = this.day.incrementStart + '/' + this.day.incrementIncrement;
                    break;
                case '5':
                    this.day.specificSpecific.map(val => {
                        days += val + ','
                    });
                    days = days.slice(0, -1);
                    break;
                case '6':
                    days = "L";
                    break;
                case '7':
                    days = "LW";
                    break;
                case '8':
                    days = this.day.cronLastSpecificDomDay + 'L';
                    break;
                case '9':
                    days = 'L-' + this.day.cronDaysBeforeEomMinus;
                    break;
                case '10':
                    days = this.day.cronDaysNearestWeekday + "W";
                    break
            }
            return days;
        },
        weeksText() {
            let weeks = '';
            let cronEvery = this.day.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                case '3':
                case '5':
                    weeks = '?';
                    break;
                case '2':
                    weeks = this.week.incrementStart + '/' + this.week.incrementIncrement;
                    break;
                case '4':
                    this.week.specificSpecific.map(val => {
                        weeks += val + ','
                    });
                    weeks = weeks.slice(0, -1);
                    break;
                case '6':
                case '7':
                case '8':
                case '9':
                case '10':
                    weeks = "?";
                    break;
                case '11':
                    weeks = this.week.cronNthDayDay + "#" + this.week.cronNthDayNth;
                    break;
            }
            return weeks;
        },
        monthsText() {
            let months = '';
            let cronEvery = this.month.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    months = '*';
                    break;
                case '2':
                    months = this.month.incrementStart + '/' + this.month.incrementIncrement;
                    break;
                case '3':
                    this.month.specificSpecific.map(val => {
                        months += val + ','
                    });
                    months = months.slice(0, -1);
                    break;
                case '4':
                    months = this.month.rangeStart + '-' + this.month.rangeEnd;
                    break;
            }
            return months;
        },
        yearsText() {
            let years = '';
            let cronEvery = this.year.cronEvery;
            switch (cronEvery.toString()) {
                case '1':
                    years = '*';
                    break;
                case '2':
                    years = this.year.incrementStart + '/' + this.year.incrementIncrement;
                    break;
                case '3':
                    this.year.specificSpecific.map(val => {
                        years += val + ','
                    });
                    years = years.slice(0, -1);
                    break;
                case '4':
                    years = this.year.rangeStart + '-' + this.year.rangeEnd;
                    break;
            }
            return years;
        },
        cron() {
            return `${this.secondsText || '0'} ${this.minutesText || '0'} ${this.hoursText || '*'} ${this.daysText || '*'} ${this.monthsText || '*'} ${this.weeksText || '?'}`
        },
    },
    methods: {
        getValue() {
            return this.cron;
        }
        ,
        change() {
            this.$emit('change', this.cron);
            // this.close();
        }
        ,
        // close() {
        //     this.$emit('close')
        // }
        // ,
        rest(data) {
            for (let i in data) {
                if (data[i] instanceof Object) {
                    this.rest(data[i])
                } else {
                    switch (typeof data[i]) {
                        case 'object':
                            data[i] = [];
                            break;
                        case 'string':
                            data[i] = '';
                            break;
                    }
                }
            }
        }
    }
    ,
    watch:{
        cron(){
            this.change();
        }
    },
    mounted() {
        this.change();
    }
    ,
    template: `
    <div  >
        <el-tabs type="border-card">
<!--            <el-tab-pane>-->
<!--                <span slot="label"><i class="el-icon-date"></i> {{text.Seconds.name}}</span>-->
<!--                <div class="tabBody">-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="second.cronEvery" label="1">{{text.Seconds.every}}</el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="second.cronEvery" label="2">{{text.Seconds.interval[0]}}-->
<!--                            <el-input-number size="small" v-model="second.incrementIncrement" :min="1" :max="60"></el-input-number>-->
<!--                            {{text.Seconds.interval[1]||''}}-->
<!--                            <el-input-number size="small" v-model="second.incrementStart" :min="0" :max="59"></el-input-number>-->
<!--                            {{text.Seconds.interval[2]||''}}-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio class="long" v-model="second.cronEvery" label="3">{{text.Seconds.specific}}-->
<!--                            <el-select size="small" multiple v-model="second.specificSpecific">-->
<!--                                <el-option v-for="val in 60"  :value="val-1">{{val-1}}</el-option>-->
<!--                            </el-select>-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="second.cronEvery" label="4">{{text.Seconds.cycle[0]}}-->
<!--                            <el-input-number size="small" v-model="second.rangeStart" :min="1" :max="60"></el-input-number>-->
<!--                            {{text.Seconds.cycle[1]||''}}-->
<!--                            <el-input-number size="small" v-model="second.rangeEnd" :min="0" :max="59"></el-input-number>-->
<!--                            {{text.Seconds.cycle[2]||''}}-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                </div>-->
<!--            </el-tab-pane>-->
<!--            <el-tab-pane>-->
<!--                <span slot="label"><i class="el-icon-date"></i> {{text.Minutes.name}}</span>-->
<!--                <div class="tabBody">-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="minute.cronEvery" label="1">{{text.Minutes.every}}</el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="minute.cronEvery" label="2">{{text.Minutes.interval[0]}}-->
<!--                            <el-input-number size="small" v-model="minute.incrementIncrement" :min="1" :max="60"></el-input-number>-->
<!--                            {{text.Minutes.interval[1]}}-->
<!--                            <el-input-number size="small" v-model="minute.incrementStart" :min="0" :max="59"></el-input-number>-->
<!--                            {{text.Minutes.interval[2]||''}}-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio class="long" v-model="minute.cronEvery" label="3">{{text.Minutes.specific}}-->
<!--                            <el-select size="small" multiple v-model="minute.specificSpecific">-->
<!--                                <el-option v-for="val in 60"  :value="val-1">{{val-1}}</el-option>-->
<!--                            </el-select>-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="minute.cronEvery" label="4">{{text.Minutes.cycle[0]}}-->
<!--                            <el-input-number size="small" v-model="minute.rangeStart" :min="1" :max="60"></el-input-number>-->
<!--                            {{text.Minutes.cycle[1]}}-->
<!--                            <el-input-number size="small" v-model="minute.rangeEnd" :min="0" :max="59"></el-input-number>-->
<!--                            {{text.Minutes.cycle[2]}}-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                </div>-->
<!--            </el-tab-pane>-->
            <el-tab-pane>
                <span slot="label"><i class="el-icon-date"></i> {{text.Hours.name}}</span>
                <div class="tabBody">
                    <el-row>
                        <el-radio v-model="hour.cronEvery" label="1">{{text.Hours.every}}</el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="hour.cronEvery" label="2">{{text.Hours.interval[0]}}
                            <el-input-number size="small" v-model="hour.incrementIncrement" :min="0" :max="23"></el-input-number>
                            {{text.Hours.interval[1]}}
                            <el-input-number size="small" v-model="hour.incrementStart" :min="0" :max="23"></el-input-number>
                            {{text.Hours.interval[2]}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio class="long" v-model="hour.cronEvery" label="3">{{text.Hours.specific}}
                            <el-select size="small" multiple v-model="hour.specificSpecific">
                                <el-option v-for="val in 24"  :value="val-1">{{val-1}}</el-option>
                            </el-select>
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="hour.cronEvery" label="4">{{text.Hours.cycle[0]}}
                            <el-input-number size="small" v-model="hour.rangeStart" :min="0" :max="23"></el-input-number>
                            {{text.Hours.cycle[1]}}
                            <el-input-number size="small" v-model="hour.rangeEnd" :min="0" :max="23"></el-input-number>
                            {{text.Hours.cycle[2]}}
                        </el-radio>
                    </el-row>
                </div>
            </el-tab-pane>
            <el-tab-pane>
                <span slot="label"><i class="el-icon-date"></i> {{text.Day.name}}</span>
                <div class="tabBody">
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="1">{{text.Day.every}}</el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="2">{{text.Day.intervalWeek[0]}}
                            <el-input-number size="small" v-model="week.incrementIncrement" :min="1" :max="7"></el-input-number>
                            {{text.Day.intervalWeek[1]}}
                            <el-select size="small" v-model="week.incrementStart">
                                <el-option v-for="val in 7"  :label="text.Week[val-1]" :value="val"></el-option>
                            </el-select>
                            {{text.Day.intervalWeek[2]}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="3">{{text.Day.intervalDay[0]}}
                            <el-input-number size="small" v-model="day.incrementIncrement" :min="1" :max="31"></el-input-number>
                            {{text.Day.intervalDay[1]}}
                            <el-input-number size="small" v-model="day.incrementStart" :min="1" :max="31"></el-input-number>
                            {{text.Day.intervalDay[2]}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio class="long" v-model="day.cronEvery" label="4">{{text.Day.specificWeek}}
                            <el-select size="small" multiple v-model="week.specificSpecific">
                                <el-option v-for="val in 7"
                                           :label="text.Week[val-1]"
                                           :value="['SUN','MON','TUE','WED','THU','FRI','SAT'][val-1]"
                                ></el-option>
                            </el-select>
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio class="long" v-model="day.cronEvery" label="5">{{text.Day.specificDay}}
                            <el-select size="small" multiple v-model="day.specificSpecific">
                                <el-option v-for="val in 31"  :value="val">{{val}}</el-option>
                            </el-select>
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="6">{{text.Day.lastDay}}</el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="7">{{text.Day.lastWeekday}}</el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="8">{{text.Day.lastWeek[0]}}
                            <el-select size="small" v-model="day.cronLastSpecificDomDay">
                                <el-option v-for="val in 7"  :label="text.Week[val-1]" :value="val"></el-option>
                            </el-select>
                            {{text.Day.lastWeek[1]||''}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="9">
                            <el-input-number size="small" v-model="day.cronDaysBeforeEomMinus" :min="1" :max="31"></el-input-number>
                            {{text.Day.beforeEndMonth[0]}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="10">{{text.Day.nearestWeekday[0]}}
                            <el-input-number size="small" v-model="day.cronDaysNearestWeekday" :min="1" :max="31"></el-input-number>
                            {{text.Day.nearestWeekday[1]}}
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="day.cronEvery" label="11">{{text.Day.someWeekday[0]}}
                            <el-input-number size="small" v-model="week.cronNthDayNth" :min="1" :max="5"></el-input-number>
                            <el-select size="small" v-model="week.cronNthDayDay">
                                <el-option v-for="val in 7" :label="text.Week[val-1]" :value="val"></el-option>
                            </el-select>
                            {{text.Day.someWeekday[1]}}
                        </el-radio>
                    </el-row>
                </div>
            </el-tab-pane>
            <el-tab-pane>
                <span slot="label"><i class="el-icon-date"></i> {{text.Month.name}}</span>
                <div class="tabBody">
                    <el-row>
                        <el-radio v-model="month.cronEvery" label="1">{{text.Month.every}}</el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="month.cronEvery" label="2">{{text.Month.interval[0]}}
                            <el-input-number size="small" v-model="month.incrementIncrement" :min="0" :max="12"></el-input-number>
                            {{text.Month.interval[1]}}
                            <el-input-number size="small" v-model="month.incrementStart" :min="0" :max="12"></el-input-number>
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio class="long" v-model="month.cronEvery" label="3">{{text.Month.specific}}
                            <el-select size="small" multiple v-model="month.specificSpecific">
                                <el-option v-for="val in 12"  :label="val" :value="val"></el-option>
                            </el-select>
                        </el-radio>
                    </el-row>
                    <el-row>
                        <el-radio v-model="month.cronEvery" label="4">{{text.Month.cycle[0]}}
                            <el-input-number size="small" v-model="month.rangeStart" :min="1" :max="12"></el-input-number>
                            {{text.Month.cycle[1]}}
                            <el-input-number size="small" v-model="month.rangeEnd" :min="1" :max="12"></el-input-number>
                        </el-radio>
                    </el-row>
                </div>
            </el-tab-pane>
<!--            <el-tab-pane>-->
<!--                <span slot="label"><i class="el-icon-date"></i> {{text.Year.name}}</span>-->
<!--                <div class="tabBody">-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="year.cronEvery" label="1">{{text.Year.every}}</el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="year.cronEvery" label="2">{{text.Year.interval[0]}}-->
<!--                            <el-input-number size="small" v-model="year.incrementIncrement" :min="1" :max="99"></el-input-number>-->
<!--                            {{text.Year.interval[1]}}-->
<!--                            <el-input-number size="small" v-model="year.incrementStart" :min="2018" :max="2118"></el-input-number>-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio class="long" v-model="year.cronEvery" label="3">{{text.Year.specific}}-->
<!--                            <el-select size="small" filterable multiple v-model="year.specificSpecific">-->
<!--                                <el-option v-for="val in 100" :label="2017+val" :value="2017+val"></el-option>-->
<!--                            </el-select>-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                    <el-row>-->
<!--                        <el-radio v-model="year.cronEvery" label="4">{{text.Year.cycle[0]}}-->
<!--                            <el-input-number size="small" v-model="year.rangeStart"  :min="2018" :max="2118"></el-input-number>-->
<!--                            {{text.Year.cycle[1]}}-->
<!--                            <el-input-number size="small" v-model="year.rangeEnd"  :min="2018" :max="2118"></el-input-number>-->
<!--                        </el-radio>-->
<!--                    </el-row>-->
<!--                </div>-->
<!--            </el-tab-pane>-->
        </el-tabs>
        <div class="bottom">
            <div class="value">表达式:{{this.cron}}</div>
<!--            <ResultDisplay style="border: 1px solid #DCDFE6;padding:15px;margin-bottom: 10px;margin-top: 10px;" :ex="this.cron"></ResultDisplay>-->
<!--            <el-button type="primary" @click="change">{{text.Save}}</el-button>-->
<!--            <el-button type="primary" @click="close">{{text.Close}}</el-button>-->
        </div>
    </div>
    `,
    // components: {
    //     ResultDisplay
    // }
})
    /**
     * @Description 推算cron最近五次运行时间
     * @Param cron
     * @Return com.tianqiauto.base.model.AjaxResult
     * @Author wjx
     * @Date 2023/4/18 16:36
     **/
    @GetMapping("/tuiSuanCron")
    public AjaxResult tuiSuanCron(String cron){
        if (!CronSequenceGenerator.isValidExpression(cron)){
            return AjaxResult.getInstance().setSuccessChain(false).setMessageChain("无效表达式:" + cron);
        }
        ArrayList<String> strings = null;
        try {
            CronSequenceGenerator cronSequenceGenerator = new CronSequenceGenerator(cron);
            Date next = new Date();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            strings = new ArrayList<>();
            for (int i = 0; i < 5; i++) {
                next = cronSequenceGenerator.next(next);
                if (next != null){
                    String date = simpleDateFormat.format(next);
                    strings.add(date);
                }else {
                    break;
                }
            }
        } catch (Exception e) {
            return AjaxResult.getInstance().setSuccessChain(false).setMessageChain("表达式解析发生错误!");
        }
        return AjaxResult.getInstance().setSuccessChain(true).setDataChain(strings);
    }

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

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

相关文章

[Tools: tiny-cuda-nn] Linux安装

official repo: https://github.com/NVlabs/tiny-cuda-nn 该包可以显著提高NeRF训练速度&#xff0c;是Instant-NGP、Threestudio和NeRFstudio等框架中&#xff0c;必须使用的。 1. 命令行安装 最便捷的安装方式&#xff0c;如果安装失败考虑本地编译。 pip install ninja g…

QT第一讲

思维导图 手动实现登录框 要求&#xff1a; 1、登录窗口更改标题、图标 2、设置固定尺寸、并给定一定的透明度 widget.h #ifndef WIDGET_H #define WIDGET_H#include <QWidget>#include<QWidget> #include<QDebug> //信息调试类&#xff0c;用于打印输出…

谱瑞PS186芯片DP1.4转HDMI2.0主动式4K转换线DSC支持10bit色深HDR

PS186 是 DisplayPort ™ v1.4a 到 HDMI ™ 2.0b 视频接口转换器&#xff0c;非常适合电缆适配器、扩展坞、监视器、电视接收器和其他需要视频协议转换的应用。输入是一个 DP v1.4a 兼容的上行端口&#xff0c;它接受音频和显示数据&#xff0c;输出是一个 HDMI 2.0b 兼容的下行…

【C++】模板(下)

文章目录 一、typename的使用二、非类型模板参数三、模板的特化1.概念2.函数的模板特化3.类的模板特化① 全特化② 偏特化 一、typename的使用 前面我们在使用模板参数的时候可以使用class&#xff0c;也可以使用typename定义模板参数&#xff0c;现在typename有了新的作用 tem…

jQuery 对象转换与选择器

目录 1.js与jQuery对象之间转换 2.jQuery选择器 2.1 基本选择器 2.2层级选择器 2.3 基本过滤选择器 1.js与jQuery对象之间转换 js的DOM对象转换成jQuery对象&#xff0c;语法&#xff1a;$(js的DOM对象) var jsDomEle document.getElementById("myDiv"); //js的…

搭建禅道环境作为练习UI和接口自动化测试对象

搭建禅道环境作为练习UI和接口自动化测试对象 1 目的2 禅道下载3 禅道安装4 禅道运行5 接口查看6 验证接口测试7 验证UI测试 1 目的 做UI和接口自动化练习时&#xff0c;有时候找不到合适的对象&#xff0c;我们可使用禅道来联系&#xff1b;因为禅道有开源版&#xff0c;可以…

three.js-解决外部模型太暗的问题

先看效果 优化前 优化后的效果 在网上找了好久&#xff0c;好多方法都过时了&#xff0c;还有调整自发光都不行&#xff0c;后来又调金属度的&#xff0c;试了下很ok, child.material.metalness 0.58;&#xff0c;完整例子看下边。 解决方案 调整模型的金属度 loader.lo…

git 提示 不能合并

今天A分支合并B分支&#xff0c;提示“不能合并” 最终发现&#xff0c;是另一个分支的版本落后导致&#xff0c;但是git并未提示出来 有遇到这种问题可以先检查下版本

go-zerogo web集成JWT和cobra命令行工具实战

前言 上一篇&#xff1a;从零开始基于go-zero的go web项目实战-01项目初始化 从零开始基于go-zero搭建go web项目实战-02集成JWT和cobra命令行工具 源码仓库地址 源码 https://gitee.com/li_zheng/treasure-box JWT JWT&#xff08;JSON Web Token&#xff09;是一种开放标…

一起学SF框架系列5.8-spring-Beans-注解bean解析4-bean解析

前面三节主要讲了如何加载注解Bean的BeanDefinition&#xff0c;执行环节是在DefaultBeanDefinitionDocumentReader.parseBeanDefinitions中用BeanDefinitionParserDelegate.parseCustomElement(ele)加载的&#xff0c;实际上没对注解真正进行解析。本节主要讲述注解bean如何被…

性能测试过程有哪些?都要做什么

13.1 性能测试过程概述 13.2 性能测试设计 需要关注的问题&#xff1a;事务需求、技术需求、系统要求、团队要求 分析从五个方面分析&#xff1a;需求调研、事务模型、场景模型、数据设计、环境设计 13.2.1 需求调研 ① 测试系统预研&#xff1a;系统相关知识、系统目的、…

MinIO在Linux环境下单机安装部署

1、MinIO是什么&#xff1f; MinIO 是一个基于 Go语言实现的高性能对象存储。它采用AGPL&#xff08;GNU Affero General Public License&#xff09; 开源协议并兼容 S3 协议。 官网地址&#xff1a;https://min.io/ github地址&#xff1a;https://github.com/minio/minio …

C 程序 运算符

文章目录 1、算术运算符2、关系运算符3、逻辑运算符4、位运算符5、赋值运算符6、杂项运算符 ↦ sizeof & 三元7、运算符优先级 1、算术运算符 #include <stdio.h>int main() {int a 21;int b 10;int c ;c a b;printf("Line 1 - c 的值是 %d\n", c );c …

Jenkins从配置到实战(一) - 实现C/C++项目自动化构建

前言 本文章主要介绍了&#xff0c;如何去安装和部署Jenkins&#xff0c;并实现自动拉取项目代码&#xff0c;自动化编译流程。 网站 官网中文网站 下载安装 可以下载这个 安装jenkins前先安装java yum search java|grep jdkyum install java-1.8.0-openjdk 安装jenkins j…

我是如何做性能测试 - 文档收集并深入学习

目录 前言&#xff1a; 1. 架构设计说明书 2. 需求说明文档/需求规格说明书 3. 接口设计文档 4. 接口详细设计文档 5. 数据库设计文档 前言&#xff1a; 性能测试是软件开发过程中的一个重要方面&#xff0c;它旨在评估软件在不同负载和压力条件下的性能表现。性能测试需…

Android10 调用相机 ( 涉及读写文件 ) 闪退

背景 按照 << 第一行Android代码>>写了一下调用摄像头和相册的案例, 页面是下面截图的样子, 拍照或者从相册选择图片后, 在下方的 imageView 里将图片显示出来. 点击 “从相册选择照片” 按钮的时候功能是正常的, 点击 “拍照” 按钮的时候会闪退并报告相机异常.…

Java训练三

一、数独 将1~9的数字放入一个3x3的数组中国&#xff0c;判断数组每行每列以及每个对角线的值相加是否都相同。 package haha; public class helloworld{public static void main(String[] args) {int arr[][] {{1,2,3},{4,5,6},{7,8,9}};//每行int arr1[]new int[3];for(int…

【uniapp学习之】uni-forms必填项校验

代码块 <uni-forms ref"baseForm" :modelValue"baseFormData" label-widthauto :rules"rules"><uni-forms-item label"企业名称" required name"principalName"><uni-easyinput v-model"baseFormData.…

数组中重复的数据(力扣)思维 JAVA

给你一个长度为 n 的整数数组 nums &#xff0c;其中 nums 的所有整数都在范围 [1, n] 内&#xff0c;且每个整数出现 一次 或 两次。 请你找出所有出现 两次 的整数&#xff0c;并以数组形式返回。 你必须设计并实现一个时间复杂度为 O(n) 且仅使用常量额外空间的算法解决此问…

QT实现用户登录注册功能

本文实例为大家分享了QT实现用户登录注册的具体代码&#xff0c;供大家参考&#xff0c;具体内容如下 1、login.h ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #ifndef LOGIN_H #define LOGIN_H #include <QWidget> namespace Ui { c…