Commit e0def4ed authored by zL's avatar zL

新增一堆更改

parent 405718f2
<template>
<div class="category-add">
<h2 class="dialog_add-title">重命名</h2>
<dialog-input
class="dialog_add-form dialog_add-input_name"
v-model="name"
:errorShowing="isErrorShowing"
placeholder="请输入新的分类名称"
/>
<button class="dialog_add-btn_confirm" @click="checkForm">确定</button>
<button class="dialog_add-btn_cancel" @click="closeDialog">取消</button>
</div>
</template>
<script>
import DialogInput from "@/components/DialogInput.vue";
import { GO_URLS } from "@/config/URLS";
export default {
components: {
DialogInput,
},
data() {
return {
isErrorShowing: false,
isInActive: false,
name: "",
};
},
props: ["oldName", "oldID"],
created() {
this.name = this.oldName;
},
methods: {
// 关闭弹窗
async closeDialog() {
this.$emit("close", {});
},
// 确认按钮
async checkForm() {
if (this.isInActive) return;
this.isInActive = true;
this.isErrorShowing = true;
// 追加非空验证
if (this.name.trim().length === 0) {
this.$message.error("分类名称不可为空");
this.isInActive = false;
return null;
}
const res = await this.$ajax({
type: "PUT",
url: GO_URLS.updateFolder,
params: {
name: this.name,
id: this.oldID,
},
});
if (res) {
this.$message({
message: "重命名成功",
type: "success",
});
this.closeDialog();
this.$emit("update");
}
this.isInActive = false;
},
},
};
</script>
<style scoped lang="less">
.category-add {
padding: 34px 50px 0 50px;
height: 245px; /* 325px - 34px */
width: 500px; /* 600px - 100px */
}
.dialog_add-title {
margin: 0;
color: #000;
font-size: 22px;
line-height: 30px;
}
.dialog_add-select_subject {
margin-top: 29px;
}
.dialog_add-input_name {
margin: 42px 0 34px 0;
}
.dialog_add-btn_confirm {
float: right;
width: 120px;
height: 40px;
color: #fff;
font-size: 14px;
outline: none;
background: #3f79fe;
border-radius: 4px;
border: none;
cursor: pointer;
}
.dialog_add-btn_cancel {
float: right;
margin-right: 18px; /* 28 - 10 */
border: none;
width: 48px; /* 28 + 增大20 */
height: 40px;
outline: none;
background: #fff;
color: #5c6476;
font-size: 14px;
cursor: pointer;
}
</style>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</div> </div>
<div class="show" v-for="(item, index) in localObjects" :key="index"> <div class="show" v-for="(item, index) in localObjects" :key="index">
<i class="iconfont iconyinpin-copy"></i> <i class="iconfont iconyinpin-copy"></i>
<p>{{ item.name }}</p> <p @click="play(item)">{{ item.name }}</p>
<div class="show-rigth"> <div class="show-rigth">
<i class="iconfont iconxingzhuang2"></i>上传成功 <i class="iconfont iconxingzhuang2"></i>上传成功
<i class="iconfont iconshanchu1" @click="deleteAudios(index)"></i> <i class="iconfont iconshanchu1" @click="deleteAudios(index)"></i>
...@@ -25,19 +25,35 @@ ...@@ -25,19 +25,35 @@
accept="audio/*" accept="audio/*"
@change="fileChange" @change="fileChange"
/> />
<common-dialog
v-if="showAudio"
@closePopup="showAudio = false"
showMask
@ClickingBackground="showAudio = false"
>
<div class="audio-box">
<audio controls="controls" style="outline: none" :src="Aurl"></audio>
</div>
</common-dialog>
</div> </div>
</template> </template>
<script> <script>
import { GO_URLS } from "@/config/URLS"; import { GO_URLS } from "@/config/URLS";
import CommonDialog from "@/components/CommonDialog.vue";
export default { export default {
props: ["property"], props: ["property"],
data() { data() {
return { return {
localObjects: [], localObjects: [],
localHash: [], // 本地hash localHash: [], // 本地hash
showAudio: false,
Aurl: "",
}; };
}, },
components: {
CommonDialog,
},
mounted() { mounted() {
if (this.property.value.length > 0) { if (this.property.value.length > 0) {
let hashes = []; let hashes = [];
...@@ -59,6 +75,10 @@ export default { ...@@ -59,6 +75,10 @@ export default {
}, },
}, },
methods: { methods: {
play(item) {
this.Aurl = item.url;
this.showAudio = true;
},
deleteAudios(index) { deleteAudios(index) {
this.localHash.splice(index, 1); this.localHash.splice(index, 1);
this.localObjects.splice(index, 1); this.localObjects.splice(index, 1);
...@@ -176,6 +196,7 @@ export default { ...@@ -176,6 +196,7 @@ export default {
margin: 0; margin: 0;
display: inline-block; display: inline-block;
padding: 0; padding: 0;
cursor: pointer;
font-weight: 400; font-weight: 400;
color: #353535; color: #353535;
} }
...@@ -199,4 +220,7 @@ export default { ...@@ -199,4 +220,7 @@ export default {
} }
} }
} }
.audio-box {
padding: 20px;
}
</style> </style>
\ No newline at end of file
...@@ -20,12 +20,6 @@ ...@@ -20,12 +20,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 上传区域 -->
<!-- <div class="upload-area" @click="upFile" v-else>
<i class="iconfont iconpdf icon"></i>
<p>上传PDF</p>
<p>大小不大于10M</p>
</div> -->
<input <input
type="file" type="file"
hidden hidden
...@@ -132,7 +126,8 @@ export default { ...@@ -132,7 +126,8 @@ export default {
}, },
// 打开pdf文件 // 打开pdf文件
openPDF(item) { openPDF(item) {
window.open(item.fileUrl); window.open(item.url);
// console.log(item);
}, },
// 删除pdf // 删除pdf
deletePDF(index) { deletePDF(index) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
<ul class="list"> <ul class="list">
<li v-for="(item, index) in locaVideos" :key="index"> <li v-for="(item, index) in locaVideos" :key="index">
<div class="video-file"> <div class="video-file" @click="play(item)">
<div class="svgbox"> <div class="svgbox">
<i class="iconfont iconshipinwenjian"></i> <i class="iconfont iconshipinwenjian"></i>
</div> </div>
...@@ -31,6 +31,17 @@ ...@@ -31,6 +31,17 @@
accept="video/mp4" accept="video/mp4"
@change="fileChange" @change="fileChange"
/> />
<!-- 视频预览 -->
<common-dialog
v-if="showVideo"
@closePopup="showVideo = false"
showMask
@ClickingBackground="showVideo = false"
>
<div>
<video controls="controls" style="outline: none" :src="Vurl"></video>
</div>
</common-dialog>
</div> </div>
</template> </template>
...@@ -39,6 +50,7 @@ ...@@ -39,6 +50,7 @@
import { getLoginCode } from "@/plugins/storage"; import { getLoginCode } from "@/plugins/storage";
import Progress from "../Progress.vue"; import Progress from "../Progress.vue";
import { GO_URLS } from "@/config/URLS"; import { GO_URLS } from "@/config/URLS";
import CommonDialog from "@/components/CommonDialog.vue";
let xhr; let xhr;
export default { export default {
data() { data() {
...@@ -47,12 +59,15 @@ export default { ...@@ -47,12 +59,15 @@ export default {
locaVideos: [], // 本地展示用 locaVideos: [], // 本地展示用
Speed: { Result: "上传中", num: 0 }, Speed: { Result: "上传中", num: 0 },
isFlag: true, isFlag: true,
showVideo: false,
Vurl: "",
}; };
}, },
props: ["property"], props: ["property"],
components: { components: {
//组件 //组件
Progress, Progress,
CommonDialog,
}, },
watch: { watch: {
hashList: { hashList: {
...@@ -78,6 +93,10 @@ export default { ...@@ -78,6 +93,10 @@ export default {
}, },
methods: { methods: {
play(item) {
this.showVideo = true;
this.Vurl = item.url;
},
// 获取已有数据 // 获取已有数据
async getVideos(hashes) { async getVideos(hashes) {
let res = await this.$ajax({ let res = await this.$ajax({
...@@ -90,10 +109,12 @@ export default { ...@@ -90,10 +109,12 @@ export default {
this.hashList = []; this.hashList = [];
for (let index = 0; index < res.data.files.length; index++) { for (let index = 0; index < res.data.files.length; index++) {
const element = res.data.files[index]; const element = res.data.files[index];
this.locaVideos.push({ this.locaVideos.push({
name: element.name, name: element.name,
state: "上传成功", state: "上传成功",
speed: 100, speed: 100,
url: element.url,
}); });
this.hashList.push(element.hash); this.hashList.push(element.hash);
} }
...@@ -160,6 +181,7 @@ export default { ...@@ -160,6 +181,7 @@ export default {
} }
return; return;
} }
that.locaVideos.push({ that.locaVideos.push({
name: file.name, name: file.name,
state: "上传中", state: "上传中",
...@@ -174,6 +196,10 @@ export default { ...@@ -174,6 +196,10 @@ export default {
uploadComplete(xhr) { uploadComplete(xhr) {
//服务断接收完文件返回的结果 //服务断接收完文件返回的结果
this.hashList.push(JSON.parse(xhr.target.response).data.hash); this.hashList.push(JSON.parse(xhr.target.response).data.hash);
this.locaVideos[this.locaVideos.length - 1].url = JSON.parse(
xhr.target.response
).data.url;
}, },
// 失败回调 // 失败回调
uploadFailed(xhr) { uploadFailed(xhr) {
...@@ -232,7 +258,7 @@ export default { ...@@ -232,7 +258,7 @@ export default {
.video-file { .video-file {
font-size: 14px; font-size: 14px;
float: left; float: left;
// margin-right: 400px; cursor: pointer;
} }
.svgbox { .svgbox {
// font-size: 22px; // font-size: 22px;
......
...@@ -49,6 +49,19 @@ ...@@ -49,6 +49,19 @@
> >
上链失败 上链失败
</div> </div>
<div v-if="item.status === 4" class="content-the-above-link">
隐藏中
</div>
<div v-if="item.status === 5" class="content-the-above-link">
已隐藏
</div>
<div
v-if="item.status === 6"
class="content-status--fail"
@click="$emit('privacy-settings', item)"
>
隐藏失败
</div>
</li> </li>
<li class="content-qrcode"> <li class="content-qrcode">
<div class="content-code-box"> <div class="content-code-box">
...@@ -111,19 +124,20 @@ ...@@ -111,19 +124,20 @@
<li <li
v-if="item.status === 2" v-if="item.status === 2"
@click=" @click="
$emit('increment', item); $emit('privacy-settings', item);
checkSet = -1; checkSet = -1;
" "
> >
增量 隐私设置
</li> </li>
<li <li
v-if="item.status === 2"
@click=" @click="
$emit('delete-goods', item); $emit('increment', item);
checkSet = -1; checkSet = -1;
" "
> >
删除 增量更新
</li> </li>
<li <li
@click=" @click="
...@@ -133,6 +147,14 @@ ...@@ -133,6 +147,14 @@
> >
创建副本 创建副本
</li> </li>
<li
@click="
$emit('delete-goods', item);
checkSet = -1;
"
>
删除
</li>
</ul> </ul>
</div> </div>
</li> </li>
...@@ -366,7 +388,6 @@ export default { ...@@ -366,7 +388,6 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
li { li {
line-height: 50px; line-height: 50px;
// border: 1px solid skyblue;
} }
.content-on-the-chain { .content-on-the-chain {
width: 70px; width: 70px;
......
<template>
<section>
<h2 class="dialog-title">提示</h2>
<p class="dialog-tip">{{ tip }}</p>
<button class="dialog_btn_confirm" @click="checkForm">确定</button>
<button class="dialog_btn_cancel" @click="closeDialog">取消</button>
</section>
</template>
<script>
export default {
props: ["tip"],
methods: {
checkForm() {
this.$emit("confirm");
},
closeDialog() {
this.$emit("close");
},
},
};
</script>
<style lang="less" scoped>
section {
width: 535px;
height: 285px;
background: #ffffff;
box-shadow: 0px 0px 20px 0px rgba(61, 118, 249, 0.18);
}
.dialog-title {
padding-left: 44px;
padding-top: 34px;
color: #000;
font-size: 22px;
}
.dialog-tip {
text-align: center;
padding-top: 48px;
font-size: 22px;
padding-bottom: 54px;
}
.dialog_btn_confirm {
float: right;
width: 120px;
height: 40px;
color: #fff;
font-size: 14px;
margin-right: 50px;
outline: none;
background: #3f79fe;
border-radius: 4px;
border: none;
cursor: pointer;
}
.dialog_btn_cancel {
float: right;
margin-right: 18px; /* 28 - 10 */
border: none;
width: 48px; /* 28 + 增大20 */
height: 40px;
outline: none;
background: #fff;
color: #5c6476;
font-size: 14px;
cursor: pointer;
}
</style>
\ No newline at end of file
...@@ -51,4 +51,5 @@ export class GO_URLS { ...@@ -51,4 +51,5 @@ export class GO_URLS {
static orderType = prefix_go + '/api/order/get' static orderType = prefix_go + '/api/order/get'
static deleteFolder = prefix_go + '/api/template/deleteFolder' static deleteFolder = prefix_go + '/api/template/deleteFolder'
static updateFolder = prefix_go + '/api/template/updateFolder' static updateFolder = prefix_go + '/api/template/updateFolder'
static deleteBlockChainProof = prefix_go + '/api/proof/deleteBlockChainProof'
} }
...@@ -69,7 +69,9 @@ ...@@ -69,7 +69,9 @@
@click="onMenuBlur" @click="onMenuBlur"
@mousedown.stop @mousedown.stop
> >
<li class="menu-item menu-item__one">重命名</li> <li class="menu-item menu-item__one" @click="Rename(item)">
重命名
</li>
<li <li
class="menu-item menu-item__two" class="menu-item menu-item__two"
@click="deleteTheClassification(item)" @click="deleteTheClassification(item)"
...@@ -146,12 +148,16 @@ ...@@ -146,12 +148,16 @@
@close="CopyShow = false" @close="CopyShow = false"
/> />
</common-dialog> </common-dialog>
<common-dialog v-if="renameShow" @closePopup="renameShow = false" showMask>
<rename :oldName="itemName" :oldID="itemID" @close="renameShow = false" @update="successCallback"/>
</common-dialog>
</div> </div>
</template> </template>
<script> <script>
import CopyTemplate from "@/components/TemplateManage/CopyTemplate.vue"; import CopyTemplate from "@/components/TemplateManage/CopyTemplate.vue";
import CommonDialog from "@/components/CommonDialog.vue"; import CommonDialog from "@/components/CommonDialog.vue";
import rename from "@/components/TemplateManage/rename.vue";
import SearchBar from "@/components/TemplateManage/SearchBar.vue"; import SearchBar from "@/components/TemplateManage/SearchBar.vue";
import CategoryAdd from "@/components/TemplateManage/CategoryAdd.vue"; import CategoryAdd from "@/components/TemplateManage/CategoryAdd.vue";
import AddTemplate from "@/components/TemplateManage/AddTemplate.vue"; import AddTemplate from "@/components/TemplateManage/AddTemplate.vue";
...@@ -173,6 +179,9 @@ export default { ...@@ -173,6 +179,9 @@ export default {
CopyShow: false, CopyShow: false,
TemplateID: -1, TemplateID: -1,
classIndex: -1, classIndex: -1,
renameShow: false,
itemName: "",
itemID:-1
}; };
}, },
components: { components: {
...@@ -181,6 +190,7 @@ export default { ...@@ -181,6 +190,7 @@ export default {
CommonDialog, CommonDialog,
AddTemplate, AddTemplate,
CopyTemplate, CopyTemplate,
rename,
}, },
created() { created() {
this.listOfSystem(); this.listOfSystem();
...@@ -190,6 +200,11 @@ export default { ...@@ -190,6 +200,11 @@ export default {
} }
}, },
methods: { methods: {
Rename(item) {
this.renameShow = true;
this.itemName = item.name;
this.itemID=item.id
},
// 删除分类 // 删除分类
async deleteTheClassification(item) { async deleteTheClassification(item) {
const res = await this.$ajax({ const res = await this.$ajax({
......
<template> <template>
<div class="body" :class="{ 'body--two': status === 0 }"> <div class="body" :class="{ 'body--two': status === 0 }">
<h1 v-if="status === 2">删除</h1>
<h1 v-if="status === 0">提示</h1> <h1 v-if="status === 0">提示</h1>
<h1 v-else>删除</h1>
<textarea <textarea
placeholder="请输入删除原因" placeholder="请输入删除原因"
v-model="deleteRemark" v-model="deleteRemark"
v-if="status === 2" v-if="status !== 0"
></textarea> ></textarea>
<p v-if="status === 0">此操作将永久删除该文件, 是否继续?</p> <p v-if="status === 0">此操作将永久删除该文件, 是否继续?</p>
<div class="footer" :class="{ 'footer--two': status === 0 }"> <div class="footer" :class="{ 'footer--two': status === 0 }">
...@@ -50,11 +50,8 @@ export default { ...@@ -50,11 +50,8 @@ export default {
case 0: case 0:
this.deleteConfirm({ id: Number(this.id) }); this.deleteConfirm({ id: Number(this.id) });
break; break;
case 2:
this.checkReason();
break;
default: default:
return false; this.checkReason();
break; break;
} }
}, },
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
@delete-incremental="deleteTheIncremental" @delete-incremental="deleteTheIncremental"
@incremental-chain="incrementalOnChain" @incremental-chain="incrementalOnChain"
@create-copy="createCopy" @create-copy="createCopy"
@privacy-settings="privacySettings"
/> />
</div> </div>
<!-- 页码组件 --> <!-- 页码组件 -->
...@@ -119,6 +120,14 @@ ...@@ -119,6 +120,14 @@
@update="getList" @update="getList"
></copy-goods> ></copy-goods>
</common-dialog> </common-dialog>
<!-- prompt -->
<common-dialog showMask v-if="PromptShow" @closePopup="PromptShow = false">
<prompt
tip="确定要隐藏该条记录吗"
@close="PromptShow = false"
@confirm="hiddenCertificate"
/>
</common-dialog>
<!-- 增量弹窗 --> <!-- 增量弹窗 -->
<div class="chain-dialog" v-show="isShowToChainDialog"> <div class="chain-dialog" v-show="isShowToChainDialog">
<div class="chain-mask" @click="isShowToChainDialog = false"></div> <div class="chain-mask" @click="isShowToChainDialog = false"></div>
...@@ -154,6 +163,7 @@ import AddGoods from "./addGoods.vue"; // 添加存证 ...@@ -154,6 +163,7 @@ import AddGoods from "./addGoods.vue"; // 添加存证
import deleteGoods from "./deleteGoods.vue"; // 删除组件 import deleteGoods from "./deleteGoods.vue"; // 删除组件
import Uncertified from "@/components/Uncertified.vue"; // 未认证提示组件 import Uncertified from "@/components/Uncertified.vue"; // 未认证提示组件
import copyGoods from "@/components/newProductList/copyGoods.vue"; import copyGoods from "@/components/newProductList/copyGoods.vue";
import prompt from "@/components/newProductList/prompt.vue";
export default { export default {
components: { components: {
...@@ -166,6 +176,7 @@ export default { ...@@ -166,6 +176,7 @@ export default {
deleteGoods, deleteGoods,
Uncertified, Uncertified,
copyGoods, copyGoods,
prompt,
}, },
data() { data() {
return { return {
...@@ -193,12 +204,36 @@ export default { ...@@ -193,12 +204,36 @@ export default {
TheIncrementalData: null, //增量数据 TheIncrementalData: null, //增量数据
isShowCopy: false, isShowCopy: false,
Copydetails: {}, Copydetails: {},
PromptShow: false,
PromptID: -1,
}; };
}, },
created() { created() {
this.getList(); // 获取所有商品 this.getList(); // 获取所有商品
}, },
methods: { methods: {
async hiddenCertificate() {
const res = await this.$ajax({
type: "POST",
url: GO_URLS.deleteBlockChainProof,
params: {
id: this.PromptID,
},
});
if (res) {
this.getList();
this.PromptShow = false;
this.$message({
type: "success",
message: "隐藏成功!",
});
}
},
privacySettings(val) {
console.log(val);
this.PromptID = val.id;
this.PromptShow = true;
},
// 创建副本 // 创建副本
createCopy(item) { createCopy(item) {
this.Copydetails = item; this.Copydetails = item;
......
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