zhangyihao преди 9 месеца
родител
ревизия
fa381be3b4

+ 0 - 32
src/types/components.d.ts

@@ -19,15 +19,8 @@ declare module 'vue' {
     ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
     ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
     ElButton: typeof import('element-plus/es')['ElButton']
-    ElCard: typeof import('element-plus/es')['ElCard']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCol: typeof import('element-plus/es')['ElCol']
-    ElCollapse: typeof import('element-plus/es')['ElCollapse']
-    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
-    ElContainer: typeof import('element-plus/es')['ElContainer']
-    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -35,43 +28,18 @@ declare module 'vue' {
     ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
     ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
-    ElForm: typeof import('element-plus/es')['ElForm']
-    ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
-    ElInput: typeof import('element-plus/es')['ElInput']
-    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
-    ElLink: typeof import('element-plus/es')['ElLink']
-    ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
-    ElOption: typeof import('element-plus/es')['ElOption']
-    ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
-    ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
-    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
-    ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
-    ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSpace: typeof import('element-plus/es')['ElSpace']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
-    ElTable: typeof import('element-plus/es')['ElTable']
-    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
-    ElTabPane: typeof import('element-plus/es')['ElTabPane']
-    ElTabs: typeof import('element-plus/es')['ElTabs']
-    ElTag: typeof import('element-plus/es')['ElTag']
-    ElText: typeof import('element-plus/es')['ElText']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
-    ElTree: typeof import('element-plus/es')['ElTree']
-    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
-    ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
     HeaderSearch: typeof import('./../components/HeaderSearch/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
-    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 1 - 1
src/views/system/user/authRole.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div class="p-2">
     <div class="panel">
       <h4 class="panel-title">基本信息</h4>
       <el-form :model="form" :inline="true">

+ 233 - 0
src/views/system/user/drill.vue

@@ -0,0 +1,233 @@
+<template>
+    <!-- 添加或修改培训记录配置对话框 -->
+    <el-dialog ref="formDialogRef" v-model="visible" :title="title" width="500px" append-to-body
+        @close="closeDialog">
+        <el-form ref="userFormRef" :model="form" :rules="rules" label-width="80px">
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练名称" prop="drillName">
+                        <el-input v-model="form.drillName" placeholder="请输入演练名称" maxlength="30" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练单位" prop="drillUnit">
+                        <el-input v-model="form.drillUnit" placeholder="请输入演练单位" maxlength="30" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="年度" prop="year">
+                        <el-input v-model="form.year" placeholder="请输入演练年度" maxlength="11" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20" class="block">
+                    <el-form-item label="演练时间" prop="drillTime">
+                        <el-date-picker :shortcuts="shortcuts" v-model="form.drillTime" placeholder="请选择开始时间"
+                            maxlength="11" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练地点" prop="drillAddress">
+                        <el-button>地图定位</el-button>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练方案" prop="drillProject">
+                        <el-button>上传</el-button>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练视频" prop="drillVideo">
+                        <el-button>上传</el-button>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-row>
+                <el-col :span="20">
+                    <el-form-item label="演练图片" prop="drillPicture">
+                        <el-button>上传</el-button>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+        <template #footer>
+            <div class="dialog-footer">
+                <el-button type="primary" @click="submitForm">确 定</el-button>
+                <el-button @click="cancel()">取 消</el-button>
+            </div>
+        </template>
+    </el-dialog>
+</template>
+<script setup lang="ts">
+import { ref } from 'vue'
+import api from '@/api/system/user';
+import {DrillForm,DrillVO,DrillQuery} from '@/api/system/user/types';
+const userFormRef = ref<ElFormInstance>();
+const ids = ref<Array<number | string>>([]);
+const drillList = ref<DrillVO[]>();
+const loading = ref(true);
+const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const emits = defineEmits(['update:modelValue','getList']);
+const total = ref(0);
+import { to } from 'await-to-js';
+
+const props = defineProps({
+    modelValue: Boolean,
+    id: String
+})
+
+watch(() => props.modelValue, (val) => {
+    visible.value = val
+})
+
+let visible = ref(false);
+const title = computed(() => {
+    return props.id ? '编辑演练' : '新建演练'
+})
+
+/***培训记录编辑界面时间选择 */
+
+const shortcuts = [
+    {
+        text: '今天',
+        value: new Date(),
+    },
+    {
+        text: '昨天',
+        value: () => {
+            const date = new Date()
+            date.setDate(date.getDate() - 1)
+            return date
+        },
+    },
+    {
+        text: '一周前',
+        value: () => {
+            const date = new Date()
+            date.setDate(date.getDate() - 7)
+            return date
+        },
+    },
+]
+const initFormData: DrillForm = {
+    drillId: undefined,
+    drillName: undefined,
+    drillUnit: undefined,
+    year: undefined,
+    drillTime: undefined,
+    drillAddress: undefined,
+    drillProject: undefined,
+    drillVideo: undefined,
+    drillPicture: undefined
+};
+
+const initData: PageData<DrillForm, DrillQuery> = {
+    form: { ...initFormData },
+    queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        drillName: '',
+    },
+    rules: {
+        drillName: [
+            { required: true, message: '演练名称不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                message: '演练名称长度必须介于 1 和 20 之间',
+                trigger: 'blur'
+            }
+        ],
+        drillUnit: [
+            { required: true, message: '演练单位不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                max: 20,
+                message: '演练单位长度必须介于 1 和 20 之间',
+                trigger: 'blur'
+            }
+        ],
+        year: [
+            { required: true, message: '演练年度不能为空', trigger: 'blur' },
+        ],
+        drillTime: [
+            { required: true, message: '演练时间不能为空', trigger: 'change' },
+        ],
+    }
+};
+
+const data = reactive<PageData<DrillForm, DrillQuery>>(initData);
+
+const { queryParams, form, rules } = toRefs<PageData<DrillForm, DrillQuery>>(data);
+
+const getList = async () => {
+    loading.value = true;
+    const res = await api.listDrill(proxy?.addDateRange(queryParams.value, dateRange.value));
+    loading.value = false;
+    drillList.value = res.rows;
+    total.value = res.total;
+};
+
+/** 重置操作表单 */
+const reset = () => {
+    form.value = { ...initFormData };
+    userFormRef.value?.resetFields();
+    form.value.drillId = undefined;
+};
+/** 取消按钮 */
+const cancel = () => {
+    emits('update:modelValue', false);
+    reset();
+};
+
+
+
+
+/** 删除预案按钮操作 */
+const drillDelete = async (row?: DrillVO) => {
+    const drillIds = row?.drillId || ids.value;
+    const [err] = await to(proxy?.$modal.confirm('是否确认删除记录编号为"' + drillIds + '"的数据项?') as any);
+    if (!err) {
+        await api.delDrill(drillIds);
+        await getList();
+        proxy?.$modal.msgSuccess('删除成功');
+    }
+};
+/**
+ * 关闭用户弹窗
+ */
+const closeDialog = () => {
+    emits('update:modelValue', false);
+    resetForm();
+};
+
+const resetForm = () => {
+    userFormRef.value?.resetFields();
+    userFormRef.value?.clearValidate();
+
+    form.value.drillId = undefined;
+};
+
+/**提交按钮 */
+const submitForm = () => {
+    userFormRef.value?.validate(async (valid: boolean) => {
+        if (valid) {
+            form.value.drillId ? await api.updateDrill(form.value) : await api.addDrill(form.value);
+            proxy?.$modal.msgSuccess('操作成功');
+            emits('update:modelValue', true);
+            emits('getList');
+        }
+    });
+};
+</script>

Файловите разлики са ограничени, защото са твърде много
+ 570 - 321
src/views/system/user/index.vue


+ 173 - 0
src/views/system/user/plan.vue

@@ -0,0 +1,173 @@
+<template>
+    <!--添加或修改预案配置-->
+    <el-dialog ref="formDialogRef" v-model="visible" :title="title" width="500px" append-to-body
+        @close="closeDialog">
+        <el-form ref="userFormRef" :model="form" :rules="rules" label-width="80px">
+            <el-form-item label="预案编号" prop="planId">
+                <el-input v-model="form.planId" placeholder="请输入预案编号" />
+            </el-form-item>
+            <el-form-item label="预案名称" prop="planName">
+                <el-input v-model="form.planName" placeholder="请输入预案名称" />
+            </el-form-item>
+            <el-form-item label="预案类型" prop="planType">
+                <el-select v-model="form.planType" placeholder="请选择预案类型" maxlength="11">
+                    <el-option label="总体应急预案" value="1" />
+                    <el-option label="专项应急预案" value="2" />
+                    <el-option label="部门应急预案" value="3" />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="发文字号" prop="document">
+                <el-input v-model="form.document" placeholder="请输入发文字号" />
+            </el-form-item>
+            <el-form-item label="编制单位" prop="organUnit">
+                <el-input v-model="form.organUnit" placeholder="请输入编制单位" />
+            </el-form-item>
+            <el-form-item label="发布日期" prop="releaseTime">
+                <el-date-picker v-model="form.releaseTime" type="date" placeholder="选择发布日期"
+                    value-format="yyyy-MM-dd"></el-date-picker>
+            </el-form-item>
+        </el-form>
+        <template #footer>
+            <div class="dialog-footer">
+                <el-button type="primary" @click="submitForm">确 定</el-button>
+                <el-button @click="cancel()">取 消</el-button>
+            </div>
+        </template>
+    </el-dialog>
+</template>
+<script setup lang="ts">
+import { ref } from 'vue'
+import api from '@/api/system/user';
+import {PlanForm,PlanVO,PlanQuery} from '@/api/system/user/types';
+//预案
+const userFormRef = ref<ElFormInstance>();
+const ids = ref<Array<number | string>>([]);
+const planList = ref<PlanVO[]>();
+const loading = ref(true);
+const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const emits = defineEmits(['update:modelValue']);
+const total = ref(0);
+import { to } from 'await-to-js';
+
+const props = defineProps({
+    modelValue: Boolean,
+    title: String
+})
+
+watch(() => props.modelValue, (val) => {
+    visible.value = val
+})
+
+let visible = ref(false);
+
+
+const initFormData: PlanForm = {
+    planId: undefined,
+    planName: undefined,
+    planType: undefined,
+    releaseTime: undefined,
+    organUnit: undefined,
+    document: undefined
+};
+
+const initData: PageData<PlanForm, PlanQuery> = {
+    form: { ...initFormData },
+    queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        planName: '',
+    },
+    rules: {
+        planId: [
+            { required: true, message: '预案编号不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                message: '预案编号长度必须大于1',
+                trigger: 'blur'
+            }
+        ],
+        planName: [
+            { required: true, message: '预案名称不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                max: 20,
+                message: '预案名称长度必须介于 1 和 20 之间',
+                trigger: 'blur'
+            }
+        ],
+        organUnit: [
+            { required: true, message: '编制单位不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                max: 20,
+                message: '编制单位长度必须介于 1 和 20 之间1',
+                trigger: 'blur'
+            }
+        ],
+        planType: [
+            { required: true, message: '预案类型不能为空', trigger: 'blur' },
+        ],
+        document: [
+            { required: true, message: '发文字号不能为空', trigger: 'blur' },
+            {
+                min: 1,
+                message: '发文字号长度必须大于1',
+                trigger: 'blur'
+            }
+        ],
+        releaseTime: [
+            { required: true, message: '发布时间不能为空', trigger: 'change' },
+        ],
+    }
+};
+const data = reactive<PageData<PlanForm, PlanQuery>>(initData);
+
+const { queryParams, form, rules } = toRefs<PageData<PlanForm, PlanQuery>>(data);
+
+const getList = async () => {
+    loading.value = true;
+    const res = await api.listPlan(proxy?.addDateRange(queryParams.value, dateRange.value));
+    loading.value = false;
+    planList.value = res.rows;
+    total.value = res.total;
+};
+
+/** 重置操作表单 */
+const reset = () => {
+    form.value = { ...initFormData };
+    userFormRef.value?.resetFields();
+};
+/** 取消按钮 */
+const cancel = () => {
+    emits('update:modelValue', false);
+    reset();
+};
+
+/**
+ * 关闭用户弹窗
+ */
+const closeDialog = () => {
+    emits('update:modelValue', false);
+    resetForm();
+};
+
+const resetForm = () => {
+    userFormRef.value?.resetFields();
+    userFormRef.value?.clearValidate();
+
+    form.value.id = undefined;
+};
+
+/**提交按钮 */
+const submitForm = () => {
+    userFormRef.value?.validate(async (valid: boolean) => {
+        if (valid) {
+            form.value.planId ? await api.updatePlan(form.value) : await api.addPlan(form.value);
+            proxy?.$modal.msgSuccess('操作成功');
+            emits('update:modelValue', true);
+            await getList();
+        }
+    });
+};
+</script>

+ 5 - 1
src/views/system/user/profile/index.vue

@@ -1,10 +1,13 @@
 <template>
-  <div class="app-container">
+  <div class="p-2">
     <el-row :gutter="20">
       <el-col :span="6" :xs="24">
+        <el-card class="box-card">
+          <template #header>
             <div class="clearfix">
               <span>个人信息</span>
             </div>
+          </template>
           <div>
             <div class="text-center">
               <userAvatar />
@@ -36,6 +39,7 @@
               </li>
             </ul>
           </div>
+        </el-card>
       </el-col>
       <el-col :span="18" :xs="24">
         <el-card>

Някои файлове не бяха показани, защото твърде много файлове са промени