Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqtOut
已重命名1个文件
已修改7个文件
已添加16个文件
已删除1个文件
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="选择安全目标指标" width="50%" draggable> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" status-icon> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.pass" placeholder="安全目标指标" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" :offset="1"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.checkPass" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" :offset="1"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)">查询</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-button size="default" :icon="Delete">清除选择</el-button> |
| | | <el-table :data="tableData" style="width: 100%;margin-top:20px"> |
| | | <el-table-column align="center" prop="date" label="安全目标指标" width="180" /> |
| | | <el-table-column align="center" prop="name" label="目标指标编号" width="180" /> |
| | | <el-table-column align="center" prop="address" label="年度" /> |
| | | <el-table-column align="center" prop="address" label="指标值" /> |
| | | </el-table> |
| | | <el-pagination |
| | | style="padding:20px 0;border-bottom:1px solid #dedede" |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)"> |
| | | {{ tag }} |
| | | </el-tag> |
| | | </el-col> |
| | | </el-row> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, reactive, ref } from 'vue'; |
| | | import { Delete } from '@element-plus/icons-vue'; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const openDailog = () => { |
| | | dialogVisible.value = true; |
| | | }; |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pass: '', |
| | | checkPass: '', |
| | | }); |
| | | // 表格 |
| | | const tableData = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-04', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-01', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | const pageSize4 = ref(100); |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | // 右方点击添加后显示标签 |
| | | const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']); |
| | | const handleClose = (tag: string) => { |
| | | dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1); |
| | | }; |
| | | return { |
| | | dialogVisible, |
| | | openDailog, |
| | | ruleForm, |
| | | tableData, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | dynamicTags, |
| | | handleClose, |
| | | Delete, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-row { |
| | | padding: 0 0 20px 0; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="用户选择" width="60%" draggable> |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <div class="userTree"> |
| | | <el-input v-model="names" placeholder="请输入组织机构过滤"></el-input> |
| | | <div class="tree"> |
| | | <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" /> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="14"> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" status-icon> |
| | | <el-row> |
| | | <el-col :span="10" :offset="1"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.pass" placeholder="登录名" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8" :offset="1"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)">查询</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-table :data="tableData" style="width: 100%; margin-top: 20px"> |
| | | <el-table-column align="center" width="50px"> |
| | | <template #default> |
| | | <el-radio-group v-model="radio1" class="ml-4"> |
| | | <el-radio label="1" size="large"> </el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="date" label="安全目标指标" /> |
| | | <el-table-column align="center" prop="name" label="目标指标编号" /> |
| | | <el-table-column align="center" prop="address" label="年度" /> |
| | | <el-table-column align="center" prop="address" label="指标值" /> |
| | | </el-table> |
| | | <el-pagination |
| | | style="padding: 20px 0; border-bottom: 1px solid #dedede" |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)"> |
| | | {{ tag }} |
| | | </el-tag> |
| | | </el-col> |
| | | </el-row> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | interface Tree { |
| | | label: string; |
| | | children?: Tree[]; |
| | | } |
| | | export default defineComponent({ |
| | | setup() { |
| | | //左边树形部分 |
| | | const names = ref<any>(); |
| | | const handleNodeClick = (data: Tree) => { |
| | | console.log(data); |
| | | }; |
| | | |
| | | const data: Tree[] = [ |
| | | { |
| | | label: 'Level one 1', |
| | | children: [ |
| | | { |
| | | label: 'Level two 1-1', |
| | | children: [ |
| | | { |
| | | label: 'Level three 1-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'Level one 2', |
| | | children: [ |
| | | { |
| | | label: 'Level two 2-1', |
| | | children: [ |
| | | { |
| | | label: 'Level three 2-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'Level two 2-2', |
| | | children: [ |
| | | { |
| | | label: 'Level three 2-2-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'Level one 3', |
| | | children: [ |
| | | { |
| | | label: 'Level two 3-1', |
| | | children: [ |
| | | { |
| | | label: 'Level three 3-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'Level two 3-2', |
| | | children: [ |
| | | { |
| | | label: 'Level three 3-2-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | //中间表格 |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pass: '', |
| | | checkPass: '', |
| | | }); |
| | | // 表格 |
| | | const tableData = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-04', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-01', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | const pageSize4 = ref(100); |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | const radio1 = ref('1'); |
| | | // 右方点击添加后显示标签 |
| | | const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']); |
| | | const handleClose = (tag: string) => { |
| | | dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1); |
| | | }; |
| | | // 开启弹窗 |
| | | const dialogVisible = ref(false); |
| | | const openDailog = () => { |
| | | dialogVisible.value = true; |
| | | }; |
| | | return { |
| | | dialogVisible, |
| | | names, |
| | | data, |
| | | handleNodeClick, |
| | | openDailog, |
| | | ruleForm, |
| | | tableData, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | radio1, |
| | | dynamicTags, |
| | | handleClose |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .userTree { |
| | | border: 1px solid #ebeef5; |
| | | } |
| | | .userTree .el-input { |
| | | padding: 10px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | .tree { |
| | | height: 500px; |
| | | overflow: hidden; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
| | |
| | | button:'121231' |
| | | }, |
| | | }, |
| | | { |
| | | path: '/team', |
| | | name: 'team', |
| | | component: () => import('/@/views/contingency/team/index.vue'), |
| | | meta: { |
| | | title: 'message.router.team', |
| | | isLink: '', |
| | | isHide: false, |
| | | isKeepAlive: true, |
| | | isAffix: true, |
| | | isIframe: false, |
| | | roles: ['admin', 'common'], |
| | | icon: 'iconfont icon-shouye', |
| | | button:'121231' |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | title="新建应急队伍人员" |
| | | v-model="isShowDialog" |
| | | width="769px" |
| | | draggable |
| | | > |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | size="default" |
| | | :rules="rules" |
| | | 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="选择人员" prop="selectPeople"> |
| | | <el-input |
| | | v-model="ruleForm.selectPeople" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <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="人员工号" prop="jobNumber"> |
| | | <el-input v-model="ruleForm.jobNumber" placeholder="请填写人员工号"></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="人员名称" prop="personnelName"> |
| | | <el-input v-model="ruleForm.personnelName" placeholder="请填写人员名称"></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="人员性别" prop="personnelGender"> |
| | | <el-radio-group v-model="ruleForm.personnelGender"> |
| | | <el-radio label="男" /> |
| | | <el-radio label="女" /> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号码" prop="phone"> |
| | | <el-input v-model="ruleForm.phone" placeholder="请填写手机号码"></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="职位" prop="position"> |
| | | <el-input v-model="ruleForm.position" placeholder="请填写职位"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">继续添加</el-button> |
| | | <el-button size="default" @click="onCancel">关闭</el-button> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | ref, |
| | | reactive, |
| | | defineComponent |
| | | } from 'vue'; |
| | | |
| | | import type { |
| | | FormRules, |
| | | FormInstance, |
| | | } from 'element-plus' |
| | | |
| | | import { |
| | | Search |
| | | } from '@element-plus/icons-vue' |
| | | |
| | | export default defineComponent({ |
| | | name: 'addTeamLeader', |
| | | components: { |
| | | // Search, |
| | | }, |
| | | setup() { |
| | | const isShowDialog = ref(false) |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleForm = reactive({ |
| | | selectPeople: '', // 选择人员 |
| | | jobNumber: '', //人员工号 |
| | | personnelName: '', // 人员名称 |
| | | personnelGender: '', // 人员性别 |
| | | phone: '', // 手机号码 |
| | | position: '', // 职位 |
| | | }); |
| | | const rules = reactive<FormRules>({ |
| | | jobNumber: [ |
| | | { |
| | | required: true, |
| | | message: '人员工号不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | personnelName: [ |
| | | { |
| | | required: true, |
| | | message: '人员名称不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | personnelGender: [ |
| | | { |
| | | required: true, |
| | | message: '人员性别不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | phone: [ |
| | | { |
| | | required: true, |
| | | message: '手机号码不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | position: [ |
| | | { |
| | | required: true, |
| | | message: '职位不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }) |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 打开弹窗 |
| | | const openDialog = () => { |
| | | isShowDialog.value = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | isShowDialog, |
| | | ruleFormRef, |
| | | submitForm, |
| | | onCancel, |
| | | ruleForm, |
| | | rules, |
| | | Search, |
| | | }; |
| | | }, |
| | | }); |
| | | </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> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | title="修改应急队伍人员" |
| | | v-model="isShowDialog" |
| | | width="769px" |
| | | draggable |
| | | > |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | size="default" |
| | | :rules="rules" |
| | | 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="选择人员" prop="selectPeople"> |
| | | <el-input |
| | | v-model="ruleForm.selectPeople" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <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="人员工号" prop="jobNumber"> |
| | | <el-input v-model="ruleForm.jobNumber" placeholder="请填写人员工号"></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="人员名称" prop="personnelName"> |
| | | <el-input v-model="ruleForm.personnelName" placeholder="请填写人员名称"></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="人员性别" prop="personnelGender"> |
| | | <el-radio-group v-model="ruleForm.personnelGender"> |
| | | <el-radio label="男" /> |
| | | <el-radio label="女" /> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="手机号码" prop="phone"> |
| | | <el-input v-model="ruleForm.phone" placeholder="请填写手机号码"></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="职位" prop="position"> |
| | | <el-input v-model="ruleForm.position" placeholder="请填写职位"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">继续添加</el-button> |
| | | <el-button size="default" @click="onCancel">关闭</el-button> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | ref, |
| | | reactive, |
| | | toRefs, |
| | | defineComponent |
| | | } from 'vue'; |
| | | |
| | | import type { |
| | | FormRules, |
| | | FormInstance, |
| | | } from 'element-plus' |
| | | |
| | | import { |
| | | Search |
| | | } from '@element-plus/icons-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; |
| | | // responsibleDepartment: any |
| | | // teamPhone: string; |
| | | // telephone: string; |
| | | // describe: string; |
| | | // selectPeople: string |
| | | } |
| | | interface UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: RuleFormRow; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'editTeamLeader', |
| | | components: { |
| | | // Search, |
| | | }, |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | selectPeople:'', //选择人员 |
| | | jobNumber: '', // 人员工号 |
| | | phone: '', // 手机号码 |
| | | personnelGender: '', //人员性别 |
| | | position: '', //职位 |
| | | personnelName: '', // 人员名称 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | // const isShowDialog = ref(false) |
| | | const ruleFormRef = ref<FormInstance>() |
| | | // 打开弹窗 |
| | | const openDialog = (row: RuleFormRow) => { |
| | | // isShowDialog.value = true; |
| | | state.ruleForm = row; |
| | | state.isShowDialog = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | // isShowDialog.value = false; |
| | | state.isShowDialog = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | selectPeople:[ |
| | | { |
| | | required: true, |
| | | message: '人员不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | jobNumber: [ |
| | | { |
| | | required: true, |
| | | message: '人员工号不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | personnelName: [ |
| | | { |
| | | required: true, |
| | | message: '人员名称不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | personnelGender: [ |
| | | { |
| | | required: true, |
| | | message: '人员性别不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | phone: [ |
| | | { |
| | | required: true, |
| | | message: '手机号码不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | position: [ |
| | | { |
| | | required: true, |
| | | message: '职位不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }) |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | // isShowDialog, |
| | | ruleFormRef, |
| | | submitForm, |
| | | onCancel, |
| | | rules, |
| | | Search, |
| | | ...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> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | title="新建应急队伍管理" |
| | | v-model="isShowDialog" |
| | | width="769px" |
| | | draggable |
| | | > |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | size="default" |
| | | :rules="rules" |
| | | label-width="120px" |
| | | > |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍名称" prop="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写队伍名称"></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="队伍级别" prop="teamLevel"> |
| | | <el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择"> |
| | | <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="队伍负责人" prop="teamLeader"> |
| | | <el-input |
| | | v-model="ruleForm.teamLeader" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <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="负责人部门" prop="responsibleDepartment"> |
| | | <el-tree-select |
| | | v-model="ruleForm.responsibleDepartment" |
| | | :data="data" class="w100" |
| | | placeholder="请选择"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="负责人手机" prop="teamPhone"> |
| | | <el-input v-model="ruleForm.teamPhone" placeholder="请填写负责人手机"></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="固定电话" prop="telephone"> |
| | | <el-input v-model="ruleForm.telephone" placeholder="请填写固定电话"></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" |
| | | maxlength="150" |
| | | placeholder="请填写队伍描述" |
| | | ></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" |
| | | >点击上传</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" @click="onAddEmergencyPersonnel">新增</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> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <AddEmergencyPersonnel ref="addRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, |
| | | ref, |
| | | defineComponent |
| | | } from 'vue'; |
| | | |
| | | import type { |
| | | UploadUserFile, |
| | | TabsPaneContext, |
| | | FormInstance, |
| | | FormRules, |
| | | } from 'element-plus' |
| | | |
| | | import { |
| | | Search |
| | | } from '@element-plus/icons-vue' |
| | | import AddEmergencyPersonnel from "/@/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue"; |
| | | // 定义表格数据类型 |
| | | interface User { |
| | | personnelName: string |
| | | jobNo: string |
| | | phone: string; |
| | | position: string; |
| | | } |
| | | export default defineComponent({ |
| | | name: 'openAdd', |
| | | components: { |
| | | AddEmergencyPersonnel |
| | | }, |
| | | setup() { |
| | | const isShowDialog = ref(false) |
| | | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | //定义表单 |
| | | const ruleForm = reactive({ |
| | | teamName: '', // 队伍名称 |
| | | teamLeader: '', //队伍负责人 |
| | | department: [], // 负责人部门 |
| | | phone: '', // 负责人手机 |
| | | telephone: '', // 固定电话 |
| | | describe: '', // 队伍描述 |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = () => { |
| | | // state.ruleForm = row; |
| | | isShowDialog.value = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | }; |
| | | // 上传附件 |
| | | 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[] = [] |
| | | |
| | | //添加队伍负责人弹窗 |
| | | const addRef = ref(); |
| | | const onAddEmergencyPersonnel = () => { |
| | | addRef.value.openDialog(); |
| | | }; |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | | teamName: [ |
| | | { |
| | | required: true, |
| | | message: '队伍名称不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamLevel: [ |
| | | { |
| | | required: true, |
| | | message: '队伍级别不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamLeader: [ |
| | | { |
| | | required: true, |
| | | message: '队伍负责人不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | responsibleDepartment: [ |
| | | { |
| | | required: true, |
| | | message: '负责人部门不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamPhone: [ |
| | | { |
| | | required: true, |
| | | message: '负责人手机不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | telephone: [ |
| | | { |
| | | required: true, |
| | | message: '固定电话不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }) |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | isShowDialog, |
| | | onCancel, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | multipleSelection, |
| | | Search, |
| | | ruleForm, |
| | | ruleFormRef, |
| | | submitForm, |
| | | rules, |
| | | addRef, |
| | | onAddEmergencyPersonnel, |
| | | }; |
| | | }, |
| | | }); |
| | | </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> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog title="编辑应急队伍管理" v-model="isShowDialog" width="769px"> |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :rules="rules" |
| | | :model="ruleForm" |
| | | size="default" |
| | | label-width="120px" |
| | | > |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="队伍名称" prop="teamName"> |
| | | <el-input v-model="ruleForm.teamName"></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="队伍级别" prop="teamLevel"> |
| | | <el-select v-model="ruleForm.teamLevel" 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="队伍负责人" prop="teamLeader"> |
| | | <el-input |
| | | v-model="ruleForm.teamLeader" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <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="负责人部门" prop="responsibleDepartment"> |
| | | <el-tree-select v-model="ruleForm.responsibleDepartment" :data="data" 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="负责人手机" prop="teamPhone"> |
| | | <el-input v-model="ruleForm.teamPhone"></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="固定电话" prop="telephone"> |
| | | <el-input v-model="ruleForm.telephone"></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" |
| | | maxlength="150" |
| | | placeholder="请填写队伍描述" |
| | | ></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">点击上传</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" @click="onAddEmergencyPersonnel">新增</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="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 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(scope.row)" style="margin-right: 5px;">编辑 |
| | | </el-button> |
| | | <el-button size="small" type="primary" 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> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <AddEmergencyPersonnel ref="addRef" /> |
| | | <EditEmergencyPersonnel ref="editRef" /> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | reactive, |
| | | toRefs, |
| | | ref, |
| | | onMounted, |
| | | defineComponent |
| | | } from 'vue'; |
| | | import type { |
| | | UploadUserFile, |
| | | TabsPaneContext, |
| | | FormInstance, |
| | | FormRules, |
| | | ElTable, |
| | | } from 'element-plus' |
| | | import { |
| | | Search |
| | | } from '@element-plus/icons-vue' |
| | | import AddEmergencyPersonnel from "/@/views/contingencyManagement/contingency/component/addEmergencyPersonnel.vue"; |
| | | import EditEmergencyPersonnel from "/@/views/contingencyManagement/contingency/component/editEmergencyPersonnel.vue"; |
| | | // 定义表格数据类型 |
| | | interface User { |
| | | personnelName: string |
| | | jobNumber: string |
| | | phone: string; |
| | | position: string; |
| | | } |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | // userName: string; |
| | | // userNickname: string; |
| | | // roleSign: string; |
| | | // department: string[]; |
| | | // phone: string; |
| | | // email: string; |
| | | } |
| | | // 定义接口来定义对象的类型 |
| | | 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; |
| | | // responsibleDepartment: any |
| | | // teamPhone: string; |
| | | // telephone: string; |
| | | // describe: string; |
| | | selectPeople:string |
| | | jobNumber: string; |
| | | personnelName: string; |
| | | personnelGender: string; |
| | | phone: string; |
| | | position: string; |
| | | } |
| | | interface UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: RuleFormRow; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'openEdit', |
| | | components: { |
| | | AddEmergencyPersonnel, |
| | | EditEmergencyPersonnel |
| | | }, |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | selectPeople:'111', //选择人员 |
| | | jobNumber: '', // 人员工号 |
| | | phone: '', // 手机号码 |
| | | personnelGender: '', //人员性别 |
| | | position: '', //职位 |
| | | personnelName: '', // 人员名称 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | |
| | | // 关闭弹窗 |
| | | 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: [], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | //定义tabs切换 |
| | | const activeName = ref('first') |
| | | |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | console.log(tab, event) |
| | | } |
| | | //添加队伍负责人弹窗 |
| | | const addRef = ref(); |
| | | const onAddEmergencyPersonnel = () => { |
| | | addRef.value.openDialog(); |
| | | }; |
| | | |
| | | //定义表格数据 |
| | | const multipleTableRef = ref<InstanceType<typeof ElTable>>() |
| | | const multipleSelection = ref<User[]>([]) |
| | | const tableData: User[] = [ |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNumber: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNumber: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNumber: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | }, |
| | | { |
| | | personnelName: '张志刚', |
| | | jobNumber: '1037', |
| | | position: '副组长', |
| | | phone: '13673321356', |
| | | } |
| | | ] |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | | teamName: [ |
| | | { |
| | | required: true, |
| | | message: '队伍名称不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamLevel: [ |
| | | { |
| | | required: true, |
| | | message: '队伍级别不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamLeader: [ |
| | | { |
| | | required: true, |
| | | message: '队伍负责人不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | responsibleDepartment: [ |
| | | { |
| | | required: true, |
| | | message: '负责人部门不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | teamPhone: [ |
| | | { |
| | | required: true, |
| | | message: '负责人手机不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | telephone: [ |
| | | { |
| | | required: true, |
| | | message: '固定电话不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }) |
| | | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | // 打开弹窗 |
| | | const openDialog = (row: RuleFormRow) => { |
| | | state.ruleForm = row; |
| | | state.isShowDialog = true; |
| | | }; |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | //表格编辑弹窗 |
| | | const editRef = ref(); |
| | | const onEditEmergencyPersonnel = (row: TableDataRow) => { |
| | | editRef.value.openDialog(row); |
| | | }; |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | onCancel, |
| | | // onSubmit, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | | activeName, |
| | | handleClick, |
| | | multipleSelection, |
| | | onAddEmergencyPersonnel, |
| | | onEditEmergencyPersonnel, |
| | | addRef, |
| | | editRef, |
| | | submitForm, |
| | | Search, |
| | | rules, |
| | | ruleFormRef, |
| | | tableData, |
| | | multipleTableRef, |
| | | ...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" |
| | | draggable |
| | | > |
| | | <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/addEmergencyPersonnel.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> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="导入Excel" |
| | | width="50%" |
| | | draggable |
| | | > |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | multiple |
| | | :on-preview="handlePreview" |
| | | :on-remove="handleRemove" |
| | | :before-remove="beforeRemove" |
| | | :limit="3" |
| | | :on-exceed="handleExceed" |
| | | > |
| | | <el-button size="default">下载模板</el-button> |
| | | <el-button size="default" type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | 只允许导入“xls”或“xlsx”格式文件! |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { ref, |
| | | defineComponent, |
| | | } from "vue"; |
| | | import { |
| | | ElMessage, |
| | | ElMessageBox |
| | | } from "element-plus"; |
| | | import type { |
| | | UploadProps, |
| | | UploadUserFile, |
| | | } from "element-plus"; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | let dialogVisible =ref<boolean>(false) |
| | | const fileList = ref<UploadUserFile[]>([ |
| | | // { |
| | | // name: "element-plus-logo.svg", |
| | | // url: "https://element-plus.org/images/element-plus-logo.svg", |
| | | // }, |
| | | // { |
| | | // name: "element-plus-logo2.svg", |
| | | // url: "https://element-plus.org/images/element-plus-logo.svg", |
| | | // }, |
| | | ]); |
| | | |
| | | const handleRemove: UploadProps["onRemove"] = (file, uploadFiles) => { |
| | | console.log(file, uploadFiles); |
| | | }; |
| | | |
| | | const handlePreview: UploadProps["onPreview"] = (uploadFile) => { |
| | | console.log(uploadFile); |
| | | }; |
| | | |
| | | const handleExceed: UploadProps["onExceed"] = (files, uploadFiles) => { |
| | | ElMessage.warning( |
| | | `The limit is 3, you selected ${ |
| | | files.length |
| | | } files this time, add up to ${ |
| | | files.length + uploadFiles.length |
| | | } totally` |
| | | ); |
| | | }; |
| | | |
| | | const beforeRemove: UploadProps["beforeRemove"] = ( |
| | | uploadFile, |
| | | uploadFiles |
| | | ) => { |
| | | return ElMessageBox.confirm( |
| | | `Cancel the transfert of ${uploadFile.name} ?` |
| | | ).then( |
| | | () => true, |
| | | () => false |
| | | ); |
| | | }; |
| | | // 打开弹窗 |
| | | const openDialog = (type:string,value:any,projectList: any,projectId:string) => { |
| | | dialogVisible.value=true |
| | | } |
| | | return { |
| | | dialogVisible, |
| | | fileList, |
| | | handleRemove, |
| | | handlePreview, |
| | | handleExceed, |
| | | beforeRemove, |
| | | openDialog, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .el-upload__tip{ |
| | | margin-left: 100px; |
| | | margin-top: 20px; |
| | | } |
| | | ::v-deep .el-dialog__header{ |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-user-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <el-form :inline="true" :model="formInline" class="demo-form-inline"> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="formInline.name" placeholder="队伍名称"> </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-select size="default" v-model="formInline.level" placeholder="请选择队伍级别"> |
| | | <el-option label="公司" value="shanghai"></el-option> |
| | | <el-option label="分厂-车间" value="beijing"></el-option> |
| | | <el-option label="工序-班组等" value="beijing"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="default" type="primary" class="ml10" @click="onSubmit"> |
| | | 查询 |
| | | </el-button> |
| | | <el-button size="default" class="ml10" @click="submitReset"> |
| | | 重置 |
| | | </el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="button_Line"> |
| | | <div class="button_Left"> |
| | | <el-button size="default" type="primary" @click="onOpenAdd('新建')"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain disabled> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain disabled> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | | </el-button> |
| | | </div> |
| | | <div class="button_Right"> |
| | | <el-button @click="upButton"> |
| | | <el-icon> |
| | | <Upload /> |
| | | </el-icon> |
| | | </el-button> |
| | | <el-button> |
| | | <el-icon> |
| | | <Download /> |
| | | </el-icon> |
| | | </el-button> |
| | | <el-button> |
| | | <el-icon> |
| | | <Refresh /> |
| | | </el-icon> |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <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="teamPhone" 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="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="onOpenEdit(scope.row)"> |
| | | <el-icon style="margin-right: 5px;"> |
| | | <EditPen /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="small" text type="primary" @click="onRowDel(scope.row)"> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pages"> |
| | | <el-pagination |
| | | v-model:currentPage="currentPage" |
| | | v-model:page-size="pageSize" |
| | | :page-sizes="[10,20,50,100]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | <OpenSee ref="seeRef" /> |
| | | <OpenAdd ref="addRef" /> |
| | | <OpenEdit ref="editRef" /> |
| | | <upData ref="upShow"></upData> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | // toRefs, |
| | | reactive, |
| | | // onMounted, |
| | | ref, |
| | | defineComponent |
| | | } from 'vue'; |
| | | import { |
| | | ElMessageBox, |
| | | ElMessage, |
| | | ElTable, |
| | | } from 'element-plus'; |
| | | import { Plus, |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen, |
| | | } from '@element-plus/icons-vue' |
| | | import OpenAdd from '/@/views/contingencyManagement/contingency/component/openAdd.vue'; |
| | | import OpenEdit from '/@/views/contingencyManagement/contingency/component/openEdit.vue'; |
| | | import OpenSee from '/@/views/contingencyManagement/contingency/component/openSee.vue'; |
| | | import UpData from '/@/views/contingencyManagement/contingency/component/upData.vue'; |
| | | |
| | | // 定义表格数据类型 |
| | | interface User { |
| | | teamName: string |
| | | teamLevel: string |
| | | teamDescription: string |
| | | teamPhone: string |
| | | telephone: 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; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'systemUser', |
| | | components: { |
| | | OpenAdd, |
| | | OpenSee, |
| | | OpenEdit, |
| | | View, |
| | | EditPen, |
| | | Plus, |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | UpData |
| | | }, |
| | | setup() { |
| | | // 定义表单搜索 |
| | | const formInline = reactive({ |
| | | name: '', |
| | | level: '', |
| | | }) |
| | | // 搜索按钮 |
| | | const onSubmit = () => { |
| | | console.log('submit!') |
| | | } |
| | | const seeRef = ref(); |
| | | const editRef = ref(); |
| | | const multipleTableRef = ref<InstanceType<typeof ElTable>>() |
| | | const multipleSelection = ref<User[]>([]) |
| | | |
| | | // 上传 |
| | | const upShow=ref() |
| | | const upButton=()=>{ |
| | | upShow.value.openDialog() |
| | | } |
| | | // 定义表格数据 |
| | | const tableData: User[] = [ |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | telephone: '051383830321', |
| | | teamPhone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | telephone: '051383830321', |
| | | teamPhone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | telephone: '051383830321', |
| | | teamPhone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | }, |
| | | { |
| | | teamName: '应急救援组', |
| | | teamLevel: '公司', |
| | | teamDescription: '实施抢险抢险的应急方案和措施实施 ;', |
| | | telephone: '051383830321', |
| | | teamPhone: '13603812900', |
| | | describe: '(1)实施抢险抢险的应急方案和措施实施 ;\n' + |
| | | '(2)负责现场被困人员、受伤人员抢救工作;\n' + |
| | | '(3)在事故有可能扩大进行抢险抢修或救援时,高度注意避免意外伤害;\n' + |
| | | '(4)抢险抢修或救援结束后,对结果进行复查和评估。', |
| | | responsibleDepartment: '仪表班', |
| | | teamLeader: '王磊', |
| | | } |
| | | ] |
| | | //查看用户弹窗 |
| | | const onOpenSee = (row: TableDataRow) => { |
| | | seeRef.value.openDialog(row); |
| | | }; |
| | | // 打开新增用户弹窗 |
| | | const addRef = ref(); |
| | | const onOpenAdd = () => { |
| | | addRef.value.openDialog(); |
| | | }; |
| | | // 打开修改用户弹窗 |
| | | const onOpenEdit = (row: TableDataRow) => { |
| | | editRef.value.openDialog(row); |
| | | }; |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除账户名称:“${row}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | ElMessage.success('删除成功'); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const currentPage = ref(4); |
| | | const pageSize = ref(10); |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | // const onHandleSizeChange = (val: number) => { |
| | | // state.tableData.param.pageSize = val; |
| | | // }; |
| | | // // 分页改变 |
| | | // 页面加载时 |
| | | // onMounted(() => { |
| | | // initTableData(); |
| | | // }); |
| | | return { |
| | | // value, |
| | | // options, |
| | | formInline, |
| | | onSubmit, |
| | | multipleSelection, |
| | | multipleTableRef, |
| | | upButton, |
| | | upShow, |
| | | tableData, |
| | | onOpenSee, //查看 |
| | | seeRef, |
| | | onOpenEdit, //编辑 |
| | | editRef, |
| | | onOpenAdd, //新增 |
| | | addRef, |
| | | onRowDel, |
| | | currentPage, |
| | | pageSize, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | // ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .table_Box{ |
| | | padding: 20px; |
| | | background-color: #fff; |
| | | } |
| | | .tableForm{ |
| | | margin-top: 10px; |
| | | } |
| | | /*按钮行*/ |
| | | .button_Line{ |
| | | display: flex; |
| | | flex-direction: row; |
| | | justify-content: space-between; |
| | | } |
| | | .pages{ |
| | | padding-top: 20px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | .el-form .el-form-item:last-of-type{ |
| | | margin-bottom: 22px!important; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="目标分解" width="50%" draggable> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="安全目标指标"> |
| | | <el-input v-model="form.name"> |
| | | <template #append> <el-button :icon="Search" @click="daiInpt" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="目标指标编号"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="年度"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="指标值"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-button type="primary" size="default" @click="daiAdd">新增</el-button> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column align="center" prop="date" label="责任部门" width="180" /> |
| | | <el-table-column align="center" prop="name" label="考核指标" width="180" /> |
| | | <el-table-column align="center" prop="address" label="制定人部门" /> |
| | | <el-table-column align="center" prop="address" label="制定日期" /> |
| | | <el-table-column align="center" prop="address" label="上报人" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default> |
| | | <el-button link type="primary">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogAdd ref="Show"></DailogAdd> |
| | | <DailogSearch ref="Shows"></DailogSearch> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import DailogAdd from './DailogAdd.vue' |
| | | import DailogSearch from '../../../../components/DailogSearch/DailogSearch.vue' |
| | | export default defineComponent({ |
| | | components:{DailogAdd,DailogSearch}, |
| | | setup() { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }); |
| | | const openDailog = (type: string, value: any, projectList: any, projectId: string) => { |
| | | dialogVisible.value = true; |
| | | }; |
| | | // 导航 |
| | | const activeName = ref('1'); |
| | | // 表格 |
| | | const tableData = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-04', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-01', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | // 新增弹窗 |
| | | const Show=ref() |
| | | const daiAdd=()=>{ |
| | | Show.value.openDailog() |
| | | } |
| | | // 安全目标指标弹窗 |
| | | const Shows=ref() |
| | | const daiInpt=()=>{ |
| | | Shows.value.openDailog() |
| | | } |
| | | return { |
| | | form, |
| | | dialogVisible, |
| | | openDailog, |
| | | activeName, |
| | | tableData, |
| | | Show, |
| | | daiAdd, |
| | | Shows, |
| | | daiInpt, |
| | | Search, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-row { |
| | | padding: 0 0 20px 0; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="新建目标指标分解" width="50%" draggable> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="责任部门"> |
| | | <el-select v-model="form.region" style="width: 100%"> |
| | | <el-option label="Zone one" value="shanghai" /> |
| | | <el-option label="Zone two" value="beijing" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="考核指标"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="制定人部门"> |
| | | <el-select v-model="form.region" style="width: 100%"> |
| | | <el-option label="Zone one" value="shanghai" /> |
| | | <el-option label="Zone two" value="beijing" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="制定日期"> |
| | | <el-date-picker v-model="form.date1" type="date" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="上报人"> |
| | | <el-input v-model="form.name"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">继续添加</el-button> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogSearchUser ref="Show"></DailogSearchUser> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import DailogSearchUser from '../../../../components/DailogSearchUser/index.vue' |
| | | export default defineComponent({ |
| | | components:{DailogSearchUser}, |
| | | setup() { |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }); |
| | | // 开启弹窗 |
| | | const dialogVisible = ref(false); |
| | | const openDailog = () => { |
| | | dialogVisible.value = true; |
| | | }; |
| | | // 开启用户弹窗 |
| | | const Show=ref() |
| | | const openUser=()=>{ |
| | | Show.value.openDailog() |
| | | } |
| | | return { |
| | | form, |
| | | dialogVisible, |
| | | openDailog, |
| | | Show, |
| | | openUser, |
| | | Search, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-row { |
| | | padding: 0 0 20px 0; |
| | | } |
| | | </style> |
| | |
| | | <div class="minCenter"> |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button type="primary" :icon="Plus" @click="openDai">新建</el-button> |
| | | <el-button type="warning" :icon="EditPen" plain @click="openDai">修改</el-button> |
| | | <el-button type="primary" :icon="Plus" @click="openType">新建</el-button> |
| | | <el-button type="warning" :icon="EditPen" plain >修改</el-button> |
| | | <el-button type="danger" :icon="Delete" plain>删除</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | ref="multipleTableRef" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Dailog ref="Show"></Dailog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import search from '../targetSettings/component/search.vue' |
| | | import Dailog from './component/Dailog.vue' |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from "vue"; |
| | | import { |
| | | ElMessageBox, |
| | |
| | | } |
| | | import type { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults"; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput,search}, |
| | | components: { ElButton, ElInput,search,Dailog}, |
| | | setup() { |
| | | |
| | | |
| | |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | |
| | | // 打开弹窗 |
| | | const Show=ref() |
| | | const openType=()=>{ |
| | | Show.value.openDailog() |
| | | } |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openType, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="记录" |
| | | width="50%" |
| | | draggable |
| | | > |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column align="center" label="序号" type="index" width="80"/> |
| | | <el-table-column align="center" prop="date" label="责任部门"/> |
| | | <el-table-column align="center" prop="name" label="考核指标"/> |
| | | <el-table-column align="center" prop="address" label="制定部门" /> |
| | | <el-table-column align="center" prop="date" label="制定日期" /> |
| | | <el-table-column align="center" prop="name" label="检查值" /> |
| | | <el-table-column align="center" prop="name" label="检查人" /> |
| | | <el-table-column align="center" prop="address" label="检查时间" /> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" |
| | | >确定</el-button |
| | | > |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent,reactive,ref} from 'vue' |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const dialogVisible = ref(false) |
| | | const tableData=ref() |
| | | const openDailog=(data:any)=>{ |
| | | dialogVisible.value=true |
| | | tableData.value=data |
| | | } |
| | | return{ |
| | | dialogVisible, |
| | | tableData, |
| | | openDailog |
| | | } |
| | | }, |
| | | }) |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-form ref="form" :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="15"> |
| | | <el-form-item label="流程标题"> |
| | | <el-input v-model="form.name" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="15"> |
| | | <el-form-item label="下级审批日期"> |
| | | <el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="15"> |
| | | <el-form-item label=""> |
| | | <el-checkbox-group v-model="form.type" @change="checkbox1"> |
| | | <el-checkbox label="是否抄送" name="1" /> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="false"> |
| | | <el-col :span="15"> |
| | | <el-form-item label="抄送给"> |
| | | <el-input v-model="resource" placeholder=""> |
| | | <template #append> <el-button :icon="Search" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="15"> |
| | | <el-form-item label=""> |
| | | <el-checkbox-group v-model="form.type" @change="checkbox2"> |
| | | <el-checkbox label="指定下一步处理者(不设置就使用默认处理人)" name="1" /> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="false"> |
| | | <el-col :span="15"> |
| | | <el-form-item label="指定"> |
| | | <el-input v-model="desc" placeholder=""> |
| | | <template #append> <el-button :icon="Search" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const form = reactive<any>({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }); |
| | | const resourceShow = ref<boolean>(); |
| | | const descShow = ref<boolean>(); |
| | | const checkbox1 = () => { |
| | | if (form.resource == '1') { |
| | | resourceShow.value = true; |
| | | } else { |
| | | resourceShow.value = false; |
| | | } |
| | | }; |
| | | const checkbox2 = () => { |
| | | if (form.desc == '1') { |
| | | descShow.value = true; |
| | | } else { |
| | | descShow.value = false; |
| | | } |
| | | }; |
| | | return { |
| | | form, |
| | | resourceShow, |
| | | checkbox1, |
| | | checkbox2, |
| | | descShow, |
| | | Search, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .box { |
| | | margin: 30px 0 100px 0; |
| | | background-color: #fff; |
| | | border: 1px solid #dcdfe6; |
| | | box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%); |
| | | padding: 20px; |
| | | } |
| | | .el-row { |
| | | padding: 0 0 20px 0; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <search></search> |
| | | <div class="minCenter"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="检查" name="1"> </el-tab-pane> |
| | | <el-tab-pane label="上报" name="2"></el-tab-pane> |
| | | </el-tabs> |
| | | <el-table ref="multipleTableRef" :data="tableData" style="width: 100%"> |
| | | <el-table-column label="安全目标指标" align="center" sortable> |
| | | <template #default="scope">{{ scope.row.date }}</template> |
| | | </el-table-column> |
| | | <el-table-column property="name" align="center" label="目标指标编号" sortable /> |
| | | <el-table-column property="address" label="年度" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="address" label="指标值" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column v-if="activeName == 1" label="操作" align="center" show-overflow-tooltip> |
| | | <template #default> |
| | | <el-button link type="primary" size="default" :icon="EditPen" @click="jumpFrom">检查</el-button> |
| | | <el-button link type="primary" size="default" :icon="View" @click="openDai(tableData)">记录</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="activeName == 2" label="操作" align="center" show-overflow-tooltip> |
| | | <template #default> |
| | | <el-button link type="primary" size="default" :icon="EditPen" @click="handleClick">上报</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pages"> |
| | | <el-pagination |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[100, 200, 300, 400]" |
| | | :small="small" |
| | | :disabled="disabled" |
| | | :background="background" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="400" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Dailog ref="Show"></Dailog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import search from '../targetSettings/component/search.vue'; |
| | | import Dailog from './component/Dailog.vue' |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { Plus, Delete, Upload, Download, Refresh, View,EditPen} from '@element-plus/icons-vue'; |
| | | import {useRouter} from "vue-router" |
| | | interface User { |
| | | date: string; |
| | | name: string; |
| | | address: string; |
| | | } |
| | | import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput, search,Dailog }, |
| | | setup() { |
| | | // 下方导航与表格 |
| | | const activeName = ref('1'); |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | console.log(tab, event); |
| | | }; |
| | | const formatter = (row: User, column: TableColumnCtx<User>) => { |
| | | return row.address; |
| | | }; |
| | | |
| | | const tableData: User[] = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-02', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-04', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-01', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-08', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-06', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | { |
| | | date: '2016-05-07', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | const currentPage4 = ref(4); |
| | | const pageSize4 = ref(100); |
| | | const small = ref(false); |
| | | const disabled = ref(false); |
| | | const background = ref(false); |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | // 记录弹窗 |
| | | const Show=ref() |
| | | const openDai=(data:any)=>{ |
| | | Show.value.openDailog(data) |
| | | } |
| | | // 流程表单 |
| | | const router=useRouter() |
| | | const jumpFrom=()=>{ |
| | | router.push({ |
| | | path:"/processForms" |
| | | }) |
| | | } |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | formatter, |
| | | currentPage4, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | small, |
| | | disabled, |
| | | background, |
| | | Show, |
| | | openDai, |
| | | router, |
| | | jumpFrom, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .minCenter { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | padding: 0 20px; |
| | | } |
| | | .btns { |
| | | padding: 0px 0px 10px 0px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .pages { |
| | | padding: 20px 0; |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <h4 class="title">胡海涛2022-07-01 16:08:42发起了目标检查上报(检查)--检查</h4> |
| | | <div class="box"> |
| | | <el-menu |
| | | :default-active="activeIndex" |
| | | class="el-menu-demo" |
| | | background-color="#fff" |
| | | text-color="#fff" |
| | | active-text-color="#fff" |
| | | mode="horizontal" |
| | | @select="handleSelect" |
| | | > |
| | | <el-menu-item index="1">表单信息</el-menu-item> |
| | | <el-menu-item index="2">流程图</el-menu-item> |
| | | </el-menu> |
| | | <div v-if="activeIndex == 1" class="navType"> |
| | | <el-form ref="form" :model="form" label-width="120px"> |
| | | <el-row style="padding: 20px"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="安全目标指标"> |
| | | <el-input v-model="name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="目标指标编号"> |
| | | <el-input v-model="name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row style="padding: 20px"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="年度"> |
| | | <el-input v-model="name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="指标值"> |
| | | <el-input v-model="name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-tabs v-model="activeName" style="padding: 0 20px"> |
| | | <el-tab-pane label="考核指标" name="1"> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column align="center" type="index" label="序号" width="70" /> |
| | | <el-table-column align="center" prop="date" label="责任部门" /> |
| | | <el-table-column align="center" prop="name" label="考核指标" /> |
| | | <el-table-column align="center" prop="address" label="制定部门" /> |
| | | <el-table-column align="center" prop="address" label="制定日期" /> |
| | | <el-table-column align="center" label="检查值"> |
| | | <template #default> |
| | | <el-input v-model="address" placeholder=""></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="address" label="检查人" /> |
| | | <el-table-column align="center" prop="address" label="检查时间" /> |
| | | </el-table> |
| | | <div class="tiao"> |
| | | <div class="typeS">审批</div> |
| | | </div> |
| | | <el-row style="padding:20px 0"> |
| | | <el-col :span="6" style="text-align:right">一级审批:</el-col> |
| | | <el-col :span="18">同意</el-col> |
| | | </el-row> |
| | | <el-row style="padding:0 0 20px 0"> |
| | | <el-col :span="6"></el-col> |
| | | <el-col :span="18"><span class="logoColor">同意</span><span style="margin-right: 8px;">杜建喜</span><span>2021-05-24 04:47:42</span></el-col> |
| | | </el-row> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | <div v-if="activeIndex == 2" class="navType">cccccccc</div> |
| | | </div> |
| | | <lowerPlate></lowerPlate> |
| | | <div class="btns"> |
| | | <el-button type="primary">发起上报</el-button> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, reactive, ref } from 'vue'; |
| | | import lowerPlate from './component/lowerPlate.vue' |
| | | export default defineComponent({ |
| | | components:{lowerPlate}, |
| | | setup() { |
| | | const activeIndex = ref('1'); |
| | | const handleSelect = (key: string, keyPath: string[]) => { |
| | | // console.log(key, keyPath); |
| | | activeIndex.value = key; |
| | | }; |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | }); |
| | | const activeName = ref('1'); |
| | | const tableData = [ |
| | | { |
| | | date: '2016-05-03', |
| | | name: 'Tom', |
| | | address: 'No. 189, Grove St, Los Angeles', |
| | | }, |
| | | ]; |
| | | return { |
| | | activeIndex, |
| | | handleSelect, |
| | | form, |
| | | activeName, |
| | | tableData |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .title { |
| | | text-align: center; |
| | | font-size: 16px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .box{ |
| | | border: 1px solid #dcdfe6; |
| | | box-shadow: 0 2px 4px 0 rgb(0 0 0 / 12%), 0 0 6px 0 rgb(0 0 0 / 4%); |
| | | } |
| | | .navType { |
| | | background-color: #fff; |
| | | } |
| | | .tiao{ |
| | | width: 100%; |
| | | height: 1px; |
| | | background-color: #dcdfe6; |
| | | margin: 30px 0 ; |
| | | position: relative; |
| | | } |
| | | .typeS{ |
| | | width: 80px; |
| | | background-color: #fff; |
| | | position: absolute; |
| | | left: 30px; |
| | | top: -9px; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | } |
| | | .logoColor{ |
| | | background-color: #67c23a; |
| | | color: #fff; |
| | | padding: 5px 8px; |
| | | border-radius: 5px; |
| | | margin-right: 5px; |
| | | } |
| | | .btns{ |
| | | width: 100%; |
| | | padding:20px 0; |
| | | background-color: #fff; |
| | | position: fixed; |
| | | bottom: 0px; |
| | | left: 0px; |
| | | text-align: center; |
| | | box-shadow: 0 -3px 5px 0 rgb(0 0 0 / 12%); |
| | | |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-dialog v-model="Shows" title="新建目标设定" width="50%"> |
| | | <el-dialog v-model="Shows" title="新建目标设定" width="50%" draggable> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="Shows = false">关闭</el-button> |
| | | <el-button type="primary" @click="Shows = false" |
| | | <el-button @click="Shows = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="Shows = false" size="default" |
| | | >确定</el-button |
| | | > |
| | | </span> |
| | |
| | | FormInstance, |
| | | } from "element-plus"; |
| | | export default defineComponent({ |
| | | props: { dialogVisible: Boolean}, |
| | | setup(props) { |
| | | let Shows=ref(false) |
| | | const form = reactive({ |
| | |
| | | resource: "", |
| | | desc: "", |
| | | }) |
| | | // 打开弹窗 |
| | | const openDialog = (type:string,value:any,projectList: any,projectId:string) => { |
| | | Shows.value=true |
| | | } |
| | | return { |
| | | props, |
| | | openDialog, |
| | | Shows, |
| | | form, |
| | | }; |
| | |
| | | v-model="dialogVisible" |
| | | title="导入Excel" |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | draggable |
| | | > |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import type { UploadProps, UploadUserFile } from "element-plus"; |
| | | export default defineComponent({ |
| | | props:{updata:Boolean}, |
| | | setup(props) { |
| | | let dialogVisible =ref<boolean>(props.updata) |
| | | setup() { |
| | | let dialogVisible =ref<boolean>(false) |
| | | const fileList = ref<UploadUserFile[]>([ |
| | | { |
| | | name: "element-plus-logo.svg", |
| | |
| | | () => false |
| | | ); |
| | | }; |
| | | // 打开弹窗 |
| | | const openDialog = (type:string,value:any,projectList: any,projectId:string) => { |
| | | dialogVisible.value=true |
| | | } |
| | | return { |
| | | dialogVisible, |
| | | fileList, |
| | |
| | | handlePreview, |
| | | handleExceed, |
| | | beforeRemove, |
| | | props |
| | | openDialog |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | > |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button type="primary" :icon="Plus" @click="openDai">新建</el-button> |
| | | <el-button type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <el-button type="danger" :icon="Delete">删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | ref="multipleTableRef" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default> |
| | | <el-button link type="primary" size="small" :icon="View" @click="handleClick" |
| | | <el-button link type="primary" size="default" :icon="View" @click="handleClick" |
| | | >查看</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="Delete">删除</el-button> |
| | | <el-button link type="primary" size="default" :icon="Delete">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <dailogAdd :dialogVisible="Show"></dailogAdd> |
| | | <upData :updata="upShow"></upData> |
| | | <dailogAdd ref="openAdd"></dailogAdd> |
| | | <upData ref="upShow"></upData> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | |
| | | ]; |
| | | const currentPage4 = ref(4); |
| | | const pageSize4 = ref(100); |
| | | const small = ref(false) |
| | | const disabled = ref(false) |
| | | const background = ref(false) |
| | | const handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | // 弹窗 |
| | | let Show=ref(false) |
| | | let openDai=()=>{ |
| | | Show.value=true |
| | | } |
| | | const openAdd=ref() |
| | | const openD=(type:String,value:any)=>{ |
| | | openAdd.value.openDialog(type,value) |
| | | } |
| | | |
| | | // 上传 |
| | | const upShow=ref(false) |
| | | const upShow=ref() |
| | | const upButton=()=>{ |
| | | upShow.value=true |
| | | upShow.value.openDialog() |
| | | } |
| | | return { |
| | | activeName, |
| | |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openDai, |
| | | openAdd, |
| | | openD, |
| | | upShow, |
| | | upButton, |
| | | small, |
| | | disabled, |
| | | background, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | |
| | | <div class="minCenter"> |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button type="primary" :icon="Plus" @click="openDai">新建</el-button> |
| | | <el-button type="warning" :icon="EditPen" plain @click="openDai">修改</el-button> |
| | | <el-button type="primary" :icon="Plus" @click="openType">新建</el-button> |
| | | <el-button type="warning" :icon="EditPen" plain >修改</el-button> |
| | | <el-button type="danger" :icon="Delete" plain>删除</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Dailog ref="Show"></Dailog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import search from '../targetSettings/component/search.vue' |
| | | import Dailog from '../targetDecompositionYear/component/Dailog.vue' |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from "vue"; |
| | | import { |
| | | ElMessageBox, |
| | |
| | | } |
| | | import type { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults"; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput,search}, |
| | | components: { ElButton, ElInput,search,Dailog}, |
| | | setup() { |
| | | |
| | | |
| | |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | |
| | | // 打开弹窗 |
| | | const Show=ref() |
| | | const openType=()=>{ |
| | | Show.value.openDailog() |
| | | } |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openType, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
对比新文件 |
| | |
| | | <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> |