fix: bug#10505 10443
This commit is contained in:
parent
7c9028dab4
commit
34bff0ecb4
|
@ -83,7 +83,7 @@ const props = defineProps({
|
|||
type: Object as PropType<PopconfirmProps>,
|
||||
},
|
||||
hasPermission: {
|
||||
type: String || Array,
|
||||
type: String || Array || Boolean,
|
||||
},
|
||||
style: {
|
||||
type: Object as PropType<CSSProperties>
|
||||
|
@ -96,7 +96,7 @@ const props = defineProps({
|
|||
const permissionStore = usePermissionStore()
|
||||
|
||||
const isPermission = computed(() => {
|
||||
if (!props.hasPermission) {
|
||||
if (!props.hasPermission || props.hasPermission === true) {
|
||||
return true
|
||||
}
|
||||
return permissionStore.hasPermission(props.hasPermission)
|
||||
|
|
|
@ -29,5 +29,9 @@ export const useProductStore = defineStore({
|
|||
setTabActiveKey(key: string) {
|
||||
this.tabActiveKey = key
|
||||
},
|
||||
reSet(){
|
||||
this.current = {} as ProductItem
|
||||
this.detail = {} as ProductItem
|
||||
}
|
||||
}
|
||||
})
|
|
@ -76,6 +76,7 @@ import type { ActionsType } from '@/components/Table/index.vue';
|
|||
import ModifyModal from './components/modifyModal/index.vue';
|
||||
import type { TableColumnType, TableProps } from 'ant-design-vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
const expandedRowKeys = ref<any>([]);
|
||||
const tableRef = ref<Record<string, any>>({});
|
||||
const modifyRef = ref();
|
||||
const dataSource = ref<any>([]);
|
||||
|
@ -126,7 +127,7 @@ let params = ref();
|
|||
* 搜索
|
||||
*/
|
||||
const handleSearch = (e: any) => {
|
||||
params.value = e
|
||||
params.value = e;
|
||||
};
|
||||
/**
|
||||
* 操作栏按钮
|
||||
|
|
|
@ -589,6 +589,7 @@ const search = (e: any) => {
|
|||
};
|
||||
};
|
||||
|
||||
const stepsRef = reactive({current:0})
|
||||
//引导页数据
|
||||
const steps = [
|
||||
{
|
||||
|
@ -673,19 +674,19 @@ const driver = new Driver({
|
|||
nextBtnText: '下一步',
|
||||
prevBtnText: '上一步',
|
||||
onNext: () => {
|
||||
// ref.current = ref.current + 1;
|
||||
stepsRef.current = stepsRef.current + 1;
|
||||
},
|
||||
onPrevious: () => {
|
||||
// ref.current = ref.current - 1;
|
||||
stepsRef.current = stepsRef.current - 1;
|
||||
},
|
||||
onReset: () => {
|
||||
// if (ref.current !== 3) {
|
||||
// guide({
|
||||
// name: 'guide',
|
||||
// content: 'skip',
|
||||
// });
|
||||
// }
|
||||
// ref.current = 0;
|
||||
if (stepsRef.current !== 3) {
|
||||
guide({
|
||||
name: 'guide',
|
||||
content: 'skip',
|
||||
});
|
||||
}
|
||||
stepsRef.current = 0;
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -695,16 +696,20 @@ const driver1 = new Driver({
|
|||
closeBtnText: '不再提示',
|
||||
nextBtnText: '下一步',
|
||||
prevBtnText: '上一步',
|
||||
onNext: () => {},
|
||||
onPrevious: () => {},
|
||||
onNext: () => {
|
||||
stepsRef.current = stepsRef.current + 1;
|
||||
},
|
||||
onPrevious: () => {
|
||||
stepsRef.current = stepsRef.current - 1;
|
||||
},
|
||||
onReset: () => {
|
||||
// if (ref.current !== 4) {
|
||||
// // guide({
|
||||
// // name: 'guide',
|
||||
// // content: 'skip',
|
||||
// // });
|
||||
// }
|
||||
// ref.current = 0;
|
||||
if (stepsRef.current !== 4) {
|
||||
guide({
|
||||
name: 'guide',
|
||||
content: 'skip',
|
||||
});
|
||||
}
|
||||
stepsRef.current = 0;
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -969,9 +974,11 @@ const submitData = async () => {
|
|||
productStore.current = { ...res.result };
|
||||
access.value = res.result;
|
||||
message.success('操作成功!');
|
||||
getData();
|
||||
}
|
||||
visible.value = false;
|
||||
queryParams.value = {};
|
||||
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
@ -1085,11 +1092,11 @@ const add = () => {
|
|||
/**
|
||||
* 初始化
|
||||
*/
|
||||
watchEffect(() => {
|
||||
if (productStore.current?.accessId) {
|
||||
getData();
|
||||
}
|
||||
});
|
||||
// watchEffect(() => {
|
||||
// if (productStore.current?.accessId) {
|
||||
// getData();
|
||||
// }
|
||||
// });
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
:deep(
|
||||
|
|
|
@ -151,6 +151,7 @@ watch(
|
|||
() => route.params.id,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
productStore.reSet();
|
||||
productStore.tabActiveKey = 'Info';
|
||||
productStore.refresh(newId as string);
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
<PermissionButton
|
||||
:disabled="i.disabled"
|
||||
:popConfirm="i.popConfirm"
|
||||
:hasPermission="'device/Product:' + i.key"
|
||||
:hasPermission="i.key === 'view' ? true : 'device/Product:' + i.key"
|
||||
:tooltip="{
|
||||
...i.tooltip,
|
||||
}"
|
||||
|
|
Loading…
Reference in New Issue