分离common-api端

This commit is contained in:
2024-09-29 17:27:36 +08:00
parent 7a180ee5a7
commit 4f0e83e9cd
18 changed files with 116 additions and 79 deletions
@@ -124,6 +124,24 @@
v-model:value="form.virtualViews"
/>
</a-form-item>
<a-form-item label="访问权限" name="permission">
<a-radio-group v-model:value="form.permission">
<a-radio :value="0">所有人可见</a-radio>
<a-radio :value="1">登录可见</a-radio>
<a-radio :value="2">密码可见</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item
label="访问密码"
name="password"
v-if="form.permission == 2"
>
<a-input-password
allow-clear
placeholder="请输入查看密码"
v-model:value="password"
/>
</a-form-item>
</a-tab-pane>
</a-tabs>
</a-form>
@@ -191,6 +209,7 @@
const files = ref<ItemType[]>([]);
const category = ref<string[]>([]);
const takeaway = ref<CmsArticleCategory[]>([]);
const password = ref();
// 用户信息
const form = reactive<CmsArticle>({
@@ -214,6 +233,9 @@
virtualViews: 0,
// 实际阅读量
actualViews: 0,
permission: 0,
password: undefined,
password2: undefined,
// 用户ID
userId: undefined,
files: '',
@@ -433,6 +455,9 @@
.validate()
.then(() => {
loading.value = true;
if(password.value){
form.password = password.value
}
const formData = {
...form,
content: content.value
@@ -142,7 +142,11 @@
name="password"
v-if="form.permission == 2"
>
<a-tag>{{ form.password }}</a-tag>
<a-input-password
allow-clear
placeholder="请输入查看密码"
v-model:value="password"
/>
</a-form-item>
</a-col>
</a-row>
@@ -196,6 +200,7 @@
const loading = ref(false);
// 已上传数据
const images = ref<ItemType[]>([]);
const password = ref();
// 表单数据
const { form, resetFields, assignFields } = useFormData<CmsNavigation>({
@@ -370,6 +375,9 @@
formRef.value
.validate()
.then(() => {
if (password.value) {
form.password = password.value;
}
const navigationForm = {
...form,
parentId: form.parentId || 0
@@ -120,8 +120,9 @@
</a-form-item>
<a-form-item label="状态" name="status">
<a-radio-group v-model:value="form.status">
<a-radio :value="0">显示</a-radio>
<a-radio :value="1">隐藏</a-radio>
<a-radio :value="0">已上架</a-radio>
<a-radio :value="1">待审核</a-radio>
<a-radio :value="2">已下架</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="排序号" name="sortNumber">
+3 -9
View File
@@ -33,8 +33,8 @@
>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
<a-tag v-if="record.status === 0" color="green">上架</a-tag>
<a-tag v-if="record.status === 1" color="red">下架</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
@@ -143,7 +143,7 @@
align: 'center'
},
{
title: '单位名称 (个)',
title: '单位',
dataIndex: 'unitName',
key: 'unitName',
align: 'center'
@@ -166,12 +166,6 @@
key: 'sales',
align: 'center'
},
{
title: '库存',
dataIndex: 'stock',
key: 'stock',
align: 'center'
},
{
title: '推荐',
dataIndex: 'recommend',
+19 -15
View File
@@ -62,7 +62,11 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import GoodsSkuEdit from './components/goodsSkuEdit.vue';
import { pageGoodsSku, removeGoodsSku, removeBatchGoodsSku } from '@/api/shop/goodsSku';
import {
pageGoodsSku,
removeGoodsSku,
removeBatchGoodsSku
} from '@/api/shop/goodsSku';
import type { GoodsSku, GoodsSkuParam } from '@/api/shop/goodsSku/model';
// 表格实例
@@ -105,85 +109,85 @@
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
width: 90
},
{
title: '商品ID',
dataIndex: 'goodsId',
key: 'goodsId',
align: 'center',
align: 'center'
},
{
title: '商品属性索引值 (attr_value|attr_value[|....])',
dataIndex: 'sku',
key: 'sku',
align: 'center',
align: 'center'
},
{
title: '商品图片',
dataIndex: 'image',
key: 'image',
align: 'center',
align: 'center'
},
{
title: '商品价格',
dataIndex: 'price',
key: 'price',
align: 'center',
align: 'center'
},
{
title: '市场价格',
dataIndex: 'salePrice',
key: 'salePrice',
align: 'center',
align: 'center'
},
{
title: '成本价',
dataIndex: 'cost',
key: 'cost',
align: 'center',
align: 'center'
},
{
title: '库存',
dataIndex: 'stock',
key: 'stock',
align: 'center',
align: 'center'
},
{
title: 'sku编码',
dataIndex: 'skuNo',
key: 'skuNo',
align: 'center',
align: 'center'
},
{
title: '唯一值',
dataIndex: 'unique',
key: 'unique',
align: 'center',
align: 'center'
},
{
title: '重量',
dataIndex: 'weight',
key: 'weight',
align: 'center',
align: 'center'
},
{
title: '体积',
dataIndex: 'volume',
key: 'volume',
align: 'center',
align: 'center'
},
{
title: '状态, 0正常, 1异常',
dataIndex: 'status',
key: 'status',
align: 'center',
align: 'center'
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '创建时间',
@@ -19,29 +19,12 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="商品多规格名称" name="goodsSpecName">
<a-form-item label="商品多规格名称" name="specValue">
<a-input
allow-clear
:maxlength="100"
placeholder="请输入商品多规格"
v-model:value="form.goodsSpecName"
/>
</a-form-item>
<a-form-item label="描述" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<a-form-item label="排序号" name="sortNumber">
<a-input-number
:min="0"
:max="9999"
class="ele-fluid"
placeholder="请输入排序号"
v-model:value="form.sortNumber"
v-model:value="form.specValue"
/>
</a-form-item>
<a-form-item label="状态" name="status">
@@ -92,11 +75,10 @@
// 用户信息
const form = reactive<GoodsSpec>({
goodsSpecId: undefined,
goodsSpecName: '',
status: 0,
comments: '',
sortNumber: 100
id: undefined,
specName: '',
specId: undefined,
specValue: ''
});
/* 更新visible */
@@ -92,7 +92,7 @@
// 用户信息
const form = reactive<GoodsSpecRel>({
goodsSpecRelId: undefined,
id: undefined,
goodsSpecRelName: '',
status: 0,
comments: '',
@@ -130,7 +130,9 @@
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateGoodsSpecRel : addGoodsSpecRel;
const saveOrUpdate = isUpdate.value
? updateGoodsSpecRel
: addGoodsSpecRel;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
+14 -3
View File
@@ -42,7 +42,11 @@
</a-card>
<!-- 编辑弹窗 -->
<GoodsSpecRelEdit v-model:visible="showEdit" :data="current" @done="reload" />
<GoodsSpecRelEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</div>
</div>
</template>
@@ -58,8 +62,15 @@
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import GoodsSpecRelEdit from './components/goodsSpecRelEdit.vue';
import { pageGoodsSpecRel, removeGoodsSpecRel, removeBatchGoodsSpecRel } from '@/api/shop/goodsSpecRel';
import type { GoodsSpecRel, GoodsSpecRelParam } from '@/api/shop/goodsSpecRel/model';
import {
pageGoodsSpecRel,
removeGoodsSpecRel,
removeBatchGoodsSpecRel
} from '@/api/shop/goodsSpecRel';
import type {
GoodsSpecRel,
GoodsSpecRelParam
} from '@/api/shop/goodsSpecRel/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
+1 -1
View File
@@ -69,7 +69,7 @@
removeBatchMerchant
} from '@/api/shop/merchant';
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
import { getMerchantId, openUrl } from "@/utils/common";
import { getMerchantId } from '@/utils/common';
import router from '@/router';
// 表格实例
+1 -1
View File
@@ -81,7 +81,7 @@
import SpecEdit from './components/specEdit.vue';
import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec';
import type { Spec, SpecParam } from '@/api/shop/spec/model';
import { getMerchantId } from "@/utils/merchant";
import { getMerchantId } from '@/utils/merchant';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
-1
View File
@@ -77,7 +77,6 @@
} from '@/api/shop/specValue';
import type { SpecValue, SpecValueParam } from '@/api/shop/specValue/model';
import { Spec } from '@/api/shop/spec/model';
import { FormInstance } from 'ant-design-vue/es/form';
const props = defineProps<{
// 弹窗是否打开