权限
This commit is contained in:
@@ -1,46 +1,52 @@
|
||||
<template>
|
||||
<el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
|
||||
<el-switch
|
||||
v-hasPermi="['base:group-team:edit-worker']"
|
||||
v-model="state"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="readonly"
|
||||
@change="changeHandler" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
state: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
readonly() {
|
||||
return !!this.injectData.readonly
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.mapToState()
|
||||
},
|
||||
methods: {
|
||||
mapToState() {
|
||||
if (this.injectData.prop === 'enabled') {
|
||||
this.state = this.injectData.enabled === 1 ? true : false
|
||||
}
|
||||
},
|
||||
changeHandler() {
|
||||
let params = {}
|
||||
let payload = {}
|
||||
params.name = 'state'
|
||||
payload.id = this.injectData.id
|
||||
payload.enabled = this.state ? '1' : '0'
|
||||
payload.code = this.injectData.code
|
||||
payload.name = this.injectData.name
|
||||
payload.leaderId = this.injectData.leaderId
|
||||
params.payload = payload
|
||||
this.$emit('emitData', params)
|
||||
}
|
||||
}
|
||||
}
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
state: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
readonly() {
|
||||
return !!this.injectData.readonly;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.mapToState();
|
||||
},
|
||||
methods: {
|
||||
mapToState() {
|
||||
if (this.injectData.prop === 'enabled') {
|
||||
this.state = this.injectData.enabled === 1 ? true : false;
|
||||
}
|
||||
},
|
||||
changeHandler() {
|
||||
let params = {};
|
||||
let payload = {};
|
||||
params.name = 'state';
|
||||
payload.id = this.injectData.id;
|
||||
payload.enabled = this.state ? '1' : '0';
|
||||
payload.code = this.injectData.code;
|
||||
payload.name = this.injectData.name;
|
||||
payload.leaderId = this.injectData.leaderId;
|
||||
params.payload = payload;
|
||||
this.$emit('emitData', params);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,41 +1,51 @@
|
||||
<template>
|
||||
<div class="workerOperate">
|
||||
<div class="operateBtn">
|
||||
<span class="view" v-if="this.$auth.hasPermi('base:group-team:view-worker')" @click="emitParams('view')">查看</span>
|
||||
<span class="edit" v-if="this.$auth.hasPermi('base:group-team:edit-worker')" @click="emitParams('edit')">编辑</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="workerOperate">
|
||||
<div class="operateBtn">
|
||||
<span
|
||||
class="view"
|
||||
v-hasPermi="['base:group-team:view-worker']"
|
||||
@click="emitParams('view')">
|
||||
查看
|
||||
</span>
|
||||
<span
|
||||
class="edit"
|
||||
v-hasPermi="['base:group-team:edit-worker']"
|
||||
@click="emitParams('edit')">
|
||||
编辑
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'WorkerOperate',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitParams(data) {
|
||||
let params = {}
|
||||
params.name = data
|
||||
params.payload = this.injectData
|
||||
this.$emit('emitData', params)
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'WorkerOperate',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
emitParams(data) {
|
||||
let params = {};
|
||||
params.name = data;
|
||||
params.payload = this.injectData;
|
||||
this.$emit('emitData', params);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.workerOperate {
|
||||
.operateBtn{
|
||||
color: #0B58FF;
|
||||
.view {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.edit {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.operateBtn {
|
||||
color: #0b58ff;
|
||||
.view {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.edit {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -125,7 +125,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -88,7 +88,7 @@ export default {
|
||||
workOrderList: [],
|
||||
workOrderName: '',
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team-view:detail')
|
||||
this.$auth.hasPermi('monitoring:group-team-scheduling:query')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:team-production:detail')
|
||||
this.$auth.hasPermi('monitoring:group-team-scheduling:query')
|
||||
? {
|
||||
type: 'productionDetail',
|
||||
btnName: '查看',
|
||||
|
||||
Reference in New Issue
Block a user