签到完成

This commit is contained in:
aixianling
2023-02-03 15:19:34 +08:00
parent 5b41cd85e0
commit 0bed825f70
7 changed files with 370 additions and 267 deletions

View File

@@ -3,31 +3,48 @@
<ai-list>
<ai-title slot="title" title="签到管理" isShowBottomBorder>
<template #rightBtn>
<el-button type="primary">设置</el-button>
<div flex>
<ai-download url="/app/appwechatsigninfo/export" :params="{...search}" :instance="instance" fileName="签到管理导出文件"/>
<ai-dialog-btn dialogTitle="签到提醒设置" width="500px" :submit="submit" @close="form={}" @open="getSetting">
<el-button slot="btn" type="primary">设置</el-button>
<el-form size="small" label-width="120px" ref="SettingForm" :model="form">
<el-form-item label="早提醒时间">
<el-time-picker v-model="form.morningTime" placeholder="请选择" value-format="hh:mm:ss"/>
</el-form-item>
<el-form-item label="晚提醒时间">
<el-time-picker v-model="form.nightTime" placeholder="请选择" value-format="hh:mm:ss"/>
</el-form-item>
</el-form>
</ai-dialog-btn>
</div>
</template>
</ai-title>
<template #left>
<ai-tree-menu title="组织部门" @search="handleSearchTree">
<el-tree ref="DeptTree" :data="treeData" :props="{label:'name'}" :filter-node-method="(v,data)=>data.label.indexOf(v)>-1"/>
<el-tree ref="DeptTree" :data="treeData" :props="{label:'name'}" :filter-node-method="(v,data)=>data.name.indexOf(v)>-1"
@node-click="handleSelectDept"/>
</ai-tree-menu>
</template>
<template #content>
<template #blank>
<div flex class="gap-16">
<ai-bar v-for="(v,key) in sta" card class="fill" :title="key"><b class="staNum" v-text="v"/></ai-bar>
</div>
<ai-card panel>
<ai-search-bar>
<template #left>
<ai-download url="/app/appwechatsigninfo/export" :params="{...search,ids}" :instance="instance" fileName="签到管理导出文件"/>
<ai-search label="签到时间">
<el-date-picker v-model="search.createDateStart" size="small" placeholder="开始时间" value-format="yyyy-MM-dd" @change="reloadTable"/>
<el-date-picker v-model="search.createDateEnd" size="small" placeholder="结束时间" value-format="yyyy-MM-dd" @change="reloadTable"/>
</ai-search>
<ai-select placeholder="签到状态" v-model="search.status" :selectList="dict.getDict('wxSignStatus')" @change="reloadTable"/>
</template>
<template #right>
<el-input size="small" placeholder="搜索" v-model="search.name" clearable @change="page.current=1,getTableData()"/>
<el-input size="small" placeholder="搜索用户" v-model="search.wxUserName" clearable @change="page.current=1,getTableData()"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center" width="300">
<template slot-scope="{row}">
</template>
</el-table-column>
</ai-table>
@getList="getTableData" :col-configs="colConfigs" :dict="dict"/>
</ai-card>
</template>
</ai-list>
</section>
@@ -46,16 +63,19 @@ export default {
},
data() {
return {
search: {name: ""},
search: {name: "", createDateStart: "", createDateEnd: ""},
page: {current: 1, size: 10, total: 0},
tableData: [],
colConfigs: [
{prop: "createDate", label: "签到时间"},
{prop: "wxUserName", label: "用户"},
{prop: "departmentName", label: "部门"},
{prop: "status", label: "状态", dict: "wxSignStatus"},
{prop: "wxUserName", label: "用户"}
{prop: "createDate", label: "签到日期"},
{prop: "createTime", label: "签到时间"},
{prop: "status", label: "状态", dict: "wxSignStatus"}
],
treeData: []
treeData: [],
form: {},
sta: {}
}
},
methods: {
@@ -69,9 +89,6 @@ export default {
}
})
},
handleAdd(id) {
this.$router.push({hash: "#add", query: {id}})
},
getDepartments() {
this.instance.post("/app/wxcp/wxdepartment/listAll").then(res => {
if (res?.data) {
@@ -79,13 +96,49 @@ export default {
}
})
},
getSetting() {
this.instance.post("/app/appwechatsignconfig/queryDetailById").then(res => {
if (res?.data) {
this.form = res.data
}
})
},
getStaData() {
const {departmentId} = this.search
this.instance.post("/app/appwechatsigninfo/querySignStatistic", null, {
params: {departmentId}
}).then(res => {
if (res?.data) {
this.sta = res.data
}
})
},
handleSearchTree(name) {
this.$refs.DeptTree.filter(name)
},
reloadTable() {
this.page.current = 1
this.getTableData()
},
handleSelectDept(data) {
this.search.departmentId = data.id
this.reloadTable()
this.getStaData()
},
submit() {
return this.$refs.SettingForm.validate()
.then(() => this.instance.post("/app/appwechatsignconfig/addOrUpdate", this.form))
.then(res => {
if (res?.code == 0) {
return this.$message.success("提交成功")
}
})
}
},
created() {
this.getTableData()
this.getDepartments()
this.getStaData()
}
}
</script>
@@ -93,5 +146,9 @@ export default {
<style lang="scss" scoped>
.list {
height: 100%;
.staNum {
font-size: 20px;
}
}
</style>

View File

@@ -17,13 +17,12 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
/**
常用内外边距样式
*/
@each $padMar, $pm in (mar:margin, pad:padding) {
@each $v in (8, 10, 16, 20, 32, 48, 56, 64, 80) {
@each $pos, $p in (l:left, r:right, t:top, b:bottom) {
.#{$padMar}-#{$pos+$v} {
#{$pm}-#{$p}: #{$v}px
}
//gap
.gap-#{$v} {
gap: #{$v}px
}
@each $padMar, $pm in (mar:margin, pad:padding) {
.#{$padMar}-#{$v} {
#{$pm}: #{$v}px
}
@@ -37,6 +36,11 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
#{$pm}-left: #{$v}px;
#{$pm}-right: #{$v}px;
}
@each $pos, $p in (l:left, r:right, t:top, b:bottom) {
.#{$padMar}-#{$pos+$v} {
#{$pm}-#{$p}: #{$v}px
}
}
}
}

View File

@@ -1,12 +1,13 @@
<template>
<div class="aibar" :style="{ marginBottom: marginBottom }" :class="[titlePosition === 'center' ? 'aibar-center' : '']">
<div v-if="titlePosition === 'center'"></div>
<div class="aibar" :style="{ marginBottom }" :class="{'aibar-cente':titlePosition === 'center',card}">
<div v-if="titlePosition === 'center'"/>
<div class="aibar-left" :class="[titlePosition === 'center' ? 'aibar-left__center' : '']">
<template v-if="!isHasTitleSlot">{{ title }}</template>
<template v-if="!$scopedSlots.title">{{ title }}</template>
<slot name="title" v-else></slot>
</div>
<div class="aibar-right">
<slot name="right"></slot>
<slot v-if="$scopedSlots.right" name="right"/>
<slot/>
</div>
</div>
</template>
@@ -33,19 +34,9 @@
titlePosition: {
type: String,
default: 'left'
}
},
computed: {
isHasTitleSlot () {
return this.$slots.title
}
card: Boolean
},
data () {
return {
}
}
}
</script>
@@ -59,6 +50,11 @@
padding: 0 16px;
box-sizing: border-box;
border-bottom: 1px solid #EEEEEE;
box-shadow: 0 4px 6px -2px rgba(15, 15, 21, 0.15);
&.card {
background: #fff;
}
.aibar-left {
color: #222;

View File

@@ -94,10 +94,12 @@
onCancel() {
this.$emit('update:visible', false)
this.$emit('onCancel')
this.$emit('cancel')
},
onConfirm() {
this.$emit('onConfirm')
this.$emit('confirm')
}
}
}

View File

@@ -1,6 +1,6 @@
<template>
<section class="ai-card">
<ai-bar v-if="!hideTitle" :title="title" v-bind="$attrs">
<section class="ai-card" :class="{panel}">
<ai-bar v-if="!hideHeader" :title="title" v-bind="$attrs">
<template #title>
<slot name="title"></slot>
</template>
@@ -9,7 +9,8 @@
</template>
</ai-bar>
<div class="ai-card__body">
<slot name="content"></slot>
<slot v-if="$scopedSlots.content" name="content"/>
<slot v-else/>
</div>
</section>
</template>
@@ -21,7 +22,11 @@ export default {
title: {
type: String
},
hideTitle: Boolean
hideTitle: Boolean,
panel: Boolean
},
computed: {
hideHeader: v => v.hideTitle || v.panel
}
}
</script>
@@ -37,5 +42,15 @@ export default {
.ai-card__body {
padding: 12px 40px 22px;
}
&.panel {
margin-bottom: 0;
.ai-card__body {
padding: 12px 16px;
}
}
}
</style>

View File

@@ -4,8 +4,8 @@
<slot v-if="$scopedSlots.btn" name="btn"/>
<el-button v-else type="text">{{ text }}</el-button>
</div>
<ai-dialog :visible.sync="dialog" :title="dialogTitle" :width="width" :customFooter="customFooter" v-on="$listeners"
@onConfirm="dialog=false,$emit('onConfirm')" v-bind="$attrs">
<ai-dialog :visible.sync="dialog" :title="dialogTitle" :width="width" :customFooter="needFooter" v-on="$listeners"
@onConfirm="handleConfirm" v-bind="$attrs">
<slot/>
<template #footer>
<el-button @click="dialog=false">关闭</el-button>
@@ -21,12 +21,26 @@ export default {
text: {default: "点击弹窗"},
dialogTitle: {default: "展示信息"},
customFooter: {default: true},
width: {default: "1200px"}
width: {default: "1200px"},
submit: {default: null}
},
computed: {
needFooter: v => v.customFooter && !v.submit
},
data() {
return {
dialog: false
}
},
methods: {
handleConfirm() {
if (!this.submit) {
this.dialog = false
this.$emit('onConfirm')
} else {
this.submit?.()?.then(() => this.dialog = false)
}
}
}
}
</script>

View File

@@ -6,9 +6,14 @@
<div class="ai-list__tabs" v-if="$slots.tabs">
<slot name="tabs"></slot>
</div>
<div class="ai-list__blank" v-else-if="$slots.blank">
<el-row type="flex" class="ai-list__blank" v-else-if="$scopedSlots.blank" :class="{hasLeft:$scopedSlots.left}">
<div class="ai-list__content--left" v-if="$scopedSlots.left">
<slot name="left"/>
</div>
<div class="fill">
<slot name="blank"/>
</div>
</el-row>
<div class="ai-list__content" v-else :class="contentClass">
<div class="ai-list__content--wrapper">
<slot name="custom" v-if="!!$slots.custom"/>
@@ -222,9 +227,19 @@ export default {
flex: 1;
padding: 16px;
box-sizing: border-box;
height: calc(100% - 50px);
&.hasLeft {
padding: 16px 0;
}
& > .fill {
height: 100%;
overflow: auto;
}
}
}
.ai-left__list {
height: 100%;