From ac7d9e20978e710a54164b2e74ea464027754b7e Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: Tue, 02 Aug 2022 09:09:57 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/gtqt
---
src/views/specialWorkSystem/approveProcessManagement/approveLinkSettings/approveLinkSetting/index.vue | 346 ++++++++++++++++++++++++++++-----------------------------
1 files changed, 168 insertions(+), 178 deletions(-)
diff --git a/src/views/specialWorkSystem/approveProcessManagement/approveLinkSettings/approveLinkSetting/index.vue b/src/views/specialWorkSystem/approveProcessManagement/approveLinkSettings/approveLinkSetting/index.vue
index f1b1bbc..242b17e 100644
--- a/src/views/specialWorkSystem/approveProcessManagement/approveLinkSettings/approveLinkSetting/index.vue
+++ b/src/views/specialWorkSystem/approveProcessManagement/approveLinkSettings/approveLinkSetting/index.vue
@@ -1,12 +1,11 @@
<template>
<div class="home-container">
- <el-scrollbar height="100%">
+ <div style="height: 100%">
<div class="homeCard">
<div class="main-card">
<el-row class="cardTop">
<el-col :span="12" class="mainCardBtn">
<el-button type="primary" :icon="Plus" size="default" @click="dialogAddRecord=true">新建审批环节</el-button>
-<!-- <el-button type="warning" :icon="Edit" size="default" plain>修改</el-button>-->
<el-button type="danger" :icon="Delete" size="default" plain>删除</el-button>
</el-col>
<el-button type="primary" :icon="Refresh" size="default"/>
@@ -15,6 +14,7 @@
ref="multipleTableRef"
:data="tableData"
style="width: 100%"
+ height="calc(100% - 100px)"
:header-cell-style="{background: '#fafafa'}"
@selection-change="handleSelectionChange"
>
@@ -34,22 +34,22 @@
</template>
</el-table-column>
</el-table>
- </div>
- <div class="pageBtn">
- <el-pagination
- v-model:currentPage="currentPage"
- v-model:page-size="pageSize"
- :page-sizes="[10, 15]"
- small=false
- background
- layout="total, sizes, prev, pager, next, jumper"
- :total="100"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
+ <div class="pageBtn">
+ <el-pagination
+ v-model:currentPage="currentPage"
+ v-model:page-size="pageSize"
+ :page-sizes="[10, 15]"
+ small=false
+ background
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="100"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ />
+ </div>
</div>
</div>
- </el-scrollbar>
+ </div>
<el-dialog v-model="dialogDetails" title="审批环节">
<el-form :model="details" label-width="120px">
<el-form-item label="环节名称">
@@ -142,147 +142,171 @@
interface type {
}
- // export default defineComponent({
- // name: 'workCheckinRecord',
- // setup() {
- const userInfo = useUserInfo()
- const { userInfos } = storeToRefs(userInfo);
- const state = reactive<stateType>({});
- const currentPage = ref(1)
- const pageSize = ref(10)
- const chosenIndex = ref(-1)
- const handleSizeChange = (val: number) => {
- console.log(`${val} items per page`)
- }
- const handleCurrentChange = (val: number) => {
- console.log(`current page: ${val}`)
- }
- const tableData = reactive(
- [
- {
- processName: '作业负责人审批',
- approveType: '上报审批意见',
- creater: '李四',
- createTime: '2021-04-22 15:21:31',
- updater: '吴海涛',
- updateTime: '2022-04-22 15:21:31',
- },
- {
- processName: '作业负责人审批',
- approveType: '上报气体检测数据',
- creater: '李四',
- createTime: '2021-04-22 15:21:31',
- updater: '吴海涛',
- updateTime: '2022-04-22 15:21:31',
- },
- ]
- )
- const timeForm = {
- hour12: false,
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- hour: '2-digit',
- minute: '2-digit',
- second: '2-digit'
- }
- const addRef = ref<FormInstance>()
- const addRules = reactive<FormRules>({
- processName:[{required: true, message: '该内容不能为空',trigger:'blur'}],
- approveType:[{required: true, message: '该内容不能为空',trigger:'blur'}]
- })
- const dialogDetails = ref(false)
- const dialogAddRecord = ref(false)
- const deleteDialog = ref(false)
- const addRecord = ref({})
- const details = ref({})
- const viewRecord = (row) =>{
- details.value = JSON.parse(JSON.stringify(row))
- dialogDetails.value = true
- }
- const deleteRecord = (index) =>{
- chosenIndex.value = index
- deleteDialog.value = true
- }
- const conFirmDelete = ()=> {
- tableData.splice(chosenIndex.value,1)
- deleteDialog.value = false
- }
- const confirmAddRecord = async (formEl: FormInstance | undefined) =>{
- if (!formEl) return
- await formEl.validate((valid, fields) => {
- if (valid) {
- if(chosenIndex.value == -1){
- addRecord.value.createTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
- addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
- tableData.push(addRecord.value)
- }else{
- addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
- tableData[chosenIndex.value] = addRecord.value
- }
- dialogAddRecord.value =false
- } else {
- console.log('error submit!', fields)
- }
- })
+ const userInfo = useUserInfo()
+ const { userInfos } = storeToRefs(userInfo);
+ // 分页
+ const currentPage = ref(1)
+ const pageSize = ref(10)
+
+ const handleSizeChange = (val: number) => {
+ console.log(`${val} items per page`)
+ }
+ const handleCurrentChange = (val: number) => {
+ console.log(`current page: ${val}`)
+ }
+
+ // 判断新增和修改
+ const chosenIndex = ref(-1)
+
+ const tableData = reactive(
+ [
+ {
+ processName: '作业负责人审批',
+ approveType: '上报审批意见',
+ creater: '李四',
+ createTime: '2021-04-22 15:21:31',
+ updater: '吴海涛',
+ updateTime: '2022-04-22 15:21:31',
+ },
+ {
+ processName: '作业负责人审批',
+ approveType: '上报气体检测数据',
+ creater: '李四',
+ createTime: '2021-04-22 15:21:31',
+ updater: '吴海涛',
+ updateTime: '2022-04-22 15:21:31',
+ },
+ ]
+ )
+
+ // 时间格式化
+ const timeForm = {
+ hour12: false,
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit'
+ }
+
+ const addRef = ref<FormInstance>()
+ const addRules = reactive<FormRules>({
+ processName:[{required: true, message: '该内容不能为空',trigger:'blur'}],
+ approveType:[{required: true, message: '该内容不能为空',trigger:'blur'}]
+ })
+ const dialogDetails = ref(false)
+ const dialogAddRecord = ref(false)
+ const deleteDialog = ref(false)
+ const addRecord = ref({})
+ const details = ref({})
+
+ // 查看记录
+ const viewRecord = (row) =>{
+ details.value = JSON.parse(JSON.stringify(row))
+ dialogDetails.value = true
+ }
+
+ // 删除记录
+ const deleteRecord = (index) =>{
+ chosenIndex.value = index
+ deleteDialog.value = true
+ }
+ const conFirmDelete = ()=> {
+ tableData.splice(chosenIndex.value,1)
+ deleteDialog.value = false
+ }
+
+ // 新增修改记录
+ const confirmAddRecord = async (formEl: FormInstance | undefined) =>{
+ if (!formEl) return
+ await formEl.validate((valid, fields) => {
+ if (valid) {
+ if(chosenIndex.value == -1){
+ addRecord.value.createTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
+ addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
+ tableData.unshift(addRecord.value)
+ }else{
+ addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-')
+ tableData[chosenIndex.value] = addRecord.value
+ }
+ dialogAddRecord.value =false
+ } else {
+ console.log('error submit!', fields)
}
- const closeAdd =()=>{
- addRecord.value={}
- chosenIndex.value = -1
- }
- const indexClear = ()=>{
- chosenIndex.value = -1
- }
- const editRecord =(index, row)=>{
- dialogAddRecord.value = true
- chosenIndex.value = index
- addRecord.value = JSON.parse(JSON.stringify(row))
- }
- // 折线图
- const renderMenu = async (value: string) => {
- Session.set('projectId',value)
- userInfos.value.projectId = value
- await initBackEndControlRoutes();
- };
- // return {
- // renderMenu,
- // multipleTableRef,
- // tableData,
- // currentPage,
- // pageSize,
- // dialogDetails,
- // details,
- // deleteDialog,
- // dialogAddRecord,
- // viewRecord,
- // deleteRecord,
- // handleSizeChange,
- // handleCurrentChange,
- // Plus,
- // Edit,
- // Delete,
- // Search,
- // Download,
- // handleSelectionChange,
- // Refresh,
- // ...toRefs(state),
- // };
- // },
- // });
+ })
+
+ }
+
+ // 编辑弹窗关闭时数据初始化处理
+ const closeAdd =()=>{
+ addRecord.value={}
+ chosenIndex.value = -1
+ }
+ const indexClear = ()=>{
+ chosenIndex.value = -1
+ }
+
+ // 修改记录
+ const editRecord =(index, row)=>{
+ dialogAddRecord.value = true
+ chosenIndex.value = index
+ addRecord.value = JSON.parse(JSON.stringify(row))
+ }
+ // 折线图
+ const renderMenu = async (value: string) => {
+ Session.set('projectId',value)
+ userInfos.value.projectId = value
+ await initBackEndControlRoutes();
+ };
</script>
<style scoped lang="scss">
$homeNavLengh: 8;
.home-container {
- height: 100%;
+ height: calc(100vh - 114px);
+ box-sizing: border-box;
overflow: hidden;
- padding: 20px;
+
.homeCard{
width: 100%;
padding: 20px;
+ box-sizing: border-box;
background: #fff;
border-radius: 4px;
+
+ .main-card{
+ width: 100%;
+ height: 100%;
+ .cardTop{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 20px;
+ .mainCardBtn{
+ margin: 0;
+ }
+ }
+ .pageBtn{
+ height: 60px;
+ display: flex;
+ align-items: center;
+ justify-content: right;
+
+ .demo-pagination-block + .demo-pagination-block {
+ margin-top: 10px;
+ }
+ .demo-pagination-block .demonstration {
+ margin-bottom: 16px;
+ }
+ }
+ }
+
+ &:last-of-type{
+ height: 100%;
+ }
+
}
.el-row{
display: flex;
@@ -308,40 +332,6 @@
}
}
}
- .mainPages{
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .main-card{
- width: 100%;
- .cardTop{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 20px;
- .mainCardBtn{
- margin: 0;
- }
- }
- }
- .pageBtn{
- display: flex;
- align-items: center;
- justify-content: right;
- margin-top: 20px;
-
- .demo-pagination-block + .demo-pagination-block {
- margin-top: 10px;
- }
- .demo-pagination-block .demonstration {
- margin-bottom: 16px;
- }
- }
- }
- .el-input{
- width: 100% !important;
}
.el-date-editor::v-deep{
width: 100%;
--
Gitblit v1.9.2