From 48954e86178c5c3d95f64b59d9a88f22a51ff1ec Mon Sep 17 00:00:00 2001
From: Flex <q1406482700@163.com>
Date: 星期四, 26 六月 2025 16:08:28 +0800
Subject: [PATCH] 修改校验文本错误以及功能补充

---
 ruoyi-ui/apps/web-antd/src/views/work/Issued/index.vue |  300 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 291 insertions(+), 9 deletions(-)

diff --git a/ruoyi-ui/apps/web-antd/src/views/work/Issued/index.vue b/ruoyi-ui/apps/web-antd/src/views/work/Issued/index.vue
index d884f8b..9e2834d 100644
--- a/ruoyi-ui/apps/web-antd/src/views/work/Issued/index.vue
+++ b/ruoyi-ui/apps/web-antd/src/views/work/Issued/index.vue
@@ -1,13 +1,295 @@
-<template>
-  <div>宸ヤ綔涓嬪彂</div>
-</template>
+<!-- 宸ヤ綔鍒楄〃 -->
+<script setup lang="ts">
+import type { VbenFormProps } from '@vben/common-ui';
 
-<script>
-export default {
-  name: "index"
+import type { VxeGridProps } from '#/adapter/vxe-table';
+import type { User } from '#/api/system/user/model';
+
+import { ref } from 'vue';
+
+import { useAccess } from '@vben/access';
+import { Page, useVbenDrawer, useVbenModal } from '@vben/common-ui';
+import { $t } from '@vben/locales';
+import { preferences } from '@vben/preferences';
+import { getVxePopupContainer } from '@vben/utils';
+
+import {
+  Avatar,
+  Dropdown,
+  Menu,
+  MenuItem,
+  Modal,
+  Popconfirm,
+  Space,
+} from 'ant-design-vue';
+
+import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
+import {
+  userExport,
+  userList,
+  userRemove,
+  userStatusChange,
+} from '#/api/system/user';
+import { TableSwitch } from '#/components/table';
+import { commonDownloadExcel } from '#/utils/file/download';
+
+import { columns, querySchema } from './data';
+import userDrawer from './user-drawer.vue';
+import userImportModal from './user-import-modal.vue';
+import userInfoModal from './user-info-modal.vue';
+import userResetPwdModal from './user-reset-pwd-modal.vue';
+
+/**
+ * 瀵煎叆
+ */
+const [UserImpotModal, userImportModalApi] = useVbenModal({
+  connectedComponent: userImportModal,
+});
+
+function handleImport() {
+  userImportModalApi.open();
 }
+
+// 宸﹁竟閮ㄩ棬鐢�
+const selectDeptId = ref<string[]>([]);
+
+const formOptions: VbenFormProps = {
+  schema: querySchema(),
+  commonConfig: {
+    labelWidth: 80,
+    componentProps: {
+      allowClear: true,
+    },
+  },
+  wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
+  handleReset: async () => {
+    selectDeptId.value = [];
+
+    const { formApi, reload } = tableApi;
+    await formApi.resetForm();
+    const formValues = formApi.form.values;
+    formApi.setLatestSubmissionValues(formValues);
+    await reload(formValues);
+  },
+  // 鏃ユ湡閫夋嫨鏍煎紡鍖�
+  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: 'default',
+    checkMethod: ({ row }) => row?.userId !== 1,
+  },
+  columns,
+  height: 'auto',
+  keepSource: true,
+  pagerConfig: {},
+  proxyConfig: {
+    ajax: {
+      // 鑾峰彇椤甸潰鏁版嵁锛屾悳绱紝閲嶇疆涔熸槸
+      /*
+        @params page:椤电爜鍙傛暟
+        @params formValues:琛ㄥ崟鍙傛暟
+      */
+      query: async ({ page }, formValues = {}) => {
+        console.log("鑾峰彇椤甸潰鏁版嵁锛�")
+        const res = {
+          rows:[ {
+            id:"0",  //宸ヤ綔id锛岀紪鍙�
+            workName:"宸ヤ綔鍚嶇О1", //宸ヤ綔鍚嶇О
+            workClass:"宸ヤ綔绫诲埆", //宸ヤ綔绫诲埆
+            workContent:"宸ヤ綔鍐呭", //宸ヤ綔鍐呭
+            projectBudget:"椤圭洰棰勭畻", //椤圭洰棰勭畻
+            amountProject:"椤圭洰閲戦", //椤圭洰閲戦
+            responsibleDepartment:"璐熻矗閮ㄩ棬", //璐熻矗閮ㄩ棬
+            Head:"璐熻矗浜�", //璐熻矗浜�
+            Annual:"骞村害", //骞村害
+            assessmentTime:"鑰冩牳鏃堕棿",//鑰冩牳鏃堕棿
+            assessmentIndicators:"鑰冩牳鎸囨爣", //鑰冩牳鎸囨爣
+            File:"鏂囦欢鍦板潃", //鏂囦欢涓婁紶
+            taskStatus:"浠诲姟鐘舵��", //浠诲姟鐘舵��
+            assignmentStatus:"鍒嗛厤鐘舵��", //鍒嗛厤鐘舵��
+            workProgress:"宸ヤ綔杩涘害" //宸ヤ綔杩涘害
+          } ],
+          total:1
+        }
+        console.log( "res", res)
+        return res
+      },
+    },
+  },
+  rowConfig: {
+    keyField: 'userId',
+    height: 48,
+  },
+  id: 'system-user-index',
+};
+const [BasicTable, tableApi] = useVbenVxeGrid({
+  formOptions,
+  gridOptions,
+});
+
+const [UserDrawer, userDrawerApi] = useVbenDrawer({
+  connectedComponent: userDrawer,
+});
+// 宸ヤ綔涓嬪彂
+function handleAdd() {
+  userDrawerApi.setData({});
+  userDrawerApi.open();
+}
+// 缂栬緫
+function handleEdit(row: any) {
+  userDrawerApi.setData({ id: row.id });
+  userDrawerApi.open();
+}
+// 鏌ョ湅
+function handleLook(row: any) {
+  userDrawerApi.setData({ id: row.id, look: true });
+  userDrawerApi.open();
+}
+// 鍒犻櫎
+async function handleDelete(row: User) {
+  await userRemove([row.userId]);
+  await tableApi.query();
+}
+
+function handleMultiDelete() {
+  const rows = tableApi.grid.getCheckboxRecords();
+  const ids = rows.map((row: User) => row.userId);
+  Modal.confirm({
+    title: '鎻愮ず',
+    okType: 'danger',
+    content: `纭鍒犻櫎閫変腑鐨�${ids.length}鏉¤褰曞悧锛焋,
+    onOk: async () => {
+      await userRemove(ids);
+      await tableApi.query();
+    },
+  });
+}
+
+function handleDownloadExcel() {
+  commonDownloadExcel(userExport, '鐢ㄦ埛绠$悊', tableApi.formApi.form.values, {
+    fieldMappingTime: formOptions.fieldMappingTime,
+  });
+}
+
+const [UserInfoModal, userInfoModalApi] = useVbenModal({
+  connectedComponent: userInfoModal,
+});
+function handleUserInfo(row: User) {
+  userInfoModalApi.setData({ userId: row.userId });
+  userInfoModalApi.open();
+}
+
+const [UserResetPwdModal, userResetPwdModalApi] = useVbenModal({
+  connectedComponent: userResetPwdModal,
+});
+
+function handleResetPwd(record: User) {
+  userResetPwdModalApi.setData({ record });
+  userResetPwdModalApi.open();
+}
+
+const { hasAccessByCodes } = useAccess();
 </script>
 
-<style scoped>
-
-</style>
+<template>
+  <Page :auto-content-height="true">
+    <div class="flex h-full gap-[8px]">
+      <BasicTable class="flex-1 overflow-hidden" table-title="宸ヤ綔鍒楄〃">
+        <template #toolbar-tools>
+          <Space>
+            <!-- 瀵煎嚭 -->
+            <!-- <a-button
+              @click="handleDownloadExcel"
+            >
+              {{ $t('pages.common.export') }}
+            </a-button> -->
+            <!-- 瀵煎叆 -->
+            <!-- <a-button
+              v-access:code="['system:user:import']"
+              @click="handleImport"
+            >
+              {{ $t('pages.common.import') }}
+            </a-button> -->
+            <!-- 鍒犻櫎 -->
+            <a-button
+              :disabled="!vxeCheckboxChecked(tableApi)"
+              danger
+              type="primary"
+              @click="handleMultiDelete"
+            >
+              {{ $t('pages.common.delete') }}
+            </a-button>
+            <!-- 鏂板 -->
+            <a-button
+              type="primary"
+              @click="handleAdd"
+            >
+              {{ $t('pages.common.WorkIssued') }}
+            </a-button>
+          </Space>
+        </template>
+        <template #avatar="{ row }">
+          <!-- 鍙兘瑕佸垽鏂┖瀛楃涓叉儏鍐� 鎵�浠ユ病鏈変娇鐢�?? -->
+          <Avatar :src="row.avatar || preferences.app.defaultAvatar" />
+        </template>
+        <template #status="{ row }">
+          <TableSwitch
+            v-model="row.status"
+            :api="() => userStatusChange(row)"
+            :disabled="
+              row.userId === 1 || !hasAccessByCodes(['system:user:edit'])
+            "
+            :reload="() => tableApi.query()"
+          />
+        </template>
+        <template #action="{ row }">
+            <Space>
+              <!-- 鏌ョ湅 -->
+              <ghost-button
+                @click.stop="handleLook(row)"
+              >
+                {{ $t('pages.common.look') }}
+              </ghost-button>
+              <!-- 缂栬緫 -->
+              <ghost-button
+                @click.stop="handleEdit(row)"
+              >
+                {{ $t('pages.common.edit') }}
+              </ghost-button>
+              <!-- 鍒犻櫎 -->
+              <Popconfirm
+                :get-popup-container="getVxePopupContainer"
+                placement="left"
+                title="纭鍒犻櫎锛�"
+                @confirm="handleDelete(row)"
+              >
+                <ghost-button
+                  danger
+                  @click.stop=""
+                >
+                  {{ $t('pages.common.delete') }}
+                </ghost-button>
+              </Popconfirm>
+            </Space>
+        </template>
+      </BasicTable>
+    </div>
+    <UserImpotModal @reload="tableApi.query()" />
+    <UserDrawer @reload="tableApi.query()" />
+    <UserInfoModal />
+    <UserResetPwdModal />
+  </Page>
+</template>

--
Gitblit v1.9.3