Commit 8e3778a7 authored by zL's avatar zL

去除多余代码

parent 3dee6489
......@@ -36,7 +36,7 @@ let router = new Router({ // todo 移除旧页面
{
path: '/choosePackage',
name: 'choosePackage',
component: () => import(/* webpackChunkName: "companyVerify" */ '@/views/userCenter/choosePackage.vue')
component: () => import(/* webpackChunkName: "companyVerify" */ './views/user/choosePackage.vue')
},
{
path: '/initPassword',
......
......@@ -14,7 +14,7 @@
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import MainHeader from "./MainHeader.vue";
import MainMenu from "./MainMenu.vue";
import MainMenu from "@/components/MainMenu/MainMenu.vue";
@Component({
components: {
MainMenu,
......
<template>
<!-- 左侧导航栏 -->
<nav class="main_menu">
<div
class="menu-item menu-item_first"
:class="{ 'js-menu-item_active': currentRoute === 0 }"
@click="selectPage(0, 'categoryManage')"
>
<div class="menu-item_subject-icon">
<i class="iconfont">&#xe62b;</i>
</div>
<div class="menu-item-label">存证</div>
<div class="menu-item-active_border"></div>
</div>
<div
class="menu-item menu-item_product"
:class="{ 'js-menu-item_active': currentRoute === 1 }"
@click="selectPage(1)"
>
<div class="menu-item_product-icon">
<i class="iconfont">&#xe629;</i>
</div>
<div class="menu-item-label">溯源</div>
<div class="menu-item-active_border"></div>
</div>
<div
class="menu-item menu-item_template"
:class="{ 'js-menu-item_active': currentRoute === 2 }"
@click="selectPage(2, 'userCenter')"
>
<div class="menu-item_template-icon">
<i class="iconfont">&#xe62a;</i>
</div>
<div class="menu-item-label">管理</div>
<div class="menu-item-active_border"></div>
</div>
</nav>
</template>
<script>
let UrlPrefixObj = require("@/config/UrlPrefix");
export default {
data() {
return {
currentRoute: 0,
};
},
methods: {
selectPage(idnex, path) {
if (idnex === 1) {
window.open(UrlPrefixObj.model.CHAIN_BROWSER_URL_PREFIX);
} else {
this.currentRoute = idnex;
this.$router.push({ path: path });
}
},
},
};
</script>
<style scoped lang="less">
.main_menu {
width: 62px;
height: 100%;
background: #27272a;
color: rgba(255, 255, 255, 0.6);
text-align: center;
font-size: 12px;
}
.menu-item {
height: 60px;
position: relative;
}
.menu-item_first {
margin-top: 79px;
}
.menu-item_product {
margin-top: 21px; /* 30 - 9 */
}
.menu-item_template {
margin-top: 26px; /* 36 - 10 */
}
.js-menu-item_active {
background: #39393e;
cursor: pointer;
& > .menu-item-active_border {
display: initial;
}
}
.menu-item-active_border {
display: none;
position: absolute;
top: 0;
left: 0;
width: 3px;
height: 100%;
background: #3f79fe;
}
.menu-item_subject-icon {
padding: 14px 0 5px 0;
& > i {
font-size: 14px;
}
}
.menu-item_product-icon {
padding: 12px 0 6px 0;
cursor: pointer;
& > i {
font-size: 15px;
}
}
.menu-item_template-icon {
padding: 9px 0 8px 0;
cursor: pointer;
& > i {
font-size: 16px;
}
}
.menu-item-label {
line-height: 17px;
}
</style>
......@@ -74,7 +74,7 @@ import { Component, Vue, Watch } from "vue-property-decorator";
// 模板管理部分
import TemplateManage from "./TemplateManage.vue";
// 右侧存证部分
import newProductList from "./newProductList.vue";
import newProductList from "@/components/category/ProductList.vue";
//删除页
import deleted from "@/views/category/deleted.vue";
// 引导页
......
<template>
<div class="subject">
<h1>添加存证</h1>
<input v-model.trim="name" type="text" placeholder="请输入存证名称" />
<div class="btn-box">
<div class="btn btn-cancel" @click="$emit('cancel')">取消</div>
<div class="btn btn-determine" @click="determine">确定</div>
</div>
</div>
</template>
<script>
import { GO_URLS } from "@/config/URLS";
import * as storage from "@/plugins/storage";
export default {
// 引入组件
components: {},
props: [],
data() {
return {
name: "",
};
},
created() {},
computed: {
//
},
methods: {
// 确认按钮
async determine() {
if (!this.name) {
this.$message("请输入名称");
return false;
}
const res = await this.$ajax({
type: "post",
url: GO_URLS.add,
params: {
name: this.name,
note: JSON.stringify({
version: 1,
userName: this.$store.state.userInfos.user || "",
userIcon: this.$store.state.userInfos.icon || "",
evidenceName: this.name,
stepName: "",
banners: [],
}),
detail: JSON.stringify([
{
label: "ext",
key: "",
type: 3,
data: [
{
data: {
type: "text",
format: "string",
value: this.name,
},
type: 0,
key: "存证名称",
label: "存证名称",
},
{
data: {
type: "text",
format: "hash",
value: "null",
},
type: 0,
key: "basehash",
label: "basehash",
},
{
data: {
type: "text",
format: "hash",
value: "null",
},
type: 0,
key: "prehash",
label: "prehash",
},
{
data: {
type: "text",
format: "string",
value: null,
},
type: 0,
key: "存证类型",
label: "存证类型",
},
],
},
{},
]),
},
});
if (res) {
this.$message({
message: "添加成功",
type: "success",
});
this.$router.push({
path: "/editTemplate",
query: {
personalTemplateId: res.data.id,
},
});
}
},
},
};
</script>
<style scoped lang="less">
.subject {
width: 512px;
height: 279px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 20px 0px rgba(61, 118, 249, 0.18);
padding: 0 44px;
}
h1 {
padding-top: 34px;
padding-bottom: 42px;
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(53, 53, 53, 1);
}
input {
width: 500px;
height: 44px;
border: 1px solid rgba(226, 226, 226, 1);
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: black;
line-height: 25px;
text-indent: 26px;
&::-webkit-input-placeholder {
/* WebKit browsers */
color: #b6b5ba;
}
&:-moz-placeholder {
color: #b6b5ba;
}
&::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #b6b5ba;
}
&:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #b6b5ba;
}
}
input:focus {
outline: none;
border: 1px solid rgba(226, 226, 226, 1);
}
.btn-box {
overflow: hidden;
padding-top: 40px;
float: right;
}
.btn {
float: left;
width: 120px;
height: 40px;
border-radius: 4px;
text-align: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
line-height: 40px;
cursor: pointer;
}
.btn-cancel {
color: rgba(92, 100, 118, 1);
}
.btn-determine {
background: rgba(63, 121, 254, 1);
color: white;
}
</style>
<template>
<div class="body" :class="{ 'body--two': status === 0 }">
<h1 v-if="status === 0">提示</h1>
<h1 v-else>删除</h1>
<textarea
placeholder="请输入删除原因"
v-model="deleteRemark"
v-if="status !== 0"
></textarea>
<p v-if="status === 0">此操作将永久删除该文件, 是否继续?</p>
<div class="footer" :class="{ 'footer--two': status === 0 }">
<div @click="cancel">取消</div>
<div class="determine" @click="Determine">确定</div>
</div>
</div>
</template>
<script>
import { GO_URLS } from "@/config/URLS";
export default {
props: {
id: 0,
status: null,
},
data() {
return {
deleteRemark: "",
};
},
created() {},
methods: {
checkReason() {
if (this.deleteRemark.trim() === "") {
this.$message({
message: "删除原因不可为空",
type: "warning",
});
return;
} else if (this.deleteRemark.trim().length > 30) {
this.$message({
showClose: true,
message: "删除原因长度不可大于三十字",
type: "warning",
});
return false;
}
this.moveRecycleBin();
},
Determine() {
switch (this.status) {
case 0:
this.deleteConfirm({ id: Number(this.id) });
break;
default:
this.checkReason();
break;
}
},
// 移入回收站
async moveRecycleBin() {
const res = await this.$ajax({
type: "post",
url: GO_URLS.abandon,
params: {
id: this.id,
abandon_remark: this.deleteRemark,
},
});
if (res) {
this.$emit("deleteSuccess");
}
},
// 删除存证
async deleteConfirm(params) {
const res = await this.$ajax({
type: "delete",
url: GO_URLS.delete,
params: params,
});
if (res) {
this.$emit("deleteSuccess");
}
},
cancel() {
this.$emit("CloseDg");
},
},
};
</script>
<style lang="less" scoped>
.body--two {
height: 284px !important;
}
.body {
width: 600px;
height: 327px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 20px 0px rgba(61, 118, 249, 0.18);
h1 {
font-size: 22px;
font-weight: 500;
margin: 0;
color: rgba(0, 0, 0, 1);
padding: 34px 0 18px 44px;
line-height: 1;
}
textarea {
width: 500px;
height: 112px;
border: 1px solid rgba(226, 226, 226, 1);
margin-left: 50px;
font-size: 18px;
resize: none;
line-height: 25px;
padding-top: 12px;
text-indent: 12px;
&::-webkit-input-placeholder {
font-size: 18px;
font-weight: 400;
color: rgba(192, 198, 210, 1);
line-height: 25px;
}
}
p {
width: 500px;
height: 112px;
line-height: 112px;
font-size: 18px;
text-align: center;
}
.footer--two {
padding-top: 0 !important;
}
.footer {
padding-top: 42px;
float: right;
padding-right: 50px;
overflow: hidden;
div {
float: left;
width: 120px;
height: 40px;
cursor: pointer;
border-radius: 4px;
text-align: center;
font-size: 14px;
color: #5c6476;
line-height: 40px;
}
.determine {
background: rgba(63, 121, 254, 1);
color: white;
}
}
}
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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