Commit 09d8c01a authored by 杨柠瑞's avatar 杨柠瑞

coding

parents 88aec90a ee1f7772
<template>
<div class="calendarlist">
<i class="el-icon-date" @click="dialogTableVisible = true"></i>
<i class="el-icon-date" @click="dialogTableVisible = true" :style="demoEvent.iconStyle"></i>
<el-dialog :visible.sync="dialogTableVisible">
<div class="datebook-root" :style='componentW?"width:"+componentW+";":""'>
<div class='top-panel'>
......@@ -44,6 +44,7 @@
box-sizing:border-box;
width: 280px;
border:1px solid #ececec;
display: inline-block;
}
.datebook-root .top-panel{
padding-top: 10px;
......@@ -177,24 +178,25 @@
background: #2db7f5 ;
}
.incident{
top: -350px;
left:270px;
vertical-align: top;
width: 300px;
display:inline-block;
position:relative;
background-color:#202020;
width:180px;
height:;
padding:20px;
height:428px;
position: relative;
overflow: scroll;
text-align: center;
/*padding:20px;*/
color:#CCC;
text-align:center;
font-size:14px;
font-family:微软雅黑;
border-radius:10px;
margin:50px;
box-shadow:1px 1px 2px #202020;
-o-box-shadow:1px 1px 2px #202020;
-moz-box-shadow:1px 1px 2px #202020;
-webkit-border-shadow:1px 1px 2px #202020;
/*text-align:center;*/
/*font-size:14px;*/
/*font-family:微软雅黑;*/
/*border-radius:10px;*/
/*margin:50px;*/
/*box-shadow:1px 1px 2px #202020;*/
/*-o-box-shadow:1px 1px 2px #202020;*/
/*-moz-box-shadow:1px 1px 2px #202020;*/
/*-webkit-border-shadow:1px 1px 2px #202020;*/
}
.close{
position: absolute;
......@@ -203,20 +205,21 @@
right:0;
}
.incident span {
color: white;
font-size: 10px;
padding: 10px 20px;
}
.incident:before{
content:'';
position:absolute;
width:0;
height:0;
border:15px solid;
color:transparent;
border-right-color:#202020;
left:-30px;
top:50%;
margin-top:-15px;
/*content:'';*/
/*position:absolute;*/
/*width:0;*/
/*height:0;*/
/*border:15px solid;*/
/*color:transparent;*/
/*border-right-color:#202020;*/
/*left:-30px;*/
/*top:50%;*/
/*margin-top:-15px;*/
}
</style>
<script>
......@@ -266,20 +269,12 @@
type: Object,
required: true
},
width: {
type: String,
required: false
},
initTime: {
required: false
},
title: {
required: false
},
events: {
required: false
},
date: {
demoEvent: {
type: Object,
required: false
}
},
......@@ -399,7 +394,7 @@
},
dateChange(dateItem) {
this.show = true
console.log(dateItem, '-=-=-=-=-=-=-=-=-')
// console.log(dateItem, '-=-=-=-=-=-=-=-=-')
var dateObj = new Date(this.showTimeData)
var year = dateObj.getFullYear()
var month = dateObj.getMonth()
......@@ -448,7 +443,7 @@
dateItem.active = !dateItem.active
}
// 向上发送本次点击的行程数据
console.log(result, '--------------------')
// console.log(result, '--------------------')
if (result.schedule) {
const currentTime = this.timestampToTime(result.schedule.date)
this.currentDate = currentTime
......@@ -487,15 +482,16 @@
getDailyEvent() {
const self = this
var saveTime = ''
var filterparams = self.demoEvent.filterparams
request(self.schema.modelUnderscorePlural, {
params: { 'sortItem': 'create_time', 'pageSize': 10000 }
params: { 'sortItem': self.demoEvent.timeOrder, 'pageSize': 10000, filters: filterparams }
}).then(resp => {
console.log(resp.data, '=========')
_.each(resp.data, function(item) {
item.time = moment(item[self.date]).format('YYYY-MM-DD')
item.date = moment(item[self.date]).format('X') * 1000
item.title = item[self.title]
item.allEvents = item[self.events]
item.time = moment(item[self.demoEvent.date]).format('YYYY-MM-DD')
item.date = moment(item[self.demoEvent.date]).format('X') * 1000
item.title = item[self.demoEvent.title]
item.allEvents = item[self.demoEvent.events]
if (saveTime === item.time) {
self.schedules[self.schedules.length - 1].allEvents.push(item.allEvents)
} else {
......@@ -508,7 +504,7 @@
}
})
})
console.log(self.schedules, '+++++最终+++++++++')
// console.log(self.schedules, '+++++最终+++++++++')
}
},
created() {
......
<template>
<div class="app-container calendar-list-container">
<hm-full-calendar
:width="width"
:schema="schema['HmUser']"
:title="title"
:events="events"
:date="date"
:demoEvent="demoEvent"
@dateChange="datechange"
@monthChange="monthchange"
></hm-full-calendar>
......@@ -26,11 +23,17 @@
data() {
return {
show: false,
width: '300px',
demoEvent: {
width: '300px',
title: 'loginid',
date: 'createTime',
events: 'email',
timeOrder: 'create_time',
filterparams: '',
iconStyle: 'color: #00BF8B'
}
// title为需要传入的事件名所对应的的字段名,date为时间所对应的字段,events为事件所对应的字段,都不是必传
title: 'loginid',
date: 'createTime',
events: 'email'
// timeOrder为所有所有事件按照数据库的哪个字段排序,为下划线格式
}
},
filters: {
......
......@@ -31,12 +31,17 @@
// widgetType值 1:普通input 2:下拉框 (如果是下拉框 再传一个options表示下拉框选项)3:复选框 4:文本域 5:富文本 6:日期 7:单选框 8: 文件上传
showUserColumns: [
// 1普通input
{ name: '选择类型', codeCamel: 'type', widgetType: 1, disabled: false,
change: this.inputChange
{ name: '选择类型', codeCamel: 'type', widgetType: 9, ref: 'type', options: []
// rule: { required: true, message: '用户名不能为空', trigger: 'blur' }
// hide: true
// default: '默认值',
},
// { name: '选择类型', codeCamel: 'type', widgetType: 1, disabled: false,
// change: this.inputChange
// // rule: { required: true, message: '用户名不能为空', trigger: 'blur' }
// // hide: true
// // default: '默认值',
// },
// 5富文本
{ name: '电子邮件', codeCamel: 'email', widgetType: 5, disabled: false,
change: this.inputChange, hide: false
......@@ -46,16 +51,16 @@
// ]
},
// 2下拉框
// { name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false,
// change: this.selectChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3]
// allowCreate: true,
// options: [
// { value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值
// { value: '2', label: '代理商' },
// { value: '3', label: '会员' },
// { value: '4', label: '访客' }
// ]
// },
{ name: '用户名称', codeCamel: 'username', widgetType: 2, multiple: false,
change: this.selectChange, // default: [1], 如果开启多选,默认选中项用数组[1]、[1,2,3]
allowCreate: true,
options: [
{ value: '1', label: '企业' }, // 下拉框的label是选项文字,value是选中值
{ value: '2', label: '代理商' },
{ value: '3', label: '会员' },
{ value: '4', label: '访客' }
]
},
// 3多选 不支持默认值
{ name: '部门ID', codeCamel: 'departmentId', widgetType: 3, options: ['美女', '帅哥'], change: this.inputChange },
// 4密码
......@@ -75,8 +80,7 @@
change: this.inputChange
},
// 8文件 change: this.uploadChange
{ name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture' }, // url是后台接口地址
{ name: '用户名称', codeCamel: 'username', widgetType: 8, url: '/api/upload', param: 'picture' } // url是后台接口地址
{ name: '选择头像', codeCamel: 'avatar', widgetType: 8, url: '/api/upload', param: 'picture' } // url是后台接口地址
],
// CcSubject示例
showUserColumns2: [
......@@ -147,6 +151,7 @@
input: { style: { width: '60%' }},
select: { style: { width: '60%' }},
cascader: { style: { width: '60%' }},
elTree: { style: { width: '60%' }},
textarea: {
style: { width: '60%' },
resize: 'none',
......@@ -183,8 +188,8 @@
},
methods: {
inputChange(val, formModel) {
// console.log(val)
// console.log(formModel)
console.log(val)
console.log(formModel)
// formModel.email = val.length
},
selectChange(val, formModel) {
......@@ -220,8 +225,8 @@
return formModel
},
uploadFun: function(response, formModel) {
// console.log(215, response)
// console.log(216, formModel)
console.log(215, response)
console.log(216, formModel)
// 修改其他表单的值
formModel.email = response.visitName
}
......
......@@ -82,7 +82,7 @@
</el-date-picker>
</el-form-item>
</span>
<!--预定义按钮-->
<el-button-group v-if="buttonGroup">
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-search" v-if="isShowSearch" @click="handleFilter">搜索</el-button>
......@@ -91,7 +91,7 @@
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-refresh" v-if="isShowRefresh" @click="refreshList">刷新</el-button>
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-close" v-if="multipleSelection.length" @click="BatchRemove">批量删除</el-button>
</el-button-group>
<span v-if="!buttonGroup">
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-search" v-if="isShowSearch" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" :style="titleButtonStyle" type="primary" :loading="downloadLoading" v-waves icon="el-icon-download" v-if="isShowExport" @click="handleDownload">导出</el-button>
......@@ -99,12 +99,11 @@
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-refresh" v-if="isShowRefresh" @click="refreshList">刷新</el-button>
<el-button class="filter-item" :style="titleButtonStyle" type="primary" v-waves icon="el-icon-close" v-if="multipleSelection.length" @click="BatchRemove">批量删除</el-button>
</span>
<hm-full-calendar style="display: inline;margin-left: 10px;" :schema="HmFullCalendar.calendarSchema" :demoEvent="HmFullCalendar.demoEvents" v-if="HmFullCalendar.calendarSchema"></hm-full-calendar>
<hm-full-calendar style="display: inline;margin-left: 10px;" :schema="HmFullCalendar.calendarSchema" :demoEvents="HmFullCalendar.demoEvents" v-if="HmFullCalendar.calendarSchema"></hm-full-calendar>
</el-form>
</div>
<!-- end 过滤 -->
<!-- 表格 -->
<el-table :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row :cell-style="cellStyle" ref="multipleTable"
:style="tableStyle" @selection-change="handleSelectionChange" @sort-change="sortChange" @current-change="tableCurrentChange">
......@@ -130,7 +129,7 @@
</el-table-column>
</el-table>
<!-- end 表格 -->
<!-- 翻页 -->
<div class="pagination-container" v-if="isShowPagination">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.pageNo"
......@@ -138,7 +137,7 @@
</el-pagination>
</div>
<!-- end翻页 -->
<!-- 弹窗 -->
<!-- @TODO 补充详情弹窗 -->
<el-dialog :title="dialogName"
......@@ -161,9 +160,9 @@
:rules="HmComplexForm.rules">
</hm-complex-form>
</el-dialog>
<!-- end 弹窗 -->
</div>
</template>
......@@ -176,7 +175,7 @@
import { Button, Table, TableColumn, Pagination, Loading } from 'element-ui'
import HmComplexForm from '../forms/HmComplexForm.vue'
import HmFullCalendar from '../calendar/HmFullCalendar.vue'
/**
* 毫末科技的表格组件.
*
......@@ -447,14 +446,12 @@
}
})
})
_.each(Object.keys(ret[self.schema['modelUnderscore']]), function(column) {
const operValue = ret[self.schema['modelUnderscore']][column]
if (Object.keys(operValue)[0] === 'like') {
ret[self.schema['modelUnderscore']][column]['like'] = '%' + ret[self.schema['modelUnderscore']][column]['like'] + '%'
}
})
return ret
}
},
......@@ -485,7 +482,6 @@
if (!item) {
return 0
}
if (typeof item !== 'string' && typeof item !== 'object') {
console.error(`传入的columns不符合要求,数组元素必须是字符串或对象`)
}
......@@ -497,7 +493,6 @@
}
})
},
init() {
const self = this
self.operationWidth = 20
......@@ -526,7 +521,7 @@
item.isSort = item.isSort === undefined ? false : item.isSort === true ? 'custom' : false
})
}
// 处理过滤条件
if (self.filters) {
const tableName = self.schema['modelUnderscore']
......@@ -551,7 +546,7 @@
if (self.userDefined) {
self.setDefinedOperate()
}
console.log(request.defaults)
console.log(`request.defaults.baseURL: ${request.defaults.baseURL}`)
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment