|
@@ -29,14 +29,16 @@
|
|
|
<el-select v-if="selectType===1" style="flex:1;"
|
|
|
filterable remote clearable
|
|
|
:placeholder="$t('ToolBox.ForexCalendar.edb_input')"
|
|
|
- v-model="searchText"
|
|
|
- :remote-method="searchHandle">
|
|
|
+ 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.EdbInfoId"/>
|
|
|
+ :value="item"/>
|
|
|
</el-select>
|
|
|
<!-- 自定义事项 -->
|
|
|
<el-button v-if="selectType===2" style="flex:1;" @click="addEventItem">+</el-button>
|
|
@@ -54,26 +56,28 @@
|
|
|
tag="div"
|
|
|
class="events-wrap"
|
|
|
handle=".el-icon-rank">
|
|
|
- <div class="event" :class="{'show-bgColor':item.isExpand}" v-for="(item,index) in eventForm.events" :key="index">
|
|
|
+ <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: '超出15个字,请重新编辑', trigger: 'change'}]">
|
|
|
<!-- move icon -->
|
|
|
<i class="el-icon-rank icon"></i>
|
|
|
- <el-input v-model="item.title" :placeholder="$t('ToolBox.ForexCalendar.item_input')" />
|
|
|
+ <el-input v-model="item.title" :placeholder="$t('ToolBox.ForexCalendar.item_input')">
|
|
|
+ <el-button slot="append" type="primary" @click.stop="item.isExpand = !item.isExpand">展开</el-button>
|
|
|
+ </el-input>
|
|
|
<!-- expand icon -->
|
|
|
- <i class="icon" :class="{'el-icon-arrow-right':item.isExpand===false,'el-icon-arrow-down':item.isExpand===true}"
|
|
|
- @click="item.isExpand = !item.isExpand"></i>
|
|
|
+ <!-- <i class="icon" :class="{'el-icon-arrow-right':item.isExpand===false,'el-icon-arrow-down':item.isExpand===true}"
|
|
|
+ @click="item.isExpand = !item.isExpand"></i> -->
|
|
|
<!-- close icon position-->
|
|
|
- <i class="el-icon-remove icon" @click="removeEvent(index)"></i>
|
|
|
+ <i class="el-icon-remove-outline icon" @click="removeEvent(index)"></i>
|
|
|
<!-- edb icon position-->
|
|
|
<i class="el-icon-printer icon"></i>
|
|
|
</el-form-item>
|
|
|
<div class="event-expand-setting" v-show="item.isExpand">
|
|
|
- <span>{{ $t('ToolBox.ForexCalendar.font_color') }} <el-color-picker v-model="item.textColor" color-format="hex" size="mini"></el-color-picker></span>
|
|
|
- <span>{{ $t('ToolBox.ForexCalendar.fill_color') }} <el-color-picker v-model="item.backgroundColor" color-format="hex" size="mini"></el-color-picker></span>
|
|
|
- <span>{{ $t('ToolBox.ForexCalendar.font_bold') }} <el-switch v-model="item.FontBold" :active-value="1" :inactive-value="0"></el-switch></span>
|
|
|
+ <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>
|
|
@@ -108,16 +112,12 @@ export default {
|
|
|
type:Number,
|
|
|
default:0
|
|
|
},
|
|
|
- dayEvents:{
|
|
|
- type:Array,
|
|
|
- default:[]
|
|
|
- }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
eventDay:'',
|
|
|
selectType:1,
|
|
|
- searchText:'',
|
|
|
+ searchObj:'',
|
|
|
searchOptions:[],
|
|
|
eventForm:{
|
|
|
events:[/* {
|
|
@@ -142,25 +142,34 @@ export default {
|
|
|
searchHandle(keyword){
|
|
|
ForexCalendarInterface.searchEdbInfo({
|
|
|
KeyWord:keyword,
|
|
|
- CurrentIndex:100
|
|
|
+ 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:Number(this.choosedDay)
|
|
|
+ MatterDate:this.eventDay
|
|
|
}).then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
- console.log('dayEvents',this.dayEvents)
|
|
|
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
|
|
|
}
|
|
|
})
|
|
@@ -170,8 +179,8 @@ export default {
|
|
|
addEventItem(){
|
|
|
this.eventForm.events.push({
|
|
|
title:'',
|
|
|
- textColor:'#000',
|
|
|
- backgroundColor:'#ccc',
|
|
|
+ textColor:'#333333',
|
|
|
+ backgroundColor:'#0052D9',
|
|
|
isExpand:false,
|
|
|
MatterType:1,
|
|
|
FontBold:0,
|
|
@@ -182,6 +191,23 @@ export default {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+ //添加一个指标事项
|
|
|
+ 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)
|
|
|
},
|
|
@@ -204,12 +230,35 @@ export default {
|
|
|
width: 100%;
|
|
|
}
|
|
|
.el-form-item{
|
|
|
- margin-bottom: 10px;
|
|
|
+ margin-bottom:0;
|
|
|
&.event-item{
|
|
|
.el-form-item__content{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap:10px;
|
|
|
+ justify-content: space-between;
|
|
|
+ /* gap:10px; */
|
|
|
+ .icon{
|
|
|
+ margin:10px;
|
|
|
+ &:last-of-type{
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -224,6 +273,9 @@ export default {
|
|
|
height: 20px;
|
|
|
padding: 0;
|
|
|
border: 0;
|
|
|
+ .el-color-picker__icon{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -232,28 +284,39 @@ export default {
|
|
|
<style scoped lang="scss">
|
|
|
.add-event-dialog-wrap{
|
|
|
.dialog-content{
|
|
|
+ padding:15px 30px;
|
|
|
.event-select{
|
|
|
display: flex;
|
|
|
gap:10px;
|
|
|
align-items: center;
|
|
|
- margin:10px 0;
|
|
|
+ margin:30px 0;
|
|
|
}
|
|
|
.event-form{
|
|
|
min-height: 200px;
|
|
|
+ margin-left: -34px;
|
|
|
.event{
|
|
|
position:relative;
|
|
|
- &.show-bgColor{
|
|
|
- background-color:#EBEBEB;
|
|
|
- }
|
|
|
+ margin-bottom: 30px;
|
|
|
.event-item{
|
|
|
.icon{
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
.event-expand-setting{
|
|
|
- padding:0 30px;
|
|
|
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 58px 0 34px;
|
|
|
+ >div{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap:10px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|