+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('common.queryBtn') }}
+
+ {{ $t('common.resetBtn') }}
+
+
+
+
+
+ 新 增
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
-
+import * as sysDutyTypeApi from "/@/api/sys/sysDutyType";
-
\ No newline at end of file
+const { sys_duty_type } = useDict("sys_duty_type")
+
+// 引入组件
+const FormDialog = defineAsyncComponent(() => import('./form.vue'));
+// 定义查询字典
+
+// 定义变量内容
+const formDialogRef = ref()
+// 搜索变量
+const queryRef = ref()
+const showSearch = ref(true)
+// 多选变量
+const selectObjs = ref([]) as any
+const multiple = ref(true)
+
+const state: BasicTableProps = reactive
({
+ queryForm: {},
+ pageList: sysDutyTypeApi.fetchList
+})
+
+// table hook
+const {
+ getDataList,
+ currentChangeHandle,
+ sizeChangeHandle,
+ sortChangeHandle,
+ downBlobFile,
+ tableStyle
+} = useTable(state)
+
+// 清空搜索条件
+const resetQuery = () => {
+ // 清空搜索条件
+ queryRef.value?.resetFields()
+ // 清空多选
+ selectObjs.value = []
+ getDataList()
+}
+
+// 导出excel
+const exportExcel = () => {
+ downBlobFile('/admin/sysDutyType/export', Object.assign(state.queryForm, { ids: selectObjs }), 'sysDutyType.xlsx')
+}
+
+// 多选事件
+const selectionChangHandle = (objs: { id: string }[]) => {
+ selectObjs.value = objs.map(({ id }) => id);
+ multiple.value = !objs.length;
+};
+
+// 删除操作
+const handleDelete = async (ids: string[]) => {
+ try {
+ await useMessageBox().confirm('此操作将永久删除');
+ } catch {
+ return;
+ }
+
+ try {
+ await sysDutyTypeApi.delObjs(ids);
+ getDataList();
+ useMessage().success('删除成功');
+ } catch (err: any) {
+ useMessage().error(err.msg);
+ }
+};
+
\ No newline at end of file