|
@@ -6,8 +6,8 @@
|
|
|
<el-form-item :label="'规则名称'" prop="ruleName">
|
|
|
<el-input :placeholder="'请输入规则名称'" v-model="state.queryForm.ruleName" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="'触发信息'" prop="triggerInfo">
|
|
|
- <el-input :placeholder="'请输入触发信息'" v-model="state.queryForm.triggerInfo" />
|
|
|
+ <el-form-item :label="'触发信息'" prop="triggerCondition">
|
|
|
+ <el-input :placeholder="'请输入触发信息'" v-model="state.queryForm.triggerCondition" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button @click="query" class="ml10" icon="search" type="primary">
|
|
@@ -26,56 +26,46 @@
|
|
|
<el-table-column :formatter="statusFormatter" :label="'推送内容'" prop="pushContent" min-width="300"
|
|
|
show-overflow-tooltip>
|
|
|
<template #default="{ row }">
|
|
|
- <div style="display: flex; align-items: center; justify-content: center;">
|
|
|
- <el-image style="width: 100px; height: 50px;" :src="lockScreen" :fit="'cover'" />
|
|
|
- <div style="margin-left: 10px; width: 200px; text-align: left; word-break: break-all; text-wrap: auto; ">
|
|
|
- http://www.baidu.comwww.baidu.com
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <el-image v-if="row.pushType" :src="row.pushContent" style="width: 100px; height: 100px;" />
|
|
|
+ <el-link v-else :href="row.pushContent" target="_blank" style="color: #409eff;">{{ row.pushContent }}</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :formatter="statusFormatter" :label="'推送方式'" prop="pushType" min-width="100"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.pushType ? '图片' : '链接' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :formatter="statusFormatter" :label="'推送频率'" prop="pushFrequency" min-width="120"
|
|
|
show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :formatter="statusFormatter" :label="'推送时间'" prop="pushTime" min-width="200"
|
|
|
+ <el-table-column :formatter="statusFormatter" :label="'推送时间'" prop="createTime" min-width="200"
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column :formatter="statusFormatter" :label="'推送状态'" prop="pushStatus" min-width="120"
|
|
|
show-overflow-tooltip>
|
|
|
<template #default="{ row }">
|
|
|
- 已推送
|
|
|
+ {{ row.pushStatus ? '已推送' : '未推送' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :formatter="statusFormatter" :label="''" prop="triggerInfo" min-width="200" >
|
|
|
- <template #header>
|
|
|
- <div class="header-wrapper">
|
|
|
- <span>触发信息</span>
|
|
|
- <el-popover placement="top" trigger="hover" content="点击查看具体设备信息" :width="200">
|
|
|
- <template #reference>
|
|
|
- <el-icon class="header-icon">
|
|
|
- <QuestionFilled />
|
|
|
- </el-icon>
|
|
|
- </template>
|
|
|
- </el-popover>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column :formatter="statusFormatter" :label="'触发信息'" prop="triggerCondition" min-width="250" >
|
|
|
<template #default="{ row }">
|
|
|
- <div class="trigger-info" @click="showTriggerInfo(row)">
|
|
|
- <div
|
|
|
- v-if="row.triggerInfo"
|
|
|
- class="rich-content-display"
|
|
|
- v-html="row.triggerInfo"
|
|
|
- ></div>
|
|
|
+ <div style="width: 100%; text-align: left;">
|
|
|
+ 关键字:{{ row._keywords?.length ? row._keywords.join(', ') : '--' }}
|
|
|
+ <br v-if="row._ip" />
|
|
|
+ {{ row._ip ? 'IP:' + row._ip : '' }}
|
|
|
+ <br v-if="row._domain" />
|
|
|
+ {{ row._domain ? '域名:' + row._domain : '' }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :formatter="statusFormatter" :label="'触发记录'" prop="triggerRecord" min-width="150"
|
|
|
+ <el-table-column :formatter="statusFormatter" :label="'触发记录'" prop="pushDetail" min-width="250"
|
|
|
show-overflow-tooltip>
|
|
|
<template #default="{ row }">
|
|
|
- 203.104.10.10
|
|
|
+ <div class="trigger-info" @click="showTriggerInfo(row)">
|
|
|
+ {{ row.pushDetail }}
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :formatter="statusFormatter" :label="'触发时间'" prop="triggerTime" min-width="150"
|
|
|
- show-overflow-tooltip></el-table-column>
|
|
|
</el-table>
|
|
|
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
|
|
|
</div>
|
|
@@ -85,25 +75,60 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" name="marketingApps" setup>
|
|
|
-// import { pageList } from '/@/api/marketing/apps';
|
|
|
+import { getPushPage } from '/@/api/marketing/apps';
|
|
|
import { BasicTableProps, useTable } from '/@/hooks/table';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
-import { ref } from 'vue'
|
|
|
+import { ref, reactive, onMounted, defineAsyncComponent } from 'vue'
|
|
|
const dataInfoModal = defineAsyncComponent(() => import('/@/views/marketing/data/dataInfoModal.vue'));
|
|
|
import { ElImage } from 'element-plus';
|
|
|
import lockScreen from '/@/assets/lockScreen.png';
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
+const getDataListWithProcess = (params: any): Promise<any> => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ getPushPage(params).then((res: any) => {
|
|
|
+ console.log(res, 'res');
|
|
|
+ try {
|
|
|
+ if (res.data && res.data.records && res.data.records.length > 0) {
|
|
|
+ res.data.records = res.data.records.map((item: any) => {
|
|
|
+ let parsedData: any = null;
|
|
|
+ try {
|
|
|
+ if (item.triggerCondition) {
|
|
|
+ parsedData = JSON.parse(item.triggerCondition);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.warn('解析触发器条件失败:', item.triggerCondition, error);
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ _keywords: parsedData?.keywords || [],
|
|
|
+ _ip: parsedData?.ip || '',
|
|
|
+ _domain: parsedData?.domain || ''
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ resolve(res);
|
|
|
+ } catch (error: any) {
|
|
|
+ console.error('数据处理失败:', error);
|
|
|
+ reject(error);
|
|
|
+ }
|
|
|
+ }).catch((error: any) => {
|
|
|
+ reject(error);
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
// 定义变量内容
|
|
|
const tableRef = ref();
|
|
|
const queryRef = ref();
|
|
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
|
|
- // pageList: pageList,
|
|
|
+ pageList: getDataListWithProcess,
|
|
|
createdIsNeed: false,
|
|
|
queryForm: {
|
|
|
ruleName: '',
|
|
|
- triggerInfo: '',
|
|
|
+ triggerCondition: '',
|
|
|
},
|
|
|
pagination: {
|
|
|
current: 1,
|
|
@@ -115,7 +140,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
|
|
|
|
|
interface SourceData {
|
|
|
ruleName: string;
|
|
|
- triggerInfo: string;
|
|
|
+ triggerCondition: string;
|
|
|
triggerTime: string;
|
|
|
pushStatus: string;
|
|
|
pushContent: string;
|
|
@@ -124,24 +149,19 @@ interface SourceData {
|
|
|
}
|
|
|
|
|
|
const richContentDialogRef = ref();
|
|
|
-const sourceData = ref<SourceData[]>([]);
|
|
|
-
|
|
|
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state);
|
|
|
|
|
|
// 搜索事件
|
|
|
const query = (refresh: boolean = false) => {
|
|
|
state.dataList = [];
|
|
|
- // getDataList(refresh);
|
|
|
- state.dataList = sourceData.value.filter(item => item.ruleName.includes(state.queryForm.ruleName) && item.triggerInfo.includes(state.queryForm.triggerInfo));
|
|
|
- state.pagination.total = state.dataList.length;
|
|
|
+ getDataList(refresh);
|
|
|
};
|
|
|
|
|
|
// 清空搜索条件
|
|
|
const resetQuery = () => {
|
|
|
queryRef.value.resetFields();
|
|
|
- query();
|
|
|
- // state.dataList = [];
|
|
|
- // getDataList();
|
|
|
+ state.dataList = [];
|
|
|
+ getDataList();
|
|
|
};
|
|
|
|
|
|
const statusFormatter = (row: any, column: any, cellValue: any, index: any) => {
|
|
@@ -151,38 +171,17 @@ const statusFormatter = (row: any, column: any, cellValue: any, index: any) => {
|
|
|
const showTriggerInfo = (row: any) => {
|
|
|
// 信息详情弹窗
|
|
|
richContentDialogRef.value.openDialog(
|
|
|
- row.triggerInfo,
|
|
|
+ row.pushDetail,
|
|
|
{
|
|
|
- createTime: row.triggerTime,
|
|
|
- triggerKeyword: ['战略']
|
|
|
+ createTime: row.createTime,
|
|
|
+ triggerKeyword: row._keywords
|
|
|
}
|
|
|
)
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- // query();
|
|
|
- for (let i = 1; i < 11; i++) {
|
|
|
- sourceData.value.push({
|
|
|
- ruleName: '规则名称' + i,
|
|
|
- triggerInfo:`<div class="fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column"><div class="fusion-text fusion-text-4"><h2 class="fusion-responsive-typography-calculated" style="--fontsize: 36; line-height: 1.25; --fontSize: 36;" data-fontsize="36" data-lineheight="45px" id="toc">什么是产品创新?</h2>
|
|
|
-<p><span style="font-weight: 400;">产品创新是指公司或组织创造和开发新的或改进的产品、服务或流程。 它涉及引入新颖的想法、技术、功能或设计,为客户提供附加值,使产品有别于市场上现有的产品。</span></p>
|
|
|
-<p><span style="font-weight: 400;">成功的产品创新需要将创造力、<a href="https://ideascale.com/zh-hans/%e5%8d%9a%e5%ae%a2/%e4%bb%80%e4%b9%88%e6%98%af%e5%b8%82%e5%9c%ba%e7%a0%94%e7%a9%b6/">市场调研</a>、客户洞察力、技术专长和有效的项目管理结合起来。 其动力来自于满足不断变化的客户需求、领先于竞争对手以及创造可持续业务增长的愿望。</span></p>
|
|
|
-<p><b>产品创新表格</b></p>
|
|
|
-<p><span style="font-weight: 400;">成功的产品创新需要将创造力、<a href="https://ideascale.com/zh-hans/%e5%8d%9a%e5%ae%a2/%e4%bb%80%e4%b9%88%e6%98%af%e5%b8%82%e5%9c%ba%e7%a0%94%e7%a9%b6/">市场调研</a>、客户洞察力、技术专长和有效的项目管理结合起来。 以下是创造可持续业务增长的产品创新形式。</span></p>
|
|
|
-<p><strong><b>了解更多信息:<a href="https://ideascale.com/zh-hans/%e5%8d%9a%e5%ae%a2/%e4%bb%80%e4%b9%88%e6%98%af%e6%88%98%e7%95%a5%e5%88%9b%e6%96%b0/">什么是战略创新?</a></b></strong></p>
|
|
|
-</div></div>`,
|
|
|
- triggerTime: '2025-08-29 10:00:00',
|
|
|
- pushStatus: i % 2 === 0 ? '1' : '2',
|
|
|
- pushContent: i % 2 === 0 ? '1' : '2',
|
|
|
- pushFrequency: '30分钟一次',
|
|
|
- pushTime: '2025-08-29 10:00:00',
|
|
|
- });
|
|
|
- }
|
|
|
- state.dataList = sourceData.value;
|
|
|
- state.pagination.total = state.dataList.length;
|
|
|
-
|
|
|
- console.log(sourceData.value);
|
|
|
-})
|
|
|
+ query();
|
|
|
+});
|
|
|
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|