提交样式

This commit is contained in:
aixianling
2023-02-02 18:20:46 +08:00
parent a8547275bd
commit deb90a8574
3 changed files with 148 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
<template>
<section class="AppSignInfo">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<script>
import List from "./list";
export default {
name: "AppSignInfo",
components: {List},
label: "签到管理",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
return List
}
},
created() {
this.dict.load('wxSignStatus')
}
}
</script>
<style lang="scss" scoped>
.AppSignInfo {
height: 100%;
}
</style>

View File

@@ -0,0 +1,109 @@
<template>
<section class="list">
<ai-list>
<ai-title slot="title" title="签到管理" isShowBottomBorder>
<template #rightBtn>
<el-button type="primary">设置</el-button>
</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"/>
</ai-tree-menu>
</template>
<template #content>
<ai-search-bar>
<template #left>
<ai-download url="/app/appwechatsigninfo/export" :params="{...search,ids}" :instance="instance" fileName="签到管理导出文件"/>
</template>
<template #right>
<el-input size="small" placeholder="搜索" v-model="search.name" 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>
</template>
</ai-list>
</section>
</template>
<script>
import AiTreeMenu from "dui/packages/layout/AiTreeMenu";
export default {
name: "list",
components: {AiTreeMenu},
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
search: {name: ""},
page: {current: 1, size: 10, total: 0},
tableData: [],
colConfigs: [
{prop: "createDate", label: "签到时间"},
{prop: "departmentName", label: "部门"},
{prop: "status", label: "状态", dict: "wxSignStatus"},
{prop: "wxUserName", label: "用户"}
],
treeData: []
}
},
methods: {
getTableData() {
this.instance.post("/app/appwechatsigninfo/list", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
},
handleAdd(id) {
this.$router.push({hash: "#add", query: {id}})
},
// handleDelete(ids) {
// this.$confirm("是否要删除?").then(() => {
// this.instance.post("/app/appwechatsigninfo/delete", null, {
// params: {ids}
// }).then(res => {
// if (res?.code == 0) {
// this.$message.success("删除成功")
// this.getTableData()
// }
// })
// }).catch(() => 0)
// },
getDepartments() {
this.instance.post("/app/wxcp/wxdepartment/listAll").then(res => {
if (res?.data) {
this.treeData = this.$arr2tree(res.data, {parent: 'parentid'})
}
})
},
handleSearchTree(name) {
this.$refs.DeptTree.filter(name)
}
},
created() {
this.getTableData()
this.getDepartments()
}
}
</script>
<style lang="scss" scoped>
.list {
height: 100%;
}
</style>

View File

@@ -2,7 +2,7 @@
<section class="AiTreeMenu">
<b>{{ title }}</b>
<el-input v-if="!hideInput" size="small" class="searchInput" v-model="searchText" :placeholder="searchPlaceholder"
suffix-icon="iconfont iconSearch" @change="handleSearch()" clearable/>
suffix-icon="iconfont iconSearch" @change="handleSearch" clearable/>
<div class="treePanel" v-if="$slots.default">
<slot/>
</div>
@@ -22,11 +22,6 @@ export default {
searchPlaceholder: {type: String, default: "请输入..."},
hideInput: Boolean
},
watch: {
searchText(v) {
this.$emit("update:search", v)
}
},
data() {
return {
searchText: "",
@@ -35,7 +30,8 @@ export default {
}
},
methods: {
handleSearch() {
handleSearch(v) {
this.$emit("update:search", v)
if (this.$slots.default) {
this.$emit('search', this.searchText)
}