Commit 509d8dc2 authored by chenqikuai's avatar chenqikuai

发行藏品:发行类型更新、发行数量更新

parent c9eb219e
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
<CopyrightTable <CopyrightTable
v-if="tableDataOfPicture.length !== 0" v-if="tableDataOfPicture.length !== 0"
ref="copyrightTableRef" ref="copyrightTableRef"
v-show="activedMenu === eCollectionType.copright" v-show="activedMenu === eCollectionType.copyright"
:active="activedMenu === eCollectionType.copright" :active="activedMenu === eCollectionType.copyright"
:table-data="tableDataOfPicture" :table-data="tableDataOfPicture"
:loading="loadingOfPicture" :loading="loadingOfPicture"
@scroll-to-end="fetchNextPageOfPicture" @scroll-to-end="fetchNextPageOfPicture"
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
></CopyrightTable> ></CopyrightTable>
<Empty <Empty
v-if=" v-if="
activedMenu === eCollectionType.copright && activedMenu === eCollectionType.copyright &&
!loadingOfPicture && !loadingOfPicture &&
tableDataOfPicture.length === 0 tableDataOfPicture.length === 0
" "
...@@ -154,14 +154,14 @@ const debouncedSearchStrOfDerivatives = ref(""); ...@@ -154,14 +154,14 @@ const debouncedSearchStrOfDerivatives = ref("");
const debouncedSearchStrOfAlbum = ref(""); const debouncedSearchStrOfAlbum = ref("");
const copyrightTableRef = ref<InstanceType<typeof CopyrightTable>>(); const copyrightTableRef = ref<InstanceType<typeof CopyrightTable>>();
const activedMenu = ref(eCollectionType.copright); const activedMenu = ref(eCollectionType.copyright);
const menuList = [ const menuList = [
{ label: "版权", value: eCollectionType.copright }, { label: "版权", value: eCollectionType.copyright },
{ label: "衍生品", value: eCollectionType.derivatives }, { label: "衍生品", value: eCollectionType.derivatives },
{ label: "专辑", value: eCollectionType.album }, { label: "专辑", value: eCollectionType.album },
]; ];
const currentSearchStr = computed(() => { const currentSearchStr = computed(() => {
if (activedMenu.value === eCollectionType.copright) { if (activedMenu.value === eCollectionType.copyright) {
return searchStrOfCopyright.value; return searchStrOfCopyright.value;
} else if (activedMenu.value === eCollectionType.derivatives) { } else if (activedMenu.value === eCollectionType.derivatives) {
return searchStrOfDerivatives.value; return searchStrOfDerivatives.value;
...@@ -172,7 +172,7 @@ const currentSearchStr = computed(() => { ...@@ -172,7 +172,7 @@ const currentSearchStr = computed(() => {
}); });
function handleCurrentSearchStrChange(str: string) { function handleCurrentSearchStrChange(str: string) {
if (activedMenu.value === eCollectionType.copright) { if (activedMenu.value === eCollectionType.copyright) {
searchStrOfCopyright.value = str; searchStrOfCopyright.value = str;
} else if (activedMenu.value === eCollectionType.derivatives) { } else if (activedMenu.value === eCollectionType.derivatives) {
searchStrOfDerivatives.value = str; searchStrOfDerivatives.value = str;
...@@ -184,7 +184,7 @@ function handleCurrentSearchStrChange(str: string) { ...@@ -184,7 +184,7 @@ function handleCurrentSearchStrChange(str: string) {
const route = useRoute(); const route = useRoute();
onBeforeMount(() => { onBeforeMount(() => {
activedMenu.value = activedMenu.value =
(route.query.type as eCollectionType) || eCollectionType.copright; (route.query.type as eCollectionType) || eCollectionType.copyright;
}); });
watch(activedMenu, (menu) => { watch(activedMenu, (menu) => {
......
<template> <template>
<HandleAllKindsOfType <HandleAllKindsOfType
v-if="activedMenu === eCollectionType.derivatives" v-if="
activedMenu === eCollectionType.copyright + eCollectionType.derivatives
"
type="uploadPicture" type="uploadPicture"
:file="fileData" :file="fileData"
@clear=" @clear="
...@@ -29,7 +31,7 @@ import { getFileName } from "../../../../utils/file"; ...@@ -29,7 +31,7 @@ import { getFileName } from "../../../../utils/file";
import HandleAllKindsOfType from "@/components/HandleAllKindsOfType/index.vue"; import HandleAllKindsOfType from "@/components/HandleAllKindsOfType/index.vue";
const props = defineProps<{ const props = defineProps<{
activedMenu: eCollectionType; activedMenu: string;
fileData: any; fileData: any;
clearCollectionMsg: any; clearCollectionMsg: any;
}>(); }>();
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
label="藏品名称" label="藏品名称"
prop="name" prop="name"
v-if=" v-if="
activedMenu === eCollectionType.picture && activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives &&
formData.fileData && formData.fileData &&
formData.fileData.name formData.fileData.name
" "
...@@ -69,10 +70,40 @@ ...@@ -69,10 +70,40 @@
> >
<sy-select <sy-select
v-model="formData.type" v-model="formData.type"
@update:model-value="formData.amount = 1"
placeholder="请选择资产类型" placeholder="请选择资产类型"
:disabled="true" :disabled="
activedMenu !==
eCollectionType.copyright + eCollectionType.derivatives
"
> >
<sy-option key="NFT" label="NFT" value="1"></sy-option> <sy-option
v-if="
activedMenu !==
eCollectionType.copyright + eCollectionType.derivatives
"
key="NFT"
label="NFT"
value="1"
></sy-option>
<sy-option
v-if="
activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives
"
key="版权"
label="版权"
value="1"
></sy-option>
<sy-option
v-if="
activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives
"
key="衍生品"
label="衍生品"
value="2"
></sy-option>
</sy-select> </sy-select>
</CustomizeFormItem> </CustomizeFormItem>
<CustomizeFormItem <CustomizeFormItem
...@@ -83,8 +114,18 @@ ...@@ -83,8 +114,18 @@
<syDialogInput <syDialogInput
class="w-full" class="w-full"
type="number" type="number"
:disabled="true" :disabled="
activedMenu === eCollectionType.album || formData.type === '1'
"
:value="formData.amount" :value="formData.amount"
:max="10000"
@update:value="
(str) => {
parseInt(str.replaceAll('.', '')) > 10000
? (formData.amount = 10000)
: (formData.amount = str.replaceAll('.', ''));
}
"
placeholder="请输入发行数量" placeholder="请输入发行数量"
></syDialogInput> ></syDialogInput>
</CustomizeFormItem> </CustomizeFormItem>
...@@ -258,10 +299,10 @@ export default defineComponent({ ...@@ -258,10 +299,10 @@ export default defineComponent({
data() { data() {
return { return {
eCollectionType, eCollectionType,
activedMenu: eCollectionType.picture, activedMenu: eCollectionType.copyright + eCollectionType.derivatives,
menuList: [ menuList: [
{ {
value: eCollectionType.picture, value: eCollectionType.copyright + eCollectionType.derivatives,
label: "上传图片", label: "上传图片",
}, },
{ {
...@@ -323,7 +364,8 @@ export default defineComponent({ ...@@ -323,7 +364,8 @@ export default defineComponent({
} else { } else {
callback && callback &&
callback( callback(
(this as any).activedMenu === eCollectionType.picture (this as any).activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives
? "请上传藏品" ? "请上传藏品"
: "请选择专辑" : "请选择专辑"
); );
...@@ -346,7 +388,10 @@ export default defineComponent({ ...@@ -346,7 +388,10 @@ export default defineComponent({
}, },
computed: { computed: {
disabled(): boolean { disabled(): boolean {
if (this.activedMenu === eCollectionType.picture) { if (
this.activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives
) {
return ( return (
this.formData.name === "" || this.formData.name === "" ||
this.formData.type === "" || this.formData.type === "" ||
...@@ -379,6 +424,11 @@ export default defineComponent({ ...@@ -379,6 +424,11 @@ export default defineComponent({
} }
}, },
}, },
setup() {
return {
console: console,
};
},
methods: { methods: {
handleClickProof(hash: string) { handleClickProof(hash: string) {
openChainBrowser(hash, globalState.urlList.chain_browser_url); openChainBrowser(hash, globalState.urlList.chain_browser_url);
...@@ -462,7 +512,10 @@ export default defineComponent({ ...@@ -462,7 +512,10 @@ export default defineComponent({
if (!isValid) return; if (!isValid) return;
this.inSubmit = true; this.inSubmit = true;
if (this.activedMenu === eCollectionType.picture) { if (
this.activedMenu ===
eCollectionType.copyright + eCollectionType.derivatives
) {
/**如果有文件,则先文件上链 */ /**如果有文件,则先文件上链 */
if (this.formData.fileData.name) { if (this.formData.fileData.name) {
const fd = new FormData(); const fd = new FormData();
...@@ -573,101 +626,6 @@ export default defineComponent({ ...@@ -573,101 +626,6 @@ export default defineComponent({
font-size: 12px; font-size: 12px;
margin-top: 2px; margin-top: 2px;
} }
.upload_layout {
width: 100%;
height: 158px;
border: 1px dashed #e2e2e2;
border-radius: var(--border-radius);
color: #8b8b8b;
text-align: center;
background-color: #f7f7f7;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 20px;
cursor: pointer;
.layout_icon {
margin-bottom: 5px;
}
.layout_status {
color: var(--sy-blue);
font-weight: bold;
font-size: 14px;
line-height: 20px;
margin-bottom: 5px;
}
.layout_tip {
transform: scale(0.9);
font-size: 12px;
line-height: 17px;
}
}
.upload_process {
margin: 20px 0 20px 0;
.process_info {
display: flex;
align-items: center;
padding: 15px 18px;
box-shadow: 0px 2px 15px 0px #e7eef3;
.process_img {
img {
width: 24px;
height: 24px;
}
}
.process_content {
flex: 1;
margin: 0 25px;
.content_info {
display: flex;
justify-content: space-between;
font-size: 12px;
margin-bottom: 5px;
color: #8b8b8b;
.file_name {
color: #353535;
width: 33.3%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.process_tip {
margin-top: 10px;
display: flex;
justify-content: space-between;
font-size: 12px;
}
.tip_fail {
.tip_left {
color: #ff4848;
}
.tip_right {
color: var(--sy-blue);
cursor: pointer;
}
}
}
.chain_select {
display: flex;
justify-content: space-between;
margin: 15px 0 15px 0;
.delete_upload {
color: #8e8d8d;
display: flex;
align-items: center;
font-size: 14px;
cursor: pointer;
.delete_icon {
width: 17px;
height: 17px;
margin-right: 7px;
}
}
}
.category_add { .category_add {
.add_content { .add_content {
display: flex; display: flex;
...@@ -727,20 +685,5 @@ export default defineComponent({ ...@@ -727,20 +685,5 @@ export default defineComponent({
:deep(.el-select) { :deep(.el-select) {
width: 100%; width: 100%;
} }
:deep(.el-tree-node__label) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
:deep(.el-input) {
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type="number"] {
-moz-appearance: textfield;
}
}
} }
</style> </style>
export enum eCollectionType { export enum eCollectionType {
/**版权 */ /**版权 */
copright = "copright", copyright = "copyright",
/**衍生品 */ /**衍生品 */
derivatives = "derivatives", derivatives = "derivatives",
/**专辑 */ /**专辑 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment