feat: 1. 完善全局路由的访问权限的验证。 2. 完善接口返回的树形路由结构 3.优化评查点列表的查询,改用表连接的方式,废弃使用数据库的rpc函数,同时进行地区隔离和权限隔离。
4. 删除冗余的评查文件列表。 5.完善上传文档 页面初始化查询数据的时候 查询文件类型(改成动态指定) 6. 添加获取入口模块的查询接口。 7.完善服务端中判断token的有效性,失效则跳转到登录页。 8. 重构layout和sidebar的页面,改成由动态权限路由来渲染对应的菜单栏。 9.重构入口页面,通过动态查询根据不同地区的人返回不同的入口。
This commit is contained in:
@@ -24,11 +24,11 @@ export function BasicInfo({ onChange, initialData, evaluationPointGroups = [], r
|
||||
// 找到当前评查点类型对应的code
|
||||
const getCheckpointTypeCode = () => {
|
||||
if (!formData.evaluation_point_groups_pid) return "";
|
||||
|
||||
|
||||
const typeGroup = evaluationPointGroups.find(
|
||||
group => group.id === formData.evaluation_point_groups_pid && group.pid === 0
|
||||
group => group.id === formData.evaluation_point_groups_pid && (!group.pid || group.pid === 0) // 🆕 NULL或0都表示顶级分组
|
||||
);
|
||||
|
||||
|
||||
return typeGroup?.code || "";
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ export function BasicInfo({ onChange, initialData, evaluationPointGroups = [], r
|
||||
group.is_enabled
|
||||
);
|
||||
|
||||
// 获取评查点类型选项(pid=0的数据)
|
||||
// 🆕 获取评查点类型选项(pid为NULL或0的数据)
|
||||
const getCheckpointTypeOptions = () => {
|
||||
if (!evaluationPointGroups || evaluationPointGroups.length === 0) {
|
||||
return (
|
||||
@@ -54,8 +54,8 @@ export function BasicInfo({ onChange, initialData, evaluationPointGroups = [], r
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const typeGroups = evaluationPointGroups.filter(group => group.pid === 0 && group.is_enabled);
|
||||
|
||||
const typeGroups = evaluationPointGroups.filter(group => (!group.pid || group.pid === 0) && group.is_enabled);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -113,8 +113,8 @@ export function BasicInfo({ onChange, initialData, evaluationPointGroups = [], r
|
||||
case 'checkpoint-type':
|
||||
// 处理评查点类型选择
|
||||
if (value) {
|
||||
// 找到选中的类型组
|
||||
const selectedType = evaluationPointGroups.find(group => group.code === value && group.pid === 0);
|
||||
// 🆕 找到选中的类型组(pid为NULL或0表示顶级分组)
|
||||
const selectedType = evaluationPointGroups.find(group => group.code === value && (!group.pid || group.pid === 0));
|
||||
if (selectedType) {
|
||||
newData.evaluation_point_groups_pid = selectedType.id;
|
||||
}
|
||||
|
||||
@@ -1029,51 +1029,55 @@ export function ExtractionSettings({
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<label
|
||||
className="form-label mb-1"
|
||||
htmlFor="regex-template-container"
|
||||
>
|
||||
常用正则模板
|
||||
</label>
|
||||
<div
|
||||
className="flex flex-wrap gap-1 mt-1"
|
||||
id="regex-template-container"
|
||||
>
|
||||
{[
|
||||
{
|
||||
label: "日期格式:yyyy-mm-dd",
|
||||
regex:
|
||||
"\\d{4}[-/年](0?[1-9]|1[0-2])[-/月](0?[1-9]|[12][0-9]|3[01])[日]?",
|
||||
},
|
||||
{ label: "合同编号格式", regex: "[A-Z]{2,5}-\\d{4,10}" },
|
||||
{
|
||||
label: "金额格式",
|
||||
regex:
|
||||
"(人民币|RMB)?\\s?(\\d{1,3}(,\\d{3})*(\\.\\d{2})?)\\s?[万元]?",
|
||||
},
|
||||
{
|
||||
label: "座机号码格式",
|
||||
regex: "\\d{3}-\\d{8}|\\d{4}-\\d{7,8}",
|
||||
},
|
||||
{ label: "手机号码格式", regex: "1[3-9]\\d{9}" },
|
||||
].map(({ label, regex }) => (
|
||||
<div
|
||||
key={label}
|
||||
className="chip cursor-pointer regex-template"
|
||||
onClick={() => applyRegexTemplate(regex)}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ")
|
||||
applyRegexTemplate(regex);
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* 🔑 只有在添加字段后或本来就有字段时才显示常用正则模板 */}
|
||||
{regexFields.length > 0 && (
|
||||
<div className="mt-2">
|
||||
<label
|
||||
className="form-label mb-1"
|
||||
htmlFor="regex-template-container"
|
||||
>
|
||||
常用正则模板
|
||||
</label>
|
||||
<div
|
||||
className="flex flex-wrap gap-1 mt-1"
|
||||
id="regex-template-container"
|
||||
>
|
||||
{[
|
||||
{
|
||||
label: "日期格式:yyyy-mm-dd",
|
||||
regex:
|
||||
"\\d{4}[-/年](0?[1-9]|1[0-2])[-/月](0?[1-9]|[12][0-9]|3[01])[日]?",
|
||||
},
|
||||
{ label: "合同编号格式", regex: "[A-Z]{2,5}-\\d{4,10}" },
|
||||
{
|
||||
label: "金额格式",
|
||||
regex:
|
||||
"(人民币|RMB)?\\s?(\\d{1,3}(,\\d{3})*(\\.\\d{2})?)\\s?[万元]?",
|
||||
},
|
||||
{
|
||||
label: "座机号码格式",
|
||||
regex: "\\d{3}-\\d{8}|\\d{4}-\\d{7,8}",
|
||||
},
|
||||
{ label: "手机号码格式", regex: "1[3-9]\\d{9}" },
|
||||
].map(({ label, regex }) => (
|
||||
<div
|
||||
key={label}
|
||||
className="chip cursor-pointer regex-template"
|
||||
onClick={() => applyRegexTemplate(regex)}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ")
|
||||
applyRegexTemplate(regex);
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user