From 58a5855774af8f66bdea6324d0b9a153065e5348 Mon Sep 17 00:00:00 2001 From: du <13220750630.163.com> Date: 星期一, 23 六月 2025 10:57:10 +0800 Subject: [PATCH] 页面调整 --- ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/serivceDialog.vue | 64 ++++++++++++ ruoyi-ui/apps/web-antd/src/views/system/process/index.vue | 55 +++++++++++ ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/index.vue | 90 +++++++++++++++++ ruoyi-ui/apps/web-antd/src/views/pageDesigner/index.vue | 13 ++ ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/data.ts | 44 ++++++++ ruoyi-ui/apps/web-antd/src/bootstrap.ts | 4 6 files changed, 266 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/apps/web-antd/src/bootstrap.ts b/ruoyi-ui/apps/web-antd/src/bootstrap.ts index f76df08..adf3f37 100644 --- a/ruoyi-ui/apps/web-antd/src/bootstrap.ts +++ b/ruoyi-ui/apps/web-antd/src/bootstrap.ts @@ -19,7 +19,10 @@ import { router } from './router'; import formCreate from '@form-create/element-ui'; import FcDesigner from '@form-create/designer'; +import Antd from 'ant-design-vue'; +import 'ant-design-vue/dist/reset.css'; async function bootstrap(namespace: string) { + // 鍒濆鍖栫粍浠堕�傞厤鍣� await initComponentAdapter(); @@ -62,6 +65,7 @@ app.use(ElementPlus); app.use(formCreate); app.use(FcDesigner); + app.use(Antd); // 鍔ㄦ�佹洿鏂版爣棰� watchEffect(() => { if (preferences.app.dynamicTitle) { diff --git a/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/data.ts b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/data.ts new file mode 100644 index 0000000..eec5231 --- /dev/null +++ b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/data.ts @@ -0,0 +1,44 @@ +import type { VxeGridProps } from 'src/adapter/vxe-table'; +import type { FormSchemaGetter } from "src/adapter/form"; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'roleName', + label: '鍚嶇О', + }, + + { + component: 'Select', + fieldName: 'roleSort', + label: '鍒涘缓浜�', + }, + { + component: 'RangePicker', + fieldName: 'createTime', + label: '鍒涘缓鏃堕棿', + }, +]; +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '鍚嶇О', + field: 'roleName', + }, + { + title: '鍒涘缓浜�', + field: 'roleSort', + }, + { + title: '鍒涘缓鏃堕棿', + field: 'createTime', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '鎿嶄綔', + width: 180, + }, +]; diff --git a/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/index.vue b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/index.vue index 76dfc47..c6d7a38 100644 --- a/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/index.vue +++ b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/index.vue @@ -1,10 +1,92 @@ <template> -<div>宸ヤ綔鑰冩牳鎸囨爣</div> + <Page :auto-content-height="true"> + <BasicTable table-title="宸ヤ綔鑰冩牳鎸囨爣鍒楄〃"> + <template #toolbar-tools> + <Space> + <a-button + v-access:code="['system:role:export']" + @click="handleDownloadExcel" + style="margin-right: 10px" + > + {{ $t('pages.common.export') }} + </a-button> + <a-button + type="primary" + v-access:code="['system:role:add']" + @click="handleAdd" + > + {{ $t('pages.common.add') }} + </a-button> + </Space> + </template> + </BasicTable> + </Page> </template> -<script> -export default { - name: "index" +<script setup lang="ts"> +import type { VxeGridProps } from "#/adapter/vxe-table"; +import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table'; +import type { VbenFormProps } from '@vben/common-ui'; +import type { roleList} from "#/api/system/role"; +import { columns, querySchema } from './data'; +import { Page, useVbenDrawer, useVbenModal } from '@vben/common-ui'; +const formOptions: VbenFormProps = { + commonConfig: { + labelWidth: 80, + componentProps: { + allowClear: true, + }, + }, + schema: querySchema(), + wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', + // 鏃ユ湡閫夋嫨鏍煎紡鍖� + fieldMappingTime: [ + [ + 'createTime', + ['params[beginTime]', 'params[endTime]'], + ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'], + ], + ], +}; +const gridOptions: VxeGridProps = { + checkboxConfig: { + // 楂樹寒 + highlight: true, + // 缈婚〉鏃朵繚鐣欓�変腑鐘舵�� + reserve: true, + // 鐐瑰嚮琛岄�変腑 + // trigger: 'row', + checkMethod: ({ row }) => row.roleId !== 1, + }, + columns, + height: 'auto', + keepSource: true, + pagerConfig: {}, + proxyConfig: { + ajax: { + query: async ({ page }, formValues = {}) => { + return await roleList({ + pageNum: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + rowConfig: { + keyField: 'roleId', + }, + id: 'system-role-index', +}; +const [BasicTable,tableApi] = useVbenVxeGrid({ + formOptions, + gridOptions, +}); +const handleAdd = () => { + console.log('鏂板') +} +const handleDownloadExcel = () => { + console.log('瀵煎嚭') } </script> diff --git a/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/serivceDialog.vue b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/serivceDialog.vue new file mode 100644 index 0000000..c79fc8a --- /dev/null +++ b/ruoyi-ui/apps/web-antd/src/views/assessment/serviceRating/serivceDialog.vue @@ -0,0 +1,64 @@ + + +<script> +import {modelInfo} from "#/api/system/model/index.js"; +import {pick} from "lodash-es"; +import {useVbenModal} from "@vben/common-ui"; +import {ref, computed} from "vue"; +import { $t } from '@vben/locales'; +const defaultValues = { + id: undefined, + name: undefined, +} + +const isUpdate = ref(false); +const title = computed(() => { + return isUpdate.value ? $t('缂栬緫') : $t('鏂板'); +}); +const { validate, validateInfos, resetFields } = Form.useForm( + formData, + formRules, +); +const [BasicModal, modalApi] = useVbenModal({ + class: 'w-[550px]', + fullscreenButton: false, + closeOnClickModal: false, + onClosed: handleCancel, + onConfirm: handleConfirm, + onOpenChange: async (isOpen) => { + if (!isOpen) { + return null; + } + modalApi.modalLoading(true); + + const { id } = modalApi.getData() as { id?: number | string }; + isUpdate.value = !!id; + + if (isUpdate.value && id) { + const record = await modelInfo(id); + // 鍙祴鍊煎瓨鍦ㄧ殑瀛楁 + const filterRecord = pick(record, Object.keys(defaultValues)); + formData.value = filterRecord; + } + + modalApi.modalLoading(false); + }, +}); + + +</script> +<template> + <BasicModal :title="title"> + <Form :label-col="{ span: 4 }"> + <FormItem label="鍚嶇О" v-bind="validateInfos.name"> + <Input + v-model:value="formData.name" + :placeholder="$t('ui.formRules.required')" + /> + </FormItem> + </Form> + </BasicModal> +</template> +<style scoped> + +</style> diff --git a/ruoyi-ui/apps/web-antd/src/views/pageDesigner/index.vue b/ruoyi-ui/apps/web-antd/src/views/pageDesigner/index.vue new file mode 100644 index 0000000..d4fea39 --- /dev/null +++ b/ruoyi-ui/apps/web-antd/src/views/pageDesigner/index.vue @@ -0,0 +1,13 @@ +<template> + <div>111</div> +</template> + +<script> +export default { + name: "index" +} +</script> + +<style scoped> + +</style> diff --git a/ruoyi-ui/apps/web-antd/src/views/system/process/index.vue b/ruoyi-ui/apps/web-antd/src/views/system/process/index.vue new file mode 100644 index 0000000..279ebf2 --- /dev/null +++ b/ruoyi-ui/apps/web-antd/src/views/system/process/index.vue @@ -0,0 +1,55 @@ +<template> +<div style="padding: 20px"> + <a-card style="width: 100%" title="娴佺▼瀹氫箟鍒楄〃"> + <a-table :dataSource="dataSource" :columns="columns" /> + </a-card> +</div> +</template> + +<script> +export default { + setup() { + return { + dataSource: [ + { + key: '1', + name: '鑳″溅鏂�', + age: 32, + address: '瑗挎箹鍖烘箹搴曞叕鍥�1鍙�', + }, + { + key: '2', + name: '鑳″溅绁�', + age: 42, + address: '瑗挎箹鍖烘箹搴曞叕鍥�1鍙�', + }, + ], + + columns: [ + { + title: '濮撳悕', + dataIndex: 'name', + key: 'name', + align: 'center', + }, + { + title: '骞撮緞', + dataIndex: 'age', + key: 'age', + align: 'center', + }, + { + title: '浣忓潃', + dataIndex: 'address', + key: 'address', + align: 'center', + }, + ], + }; + }, +}; +</script> + +<style scoped> + +</style> -- Gitblit v1.9.3