({
primaryTitle: '申请编号',
action: true,
actionWidth: '260',
+ searchSpan: 8,
columns: [
{
title: t('common.status'),
diff --git a/src/views/bpm/processInstance/create.vue b/src/views/bpm/processInstance/create.vue
index c0542b22..084c085c 100644
--- a/src/views/bpm/processInstance/create.vue
+++ b/src/views/bpm/processInstance/create.vue
@@ -3,6 +3,10 @@
+
+
+
+
v{{ row.version }}
@@ -56,6 +60,7 @@ import * as DefinitionApi from '@/api/bpm/definition'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { setConfAndFields2 } from '@/utils/formCreate'
import { ApiAttrs } from '@form-create/element-ui/types/config'
+import { DICT_TYPE } from '@/utils/dict'
const router = useRouter() // 路由
const message = useMessage() // 消息
diff --git a/src/views/bpm/processInstance/process.create.ts b/src/views/bpm/processInstance/process.create.ts
index b2282406..7516c0b4 100644
--- a/src/views/bpm/processInstance/process.create.ts
+++ b/src/views/bpm/processInstance/process.create.ts
@@ -14,7 +14,12 @@ const crudSchemas = reactive({
title: '流程分类',
field: 'category',
dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
- dictClass: 'number'
+ dictClass: 'number',
+ table: {
+ slots: {
+ default: 'category_default'
+ }
+ }
},
{
title: '流程版本',
diff --git a/src/views/bpm/task/todo/todo.data.ts b/src/views/bpm/task/todo/todo.data.ts
index 85c58ce9..419a80fe 100644
--- a/src/views/bpm/task/todo/todo.data.ts
+++ b/src/views/bpm/task/todo/todo.data.ts
@@ -7,6 +7,7 @@ const crudSchemas = reactive({
primaryKey: 'id',
primaryType: null,
action: true,
+ searchSpan: 8,
columns: [
{
title: '任务编号',
diff --git a/src/views/bpm/taskAssignRule/index.vue b/src/views/bpm/taskAssignRule/index.vue
index e6e4b88f..012e6f68 100644
--- a/src/views/bpm/taskAssignRule/index.vue
+++ b/src/views/bpm/taskAssignRule/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -145,11 +145,12 @@ import { listSimpleUserGroupsApi } from '@/api/bpm/userGroup'
import { listSimpleDeptApi } from '@/api/system/dept'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { handleTree, defaultProps } from '@/utils/tree'
-import { allSchemas, rules } from './taskAssignRule.data'
+import { allSchemas, rules, idShowActionClick } from './taskAssignRule.data'
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const { query } = useRoute()
+const xGrid = ref()
// ========== 列表相关 ==========
@@ -165,6 +166,8 @@ const taskAssignScriptDictDatas = getDictOptions(DICT_TYPE.BPM_TASK_ASSIGN_SCRIP
const modelId = query.modelId
// 流程定义的编号。如果 processDefinitionId 非空,则用于流程定义的查看,不支持配置
const processDefinitionId = query.processDefinitionId
+let isShow = idShowActionClick(modelId)
+
// 查询参数
const queryParams = reactive({
modelId: modelId,
@@ -346,5 +349,10 @@ onMounted(() => {
listSimpleUserGroupsApi().then((data) => {
userGroupOptions.value.push(...data)
})
+ if (!isShow) {
+ setTimeout(() => {
+ xGrid.value.Ref.hideColumn('actionbtns')
+ }, 100)
+ }
})
diff --git a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts b/src/views/bpm/taskAssignRule/taskAssignRule.data.ts
index 1ced3425..cad74325 100644
--- a/src/views/bpm/taskAssignRule/taskAssignRule.data.ts
+++ b/src/views/bpm/taskAssignRule/taskAssignRule.data.ts
@@ -43,4 +43,12 @@ const crudSchemas = reactive({
}
]
})
+
+export const idShowActionClick = (modelId?: any) => {
+ if (modelId) {
+ return true
+ } else {
+ return false
+ }
+}
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
diff --git a/src/views/system/dept/dept.data.ts b/src/views/system/dept/dept.data.ts
index 5e3d0761..c6945841 100644
--- a/src/views/system/dept/dept.data.ts
+++ b/src/views/system/dept/dept.data.ts
@@ -6,7 +6,15 @@ const { t } = useI18n() // 国际化
export const rules = reactive({
name: [required],
sort: [required],
- email: [required],
+ // email: [required],
+ email: [
+ { required: true, message: t('profile.rules.mail'), trigger: 'blur' },
+ {
+ type: 'email',
+ message: t('profile.rules.truemail'),
+ trigger: ['blur', 'change']
+ }
+ ],
phone: [
{
len: 11,
diff --git a/src/views/system/mail/account/account.data.ts b/src/views/system/mail/account/account.data.ts
index a2e29f85..bd05ce4f 100644
--- a/src/views/system/mail/account/account.data.ts
+++ b/src/views/system/mail/account/account.data.ts
@@ -1,8 +1,18 @@
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
+const { t } = useI18n() // 国际化
+
// 表单校验
export const rules = reactive({
- mail: [required],
+ // mail: [required],
+ mail: [
+ { required: true, message: t('profile.rules.mail'), trigger: 'blur' },
+ {
+ type: 'email',
+ message: t('profile.rules.truemail'),
+ trigger: ['blur', 'change']
+ }
+ ],
username: [required],
password: [required],
host: [required],
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 645546a9..da4b8389 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -131,7 +131,6 @@
ref="treeRef"
node-key="id"
show-checkbox
- :default-checked-keys="defaultCheckedKeys"
:check-strictly="!checkStrictly"
:props="defaultProps"
:data="treeOptions"
@@ -255,7 +254,6 @@ const dialogScopeVisible = ref(false)
const dialogScopeTitle = ref('数据权限')
const actionScopeType = ref('')
const dataScopeDictDatas = ref()
-const defaultCheckedKeys = ref()
// 选项
const checkStrictly = ref(true)
const treeNodeAll = ref(false)
@@ -268,13 +266,16 @@ const handleScope = async (type: string, row: RoleApi.RoleVO) => {
dataScopeForm.id = row.id
dataScopeForm.name = row.name
dataScopeForm.code = row.code
+ actionScopeType.value = type
+ dialogScopeVisible.value = true
if (type === 'menu') {
const menuRes = await listSimpleMenusApi()
treeOptions.value = handleTree(menuRes)
const role = await PermissionApi.listRoleMenusApi(row.id)
if (role) {
- // treeRef.value!.setCheckedKeys(role as unknown as Array)
- defaultCheckedKeys.value = role
+ role?.forEach((item: any) => {
+ unref(treeRef)?.setChecked(item, true, false)
+ })
}
} else if (type === 'data') {
const deptRes = await listSimpleDeptApi()
@@ -282,12 +283,11 @@ const handleScope = async (type: string, row: RoleApi.RoleVO) => {
const role = await RoleApi.getRoleApi(row.id)
dataScopeForm.dataScope = role.dataScope
if (role.dataScopeDeptIds) {
- // treeRef.value!.setCheckedKeys(role.dataScopeDeptIds as unknown as Array, false)
- defaultCheckedKeys.value = role.dataScopeDeptIds
+ role.dataScopeDeptIds?.forEach((item: any) => {
+ unref(treeRef)?.setChecked(item, true, false)
+ })
}
}
- actionScopeType.value = type
- dialogScopeVisible.value = true
}
// 保存权限
const submitScope = async () => {
diff --git a/src/views/system/role/role.data.ts b/src/views/system/role/role.data.ts
index fef2ec47..d55b5e21 100644
--- a/src/views/system/role/role.data.ts
+++ b/src/views/system/role/role.data.ts
@@ -9,12 +9,19 @@ export const rules = reactive({
})
// CrudSchema
const crudSchemas = reactive({
- primaryKey: 'id',
- primaryTitle: '角色编号',
- primaryType: 'seq',
+ // primaryKey: 'id',
+ // primaryTitle: '角色编号',
+ // primaryType: 'seq',
action: true,
actionWidth: '400px',
columns: [
+ {
+ title: '角色编号',
+ field: 'id',
+ table: {
+ width: 200
+ }
+ },
{
title: '角色名称',
field: 'name',
diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts
index 7e81138c..110bfbb3 100644
--- a/src/views/system/tenant/tenant.data.ts
+++ b/src/views/system/tenant/tenant.data.ts
@@ -27,6 +27,24 @@ export const rules = reactive({
contactMobile: [required],
accountCount: [required],
expireTime: [required],
+ username: [
+ required,
+ {
+ min: 4,
+ max: 30,
+ trigger: 'blur',
+ message: '用户名称长度为 4-30 个字符'
+ }
+ ],
+ password: [
+ required,
+ {
+ min: 4,
+ max: 16,
+ trigger: 'blur',
+ message: '密码长度为 4-16 位'
+ }
+ ],
domain: [required],
status: [required]
})
diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue
index 61831489..9222365b 100644
--- a/src/views/system/tenantPackage/index.vue
+++ b/src/views/system/tenantPackage/index.vue
@@ -135,7 +135,9 @@ const handleUpdate = async (rowId: number) => {
const res = await TenantPackageApi.getTenantPackageApi(rowId)
unref(formRef)?.setValues(res)
// 设置选中
- unref(treeRef)?.setCheckedKeys(res.menuIds)
+ res.menuIds?.forEach((item: any) => {
+ unref(treeRef)?.setChecked(item, true, false)
+ })
}
// 提交按钮
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 3305b275..5568ca2a 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -332,7 +332,6 @@ const getPostOptions = async () => {
const res = await listSimplePostsApi()
postOptions.value.push(...res)
}
-
const dataFormater = (val) => {
return deptFormater(deptOptions.value, val)
}
@@ -409,24 +408,31 @@ const handleDetail = async (rowId: number) => {
// 提交按钮
const submitForm = async () => {
- loading.value = true
// 提交请求
- try {
- const data = unref(formRef)?.formModel as UserApi.UserVO
- if (actionType.value === 'create') {
- await UserApi.createUserApi(data)
- message.success(t('common.createSuccess'))
- } else {
- await UserApi.updateUserApi(data)
- message.success(t('common.updateSuccess'))
+ const elForm = unref(formRef)?.getElFormRef()
+ if (!elForm) return
+ elForm.validate(async (valid) => {
+ if (valid) {
+ try {
+ const data = unref(formRef)?.formModel as UserApi.UserVO
+ if (actionType.value === 'create') {
+ await UserApi.createUserApi(data)
+ loading.value = true
+ message.success(t('common.createSuccess'))
+ } else {
+ await UserApi.updateUserApi(data)
+ loading.value = true
+ message.success(t('common.updateSuccess'))
+ }
+ dialogVisible.value = false
+ } finally {
+ // unref(formRef)?.setSchema(allSchemas.formSchema)
+ // 刷新列表
+ await reload()
+ loading.value = false
+ }
}
- dialogVisible.value = false
- } finally {
- // unref(formRef)?.setSchema(allSchemas.formSchema)
- // 刷新列表
- await reload()
- loading.value = false
- }
+ })
}
// 改变用户状态操作
const handleStatusChange = async (row: UserApi.UserVO) => {
diff --git a/src/views/system/user/user.data.ts b/src/views/system/user/user.data.ts
index 12c777fc..eb20b999 100644
--- a/src/views/system/user/user.data.ts
+++ b/src/views/system/user/user.data.ts
@@ -5,6 +5,8 @@ const { t } = useI18n()
export const rules = reactive({
username: [required],
nickname: [required],
+ password: [required],
+ deptId: [required],
email: [
{ required: true, message: t('profile.rules.mail'), trigger: 'blur' },
{
diff --git a/types/global.d.ts b/types/global.d.ts
index 3179c200..6f583ba7 100644
--- a/types/global.d.ts
+++ b/types/global.d.ts
@@ -1,4 +1,3 @@
-import type { CSSProperties } from 'vue'
declare global {
declare interface Fn {
(...arg: T[]): T