提交 287f44d7 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 17054b56
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: #00ac27">${row.row.status_name}</span>`
: `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: #00ac27">${row.row.status_name}</span>`
: `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -39,7 +39,15 @@ const listOptions = computed(() => {
{ label: '资料ID', prop: 'id' },
{ label: '资料名称', prop: 'name' },
{ label: '资料类型', prop: 'type_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: #00ac27">${row.row.status_name}</span>`
: `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -28,7 +28,7 @@ const form = reactive(
name: '',
english_name: '',
experiment_connection_id: '',
status: '0'
status: '1'
}
)
......
......@@ -51,7 +51,15 @@ const listOptions = computed(() => {
{ label: '事件名称', prop: 'name' },
{ label: '所属连接', prop: 'connection_name' },
{ label: '属性字段数量', prop: 'attributes_count' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 300 }
......
......@@ -31,7 +31,7 @@ const form = reactive(
english_name: '',
type: '',
format: '',
status: '0'
status: '1'
}
)
......@@ -72,7 +72,7 @@ const experimentAttributeOptions = $ref(store.getMapValuesByKey('experiment_attr
// 属性字段类型选择后->格式的placeholder改变
const formatPlaceholder = computed(() => {
return form.type === '1' ? '请输入字符串长度' : '请输入长度'
return form.type === '1' ? '请输入字符串长度' : form.type === '3' ? '请输入小数点后位数' : '请输入长度'
})
</script>
......@@ -82,12 +82,12 @@ const formatPlaceholder = computed(() => {
<el-form-item label="属性ID" v-if="isUpdate">
{{ props.data?.id }}
</el-form-item>
<el-form-item label="属性英文名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
<el-form-item label="属性名称" prop="english_name">
<el-form-item label="属性英文名称" prop="english_name">
<el-input v-model="form.english_name" placeholder="请输入" />
</el-form-item>
<el-form-item label="属性名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
<el-form-item label="属性字段类型" prop="type">
<el-select
:disabled="isUpdate"
......@@ -112,7 +112,7 @@ const formatPlaceholder = computed(() => {
style="width: 100%"
placeholder="请选择"
>
<el-option label="yyyy-mm-dd" value="yyyy-mm-dd"></el-option>
<el-option v-if="form.type !== '5'" label="yyyy-mm-dd" value="yyyy-mm-dd"></el-option>
<el-option v-if="form.type !== '4'" label="yyyy-mm-dd hh:mm:ss" value="yyyy-mm-dd hh:mm:ss"></el-option>
</el-select>
<el-input :disabled="isUpdate" type="number" v-else v-model="form.format" :placeholder="formatPlaceholder" />
......
......@@ -44,7 +44,15 @@ const listOptions = computed(() => {
{ label: '属性英文名称', prop: 'english_name' },
{ label: '属性字段类型', prop: 'type_name' },
{ label: '属性字段格式', prop: 'format' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: #00ac27">${row.row.status_name}</span>`
: `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 240 }
......
......@@ -54,8 +54,9 @@ function handleSave() {
v-for="item in connectionList"
:key="item.id"
:class="{ 'is-active': isActive(item) }"
@click="toggleSelection(item)">
<el-checkbox :model-value="isActive(item)" />
@click="toggleSelection(item)"
>
<el-checkbox @change="toggleSelection(item)" :model-value="isActive(item)" />
<div class="connection-item__icon"><ConnectionIcon :name="item.type + ''" /></div>
<p>{{ item.name }}</p>
</div>
......
......@@ -106,7 +106,7 @@ function handleConfig(row: TripTemplate) {
<el-button type="primary" plain @click="handleConfig(row)">配置</el-button>
<el-button type="primary" plain @click="handleView(row)">查看</el-button>
<el-button type="primary" plain @click="handleUpdate(row)">编辑</el-button>
<el-button type="primary" plain @click="handleRemove(row)">删除</el-button>
<!-- <el-button type="primary" plain @click="handleRemove(row)">删除</el-button> -->
</template>
</AppList>
</AppCard>
......
......@@ -48,7 +48,7 @@ const emit = defineEmits<{
const form = $ref(
props.data || {
name: '',
status: '0',
status: '1',
experiment_connection_id: '',
gender: '',
mobile: ''
......
......@@ -52,7 +52,6 @@ const submitForm = (formEl: FormInstance | undefined) => {
a[b.id] = b.value
return a
}, {})
console.log(eventList, '123attributes')
const [data] = eventAttributes.value || []
formEl.validate(valid => {
if (valid) {
......@@ -67,9 +66,10 @@ const submitForm = (formEl: FormInstance | undefined) => {
ElMessage({ message: '更新成功', type: 'success' })
})
} else {
console.log(data, 'data')
const params = {
experiment_member_id: route.query?.user_id as '',
experiment_meta_event_id: data.experiment_meta_event_id,
experiment_meta_event_id: form.experiment_meta_event_id,
fields: attributes
}
createEvent(params).then(res => {
......@@ -87,7 +87,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
<template>
<el-dialog
title="新建用户事件数据"
:title="!props.data ? '新建用户事件属性' : '修改用户事件属性'"
:close-on-click-modal="false"
width="500px"
@update:modelValue="$emit('update:modelValue')"
......
......@@ -48,6 +48,13 @@ export interface AttributesProp {
}
export interface ImageProp {
name: string
connection_name: string
id: string
created_time: string
status_name: string
status: string
updated_time: string
tag: string[]
static_groups: string[]
dynamic_groups: string[]
......
<script setup lang="ts">
import { UserFilled } from '@element-plus/icons-vue'
import { getMemberImage, getMemberFieldsList } from '../api'
import type { MemberFieldsProp, ImageProp } from '../types'
import Icon from '../components/Icon.vue'
......@@ -36,6 +37,48 @@ const getDate = function (date: string) {
</script>
<template>
<AppCard class="card" style="margin-bottom: 10px">
<div class="info-box">
<div class="info-name" style="min-width: 300px">
<div class="tx">
<el-icon :size="50" color="#fff"><UserFilled /></el-icon>
</div>
<h1>{{ data?.name }}</h1>
<div class="line"></div>
</div>
<div style="display: flex; justify-content: space-around; width: 100%">
<el-form label-suffix=":" label-width="110px">
<el-form-item label="来源链接"
><span>{{ data?.connection_name }}</span></el-form-item
>
<el-form-item label="创建时间"
><span>{{ data?.created_time }}</span></el-form-item
>
<!-- <el-form-item label="用户ID"
><span>{{ data?.id }}</span></el-form-item
> -->
</el-form>
<el-form label-suffix=":" label-width="110px">
<el-form-item label="用户ID"
><span>{{ data?.id }}</span></el-form-item
>
<el-form-item label="状态"
><span :style="`color: ${data?.status === '1' ? 'rgba(0,172,39,1)' : '#ba143e'}`">{{
data?.status_name
}}</span></el-form-item
>
</el-form>
<el-form label-suffix=":" label-width="110px">
<el-form-item label="最近活跃时间"
><span>{{ data?.updated_time }}</span></el-form-item
>
<el-form-item label="最近活跃时间" style="opacity: 0"
><span>{{ data?.updated_time }}</span></el-form-item
>
</el-form>
</div>
</div>
</AppCard>
<div class="card-box">
<AppCard class="card" title="用户属性">
<div style="display: flex; justify-content: center; padding-right: 20px">
......@@ -51,28 +94,40 @@ const getDate = function (date: string) {
<AppCard class="card" title="标签与群组">
<el-tabs class="demo-tabs">
<el-tab-pane label="用户标签">
<div class="scroll">
<el-empty v-if="!data?.tag" description="暂无数据" :image-size="80" />
<div class="scroll" v-else>
<el-tag class="ml-2" type="success" v-for="item in data?.tag">{{ item }}</el-tag>
</div>
</el-tab-pane>
</el-tabs>
<el-tabs class="demo-tabs">
<el-tab-pane label="静态分组">
<div class="scroll">
<el-empty
v-if="!data?.static_groups || !data?.static_groups.length"
description="暂无数据"
:image-size="80"
/>
<div class="scroll" v-else>
<el-tag class="ml-2" type="success" v-for="item in data?.static_groups">{{ item }}</el-tag>
</div>
</el-tab-pane>
</el-tabs>
<el-tabs class="demo-tabs">
<el-tab-pane label="动态分组">
<div class="scroll">
<el-empty
v-if="!data?.dynamic_groups || !data?.static_groups.length"
description="暂无数据"
:image-size="80"
/>
<div class="scroll" v-else>
<el-tag class="ml-2" type="success" v-for="item in data?.dynamic_groups">{{ item }}</el-tag>
</div>
</el-tab-pane>
</el-tabs>
</AppCard>
<AppCard class="card" title="用户行为轨迹">
<div class="event-box" v-for="item in data?.events?.list">
<el-empty v-if="!data?.events?.list || !data?.events?.list.length" description="暂无数据" :image-size="80" />
<div class="event-box" v-for="item in data?.events?.list" v-else>
<div class="date">{{ item.updated_time?.slice(0, item.updated_time.indexOf(' ')) }}</div>
<div class="event-content">
<div class="time">
......@@ -102,6 +157,33 @@ const getDate = function (date: string) {
</div>
</template>
<style lang="scss">
.info-box {
display: flex;
align-items: center;
.info-name {
display: flex;
align-items: center;
.tx {
width: 80px;
height: 80px;
background: #000;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
}
h1 {
font-size: 30px;
margin-left: 20px;
}
.line {
width: 1px;
height: 100px;
background: #ccc;
margin: 0 50px;
}
}
.ml-2 {
margin-right: 10px;
}
......
......@@ -43,7 +43,15 @@ const listOptions = computed(() => {
{ label: '性别', prop: 'gender_name' },
{ label: '手机号码', prop: 'mobile' },
{ label: '来源连接', prop: 'connection_name' },
{ label: '状态', prop: 'status_name' },
{
label: '状态',
prop: 'status_name',
computed: (row: any) => {
return row.row.status === '0'
? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>`
: `<span style="color: #00ac27">${row.row.status_name}</span>`
}
},
{ label: '更新人', prop: 'updated_operator_name' },
{ label: '更新时间', prop: 'updated_time' },
{ label: '操作', slots: 'table-x', width: 380 }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论