驾校管理

This commit is contained in:
qsh
2024-05-16 11:50:50 +08:00
parent 555cb4d27a
commit 2468a0c8a5
5 changed files with 917 additions and 123 deletions

View File

@@ -2,16 +2,33 @@
<div>
<el-table :data="list" border>
<el-table-column type="index" width="50" />
<el-table-column label="来源名称">
<el-table-column label="来源名称" width="200px">
<template #default="{ row }">
<el-input v-model="row.name" placeholder="请输入" :clearable="false" />
</template>
</el-table-column>
<el-table-column label="获取连接">
<el-table-column label="渠道" width="300px">
<template #default="{ row }">
<el-input v-model="row.link" placeholder="请输入" :clearable="false" />
<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>
</template>
</el-table-column>
<el-table-column label="获取连接" prop="link" />
<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" />
@@ -28,21 +45,46 @@
<div class="mt-20px flex justify-center">
<el-button type="primary" @click="handleInsert">新增规则</el-button>
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button>重置</el-button>
</div>
</div>
</template>
<script setup>
const list = ref([
{ name: '一点通账号1', link: 'http://baidu.com' },
{ name: '一点通账号2', link: 'http://baidu.com' },
{ name: '宝典账号', link: 'http://baidu.com' },
{ name: '抖音', link: 'http://baidu.com' }
{
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: '抖音' }
])
function handleInsert() {
list.value.push({ name: '', link: '' })
list.value.push({ name: '', link: '', edit: true, inEnable: true })
}
function onSubmit() {
@@ -52,6 +94,11 @@ function onSubmit() {
function handleRemove(idx) {
list.value.splice(idx, 1)
}
function handleChange(row) {
row.link = `https://sscrm.ahduima.com/clue/get?cid=1001&aid=1001&res=${row.resource}`
row.params = '参数详情'
}
</script>
<style lang="scss" scoped></style>