提交 b1acbeb4 authored 作者: lhh's avatar lhh

update

上级 c1abf287
...@@ -132,14 +132,28 @@ defineExpose({ refetch, tableRef }) ...@@ -132,14 +132,28 @@ defineExpose({ refetch, tableRef })
</template> </template>
<template v-else> <template v-else>
<!-- input --> <!-- input -->
<el-input v-model="params[item.prop]" v-bind="item" clearable @change="search" v-if="item.type === 'input'" /> <el-input
v-model="params[item.prop]"
v-bind="item"
clearable
@change="search"
v-if="item.type === 'input'"
/>
<!-- select --> <!-- select -->
<el-select v-model="params[item.prop]" v-bind="item" filterable clearable @change="search" v-if="item.type === 'select'"> <el-select
v-model="params[item.prop]"
v-bind="item"
filterable
clearable
@change="search"
v-if="item.type === 'select'"
>
<el-option <el-option
v-for="(option, index) in item.options" v-for="(option, index) in item.options"
:label="option[item.labelKey] || option.label || option" :label="option[item.labelKey] || option.label || option"
:value="option[item.valueKey] || option.value || option" :value="option[item.valueKey] || option.value || option"
:key="index" /> :key="index"
/>
</el-select> </el-select>
</template> </template>
</el-form-item> </el-form-item>
...@@ -157,7 +171,13 @@ defineExpose({ refetch, tableRef }) ...@@ -157,7 +171,13 @@ defineExpose({ refetch, tableRef })
<!-- 主体 --> <!-- 主体 -->
<div class="table-list-bd"> <div class="table-list-bd">
<slot name="body" v-bind="{ data: dataList }"> <slot name="body" v-bind="{ data: dataList }">
<el-table :header-cell-style="{ background: '#ededed' }" :data="dataList" v-loading="loading" v-bind="$attrs" ref="tableRef"> <el-table
:header-cell-style="{ background: '#ededed' }"
:data="dataList"
v-loading="loading"
v-bind="$attrs"
ref="tableRef"
>
<el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop"> <el-table-column align="center" v-bind="item || {}" v-for="item in columns" :key="item.prop">
<template #default="scope" v-if="item.slots || item.computed"> <template #default="scope" v-if="item.slots || item.computed">
<slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot> <slot :name="item.slots" v-bind="scope" v-if="item.slots"></slot>
...@@ -183,7 +203,8 @@ defineExpose({ refetch, tableRef }) ...@@ -183,7 +203,8 @@ defineExpose({ refetch, tableRef })
@size-change="pageSizeChange" @size-change="pageSizeChange"
@current-change="fetchList()" @current-change="fetchList()"
:hide-on-single-page="true" :hide-on-single-page="true"
v-if="hasPagination"> v-if="hasPagination"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
......
...@@ -36,59 +36,64 @@ const platformList: PlatformItem[] = [ ...@@ -36,59 +36,64 @@ const platformList: PlatformItem[] = [
type: '2', type: '2',
type_name: '钉钉', type_name: '钉钉',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '钉钉' },
{ label: 'AgentId', prop: 'agentId', value: '' }, { label: 'AgentId', prop: 'agentId', value: '8441459810' },
{ label: 'AppKey', prop: 'appKey', value: '' }, { label: 'AppKey', prop: 'appKey', value: 'dingigucs3beqlotpf24' },
{ label: 'AppSecret', prop: 'appSecret', value: '' } { label: 'AppSecret', prop: 'appSecret', value: '6dNRvuOzvX_xq5N9tFdjepdf3FeooN25yUZK6ammDbPUVq9sfdXD-sKUg' }
] ]
}, },
{ {
type: '3', type: '3',
type_name: '小鹅通', type_name: '小鹅通',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '小鹅通' },
{ label: 'app_id', prop: 'app_id', value: '' }, { label: 'app_id', prop: 'app_id', value: 'appc4bolgenF58' },
{ label: 'client_id', prop: 'client_id', value: '' }, { label: 'client_id', prop: 'client_id', value: '_5e7f809dd6317_qSMuUoAi?type=2SDK' },
{ label: 'secret_key', prop: 'secret_key', value: '' } { label: 'secret_key', prop: 'secret_key', value: 'xiao_5ac1dd24803ae_GtfAOxiS1pdf3FeooN2huhu92WRE52S-SkOh' }
] ]
}, },
{ {
type: '4', type: '4',
type_name: '问卷星', type_name: '问卷星',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '问卷星' },
{ label: 'AppKey', prop: 'appKey', value: '' }, { label: 'AppKey', prop: 'appKey', value: '82286f9c5114dc2bda214cd9567dodc' },
{ label: 'AppSecret', prop: 'appSecret', value: '' } { label: 'AppSecret', prop: 'appSecret', value: 'pages/wjxqList/wjxqList?activityId= P251FBP' }
] ]
}, },
{ type: '5', type_name: '今日头条', config_attributes: [{ label: '连接名称', prop: 'name', value: '' }] }, { type: '5', type_name: '今日头条', config_attributes: [{ label: '连接名称', prop: 'name', value: '今日头条' }] },
{ {
type: '6', type: '6',
type_name: '抖音', type_name: '抖音',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '抖音' },
{ label: '应用类别', prop: 'dyInput1', value: '' }, { label: '应用类别', prop: 'dyInput1', value: '短视频分享与社交平台' },
{ label: '授权域回调', prop: 'dyInput2', value: '' }, { label: '授权域回调', prop: 'dyInput2', value: 'https://douyin.xiaokefu.com.cn/douYin/push/19872884' },
{ label: '网站应用简介', prop: 'dyInput3', value: '' }, {
{ label: '应用官网', prop: 'dyInput4', value: '' }, label: '网站应用简介',
{ label: '联系人姓名', prop: 'dyInput5', value: '' } prop: 'dyInput3',
value:
'不仅是下载抖音应用程序的官方渠道,也是一个展示抖音最新动态、功能更新和推广活动的平台。用户可以通过官网了解抖音的特色功能、查看热门视频、参与互动活动,以及获取帮助和教程等。官网还为创作者和企业提供了一个展示空间,让他们了解如何利用抖音平台进行内容创作、品牌推广和电子商务等。'
},
{ label: '应用官网', prop: 'dyInput4', value: 'https://www.douyin.com' },
{ label: '联系人姓名', prop: 'dyInput5', value: '清控紫荆(北京)教育股份有限公司' }
] ]
}, },
{ {
type: '7', type: '7',
type_name: '微博', type_name: '微博',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '微博' },
{ label: 'AppKey', prop: 'appKey', value: '' }, { label: 'AppKey', prop: 'appKey', value: '1206405345' },
{ label: 'AppSecret', prop: 'appSecret', value: '' } { label: 'AppSecret', prop: 'appSecret', value: '6a6095e113cd28fde6e14c7b7145c5c5' }
] ]
}, },
{ {
type: '8', type: '8',
type_name: '小红书', type_name: '小红书',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '小红书' },
{ label: 'AppKey', prop: 'appKey', value: '' }, { label: 'AppKey', prop: 'appKey', value: '6c1dd8dd64d074d56124c751f6bc240b' },
{ label: 'AppSecret', prop: 'appSecret', value: '' } { label: 'AppSecret', prop: 'appSecret', value: '' }
] ]
}, },
...@@ -96,40 +101,45 @@ const platformList: PlatformItem[] = [ ...@@ -96,40 +101,45 @@ const platformList: PlatformItem[] = [
type: '9', type: '9',
type_name: '邮箱', type_name: '邮箱',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '邮箱' },
{ label: 'client_id', prop: 'client_id', value: '' }, { label: 'client_id', prop: 'client_id', value: 'swanzhong' },
{ label: 'client_secret', prop: 'client_secret', value: '' }, { label: 'client_secret', prop: 'client_secret', value: '563a8c6a89d2368194c1c7889c508b34' },
{ label: 'token URL', prop: 'token', value: '' }, { label: 'token URL', prop: 'token', value: 'openapi/user/get' },
{ label: 'API URL', prop: 'apiUrl', value: '' } { label: 'API URL', prop: 'apiUrl', value: 'openapi/user/check' }
] ]
}, },
{ {
type: '10', type: '10',
type_name: '短信', type_name: '短信',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '短信' },
{ label: 'client_id', prop: 'client_id', value: '' }, { label: 'client_id', prop: 'client_id', value: 'FbFgN2of-mlc' },
{ label: 'SdkAppId', prop: 'sdkAppId', value: '' }, { label: 'SdkAppId', prop: 'sdkAppId', value: 'CV3X1%2FJG7mdNZm03l9puvwPAktmfw1aj8XvBb6sm696MqoW57' },
{ label: 'token URL', prop: 'token', value: '' }, { label: 'token URL', prop: 'token', value: 'https://oauth-login.cloud.ali.com/oauth2/v3/token' },
{ label: 'API URL', prop: 'apiUrl', value: '' } { label: 'API URL', prop: 'apiUrl', value: 'oauth2v3wPAktm' }
] ]
}, },
{ type_name: '内部消息', type: '11', config_attributes: [{ label: '连接名称', prop: 'name', value: '' }] }, { type_name: '内部消息', type: '11', config_attributes: [{ label: '连接名称', prop: 'name', value: '内部消息' }] },
{ {
type: '12', type: '12',
type_name: '自定义', type_name: '自定义',
config_attributes: [ config_attributes: [
{ label: '连接名称', prop: 'name', value: '' }, { label: '连接名称', prop: 'name', value: '自定义' },
{ label: 'APP类型', prop: 'appType', value: '' }, { label: 'APP类型', prop: 'appType', value: '自定义' },
{ label: 'AppId', prop: 'appId', value: '' } { label: 'AppId', prop: 'appId', value: 'Custom App ID' }
] ]
}, },
{ type: '13', type_name: '紫荆表单', icon: '99', config_attributes: [{ label: '连接名称', prop: 'name', value: '' }] }, {
type: '13',
type_name: '紫荆表单',
icon: '99',
config_attributes: [{ label: '连接名称', prop: 'name', value: '紫荆表单' }]
},
{ {
type: '14', type: '14',
type_name: '小程序', type_name: '小程序',
icon: '100', icon: '100',
config_attributes: [{ label: '连接名称', prop: 'name', value: '' }], config_attributes: [{ label: '连接名称', prop: 'name', value: '小程序' }],
async onBeforeNext(stepActive) { async onBeforeNext(stepActive) {
if (stepActive === 2) { if (stepActive === 2) {
const res = await handleSubmit() const res = await handleSubmit()
...@@ -215,7 +225,8 @@ async function handleSave() { ...@@ -215,7 +225,8 @@ async function handleSave() {
:title="props.data?.id ? '编辑连接' : '新建连接'" :title="props.data?.id ? '编辑连接' : '新建连接'"
:close-on-click-modal="false" :close-on-click-modal="false"
width="1050px" width="1050px"
@update:modelValue="value => $emit('update:modelValue', value)"> @update:modelValue="value => $emit('update:modelValue', value)"
>
<el-tabs v-model="stepActive" class="demo-tabs"> <el-tabs v-model="stepActive" class="demo-tabs">
<!-- 第一步 --> <!-- 第一步 -->
<el-tab-pane disabled lazy label="选择连接类型" :name="1" v-if="!props.data?.id"> <el-tab-pane disabled lazy label="选择连接类型" :name="1" v-if="!props.data?.id">
......
<script setup lang="ts"> <script setup lang="ts">
import { Delete, Edit, MoreFilled, EditPen, User, Avatar, PieChart, UserFilled } from '@element-plus/icons-vue' import { Delete, Edit, MoreFilled, EditPen, User, Avatar, PieChart, UserFilled, View } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import Icon from '@/components/ConnectionIcon.vue' import Icon from '@/components/ConnectionIcon.vue'
import { deleteConnection } from '../api' import { deleteConnection } from '../api'
...@@ -40,7 +40,7 @@ function handleRemove() { ...@@ -40,7 +40,7 @@ function handleRemove() {
}) })
} }
// 去查看 // 去查看
const routerView = function () { const handleView = function () {
router.push({ path: '/connect/view', query: { id: props.data.id } }) router.push({ path: '/connect/view', query: { id: props.data.id } })
} }
...@@ -70,7 +70,7 @@ const handleStudentFollow = function () { ...@@ -70,7 +70,7 @@ const handleStudentFollow = function () {
</script> </script>
<template> <template>
<div class="connect-item" @click="routerView"> <div class="connect-item">
<div class="connect-item_top"> <div class="connect-item_top">
<!-- <div class="connect-item__edit"> <!-- <div class="connect-item__edit">
<img @click="edit" src="https://webapp-pub.ezijing.com/pages/assa/dml_edit.png" /> <img @click="edit" src="https://webapp-pub.ezijing.com/pages/assa/dml_edit.png" />
...@@ -92,6 +92,10 @@ const handleStudentFollow = function () { ...@@ -92,6 +92,10 @@ const handleStudentFollow = function () {
</template> </template>
<template #default> <template #default>
<ul class="connect-item_tool"> <ul class="connect-item_tool">
<li @click.stop="handleView" v-if="userStore.role?.id !== 1">
<el-icon size="16" color="#000"><View /></el-icon>
<span>查看</span>
</li>
<li @click.stop="handleStudentFollow" v-if="userStore.role?.id === 1"> <li @click.stop="handleStudentFollow" v-if="userStore.role?.id === 1">
<el-icon size="16" color="#000"><UserFilled /></el-icon> <el-icon size="16" color="#000"><UserFilled /></el-icon>
<span>用户触达</span> <span>用户触达</span>
......
...@@ -27,7 +27,7 @@ let ruleForm = $ref<any>({ ...@@ -27,7 +27,7 @@ let ruleForm = $ref<any>({
name: 1, name: 1,
name_value: '', name_value: '',
status: 1, status: 1,
gender: 1, gender: 100,
mobile: 1, mobile: 1,
create_data: '', create_data: '',
type_name: '' type_name: ''
...@@ -80,6 +80,13 @@ const submitForm = async (formEl: FormInstance | undefined, bl: string) => { ...@@ -80,6 +80,13 @@ const submitForm = async (formEl: FormInstance | undefined, bl: string) => {
} }
const rules = [{ required: true }] const rules = [{ required: true }]
let genderWoman = ref(0)
watchEffect(() => {
if (ruleForm.gender > 100) ruleForm.gender = 100
if (ruleForm.gender < 0) ruleForm.gender = 0
genderWoman.value = 100 - ruleForm.gender
})
</script> </script>
<template> <template>
...@@ -107,6 +114,7 @@ const rules = [{ required: true }] ...@@ -107,6 +114,7 @@ const rules = [{ required: true }]
<el-radio :value="5000">5000</el-radio> <el-radio :value="5000">5000</el-radio>
<el-radio :value="10000">10000</el-radio> <el-radio :value="10000">10000</el-radio>
</el-radio-group> </el-radio-group>
<span style="color: #ccc;font-size: 12px;line-height: 100%;">注意:为了保障系统性能,您最多只能导入10000条数据</span>
</el-form-item> </el-form-item>
<el-form-item label="请选择数据覆盖形式:" :rules="rules"> <el-form-item label="请选择数据覆盖形式:" :rules="rules">
<el-radio-group v-model="ruleForm.cover_type"> <el-radio-group v-model="ruleForm.cover_type">
...@@ -134,11 +142,17 @@ const rules = [{ required: true }] ...@@ -134,11 +142,17 @@ const rules = [{ required: true }]
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="性别" :rules="rules"> <el-form-item label="性别" :rules="rules">
<el-radio-group v-model="ruleForm.gender"> <!-- <el-radio-group v-model="ruleForm.gender">
<el-radio :value="1">随机</el-radio> <el-radio :value="1">随机</el-radio>
<el-radio :value="2"></el-radio> <el-radio :value="2"></el-radio>
<el-radio :value="3"></el-radio> <el-radio :value="3"></el-radio>
</el-radio-group> </el-radio-group> -->
<div>
<div style="display: flex">&nbsp;&nbsp;<el-input v-model="ruleForm.gender"></el-input>&nbsp;&nbsp;%</div>
<div style="display: flex; margin-top: 10px">
&nbsp;&nbsp;<el-input v-model="genderWoman"></el-input>&nbsp;&nbsp;%
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item label="手机号吗" :rules="rules"> <el-form-item label="手机号吗" :rules="rules">
<el-radio-group v-model="ruleForm.mobile"> <el-radio-group v-model="ruleForm.mobile">
......
...@@ -41,7 +41,10 @@ const platformList = [ ...@@ -41,7 +41,10 @@ const platformList = [
{ {
title: '重新获取公众号信息', title: '重新获取公众号信息',
async onClick() { async onClick() {
await asyncOfficialAccountInfo({ connection_id: connectId.value, appid: getAttributeValueByProp('appid') }) await asyncOfficialAccountInfo({
connection_id: connectId.value,
appid: getAttributeValueByProp('appid')
})
ElMessage.success('重新获取公众号信息成功') ElMessage.success('重新获取公众号信息成功')
} }
}, },
...@@ -49,8 +52,14 @@ const platformList = [ ...@@ -49,8 +52,14 @@ const platformList = [
title: '重新获取公众号粉丝', title: '重新获取公众号粉丝',
async onClick() { async onClick() {
const nikeName = getAttributeValueByProp('nikeName') const nikeName = getAttributeValueByProp('nikeName')
await ElMessageBox.confirm(`同步微信公众号粉丝能够将微信粉丝的最新信息同步到本系统中,您确定现在要开始同步公众号“${nikeName}”的粉丝吗?`, '同步微信公众号粉丝') await ElMessageBox.confirm(
await asyncOfficialAccountUsers({ connection_id: connectId.value, appid: getAttributeValueByProp('appid') }) `同步微信公众号粉丝能够将微信粉丝的最新信息同步到本系统中,您确定现在要开始同步公众号“${nikeName}”的粉丝吗?`,
'同步微信公众号粉丝'
)
await asyncOfficialAccountUsers({
connection_id: connectId.value,
appid: getAttributeValueByProp('appid')
})
ElMessage.success(`已经开始同步公众号“${nikeName}”的粉丝,完成时间取决于您公众号的粉丝数量,请耐心等待。`) ElMessage.success(`已经开始同步公众号“${nikeName}”的粉丝,完成时间取决于您公众号的粉丝数量,请耐心等待。`)
} }
} }
...@@ -544,7 +553,9 @@ const surveyKingDialogVisible = ref<boolean>(false) ...@@ -544,7 +553,9 @@ const surveyKingDialogVisible = ref<boolean>(false)
<el-tabs class="tabs-box" v-for="(item, index) in platformDataList" :key="index"> <el-tabs class="tabs-box" v-for="(item, index) in platformDataList" :key="index">
<el-tab-pane :label="item.title"> <el-tab-pane :label="item.title">
<div class="tag-box" v-if="item.children.length"> <div class="tag-box" v-if="item.children.length">
<div class="tag" v-for="cItem in item.children" :key="cItem.title" @click="handleClick(cItem)">{{ cItem.title }}</div> <div class="tag" v-for="cItem in item.children" :key="cItem.title" @click="handleClick(cItem)">
{{ cItem.title }}
</div>
</div> </div>
<div class="tag-null" v-else>无数据</div> <div class="tag-null" v-else>无数据</div>
</el-tab-pane> </el-tab-pane>
...@@ -554,7 +565,8 @@ const surveyKingDialogVisible = ref<boolean>(false) ...@@ -554,7 +565,8 @@ const surveyKingDialogVisible = ref<boolean>(false)
v-model="surveyKingDialogVisible" v-model="surveyKingDialogVisible"
:account="getAttributeValueByProp('account')" :account="getAttributeValueByProp('account')"
:password="getAttributeValueByProp('password')" :password="getAttributeValueByProp('password')"
v-if="detail?.type === '13'"></SurveyKingDialog> v-if="detail?.type === '13'"
></SurveyKingDialog>
</template> </template>
<style lang="scss"> <style lang="scss">
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import type { EventProp, EventDetailProp, EventAttributesProp } from '../types' import type { EventProp, EventDetailProp, EventAttributesProp } from '../types'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { Close } from '@element-plus/icons-vue' import { Close, QuestionFilled } from '@element-plus/icons-vue'
import { getMetaEventDetail, updateAttributes, getIsDeleteAttribute } from '../api' import { getMetaEventDetail, updateAttributes, getIsDeleteAttribute } from '../api'
const store = useMapStore() const store = useMapStore()
...@@ -86,10 +86,37 @@ const changeFormatType = function (row: any) { ...@@ -86,10 +86,37 @@ const changeFormatType = function (row: any) {
break break
} }
} }
const popoverText = function (row: any) {
let t = ''
if (row.type === '1') {
t = '你可以在这个字段中输入最多25个字符'
}
if (row.type === '2') {
t = '该字段可以存储最多四位数的整数'
}
if (row.type === '3') {
t = '数字的总长度为20位,包括整数部分和小数部分'
}
if (row.type === '4') {
t =
'yyyy: 表示四位数的年份,例如2023年会被表示为“2023”。<br/>mm: 表示两位数的月份,从01到12,例如3月表示为“03”。<br/>dd: 表示两位数的日期,从01到31,具体取决于月份和是否为闰年。<br/>例如“2023-04-01”代表的是2023年4月1日'
}
if (row.type === '5') {
t =
'yyyy: 表示四位数的年份,例如2023。<br/>mm: 表示两位数的月份,从01到12表示1月到12月。<br/>dd: 表示两位数的日期,从01到31,依据具体月份和是否为闰年。<br/>hh: 表示两位数的小时,使用24小时制,从00到23表示。<br/>mm: 表示两位数的分钟,从00到59。<br/>ss: 表示两位数的秒,从00到59。<br/>例如"2023-04-01 15:30:45"表示的是2023年4月1日下午3点30分45秒'
}
return t
}
</script> </script>
<template> <template>
<el-dialog title="事件属性" :close-on-click-modal="false" width="800px" @update:modelValue="value => $emit('update:modelValue', value)"> <el-dialog
title="事件属性"
:close-on-click-modal="false"
width="800px"
@update:modelValue="value => $emit('update:modelValue', value)"
>
<div style="display: flex; justify-content: space-around"> <div style="display: flex; justify-content: space-around">
<el-form label-width="120px"> <el-form label-width="120px">
<el-form-item label="事件英文名称:">{{ eventDetail?.english_name }}</el-form-item> <el-form-item label="事件英文名称:">{{ eventDetail?.english_name }}</el-form-item>
...@@ -120,23 +147,55 @@ const changeFormatType = function (row: any) { ...@@ -120,23 +147,55 @@ const changeFormatType = function (row: any) {
</el-table-column> </el-table-column>
<el-table-column label="字段类型"> <el-table-column label="字段类型">
<template #default="scope"> <template #default="scope">
<el-select @change="changeFormatType(scope.row)" :disabled="scope.row.id !== ''" v-model="scope.row.type" placeholder="请选择"> <el-select
<el-option :label="item.label" :value="item.value" :key="item.id" v-for="item in experimentAttributeOptions"></el-option> @change="changeFormatType(scope.row)"
:disabled="scope.row.id !== ''"
v-model="scope.row.type"
placeholder="请选择"
>
<el-option
:label="item.label"
:value="item.value"
:key="item.id"
v-for="item in experimentAttributeOptions"
></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="字段格式"> <el-table-column label="字段格式">
<template #default="scope"> <template #default="scope">
<el-select :disabled="scope.row.id !== ''" v-if="scope.row.type === '4' || scope.row.type === '5'" v-model="scope.row.format" placeholder="请选择"> <el-select
:disabled="scope.row.id !== ''"
v-if="scope.row.type === '4' || scope.row.type === '5'"
v-model="scope.row.format"
placeholder="请选择"
>
<el-option v-if="scope.row.type !== '5'" label="yyyy-mm-dd" value="yyyy-mm-dd"></el-option> <el-option v-if="scope.row.type !== '5'" label="yyyy-mm-dd" value="yyyy-mm-dd"></el-option>
<el-option v-if="scope.row.type !== '4'" label="yyyy-mm-dd hh:mm:ss" value="yyyy-mm-dd hh:mm:ss"></el-option> <el-option
v-if="scope.row.type !== '4'"
label="yyyy-mm-dd hh:mm:ss"
value="yyyy-mm-dd hh:mm:ss"
></el-option>
</el-select> </el-select>
<el-input <el-input
v-else v-else
:disabled="scope.row.id !== ''" :disabled="scope.row.id !== ''"
type="number" type="number"
v-model="scope.row.format" v-model="scope.row.format"
:placeholder="scope.row.type === '1' ? '请输入字符串长度' : '请输入长度'"></el-input> :placeholder="scope.row.type === '1' ? '请输入字符串长度' : '请输入长度'"
></el-input>
</template>
</el-table-column>
<el-table-column width="30">
<template #default="scope">
<el-popover placement="top-start" :width="300" trigger="hover" :title="scope?.row.type_name">
<template #reference>
<div style="display: flex; justify-content: center; cursor: pointer">
<el-icon size="20"><QuestionFilled /></el-icon>
</div>
</template>
<div v-html="popoverText(scope.row)"></div>
</el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="30"> <el-table-column width="30">
......
...@@ -4,6 +4,7 @@ import type { FormInstance, FormRules } from 'element-plus' ...@@ -4,6 +4,7 @@ import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
import { createMemberMeta, updateMemberMeta } from '../api' import { createMemberMeta, updateMemberMeta } from '../api'
import { QuestionFilled } from '@element-plus/icons-vue'
const store = useMapStore() const store = useMapStore()
...@@ -94,10 +95,37 @@ const changeFormatType = function () { ...@@ -94,10 +95,37 @@ const changeFormatType = function () {
break break
} }
} }
const popoverText = function (type: any) {
let t = ''
if (type === '1') {
t = '你可以在这个字段中输入最多25个字符'
}
if (type === '2') {
t = '该字段可以存储最多四位数的整数'
}
if (type === '3') {
t = '数字的总长度为20位,包括整数部分和小数部分'
}
if (type === '4') {
t =
'yyyy: 表示四位数的年份,例如2023年会被表示为“2023”。<br/>mm: 表示两位数的月份,从01到12,例如3月表示为“03”。<br/>dd: 表示两位数的日期,从01到31,具体取决于月份和是否为闰年。<br/>例如“2023-04-01”代表的是2023年4月1日'
}
if (type === '5') {
t =
'yyyy: 表示四位数的年份,例如2023。<br/>mm: 表示两位数的月份,从01到12表示1月到12月。<br/>dd: 表示两位数的日期,从01到31,依据具体月份和是否为闰年。<br/>hh: 表示两位数的小时,使用24小时制,从00到23表示。<br/>mm: 表示两位数的分钟,从00到59。<br/>ss: 表示两位数的秒,从00到59。<br/>例如"2023-04-01 15:30:45"表示的是2023年4月1日下午3点30分45秒'
}
return t
}
</script> </script>
<template> <template>
<el-dialog :title="title" :close-on-click-modal="false" width="600px" @update:modelValue="value => $emit('update:modelValue', value)"> <el-dialog
:title="title"
:close-on-click-modal="false"
width="600px"
@update:modelValue="value => $emit('update:modelValue', value)"
>
<el-form ref="formRef" :model="form" :rules="rules" label-suffix=":" label-width="122px"> <el-form ref="formRef" :model="form" :rules="rules" label-suffix=":" label-width="122px">
<el-form-item label="属性ID" v-if="isUpdate"> <el-form-item label="属性ID" v-if="isUpdate">
{{ props.data?.id }} {{ props.data?.id }}
...@@ -109,16 +137,48 @@ const changeFormatType = function () { ...@@ -109,16 +137,48 @@ const changeFormatType = function () {
<el-input v-model="form.name" placeholder="请输入" /> <el-input v-model="form.name" placeholder="请输入" />
</el-form-item> </el-form-item>
<el-form-item label="属性字段类型" prop="type"> <el-form-item label="属性字段类型" prop="type">
<el-select :disabled="isUpdate" @change="changeFormatType" v-model="form.type" style="width: 100%" placeholder="请选择"> <el-select
<el-option :label="item.label" :value="item.value" :key="item.id" v-for="item in experimentAttributeOptions"></el-option> :disabled="isUpdate"
@change="changeFormatType"
v-model="form.type"
style="width: 100%"
placeholder="请选择"
>
<el-option
:label="item.label"
:value="item.value"
:key="item.id"
v-for="item in experimentAttributeOptions"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="属性字段格式" prop="format" v-if="form.type !== ''"> <el-form-item label="属性字段格式" prop="format" v-if="form.type !== ''">
<el-select :disabled="isUpdate" v-if="form.type === '4' || form.type === '5'" v-model="form.format" style="width: 100%" placeholder="请选择"> <el-select
:disabled="isUpdate"
v-if="form.type === '4' || form.type === '5'"
v-model="form.format"
style="width: 93%; margin-right: 10px"
placeholder="请选择"
>
<el-option v-if="form.type !== '5'" 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-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-select>
<el-input :disabled="isUpdate" type="number" v-else v-model="form.format" :placeholder="formatPlaceholder" /> <el-input
style="width: 93%; margin-right: 10px"
:disabled="isUpdate"
type="number"
v-else
v-model="form.format"
:placeholder="formatPlaceholder"
/>
<el-popover placement="top-start" :width="300" trigger="hover" :title="form.type_name">
<template #reference>
<div style="display: flex; justify-content: center; cursor: pointer">
<el-icon size="20"><QuestionFilled /></el-icon>
</div>
</template>
<div v-html="popoverText(form.type)"></div>
</el-popover>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-switch v-model="form.status" active-text="生效" inactive-text="失效" active-value="1" inactive-value="0" /> <el-switch v-model="form.status" active-text="生效" inactive-text="失效" active-value="1" inactive-value="0" />
......
<script setup lang="ts"> <script setup lang="ts">
import { getProgress } from '../api' import { getProgress } from '../api'
import AppList from '@/components/base/AppList.vue'
defineEmits<{ defineEmits<{
(e: 'update'): void (e: 'update'): void
...@@ -34,7 +35,8 @@ const listOptions = computed(() => { ...@@ -34,7 +35,8 @@ const listOptions = computed(() => {
} }
}, },
{ label: '更新人', prop: 'updated_operator_name' }, { label: '更新人', prop: 'updated_operator_name' },
{ label: '导入时间', prop: 'created_time' } { label: '导入时间', prop: 'created_time' },
{ label: '操作', slots: 'table-x', width: '100' }
] ]
} }
}) })
...@@ -47,6 +49,12 @@ const bytesToSize = (bytes: number) => { ...@@ -47,6 +49,12 @@ const bytesToSize = (bytes: number) => {
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i] return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]
} }
const appList = $ref<InstanceType<typeof AppList> | null>(null)
const refetch = function () {
appList?.refetch()
}
</script> </script>
<template> <template>
<el-dialog <el-dialog
...@@ -54,7 +62,12 @@ const bytesToSize = (bytes: number) => { ...@@ -54,7 +62,12 @@ const bytesToSize = (bytes: number) => {
title="导入用户数据" title="导入用户数据"
:close-on-click-modal="false" :close-on-click-modal="false"
width="900px" width="900px"
@update:modelValue="value => $emit('update:modelValue', value)"> @update:modelValue="value => $emit('update:modelValue', value)"
<AppList v-bind="listOptions" ref="appList"></AppList> >
<AppList v-bind="listOptions" ref="appList">
<template #table-x="{ row }">
<el-button type="primary" plain @click="refetch" v-permission="'v1-experiment-member-delete'">刷新</el-button>
</template>
</AppList>
</el-dialog> </el-dialog>
</template> </template>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论