提交 45cec009 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 统计增加刷新

上级 9e90f06d
<script setup lang="ts">
import type { Group, GroupMember } from '../types'
import { UserFilled, Plus, Delete } from '@element-plus/icons-vue'
import { UserFilled, Plus, Delete, Refresh } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import AppList from '@/components/base/AppList.vue'
import { getNameByValue, groupTypeList, updateStatusRuleList, updateStatusList } from '@/utils/dictionary'
......@@ -23,7 +23,7 @@ const connectionTypeList = useMapStore().getMapValuesByKey('experiment_connectio
const detail = reactive({ count: 0, status: '1', updated_time: '-' })
function fetchInfo() {
getGroupStatistics({ group_id: props.data.id }).then(res => {
getGroupStatistics({ group_id: props.data.id }).then((res) => {
Object.assign(detail, res.data.detail)
})
}
......@@ -58,7 +58,7 @@ const listOptions = computed(() => {
return {
remote: {
httpRequest: getGroupMembers,
params: { group_id: props.data.id }
params: { group_id: props.data.id },
},
columns: [
{ label: '序号', type: 'index', width: 60 },
......@@ -69,7 +69,7 @@ const listOptions = computed(() => {
prop: 'gender',
computed({ row }: { row: GroupMember }) {
return getNameByValue(row.gender, genderList)
}
},
},
{ label: '手机号码', prop: 'mobile' },
{
......@@ -77,19 +77,19 @@ const listOptions = computed(() => {
prop: 'experiment_connection_id',
computed({ row }: { row: GroupMember }) {
return getNameByValue(row.connection.type.toString(), connectionTypeList)
}
},
},
{
label: '状态',
prop: 'status',
computed({ row }: { row: GroupMember }) {
return getNameByValue(row.status, statusList)
}
},
},
{ label: '更新人', prop: 'updated_operator.real_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x' }
]
{ label: '操作', slots: 'table-x' },
],
}
})
// 刷新
......@@ -158,6 +158,7 @@ function handleRefresh() {
:disabled="['2', '4'].includes(detail.status.toString())"
>立即更新</el-button
>
<el-button size="small" :icon="Refresh" @click="handleRefresh"></el-button>
</dd>
</dl>
</template>
......
<script setup lang="ts">
import type { Label } from '../types'
import { UserFilled } from '@element-plus/icons-vue'
import { UserFilled, Refresh } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map'
import { getNameByValue, updateStatusRuleList, updateStatusList, labelList } from '@/utils/dictionary'
import { getLabelStatistics, updateLabelStatistics, getLabelMembers } from '../api'
......@@ -17,7 +17,7 @@ const connectionTypeList = useMapStore().getMapValuesByKey('experiment_connectio
const detail = reactive({ count: 0, status: '1', updated_time: '-' })
function fetchInfo() {
getLabelStatistics({ id: props.data.id }).then(res => {
getLabelStatistics({ id: props.data.id }).then((res) => {
Object.assign(detail, res.data.detail)
})
}
......@@ -36,7 +36,7 @@ const listOptions = computed(() => {
return {
remote: {
httpRequest: getLabelMembers,
params: { tag_id: props.data.id }
params: { tag_id: props.data.id },
},
columns: [
{ label: '序号', type: 'index', width: 60 },
......@@ -47,7 +47,7 @@ const listOptions = computed(() => {
prop: 'gender',
computed({ row }: { row: any }) {
return getNameByValue(row.gender, genderList)
}
},
},
{ label: '手机号码', prop: 'mobile' },
{
......@@ -55,21 +55,26 @@ const listOptions = computed(() => {
prop: 'experiment_connection_id',
computed({ row }: { row: any }) {
return getNameByValue(row.connection.type.toString(), connectionTypeList)
}
},
},
{
label: '状态',
prop: 'status',
computed({ row }: { row: any }) {
return getNameByValue(row.status, statusList)
}
},
},
{ label: '更新人', prop: 'updated_operator.real_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x' }
]
{ label: '操作', slots: 'table-x' },
],
}
})
// 刷新
function handleRefresh() {
fetchInfo()
appList.value?.refetch()
}
</script>
<template>
......@@ -113,7 +118,15 @@ const listOptions = computed(() => {
<dt>更新状态</dt>
<dd>
<span style="margin-right: 10px">{{ getNameByValue(detail.status, updateStatusList) }}</span>
<el-button type="primary" plain @click="handleUpdate" size="small" :disabled="['2', '4'].includes(detail.status)">立即更新</el-button>
<el-button
type="primary"
plain
@click="handleUpdate"
size="small"
:disabled="['2', '4'].includes(detail.status)"
>立即更新</el-button
>
<el-button size="small" :icon="Refresh" @click="handleRefresh"></el-button>
</dd>
</dl>
</div>
......@@ -123,7 +136,11 @@ const listOptions = computed(() => {
<AppList v-bind="listOptions" ref="appList">
<template #table-x="{ row }">
<el-button type="primary" plain>
<router-link target="_blank" :to="{ path: '/user/image', query: { user_id: row.id, experiment_id: row.experiment_id } }">查看</router-link>
<router-link
target="_blank"
:to="{ path: '/user/image', query: { user_id: row.id, experiment_id: row.experiment_id } }"
>查看</router-link
>
</el-button>
</template>
</AppList>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论