This commit is contained in:
qsh
2024-06-07 17:01:46 +08:00
parent 86ffb5a9c9
commit 5b3e02b447
15 changed files with 682 additions and 239 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div>
<el-table :data="list" border>
<el-table v-loading="loading" :data="list" border>
<el-table-column type="index" width="50" />
<el-table-column label="来源名称" width="200px">
<template #default="{ row }">
<el-input v-model="row.name" placeholder="请输入" :clearable="false" />
<el-input v-model="row.source" placeholder="请输入" :clearable="false" />
</template>
</el-table-column>
<el-table-column label="渠道" width="300px">
@@ -24,14 +24,14 @@
:value="item.value"
/>
</el-select>
<span>{{ row.resourceName }}</span>
<span>{{ row.channel }}</span>
</template>
</el-table-column>
<el-table-column label="获取连接" prop="link" />
<el-table-column label="获取连接" prop="url" />
<el-table-column label="参数详情" prop="params" />
<el-table-column label="是否启用" width="100px">
<template #default="{ row }">
<el-switch v-model="row.inEnable" :active-value="true" :inactive-value="false" />
<el-switch v-model="row.status" :active-value="0" :inactive-value="1" />
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
@@ -49,56 +49,60 @@
</div>
</template>
<script setup>
const list = ref([
{
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: '参数详情'
}
])
<script setup name="ClueSet">
import { getClueGainRuleList, deleteClueGainRule } from '@/api/clue/clueGetSet'
const resourceOptions = ref([
{ value: 1, label: '驾考宝典' },
{ value: 2, label: '一点通' },
{ value: 3, label: '抖音' }
])
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
const list = ref([])
const loading = ref(false)
const resourceOptions = ref([])
async function getList() {
loading.value = true
try {
const data = await getClueGainRuleList()
list.value = data
} finally {
loading.value = false
}
}
function handleInsert() {
list.value.push({ name: '', link: '', edit: true, inEnable: true })
list.value.push({ source: '', url: '', edit: true, status: 0 })
}
function onSubmit() {
console.log('保存成功')
}
function handleRemove(idx) {
list.value.splice(idx, 1)
async function handleRemove(idx) {
if (list.value[idx].ruleId) {
try {
// 删除的二次确认
await message.delConfirm()
// 发起删除
await deleteClueGainRule(list.value[idx].ruleId)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
} catch (err) {
console.log(err)
}
} else {
list.value.splice(idx, 1)
}
}
function handleChange(row) {
row.link = `https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=${row.resource}`
row.url = `https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=${row.resource}`
row.params = '参数详情'
}
onMounted(() => {
getList()
})
</script>
<style lang="scss" scoped></style>