按角色展示流程列表搜索项

This commit is contained in:
wkc
2026-08-10 15:56:44 +08:00
parent 86b50f057e
commit 9d48d4b688
2 changed files with 19 additions and 6 deletions

View File

@@ -17,13 +17,13 @@
@keydown.enter.native.prevent="handleQuery"
/>
</el-form-item>
<el-form-item label="客户类型" prop="custType">
<el-form-item v-if="showAllSearchItems" label="客户类型" prop="custType">
<el-select v-model="queryParams.custType" placeholder="请选择客户类型" clearable style="width: 160px">
<el-option label="个人" value="个人" />
<el-option label="企业" value="企业" />
</el-select>
</el-form-item>
<el-form-item label="担保方式" prop="guarType">
<el-form-item v-if="showAllSearchItems" label="担保方式" prop="guarType">
<el-select v-model="queryParams.guarType" placeholder="请选择担保方式" clearable style="width: 160px">
<el-option label="信用" value="信用" />
<el-option label="保证" value="保证" />
@@ -31,7 +31,7 @@
<el-option label="质押" value="质押" />
</el-select>
</el-form-item>
<el-form-item label="创建者" prop="createBy">
<el-form-item v-if="showAllSearchItems" label="创建者" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入创建者"
@@ -39,7 +39,7 @@
@keydown.enter.native.prevent="handleQuery"
/>
</el-form-item>
<el-form-item label="机构号" prop="deptId">
<el-form-item v-if="showAllSearchItems" label="机构号" prop="deptId">
<treeselect
v-model="queryParams.deptId"
:options="deptOptions"
@@ -49,7 +49,7 @@
style="width: 220px"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-form-item v-if="showAllSearchItems" label="创建时间">
<el-date-picker
v-model="dateRange"
type="daterange"
@@ -226,8 +226,12 @@ export default {
computed: {
...mapGetters([
'name',
'nickName'
'nickName',
'roles'
]),
showAllSearchItems() {
return !this.roles.includes('common')
},
currentCreateBy() {
return `${this.nickName}-${this.name}`
}

View File

@@ -63,6 +63,15 @@ assert(source.includes('beginCreateTime: hasDateRange ? `${this.dateRange[0]} 00
assert(source.includes('endCreateTime: hasDateRange ? `${this.dateRange[1]} 23:59:59` : undefined'), '流程列表应传递当天末秒的顶层创建时间结束参数')
assert(source.includes('label="机构号"') && source.includes('prop="deptId"'), '流程列表应展示机构号')
assert(source.indexOf('label="机构号"') > source.indexOf('label="创建者"'), '机构号列应位于创建者列之后')
assert.strictEqual((source.match(/v-if="showAllSearchItems"/g) || []).length, 5, '五个高级搜索项均应根据角色显示')
assert.strictEqual(component.computed.showAllSearchItems.call({
roles: ['common']
}), false, '客户经理只应展示客户信息搜索项')
assert.strictEqual(component.computed.showAllSearchItems.call({
roles: ['headAdmin']
}), true, '其他角色应展示全部搜索项')
let refreshCount = 0
component.activated.call({