feat: 增加同步规则
This commit is contained in:
parent
04ae1c342b
commit
8fd3565bac
|
|
@ -116,4 +116,16 @@ export function downloadFile(obj: BlobPart, name: string, suffix: string, useUni
|
|||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断主店同步是否启用
|
||||
*/
|
||||
export function isSyncStatus() {
|
||||
let userInfo = ref(JSON.parse(localStorage.getItem('userInfo') || '{}'))
|
||||
if (userInfo.value.isHeadShop == 0 && userInfo.value.isEnableProdSync == 1 && userInfo.value.isEnableVipSync == 1 && userInfo.value.isEnableConsSync == 1) {
|
||||
return true
|
||||
}else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@
|
|||
<el-radio :value="2">接口</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否外链" prop="path">
|
||||
<el-form-item label="是否外链" >
|
||||
<el-switch
|
||||
v-model="formData.iFrame"
|
||||
:active-value="1"
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ import UserAPI from "@/api/product/index";
|
|||
import { useRouter } from "vue-router";
|
||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
import { isSyncStatus } from "@/utils/index";
|
||||
import addModalConfig from "./indexconfig/add";
|
||||
import contentConfig from "./indexconfig/content";
|
||||
import MultiImageUpload from "@/components/Upload/MultiImageUpload.vue"
|
||||
|
|
@ -199,13 +200,19 @@ let datas = reactive({
|
|||
remark: "",
|
||||
images: []
|
||||
});
|
||||
let userInfo = ref(JSON.parse(localStorage.getItem('userInfo') || '{}'))
|
||||
console.log(userInfo.value.isEnableProdSync)
|
||||
if (userInfo.value.isHeadShop == 0 && userInfo.value.isEnableProdSync == 1) {
|
||||
contentConfig.toolbar.splice(0, 1)
|
||||
if (isSyncStatus()) {
|
||||
if( JSON.stringify(contentConfig.toolbar)?.indexOf("add") != -1){
|
||||
contentConfig.toolbar?.splice(0, 1)
|
||||
}
|
||||
if( JSON.stringify(contentConfig.cols[contentConfig.cols.length-1].operat)?.indexOf("delete") != -1){
|
||||
contentConfig.cols[contentConfig.cols.length-1].operat?.splice(2, 1)
|
||||
}
|
||||
}else {
|
||||
contentConfig.toolbar.splice(1, 1)
|
||||
if( JSON.stringify(contentConfig.toolbar)?.indexOf("custom2") != -1){
|
||||
contentConfig.toolbar?.splice(1, 1)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
console.log(route.query);
|
||||
if (route.query.id) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue