|
@@ -3,7 +3,7 @@
|
|
|
<div class="dialog-bg" v-if="dialogVisible">
|
|
|
<div class="dialog" :style="{width: (width ? width : 680) + 'px'}">
|
|
|
<div class="head">
|
|
|
- <h3>{{title}} </h3>
|
|
|
+ <h3>{{title}}</h3>
|
|
|
<i class="el-icon-close" @click="closeHandle" v-if="showClose || showClose === void 0 || cornerClose"></i>
|
|
|
</div>
|
|
|
<div class="content">
|
|
@@ -12,7 +12,8 @@
|
|
|
<div class="floot" v-if="showFloor">
|
|
|
<el-button type="danger" v-if="showDel" @click="deleteHandle" >删 除</el-button>
|
|
|
<el-button @click="closeHandle" v-if="showClose || showClose === void 0">取 消</el-button>
|
|
|
- <el-button type="primary" @click="enterHandle">{{enterText || '保 存'}}</el-button>
|
|
|
+ <el-button type="primary" :disabled="disabled()" @click="enterHandle">{{enterText || '保 存'}}</el-button>
|
|
|
+ <!-- <el-button v-if="power" v-else type="primary" @click="enterHandle">{{enterText || '保 存'}}</el-button> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -21,9 +22,10 @@
|
|
|
|
|
|
<script>
|
|
|
import { computed, ref } from "vue";
|
|
|
+import user from '@/state/user'
|
|
|
|
|
|
export default {
|
|
|
- props: ["show", "title", "hideFloor", 'enterText', 'width', 'showClose','showDelete','cornerClose'],
|
|
|
+ props: ["show", "title", "hideFloor", 'enterText', 'width','power', 'showClose','showDelete','cornerClose'],
|
|
|
setup(props) {
|
|
|
const dialogVisible = ref(props.show);
|
|
|
console.log('props',props);
|
|
@@ -49,12 +51,29 @@ export default {
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
enterHandle() {
|
|
|
+ console.log('enterHandle',this.$route,'user',user)
|
|
|
this.$emit('submit')
|
|
|
// this.dialogVisible = false;
|
|
|
},
|
|
|
deleteHandle() {
|
|
|
console.log('deleteHandle')
|
|
|
this.$emit('delete')
|
|
|
+ },
|
|
|
+ disabled(){
|
|
|
+ if(!this.power){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let replacelist = {
|
|
|
+ 'organizationlist':'organization',
|
|
|
+ }
|
|
|
+ let roleKeyList = user._value.roleKeyList
|
|
|
+ let routeName = this.$route.name
|
|
|
+ let rokeName = `${replacelist[routeName] || routeName}:${this.power}`
|
|
|
+ if(!roleKeyList.includes(rokeName)){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
};
|