提交 7afc9c57 authored 作者: lihuihui's avatar lihuihui

update

上级 287f44d7
...@@ -138,7 +138,8 @@ defineExpose({ refetch, tableRef }) ...@@ -138,7 +138,8 @@ defineExpose({ refetch, tableRef })
clearable clearable
@change="search" @change="search"
style="width: 200px" style="width: 200px"
v-if="item.type === 'input'" /> v-if="item.type === 'input'"
/>
<!-- select --> <!-- select -->
<el-select <el-select
v-model="params[item.prop]" v-model="params[item.prop]"
...@@ -146,12 +147,14 @@ defineExpose({ refetch, tableRef }) ...@@ -146,12 +147,14 @@ defineExpose({ refetch, tableRef })
filterable filterable
clearable clearable
@change="search" @change="search"
v-if="item.type === 'select'"> 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>
...@@ -170,12 +173,12 @@ defineExpose({ refetch, tableRef }) ...@@ -170,12 +173,12 @@ 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 <el-table
stripe
:header-cell-style="{ background: '#ededed' }" :header-cell-style="{ background: '#ededed' }"
:data="dataList" :data="dataList"
v-loading="loading" v-loading="loading"
v-bind="$attrs" v-bind="$attrs"
ref="tableRef"> 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>
...@@ -201,7 +204,8 @@ defineExpose({ refetch, tableRef }) ...@@ -201,7 +204,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>
......
...@@ -22,7 +22,7 @@ const form = $ref( ...@@ -22,7 +22,7 @@ const form = $ref(
props.data || { props.data || {
name: '', name: '',
content: '', content: '',
status: '' status: '1'
} }
) )
......
<script setup lang="ts"> <script setup lang="ts">
import { Delete, Edit } from '@element-plus/icons-vue' import { Delete, Edit } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import Icon from '../components/Icon.vue' import Icon from '@/components/ConnectionIcon.vue'
import { deleteConnection } from '../api' import { deleteConnection } from '../api'
const props = defineProps<{ data: { id: string; type_name: string; type: string } }>() const props = defineProps<{ data: { id: string; type_name: string; type: string } }>()
...@@ -39,9 +39,9 @@ const edit = function () { ...@@ -39,9 +39,9 @@ const edit = function () {
</div> </div>
<div @click="routerView" style="display: flex; width: 100%; flex-direction: column; align-items: center"> <div @click="routerView" style="display: flex; width: 100%; flex-direction: column; align-items: center">
<div class="connect-item__icon"> <div class="connect-item__icon">
<Icon class="svg" :name="data?.type"></Icon> <Icon w="40" h="40" :multicolour="true" class="svg" :name="data?.type"></Icon>
</div> </div>
<p>{{ data?.type_name }}</p> <p style="font-size: 18px;margin-top: 8px;">{{ data?.type_name }}</p>
</div> </div>
</div> </div>
</template> </template>
......
<script setup lang="ts"> <script setup lang="ts">
import type { IconProp } from '../types' import type { IconProp } from '../types'
import Icon from '../components/Icon.vue' import Icon from '@/components/ConnectionIcon.vue'
// icon // icon
const iconItems = $ref<IconProp[]>([ const iconItems = $ref<IconProp[]>([
...@@ -37,7 +37,7 @@ defineExpose({ getData }) ...@@ -37,7 +37,7 @@ defineExpose({ getData })
<div class="connect-from_icon__box"> <div class="connect-from_icon__box">
<div v-for="item in iconItems" :key="item.name" :class="item.checkbox ? 'mr20-mt20 active' : 'mr20-mt20'"> <div v-for="item in iconItems" :key="item.name" :class="item.checkbox ? 'mr20-mt20 active' : 'mr20-mt20'">
<div @click="handleIcon(item)" class="connect-form_icon"> <div @click="handleIcon(item)" class="connect-form_icon">
<Icon class="svg" :name="item.name"></Icon> <Icon :multicolour="item.checkbox" class="svg" :name="item.name"></Icon>
</div> </div>
<div class="name">{{ item.label }}</div> <div class="name">{{ item.label }}</div>
</div> </div>
...@@ -57,8 +57,7 @@ defineExpose({ getData }) ...@@ -57,8 +57,7 @@ defineExpose({ getData })
color: #ba143e; color: #ba143e;
} }
.connect-form_icon { .connect-form_icon {
box-shadow: 0 0 10px rgb(186, 20, 62, 0.5); box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.2);
border: 1px solid #ba143e;
} }
} }
} }
...@@ -70,14 +69,11 @@ defineExpose({ getData }) ...@@ -70,14 +69,11 @@ defineExpose({ getData })
width: 70px; width: 70px;
height: 70px; height: 70px;
border-radius: 50%; border-radius: 50%;
border: 1px solid #000;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
&:hover { box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 10px rgb(0 0 0 / 50%);
}
} }
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import Icon from '../components/Icon.vue' import Icon from '@/components/ConnectionIcon.vue'
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
import { getConnectionDetails } from '../api' import { getConnectionDetails } from '../api'
...@@ -452,7 +452,7 @@ const abilityItem = computed(() => { ...@@ -452,7 +452,7 @@ const abilityItem = computed(() => {
<AppCard title="查看链接"> <AppCard title="查看链接">
<div class="view-info"> <div class="view-info">
<div class="view-info_icon"> <div class="view-info_icon">
<Icon :name="dataDetail?.type || '0'" w="50" h="50"></Icon> <Icon :multicolour="true" :name="dataDetail?.type || '0'" w="50" h="50"></Icon>
</div> </div>
<div class="view-info_content"> <div class="view-info_content">
<p>链接名称:{{ dataDetail?.type_name }}</p> <p>链接名称:{{ dataDetail?.type_name }}</p>
...@@ -479,10 +479,11 @@ const abilityItem = computed(() => { ...@@ -479,10 +479,11 @@ const abilityItem = computed(() => {
width: 100px; width: 100px;
height: 100px; height: 100px;
border-radius: 50%; border-radius: 50%;
border: 1px solid #000; // border: 1px solid #000;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 2px 2px 10px 0px rgba(0, 0, 0, 0.2);
} }
.view-info_content { .view-info_content {
margin-left: 20px; margin-left: 20px;
......
...@@ -8,23 +8,31 @@ defineProps<Props>() ...@@ -8,23 +8,31 @@ defineProps<Props>()
<template> <template>
<el-dialog title="查看事件属性" :close-on-click-modal="false" width="600px"> <el-dialog title="查看事件属性" :close-on-click-modal="false" width="600px">
<el-form label-suffix=":" label-width="120px"> <div style="display: flex; justify-content: center">
<el-form-item label="事件ID"> <el-form label-suffix=":" label-width="120px">
{{ data.id }} <el-form-item label="事件ID">
</el-form-item> {{ data.id }}
<el-form-item label="事件英文名称"> </el-form-item>
{{ data.english_name }} <el-form-item label="事件英文名称">
</el-form-item> {{ data.english_name }}
<el-form-item label="事件名称"> </el-form-item>
{{ data.name }} <el-form-item label="事件名称">
</el-form-item> {{ data.name }}
<el-form-item label="所属连接"> </el-form-item>
{{ data.connection_name }} <el-form-item label="所属连接">
</el-form-item> {{ data.connection_name }}
<el-form-item label="状态"> </el-form-item>
{{ data.status_name }} <el-form-item label="状态">
</el-form-item> {{ data.status_name }}
</el-form> </el-form-item>
<el-form-item label="更新人">
{{ data.updated_operator_name }}
</el-form-item>
<el-form-item label="更新时间">
{{ data.updated_time }}
</el-form-item>
</el-form>
</div>
<template #footer> <template #footer>
<el-row justify="center"> <el-row justify="center">
<el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button> <el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
......
...@@ -6,6 +6,8 @@ export interface EventProp { ...@@ -6,6 +6,8 @@ export interface EventProp {
status: string status: string
connection_name: string connection_name: string
status_name: string status_name: string
updated_operator_name: string
updated_time: string
} }
export interface ConnectionOptionProp { type_name: string; id: string } export interface ConnectionOptionProp { type_name: string; id: string }
......
...@@ -8,26 +8,34 @@ defineProps<Props>() ...@@ -8,26 +8,34 @@ defineProps<Props>()
<template> <template>
<el-dialog title="查看用户属性" :close-on-click-modal="false" width="600px"> <el-dialog title="查看用户属性" :close-on-click-modal="false" width="600px">
<el-form label-suffix=":" label-width="110px"> <div style="display: flex; justify-content: center">
<el-form-item label="属性ID"> <el-form label-suffix=":" label-width="110px">
{{ data.id }} <el-form-item label="属性ID">
</el-form-item> {{ data.id }}
<el-form-item label="属性英文名称"> </el-form-item>
{{ data.english_name }} <el-form-item label="属性英文名称">
</el-form-item> {{ data.english_name }}
<el-form-item label="属性名称"> </el-form-item>
{{ data.name }} <el-form-item label="属性名称">
</el-form-item> {{ data.name }}
<el-form-item label="属性字段类型"> </el-form-item>
{{ data.type_name }} <el-form-item label="属性字段类型">
</el-form-item> {{ data.type_name }}
<el-form-item label="属性字段格式"> </el-form-item>
{{ data.format }} <el-form-item label="属性字段格式">
</el-form-item> {{ data.format }}
<el-form-item label="状态"> </el-form-item>
{{ data.status_name }} <el-form-item label="状态">
</el-form-item> {{ data.status_name }}
</el-form> </el-form-item>
<el-form-item label="更新人">
{{ data.updated_operator_name }}
</el-form-item>
<el-form-item label="更新时间">
{{ data.updated_time }}
</el-form-item>
</el-form>
</div>
<template #footer> <template #footer>
<el-row justify="center"> <el-row justify="center">
<el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button> <el-button round auto-insert-space @click="$emit('update:modelValue', false)">关闭</el-button>
......
...@@ -7,4 +7,6 @@ export interface UserProp { ...@@ -7,4 +7,6 @@ export interface UserProp {
status: string status: string
type_name: string type_name: string
status_name: string status_name: string
updated_operator_name: string
updated_time: string
} }
...@@ -49,8 +49,8 @@ const listOptions = computed(() => { ...@@ -49,8 +49,8 @@ const listOptions = computed(() => {
prop: 'status_name', prop: 'status_name',
computed: (row: any) => { computed: (row: any) => {
return row.row.status === '0' 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>`
: `<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_operator_name' },
......
...@@ -26,10 +26,11 @@ const getConnectionsList = function () { ...@@ -26,10 +26,11 @@ const getConnectionsList = function () {
let fieldsList = $ref<MemberFieldsProp[]>([]) let fieldsList = $ref<MemberFieldsProp[]>([])
const getFieldsList = function () { const getFieldsList = function () {
getMemberFieldsList().then((res: { data: MemberFieldsProp[] }) => { getMemberFieldsList().then((res: { data: MemberFieldsProp[] }) => {
fieldsList = res.data.map(item => { console.log(res, 'res', props.data?.fields)
fieldsList = res.data.map((item: any) => {
item.value = '' item.value = ''
if (props.data) { if (props.data) {
item.value = JSON.parse(props.data?.fields)[item.id] item.value = props.data?.fields[item.id]
} }
return item return item
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论