Files
ss-crm-manage-web/src/views/Clue/Set/Comp/ClueGet.vue

105 lines
3.0 KiB
Vue
Raw Normal View History

2024-04-28 16:20:45 +08:00
<template>
<div>
2024-05-10 16:21:07 +08:00
<el-table :data="list" border>
2024-04-28 16:20:45 +08:00
<el-table-column type="index" width="50" />
2024-05-16 11:50:50 +08:00
<el-table-column label="来源名称" width="200px">
2024-04-28 16:20:45 +08:00
<template #default="{ row }">
<el-input v-model="row.name" placeholder="请输入" :clearable="false" />
</template>
</el-table-column>
2024-05-16 11:50:50 +08:00
<el-table-column label="渠道" width="300px">
2024-04-28 16:20:45 +08:00
<template #default="{ row }">
2024-05-16 11:50:50 +08:00
<el-select
v-if="row.edit"
v-model="row.resource"
placeholder="选择渠道"
clearable
filterable
@change="handleChange(row)"
>
<el-option
v-for="item in resourceOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<span>{{ row.resourceName }}</span>
2024-04-28 16:20:45 +08:00
</template>
</el-table-column>
2024-05-16 11:50:50 +08:00
<el-table-column label="获取连接" prop="link" />
<el-table-column label="参数详情" prop="params" />
2024-05-10 16:21:07 +08:00
<el-table-column label="是否启用" width="100px">
<template #default="{ row }">
<el-switch v-model="row.inEnable" :active-value="true" :inactive-value="false" />
</template>
</el-table-column>
2024-04-28 16:20:45 +08:00
<el-table-column label="操作" width="100px">
<template #default="{ $index }">
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="mt-20px flex justify-center">
<el-button type="primary" @click="handleInsert">新增规则</el-button>
<el-button type="primary" @click="onSubmit">保存</el-button>
</div>
</div>
</template>
<script setup>
const list = ref([
2024-05-16 11:50:50 +08:00
{
name: '一点通账号1',
resourceName: '驾校一点通',
link: 'https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=2',
params: '参数详情'
},
{
name: '一点通账号2',
resourceName: '驾校一点通',
link: 'https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=2',
params: '参数详情'
},
{
name: '宝典账号',
resourceName: '驾考宝典',
link: 'https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=1',
params: '参数详情'
},
{
name: '抖音',
resourceName: '抖音/开心学车',
link: 'https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=3',
params: '参数详情'
}
])
const resourceOptions = ref([
{ value: 1, label: '驾考宝典' },
{ value: 2, label: '一点通' },
{ value: 3, label: '抖音' }
2024-04-28 16:20:45 +08:00
])
function handleInsert() {
2024-05-16 11:50:50 +08:00
list.value.push({ name: '', link: '', edit: true, inEnable: true })
2024-04-28 16:20:45 +08:00
}
function onSubmit() {
console.log('保存成功')
}
function handleRemove(idx) {
list.value.splice(idx, 1)
}
2024-05-16 11:50:50 +08:00
function handleChange(row) {
row.link = `https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=${row.resource}`
row.params = '参数详情'
}
2024-04-28 16:20:45 +08:00
</script>
<style lang="scss" scoped></style>