From 368136482d8098b6c888ab05c49f1ed44523be89 Mon Sep 17 00:00:00 2001 From: zhengzhou Date: Fri, 23 Apr 2021 14:01:53 +0800 Subject: [PATCH] update --- .../template/components/template-files.vue | 102 +++++++++++++++++- src/views/manage_company/template/detail.vue | 60 +++++++++-- 2 files changed, 150 insertions(+), 12 deletions(-) diff --git a/src/views/manage_company/template/components/template-files.vue b/src/views/manage_company/template/components/template-files.vue index f30f9b9e..f2f03822 100644 --- a/src/views/manage_company/template/components/template-files.vue +++ b/src/views/manage_company/template/components/template-files.vue @@ -6,6 +6,7 @@ v-for="node in nodeList" :class="{ item_active: node === selectedNode }" :key="node.id" + @click.stop="selectedNode = node" > {{ node.label }} @@ -14,17 +15,45 @@
模板样板文件
- +
+
+
文件名
+
文件扩展名
+
文件大小
+
+
+
新增样板文件 - 上传文件 + + 上传文件 + +
+
+
+
文件名
+
文件扩展名
+
文件大小
+
+ 删除 +
+
@@ -100,6 +152,46 @@ export default { margin: auto 0; } } + + &_list { + &_item { + display: flex; + flex-direction: row; + height: 40px; + line-height: 40px; + border-bottom: 1px solid rgba(#111111, 0.1); + >div { + position: relative; + padding-left: 10px; + font-size: 12px; + &:first-child { + padding-left: 24px; + flex: 407; + } + &:nth-child(2) { flex: 139; } + &:nth-child(3) { flex: 140; } + &:nth-child(4) { flex: 70; } + &:nth-child(2), + &:nth-child(3) { + &:before { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + margin: auto 0; + width: 1px; + height: 32px; + background-color: rgba(#111111, 0.1); + } + } + } + + .del_button { + color: #d20f00; + } + } + } } .node_list_item { height: 28px; diff --git a/src/views/manage_company/template/detail.vue b/src/views/manage_company/template/detail.vue index 80cc7575..1a2f3378 100644 --- a/src/views/manage_company/template/detail.vue +++ b/src/views/manage_company/template/detail.vue @@ -14,7 +14,7 @@ :backBtnTitle="prevViewName || '返回'" > - @@ -82,9 +101,9 @@ import { queryTemplateById, queryTemplateNodeByTemplateId, } from "@/services/template"; -import { firstCharToLowerCase } from "@/utils/tool"; +import { firstCharToLowerCase, notify } from "@/utils/tool"; import { queryAllIndustry } from "@/services/industry"; -import { addTemplateToCompany } from "./tool"; +import { addTemplateToCompany, removeTemplate } from "./tool"; import Info from "./components/info"; import TemplateFiles from './components/template-files'; @@ -167,6 +186,12 @@ export default { this.$notify({ message: "添加成功", type: "success" }); this.templateIsAdded = true; }, + async removeTemplate() { + const res = await removeTemplate(this.companyId, this.templateId); + if(res.Code) { return; } + notify.success('移除成功'); + this.$router.go(-1); + }, }, }; @@ -196,6 +221,7 @@ function flatternTree(treeHeadNode) { align-items: stretch; padding: 0 40px; &_left { + position: relative; flex: none; width: 250px + 16px; padding-right: 16px; @@ -209,6 +235,7 @@ function flatternTree(treeHeadNode) { } &_list { &_item { + position: relative; height: 44px; line-height: 44px; background-color: #fff; @@ -229,6 +256,25 @@ function flatternTree(treeHeadNode) { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; } + .item_icon { + position: absolute; + top: 0; + bottom: 0; + margin: auto 0; + right: 20px; + font-size: 26px; + height: 1em; + &.el-icon-delete-solid { + color: #D6243A; + } + } + } + &_group.bottom { + position: absolute; + bottom: 60px; + left: 0; + right: 16px; + // width: 100%; } } }