Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
bigDataSystem
Commits
80efa24c
Commit
80efa24c
authored
Nov 05, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改工作组
parent
b06a3c78
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
144 deletions
+68
-144
data.ts
src/views/system/workspace/data.ts
+6
-141
index.vue
src/views/system/workspace/index.vue
+3
-3
workspaceModal.vue
src/views/system/workspace/workspaceModal.vue
+59
-0
No files found.
src/views/system/workspace/data.ts
View file @
80efa24c
...
...
@@ -54,152 +54,17 @@ export const searchFormSchema: FormSchema[] = [
colProps
:
{
span
:
8
},
},
];
function
passwordCheck
(
rule
,
value
,
callback
)
{
const
hasUpperCase
=
/
[
A-Z
]
/
.
test
(
value
);
const
hasLowerCase
=
/
[
a-z
]
/
.
test
(
value
);
const
hasNumber
=
/
\d
/
.
test
(
value
);
const
hasSpecialChar
=
/
[
~`!@#$%^&*()_
\-
={}
\[\]\\
|;:"'<,>.?
\/]
/
.
test
(
value
);
// 检查密码组成
let
count
=
0
;
if
(
hasUpperCase
)
count
++
;
if
(
hasLowerCase
)
count
++
;
if
(
hasNumber
)
count
++
;
if
(
hasSpecialChar
)
count
++
;
if
(
count
<
3
)
{
return
callback
(
new
Error
(
'密码中需至少包含大写字母、小写字母、数字及特殊字符中的 3 种'
));
}
// 如果所有检查都通过,则调用callback无参数表示验证成功
callback
();
}
export
const
accountFormSchema
:
any
[]
=
[
export
const
formSchema
:
FormSchema
[]
=
[
{
field
:
'
usern
ame'
,
label
:
'
账号
'
,
field
:
'
workSpaceN
ame'
,
label
:
'
工作区名称
'
,
component
:
'Input'
,
// helpMessage: ['本字段演示异步验证', '不能输入带有admin的用户名'],
rules
:
[
{
required
:
true
,
message
:
'请输入登录名'
,
},
],
},
{
field
:
'password'
,
label
:
'密码'
,
component
:
'InputPassword'
,
rules
:
[
{
required
:
true
,
message
:
'请输入用户密码'
,
},
{
min
:
8
,
max
:
25
,
message
:
'长度在 8 到 25 个字符'
,
trigger
:
'blur'
},
{
validator
:
passwordCheck
,
trigger
:
'blur'
,
},
],
},
{
field
:
'name'
,
label
:
'姓名'
,
component
:
'Input'
,
},
{
field
:
'nickName'
,
label
:
'昵称'
,
component
:
'Input'
,
},
{
field
:
'sex'
,
label
:
'性别'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'男'
,
value
:
'1'
},
{
label
:
'女'
,
value
:
'0'
},
],
},
},
{
field
:
'phone'
,
label
:
'手机号码'
,
component
:
'Input'
,
rules
:
[
{
required
:
false
,
message
:
'请输入手机号码'
,
trigger
:
'blur'
},
{
pattern
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
,
message
:
'请输入正确的手机号码'
,
trigger
:
'blur'
,
},
],
},
{
field
:
'idNumber'
,
label
:
'身份证号'
,
component
:
'Input'
,
rules
:
[
{
required
:
false
,
message
:
'请输入身份证号'
,
trigger
:
'blur'
,
},
{
min
:
18
,
max
:
18
,
message
:
'长度18字符'
,
trigger
:
'blur'
},
],
},
{
field
:
'email'
,
label
:
'邮箱'
,
component
:
'Input'
,
rules
:
[
{
required
:
false
,
message
:
'请输入邮箱地址'
,
trigger
:
'blur'
},
{
type
:
'email'
,
message
:
'请输入正确的邮箱地址'
,
trigger
:
[
'blur'
,
'change'
],
},
],
},
{
field
:
'flag'
,
label
:
'状态'
,
component
:
'RadioGroup'
,
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
options
:
[
{
label
:
'启用'
,
value
:
'1'
},
{
label
:
'停用'
,
value
:
'0'
},
],
},
required
:
true
,
},
{
field
:
'deptId'
,
label
:
'所属部门'
,
component
:
'TreeSelect'
,
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
fieldNames
:
{
label
:
'deptName'
,
value
:
'businessId'
,
},
getPopupContainer
:
()
=>
document
.
body
,
},
required
:
true
,
},
{
field
:
'roleList'
,
label
:
'角色'
,
component
:
'ApiSelect'
,
colProps
:
{
lg
:
24
,
md
:
24
},
componentProps
:
{
// placeholder: '公开给',
mode
:
'multiple'
,
api
:
getAllRoleList
,
labelField
:
'roleName'
,
valueField
:
'businessId'
,
resultField
:
'data'
,
},
field
:
'createBy'
,
label
:
'管理员'
,
component
:
'Input'
,
required
:
true
,
},
];
...
...
src/views/system/workspace/index.vue
View file @
80efa24c
...
...
@@ -35,17 +35,17 @@
</
template
>
</template>
</BasicTable>
<
Account
Modal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
<
WorkSpace
Modal
@
register=
"registerModal"
@
success=
"handleSuccess"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
onMounted
,
ref
}
from
'vue'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'@/components/Table'
;
import
{
getAccountList
,
deleteUser
}
from
'@/api/system/user/user'
;
import
{
deleteUser
}
from
'@/api/system/user/user'
;
import
{
PageWrapper
}
from
'@/components/Page'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
useModal
}
from
'@/components/Modal'
;
import
AccountModal
from
'@/views/system/user/Account
Modal.vue'
;
import
WorkSpaceModal
from
'@/views/system/workspace/workspace
Modal.vue'
;
import
{
useRoute
,
onBeforeRouteLeave
}
from
'vue-router'
;
import
{
useFilterStore
}
from
'@/store/modules/filterData'
;
import
{
columns
,
searchFormSchema
}
from
'@/views/system/workspace/data'
;
...
...
src/views/system/workspace/workspaceModal.vue
0 → 100644
View file @
80efa24c
<
template
>
<BasicModal
width=
"40%"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
useMessage
}
from
'@/hooks/web/useMessage'
;
import
{
formSchema
}
from
'@/views/system/workspace/data'
;
import
{
TreeData
}
from
"@/views/system/workspace/workSpaceData"
;
defineOptions
({
name
:
'KnowledgeModal'
});
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
createMessage
}
=
useMessage
();
const
isUpdate
=
ref
(
true
);
const
rowId
=
ref
(
''
);
const
tableData
=
ref
([]);
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const
[
registerForm
,
{
setFieldsValue
,
resetFields
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
lg
:
12
,
md
:
24
},
schemas
:
formSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
23
,
},
});
//初始化弹框
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
resetFields
();
setModalProps
({
confirmLoading
:
false
});
isUpdate
.
value
=
!!
data
?.
isUpdate
;
if
(
unref
(
isUpdate
))
{
// 获取行数据的id
rowId
.
value
=
data
.
record
.
businessId
;
// 通过id获取行详情信息
tableData
.
value
=
TreeData
;
var
userData
=
[];
userData
=
tableData
.
value
.
filter
((
item
)
=>
item
.
businessId
===
rowId
.
value
);
setFieldsValue
(
userData
[
0
]);
}
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增文件'
:
'编辑文件'
));
async
function
handleSubmit
()
{
closeModal
();
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment