Commit e85fa964 by ningjihai

脱敏策略管理 列表

parent b09cb553
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
import { computed,ref,watch } from 'vue' import { computed,ref,watch } from 'vue'
import type { FormInstance } from 'element-plus' import type { FormInstance } from 'element-plus'
import PageWrapperSearch from '@/components/search/PageWrapperSearch.vue' import PageWrapperSearch from '@/components/search/PageWrapperSearch.vue'
// import { useDict } from '@/utils/dict'
// import { listDept } from '@/api/system/dept'// 部门
import {
Plus
} from '@element-plus/icons-vue'
// const { approve_status, invoice_status} = useDict('approve_status', 'invoice_status') // const { approve_status, invoice_status} = useDict('approve_status', 'invoice_status')
const emit = defineEmits(['update:modelValue', 'query', 'reset']) const emit = defineEmits(['update:modelValue', 'query', 'reset','handleAdd'])
const invoice_status_filter = ref([]) const invoice_status_filter = ref([])
const employeesList = ref([]) const employeesList = ref([])
const props = defineProps<{ const props = defineProps<{
...@@ -39,7 +40,9 @@ function onReset(formRef: FormInstance) { ...@@ -39,7 +40,9 @@ function onReset(formRef: FormInstance) {
queryForm.value.state = '' queryForm.value.state = ''
emit('reset', formRef) emit('reset', formRef)
} }
function handleAdd() {
emit('handleAdd')
}
</script> </script>
...@@ -47,6 +50,16 @@ function onReset(formRef: FormInstance) { ...@@ -47,6 +50,16 @@ function onReset(formRef: FormInstance) {
<!-- el-form --> <!-- el-form -->
<page-wrapper-search <page-wrapper-search
:model="queryForm" :model="queryForm"
:extraButtons="[
{
text: '新增',
icon: Plus,
color: 'rgba(0, 189, 207, 1)',
type: 'success',
class: 'btn-fff',
onClick: handleAdd
}
]"
@search="onSearch" @search="onSearch"
@reset="onReset"> @reset="onReset">
<el-form-item label="策略名" prop="strategyName"> <el-form-item label="策略名" prop="strategyName">
...@@ -81,6 +94,10 @@ function onReset(formRef: FormInstance) { ...@@ -81,6 +94,10 @@ function onReset(formRef: FormInstance) {
</page-wrapper-search> </page-wrapper-search>
</template> </template>
<style scoped> <style scoped lang="scss">
:deep(.btn-fff){
span{
color: #fff;
}
}
</style> </style>
...@@ -214,34 +214,36 @@ const toggleStatus = (row) => { ...@@ -214,34 +214,36 @@ const toggleStatus = (row) => {
<template> <template>
<div class="app-container scroller"> <div class="app-container scroller">
<PageTitle :back="true" @back="pageProjectManage"> <PageTitle backProject @handleBackProject="pageProjectManage">
<template #title> <template #title>
返回项目管理 脱敏策略管理
</template> </template>
<template #buttons> <template #buttons>
<el-button <!-- <el-button
icon="Plus" icon="Plus"
type="primary" type="primary"
@click="handleAdd" @click="handleAdd"
> >
新增策略 新增策略
</el-button> </el-button> -->
</template> </template>
</PageTitle> </PageTitle>
<div class="app-container__body"> <div class="app-container__body">
<div>
<query-form <query-form
ref="QueryFormRef" ref="QueryFormRef"
v-model="queryParams" v-model="queryParams"
@query="onQuery" @query="onQuery"
@reset="onReset"/> @reset="onReset"
@handleAdd="handleAdd"
/>
<div style="flex: 1;">
<el-table <el-table
height="100%"
:data="tableData" :data="tableData"
border stripe
style="width: 100%" style="width: 100%"
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
v-loading="loading" v-loading="loading"
> >
<el-table-column prop="strategyName" label="策略名称" min-width="120" fiexd/> <el-table-column prop="strategyName" label="策略名称" min-width="120" fiexd/>
...@@ -255,20 +257,19 @@ const toggleStatus = (row) => { ...@@ -255,20 +257,19 @@ const toggleStatus = (row) => {
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="280" align="center" fixed="right"> <el-table-column label="操作" width="340" align="center" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button link type="primary" size="small" @click="showDetail(row)">详情</el-button> <el-button plain type="primary" size="small" icon="Tickets" @click="showDetail(row)">详情</el-button>
<el-divider direction="vertical" /> <el-button plain color="rgba(237, 183, 5, 1)" size="small" icon="edit" @click="editStrategy(row)">编辑</el-button>
<el-button link type="primary" size="small" @click="editStrategy(row)">编辑策略</el-button> <el-button plain color="rgba(255, 141, 26, 1)" size="small" icon="delete" @click="deleteStrategy(row)">删除</el-button>
<el-divider direction="vertical" /> <el-button :icon="row.state === '1'?'WarningFilled' : 'SuccessFilled'" :type="row.state === '1' ? 'warning' : 'success'" size="small" plain @click="toggleStatus(row)">
<el-button link type="danger" size="small" @click="deleteStrategy(row)">删除</el-button>
<el-divider direction="vertical" />
<el-button link type="success" size="small" @click="toggleStatus(row)">
{{ row.state === '1' ? '禁用' : '启用' }} {{ row.state === '1' ? '禁用' : '启用' }}
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
...@@ -278,7 +279,7 @@ const toggleStatus = (row) => { ...@@ -278,7 +279,7 @@ const toggleStatus = (row) => {
@pagination="getList" @pagination="getList"
/> />
</div> </div>
</div>
<!-- 统一策略对话框组件 --> <!-- 统一策略对话框组件 -->
<StrategyAddDialog :title="dialog.title" ref="strategyAddDialogRef" @refresh="handleQuery" /> <StrategyAddDialog :title="dialog.title" ref="strategyAddDialogRef" @refresh="handleQuery" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论