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