From 5a26e52cdd75a6eebffe74af9d98e545d6b6ea67 Mon Sep 17 00:00:00 2001
From: shj <1790240199@qq.com>
Date: Wed, 20 Jul 2022 09:39:06 +0800
Subject: [PATCH] css
---
src/views/contingencyManagement/contingency/component/openEdit.vue | 58 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/src/views/contingencyManagement/contingency/component/openEdit.vue b/src/views/contingencyManagement/contingency/component/openEdit.vue
index 602a172..fbd8de4 100644
--- a/src/views/contingencyManagement/contingency/component/openEdit.vue
+++ b/src/views/contingencyManagement/contingency/component/openEdit.vue
@@ -7,7 +7,9 @@
:model="ruleForm"
size="default"
label-width="120px"
+ :fullscreen="full"
>
+ <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button>
<el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="队伍名称" prop="teamName">
@@ -31,7 +33,7 @@
class="input-with-select"
>
<template #append>
- <el-button :icon="Search"/>
+ <el-button :icon="Search" @click="openUser"/>
</template>
</el-input>
</el-form-item>
@@ -89,15 +91,15 @@
ref="multipleTableRef"
:header-cell-style="{background:'#f6f7fa',color:'#909399'}"
>
- <el-table-column prop="jobNumber" label="人员工号" show-overflow-tooltip></el-table-column>
- <el-table-column prop="personnelName" label="人员名称" show-overflow-tooltip></el-table-column>
- <el-table-column prop="phone" label="手机号码" show-overflow-tooltip></el-table-column>
- <el-table-column prop="position" label="职位" show-overflow-tooltip></el-table-column>
+ <el-table-column prop="jobNumber" label="人员工号" show-overflow-tooltip sortable></el-table-column>
+ <el-table-column prop="personnelName" label="人员名称" show-overflow-tooltip sortable></el-table-column>
+ <el-table-column prop="phone" label="手机号码" show-overflow-tooltip sortable></el-table-column>
+ <el-table-column prop="position" label="职位" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="操作" width="200" align="center">
<template #default="scope">
<el-button size="small" type="primary" text="plain" >查看
</el-button>
- <el-button size="small" type="primary" text="plain" @click="onEditEmergencyPersonnel" style="margin-right: 5px;">编辑
+ <el-button size="small" type="primary" text="plain" @click="onEditEmergencyPersonnel(scope.row)" style="margin-right: 5px;">编辑
</el-button>
<el-button size="small" type="primary" text="plain" style="margin-right: 5px;">删除
</el-button>
@@ -116,9 +118,9 @@
</span>
</template>
</el-dialog>
+ <userSelections ref="userRef"/>
<AddEmergencyPersonnel ref="addRef" />
<EditEmergencyPersonnel ref="editRef" />
-
</div>
</template>
@@ -135,10 +137,13 @@
TabsPaneContext,
FormInstance,
FormRules,
+ ElTable,
} from 'element-plus'
import {
- Search
+ Search,
+ FullScreen
} from '@element-plus/icons-vue'
+import UserSelections from "/@/components/userSelections/index.vue"
import AddEmergencyPersonnel from "/@/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue";
import EditEmergencyPersonnel from "/@/views/contingencyManagement/contingency/component/editEmergencyPersonnel.vue";
// 定义表格数据类型
@@ -147,6 +152,15 @@
jobNumber: string
phone: string;
position: string;
+}
+// 定义接口来定义对象的类型
+interface TableDataRow {
+ // userName: string;
+ // userNickname: string;
+ // roleSign: string;
+ // department: string[];
+ // phone: string;
+ // email: string;
}
// 定义接口来定义对象的类型
interface DeptData {
@@ -158,6 +172,7 @@
id: number;
children?: DeptData[];
}
+// 定义接口来定义对象的类型
interface RuleFormRow {
// teamName: string;
// teamLevel: string;
@@ -182,6 +197,7 @@
export default defineComponent({
name: 'openEdit',
components: {
+ UserSelections,
AddEmergencyPersonnel,
EditEmergencyPersonnel
},
@@ -307,6 +323,7 @@
};
//定义表格数据
+ const multipleTableRef = ref<InstanceType<typeof ElTable>>()
const multipleSelection = ref<User[]>([])
const tableData: User[] = [
{
@@ -380,6 +397,12 @@
],
})
+ // 打开用户选择弹窗
+ const userRef = ref();
+ const openUser = () => {
+ userRef.value.openDialog();
+ };
+
const ruleFormRef = ref<FormInstance>()
// 打开弹窗
const openDialog = (row: RuleFormRow) => {
@@ -399,8 +422,17 @@
}
//表格编辑弹窗
const editRef = ref();
- const onEditEmergencyPersonnel = () => {
- editRef.value.openDialog();
+ const onEditEmergencyPersonnel = (row: TableDataRow) => {
+ editRef.value.openDialog(row);
+ };
+ //全屏
+ const full = ref(false);
+ const toggleFullscreen = () => {
+ if (full.value == false) {
+ full.value = true;
+ } else {
+ full.value = false;
+ }
};
return {
openDialog,
@@ -422,7 +454,13 @@
rules,
ruleFormRef,
tableData,
+ multipleTableRef,
+ openUser,
+ userRef,
...toRefs(state),
+ toggleFullscreen,
+ FullScreen,
+ full,
};
},
});
--
Gitblit v1.9.2