Compare commits

..

No commits in common. "3811a5c8a8ead840874d0edf56461dde089f500f" and "c2732625894265997ac1a2512f791e950dda518e" have entirely different histories.

7 changed files with 30 additions and 102 deletions

View File

@ -128,7 +128,7 @@
}); });
/** /**
* 定义函数 * 定义
*/ */
defineExpose({ defineExpose({
openModal, openModal,

View File

@ -72,7 +72,7 @@
v-model:visible="editVisible" v-model:visible="editVisible"
@success="reloadTable('noRefresh')" @success="reloadTable('noRefresh')"
/> />
<!-- 上传文件 -->
<userUpload v-if="importVisible" v-model:visible="importVisible" @success="reloadTable()" /> <userUpload v-if="importVisible" v-model:visible="importVisible" @success="reloadTable()" />
</div> </div>
</template> </template>

View File

@ -69,16 +69,11 @@
default: 0, default: 0,
}, },
}); });
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({ const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.positionId ? '编辑岗位' : '添加岗位', title: props.positionId ? '编辑岗位' : '添加岗位',
subBtuText: '确定', subBtuText: '确定',
width: 600, width: 600,
}); });
/** /**
* 执行提交 * 执行提交
*/ */
@ -125,10 +120,7 @@
setFormData(); setFormData();
} }
}); });
//
/**
* 定义函数
*/
defineExpose({ defineExpose({
openModal, openModal,
}); });

View File

@ -27,6 +27,7 @@
</template> </template>
新建 新建
</n-button> </n-button>
<n-button <n-button
type="error" type="error"
@click="handleDelete" @click="handleDelete"
@ -62,7 +63,9 @@
import { getPositionList, positionDelete, positionBatchDelete } from '@/api/system/position'; import { getPositionList, positionDelete, positionBatchDelete } from '@/api/system/position';
import { columns } from './columns'; import { columns } from './columns';
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd'; import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue'; import editDialog from './edit.vue';
import { basicModal, useModal } from '@/components/Modal';
import { schemas } from './querySchemas'; import { schemas } from './querySchemas';
import { renderIcon } from '@/utils'; import { renderIcon } from '@/utils';
@ -73,21 +76,16 @@
const editVisible = ref(false); const editVisible = ref(false);
const positionId = ref(0); const positionId = ref(0);
const rowKeys = ref([]); const rowKeys = ref([]);
const showModal = ref(false); const exportLoading = ref(false);
/** const showModal = ref(false);
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
name: '', name: '',
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 200, width: 400,
title: '操作', title: '操作',
align: 'center', align: 'center',
key: 'action', key: 'action',
@ -115,36 +113,24 @@
}, },
}); });
/** function addTable() {
* 加载数据列表 showModal.value = true;
* @param res 参数 }
*/
const loadDataTable = async (res) => { const loadDataTable = async (res) => {
rowKeys.value = []; rowKeys.value = [];
const result = await getPositionList({ ...formParams, ...res }); const result = await getPositionList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 数据行选择事件
* @param keys 参数
*/
function onCheckedRow(keys) { function onCheckedRow(keys) {
rowKeys.value = keys; rowKeys.value = keys;
} }
/**
* 加载数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
@ -155,10 +141,6 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
* @param values 参数
*/
function handleReset(values: Recordable) { function handleReset(values: Recordable) {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
@ -169,9 +151,6 @@
reloadTable(); reloadTable();
} }
/**
* 执行注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80, labelWidth: 80,
@ -187,7 +166,6 @@
await nextTick(); await nextTick();
createModalRef.value.openModal(); createModalRef.value.openModal();
}; };
/** /**
* 执行编辑 * 执行编辑
*/ */
@ -197,7 +175,6 @@
await nextTick(); await nextTick();
createModalRef.value.openModal(); createModalRef.value.openModal();
} }
/** /**
* 执行删除 * 执行删除
* @param id 参数 * @param id 参数

View File

@ -92,7 +92,8 @@
label-field="name" label-field="name"
value-field="id" value-field="id"
placeholder="请选择角色" placeholder="请选择角色"
/> >
</n-select>
</n-form-item> </n-form-item>
<n-form-item <n-form-item
label="部门" label="部门"
@ -134,7 +135,8 @@
:options="optionData.levelList" :options="optionData.levelList"
label-field="name" label-field="name"
value-field="id" value-field="id"
/> >
</n-select>
</n-form-item> </n-form-item>
<n-form-item <n-form-item
label="岗位" label="岗位"
@ -155,7 +157,8 @@
class="flex-1" class="flex-1"
clearable clearable
placeholder="请选择岗位" placeholder="请选择岗位"
/> >
</n-select>
</n-form-item> </n-form-item>
</div> </div>
<div class="flex"> <div class="flex">
@ -285,9 +288,6 @@
*/ */
const emit = defineEmits(['success', 'update:visible']); const emit = defineEmits(['success', 'update:visible']);
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({ const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.userId ? '编辑用户' : '添加用户', title: props.userId ? '编辑用户' : '添加用户',
subBtuText: '确定', subBtuText: '确定',
@ -395,18 +395,10 @@
positionList: [], positionList: [],
}); });
/**
* 上传发生变化
*/
function uploadChange(data: string[]) { function uploadChange(data: string[]) {
formData.avatar = data.fileUrl; formData.avatar = data.fileUrl;
formData.avatarName = data.fileName; formData.avatarName = data.fileName;
} }
/**
* 执行删除
* @param file 文件参数
*/
const handleDelete = async (file) => { const handleDelete = async (file) => {
console.log(file); console.log(file);
}; };
@ -434,10 +426,7 @@
setFormData({ userId: props.userId }); setFormData({ userId: props.userId });
} }
}); });
//
/**
* 定义函数
*/
defineExpose({ defineExpose({
openModal, openModal,
}); });

View File

@ -27,6 +27,7 @@
</template> </template>
新建 新建
</n-button> </n-button>
<n-button <n-button
type="error" type="error"
@click="handleDelete" @click="handleDelete"
@ -72,7 +73,7 @@
v-model:visible="editVisible" v-model:visible="editVisible"
@success="reloadTable('noRefresh')" @success="reloadTable('noRefresh')"
/> />
<!-- 上传文件 -->
<userUpload v-if="importVisible" v-model:visible="importVisible" @success="reloadTable()" /> <userUpload v-if="importVisible" v-model:visible="importVisible" @success="reloadTable()" />
</div> </div>
</template> </template>
@ -100,8 +101,10 @@
ToTopOutlined, ToTopOutlined,
FormOutlined, FormOutlined,
} from '@vicons/antd'; } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue'; import editDialog from './edit.vue';
import userUpload from './userUpload.vue'; import userUpload from './userUpload.vue';
import { basicModal, useModal } from '@/components/Modal';
import { downloadByData } from '@/utils/file/download'; import { downloadByData } from '@/utils/file/download';
import { schemas } from './querySchemas'; import { schemas } from './querySchemas';
import { renderIcon } from '@/utils'; import { renderIcon } from '@/utils';
@ -116,20 +119,13 @@
const rowKeys = ref([]); const rowKeys = ref([]);
const importVisible = ref(false); const importVisible = ref(false);
const exportLoading = ref(false); const exportLoading = ref(false);
const showModal = ref(false);
/** const showModal = ref(false);
* 定义查询参数
*/
const formParams = reactive({ const formParams = reactive({
realname: '', name: '',
role: '',
status: '', status: '',
}); });
/**
* 定义操作栏
*/
const actionColumn = reactive({ const actionColumn = reactive({
width: 400, width: 400,
title: '操作', title: '操作',
@ -175,36 +171,24 @@
}, },
}); });
/** function addTable() {
* 加载数据列表 showModal.value = true;
* @param res 参数 }
*/
const loadDataTable = async (res) => { const loadDataTable = async (res) => {
rowKeys.value = []; rowKeys.value = [];
const result = await getUserList({ ...formParams, ...res }); const result = await getUserList({ ...formParams, ...res });
return result; return result;
}; };
/**
* 数据行选中事件
* @param keys 参数
*/
function onCheckedRow(keys) { function onCheckedRow(keys) {
rowKeys.value = keys; rowKeys.value = keys;
} }
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') { function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
} }
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) { function handleSubmit(values: Recordable) {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
@ -215,10 +199,6 @@
reloadTable(); reloadTable();
} }
/**
* 执行重置
* @param values 参数
*/
function handleReset(values: Recordable) { function handleReset(values: Recordable) {
for (const key in formParams) { for (const key in formParams) {
formParams[key] = ''; formParams[key] = '';
@ -229,9 +209,6 @@
reloadTable(); reloadTable();
} }
/**
* 执行注册
*/
const [register, {}] = useForm({ const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80, labelWidth: 80,
@ -255,7 +232,6 @@
}, },
}); });
}; };
/** /**
* 执行添加 * 执行添加
*/ */
@ -265,7 +241,6 @@
await nextTick(); await nextTick();
createModalRef.value.openModal(); createModalRef.value.openModal();
}; };
/** /**
* 执行编辑 * 执行编辑
*/ */
@ -275,7 +250,6 @@
await nextTick(); await nextTick();
createModalRef.value.openModal(); createModalRef.value.openModal();
} }
/** /**
* 执行删除 * 执行删除
* @param id 参数 * @param id 参数
@ -293,7 +267,6 @@
}, },
}); });
} }
/** /**
* 执行导出 * 执行导出
*/ */

View File

@ -125,9 +125,6 @@
window.open(res.filePath); window.open(res.filePath);
}; };
/**
* 执行弹窗提交
*/
const dialogSubmit = async () => { const dialogSubmit = async () => {
uploadRef.value?.submit(); uploadRef.value?.submit();
}; };