Commit 6e9c88e4 by wanglizhen

加密算法

parent 3b1a3bbc
......@@ -170,11 +170,13 @@ onMounted(() => {
</div>
<div class="right">
<div class="line"></div>
<div style="padding: 26px 28px 0 28px;">
<div style="padding: 26px 28px 0 28px;position: relative;flex: 1;">
<DividerTitle title-name="脱敏规则" />
<div class="right-content">
<div class="right-content" v-if="collapseList.length > 0">
<formModule :itemData="editForm" :nameList="rulenameList" type="edit" @confirm="formModuleConfirm" />
</div>
<el-empty description="暂无数据" v-if="collapseList.length <= 0"
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"></el-empty>
</div>
</div>
</div>
......@@ -236,6 +238,8 @@ onMounted(() => {
}
}
.right {
display: flex;
flex-direction: column;
flex: 1;
height: 100%;
background: rgba(255, 255, 255, 1);
......
<script setup name="CalculationMethod">
import { onMounted, ref, toRefs } from 'vue'
import { Split } from 'view-ui-plus';
import { ElMessage } from "element-plus";
import CollapseView from '@/components/CollapseView/index.vue'
......@@ -9,7 +8,7 @@ import ModalPop from "@/components/EditPop/ModalPop.vue"
import { query, queryenc, del } from '@/api/ruleConfig/calculationMethod'
const splitNum = ref(0.31) // 左右分割比例
const fatherIndex = ref(0) // 父级索引
const collapseList = ref([])
const encryptionList = ref([]) // 加密规则列表
......@@ -59,11 +58,13 @@ const getCollapse = (type) => {
if (type === 'edit') return
if (collapseList.value.length <= 0) return
if (collapseList.value[0].secretkeyList.length > 0) {
fatherIndex.value = 0
editForm.value = {
dataarea_id: collapseList.value[0].id,
...collapseList.value[0].secretkeyList[0]
}
} else {
fatherIndex.value = null
editForm.value = {
dataarea_id: collapseList.value[0].id
}
......@@ -113,6 +114,11 @@ const modalConfirm = () => {
}
})
}
// 一级点击
const collapseView = (index) => {
console.log(index)
fatherIndex.value = index
}
// 点击监听
const collapseChange = (item) => {
......@@ -152,89 +158,168 @@ onMounted(() => {
</script>
<template>
<div class="app-container scroller">
<PageTitle>
<template #title>
加密算法
</template>
</PageTitle>
<div class="app-container__body">
<Split v-model="splitNum">
<template #left>
<div class="demo-split-pane" style="padding: 0 38px 10px 0;width: 100%;overflow: auto;height: 100%;display: flex;flex-direction: column;">
<el-input class="mb20" v-model="queryParams.dataarea" placeholder="加密算法搜索">
<template #suffix>
<el-icon style="vertical-align: middle;cursor: pointer;" @click="getCollapse">
<search />
</el-icon>
</template>
</el-input>
<el-scrollbar style="width: 100%;flex: 1;padding-right: 38px;">
<CollapseView :list="collapseList" @add="collapseAdd" @childDelete="collapseDelete"
@change="collapseChange" />
</el-scrollbar>
<div class="pageTitle">
<img class="icon" src="@/assets/images/ruleConfig/algorithmPage.png" alt="">
<span>加密算法</span>
</div>
<div class="box">
<div class="left">
<el-input v-model="queryParams.dataarea" placeholder="加密算法搜索" style="width: 369px;margin-bottom: 15px;">
<template #prefix>
<el-icon>
<search />
</el-icon>
</template>
<template #append>
<el-button icon="search" class="searchBut" @click="getCollapse">搜索</el-button>
</template>
</el-input>
<div class="collapseView">
<CollapseView :list="collapseList" :fatherIndex="fatherIndex" :currentId="editForm.id" @add="collapseAdd" @childDelete="collapseDelete"
@change="collapseChange" @view="collapseView" />
</div>
</template>
<template #right>
<div class="demo-split-pane">
<div class="right">
<div class="right-title">
<el-icon>
<info-filled />
</el-icon>
<span style="margin-left: 5px;">加密算法</span>
</div>
<div class="right-content">
<formModule :itemData="editForm" :encryptionDict="encryptionList" type="edit" @cancel="modalPopCancel"
</div>
<div class="right">
<div class="line"></div>
<div style="padding: 26px 28px 0 28px;position: relative;flex: 1;">
<DividerTitle title-name="加密算法" />
<div class="right-content" v-if="collapseList.length > 0">
<formModule :itemData="editForm" :encryptionDict="encryptionList" type="edit" @cancel="modalPopCancel"
@confirm="formModuleConfirm" />
</div>
</div>
<el-empty description="暂无数据" v-if="collapseList.length <= 0"
style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"></el-empty>
</div>
</template>
</Split>
</div>
</div>
</div>
<!-- 提示框 -->
<Modal v-model="modalData.show" :icon="modalData.icon" :cancel="modalData.cancel" :text="modalData.text"
@confirm="modalConfirm"></Modal>
<!-- 新增加密算法 -->
<ModalPop v-model="modalPopShow" width="800px" title="新增加密算法" @cancel="modalPopCancel">
<template #content>
<el-dialog title="新增加密算法" v-model="modalPopShow" :before-close="modalPopCancel" width="800">
<div style="padding: 30px;">
<formModule v-if="modalPopShow" :itemData="addForm" :encryptionDict="encryptionList" type="add" @cancel="modalPopCancel"
@confirm="formModuleConfirm" />
</template>
</ModalPop>
</div>
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.app-container__body {
height: calc(
100vh - var(--navbar-height) - var(--container-pd) - var(--container-pd)
) !important;
.right {
padding: 6px 10px 10px;
height: 100%;
&-title {
padding: 0px 0px 10px 10px;
display: flex;
align-items: center;
font-weight: 700;
color: #515a6e;
padding: 20px 0 0 0;
.pageTitle {
margin-bottom: 20px;
display: flex;
align-items: center;
font-size: 16px;
font-weight: 500;
letter-spacing: 0px;
line-height: 22px;
color: rgba(53, 64, 79, 1);
.icon {
margin-right: 6px;
width: 16px;
height: 16px;
}
&-content {
padding: 10px 0px;
width: 80%;
margin: 20px auto;
.openEditor {
position: absolute;
bottom: 0;
right: 0;
}
.box {
display: flex;
flex: 1;
overflow: hidden;
.left {
margin-right: 30px;
width: 565px;
overflow: auto;
height: 100%;
display: flex;
flex-direction: column;
.searchBut {
height: 40px;
background: var(--el-color-primary);
color: var(--el-color-white);
border-radius: 0px 5px 5px 0px;
}
.collapseView {
width: 100%;
flex: 1;
overflow: hidden;
}
}
&-btn {
padding: 20px 20px 20px 100px;
.right {
display: flex;
justify-content: center;
flex-direction: column;
flex: 1;
height: 100%;
background: rgba(255, 255, 255, 1);
.line {
width: 100%;
height: 2px;
border-radius: 5px 5px 0px 0px;
background: linear-gradient(
90deg,
rgba(33, 103, 217, 1) 0%,
rgba(17, 200, 250, 1) 34.03%,
rgba(33, 103, 217, 1) 64.58%,
rgba(48, 128, 255, 1) 100%
);
}
&-content {
width: 100%;
.openEditor {
position: absolute;
bottom: 0;
right: 0;
}
:deep(.formBox) {
border-radius: 5px;
background: #ebebeb;
border: 1px solid rgba(29, 178, 245, 1);
overflow: hidden;
.el-form-item__content {
margin-left: 1px;
background: #f5fcff;
}
.el-form-item__label {
height: 40px;
line-height: 40px;
background: #f5fcff;
color: rgba(148, 148, 148, 1);
}
.el-form-item {
margin-bottom: 1px;
}
.el-input {
height: 40px;
line-height: 40px;
}
.is-disabled {
background: #f5fcff;
.el-input__wrapper {
background: #f5fcff;
box-shadow: none;
border-radius: 0;
}
.el-input__inner {
-webkit-text-fill-color: rgba(53, 64, 79, 1);
}
}
.el-form-item__error {
top: 30% !important;
left: auto !important;
right: 89px !important;
}
}
}
&-btn {
padding: 20px 20px 20px 100px;
display: flex;
justify-content: center;
}
}
}
}
......
<script setup lang="ts" name="Form">
import { onMounted, reactive, ref, toRefs, watch, computed } from "vue";
import { Switch } from "view-ui-plus";
import type { FormInstance } from "element-plus";
import { ElMessage } from "element-plus";
import { querysec, save } from "@/api/ruleConfig/calculationMethod";
......@@ -153,40 +152,43 @@ watch(
<template>
<div>
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px" :disabled="readOnly">
<el-form-item label="算法名称" prop="enc_name" required>
<el-input v-model="form.enc_name" placeholder="请输入算法名称"></el-input>
</el-form-item>
<el-form-item label="加密规则" prop="encryption_id" required>
<div style="width: 100%;background: #F3F5FA;">
<el-select v-model="form.encryption_id" @change="encryptionChange">
<el-option v-for="item in encryptionList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="密钥" prop="secretkey_id" required>
<div style="width: 100%;background: #F3F5FA;">
<el-select v-model="form.secretkey_id">
<el-option v-for="item in secretkeyList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</el-form-item>
<el-form-item label="默认规则">
<Switch true-value="1" false-value="0" v-model="form.defaulttype" :disabled="readOnly">
<template #open>
<span></span>
</template>
<template #close>
<span></span>
</template>
</Switch>
</el-form-item>
<div class="formBox">
<el-form-item label="算法名称" prop="enc_name" required>
<el-input v-model="form.enc_name" placeholder="请输入算法名称"></el-input>
</el-form-item>
<el-form-item label="加密规则" prop="encryption_id" required>
<div style="width: 100%;background: #F3F5FA;">
<el-select v-model="form.encryption_id" @change="encryptionChange" v-if="!readOnly">
<el-option v-for="item in encryptionList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-input v-model="form.encryption_id" v-if="readOnly"></el-input>
</div>
</el-form-item>
<el-form-item label="密钥" prop="secretkey_id" required>
<div style="width: 100%;background: #F3F5FA;">
<el-select v-model="form.secretkey_id" v-if="!readOnly">
<el-option v-for="item in secretkeyList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-input v-model="form.secretkey_id" v-if="readOnly"></el-input>
</div>
</el-form-item>
<el-form-item label="默认规则">
<div class="is-disabled" v-if="readOnly" style="width: 100%;height: 100%;">
<div class="el-input__wrapper" style="height: 100%;">{{ form.defaulttype === '1' ? '是':'否' }}</div>
</div>
<el-radio-group v-model="form.defaulttype" v-if="!readOnly" style="margin-left: 10px;">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
</div>
</el-form>
<div class="btn">
<el-button type="primary" style="width: 150px;" @click="readOnly = false" v-if="readOnly">编辑</el-button>
<el-button type="info" style="width: 150px;" @click="cancel" v-if="!readOnly">取消</el-button>
<el-button type="primary" style="width: 150px;" @click="confirm" v-if="!readOnly">确认</el-button>
<el-button type="primary" style="width: 80px;" @click="readOnly = false" v-if="readOnly">编辑</el-button>
<el-button type="primary" style="width: 80px;" @click="confirm" v-if="!readOnly">确认</el-button>
<el-button style="width: 80px;" @click="cancel" v-if="!readOnly">取消</el-button>
</div>
</div>
</template>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论