300 lines
8.8 KiB
Vue
Raw Normal View History

2024-08-16 09:55:26 +08:00
<template>
<div class="app-container" style="display: flex;flex-wrap: wrap">
<!-- <el-col :span="8" v-for="(o, index) in 1" :key="o" :offset="index > 0 ? 2 : 0">-->
<el-card class="box-card">
<div class="container">
2024-08-23 09:46:53 +08:00
<el-button type="primary" plain @click="handleAdd" style="border: none;">
2024-08-16 09:55:26 +08:00
+ 新建表单
</el-button>
</div>
</el-card>
2024-08-23 09:46:53 +08:00
<el-card class="box-card" v-for="o in cardList" :key="o.id">
<template #header>
<div class="clearfix">
<span
style="font-size: 23px;
2024-08-16 09:55:26 +08:00
color: #000000;
background-color:#ffffff;
2024-08-23 09:46:53 +08:00
border-color: #fdfdff;">{{ o.title }}</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handelExtend(o.id)">推广</el-button>
</div>
</template>
2024-08-16 09:55:26 +08:00
<div style="display: flex;justify-content: space-between">
<!-- <div style="width: 30%">-->
<!-- <div>采购员</div>-->
<!-- <p style="font-size: 25px">1</p>-->
<!-- </div>-->
<div style="width: 30%">
2024-08-23 09:46:53 +08:00
<div
style="font-size: 18px;
2024-08-16 09:55:26 +08:00
color: #999595;
background-color:#ffffff;
border-color: #fdfdff;">总浏览量</div>
2024-08-23 09:46:53 +08:00
<p style="font-size: 25px">{{ o.pageView }}</p>
2024-08-16 09:55:26 +08:00
</div>
<div style="width: 30%">
2024-08-23 09:46:53 +08:00
<el-link
style="font-size: 18px;
2024-08-16 09:55:26 +08:00
color: #999595;
background-color:#ffffff;
2024-08-23 09:46:53 +08:00
border-color: #fdfdff;" @click="extendList(o.id)">采集数量</el-link>
<p style="font-size: 25px" @click="extendList(o.id)">{{ o.collectionQuantity }}</p>
2024-08-16 09:55:26 +08:00
</div>
</div>
<div style="display: flex;justify-content: space-between">
<div>
2024-08-23 09:46:53 +08:00
<span
style="font-size: 16px;
2024-08-16 09:55:26 +08:00
color: #999595;
background-color:#ffffff;
2024-08-23 09:46:53 +08:00
border-color: #fdfdff;">创建人{{ o.createPeople }}</span>
2024-08-16 09:55:26 +08:00
</div>
2024-08-23 09:46:53 +08:00
<div
style="font-size: 16px;
2024-08-16 09:55:26 +08:00
color: #999595;
background-color:#ffffff;
2024-08-23 09:46:53 +08:00
border-color: #fdfdff;">创建时间{{ o.createTime }}</div>
2024-08-16 09:55:26 +08:00
</div>
</el-card>
<!-- </el-col>-->
<!-- 添加表单对话框 -->
2024-08-23 09:46:53 +08:00
<el-dialog :title="title" v-model:visible="open" width="500px" append-to-body>
2024-08-16 09:55:26 +08:00
<div style="text-align: center">
<!-- <el-form-item label="表单标题">-->
2024-08-23 09:46:53 +08:00
<div><span>标题</span> <el-input
style="border-bottom: 1px solid skyblue;margin-bottom: 10px"
v-model="addParams.title" placeholder="请输入表单标题" />
2024-08-16 09:55:26 +08:00
</div>
<!-- </el-form-item>-->
<!-- <el-form-item label="字段名称">-->
2024-08-23 09:46:53 +08:00
<div v-for="(item, index) in inputarr" :key="index" style="margin-bottom: 10px;">
<span>字段</span> <el-input
style="border: 1px solid #DCDFE6;border-radius: 3px; " v-model="inputarr[index]"
placeholder="请输入字段" />
2024-08-16 09:55:26 +08:00
</div>
<div>
2024-08-23 09:46:53 +08:00
<el-button
@click="adinput"
style="text-align: center;width: 90%;background-color: rgb(232,244,255);color:#1890ff">添加字段</el-button>
2024-08-16 09:55:26 +08:00
</div>
<!-- </el-form-item>-->
</div>
2024-08-23 09:46:53 +08:00
<br />
2024-08-16 09:55:26 +08:00
<div class="el-input-foot">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 推广链接对话框-->
2024-08-23 09:46:53 +08:00
<el-dialog :title="extendTitle" v-model:visible="extendOpen" width="500px" append-to-body>
<el-input v-model="extendLink" placeholder="请输入内容" :disabled="true" />
2024-08-16 09:55:26 +08:00
<el-button @click="copyAddress">复制</el-button>
</el-dialog>
<!-- 采集数据列表 -->
2024-08-23 09:46:53 +08:00
<el-dialog :title="collectTitle" v-model:visible="collectOpen" append-to-body>
2024-08-16 09:55:26 +08:00
<el-table border v-loading="loading" :data="collectLink" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
2024-08-23 09:46:53 +08:00
<div>
2024-08-16 09:55:26 +08:00
</div>
2024-08-23 09:46:53 +08:00
<!-- <el-table-column label="编号" align="center" prop="id" />-->
<!-- <el-table-column label="id" align="center" prop="dynamicDataId" />-->
<!-- <el-table-column v-for="item in collectLink" :label="item.map" align="center" :prop="item" />-->
<template>
<el-table>
<el-table-column v-for="(item, index) in Object.keys(collectLink[0])" :key="index" :label="item">
<template #default="scope">
<span>{{ scope.row[item] }}</span>
</template>
</el-table-column>
</el-table>
2024-08-16 09:55:26 +08:00
</template>
</el-table>
</el-dialog>
</div>
</template>
<script>
import * as ArticleCategoryApi from "@/api/mall/promotion/intelligent";
export default {
name: "Business",
dicts: ['stage_type', 'sales_stage'],
data() {
return {
id: '',
2024-08-23 09:46:53 +08:00
inputarr: [''],
2024-08-16 09:55:26 +08:00
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 弹出层标题
title: "",
//推广弹出框标题
extendTitle: "",
//采集数据列表弹出标题
collectTitle: "",
// 是否显示弹出层
open: false,
// 是否显示推广弹出层
extendOpen: false,
//是否显示采集数据列表弹出层
collectOpen: false,
//推广链接数据
extendLink: '',
//采集数据列表数据
collectLink: [{}],
//下拉框客户列表
customerList: [],
//卡片列表
cardList: [],
addParams: {
2024-08-23 09:46:53 +08:00
title: '',
pageView: '',
collectionQuantity: '',
2024-08-16 09:55:26 +08:00
inputarr: []
}
};
},
created() {
this.getIntelligentList();
},
methods: {
//添加表单
2024-08-23 09:46:53 +08:00
adinput() {
2024-08-16 09:55:26 +08:00
this.inputarr.push('')
console.log(this.inputarr)
},
getIntelligentList() {
this.loading = true;
ArticleCategoryApi.selectDynamicData().then(response => {
this.cardList = response.data;
// this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
},
//提交按钮
2024-08-23 09:46:53 +08:00
submitForm() {
2024-08-16 09:55:26 +08:00
this.addParams.inputarr = this.inputarr
this.addParams.pageView = '0'
this.addParams.collectionQuantity = '0'
ArticleCategoryApi.saveDynamicData(this.addParams).then(response => {
// this.cardList = response.data;
// this.total = response.total;
this.loading = false;
this.open = false;
this.getIntelligentList();
});
},
/** 新增按钮操作 */
handleAdd() {
this.inputarr = []
this.addParams = {
2024-08-23 09:46:53 +08:00
title: '',
2024-08-16 09:55:26 +08:00
inputarr: []
}
this.open = true;
this.title = "添加表单";
},
//推广按钮操作
handelExtend(id) {
2024-08-23 09:46:53 +08:00
this.extendLink = 'http://101.43.112.107/form/extendLink/form?id=' + id
2024-08-16 09:55:26 +08:00
this.extendOpen = true;
this.extendTitle = "推广链接";
},
//复制按钮操作
copyAddress() {
const input = document.createElement('input');
input.value = this.extendLink;
document.body.appendChild(input);
input.select();
document.execCommand('copy');
document.body.removeChild(input);
alert('已复制到剪贴板');
2024-08-23 09:46:53 +08:00
},
2024-08-16 09:55:26 +08:00
//采集数据展示
2024-08-23 09:46:53 +08:00
extendList(id) {
2024-08-16 09:55:26 +08:00
this.collectLink = null;
this.id = id
this.collectOpen = true;
this.collectTitle = "采集数据";
ArticleCategoryApi.collectDataList(this.id).then(response => {
this.collectLink = response.data
});
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
2024-08-23 09:46:53 +08:00
this.single = selection.length !== 1
2024-08-16 09:55:26 +08:00
this.multiple = !selection.length
},
},
};
</script>
<style scoped>
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
2024-08-23 09:46:53 +08:00
2024-08-16 09:55:26 +08:00
.clearfix:after {
clear: both
}
.box-card {
2024-08-23 09:46:53 +08:00
width: 32%;
2024-08-16 09:55:26 +08:00
margin-bottom: 10px;
2024-08-23 09:46:53 +08:00
margin-right: 10px;
2024-08-16 09:55:26 +08:00
}
.container {
display: flex;
justify-content: center;
align-items: center;
2024-08-23 09:46:53 +08:00
height: 100px;
/* 可根据需要调整高度 */
color: #ccc;
/* 灰白色 */
2024-08-16 09:55:26 +08:00
}
2024-08-23 09:46:53 +08:00
.el-input-foot {
2024-08-16 09:55:26 +08:00
padding: 20px;
padding-top: 10px;
text-align: center;
box-sizing: border-box;
}
2024-08-23 09:46:53 +08:00
::v-deep.el-input--medium {
2024-08-16 09:55:26 +08:00
width: 80%;
}
2024-08-23 09:46:53 +08:00
::v-deep.el-input--medium .el-input__inner {
2024-08-16 09:55:26 +08:00
border: none;
/* border-bottom:1px solid blue; */
}
</style>