1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

去除所有组件的动态操作按钮,改为自定义按钮

This commit is contained in:
dengfuchuan 2021-06-22 15:51:00 +08:00
parent 8ec6784ce7
commit c37f48ee90
19 changed files with 163 additions and 63 deletions

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-button v-for="d in data" :key="d.method" type="primary" @click="Fn(d.method)">{{ d.text }}</el-button>
<el-button v-for="d in data" :key="d.method" type="primary" @click="Fn(d.method)">{{ d.text }}{{ d.method }}</el-button>
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-button v-for="d in data" :key="d.method" type="primary" @click="Fn(d.method)">{{ d.text }}</el-button>
<el-button v-for="d in data" :key="d.method" type="primary" @click="Fn(d.method)">{{ d.text }}{{ d.method }}</el-button>
</div>
</template>

View File

@ -2,7 +2,12 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -158,14 +163,12 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
import { parseDay } from '@/utils/index'
export default {
name: 'HiddenCheckCreateForm',
components: {
buttons,
SelUser,
SelDept
},
@ -258,6 +261,11 @@ export default {
}
})
},
create() {},
del() {},
audit() {},
unaudit() {},
upload() {},
onSubmit() {},
getCheckMan(data) {
this.form.hidden_danger__check_man = data.sys_user__user_name
@ -361,6 +369,7 @@ export default {
}
.buttons {
display: flex;
margin-bottom: 20px;
.el-button--primary {
margin-left: 10px;
height: 26.8px;

View File

@ -2,7 +2,12 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" @upload="upload" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -172,7 +177,6 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
import ShowImages from '@/components/show_images'
@ -180,7 +184,6 @@ import Attach from '@/components/sys_attach'
export default {
name: 'HiddenCheckAuditForm',
components: {
buttons,
SelUser,
SelDept,
ShowImages,
@ -274,6 +277,10 @@ export default {
}
})
},
create() {},
del() {},
audit() {},
unaudit() {},
upload() {
this.dialogUploadVisible = true
},
@ -383,6 +390,7 @@ export default {
}
.buttons {
display: flex;
margin-bottom: 20px;
.el-button--primary {
margin-left: 10px;
height: 26.8px;

View File

@ -2,7 +2,10 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="hidden_check" @Create="editCreate" @Del="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
</div>
<Search funid="hidden_check" @search="search" />
</div>
@ -81,14 +84,12 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import Attach from '@/components/sys_attach'
import { parseDay } from '@/utils/index'
export default {
name: 'HiddenCheck',
components: {
buttons,
Search,
Attach
},
@ -253,11 +254,13 @@ export default {
}
})
},
editCreate() {
create() {
const param = `/hidden_danger/hidden_check/create`
this.$router.push(param)
},
Delete(row) {
audit() {},
unaudit() {},
del(row) {
this.ids = []
this.ids.push(row.hidden_danger__hidden_danger_id)
this.editDelete()

View File

@ -2,7 +2,13 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -158,13 +164,11 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
export default {
name: 'HiddenReformCreateForm',
components: {
buttons,
SelUser,
SelDept
},
@ -241,6 +245,11 @@ export default {
}
})
},
create() {},
del() {},
audit() {},
unaudit() {},
upload() {},
onSubmit() {},
getCheckMan(data) {
this.form.hidden_danger__check_man = data.sys_user__user_name
@ -347,6 +356,7 @@ export default {
}
.buttons {
display: flex;
margin-bottom: 20px;
.el-button--primary {
margin-left: 10px;
height: 26.8px;

View File

@ -2,7 +2,9 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" @upload="upload" />
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -206,7 +208,6 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
import ShowImages from '@/components/show_images'
@ -214,7 +215,6 @@ import Attach from '@/components/sys_attach'
export default {
name: 'HiddenReformAuditForm',
components: {
buttons,
SelUser,
SelDept,
ShowImages,
@ -298,6 +298,8 @@ export default {
}
})
},
audit() {},
unaudit() {},
upload() {
this.dialogUploadVisible = true
},
@ -407,6 +409,7 @@ export default {
}
.buttons {
display: flex;
margin-bottom: 20px;
.el-button--primary {
margin-left: 10px;
height: 26.8px;

View File

@ -2,7 +2,8 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="hidden_reform" @Create="editCreate" @Del="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
</div>
<Search funid="hidden_reform" @search="search" />
</div>
@ -77,14 +78,12 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import Attach from '@/components/sys_attach'
import { parseDay } from '@/utils/index'
export default {
name: 'HiddenReform',
components: {
buttons,
Search,
Attach
},
@ -285,6 +284,7 @@ export default {
editSave() {
console.log('editSave')
},
audit() {},
upload() {
if (this.ids.length > 1) {
this.$message.warning('只能选择一条数据!')

View File

@ -2,7 +2,13 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -158,13 +164,11 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
export default {
name: 'HiddenReviewCreateForm',
components: {
buttons,
SelUser,
SelDept
},
@ -241,6 +245,11 @@ export default {
}
})
},
create() {},
del() {},
audit() {},
unaudit() {},
upload() {},
onSubmit() {},
getCheckMan(data) {
this.form.hidden_danger__check_man = data.sys_user__user_name

View File

@ -2,7 +2,9 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="hidden_check" style="margin-bottom:20px" @save="save" @upload="upload" />
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -246,7 +248,6 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import SelUser from '@/components/selUser'
import SelDept from '@/components/selDept'
import ShowImages from '@/components/show_images'
@ -254,7 +255,6 @@ import Attach from '@/components/sys_attach'
export default {
name: 'HiddenReviewAuditForm',
components: {
buttons,
SelUser,
SelDept,
ShowImages,
@ -339,6 +339,8 @@ export default {
}
})
},
audit() {},
unaudit() {},
upload() {
this.dialogUploadVisible = true
},

View File

@ -2,7 +2,8 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="hidden_review" @Create="editCreate" @Del="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
</div>
<Search funid="hidden_review" @search="search" />
</div>
@ -73,14 +74,12 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import Attach from '@/components/sys_attach'
import { parseDay } from '@/utils/index'
export default {
name: 'HiddenReview',
components: {
buttons,
Search,
Attach
},
@ -261,6 +260,7 @@ export default {
editSave() {
console.log('editSave')
},
audit() {},
upload() {
console.log('upload')
},

View File

@ -2,8 +2,13 @@
<div>
<el-card>
<div class="head">
<div>
<buttons funid="insp_item" style="margin-bottom:10px" @editCreate="editCreate" @editDelete="editDelete" />
<div style="margin-bottom:20px;">
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="editSave">保存</el-button>
<el-button type="primary" @click="editCopy">复制</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="expxls">另存数据</el-button>
</div>
<Search funid="insp_item" :wsql="where_sql" :wvalue="id" :wtype="where_type" @search="search" />
</div>
@ -67,12 +72,10 @@
<script>
import api from './api'
import publicApi from '@/api/public'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
export default {
name: 'SafeIdsp',
components: {
buttons,
Search
},
@ -216,6 +219,10 @@ export default {
this.dialogFormVisible = true
this.form = JSON.parse(JSON.stringify(row))
},
editSave() {},
editCopy() {},
upload() {},
expxls() {},
Delete(row) {
this.ids = []
this.ids.push(row.insp_item__insp_item_id)

View File

@ -2,7 +2,12 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="insp_name" @editCreate="editCreate" @editDelete="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="editSave">保存</el-button>
<el-button type="primary" @click="editCopy">复制</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="expxls">另存数据</el-button>
</div>
<!-- <Search funid="insp_name" @search="search" /> -->
</div>
@ -87,13 +92,11 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import InspItem from './components/insp_item'
export default {
name: 'SafeIdsp',
components: {
buttons,
Search,
InspItem
},
@ -207,6 +210,8 @@ export default {
this.dialogFormVisible = true
this.form = JSON.parse(JSON.stringify(row))
},
editCopy() {},
expxls() {},
Delete(row) {
this.ids = []
this.ids.push(row.insp_name__insp_name_id)

View File

@ -86,14 +86,16 @@ export default {
data() {
const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) {
callback(new Error('Please enter the correct user name'))
callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const validatePassword = (rule, value, callback) => {
if (value.length < 3) {
callback(new Error('The password can not be less than 6 digits'))
if (!value) {
callback(new Error('请输入密码'))
} else if (value.length < 3) {
callback(new Error('密码不能少于3位'))
} else {
callback()
}
@ -131,6 +133,9 @@ export default {
// window.addEventListener('storage', this.afterQRScan)
this.loginForm.username = localStorage.getItem('UserName')
this.loginForm.password = localStorage.getItem('Password')
if (this.loginForm.username && this.loginForm.password) {
this.checked = true
}
},
mounted() {
if (this.loginForm.username === '') {

View File

@ -2,7 +2,12 @@
<div>
<el-card>
<div class="buttons">
<buttons funid="safe_insp" style="margin-bottom:20px" @save="save" />
<el-button type="primary" @click="create">新增</el-button>
<el-button type="primary" @click="del">删除</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="audit">提交</el-button>
<el-button type="primary" @click="unaudit">反提交</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="back">返回列表</el-button>
</div>
<el-form ref="form" :model="form" label-width="80px" :rules="rules">
@ -122,14 +127,12 @@
<script>
import api from '../../api'
import publicApi from '@/api/public'
import buttons from '@/components/formBtn'
import InspDet from '../insp_det'
import SelUser from '@/components/selUser'
import InspName from '../inspName'
export default {
name: 'EditForm',
components: {
buttons,
SelUser,
InspDet,
InspName
@ -234,6 +237,11 @@ export default {
}
})
},
create() {},
del() {},
audit() {},
unaudit() {},
upload() {},
onSubmit() {},
updateUser(data) {
this.form.safe_insp__insp_man = data.sys_user__user_name
@ -286,6 +294,7 @@ export default {
}
.buttons {
display: flex;
margin-bottom:20px;
.el-button--primary {
margin-left: 10px;
height: 26.8px;

View File

@ -2,8 +2,12 @@
<div class="app-container">
<el-card>
<div class="head">
<div>
<buttons funid="insp_det" style="margin-bottom:10px" @Create="editCreate" @Del="editDelete" @upload="upload" />
<div class="buttons">
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="editCopy">复制</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="expxls">另存数据</el-button>
</div>
<Search funid="insp_det" :wsql="where_sql" :wvalue="where_value" :wtype="where_type" @search="search" />
</div>
@ -98,13 +102,11 @@
<script>
import api from './api'
import publicApi from '@/api/public'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import Attach from '@/components/sys_attach'
export default {
name: 'SafeIdsp',
components: {
buttons,
Search,
Attach
},
@ -237,6 +239,8 @@ export default {
this.whereSql = sql
this.getList()
},
editCopy() {},
expxls() {},
upload() {
if (this.ids.length > 1) {
this.$message.warning('只能选择一条数据!')
@ -344,4 +348,7 @@ export default {
.el-card {
margin-top: 10px;
}
.buttons {
margin-bottom: 20px;
}
</style>

View File

@ -2,7 +2,12 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="insp_det" @editCreate="editCreate" @editDelete="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="editSave">保存</el-button>
<el-button type="primary" @click="editCopy">复制</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
<el-button type="primary" @click="expxls">另存数据</el-button>
</div>
<Search funid="safe_insp" @search="search" />
</div>
@ -66,13 +71,11 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import { parseDay } from '@/utils/index'
export default {
name: 'SafeIdsp',
components: {
buttons,
Search
},
data() {
@ -103,7 +106,6 @@ export default {
}, {
prop: 'safe_insp__insp_name',
label: '巡检名称',
width: '250px',
show: true
},
{
@ -319,6 +321,8 @@ export default {
}
})
},
editCopy() {},
expxls() {},
Delete(row) {
this.ids = []
this.ids.push(row.sys_dept__dept_id)

View File

@ -2,17 +2,20 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="sys_dept" @editCreate="editCreate" @editDelete="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
</div>
<Search funid="sys_dept" @search="search" />
</div>
<el-row>
<el-col :span="5">
<el-col :span="3" class="tree">
<el-card>
<div class="tree_title">安全组织架构</div>
<el-tree :data="treeData" default-expand-all :props="defaultProps" @node-click="handleNodeClick" />
</el-card>
</el-col>
<el-col :span="19">
<el-col :span="21">
<el-card>
<el-table
ref="deptTable"
@ -99,13 +102,11 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import AdutiDept from './components/auditDept'
export default {
name: 'Guide',
components: {
buttons,
Search,
AdutiDept
},
@ -421,4 +422,20 @@ export default {
overflow-x:auto;
overflow-y:auto;
}
.tree{
::v-deep .el-card__body {
padding: 0px;
}
}
.tree_title{
width: 100%;
height: 30px;
margin-bottom: 10px;
padding: 2px;
line-height: 30px;
color: #fff;
font-weight: bold;
background-color: #42b983;
text-align: center;
}
</style>

View File

@ -2,12 +2,14 @@
<div class="app-container">
<div class="head">
<div>
<buttons funid="sys_dept" @editCreate="editCreate" @editDelete="editDelete" @editSave="editSave" @upload="upload" />
<el-button type="primary" @click="editCreate">新增</el-button>
<el-button type="primary" @click="editDelete">删除</el-button>
<el-button type="primary" @click="upload">图文附件</el-button>
</div>
<Search funid="sys_user" @search="search" />
</div>
<el-row>
<el-col :span="3">
<el-col :span="3" class="tree">
<el-card>
<div class="tree_title">安全组织架构</div>
<el-tree :data="treeData" default-expand-all :props="defaultProps" @node-click="handleNodeClick" />
@ -117,14 +119,12 @@
<script>
import api from './api'
import buttons from '@/components/Buttons'
import Search from '@/components/Search'
import AdutiUser from './components/auditUser'
import Attach from '@/components/sys_attach'
export default {
name: 'User',
components: {
buttons,
Search,
AdutiUser,
Attach
@ -463,8 +463,10 @@ export default {
.el-card {
margin-top: 10px;
}
::v-deep .el-card__body {
padding: 0px;
.tree{
::v-deep .el-card__body {
padding: 0px;
}
}
.tree_title{
width: 100%;