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

coding

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