Commit 524d1cc9 authored by 罗林杰's avatar 罗林杰

修改工作区

parent 7e03dad4
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { accountFormSchema } from './data'; import { accountFormSchema } from './data';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { userData } from '@/views/system/workspace/workSpaceData';
defineOptions({ name: 'AccountModal' }); defineOptions({ name: 'AccountModal' });
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const isUpdate = ref(true); const isUpdate = ref(true);
const rowId = ref(''); const rowId = ref('');
const tableData = ref([]);
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100, labelWidth: 100,
...@@ -36,6 +38,15 @@ ...@@ -36,6 +38,15 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields(); resetFields();
isUpdate.value = !!data?.isUpdate; isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 通过id获取行详情信息
tableData.value = userData;
var useData = [];
useData = tableData.value.filter((item) => item.businessId === rowId.value);
setFieldsValue(useData[0]);
}
}); });
const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户')); const getTitle = computed(() => (!unref(isUpdate) ? '新增用户' : '编辑用户'));
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const isUpdate = ref(true); const isUpdate = ref(true);
const rowId = ref(''); const rowId = ref('');
const tableData = ref([
{
groupName: '测试工作组',
workspaceName: 'admin个人工作区',
},
]);
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100, labelWidth: 100,
...@@ -36,6 +42,12 @@ ...@@ -36,6 +42,12 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields(); resetFields();
isUpdate.value = !!data?.isUpdate; isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
// 通过id获取行详情信息
var userData = [];
userData = tableData.value;
setFieldsValue(userData[0]);
}
}); });
const getTitle = computed(() => (!unref(isUpdate) ? '新增工作组' : '编辑工作组')); const getTitle = computed(() => (!unref(isUpdate) ? '新增工作组' : '编辑工作组'));
......
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
} }
function editGroup() { function editGroup() {
openAddGroupModal(true, { openAddGroupModal(true, {
isUpdate: false, isUpdate: true,
}); });
} }
function handleApproval() { function handleApproval() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment