Commit 250c6f59 authored by 罗超's avatar 罗超

1

parent 479e43a3
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
dense dense
outlined outlined
placeholder="请输入" placeholder="请输入"
v-model="filter"
style="margin-bottom:10px" style="margin-bottom:10px"
clearable
@clear="clearInput"
> >
<template v-slot:append> <template v-slot:append>
<q-icon name="search" /> <q-icon name="search" />
...@@ -42,6 +45,8 @@ ...@@ -42,6 +45,8 @@
no-connectors no-connectors
v-model:ticked="defaultArray" v-model:ticked="defaultArray"
@update:ticked="tickedTree" @update:ticked="tickedTree"
:filter="filter"
:filter-method="myFilterMethod"
/> />
</div> </div>
<div class="col-6 q-px-sm"> <div class="col-6 q-px-sm">
...@@ -139,33 +144,47 @@ export default { ...@@ -139,33 +144,47 @@ export default {
let hideDialog = () => { let hideDialog = () => {
ctx.emit("update:modelValue", false) ctx.emit("update:modelValue", false)
} }
let filter = ref('')
const filterRef = ref<any>(null)
// 过滤树形列表
const myFilterMethod = (node, filter) => {
const filt = filter.toLowerCase()
return node[props.labelKey] && node[props.labelKey].toLowerCase().indexOf(filt) > -1
}
let clearInput = () => {
filter.value = ''
}
let initDefault = () => { let initDefault = () => {
selectArray.value = []
if (props.defaultArray && props.defaultArray.length > 0) { if (props.defaultArray && props.defaultArray.length > 0) {
props.defaultArray.forEach((e, i) => { props.defaultArray.map((e, i) => {
if (e.slice(0, 1) == 1) { setTimeout(() => {
props.defaultArray.splice(i, 1) if (e.slice(0, 1) == 1) {
const node = tree.value.getNodeByKey(e) const node = tree.value.getNodeByKey(e)
if (node[props.childrenKey] && node[props.childrenKey].length > 0) { if (node[props.childrenKey] && node[props.childrenKey].length > 0) {
findChild(node[props.childrenKey]) props.defaultArray.splice(i, 1)
} else { findChild(node[props.childrenKey])
props.defaultArray.push('2-' + node.DeptId) } else {
props.defaultArray.push(node.DataType + '-' + node.DeptId)
}
} }
} }, 100)
}) })
} }
console.log(160, props.defaultArray)
} }
let findChild(arr: Array<parmas>) => { let findChild = (arr: Array<parmas>) => {
arr.map(e => { arr.map(e => {
if (e[props.childrenKey] && e[props.childrenKey].length > 0) { if (e[props.childrenKey] && e[props.childrenKey].length > 0) {
findChild(e[props.childrenKey]) findChild(e[props.childrenKey])
} else { } else {
props.defaultArray.push('2-' + e.DeptId) props.defaultArray.push(e.DataType + '-' + e.DeptId)
} }
}) })
} }
let showDialog = () => { let showDialog = () => {
initDefault() initDefault()
getselectArray(props.treeData)
} }
const getselectArray = (arr: parmas[]) => { const getselectArray = (arr: parmas[]) => {
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
...@@ -182,6 +201,8 @@ export default { ...@@ -182,6 +201,8 @@ export default {
} }
let tickedTree = (val) => { let tickedTree = (val) => {
ctx.emit("update:defaultArray", val) ctx.emit("update:defaultArray", val)
let filt = val.filter(e => e.slice(0, 1) == 2).length
ctx.emit('getNum',filt)
setTimeout(() => { setTimeout(() => {
selectArray.value = [] selectArray.value = []
getselectArray(props.treeData) getselectArray(props.treeData)
...@@ -221,12 +242,13 @@ export default { ...@@ -221,12 +242,13 @@ export default {
selectArray.value.splice(i, 1) selectArray.value.splice(i, 1)
} }
watch(() => [...selectArray.value], (val) => { watch(() => [...selectArray.value], (val) => {
ctx.emit('change', val) ctx.emit('select', [...val])
}, { deep: true })
watch(() => [...selectArray.value], (val) => {
ctx.emit('change', val)
}, { deep: true }) }, { deep: true })
return { return {
myFilterMethod,
filter,
filterRef,
clearInput,
tree, tree,
hideDialog, hideDialog,
tickedTree, tickedTree,
......
...@@ -8,6 +8,7 @@ interface dataParams { ...@@ -8,6 +8,7 @@ interface dataParams {
dataTree: Array<any> dataTree: Array<any>
defaultArray: Array<number | string> defaultArray: Array<number | string>
editMsg: any editMsg: any
peopleNum:number
} }
const msg = () => { const msg = () => {
...@@ -29,7 +30,8 @@ const data = reactive<dataParams>({ ...@@ -29,7 +30,8 @@ const data = reactive<dataParams>({
EmpList: [], //员工列表 EmpList: [], //员工列表
RuleAllotWay: 1, //分配方式 1依次轮流 2随机分配 RuleAllotWay: 1, //分配方式 1依次轮流 2随机分配
ConditionList: [] //条件列表 ConditionList: [] //条件列表
} },
peopleNum:0
}) })
// watch( // watch(
// () =>data.defaultArray, // () =>data.defaultArray,
...@@ -71,7 +73,10 @@ const editRuleModule = () => { ...@@ -71,7 +73,10 @@ const editRuleModule = () => {
}) })
} }
}) })
console.log(61, data.editMsg) }
//获取已选人数
const getNum = (n) => {
data.peopleNum=n
} }
//获取线索详情 //获取线索详情
const getDetail = () => { const getDetail = () => {
...@@ -137,7 +142,8 @@ const editRuleModule = () => { ...@@ -137,7 +142,8 @@ const editRuleModule = () => {
changeDialog, changeDialog,
setCustomerClueRuleInfo, setCustomerClueRuleInfo,
getCondition, getCondition,
getdpt getdpt,
getNum
} }
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="departs flex-between-center"> <div class="departs flex-between-center">
<q-btn outline color="primary" label="选择部门/成员" @click="changeDialog" /> <q-btn outline color="primary" label="选择部门/成员" @click="changeDialog" />
<div class="flex align-center depart-title"> <div class="flex align-center depart-title">
<span>已选:0</span> <span>已选:{{peopleNum}}</span>
<div class="per"></div> <div class="per"></div>
<span>有效账号数(已启用探马账号人数):0人</span> <span>有效账号数(已启用探马账号人数):0人</span>
</div> </div>
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
childrenKey="ChildList" childrenKey="ChildList"
strategy='leaf' strategy='leaf'
:treeData="dataTree" :treeData="dataTree"
@change="getdpt" @select="getdpt"
@getNum="getNum"
/> />
</div> </div>
</template> </template>
...@@ -77,7 +78,8 @@ export default defineComponent({ ...@@ -77,7 +78,8 @@ export default defineComponent({
getEmployeeData, getEmployeeData,
setCustomerClueRuleInfo, setCustomerClueRuleInfo,
getCondition, getCondition,
getdpt getdpt,
getNum,
} = editRuleModule(); } = editRuleModule();
onMounted(() => { onMounted(() => {
if (msg().RuleId > 0) { if (msg().RuleId > 0) {
...@@ -93,7 +95,8 @@ export default defineComponent({ ...@@ -93,7 +95,8 @@ export default defineComponent({
...toRefs(data), ...toRefs(data),
setCustomerClueRuleInfo, setCustomerClueRuleInfo,
getCondition, getCondition,
getdpt getdpt,
getNum
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment