Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqtOut
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-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 UserState { |
| | | isShowDialog: boolean; |
| | | ruleForm: { |
| | | userName: string; |
| | | userNickname: string; |
| | | roleSign: string; |
| | | department: any; |
| | | phone: string; |
| | | email: string; |
| | | sex: string; |
| | | password: string; |
| | | overdueTime: string; |
| | | status: boolean; |
| | | describe: string; |
| | | }; |
| | | deptData: Array<DeptData>; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'systemAddUser', |
| | | setup() { |
| | | const state = reactive<UserState>({ |
| | | isShowDialog: false, |
| | | ruleForm: { |
| | | userName: '', // 账户名称 |
| | | userNickname: '', // 用户昵称 |
| | | roleSign: '', // 关联角色 |
| | | department: [], // 部门 |
| | | phone: '', // 手机号 |
| | | email: '', // 邮箱 |
| | | sex: '', // 性别 |
| | | password: '', // 账户密码 |
| | | overdueTime: '', // 账户过期 |
| | | status: true, // 用户状态 |
| | | describe: '', // 用户描述 |
| | | }, |
| | | deptData: [], // 部门数据 |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = () => { |
| | | 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> |
| | |
| | | <template> |
| | | |
| | | <div class="system-user-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <el-input size="default" placeholder="队伍名称" style="max-width: 215px;"> </el-input> |
| | | <el-select size="default" v-model="value" placeholder="请选择队伍级别" class="ml10" style="max-width: 215px;"> |
| | | <el-option label="公司" value="shanghai"></el-option> |
| | | <el-option label="分厂-车间" value="beijing"></el-option> |
| | | <el-option label="工序-班组等" value="beijing"></el-option> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in options"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value"--> |
| | | <!-- />--> |
| | | </el-select> |
| | | <el-button size="default" type="primary" class="ml10"> |
| | | 查询 |
| | | </el-button> |
| | | <el-button size="default" class="ml10" @click="submitReset"> |
| | | 重置 |
| | | </el-button> |
| | | </div> |
| | | <div class="button_Line"> |
| | | <div class="button_Left"> |
| | | <el-button type="primary" @click="onOpenAdd"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>新建 |
| | | </el-button> |
| | | <el-button type="warning" plain disabled> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button type="danger" plain disabled> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | | </el-button> |
| | | </div> |
| | | <div class="button_Right"> |
| | | <el-button> |
| | | <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.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="userName" label="队伍名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userNickname" label="队伍级别" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="roleSign" label="队伍描述" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="phone" label="负责人手机" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="email" label="相关附件" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="200" align="center"> |
| | | <template #default="scope"> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenLink(scope.row)"> |
| | | <el-icon style="margin-right: 5px;"> |
| | | <View /> |
| | | </el-icon>查看 |
| | | </el-button> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenEditUser(scope.row)"> |
| | | <el-icon style="margin-right: 5px;"> |
| | | <EditPen /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)"> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon>删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination |
| | | @size-change="onHandleSizeChange" |
| | | @current-change="onHandleCurrentChange" |
| | | class="mt15" |
| | | :pager-count="5" |
| | | :page-sizes="[10, 20, 30]" |
| | | v-model:current-page="tableData.param.pageNum" |
| | | background |
| | | v-model:page-size="tableData.param.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="tableData.total" |
| | | > |
| | | </el-pagination> |
| | | </el-card> |
| | | <OpenLink ref="openLinRef" /> |
| | | <EditUser ref="editUserRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "index" |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import { Plus, |
| | | Edit, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen, |
| | | } from '@element-plus/icons-vue' |
| | | import AddUer from '/@/views/system/user/component/addUser.vue'; |
| | | import EditUser from '/@/views/system/user/component/editUser.vue'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | userName: string; |
| | | userNickname: string; |
| | | roleSign: string; |
| | | department: string[]; |
| | | phone: string; |
| | | email: string; |
| | | sex: string; |
| | | password: string; |
| | | overdueTime: Date; |
| | | describe: string; |
| | | createTime: string; |
| | | } |
| | | interface TableDataState { |
| | | tableData: { |
| | | data: Array<TableDataRow>; |
| | | total: number; |
| | | loading: boolean; |
| | | param: { |
| | | pageNum: number; |
| | | pageSize: number; |
| | | }; |
| | | }; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'systemUser', |
| | | components: { AddUer, EditUser, View, EditPen, Plus, Edit, Delete, Upload, Download, Refresh }, |
| | | setup() { |
| | | const addUserRef = ref(); |
| | | const editUserRef = ref(); |
| | | const openLinRef = ref(); |
| | | // 选择框 |
| | | // const value = ref(''); |
| | | // const options = |
| | | // { |
| | | // value: 'Option1', |
| | | // label: 'Option1', |
| | | // }; |
| | | const state = reactive<TableDataState>({ |
| | | tableData: { |
| | | data: [], |
| | | total: 0, |
| | | loading: false, |
| | | param: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }, |
| | | }, |
| | | }); |
| | | // 初始化表格数据 |
| | | // const initTableData = () => [ |
| | | // { |
| | | // userName: '消防抢险组(部门级)', |
| | | // userNickname: '分厂-车间', |
| | | // roleSign: 'No. 189, Grove St, Los Angeles', |
| | | // phone: '11', |
| | | // email: 'ce', |
| | | // }, |
| | | // ] |
| | | const initTableData = () => { |
| | | const data: Array<TableDataRow> = []; |
| | | for (let i = 0; i < 2; i++) { |
| | | data.push({ |
| | | userName: i === 0 ? 'admin' : 'test', |
| | | userNickname: i === 0 ? '我是管理员' : '我是普通用户', |
| | | roleSign: i === 0 ? 'admin' : 'common', |
| | | department: i === 0 ? ['vueNextAdmin', 'IT外包服务'] : ['vueNextAdmin', '资本控股'], |
| | | phone: '12345678910', |
| | | email: 'vueNextAdmin@123.com', |
| | | sex: '女', |
| | | password: '123456', |
| | | overdueTime: new Date(), |
| | | describe: i === 0 ? '不可删除' : '测试用户', |
| | | createTime: new Date().toLocaleString(), |
| | | }); |
| | | } |
| | | state.tableData.data = data; |
| | | state.tableData.total = state.tableData.data.length; |
| | | }; |
| | | //查看用户弹窗 |
| | | const OpenLink = () => { |
| | | openLinRef.value.openDialog(); |
| | | }; |
| | | // 打开新增用户弹窗 |
| | | const onOpenAddUser = () => { |
| | | addUserRef.value.openDialog(); |
| | | }; |
| | | // 打开修改用户弹窗 |
| | | const onOpenEditUser = (row: TableDataRow) => { |
| | | editUserRef.value.openDialog(row); |
| | | }; |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除账户名称:“${row.userName}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | ElMessage.success('删除成功'); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.tableData.param.pageSize = val; |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.tableData.param.pageNum = val; |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initTableData(); |
| | | }); |
| | | return { |
| | | // value, |
| | | // options, |
| | | addUserRef, |
| | | editUserRef, |
| | | OpenLink, |
| | | openLinRef, |
| | | onOpenAddUser, |
| | | onOpenEditUser, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | <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; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <search></search> |
| | | <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="danger" :icon="Delete" plain>删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table |
| | | ref="multipleTableRef" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | align="center" |
| | | type="index" |
| | | width="70" |
| | | /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <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 |
| | | label="操作" |
| | | align="center" |
| | | sortable |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default> |
| | | <el-button link type="primary" size="small" :icon="View" @click="handleClick" |
| | | >查看</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="EditPen" @click="handleClick" |
| | | >修改</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="Delete">删除</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> |
| | | </template> |
| | | <script lang="ts"> |
| | | import search from '../targetSettings/component/search.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"; |
| | | 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}, |
| | | 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 handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | formatter, |
| | | currentPage4, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | 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> |
| | | <el-dialog v-model="Shows" title="新建目标设定" width="50%"> |
| | | <el-form :model="form" label-width="120px"> |
| | | <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-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-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="指标级别"> |
| | | <el-select |
| | | v-model="form.region" |
| | | placeholder="please select your zone" |
| | | 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" |
| | | placeholder="Pick a date" |
| | | width="100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-form-item label="备注信息"> |
| | | <el-input v-model="form.desc" type="textarea" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="Shows = false">关闭</el-button> |
| | | <el-button type="primary" @click="Shows = false" |
| | | >确定</el-button |
| | | > |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { ref, toRefs, reactive, onMounted,watch,defineComponent } from "vue"; |
| | | import { |
| | | ElMessageBox, |
| | | ElMessage, |
| | | ElButton, |
| | | ElInput, |
| | | TabsPaneContext, |
| | | FormInstance, |
| | | } from "element-plus"; |
| | | export default defineComponent({ |
| | | props: { dialogVisible: Boolean}, |
| | | setup(props) { |
| | | let Shows=ref(false) |
| | | const form = reactive({ |
| | | name: "", |
| | | region: "", |
| | | date1: "", |
| | | date2: "", |
| | | delivery: false, |
| | | type: [], |
| | | resource: "", |
| | | desc: "", |
| | | }) |
| | | return { |
| | | props, |
| | | Shows, |
| | | form, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-row{ |
| | | padding:0 0 20px 0; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" status-icon label-width="20px" class="topTitle"> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.pass" placeholder="安全目标指标" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.checkPass" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <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> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { ref, reactive, defineComponent } from 'vue'; |
| | | import { |
| | | FormInstance, |
| | | } from "element-plus"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pass: '', |
| | | checkPass: '', |
| | | }); |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | console.log(!formEl); |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | return { |
| | | ruleForm, |
| | | resetForm |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .topTitle { |
| | | background-color: #fff; |
| | | padding: 20px 0px 20px 0px; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="导入Excel" |
| | | width="50%" |
| | | :before-close="handleClose" |
| | | > |
| | | <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>下载模板</el-button> |
| | | <el-button 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,toRefs, reactive,defineComponent,computed } from "vue"; |
| | | 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) |
| | | 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 |
| | | ); |
| | | }; |
| | | return { |
| | | dialogVisible, |
| | | fileList, |
| | | handleRemove, |
| | | handlePreview, |
| | | handleExceed, |
| | | beforeRemove, |
| | | props |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <search></search> |
| | | <div class="minCenter"> |
| | | <el-tabs |
| | | v-model="activeName" |
| | | class="demo-tabs" |
| | | @tab-click="handleClick" |
| | | > |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button type="primary" :icon="Plus" @click="openDai">新建</el-button> |
| | | <el-button type="danger" :icon="Delete">删除</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button :icon="Upload" @click="upButton"></el-button> |
| | | <el-button :icon="Download"></el-button> |
| | | <el-button :icon="Refresh"></el-button> |
| | | </div> |
| | | </div> |
| | | <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%" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | align="center" |
| | | type="index" |
| | | width="70" |
| | | /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <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 |
| | | property="address" |
| | | label="指标级别" |
| | | align="center" |
| | | sortable |
| | | show-overflow-tooltip |
| | | /> |
| | | <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 |
| | | property="address" |
| | | label="备注信息" |
| | | align="center" |
| | | sortable |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | sortable |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default> |
| | | <el-button link type="primary" size="small" :icon="View" @click="handleClick" |
| | | >查看</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="Delete">删除</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> |
| | | <dailogAdd :dialogVisible="Show"></dailogAdd> |
| | | <upData :updata="upShow"></upData> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import dailogAdd from './component/dailogAdd.vue' |
| | | import upData from './component/updata.vue' |
| | | import search from './component/search.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 |
| | | } from "@element-plus/icons-vue"; |
| | | 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,dailogAdd,upData,search}, |
| | | 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 handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | // 弹窗 |
| | | let Show=ref(false) |
| | | let openDai=()=>{ |
| | | Show.value=true |
| | | } |
| | | // 上传 |
| | | const upShow=ref(false) |
| | | const upButton=()=>{ |
| | | upShow.value=true |
| | | } |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | formatter, |
| | | currentPage4, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openDai, |
| | | upShow, |
| | | upButton, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View |
| | | }; |
| | | }, |
| | | }); |
| | | </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> |
| | | <search></search> |
| | | <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="danger" :icon="Delete" plain>删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table |
| | | ref="multipleTableRef" |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | | label="序号" |
| | | align="center" |
| | | type="index" |
| | | width="70" |
| | | /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <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 |
| | | label="操作" |
| | | align="center" |
| | | sortable |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default> |
| | | <el-button link type="primary" size="small" :icon="View" @click="handleClick" |
| | | >查看</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="EditPen" @click="handleClick" |
| | | >修改</el-button |
| | | > |
| | | <el-button link type="primary" size="small" :icon="Delete">删除</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> |
| | | </template> |
| | | <script lang="ts"> |
| | | import search from '../targetSettings/component/search.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"; |
| | | 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}, |
| | | 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 handleSizeChange = (val: number) => { |
| | | console.log(`${val} items per page`); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | console.log(`current page: ${val}`); |
| | | }; |
| | | |
| | | return { |
| | | activeName, |
| | | handleClick, |
| | | tableData, |
| | | formatter, |
| | | currentPage4, |
| | | pageSize4, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | 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> |