Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nse-ui
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
nse-ui
Commits
7ced7262
Commit
7ced7262
authored
Aug 23, 2025
by
wanglizhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加密算法模块
parent
48edd2a2
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
344 行增加
和
127 行删除
+344
-127
src/api/ruleConfig/calculationMethod.js
+67
-0
src/views/ruleConfig/CalculationMethod/index.vue
+84
-51
src/views/ruleConfig/CalculationMethod/modules/formModule.vue
+143
-41
src/views/ruleConfig/Discover/index.vue
+1
-1
src/views/ruleConfig/Discover/modules/AddRules.vue
+49
-34
没有找到文件。
src/api/ruleConfig/calculationMethod.js
0 → 100644
View file @
7ced7262
import
request
from
'@/utils/request'
/**
* 加密算法 - 查询列表
* @param {*} data
* @returns
*/
export
function
query
(
data
)
{
return
request
({
url
:
'/core/dataareasecretkey/query'
,
method
:
'post'
,
data
:
data
})
}
/**
* 加密算法 - 查询加密规则
* @param {*} data
* @returns
*/
export
function
queryenc
(
data
)
{
return
request
({
url
:
'/core/dataareasecretkey/queryenc'
,
method
:
'post'
,
data
:
data
})
}
/**
* 加密算法 - 查询密钥
* @param {*} data
* @returns
*/
export
function
querysec
(
data
)
{
return
request
({
url
:
'/core/dataareasecretkey/querysec'
,
method
:
'post'
,
data
:
data
})
}
/**
* 加密算法 - 新增算法
* @param {*} data
* @returns
*/
export
function
save
(
data
)
{
return
request
({
url
:
'/core/dataareasecretkey/save'
,
method
:
'post'
,
data
:
data
})
}
/**
* 加密算法 - 删除算法
* @param {*} data
* @returns
*/
export
function
del
(
data
)
{
return
request
({
url
:
'/core/dataareasecretkey/delete'
,
method
:
'post'
,
data
:
data
})
}
\ No newline at end of file
src/views/ruleConfig/CalculationMethod/index.vue
View file @
7ced7262
<
script
setup
name=
"CalculationMethod"
>
<
script
setup
name=
"CalculationMethod"
>
import
{
onMounted
,
ref
,
toRefs
}
from
'vue'
import
{
onMounted
,
ref
,
toRefs
}
from
'vue'
import
{
Split
}
from
'view-ui-plus'
;
import
{
Split
}
from
'view-ui-plus'
;
import
{
ElMessage
}
from
"element-plus"
;
import
CollapseView
from
'@/components/CollapseView/index.vue'
import
CollapseView
from
'@/components/CollapseView/index.vue'
import
formModule
from
'./modules/formModule.vue'
import
formModule
from
'./modules/formModule.vue'
import
ModalPop
from
"@/components/EditPop/ModalPop.vue"
import
ModalPop
from
"@/components/EditPop/ModalPop.vue"
import
{
query
,
queryenc
,
del
}
from
'@/api/ruleConfig/calculationMethod'
const
splitNum
=
ref
(
0.31
)
// 左右分割比例
const
splitNum
=
ref
(
0.31
)
// 左右分割比例
const
collapseList
=
ref
([])
const
collapseList
=
ref
([])
const
encryptionList
=
ref
([])
// 加密规则列表
const
data
=
reactive
({
const
data
=
reactive
({
form
Edit
:
{
form
Data
:
{
name
:
""
,
name
:
""
,
},
},
formAdd
:
{
queryParams
:
{
name
:
""
,
dataarea
:
''
},
delData
:
{
id
:
''
}
}
});
});
const
{
form
Edit
,
formAdd
}
=
toRefs
(
data
);
const
{
form
Data
,
queryParams
,
delData
}
=
toRefs
(
data
);
const
modalData
=
reactive
({
const
modalData
=
reactive
({
show
:
false
,
show
:
false
,
...
@@ -31,48 +38,35 @@ const modalPopShow = ref(false)
...
@@ -31,48 +38,35 @@ const modalPopShow = ref(false)
// 获取数据
// 获取数据
const
getCollapse
=
()
=>
{
const
getCollapse
=
()
=>
{
const
data
=
[
query
(
queryParams
.
value
).
then
(
res
=>
{
{
const
{
data
}
=
res
name
:
'测试数据域'
,
collapseList
.
value
=
data
.
map
(
item
=>
{
list
:
[
const
list
=
item
.
secretkeyList
.
map
(
itemTwo
=>
{
{
return
{
name
:
'aaaaa'
...
itemTwo
,
}
,
name
:
itemTwo
.
enc_name
,
{
isCheck
:
false
,
name
:
'bbbbb'
isDelete
:
true
,
}
}
]
})
},
{
name
:
'通用规则'
,
list
:
[
{
name
:
'aaaaa'
},
{
name
:
'bbbbb'
}
]
},
{
name
:
'解密数据'
,
list
:
[]
}
]
collapseList
.
value
=
data
.
map
(
item
=>
{
const
list
=
item
.
list
.
map
(
itemTwo
=>
{
return
{
return
{
...
itemTwo
,
...
item
,
isCheck
:
false
,
list
:
list
,
isDelete
:
true
,
isAdd
:
true
,
isView
:
false
,
isDelete
:
false
,
}
}
})
})
return
{
if
(
collapseList
.
value
.
length
<=
0
)
return
...
item
,
if
(
collapseList
.
value
[
0
].
secretkeyList
.
length
>
0
)
{
list
:
list
,
formData
.
value
=
{
isAdd
:
true
,
dataarea_id
:
collapseList
.
value
[
0
].
id
,
isView
:
false
,
...
collapseList
.
value
[
0
].
secretkeyList
[
0
]
isDelete
:
false
,
}
}
else
{
formData
.
value
=
{
dataarea_id
:
collapseList
.
value
[
0
].
id
}
}
}
})
})
}
}
...
@@ -84,14 +78,18 @@ const modalPopCancel = () => {
...
@@ -84,14 +78,18 @@ const modalPopCancel = () => {
// 新增加密算法
// 新增加密算法
const
collapseAdd
=
(
item
)
=>
{
const
collapseAdd
=
(
item
)
=>
{
console
.
log
(
'添加事件'
,
item
)
// console.log('添加事件', item)
formAdd
.
value
=
{}
const
{
id
}
=
item
formData
.
value
=
{
dataarea_id
:
id
}
modalPopShow
.
value
=
true
modalPopShow
.
value
=
true
}
}
// 删除事件
// 删除事件
const
collapseDelete
=
(
item
)
=>
{
const
collapseDelete
=
(
item
)
=>
{
console
.
log
(
'删除事件'
,
item
)
console
.
log
(
'删除事件'
,
item
)
delData
.
value
=
item
modalData
.
show
=
true
modalData
.
show
=
true
modalData
.
icon
=
'error'
modalData
.
icon
=
'error'
modalData
.
text
=
'确认删除['
+
item
.
name
+
']?'
modalData
.
text
=
'确认删除['
+
item
.
name
+
']?'
...
@@ -99,21 +97,53 @@ const collapseDelete = (item) => {
...
@@ -99,21 +97,53 @@ const collapseDelete = (item) => {
// 删除回调
// 删除回调
const
modalConfirm
=
()
=>
{
const
modalConfirm
=
()
=>
{
modalData
.
show
=
false
const
data
=
{
relationid
:
delData
.
value
.
id
}
del
(
data
).
then
(
res
=>
{
const
{
flag
}
=
res
if
(
flag
)
{
ElMessage
.
success
(
'删除成功'
)
getCollapse
()
modalData
.
show
=
false
}
else
{
ElMessage
.
error
(
'删除失败'
)
}
})
}
}
// 点击监听
// 点击监听
const
collapseChange
=
(
item
)
=>
{
const
collapseChange
=
(
item
)
=>
{
formEdit
.
value
=
item
console
.
log
(
'修改事件'
,
item
)
formData
.
value
=
{
...
item
.
item
}
}
}
// 算法确认
// 算法确认
const
formModuleConfirm
=
(
item
)
=>
{
const
formModuleConfirm
=
(
item
)
=>
{
console
.
log
(
'新增算法'
,
item
)
console
.
log
(
'新增算法'
,
item
)
getCollapse
()
modalPopShow
.
value
=
false
modalPopShow
.
value
=
false
}
}
// 查询加密规则
const
getQueryenc
=
()
=>
{
queryenc
({}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
encryptionList
.
value
=
data
.
map
((
item
)
=>
{
return
{
value
:
item
.
id
,
label
:
item
.
encryption_name
,
};
});
});
};
onMounted
(()
=>
{
onMounted
(()
=>
{
getQueryenc
()
getCollapse
()
getCollapse
()
})
})
...
@@ -129,14 +159,15 @@ onMounted(() => {
...
@@ -129,14 +159,15 @@ onMounted(() => {
<Split
v-model=
"splitNum"
>
<Split
v-model=
"splitNum"
>
<
template
#
left
>
<
template
#
left
>
<div
class=
"demo-split-pane"
style=
"padding: 0 38px 10px 0;width: 100%;overflow: auto;height: 100%;"
>
<div
class=
"demo-split-pane"
style=
"padding: 0 38px 10px 0;width: 100%;overflow: auto;height: 100%;"
>
<el-input
class=
"mb20"
placeholder=
"加密算法搜索"
>
<el-input
class=
"mb20"
v-model=
"queryParams.dataarea"
placeholder=
"加密算法搜索"
>
<template
#
suffix
>
<template
#
suffix
>
<el-icon
style=
"vertical-align: middle;"
>
<el-icon
style=
"vertical-align: middle;
cursor: pointer;"
@
click=
"getCollapse
"
>
<search
/>
<search
/>
</el-icon>
</el-icon>
</
template
>
</
template
>
</el-input>
</el-input>
<CollapseView
:list=
"collapseList"
@
add=
"collapseAdd"
@
childDelete=
"collapseDelete"
@
change=
"collapseChange"
/>
<CollapseView
:list=
"collapseList"
@
add=
"collapseAdd"
@
childDelete=
"collapseDelete"
@
change=
"collapseChange"
/>
</div>
</div>
</template>
</template>
<
template
#
right
>
<
template
#
right
>
...
@@ -149,7 +180,8 @@ onMounted(() => {
...
@@ -149,7 +180,8 @@ onMounted(() => {
<span
style=
"margin-left: 5px;"
>
加密算法
</span>
<span
style=
"margin-left: 5px;"
>
加密算法
</span>
</div>
</div>
<div
class=
"right-content"
>
<div
class=
"right-content"
>
<formModule
v-model=
"formEdit"
type=
"edit"
/>
<formModule
:itemData=
"formData"
:encryptionDict=
"encryptionList"
type=
"edit"
@
cancel=
"modalPopCancel"
@
confirm=
"formModuleConfirm"
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -163,7 +195,8 @@ onMounted(() => {
...
@@ -163,7 +195,8 @@ onMounted(() => {
<!-- 新增加密算法 -->
<!-- 新增加密算法 -->
<ModalPop
v-model=
"modalPopShow"
title=
"编辑器"
@
cancel=
"modalPopCancel"
>
<ModalPop
v-model=
"modalPopShow"
title=
"编辑器"
@
cancel=
"modalPopCancel"
>
<
template
#
content
>
<
template
#
content
>
<formModule
v-model=
"formAdd"
type=
"add"
@
cancel=
"modalPopCancel"
@
confirm=
"formModuleConfirm"
/>
<formModule
:itemData=
"formData"
:encryptionDict=
"encryptionList"
type=
"add"
@
cancel=
"modalPopCancel"
@
confirm=
"formModuleConfirm"
/>
</
template
>
</
template
>
</ModalPop>
</ModalPop>
</div>
</div>
...
...
src/views/ruleConfig/CalculationMethod/modules/formModule.vue
View file @
7ced7262
<
script
setup
lang=
"ts"
name=
"Form"
>
<
script
setup
lang=
"ts"
name=
"Form"
>
import
{
onMounted
,
reactive
,
ref
,
toRefs
,
watch
}
from
"vue"
;
import
{
onMounted
,
reactive
,
ref
,
toRefs
,
watch
}
from
"vue"
;
import
{
Switch
}
from
"view-ui-plus"
;
import
{
Switch
}
from
"view-ui-plus"
;
import
type
{
FormInstance
}
from
"element-plus"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
querysec
,
save
}
from
"@/api/ruleConfig/calculationMethod"
;
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
modelValue
:
boolean
;
itemData
:
boolean
;
type
:
string
;
type
:
string
;
encryptionDict
:
Array
<
any
>
;
}
>
();
}
>
();
const
emit
=
defineEmits
([
"
update:modelValue"
,
'cancel'
,
'confirm'
]);
const
emit
=
defineEmits
([
"
cancel"
,
"confirm"
]);
const
data
=
reactive
({
const
data
=
reactive
({
rules
:
{},
form
:
<
any
>
{
dataarea_id
:
""
,
defaulttype
:
"0"
,
enc_name
:
""
,
encryption_id
:
""
,
secretkey_id
:
""
,
},
rules
:
{
enc_name
:
[
{
required
:
true
,
message
:
"请输入数据域名称"
,
trigger
:
[
"blur"
],
},
],
encryption_id
:
[
{
required
:
true
,
message
:
"请选择加密规则"
,
trigger
:
[
"change"
],
},
],
secretkey_id
:
[
{
required
:
true
,
message
:
"请选择密钥"
,
trigger
:
[
"change"
],
},
],
},
});
});
const
{
rules
}
=
toRefs
(
data
);
const
{
form
,
rules
}
=
toRefs
(
data
);
const
encryptionList
=
ref
<
any
[]
>
([]);
// 加密规则选项列表
const
secretkeyList
=
ref
<
any
[]
>
([]);
// 密钥选项列表
const
readOnly
=
ref
(
true
);
const
readOnly
=
ref
(
true
);
const
formRef
=
ref
<
FormInstance
>
();
watch
(
// 重置
()
=>
props
.
type
,
const
reset
=
()
=>
{
(
newVal
)
=>
{
form
.
value
=
{
readOnly
.
value
=
props
.
type
===
'edit'
?
true
:
false
;
dataarea_id
:
""
,
},
defaulttype
:
"0"
,
{
deep
:
true
,
immediate
:
true
}
enc_name
:
""
,
);
encryption_id
:
""
,
secretkey_id
:
""
,
};
}
// 取消
// 取消
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
if
(
props
.
type
===
'edit'
)
{
if
(
props
.
type
===
"edit"
)
{
readOnly
.
value
=
true
readOnly
.
value
=
true
;
}
else
if
(
props
.
type
===
'add'
)
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
itemData
));
emit
(
'cancel'
)
form
.
value
=
{
...
form
.
value
,
...
data
};
getQuerysec
()
}
else
if
(
props
.
type
===
"add"
)
{
emit
(
"cancel"
);
}
}
}
}
;
const
confirm
=
()
=>
{
const
confirm
=
()
=>
{
if
(
props
.
type
===
'edit'
)
{
formRef
.
value
?.
validate
((
valid
)
=>
{
readOnly
.
value
=
true
if
(
valid
)
{
saveFunc
();
}
else
{
}
});
};
const
saveFunc
=
()
=>
{
console
.
log
(
form
.
value
)
if
(
props
.
type
===
"edit"
)
{
form
.
value
=
{
...
form
.
value
,
...{
id
:
form
.
value
.
id
}
}
}
}
emit
(
'confirm'
)
save
(
form
.
value
).
then
((
res
)
=>
{
const
{
flag
}
=
res
;
if
(
flag
)
{
ElMessage
.
success
((
props
.
type
===
"add"
||
!
form
.
value
.
id
)
?
"新增成功"
:
"修改成功"
);
if
(
props
.
type
===
"edit"
)
{
readOnly
.
value
=
true
;
}
else
if
(
props
.
type
===
"add"
)
{
reset
()
}
emit
(
"confirm"
);
}
});
}
}
// 查询密钥
const
getQuerysec
=
()
=>
{
querysec
({
encryption_id
:
form
.
value
.
encryption_id
}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
secretkeyList
.
value
=
data
.
map
((
item
)
=>
{
return
{
value
:
item
.
id
,
label
:
item
.
secret_key_name
,
};
});
});
};
// 加密规则变化
const
encryptionChange
=
()
=>
{
form
.
value
.
secretkey_id
=
''
getQuerysec
()
}
watch
(
()
=>
props
.
type
,
(
newVal
)
=>
{
readOnly
.
value
=
props
.
type
===
"edit"
?
true
:
false
;
},
{
deep
:
true
,
immediate
:
true
}
);
watch
(
()
=>
props
.
itemData
,
(
newVal
)
=>
{
if
(
props
.
itemData
)
{
if
(
!
props
.
itemData
.
enc_name
)
{
reset
()
}
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
itemData
));
form
.
value
=
{
...
form
.
value
,
...
data
};
if
(
props
.
type
===
"edit"
&&
form
.
value
.
secretkey_id
)
{
getQuerysec
()
}
}
},
{
deep
:
true
,
immediate
:
true
}
);
watch
(
()
=>
props
.
encryptionDict
,
(
newVal
)
=>
{
encryptionList
.
value
=
props
.
encryptionDict
;
},
{
deep
:
true
,
immediate
:
true
}
);
</
script
>
</
script
>
<
template
>
<
template
>
<div>
<div>
<el-form
ref=
"formRef"
:model=
"
modelValue
"
label-width=
"100px"
:disabled=
"readOnly"
>
<el-form
ref=
"formRef"
:model=
"
form"
:rules=
"rules
"
label-width=
"100px"
:disabled=
"readOnly"
>
<el-form-item
label=
"算法名称"
required
>
<el-form-item
label=
"算法名称"
prop=
"enc_name"
required
>
<el-input
v-model=
"
modelValue.
name"
placeholder=
"请输入算法名称"
></el-input>
<el-input
v-model=
"
form.enc_
name"
placeholder=
"请输入算法名称"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"加密规则"
required
>
<el-form-item
label=
"加密规则"
prop=
"encryption_id"
required
>
<div
style=
"width: 100%;background: #F3F5FA;"
>
<div
style=
"width: 100%;background: #F3F5FA;"
>
<el-select
v-model=
"modelValue.name"
>
<el-select
v-model=
"form.encryption_id"
@
change=
"encryptionChange"
>
<el-option
<el-option
v-for=
"item in encryptionList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-option>
</el-select>
</el-select>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"密钥"
required
>
<el-form-item
label=
"密钥"
prop=
"secretkey_id"
required
>
<div
style=
"width: 100%;background: #F3F5FA;"
>
<div
style=
"width: 100%;background: #F3F5FA;"
>
<el-select
v-model=
"modelValue.name"
>
<el-select
v-model=
"form.secretkey_id"
>
<el-option
<el-option
v-for=
"item in secretkeyList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-option>
</el-select>
</el-select>
</div>
</div>
</el-form-item>
</el-form-item>
<el-form-item
label=
"默认规则"
>
<el-form-item
label=
"默认规则"
>
<Switch
:disabled=
"readOnly"
>
<Switch
true-value=
"1"
false-value=
"0"
v-model=
"form.defaulttype"
:disabled=
"readOnly"
>
<template
#
open
>
<template
#
open
>
<span>
是
</span>
<span>
是
</span>
</
template
>
</
template
>
...
...
src/views/ruleConfig/Discover/index.vue
View file @
7ced7262
...
@@ -65,7 +65,7 @@ const getCollapse = () => {
...
@@ -65,7 +65,7 @@ const getCollapse = () => {
isDelete
:
true
,
isDelete
:
true
,
}
}
})
})
if
(
collapseList
.
value
.
length
<
0
)
return
if
(
collapseList
.
value
.
length
<
=
0
)
return
domainForm
.
value
=
collapseList
.
value
[
0
]
domainForm
.
value
=
collapseList
.
value
[
0
]
rightType
.
value
=
'domain'
rightType
.
value
=
'domain'
})
})
...
...
src/views/ruleConfig/Discover/modules/AddRules.vue
View file @
7ced7262
...
@@ -18,7 +18,7 @@ const props = defineProps<{
...
@@ -18,7 +18,7 @@ const props = defineProps<{
const
emit
=
defineEmits
([
"cancel"
,
"confirm"
]);
const
emit
=
defineEmits
([
"cancel"
,
"confirm"
]);
const
subRuleidList
=
ref
([])
const
subRuleidList
=
ref
([])
;
const
data
=
reactive
({
const
data
=
reactive
({
form
:
<
any
>
{
form
:
<
any
>
{
dataarea_id
:
""
,
dataarea_id
:
""
,
...
@@ -36,7 +36,7 @@ const data = reactive({
...
@@ -36,7 +36,7 @@ const data = reactive({
matchingway
:
""
,
matchingway
:
""
,
defaulttype
:
"0"
,
defaulttype
:
"0"
,
remark
:
""
,
remark
:
""
,
testString
:
""
testString
:
""
,
},
},
rules
:
{
rules
:
{
name
:
[
name
:
[
...
@@ -89,22 +89,34 @@ const modalData = reactive({
...
@@ -89,22 +89,34 @@ const modalData = reactive({
type
:
""
,
type
:
""
,
});
});
watch
(
// 重置
()
=>
[
props
.
type
,
props
.
itemData
],
const
reset
=
()
=>
{
(
newVal
)
=>
{
form
.
value
=
{
readOnly
.
value
=
props
.
type
===
"edit"
?
true
:
false
;
dataarea_id
:
""
,
if
(
props
.
itemData
)
{
id
:
""
,
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
itemData
));
name
:
""
,
form
.
value
=
{
...
form
.
value
,
...
data
};
type
:
""
,
}
flag
:
""
,
},
discoverway
:
"01"
,
{
deep
:
true
,
immediate
:
true
}
regex
:
""
,
);
icon
:
""
,
ruleexample
:
""
,
ruleargument
:
""
,
rulegroupname
:
""
,
dictionaryClass
:
""
,
matchingway
:
""
,
defaulttype
:
"0"
,
remark
:
""
,
testString
:
""
,
};
};
// 取消
// 取消
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
if
(
props
.
type
===
"edit"
)
{
if
(
props
.
type
===
"edit"
)
{
readOnly
.
value
=
true
;
readOnly
.
value
=
true
;
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
itemData
));
form
.
value
=
{
...
form
.
value
,
...
data
};
}
else
if
(
props
.
type
===
"add"
)
{
}
else
if
(
props
.
type
===
"add"
)
{
emit
(
"cancel"
);
emit
(
"cancel"
);
}
}
...
@@ -138,24 +150,7 @@ const addDataFun = () => {
...
@@ -138,24 +150,7 @@ const addDataFun = () => {
if
(
props
.
type
===
"edit"
)
{
if
(
props
.
type
===
"edit"
)
{
readOnly
.
value
=
true
;
readOnly
.
value
=
true
;
}
else
if
(
props
.
type
===
"add"
)
{
}
else
if
(
props
.
type
===
"add"
)
{
form
.
value
=
{
reset
();
dataarea_id
:
""
,
id
:
""
,
name
:
""
,
type
:
""
,
flag
:
""
,
discoverway
:
"01"
,
regex
:
""
,
icon
:
""
,
ruleexample
:
""
,
ruleargument
:
""
,
rulegroupname
:
""
,
dictionaryClass
:
""
,
matchingway
:
""
,
defaulttype
:
"0"
,
remark
:
""
,
testString
:
""
};
}
}
emit
(
"confirm"
);
emit
(
"confirm"
);
}
}
...
@@ -172,7 +167,8 @@ const getDictionaryTypesFunc = () => {
...
@@ -172,7 +167,8 @@ const getDictionaryTypesFunc = () => {
// 规则测试
// 规则测试
const
testRegexFun
=
()
=>
{
const
testRegexFun
=
()
=>
{
const
{
dictionaryClass
,
discoverway
,
matchingway
,
regex
,
testString
}
=
form
.
value
;
const
{
dictionaryClass
,
discoverway
,
matchingway
,
regex
,
testString
}
=
form
.
value
;
const
data
=
{
const
data
=
{
dictionaryClass
:
dictionaryClass
,
dictionaryClass
:
dictionaryClass
,
discoverway
:
discoverway
,
discoverway
:
discoverway
,
...
@@ -183,7 +179,7 @@ const testRegexFun = () => {
...
@@ -183,7 +179,7 @@ const testRegexFun = () => {
};
};
formRef
.
value
?.
validate
((
valid
)
=>
{
formRef
.
value
?.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
testRegex
(
data
).
then
((
res
)
=>
{
testRegex
(
data
).
then
((
res
)
=>
{
const
{
flag
,
msg
}
=
res
;
const
{
flag
,
msg
}
=
res
;
if
(
flag
)
{
if
(
flag
)
{
modalData
.
icon
=
"success"
;
modalData
.
icon
=
"success"
;
...
@@ -194,7 +190,7 @@ const testRegexFun = () => {
...
@@ -194,7 +190,7 @@ const testRegexFun = () => {
modalData
.
text
=
msg
;
modalData
.
text
=
msg
;
modalData
.
show
=
true
;
modalData
.
show
=
true
;
}
}
})
})
;
}
else
{
}
else
{
}
}
});
});
...
@@ -212,6 +208,25 @@ const modalCancel = () => {
...
@@ -212,6 +208,25 @@ const modalCancel = () => {
modalData
.
show
=
false
;
modalData
.
show
=
false
;
};
};
watch
(
()
=>
props
.
type
,
(
newVal
)
=>
{
readOnly
.
value
=
props
.
type
===
"edit"
?
true
:
false
;
},
{
deep
:
true
,
immediate
:
true
}
);
watch
(
()
=>
props
.
itemData
,
(
newVal
)
=>
{
if
(
props
.
itemData
)
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
itemData
));
form
.
value
=
{
...
form
.
value
,
...
data
};
}
},
{
deep
:
true
,
immediate
:
true
}
);
onMounted
(()
=>
{
onMounted
(()
=>
{
getDictionaryTypesFunc
();
getDictionaryTypesFunc
();
});
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论