驾校管理

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>

View File

@@ -30,27 +30,6 @@
</el-radio-group>
</el-form-item>
<div v-if="form.isAuto">
<!-- <el-form-item label="分配对象">
<div>
<el-checkbox
v-model="checkUserAll"
:indeterminate="userIndeterminate"
@change="userCheckAllChange"
>
全选
</el-checkbox>
<el-checkbox-group v-model="form.users" @change="userCheckedChange">
<el-checkbox
v-for="(item, index) in userOptions"
:key="index"
:label="item.value"
:value="item.value"
>
{{ item.label }}
</el-checkbox>
</el-checkbox-group>
</div>
</el-form-item> -->
<el-form-item label="线索来源">
<div>
<el-checkbox
@@ -73,32 +52,9 @@
</div>
</el-form-item>
<el-form-item label="权重配置">
<div>
<el-radio-group v-model="form.isRandom">
<el-radio :label="1">
<Tooltip message="根据剩余的线索平均分配到未分配线索的所有人" />
平均分配
</el-radio>
<el-radio :label="0"> 权重分配 </el-radio>
</el-radio-group>
<div v-if="form.isRandom == 0">
<div v-for="(item, index) in intentionOptions" :key="index" class="flex mb-10px">
<div class="mr-15px" style="width: 100px">{{ item.label }}</div>
<el-input v-model="item.value" type="number" placeholder="请输入权重">
<template #suffix> % </template>
</el-input>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="分配时间">
<el-time-picker
v-model="form.sendTime"
placeholder="任意时间点"
format="HH:mm"
value-format="HH:mm"
:clearable="false"
/>
<el-input v-model="form.value" type="number" placeholder="请输入权重">
<template #suffix> % </template>
</el-input>
</el-form-item>
</div>
<el-form-item>
@@ -128,25 +84,6 @@ const form = ref({
})
const rules = ref({})
// const checkUserAll = ref(false)
// const userIndeterminate = ref(true)
// const userOptions = ref([
// { label: '张三', value: 1 },
// { label: '李四', value: 2 },
// { label: '王二', value: 3 }
// ])
// function userCheckAllChange(val) {
// form.value.users = val ? userOptions.value.map((it) => it.value) : []
// userIndeterminate.value = false
// }
// function userCheckedChange(val) {
// const checkedCount = val.length
// checkUserAll.value = checkedCount == userOptions.value.length
// userIndeterminate.value = checkedCount > 0 && checkedCount < userOptions.value.length
// }
function getUserList() {
console.log('获取列表')
}
@@ -174,13 +111,6 @@ function resourceCheckedChange(val) {
resourceIndeterminate.value = checkedCount > 0 && checkedCount < resourceOptions.value.length
}
const intentionOptions = ref([
{ label: '高意向', value: 20 },
{ label: '中意向', value: 20 },
{ label: '低意向', value: 20 },
{ label: '未知意向', value: 40 }
])
function selectUser(row) {
console.log(row)
}