|
@@ -1,80 +1,424 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <header></header>
|
|
|
- <el-row>
|
|
|
- <div>
|
|
|
- <el-button type="info" icon="el-icon-plus">活动发起</el-button>
|
|
|
+ <div class="flex-col-between" style="height: 100%;">
|
|
|
+ <header style="margin-bottom:30px" class="flex-item-none flex-row">
|
|
|
+ <div class="flex-item-none count-item">
|
|
|
+ <div class="left-icon"></div>
|
|
|
+ <div class="right-text">
|
|
|
+ <div class="count">{{ outputAlyzData[0].toFixed(0) }}</div>
|
|
|
+ <div class="name">活动总数</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <el-input
|
|
|
- placeholder="请输入搜索关键字"
|
|
|
- suffix-icon="el-icon-search"
|
|
|
- v-model="searchText"
|
|
|
- style="width: 200px;"
|
|
|
- ></el-input>
|
|
|
- <el-button type="primary">搜索</el-button>
|
|
|
+ <div class="flex-item-none count-item">
|
|
|
+ <div class="left-icon"></div>
|
|
|
+ <div class="right-text">
|
|
|
+ <div class="count">{{ outputAlyzData[1].toFixed(0) }}</div>
|
|
|
+ <div class="name">已结束</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-table
|
|
|
- ref="multipleTable"
|
|
|
- :data="tableData"
|
|
|
- tooltip-effect="dark"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column label="活动名称" prop=""></el-table-column>
|
|
|
- <el-table-column label="姓名" prop=""></el-table-column>
|
|
|
- <el-table-column label="姓名" prop=""></el-table-column>
|
|
|
- <el-table-column label="姓名" prop=""></el-table-column>
|
|
|
- <el-table-column label="姓名" prop=""></el-table-column>
|
|
|
- <el-table-column label="姓名" prop=""></el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="操作">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-link type="primary">权限</el-link>
|
|
|
- <span style="color: #409eff;margin: 0 10px;">|</span>
|
|
|
- <el-link type="primary">编辑</el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-row>
|
|
|
- <el-row style="text-align: right">
|
|
|
- <el-pagination background layout="prev, pager, next" :total="total"></el-pagination>
|
|
|
- </el-row>
|
|
|
+ <div class="flex-item-none count-item">
|
|
|
+ <div class="left-icon"></div>
|
|
|
+ <div class="right-text">
|
|
|
+ <div class="count">{{ outputAlyzData[2].toFixed(0) }}</div>
|
|
|
+ <div class="name">进行中</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-item-none count-item">
|
|
|
+ <div class="left-icon"></div>
|
|
|
+ <div class="right-text">
|
|
|
+ <div class="count">{{ outputAlyzData[3].toFixed(0) }}</div>
|
|
|
+ <div class="name">审核中</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-item-none count-item">
|
|
|
+ <div class="left-icon"></div>
|
|
|
+ <div class="right-text">
|
|
|
+ <div class="count">{{ outputAlyzData[4].toFixed(0) }}</div>
|
|
|
+ <div class="name">我发起的</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+ <section class="flex-item-auto">
|
|
|
+ <div style="display: flex; justify-content: space-between;margin-bottom: 20px;">
|
|
|
+ <div>
|
|
|
+ <el-button type="info" icon="el-icon-plus" @click="handleAdd">活动发起</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入搜索关键字"
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ v-model="searchText"
|
|
|
+ style="width: 200px; margin-right: 10px;"
|
|
|
+ ></el-input>
|
|
|
+ <el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-row>
|
|
|
+ <el-table :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column label="活动名称" width="auto" prop="hhg_name"></el-table-column>
|
|
|
+ <el-table-column label="批次" width="100" prop="hhg_src_id"></el-table-column>
|
|
|
+ <el-table-column label="活动类型" show-overflow-tooltip width="360" prop="hhg_cate">
|
|
|
+ <template
|
|
|
+ slot-scope="scope"
|
|
|
+ >{{ scope.row.cate_info.reduce((p, c) => `${p} ${c.hh_name}` , '') }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="活动级别" width="100" prop="hhg_level"></el-table-column>
|
|
|
+ <el-table-column label="活动时间(开始-结束)" width="290">
|
|
|
+ <template
|
|
|
+ slot-scope="scope"
|
|
|
+ >{{ scope.row.hhg_kssj }} - {{ scope.row.hhg_jssj }}</template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="操作" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="handleSz(scope.row)">设置</el-button>
|
|
|
+ <el-popconfirm title="确定删除吗?" @confirm="handleDel(scope.row.hhg_id)">
|
|
|
+ <el-button
|
|
|
+ slot="reference"
|
|
|
+ type="text"
|
|
|
+ style="margin-left: 10px;"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button type="text" style="margin-left: 10px;">
|
|
|
+ 其他
|
|
|
+ <i class="el-icon-arrow-down el-icon--right" />
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item
|
|
|
+ @click.native="handleFb(scope.row)"
|
|
|
+ >{{ scope.row.hhg_fbzt_option_k === '0' ? '发布' : '已发布' }}</el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ @click.native="handleCopy(scope.row.hhg_id)"
|
|
|
+ >复制</el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ @click.native="handleSqjl(scope.row.hhg_id)"
|
|
|
+ >申请记录</el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ @click.native="handleHdjg(scope.row.hhg_id)"
|
|
|
+ >活动结果</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-row>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ <footer
|
|
|
+ class="flex-item-none"
|
|
|
+ style="display: flex;justify-content: flex-end;margin-top: 30px;"
|
|
|
+ >
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total,prev, pager, next"
|
|
|
+ :page-size="limit"
|
|
|
+ :total="total"
|
|
|
+ :current-page.sync="page"
|
|
|
+ @current-change="handleQuery"
|
|
|
+ ></el-pagination>
|
|
|
+ </footer>
|
|
|
+
|
|
|
+ <el-dialog title="设置" :visible.sync="dialogFormVisible" @closed="initDialogForm">
|
|
|
+ <el-form :model="dialogForm" label-width="100px">
|
|
|
+ <el-form-item label="评分设置">
|
|
|
+ <el-select
|
|
|
+ v-model="dialogForm.hhg_pfmb"
|
|
|
+ placeholder
|
|
|
+ style="width: 100%;"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ :remote-method="handleQueryPfmb"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="({ hp_id, hp_name }) in pfmbOptions"
|
|
|
+ :key="hp_id"
|
|
|
+ :label="hp_name"
|
|
|
+ :value="hp_id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="专家设置">
|
|
|
+ <el-select
|
|
|
+ v-model="dialogForm.hhg_zjsz"
|
|
|
+ placeholder
|
|
|
+ multiple
|
|
|
+ style="width: 100%;"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ :remote-method="handleQueryZjsz"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="({ user_id, user_realname }) in zjszOptions"
|
|
|
+ :key="user_id"
|
|
|
+ :label="user_realname"
|
|
|
+ :value="user_id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="奖项设置">
|
|
|
+ <el-input
|
|
|
+ v-model="dialogForm.hhg_jxsz"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 5 }"
|
|
|
+ placeholder="例如:一等奖 笔记本一台 一名
|
|
|
+ 二等奖 笔记本一台 一名
|
|
|
+ 三等奖 笔记本一台 一名"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="closeDialogForm">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handleEdit">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { defineComponent, ref } from "@vue/composition-api";
|
|
|
-import { queryApi } from './api';
|
|
|
+import { defineComponent, ref, getCurrentInstance, reactive } from "@vue/composition-api";
|
|
|
+import { TransitionPresets, useTransition } from '@vueuse/core'
|
|
|
+import { queryApi, deleteApi, editApi, copyApi, queryPfmbApi, queryZjszApi } from './api';
|
|
|
|
|
|
export default defineComponent({
|
|
|
setup() {
|
|
|
- const searchText = ref('')
|
|
|
|
|
|
+
|
|
|
+ const _this = getCurrentInstance().proxy
|
|
|
+
|
|
|
+ const searchText = ref('')
|
|
|
const total = ref(0)
|
|
|
const tableData = ref([])
|
|
|
- async function query() {
|
|
|
- const { data } = await queryApi()
|
|
|
- const { page_data, total_rows } = data
|
|
|
+ const limit = 7
|
|
|
+ const page = ref(1)
|
|
|
+ const alyzData = ref([0, 0, 0, 0, 0])
|
|
|
+
|
|
|
+ const outputAlyzData = useTransition(alyzData, {
|
|
|
+ duration: 1000,
|
|
|
+ transition: TransitionPresets.easeInOutCubic,
|
|
|
+ })
|
|
|
+
|
|
|
+ async function handleQuery() {
|
|
|
+ const { data } = await queryApi({
|
|
|
+ limit,
|
|
|
+ keyword: searchText.value,
|
|
|
+ page: page.value
|
|
|
+ })
|
|
|
+ const { page_data, total_rows, alyz } = data
|
|
|
|
|
|
total.value = total_rows * 1
|
|
|
tableData.value = page_data
|
|
|
+
|
|
|
+ const { hdzs, yjs, jxz, shz, wfqd } = alyz
|
|
|
+ alyzData.value = [hdzs * 1, yjs * 1, jxz * 1, shz * 1, wfqd * 1]
|
|
|
+ }
|
|
|
+
|
|
|
+ handleQuery()
|
|
|
+
|
|
|
+ function handleAdd() {
|
|
|
+ _this.$router.push('/hdlb/hdfq')
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleDel(id) {
|
|
|
+ deleteApi(id).then(() => {
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleCopy(id) {
|
|
|
+ copyApi(id).then(() => {
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleFb(row) {
|
|
|
+ const { hhg_id, hhg_fbzt_option_k } = row
|
|
|
+ editApi(hhg_id, {
|
|
|
+ hhg_fbzt: hhg_fbzt_option_k === '0' ? '1' : '0'
|
|
|
+ }).then(() => {
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function handleHdjg(id) {
|
|
|
+ _this.$router.push({ name: 'hdjg', params: { id: id } })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const currentRow = ref(null)
|
|
|
+ function handleSz(row) {
|
|
|
+ currentRow.value = row;
|
|
|
+ console.log('row :>> ', row);
|
|
|
+
|
|
|
+ row['hhg_pfmb'] && (dialogForm['hhg_pfmb'] = row['hhg_pfmb']);
|
|
|
+ row['hhg_zjsz'] && (dialogForm['hhg_zjsz'].push(...row['hhg_zjsz'].split(',')));
|
|
|
+ row['hhg_jxsz'] && (dialogForm['hhg_jxsz'] = row['hhg_jxsz']);
|
|
|
+
|
|
|
+ openDialogForm()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function handleEdit() {
|
|
|
+ const { hhg_pfmb, hhg_zjsz, hhg_jxsz } = dialogForm
|
|
|
+ editApi(currentRow.value.hhg_id, {
|
|
|
+ hhg_pfmb,
|
|
|
+ hhg_jxsz,
|
|
|
+ hhg_zjsz: hhg_zjsz.join(',')
|
|
|
+ }).then(() => {
|
|
|
+ closeDialogForm()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+ const dialogFormVisible = ref(false)
|
|
|
+ function openDialogForm() {
|
|
|
+ // handleQueryPfmb()
|
|
|
+ pfmbOptions.value.push(currentRow.value.pfmb_info)
|
|
|
+ // handleQueryZjsz()
|
|
|
+ zjszOptions.value = currentRow.value.members_zj
|
|
|
+
|
|
|
+ dialogFormVisible.value = true
|
|
|
+ }
|
|
|
+ function closeDialogForm() {
|
|
|
+ handleQuery().then(() => {
|
|
|
+ dialogFormVisible.value = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function initDialogForm() {
|
|
|
+ dialogForm['hhg_pfmb'] = '';
|
|
|
+ dialogForm['hhg_zjsz'] = [];
|
|
|
+ dialogForm['hhg_jxsz'] = '';
|
|
|
+
|
|
|
+ pfmbOptions.value = []
|
|
|
+ zjszOptions.value = []
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const dialogForm = reactive({
|
|
|
+ hhg_pfmb: '', hhg_zjsz: [], hhg_jxsz: ''
|
|
|
+ })
|
|
|
+
|
|
|
+ const pfmbOptions = ref([])
|
|
|
+ function handleQueryPfmb(value) {
|
|
|
+ queryPfmbApi({ keyword: value }).then(res => {
|
|
|
+ pfmbOptions.value = res.data.page_data
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const zjszOptions = ref([])
|
|
|
+ function handleQueryZjsz(value) {
|
|
|
+ queryZjszApi({ keyword: value }).then(res => {
|
|
|
+ zjszOptions.value = res.data.page_data
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
- query()
|
|
|
|
|
|
return {
|
|
|
+ limit,
|
|
|
+ page,
|
|
|
total,
|
|
|
tableData,
|
|
|
- query,
|
|
|
- searchText
|
|
|
+ searchText,
|
|
|
+ handleQuery,
|
|
|
+ handleAdd,
|
|
|
+ handleDel,
|
|
|
+ dialogFormVisible,
|
|
|
+ openDialogForm,
|
|
|
+ closeDialogForm,
|
|
|
+ dialogForm,
|
|
|
+ outputAlyzData,
|
|
|
+ handleHdjg,
|
|
|
+ handleSz,
|
|
|
+ handleEdit,
|
|
|
+ pfmbOptions,
|
|
|
+ zjszOptions,
|
|
|
+ handleQueryPfmb,
|
|
|
+ handleQueryZjsz,
|
|
|
+ initDialogForm,
|
|
|
+ handleCopy,
|
|
|
+ handleFb
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+@import "@/styles/mixin.scss";
|
|
|
+
|
|
|
+.count-item {
|
|
|
+ width: 180px;
|
|
|
+ height: 90px;
|
|
|
+ border-radius: 6px;
|
|
|
+ overflow: hidden;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: flex-start;
|
|
|
+ &:nth-child(1) {
|
|
|
+ .left-icon {
|
|
|
+ background-color: #4a7dbd;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ background-color: #5daaec;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-child(2) {
|
|
|
+ .left-icon {
|
|
|
+ background-color: #4a7dbd;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ background-color: #5daaec;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-child(3) {
|
|
|
+ .left-icon {
|
|
|
+ background-color: #4a7dbd;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ background-color: #5daaec;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-child(4) {
|
|
|
+ .left-icon {
|
|
|
+ background-color: #4a7dbd;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ background-color: #5daaec;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-child(5) {
|
|
|
+ .left-icon {
|
|
|
+ background-color: #4a7dbd;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ background-color: #5daaec;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ > div {
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .left-icon {
|
|
|
+ width: 80px;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .right-text {
|
|
|
+ width: 100px;
|
|
|
+ height: 100%;
|
|
|
+ padding: 10px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: start;
|
|
|
+
|
|
|
+ .count {
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|