对比新文件 |
| | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "openAdd" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog title="查看应急队伍管理" v-model="isShowDialog" width="769px"> |
| | | <el-form :model="ruleForm" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍名称"> |
| | | <el-input v-model="ruleForm.teamName" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍级别"> |
| | | <el-select v-model="ruleForm.teamLevel" :disabled="true" class="w100"> |
| | | <el-option label="公司" value="admin"></el-option> |
| | | <el-option label="分厂-车间" value="common"></el-option> |
| | | <el-option label="工序-班组等" value="shang"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍负责人"> |
| | | <el-select v-model="ruleForm.teamLeader" :disabled="true" class="w100"> |
| | | <el-option label="超级管理员" value="admin"></el-option> |
| | | <el-option label="普通用户" value="common"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="负责人部门"> |
| | | <el-tree-select v-model="ruleForm.responsibleDepartment" :data="data" :disabled="true" class="w100"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="负责人手机"> |
| | | <el-input v-model="ruleForm.teamPhone" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="固定电话"> |
| | | <el-input v-model="ruleForm.telephone" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="队伍描述"> |
| | | <el-input class="textarea" v-model="ruleForm.describe" type="textarea" :disabled="true" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="相关附件"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | :on-change="handleChange" |
| | | :disabled="true" |
| | | > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | 添加相关附件 |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="onCancel" size="default">关闭</el-button> |
| | | <!-- <el-button type="primary" @click="onSubmit" size="default">修 改</el-button>--> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, ref, onMounted, defineComponent } from 'vue'; |
| | | import type { UploadUserFile } from 'element-plus' |
| | | // import OpenEdit from "/@/views/contingency/component/openEdit.vue"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData { |
| | | deptName: string; |
| | | createTime: string; |
| | | status: boolean; |
| | | sort: number | string; |
| | | describe: string; |
| | | id: number; |
| | | children?: DeptData[]; |
| | | } |
| | | interface RuleFormRow { |
| | | teamName: string; |
| | | teamLevel: string; |
| | | teamLeader: string; |
| | | department: any; |
| | | phone: string; |
| | | telephone: string; |
| | | describe: string; |
| | | } |
| | | interface UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: RuleFormRow; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'openEdit', |
| | | components: { |
| | | // uploadFile |
| | | // uploadFiles, |
| | | }, |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | teamName: '', // 队伍名称 |
| | | teamLevel: '', // 队伍级别 |
| | | teamLeader: '', //队伍负责人 |
| | | department: [], // 负责人部门 |
| | | phone: '', // 负责人手机 |
| | | telephone: '', // 固定电话 |
| | | describe: '', // 队伍描述 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (row: RuleFormRow) => { |
| | | state.ruleForm = row; |
| | | state.isShowDialog = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | state.isShowDialog = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | // // 新增 |
| | | // const onSubmit = () => { |
| | | // closeDialog(); |
| | | // }; |
| | | // 初始化部门数据 |
| | | const initTableData = () => { |
| | | state.deptData.push({ |
| | | deptName: 'vueNextAdmin', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '顶级部门', |
| | | id: Math.random(), |
| | | children: [ |
| | | { |
| | | deptName: 'IT外包服务', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '总部', |
| | | id: Math.random(), |
| | | }, |
| | | { |
| | | deptName: '资本控股', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '分部', |
| | | id: Math.random(), |
| | | }, |
| | | ], |
| | | }); |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initTableData(); |
| | | }); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]) |
| | | |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref() |
| | | const data = [ |
| | | { |
| | | value: '1', |
| | | label: '广汇能源综合物流发展有限责任公司', |
| | | children: [ |
| | | { |
| | | value: '1-1', |
| | | label: '经营班子', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '生产运行部', |
| | | children: [ |
| | | { |
| | | value: '2-1', |
| | | label: '灌装一班', |
| | | children: [] |
| | | }, |
| | | { |
| | | value: '2-2', |
| | | label: '工艺四班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: '设备部', |
| | | children: [ |
| | | { |
| | | value: '3-1', |
| | | label: '仪表班', |
| | | children: [], |
| | | }, |
| | | { |
| | | value: '3-2', |
| | | label: '机修班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | onCancel, |
| | | // onSubmit, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | | // handleChange, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .textarea{ |
| | | height: 168px!important; |
| | | } |
| | | .textarea ::v-deep .el-textarea__inner{ |
| | | height: 168px!important; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog title="查看应急队伍管理" v-model="isShowDialog" width="769px"> |
| | | <el-form :model="ruleForm" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍名称"> |
| | | <el-input v-model="ruleForm.teamName" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍级别"> |
| | | <el-select v-model="ruleForm.teamLevel" :disabled="true" class="w100"> |
| | | <el-option label="公司" value="admin"></el-option> |
| | | <el-option label="分厂-车间" value="common"></el-option> |
| | | <el-option label="工序-班组等" value="shang"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍负责人"> |
| | | <el-input |
| | | v-model="ruleForm.teamLeader" |
| | | placeholder="Please input" |
| | | class="input-with-select" |
| | | :disabled="true" |
| | | > |
| | | <template #append> |
| | | <el-button :icon="Search"/> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="负责人部门"> |
| | | <el-tree-select v-model="ruleForm.responsibleDepartment" :data="data" :disabled="true" class="w100"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="负责人手机"> |
| | | <el-input v-model="ruleForm.teamPhone" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="固定电话"> |
| | | <el-input v-model="ruleForm.telephone" :disabled="true"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="队伍描述"> |
| | | <el-input class="textarea" v-model="ruleForm.describe" type="textarea" :disabled="true" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="相关附件"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | :on-change="handleChange" |
| | | > |
| | | <el-button type="primary" disabled |
| | | >点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | 添加相关附件 |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="应急队伍人员" name="first"> |
| | | <el-button type="primary" size="default" disabled>新增</el-button> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%;margin-top: 15px;" |
| | | ref="multipleTableRef" |
| | | :header-cell-style="{background:'#f6f7fa',color:'#909399'}" |
| | | > |
| | | <el-table-column prop="jobNo" 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 label="操作" width="200" align="center"> |
| | | <template #default="scope"> |
| | | <el-button disabled size="small" text="plain" >查看 |
| | | </el-button> |
| | | <el-button disabled size="small" text="plain" style="margin-right: 5px;">编辑 |
| | | </el-button> |
| | | <el-button disabled size="small" text="plain" style="margin-right: 5px;">删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="onCancel" size="default">关闭</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- <AddTeamLeader ref="addRef" />--> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, ref, onMounted, defineComponent } from 'vue'; |
| | | import type { |
| | | UploadUserFile, |
| | | TabsPaneContext, |
| | | } from 'element-plus' |
| | | import { |
| | | Search |
| | | } from '@element-plus/icons-vue' |
| | | // import AddTeamLeader from '/@/views/contingency/component/addTeamLeader.vue'; |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData { |
| | | deptName: string; |
| | | createTime: string; |
| | | status: boolean; |
| | | sort: number | string; |
| | | describe: string; |
| | | id: number; |
| | | children?: DeptData[]; |
| | | } |
| | | interface RuleFormRow { |
| | | teamName: string; |
| | | teamLevel: string; |
| | | teamLeader: string; |
| | | department: any; |
| | | phone: string; |
| | | telephone: string; |
| | | describe: string; |
| | | } |
| | | interface UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: RuleFormRow; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | // 定义表格数据类型 |
| | | interface User { |
| | | personnelName: string |
| | | jobNo: string |
| | | phone: string; |
| | | position: string; |
| | | } |
| | | // // 定义表格数据类型 |
| | | // interface Team { |
| | | // personnelName: string |
| | | // teamLevel: string |
| | | // teamDescription: string |
| | | // teamPhone: string |
| | | // phone: string; |
| | | // describe: string; |
| | | // responsibleDepartment: string |
| | | // } |
| | | export default defineComponent({ |
| | | name: 'openSee', |
| | | components: { |
| | | // Search, |
| | | }, |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | teamName: '', // 队伍名称 |
| | | teamLevel: '', // 队伍级别 |
| | | teamLeader: '', //队伍负责人 |
| | | department: [], // 负责人部门 |
| | | phone: '', // 负责人手机 |
| | | telephone: '', // 固定电话 |
| | | describe: '', // 队伍描述 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (row: RuleFormRow) => { |
| | | state.ruleForm = row; |
| | | state.isShowDialog = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | state.isShowDialog = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | // 初始化部门数据 |
| | | const initTableData = () => { |
| | | state.deptData.push({ |
| | | deptName: 'vueNextAdmin', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '顶级部门', |
| | | id: Math.random(), |
| | | children: [ |
| | | { |
| | | deptName: 'IT外包服务', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '总部', |
| | | id: Math.random(), |
| | | }, |
| | | { |
| | | deptName: '资本控股', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '分部', |
| | | id: Math.random(), |
| | | }, |
| | | ], |
| | | }); |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initTableData(); |
| | | }); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]) |
| | | |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref() |
| | | const data = [ |
| | | { |
| | | value: '1', |
| | | label: '广汇能源综合物流发展有限责任公司', |
| | | children: [ |
| | | { |
| | | value: '1-1', |
| | | label: '经营班子', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '生产运行部', |
| | | children: [ |
| | | { |
| | | value: '2-1', |
| | | label: '灌装一班', |
| | | children: [] |
| | | }, |
| | | { |
| | | value: '2-2', |
| | | label: '工艺四班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: '设备部', |
| | | children: [ |
| | | { |
| | | value: '3-1', |
| | | label: '仪表班', |
| | | children: [], |
| | | }, |
| | | { |
| | | value: '3-2', |
| | | label: '机修班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | //定义tabs切换 |
| | | const activeName = ref('first') |
| | | |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | console.log(tab, event) |
| | | } |
| | | |
| | | //定义表格数据 |
| | | const multipleSelection = ref<User[]>([]) |
| | | const tableData: User[] = [ |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNo: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNo: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNo: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNo: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | } |
| | | ] |
| | | |
| | | // //添加队伍负责人 |
| | | // const addRef = ref(); |
| | | // //添加队伍负责人弹窗 |
| | | // const onAddTeamLeader = () => { |
| | | // addRef.value.openDialog(); |
| | | // }; |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | onCancel, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | multipleSelection, |
| | | Search, |
| | | // addRef, |
| | | // onAddTeamLeader, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .textarea{ |
| | | height: 168px!important; |
| | | } |
| | | .textarea ::v-deep .el-textarea__inner{ |
| | | height: 168px!important; |
| | | } |
| | | ::v-deep .el-table__cell { |
| | | font-weight: 400; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="button_Line"> |
| | | <div class="button_Left"> |
| | | <el-button type="primary" @click="onOpenAdd"> |
| | | <el-button size="default" type="primary" @click="onOpenAdd"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>新建 |
| | | </el-button> |
| | | <el-button type="warning" plain disabled> |
| | | <el-button size="default" type="warning" plain disabled> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button type="danger" plain disabled> |
| | | <el-button size="default" type="danger" plain disabled> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="userName" label="队伍名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userNickname" label="队伍级别" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="roleSign" label="队伍描述" show-overflow-tooltip></el-table-column> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | ref="multipleTableRef" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55" |
| | | /> |
| | | <el-table-column prop="teamName" label="队伍名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="teamLevel" label="队伍级别" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="teamDescription" label="队伍描述" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="phone" label="负责人手机" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="email" label="相关附件" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="attachments" label="相关附件" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="200" align="center"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenLink(scope.row)"> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenSee(scope.row)"> |
| | | <el-icon style="margin-right: 5px;"> |
| | | <View /> |
| | | </el-icon>查看 |
| | | </el-button> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEditUser(scope.row)"> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEdit(scope.row)"> |
| | | <el-icon style="margin-right: 5px;"> |
| | | <EditPen /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)"> |
| | | <el-button size="small" text type="primary" @click="onRowDel(scope.row)"> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | @size-change="onHandleSizeChange" |
| | | @current-change="onHandleCurrentChange" |
| | | class="mt15" |
| | | :pager-count="5" |
| | | :page-sizes="[10, 20, 30]" |
| | | v-model:current-page="tableData.param.pageNum" |
| | | background |
| | | v-model:page-size="tableData.param.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="tableData.total" |
| | | > |
| | | </el-pagination> |
| | | <!-- <el-pagination--> |
| | | <!-- @size-change="onHandleSizeChange"--> |
| | | <!-- @current-change="onHandleCurrentChange"--> |
| | | <!-- class="mt15"--> |
| | | <!-- :pager-count="5"--> |
| | | <!-- :page-sizes="[10, 20, 30]"--> |
| | | <!-- v-model:current-page="tableData.param.pageNum"--> |
| | | <!-- background--> |
| | | <!-- v-model:page-size="tableData.param.pageSize"--> |
| | | <!-- layout="total, sizes, prev, pager, next, jumper"--> |
| | | <!-- :total="tableData.total"--> |
| | | <!-- >--> |
| | | <!-- </el-pagination>--> |
| | | </el-card> |
| | | <OpenLink ref="openLinRef" /> |
| | | <EditUser ref="editUserRef" /> |
| | | <OpenSee ref="seeRef" /> |
| | | <!-- <OpenAdd ref="addRef" />--> |
| | | <OpenEdit ref="editRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import { |
| | | // toRefs, |
| | | // reactive, |
| | | // onMounted, |
| | | ref, |
| | | defineComponent |
| | | } from 'vue'; |
| | | import { |
| | | ElMessageBox, |
| | | ElMessage, |
| | | ElTable, |
| | | } from 'element-plus'; |
| | | import { Plus, |
| | | Edit, |
| | | Delete, |
| | |
| | | View, |
| | | EditPen, |
| | | } from '@element-plus/icons-vue' |
| | | import AddUer from '/@/views/system/user/component/addUser.vue'; |
| | | import EditUser from '/@/views/system/user/component/editUser.vue'; |
| | | // import OpenAdd from '/@/views/system/user/component/openAdd.vue'; |
| | | import OpenEdit from '/@/views/contingency/component/openEdit.vue'; |
| | | import OpenSee from '/@/views/contingency/component/openSee.vue'; |
| | | |
| | | // 定义表格数据类型 |
| | | interface User { |
| | | teamName: string |
| | | teamLevel: string |
| | | teamDescription: string |
| | | teamPhone: string |
| | | phone: string; |
| | | describe: string; |
| | | responsibleDepartment: string |
| | | teamLeader: string |
| | | |
| | | } |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | userName: string; |
| | | userNickname: string; |
| | | roleSign: string; |
| | | department: string[]; |
| | | phone: string; |
| | | email: string; |
| | | sex: string; |
| | | password: string; |
| | | overdueTime: Date; |
| | | describe: string; |
| | | createTime: string; |
| | | } |
| | | interface TableDataState { |
| | | tableData: { |
| | | data: Array<TableDataRow>; |
| | | total: number; |
| | | loading: boolean; |
| | | param: { |
| | | pageNum: number; |
| | | pageSize: number; |
| | | }; |
| | | }; |
| | | // userName: string; |
| | | // userNickname: string; |
| | | // roleSign: string; |
| | | // department: string[]; |
| | | // phone: string; |
| | | // email: string; |
| | | // sex: string; |
| | | // password: string; |
| | | // overdueTime: Date; |
| | | // // describe: string; |
| | | // createTime: string; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'systemUser', |
| | | components: { AddUer, EditUser, View, EditPen, Plus, Edit, Delete, Upload, Download, Refresh }, |
| | | components: { |
| | | // OpenAdd, |
| | | OpenSee, |
| | | OpenEdit, |
| | | View, |
| | | EditPen, |
| | | Plus, |
| | | Edit, |
| | | Delete, Upload, Download, Refresh }, |
| | | setup() { |
| | | const addUserRef = ref(); |
| | | const editUserRef = ref(); |
| | | const openLinRef = ref(); |
| | | const addRef = ref(); |
| | | const seeRef = ref(); |
| | | const editRef = ref(); |
| | | // 选择框 |
| | | // const value = ref(''); |
| | | // const options = |
| | |
| | | // value: 'Option1', |
| | | // label: 'Option1', |
| | | // }; |
| | | const state = reactive<TableDataState>({ |
| | | tableData: { |
| | | data: [], |
| | | total: 0, |
| | | loading: false, |
| | | param: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }, |
| | | const multipleTableRef = ref<InstanceType<typeof ElTable>>() |
| | | const multipleSelection = ref<User[]>([]) |
| | | // 定义表格数据 |
| | | const tableData: User[] = [ |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | teamPhone: '051383830321', |
| | | phone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | }); |
| | | // 初始化表格数据 |
| | | // const initTableData = () => [ |
| | | // { |
| | | // userName: '消防抢险组(部门级)', |
| | | // userNickname: '分厂-车间', |
| | | // roleSign: 'No. 189, Grove St, Los Angeles', |
| | | // phone: '11', |
| | | // email: 'ce', |
| | | // }, |
| | | // ] |
| | | const initTableData = () => { |
| | | const data: Array<TableDataRow> = []; |
| | | for (let i = 0; i < 2; i++) { |
| | | data.push({ |
| | | userName: i === 0 ? 'admin' : 'test', |
| | | userNickname: i === 0 ? '我是管理员' : '我是普通用户', |
| | | roleSign: i === 0 ? 'admin' : 'common', |
| | | department: i === 0 ? ['vueNextAdmin', 'IT外包服务'] : ['vueNextAdmin', '资本控股'], |
| | | phone: '12345678910', |
| | | email: 'vueNextAdmin@123.com', |
| | | sex: '女', |
| | | password: '123456', |
| | | overdueTime: new Date(), |
| | | describe: i === 0 ? '不可删除' : '测试用户', |
| | | createTime: new Date().toLocaleString(), |
| | | }); |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | teamPhone: '051383830321', |
| | | phone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | teamPhone: '051383830321', |
| | | phone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | teamPhone: '051383830321', |
| | | phone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | } |
| | | state.tableData.data = data; |
| | | state.tableData.total = state.tableData.data.length; |
| | | }; |
| | | ] |
| | | //查看用户弹窗 |
| | | const OpenLink = () => { |
| | | openLinRef.value.openDialog(); |
| | | const onOpenSee = (row: TableDataRow) => { |
| | | seeRef.value.openDialog(row); |
| | | }; |
| | | // 打开新增用户弹窗 |
| | | const onOpenAddUser = () => { |
| | | addUserRef.value.openDialog(); |
| | | }; |
| | | // const onOpenAdd = () => { |
| | | // addRef.value.openDialog(); |
| | | // }; |
| | | // 打开修改用户弹窗 |
| | | const onOpenEditUser = (row: TableDataRow) => { |
| | | editUserRef.value.openDialog(row); |
| | | const onOpenEdit = (row: TableDataRow) => { |
| | | editRef.value.openDialog(row); |
| | | }; |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除账户名称:“${row.userName}”,是否继续?`, '提示', { |
| | | ElMessageBox.confirm(`此操作将永久删除账户名称:“${row}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.tableData.param.pageSize = val; |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.tableData.param.pageNum = val; |
| | | }; |
| | | // const onHandleSizeChange = (val: number) => { |
| | | // state.tableData.param.pageSize = val; |
| | | // }; |
| | | // // 分页改变 |
| | | // const onHandleCurrentChange = (val: number) => { |
| | | // state.tableData.param.pageNum = val; |
| | | // }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initTableData(); |
| | | }); |
| | | // onMounted(() => { |
| | | // initTableData(); |
| | | // }); |
| | | return { |
| | | // value, |
| | | // options, |
| | | addUserRef, |
| | | editUserRef, |
| | | OpenLink, |
| | | openLinRef, |
| | | onOpenAddUser, |
| | | onOpenEditUser, |
| | | multipleSelection, |
| | | multipleTableRef, |
| | | tableData, |
| | | onOpenSee, //查看 |
| | | seeRef, |
| | | onOpenEdit, //编辑 |
| | | editRef, |
| | | // onOpenAdd, //新增 |
| | | addRef, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state), |
| | | // onHandleSizeChange, |
| | | // onHandleCurrentChange, |
| | | // ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog title="修改用户" v-model="isShowDialog" width="769px"> |
| | | <el-form :model="ruleForm" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="账户名称"> |
| | | <el-input v-model="ruleForm.userName" placeholder="请输入账户名称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="用户昵称"> |
| | | <el-input v-model="ruleForm.userNickname" placeholder="请输入用户昵称" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="关联角色"> |
| | | <el-select v-model="ruleForm.roleSign" placeholder="请选择" clearable class="w100"> |
| | | <el-option label="超级管理员" value="admin"></el-option> |
| | | <el-option label="普通用户" value="common"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="部门"> |
| | | <el-cascader |
| | | :options="deptData" |
| | | :props="{ checkStrictly: true, value: 'deptName', label: 'deptName' }" |
| | | placeholder="请选择部门" |
| | | clearable |
| | | class="w100" |
| | | v-model="ruleForm.department" |
| | | > |
| | | <template #default="{ node, data }"> |
| | | <span>{{ data.deptName }}</span> |
| | | <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span> |
| | | </template> |
| | | </el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号"> |
| | | <el-input v-model="ruleForm.phone" placeholder="请输入手机号" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="邮箱"> |
| | | <el-input v-model="ruleForm.email" placeholder="请输入" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="性别"> |
| | | <el-select v-model="ruleForm.sex" placeholder="请选择" clearable class="w100"> |
| | | <el-option label="男" value="男"></el-option> |
| | | <el-option label="女" value="女"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="账户密码"> |
| | | <el-input v-model="ruleForm.password" placeholder="请输入" type="password" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="账户过期"> |
| | | <el-date-picker v-model="ruleForm.overdueTime" type="date" placeholder="请选择" class="w100"> </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="用户状态"> |
| | | <el-switch v-model="ruleForm.status" inline-prompt active-text="启" inactive-text="禁"></el-switch> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="用户描述"> |
| | | <el-input v-model="ruleForm.describe" type="textarea" placeholder="请输入用户描述" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="onCancel" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmit" size="default">修 改</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent } from 'vue'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData { |
| | | deptName: string; |
| | | createTime: string; |
| | | status: boolean; |
| | | sort: number | string; |
| | | describe: string; |
| | | id: number; |
| | | children?: DeptData[]; |
| | | } |
| | | interface RuleFormRow { |
| | | userName: string; |
| | | userNickname: string; |
| | | roleSign: string; |
| | | department: any; |
| | | phone: string; |
| | | email: string; |
| | | sex: string; |
| | | password: string; |
| | | overdueTime: string; |
| | | status: boolean; |
| | | describe: string; |
| | | } |
| | | interface UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: RuleFormRow; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'systemEditUser', |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | userName: '', // 账户名称 |
| | | userNickname: '', // 用户昵称 |
| | | roleSign: '', // 关联角色 |
| | | department: [], // 部门 |
| | | phone: '', // 手机号 |
| | | email: '', // 邮箱 |
| | | sex: '', // 性别 |
| | | password: '', // 账户密码 |
| | | overdueTime: '', // 账户过期 |
| | | status: true, // 用户状态 |
| | | describe: '', // 用户描述 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (row: RuleFormRow) => { |
| | | state.ruleForm = row; |
| | | state.isShowDialog = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | state.isShowDialog = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | // 新增 |
| | | const onSubmit = () => { |
| | | closeDialog(); |
| | | }; |
| | | // 初始化部门数据 |
| | | const initTableData = () => { |
| | | state.deptData.push({ |
| | | deptName: 'vueNextAdmin', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '顶级部门', |
| | | id: Math.random(), |
| | | children: [ |
| | | { |
| | | deptName: 'IT外包服务', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '总部', |
| | | id: Math.random(), |
| | | }, |
| | | { |
| | | deptName: '资本控股', |
| | | createTime: new Date().toLocaleString(), |
| | | status: true, |
| | | sort: Math.random(), |
| | | describe: '分部', |
| | | id: Math.random(), |
| | | }, |
| | | ], |
| | | }); |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initTableData(); |
| | | }); |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | onCancel, |
| | | onSubmit, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |