提交 21cb2626 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 d458c104
......@@ -47,6 +47,11 @@ export function getGroupStatistics(params: { group_id: string }) {
return httpRequest.get('/api/lab/v1/experiment/group/statistics-detail', { params })
}
// 更新群组数据信息
export function updateGroupStatistics(data: { id: string }) {
return httpRequest.post('/api/lab/v1/experiment/group/statistics-user-group', data)
}
// 获取群组成员
export function getGroupMembers(params: { group_id: string; name?: string; id?: string }) {
return httpRequest.get('/api/lab/v1/experiment/group/members', { params })
......
......@@ -34,7 +34,7 @@ const form = reactive({
name: '',
type: '',
status: '1',
update_status: '1',
update_status: '2',
update_rule: { type: 1, info: 1 },
user_attr_rule: { current_logic_operate: 'and', items: [] },
event_attr_rule: { current_logic_operate: 'and', items: [] },
......@@ -138,7 +138,11 @@ async function handleUpdate() {
<template v-if="data.type === '2'">
<el-form-item label="更新频率" prop="update_status">
<el-radio-group v-model="form.update_status">
<el-radio v-for="item in updateStatusRuleList" :key="item.value" :label="item.value">
<el-radio
v-for="item in updateStatusRuleList"
:key="item.value"
:label="item.value"
:disabled="item.value === '1'">
{{ item.label }}
</el-radio>
</el-radio-group>
......
......@@ -3,9 +3,9 @@ import type { Group } from '../types'
import { UserFilled, Plus, Delete } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import AppList from '@/components/base/AppList.vue'
import { getNameByValue, groupTypeList, updateStatusRuleList } from '@/utils/dictionary'
import { getNameByValue, groupTypeList, updateStatusRuleList, updateStatusList } from '@/utils/dictionary'
import { useMapStore } from '@/stores/map'
import { getGroupStatistics, getGroupMembers, clearGroupMembers } from '../api'
import { getGroupStatistics, getGroupMembers, clearGroupMembers, updateGroupStatistics } from '../api'
import BindMembers from './BindMembers.vue'
const props = defineProps<{
......@@ -19,7 +19,7 @@ const emit = defineEmits<{
const statusList = useMapStore().getMapValuesByKey('system_status')
const detail = reactive({ count: 0, status: 1, updated_time: '-' })
const detail = reactive({ count: 0, status: '1', updated_time: '-' })
function fetchInfo() {
getGroupStatistics({ group_id: props.data.id }).then(res => {
Object.assign(detail, res.data.detail)
......@@ -27,6 +27,14 @@ function fetchInfo() {
}
watchEffect(() => fetchInfo())
// 立即更新
function handleUpdate() {
updateGroupStatistics({ id: props.data.id }).then(() => {
ElMessage({ type: 'success', message: '更新成功' })
fetchInfo()
})
}
// 清空群组成员
function handleClearMembers() {
ElMessageBox.confirm('确定要删清空该群组成员吗?', '提示').then(() => {
......@@ -36,6 +44,11 @@ function handleClearMembers() {
})
})
}
// 添加群组成员
let selectMembersVisible = $ref(false)
function handleAdd() {
selectMembersVisible = true
}
const appList = $ref<InstanceType<typeof AppList> | null>(null)
// 列表配置
......@@ -63,11 +76,6 @@ function handleRefresh() {
fetchInfo()
appList?.refetch()
}
// 添加群组成员
let selectMembersVisible = $ref(false)
function handleAdd() {
selectMembersVisible = true
}
</script>
<template>
......@@ -120,8 +128,8 @@ function handleAdd() {
<dl>
<dt>更新状态</dt>
<dd>
<span>完成</span>
<el-button type="primary" plain size="small">立即更新</el-button>
<span style="margin-right: 10px">{{ getNameByValue(detail.status, updateStatusList) }}</span>
<el-button type="primary" plain @click="handleUpdate" size="small">立即更新</el-button>
</dd>
</dl>
</template>
......
......@@ -53,6 +53,11 @@ export function getLabelStatistics(params: { id: string }) {
return httpRequest.get('/api/lab/v1/experiment/tag/statistics', { params })
}
// 更新标签数据信息
export function updateLabelStatistics(data: { id: string }) {
return httpRequest.post('/api/lab/v1/experiment/tag/statistics-user-tag', data)
}
// 获取标签规则
export function getLabelRule(params: { id: string }) {
return httpRequest.get('/api/lab/v1/experiment/tag/rule', { params })
......
......@@ -26,7 +26,7 @@ const form = reactive({
id: '',
name: '',
type_id: '',
update_status: '1',
update_status: '2',
update_rule: { type: 1, info: 1 },
status: '1'
})
......@@ -98,7 +98,11 @@ function handleUpdate() {
</el-form-item>
<el-form-item label="更新频率" prop="update_status">
<el-radio-group v-model="form.update_status">
<el-radio v-for="item in updateStatusRuleList" :key="item.value" :label="item.value">
<el-radio
v-for="item in updateStatusRuleList"
:key="item.value"
:label="item.value"
:disabled="item.value === '1'">
{{ item.label }}
</el-radio>
</el-radio-group>
......
......@@ -2,9 +2,9 @@
import type { Label } from '../types'
import { UserFilled } from '@element-plus/icons-vue'
import { useMapStore } from '@/stores/map'
import { getNameByValue, updateStatusRuleList } from '@/utils/dictionary'
import { getLabelStatistics } from '../api'
// import { ElMessage } from 'element-plus'
import { getNameByValue, updateStatusRuleList, updateStatusList } from '@/utils/dictionary'
import { getLabelStatistics, updateLabelStatistics } from '../api'
import { ElMessage } from 'element-plus'
const props = defineProps<{
data: Label
......@@ -12,14 +12,20 @@ const props = defineProps<{
const statusList = useMapStore().getMapValuesByKey('system_status')
const detail = reactive({ count: 0, status: 1, updated_time: '-' })
const detail = reactive({ count: 0, status: '1', updated_time: '-' })
function fetchInfo() {
getLabelStatistics({ id: props.data.id }).then(res => {
console.log(res)
Object.assign(detail, res.data.detail)
})
}
watchEffect(() => fetchInfo())
function handleUpdate() {
updateLabelStatistics({ id: props.data.id }).then(() => {
ElMessage({ type: 'success', message: '更新成功' })
fetchInfo()
})
}
</script>
<template>
......@@ -62,8 +68,8 @@ watchEffect(() => fetchInfo())
<dl>
<dt>更新状态</dt>
<dd>
<span>完成</span>
<el-button type="primary" plain size="small">立即更新</el-button>
<span style="margin-right: 10px">{{ getNameByValue(detail.status, updateStatusList) }}</span>
<el-button type="primary" plain @click="handleUpdate" size="small">立即更新</el-button>
</dd>
</dl>
</div>
......
......@@ -25,6 +25,13 @@ export const updateStatusRuleList = [
{ label: '手动更新', value: '2' }
]
// 更新状态
export const updateStatusList = [
{ label: '未开始', value: '1' },
{ label: '进行中', value: '2' },
{ label: '完成', value: '3' }
]
export const dateUnitList = [
{ label: '天', value: 1 },
{ label: '周', value: 2 },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论