vue jQuery 混用实现 点击日历展示list

html 复制代码
 <div class="ibox-content " style="margin-left:720px;width:410px;height: 1030px;margin-top: -1030px" id="app">
            <div>
                <div class="ibox-content center-block">
                    <div id="date"></div>
                </div>
                <div class="ibox-content center-block">
                    <div id="remark" style="border-width: 0px 0;height:20px;"></div>
                </div>
            </div>
            <div>
                <template v-if="sd>0">
                    <div>{{time}} <span style="margin-left: 230px"><a style="color: #1684fc" onclick="showTimeMore()"> 查看更多>></a></span>
                    </div>
                </template>
                <template v-if="sd==0">
                    <div align="center" style="font-size: larger;font-weight: bold">该警员暂无日程</div>
                </template>
                <div class="well toolong" v-for="(item, index) in list" v-if="index<8" style="margin-top: 10px;width: 350px" :title="item.columns.title+'   '+20+item.columns.time_start+'   '+20+item.columns.time_end">
                    <i class="fa fa-flag" aria-hidden="true" style="color: #e99d42"></i>
                    {{item.columns.title}}
                    <span
                        style="margin-left: 10px">20{{item.columns.time_start|dateFmt('YYYY-MM-DD')}}</span><span
                        style="margin-left: 10px">20{{item.columns.time_end|dateFmt('YYYY-MM-DD')}}</span>
                </div>
            </div>
        </div>
javascript 复制代码
<!--日历日程-->
<script th:inline="javascript">
    var vue = new Vue({
        el: '#app',
        data: {
            key: "aa",
            list: '',
            time: new Date().format("yyyy-MM-dd"),
            sd: 0
        }

    })
    $('<div style="width:100 %;"></div>').datetimepicker({
        language: 'zh-cn',  //设置语言类型为中文,默认英文。需导入对应css
        format: 'yyyy-MM-dd',
        fontAwesome: true,
        minView: 2,
        viewSelect: 2,
        initialDate: new Date().format("yyyy-MM-dd"), // 设置日期
    }).prependTo("#date");

    function reload() {
        $.get(ctx + "qjep/personalHomepage/scheduleList/" + vue.time, function (response) {
            vue.list = response.data
            if (response.data.length > 0) {
                vue.sd += 1
            } else {
                vue.sd = 0
            }
        })
    }

    function showTimeMore() {
        var url = prefix + "/showtimemore/" + vue.time;
        $.modal.openCancel("日程", url);
    }

    reload()

    $("#date").on('changeDate', function (ev) {
        vue.time = ev.date.format("yyyy-MM-dd")
        reload()
    })

</script>
java 复制代码
   @RequestMapping("/scheduleList/{time}")
    @ResponseBody
    public AjaxResult scheduleList(@PathVariable("time") String time) {
        System.out.println(time);
        List<Record> scheduleList = qjepPersonalHomepageService.scheduleList(getSysUser().getUserId(), time);
        return AjaxResult.success(scheduleList);

    }
相关推荐
清风细雨_林木木1 小时前
Vue开发网站会有“#”原因是前端路由使用了 Hash 模式
前端·vue.js·哈希算法
局外人LZ2 小时前
前端项目搭建集锦:vite、vue、react、antd、vant、ts、sass、eslint、prettier、浏览器扩展,开箱即用,附带项目搭建教程
前端·vue.js·react.js
宝拉不想努力了2 小时前
vue element使用el-table时,切换tab,table表格列项发生错位问题
前端·vue.js·elementui
神仙别闹3 小时前
基于VUE+Node.JS实现(Web)学生组队网站
前端·vue.js·node.js
HuaHua的世界5 小时前
说说 Vue 中 CSS scoped 的原理?
css·vue.js
H5开发新纪元6 小时前
Vue 项目中 Loading 状态管理及页面切换 Bug 分析
前端·vue.js
icefiresong248 小时前
如何让 Vue 组件自动清理 EventBus 监听器?告别内存泄漏!
vue.js
tjh000110 小时前
vue3+TS 手动实现表格滚动
前端·javascript·vue.js
章若楠圈外男友10 小时前
修改了Element UI中组件的样式,打包后样式丢失
前端·vue.js
86Eric11 小时前
Vue 中 使用 Mixins 解决 多页面共用相同组件的相关问题
前端·javascript·vue.js·mixins·公用组件