瀏覽代碼

Merge branch 'eta1.7.8'

cxmo 11 月之前
父節點
當前提交
12d8e4b7bb

+ 81 - 0
src/api/modules/toolBoxApi.js

@@ -11,4 +11,85 @@ export const ToolBoxInterface = {
     getSheetDetail:(params)=>{
         return http.get('/meeting_probabilities/detail',params)
     }
+}
+
+//外汇日历表
+export const ForexCalendarInterface = {
+    /**
+     * 获取品种列表
+     * @param {*} params 
+     * @returns [{ChartPermissionId,ChartPermissionName }]
+     */
+    getPermissionList:(params)=>{
+        return http.get("/fe_calendar/permission/list",params)
+    },
+    /**
+     * 获取日期范围内事项列表
+     * @param {*} params 
+     * @param {Number} params.ChartPermissionId 品种ID
+     * @param {String} params.StartDate 起始时间
+     * @param {String} params.EndDate 终止时间
+     * @returns [{
+     *      Date:"2024-03-28",//事项日期
+     *      Matters:[],//事项详情
+     * }]
+     */
+    getCalendarEventList:(params)=>{
+        return http.get("/fe_calendar/matter/list?",params)
+    },
+    /**
+     * 获取指定日期事项列表
+     * @param {Object} params 
+     * @param {Number} params.ChartPermissionId 品种ID
+     * @param {String} params.MatterDate "2024-03-29" 指定日期
+     * @returns [{ //事项详情
+     *      "FeCalendarMatterId": 2, //事项ID
+            "ChartPermissionId": 3, //品种ID
+            "ChartPermissionName": "原油", //品种名称
+            "MatterDate": "2024-03-29", //事项日期
+            "Title": "指标B0002", //事项标题
+            "MatterType": 2, //事项类型:1-自定义事项;2-基础指标;3-预测指标
+            "EdbInfoId": 104507, //指标ID
+            "EdbUniqueCode": "c7959050a204e7479c392d11d1b3b88e", //指标唯一编码
+            "EdbCode": "C2403297186", //指标编码
+            "FontColor": "#000fff", //字体颜色
+            "FillingColor": "#f28500", /填充颜色
+            "FontBold": 1, //字体加粗:0-否;1-是
+            "Sort": 1 //排序
+     * }]
+     */
+    getDailyEventList:(params)=>{
+        return http.get("/fe_calendar/matter/detail",params)
+    },
+    /**
+     * 保存指定日期的事项
+     * @param {Object} params //品种ID
+     * @param {Number} params.ChartPermissionId //事项日期
+     * @param {String} params.MatterDate //事项列表
+     * @param {Object[]} params.Matters
+     * @param {Number} params.Matters.FeCalendarMatterId //事项ID,大于0为更新
+     * @param {String} params.Matters.Title //事项标题
+     * @param {Number} params.Matters.MatterType //事项类型:1-自定义事项;2-基础指标;3-预测指标
+     * @param {Number} params.Matters.EdbInfoId //指标ID,类型为2/3时必填
+     * @param {String} params.Matters.EdbUniqueCode //指标唯一编码,类型为2/3时必填
+     * @param {String} params.Matters.EdbCode //指标编码,类型为2/3时必填
+     * @param {String} params.Matters.FontColor //字体颜色
+     * @param {String} params.Matters.FillingColor //填充颜色
+     * @param {Number} params.Matters.FontBold //字体加粗:0-否;1-是
+     * @param {Number} params.Matters.Sort //排序
+     * @returns 
+     */
+    saveDailyEvents:(params)=>{
+        return http.post("/fe_calendar/matter/save",params)
+    },
+    /**
+     * 搜索指标/预测指标库
+     * @param {*} params 
+     * @param {String} params.KeyWord
+     * @param {Number} params.CurrentIndex
+     * @returns 
+     */
+    searchEdbInfo:(params)=>{
+        return http.get("/datamanage/edb_info/filter_by_es/all",params)
+    }
 }

二進制
src/assets/img/icons/edb-icon.png


+ 3 - 1
src/lang/modules/ToolBox/IndexEn.js

@@ -1,6 +1,7 @@
 import { AIQuestionEn } from "./AIQuestion";
 import { CommodityPriceChartEn } from "./CommodityPriceChart";
 import { PositionAnalysisEn } from "./PositionAnalysis";
+import { ForexCalendarEn } from "./calendar/ForexCalendar";
 
 
 export default {
@@ -8,6 +9,7 @@ export default {
     ToolBox: {
         AIQuestion:AIQuestionEn,
         CommodityPriceChart:CommodityPriceChartEn,
-        PositionAnalysis:PositionAnalysisEn
+        PositionAnalysis:PositionAnalysisEn,
+        ForexCalendar:ForexCalendarEn,
     },
 };

+ 3 - 1
src/lang/modules/ToolBox/IndexZh.js

@@ -1,6 +1,7 @@
 import { AIQuestionZh } from "./AIQuestion";
 import { CommodityPriceChartZh } from "./CommodityPriceChart";
 import { PositionAnalysisZh } from "./PositionAnalysis";
+import { ForexCalendarZh } from "./calendar/ForexCalendar";
 
 
 export default {
@@ -8,6 +9,7 @@ export default {
     ToolBox: {
         AIQuestion:AIQuestionZh,
         CommodityPriceChart:CommodityPriceChartZh,
-        PositionAnalysis:PositionAnalysisZh
+        PositionAnalysis:PositionAnalysisZh,
+        ForexCalendar:ForexCalendarZh,
     },
 };

+ 41 - 0
src/lang/modules/ToolBox/calendar/ForexCalendar.js

@@ -0,0 +1,41 @@
+export const ForexCalendarEn={
+    header_title:'{month} {year} Calendar',
+    mark_date:'{month} {year}',
+    add_item:'Add Item',
+    select_date:'Select Date',
+    select_type:'Select Variety',
+    select_type_hint:'Select Variety First',
+    link_edb:'Linked Indicators',
+    link_item:'Custom Items',
+    edb_input:'Enter Index ID/Name',
+    item_input_limit:'Max 15 chars Please re-edit',
+    item_btn_text:'expand',
+    item_btn_text_pickup:'pick up',
+    item_input:'Enter Item Content',
+    link_hint:'Items linked to indicators default to their names, editable, max 15 chars per item.',
+    font_color:'Font Color',
+    fill_color:'Fill Color',
+    font_bold:'Bold',
+    save_success:'Save Successful'
+
+}
+export const ForexCalendarZh={
+    header_title:'{year}年{month}月日历表',
+    mark_date:'{year}年{month}月',
+    add_item:'添加事项',
+    select_date:'请选择日期',
+    select_type:'请选择品种',
+    select_type_hint:'请选择品种',
+    link_edb:'关联指标',
+    link_item:'自定义事项',
+    edb_input:'请输入指标ID/指标名称',
+    item_input:'请输入事项内容',
+    item_input_limit:'超出15个字,请重新编辑',
+    item_btn_text:'展开',
+    item_btn_text_pickup:'收起',
+    link_hint:'添加关联指标的事项默认以指标名称命名,可修改,每个事项最多15个字',
+    font_color:'字体颜色',
+    fill_color:'填充颜色',
+    font_bold:'加粗',
+    save_success:'保存成功'
+}

+ 64 - 0
src/lang/modules/ToolBox/calendar/commonLang.js

@@ -0,0 +1,64 @@
+export default{
+    Month:{//月份
+        1:{
+            en:'January',
+            enSort:'Jan.',
+            zh:'一月',
+        },
+        2:{
+            en:'February',
+            enSort:'Feb.',
+            zh:'二月',
+        },
+        3:{
+            en:'March',
+            enSort:'Mar.',
+            zh:'三月',
+        },
+        4:{
+            en:'April',
+            enSort:'Apr.',
+            zh:'四月',
+        },
+        5:{
+            en:'May',
+            enSort:'May.',
+            zh:'五月',
+        },
+        6:{
+            en:'June',
+            enSort:'Jun.',
+            zh:'六月',
+        },
+        7:{
+            en:'July',
+            enSort:'Jul.',
+            zh:'七月',
+        },
+        8:{
+            en:'August',
+            enSort:'Aug.',
+            zh:'八月',
+        },
+        9:{
+            en:'September',
+            enSort:'Sep.',
+            zh:'九月',
+        },
+        10:{
+            en:'October',
+            enSort:'Oct.',
+            zh:'十月',
+        },
+        11:{
+            en:'November',
+            enSort:'Nov.',
+            zh:'十一月',
+        },
+        12:{
+            en:'December',
+            enSort:'Dec.',
+            zh:'十二月',
+        },
+    }
+}

+ 5 - 0
src/routes/modules/chartRoutes.js

@@ -345,6 +345,11 @@ export default [
 					pathName: "商品价格曲线",
 				}
 			},
+			{
+				path:"forexCalendar",
+				name:"事件日历",
+				component:()=>import('@/views/toolBox_manage/ForexCalendar.vue')
+			},
 		]
 	}
 ]

+ 10 - 1
src/utils/buttonConfig.js

@@ -619,6 +619,14 @@ export const productPricePermission = {
     goodsPrice_priceLine_addMyChart:'goodsPrice:priceLine:addMyChart',
     goodsPrice_priceLine_share:'goodsPrice:priceLine:share',
 }
+/**
+ * --------------------------------------------------------------------------工具箱-----------------------------------------------------
+ */
+export const toolBoxPermission = {
+    forexCalendar_view:'forexCalendar:view',//查看日历
+    forexCalendar_save:'forexCalendar:save',//添加/编辑事项
+
+}
 /*
  * --------------------------------------------------------------------------系统设置------------------------------------------------
 */
@@ -753,7 +761,8 @@ const btnMap  = {
     outlinkConfigPermission,approveFlowPermission,
     approvePermission,
     outlinkConfigPermission,
-    chartThemePermission
+    chartThemePermission,
+    toolBoxPermission
 }
 
 /**

+ 227 - 0
src/views/toolBox_manage/ForexCalendar.vue

@@ -0,0 +1,227 @@
+<template>
+    <div class="forex-calendar-wrap">
+        <div class="calendar-header">
+            <div class="left-select">
+                <!-- 添加事项 -->
+                <el-button 
+                    v-permission="permissionBtn.toolBoxPermission.forexCalendar_save"
+                    type="primary" @click="dateClick">{{ $t('ToolBox.ForexCalendar.add_item') }}</el-button>
+                <!-- 选择日期 -->
+                <el-date-picker type="month" :placeholder="$t('ToolBox.ForexCalendar.select_date')" 
+                    :clearable="false"
+                    v-model="monthValue"
+                    value-format="yyyy-MM"
+                    :disabled="!permissionValue"
+                    style="margin-left: 30px;"
+                    @change="changeMonth"/>
+            </div>
+            <div class="center-title"> <!-- 当前日期 -->
+                {{ $t('ToolBox.ForexCalendar.header_title',{
+                    //中文版传字符,英文版传月份翻译
+                    month:$i18n.locale==='zh'?`${currentMonth}`:calendarTrans.Month[Number(currentMonth)||1].en,
+                    year:currentYear||'2024'}) 
+                }}</div>
+            <div class="right-select">
+
+                <el-cascader :options="permissonList" 
+                    ref="cascaderRef"
+                    :placeholder="$t('ToolBox.ForexCalendar.select_type')"
+                    v-model="permissionValue"
+                    :props="{
+                        children:'Children',
+                        expandTrigger:'hover',
+                        emitPath:false,
+                        value:'ChartPermissionId',
+                        label:'ChartPermissionName'
+                    }"
+                    style="min-width:300px;"
+                    @change="changePermission"
+                ></el-cascader>
+            </div>
+        </div>
+        <BaseCalendar
+            ref="baseCalendar"
+            :markText="{
+                date:`${$t('ToolBox.ForexCalendar.mark_date',{
+                    month:$i18n.locale==='zh'?`${currentMonth}`:calendarTrans.Month[Number(currentMonth)||1].en,
+                    year:currentYear||'2024'})
+                }`,
+                type:`${permissionName}`
+            }"
+            @dateClick="dateClick"
+            @eventClick="eventClick"
+        ></BaseCalendar>
+        <AddEventDialog
+            :isEventDialogShow="isEventDialogShow"
+            :choosedDay="choosedDay"
+            :choosedPermission="permissionValue"
+            @save="addEvents"
+            @close="isEventDialogShow=false"
+        />
+    </div>
+</template>
+
+<script>
+import BaseCalendar from './components/BaseCalendar.vue';
+import AddEventDialog from './components/AddEventDialog.vue';
+import calendarTrans from '@/lang/modules/ToolBox/calendar/commonLang';
+import {ForexCalendarInterface} from '@/api/modules/toolBoxApi';
+export default {
+    data() {
+        return {
+            monthValue:'',//选择的月份
+            permissionValue:'',//选择的品种Id
+            permissionName:'',//选择的品种Name
+            permissonList:[],//品种列表
+
+            calendarApi:null,//日历Api
+            calendarTrans:calendarTrans,//翻译方法
+
+            isEventDialogShow:false,//控制添加事项弹窗
+            eventInfo:null,
+            choosedDay:'',//选择的日期
+        };
+    },
+    computed:{
+        currentYear(){//选择的年份
+            const date = this.monthValue||new Date()
+            return this.$moment(date).format('YYYY')
+        },
+        currentMonth(){//选择的月份
+            const date = this.monthValue||new Date()
+            return this.$moment(date).format('MM')
+        }
+    },
+    methods: {
+        getPermissonList(){
+            ForexCalendarInterface.getPermissionList().then(res=>{
+                if(res.Ret!==200) return 
+                this.permissonList = res.Data||[]
+            })
+        },
+        changePermission(){
+            this.getPermissionName()
+            this.renderCalendar()
+        },
+        //获取选择品种的名称
+        getPermissionName(){
+            const node = this.$refs.cascaderRef.getCheckedNodes(true)[0]
+            this.permissionName = node.label
+        },
+        changeMonth(month){
+            const Month = month||new Date()
+            this.calendarApi.gotoDate(Month)
+            this.renderCalendar()
+        },
+        async renderCalendar(){
+            //获取当前日历的起始日期+终止日期,可能会跨月
+            const {activeStart,activeEnd} = this.calendarApi.view
+            const res = await ForexCalendarInterface.getCalendarEventList({
+                ChartPermissionId:Number(this.permissionValue),
+                StartDate:this.$moment(activeStart).format('YYYY-MM-DD'),
+                EndDate:this.$moment(activeEnd).subtract(1, 'days').format('YYYY-MM-DD'), //activeEnd到最后一天的24:00会被认为是第二天,所以取前一天
+            })
+            if(res.Ret!==200) return 
+            const allEventSource = this.calendarApi.getEventSources()||[]
+            //先清空所有eventSource,再添加
+            allEventSource.forEach(es=>es.remove())
+            //将日历表每天的事件作为一个eventSource
+            const eventList = (res.Data?res.Data:[]).map(dailyEvents=>{
+                const eventSource = { id:dailyEvents.Date,events:[]}
+                eventSource.events = dailyEvents.Matters.map(e=>{
+                    return {
+                        ...e,
+                        start:e.MatterDate,
+                        title:e.Title,
+                        textColor:e.FontColor||'#000',
+                        backgroundColor:e.FillingColor||'#fff',
+                        borderColor:e.FillingColor||'#fff',
+                    }
+                })
+                return eventSource
+            })
+            eventList.forEach(es=>{
+                this.calendarApi.addEventSource(es)
+            })
+        },
+        //点击单元格(非事项部分)
+        dateClick(info){
+            this.setEventInfo(info.dateStr)
+        },
+        //点击事项
+        eventClick(info){
+            this.setEventInfo(info.event.startStr)
+        },
+        //根据日期设置弹窗信息
+        setEventInfo(date){
+            if(!this.permissionBtn.isShowBtn('toolBoxPermission','forexCalendar_save')) return
+            if(!this.permissionValue) return this.$message.warning(this.$t('ToolBox.ForexCalendar.select_type_hint'))
+            this.choosedDay = date||''
+            this.isEventDialogShow = true
+        },
+        //添加事项(批量)
+        async addEvents({events,eventDay}){
+            //需要添加的事项
+            const eventSource = events.map((e,index)=>{
+                return {
+                    FeCalendarMatterId:e.FeCalendarMatterId||0,
+                    Title:e.title,
+                    MatterType:Number(e.MatterType),
+                    EdbInfoId:Number(e.EdbInfoId||''),
+                    EdbUniqueCode:e.EdbUniqueCode||'',
+                    EdbCode:e.EdbCode||'',
+                    FontBold:e.FontBold,
+                    FontColor:e.textColor,
+                    FillingColor:e.backgroundColor,
+                    Sort:index+1
+                }
+            })
+
+            //通过接口,添加该日的事件
+            const res = await ForexCalendarInterface.saveDailyEvents({
+                ChartPermissionId:Number(this.permissionValue),
+                MatterDate:eventDay,
+                Matters:eventSource
+            })
+            if(res.Ret!==200) return 
+
+            //重新加载日历
+            if(this.$moment(eventDay).format('MM')===this.currentMonth){
+                this.renderCalendar()
+            }else{
+                this.monthValue = this.$moment(eventDay).format('YYYY-MM')
+                this.changeMonth(this.monthValue)
+            }
+            
+            this.isEventDialogShow = false
+        },
+    },
+    components: { BaseCalendar , AddEventDialog },
+    mounted(){
+        this.monthValue = this.$moment(new Date()).format('YYYY-MM')
+        this.calendarApi = this.$refs.baseCalendar.$refs.fullCalendar.getApi()
+        this.getPermissonList()
+    }
+};
+</script>
+
+<style scoped lang="scss">
+.forex-calendar-wrap{
+    min-height: calc(100vh - 120px);
+    box-sizing: border-box;
+    padding:20px;
+    background-color: #fff;
+    display: flex;
+    flex-direction: column;
+    .calendar-header{
+        display: flex;
+        justify-content:space-between;
+        align-items: center;
+        margin-bottom: 20px;
+        .center-title{
+            font-size: 18px;
+            font-weight: bold;
+        }
+    }
+}
+</style>

+ 155 - 0
src/views/toolBox_manage/components/BaseCalendar.vue

@@ -0,0 +1,155 @@
+<template>
+    <div class="base-calendar-wrap">
+        <FullCalendar class="full-calendar-wrap"
+            ref="fullCalendar"
+            :options="calendarOptions"
+        >
+            <template #eventContent="arg">
+                <div class="popper-content"
+                    :style="{fontWeight:arg.event.extendedProps.FontBold?'bold':'normal'}"
+                >
+                   {{arg.event.title||''}}
+                </div>
+            </template>
+        </FullCalendar>
+        <div class="water-mark" v-if="showMark">
+            <p>{{ markText.date }}</p>
+            <p>{{ markText.type }}</p>
+        </div>
+    </div>
+</template>
+
+<script>
+import FullCalendar from "@fullcalendar/vue";
+import dayGridPlugin from '@fullcalendar/daygrid'
+import interactionPlugin from '@fullcalendar/interaction'
+export default {
+    components: {FullCalendar},
+    props:{
+        showMark:{
+            type:Boolean,
+            default:true
+        },
+        markText:{
+            type:Object,
+            default:()=>{
+                return {
+                    date:'当前日期',
+                    type:'当前品种'
+                }
+            }
+        },
+        options:{
+            type:Object,
+            default:{}
+        }
+    },
+    data() {
+        return {
+            calendarOptions:{
+                height:'100%',
+                locale: "zh-cn",
+                plugins: [ dayGridPlugin, interactionPlugin ],
+                initialView:'dayGridMonth',
+                headerToolbar:false,//不显示头部信息
+                weekNumberCalculation:'ISO',//从周一开始
+                dayHeaderFormat:{ //https://fullcalendar.io/docs/v5/date-formatting
+                    weekday:'narrow', //头部星期显示为一 二 三...
+                },
+                dayCellContent:function(arg){ //单元格日期显示为 1 2 3...
+                    return arg.date.getDate()
+                },
+                fixedWeekCount:false,//是否固定6周
+                eventOrder:'Sort', //指定事项排序字段
+                /* dayMaxEventRows:6,//一天最多展示6条
+                moreLinkClick:(info)=>{this.handleDateClick(info)},//点击more时触发 */
+                events:[
+                    /* {
+                        id:1,
+                        title:'我是默认事件', //事件名称
+                        start:'2024-03-26',//日期,默认是全天事件
+                        textColor:'#000',//字体颜色
+                        backgroundColor:'#ffc0cb',//背景色
+                        borderColor:'#ffc0cb',//边框色
+                        //↑此外的属性会被FullCalendar插件放到extendedProps属性中
+                        //extendedProps
+                        isTextBold:true,//是否加粗
+                    }, */
+                ],
+                dateClick:this.handleDateClick,
+                eventClick:this.handleEventClick
+            }
+        };
+    },
+    methods: {
+        handleDateClick(info){
+            this.$emit("dateClick",info)
+        },
+        handleEventClick(info){
+            this.$emit("eventClick",info)
+        }
+    },
+};
+</script>
+
+<style lang="scss">
+.base-calendar-wrap{
+    .full-calendar-wrap{
+        .fc-daygrid-day-top{ //日期偏左显示
+            flex-direction: row;
+        }
+        .fc-daygrid-event{
+            border-radius: 0;
+            margin:0 !important;
+        }
+        .fc-scrollgrid{
+            border:none;
+            .fc-scrollgrid-section-header{
+                th{
+                    border:none !important;
+                }
+                .fc-col-header-cell{
+                    text-align: left;
+                    //font-weight: 500;
+                }
+            }
+            .fc-scrollgrid-section-body{
+                td{
+                    border: none !important;
+                    border-left:2px solid #002D78 !important;
+                }
+            }
+        }
+        .fc-more-popover{
+            display:none !important;
+        }
+    }
+}
+</style>
+<style scoped lang="scss">
+.base-calendar-wrap{
+    flex: 1;
+    display: flex;
+    flex-direction: column;
+    position:relative;
+    .full-calendar-wrap{
+        flex:1;
+        .popper-content{
+            cursor: pointer;
+        }
+    }
+    .water-mark{
+        position: absolute;
+        top:0;
+        bottom: 0;
+        left: 0;
+        right: 0;
+        display: flex;
+        flex-direction: column;
+        justify-content: center;
+        align-items: center;
+        font-size: 64px;
+        opacity: 0.3;
+    }
+}
+</style>

+ 344 - 0
src/views/toolBox_manage/components/addEventDialog.vue

@@ -0,0 +1,344 @@
+<template>
+    <el-dialog
+        :title="$t('ToolBox.ForexCalendar.add_item')"
+        width="600px"
+        center
+        custom-class="add-event-dialog-wrap"
+        :visible.sync="isEventDialogShow"
+        :modal-append-to-body="false"
+        :append-to-body="false"
+        @close="$emit('close')"
+    >
+        <div class="dialog-content">
+            <div class="event-header">
+                <!-- 选择日期 -->
+                <el-date-picker  type="date" v-model="eventDay"
+                    :placeholder="$t('ToolBox.ForexCalendar.select_date')"
+                    value-format="yyyy-MM-dd"
+                    @change="getDayEvents"
+                    >
+                </el-date-picker>
+                <div class="event-select">
+                    <el-select v-model="selectType" style="width:130px">
+                        <!-- 关联指标 -->
+                        <el-option :label="$t('ToolBox.ForexCalendar.link_edb')" :value="1"/>
+                        <!-- 自定义事项 -->
+                        <el-option :label="$t('ToolBox.ForexCalendar.link_item')" :value="2"/>
+                    </el-select>
+                    <!-- 关联指标 -->
+                   <el-select v-if="selectType===1" style="flex:1;"
+                        filterable remote clearable
+                        :placeholder="$t('ToolBox.ForexCalendar.edb_input')"
+                        v-model="searchObj"
+                        :remote-method="searchHandle"
+                        value-key="EdbInfoId"
+                        @change="searchChange">
+                        <i slot="prefix" class="el-input__icon el-icon-search"></i>
+                        <el-option
+                            v-for="item in searchOptions"
+                            :key="item.EdbInfoId"
+                            :label="item.EdbName"
+                            :value="item"/>
+                    </el-select>
+                    <!-- 自定义事项 -->
+                    <el-button v-if="selectType===2" style="flex:1;" @click="addEventItem">+</el-button>
+
+                    <el-tooltip effect="dark" :content="$t('ToolBox.ForexCalendar.link_hint')" placement="top">
+                        <i class="el-icon-question" style="font-size: 16px;"></i>
+                    </el-tooltip>
+                </div>
+            </div>
+            <div class="event-form">
+                <el-form :model="eventForm" ref="eventForm">
+                    <draggable 
+                        v-model="eventForm.events"
+                        animation="300"
+                        tag="div" 
+                        class="events-wrap"
+                        handle=".el-icon-rank">
+                        <div class="event" v-for="(item,index) in eventForm.events" :key="index">
+                            <el-form-item :prop="`events[${index}].title`" class="event-item"
+                                :rules="[
+                                    {required:true,message:$t('ToolBox.ForexCalendar.item_input'),trigger: 'blur'},
+                                    {max: 15, message: $t('ToolBox.ForexCalendar.item_input_limit'), trigger: 'blur'}]">
+                                <!-- move icon -->
+                                <i class="el-icon-rank icon" style="color: #0052D9;"></i>
+                                <el-input v-model="item.title" :placeholder="$t('ToolBox.ForexCalendar.item_input')">
+                                    <el-button slot="append" type="primary" @click.stop="item.isExpand = !item.isExpand">
+                                        {{$t(`ToolBox.ForexCalendar.item_btn_text${item.isExpand?'_pickup':''}`)}}
+                                    </el-button>
+                                </el-input>
+                                <!-- close icon -->
+                                <i class="el-icon-remove-outline icon" style="color:#D54941;" @click="removeEvent(index)"></i>
+                                <!-- edb icon -->
+                                <img class="icon" src="~@/assets/img/icons/edb-icon.png" v-if="item.MatterType!==1" @click="toEdbDetail(item)">
+                                <!-- 占位 -->
+                                <span class="icon" v-else></span>
+                            </el-form-item>
+                            <div class="event-expand-setting" v-show="item.isExpand">
+                                <div><span>{{ $t('ToolBox.ForexCalendar.font_color') }}</span> <el-color-picker v-model="item.textColor" color-format="hex" size="mini"></el-color-picker></div>
+                                <div><span>{{ $t('ToolBox.ForexCalendar.fill_color') }}</span> <el-color-picker v-model="item.backgroundColor" color-format="hex" size="mini"></el-color-picker></div>
+                                <div><span>{{ $t('ToolBox.ForexCalendar.font_bold') }}</span> <el-switch v-model="item.FontBold" :active-value="1" :inactive-value="0"></el-switch></div>
+                            </div>
+                        </div>
+                    </draggable>
+                    
+                </el-form>
+            </div>
+            
+        </div>
+        <div class="dialog-footer" slot="footer">
+            <el-button @click="$emit('close')">{{ $t('Dialog.cancel_btn') }}</el-button>
+            <el-button type="primary" @click="handleSaveEvents">{{ $t('Dialog.confirm_save_btn') }}</el-button>
+        </div>
+        
+    </el-dialog>
+</template>
+
+<script>
+import draggable from 'vuedraggable';
+import {ForexCalendarInterface} from '@/api/modules/toolBoxApi';
+export default {
+    components:{draggable},
+    props:{
+        isEventDialogShow:{
+            type:Boolean,
+            default:false
+        },
+        choosedDay:{
+            type:String,
+            default:''
+        },
+        choosedPermission:{
+            type:Number,
+            default:0
+        },
+    },
+    data() {
+        return {
+            eventDay:'',
+            selectType:1,
+            searchObj:'',
+            searchOptions:[],
+            eventForm:{
+                events:[/* {
+                    title:'',
+                    textColor:'#000',
+                    backgroundColor:'#ccc',
+                    isTextBold:false,
+                    isExpand:false,//是否展开
+                } */]
+            }
+        };
+    },
+    watch:{
+        isEventDialogShow(newVal){
+            if(newVal){
+                this.eventDay = this.choosedDay||this.$moment(new Date()).format('YYYY-MM-DD')
+                this.getDayEvents()
+            }
+        }
+    },
+    methods: {
+        searchHandle(keyword){
+            ForexCalendarInterface.searchEdbInfo({
+                KeyWord:keyword,
+                CurrentIndex:1,
+                PageSize:100,
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.searchOptions = res.Data.List||[]
+            })
+        },
+        searchChange(){
+            if(typeof this.searchObj === 'object'){
+                this.addEdbItem()
+            }
+        },
+        //获取当天的事项
+        getDayEvents(){
+            this.eventForm.events = []
+            //接口获取
+            ForexCalendarInterface.getDailyEventList({
+                ChartPermissionId:Number(this.choosedPermission),
+                MatterDate:this.eventDay
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.eventForm.events = (res.Data?res.Data:[]).map(e=>{
+                    return {
+                        ...e,
+                        title:e.Title,
+                        textColor:e.FontColor||'#333333',
+                        backgroundColor:e.FillingColor||'#0052D9',
+                        borderColor:e.FillingColor||'#0052D9',
+                        isExpand:false
+                    }
+                })
+            })
+        },
+        //添加一个事项
+        addEventItem(){
+            this.eventForm.events.push({
+                title:'',
+                textColor:'#333333',
+                backgroundColor:'#0052D9',
+                isExpand:false,
+                MatterType:1,
+                FontBold:0,
+                FeCalendarMatterId:0,
+                EdbInfoId:'',
+                EdbUniqueCode:'',
+                EdbCode:'',
+                
+            })
+        },
+        //添加一个指标事项
+        addEdbItem(){
+            const {EdbName,EdbInfoType,EdbInfoId,UniqueCode,EdbCode} = this.searchObj
+            this.eventForm.events.push({
+                title:EdbName||'',
+                textColor:'#333333',
+                backgroundColor:'#0052D9',
+                isExpand:false,
+                MatterType:EdbInfoType?3:2,
+                FontBold:0,
+                FeCalendarMatterId:0,
+                EdbInfoId:EdbInfoId||'',
+                EdbUniqueCode:UniqueCode||'',
+                EdbCode:EdbCode||'',
+            })
+            this.searchObj=''
+        },
+        removeEvent(index){
+            this.eventForm.events.splice(index,1)
+        },
+        //跳转指标库/预测指标库
+        toEdbDetail(item){
+            const { EdbUniqueCode, EdbInfoId, MatterType } = item
+            let { href } = this.$router.resolve({ 
+                path: MatterType === 3 ? '/predictEdb' : '/database',
+                query: { 
+                    code: EdbUniqueCode, 
+                    id:EdbInfoId, 
+                } 
+            });
+            window.open(href, '_blank');
+        },
+        async handleSaveEvents(){
+            if(!this.eventDay) return this.$message.warning('请选择日期')
+            try{
+                await this.$refs.eventForm.validate()
+            }catch(e){
+                return 
+            }
+            this.$emit('save',{events:this.eventForm.events,eventDay:this.eventDay})
+        }
+    },
+};
+</script>
+
+<style lang="scss">
+.add-event-dialog-wrap{
+    .el-input{
+        width: 100%;
+    }
+    .el-form-item{
+        margin-bottom:0;
+        &.event-item{
+            .el-form-item__content{
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                /* gap:10px; */
+                .icon{
+                    margin:10px;
+                    &:last-of-type{
+                        margin-right: 0;
+                    }
+                }
+                img.icon,span.icon{
+                    width:16px;
+                    height:16px;
+                }
+                .el-input{
+                    flex: 1;
+                }
+                .el-input-group__append{
+                    .el-button{
+                        color: #FFFFFF;
+                        background-color: #0052D9;
+                        border-color: #0052D9;
+                        border-top-left-radius:0;
+                        border-bottom-left-radius: 0;
+                    }
+                    
+                }
+                .el-form-item__error{
+                    left: 34px;
+                }
+            }
+        }
+    }
+    .event-expand-setting{
+        .el-color-picker {
+            display: inline-block;
+            &.el-color-picker--mini {
+                height: 20px;
+            }
+            .el-color-picker__trigger {
+                width: 40px;
+                height: 20px;
+                padding: 0;
+                border: 0;
+                .el-color-picker__icon{
+                    display: none;
+                }
+            }
+        }
+    }
+}
+</style>
+<style scoped lang="scss">
+.add-event-dialog-wrap{
+    .dialog-content{
+        padding:15px 30px;
+        .event-select{
+            display: flex;
+            gap:10px;
+            align-items: center;
+            margin:30px 0;
+        }
+        .event-form{
+            min-height: 200px;
+            max-height: 320px;
+            overflow-y: auto;
+            margin-left: -34px;
+            .event{
+                position:relative;
+                margin-bottom: 30px;
+                .event-item{
+                    .icon{
+                        cursor: pointer;
+                    }
+                }
+                .event-expand-setting{
+                    display: flex;
+                    justify-content: space-around;
+                    align-items: center;
+                    border:1px dashed #0052D9;
+                    border-top: none;
+                    border-radius: 0 0 4px 4px;
+                    padding:14px;
+                    background-color: #ECF2FE;
+                    margin:0 52px 0 34px;
+                    >div{
+                        display: flex;
+                        align-items: center;
+                        gap:10px;
+                    }
+                }
+            }
+        }
+    }
+}
+</style>