Commit e8cf0ab9 authored by zL's avatar zL

提交部分代码

parent 4a85d0ef
......@@ -9141,6 +9141,23 @@
"integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=",
"dev": true
},
"simple-components01": {
"version": "0.1.15",
"resolved": "https://registry.npmjs.org/simple-components01/-/simple-components01-0.1.15.tgz",
"integrity": "sha512-ArG9rsYhyLJ1vcwO1k3bIPe6uMdYiOYOnmcMlcm4r5JQ63hIzrvfGLhjfRvluunDUfYkqY+hT8xb4jPiKuZBdQ==",
"requires": {
"core-js": "^2.6.5",
"element-ui": "^2.11.1",
"vue": "^2.6.10"
},
"dependencies": {
"core-js": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
"integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
}
}
},
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npm.taobao.org/simple-swizzle/download/simple-swizzle-0.2.2.tgz",
......
......@@ -14,6 +14,7 @@
"element-ui": "^2.13.2",
"js-md5": "^0.7.3",
"qrcode": "^1.4.4",
"simple-components01": "^0.1.15",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
"vue-cropper": "^0.5.5",
......
<!--
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-08-15 15:32:16
* @LastEditTime: 2019-08-15 15:32:16
* @LastEditors: your name
-->
<template>
<common-dialog id="add_child_dialog" @closePopup="emitClose">
<div class="c-dialog">
<h2 class="c-dialog-title l-title">添加下一级</h2>
<!--<div class="dialog-input-con-con">-->
<PcMyscroll ref="scrollObj">
<div slot="mylist">
<dialog-input
ref="List"
v-for="item in propertyList"
class="l-input t-input"
v-model="item.label"
:errorShowing="isErrorShowing"
maxlength="10"
:key="item.id"
>
<div class="shanchu-con">
<i class="iconfont iconshanchu-" @click="deleteTmpItem(item)"></i>
</div>
</dialog-input>
</div>
</PcMyscroll>
<!--</div>-->
<div class="btn_add" @click="addNewProperty">
<i class="iconfont btn_add-icon iconjixutianjia"></i>
<span class="btn_add-text">继续添加</span>
</div>
<div class="c-dialog-btn_wrapper l-btn_wrapper">
<button class="g-btn_primary c-dialog-btn_cancel" @click="emitClose">
取消
</button>
<button class="g-btn_primary c-dialog-btn_confirm" @click="emitConfirm">
确定
</button>
</div>
</div>
</common-dialog>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import CommonDialog from "@/components/CommonDialog.vue";
import { getUuid } from "@/utils/tool";
import DialogInput from "@/components/DialogInput.vue";
let Con33 = require("../../../node_modules/simple-components01/src/main.js");
let PcMyscroll = Con33.default;
interface Item {
id: string;
label: string;
}
/**
* 添加下一级字段
* @author yuanzeyu
* @date 2019-06-04
* @desc
*/
@Component({
components: {
CommonDialog,
DialogInput,
PcMyscroll,
},
})
export default class AddChildDialog extends Vue {
public propertyList: Item[] = [];
public isErrorShowing: boolean = false;
public addNewProperty() {
this.propertyList.push({
id: getUuid(),
label: "",
});
// 聚焦最底部input
// setTimeout(() => {
// let List: any = this.$refs.List;
// List[List.length - 1].$el.childNodes[0].focus();
// }, 200);
setTimeout(() => {
let srlObj: any = this.$refs.scrollObj;
if (srlObj && srlObj.init2) {
srlObj.reCalculate(true);
srlObj.init2();
srlObj.scrollToEnd("y");
}
}, 300);
}
// 删除
public deleteTmpItem(item: Item) {
for (let i = this.propertyList.length - 1; i > -1; i--) {
let _item = this.propertyList[i];
if (_item.id == item.id) {
this.propertyList.splice(i, 1);
setTimeout(() => {
let srlObj: any = this.$refs.scrollObj;
if (srlObj && srlObj.init2) {
srlObj.reCalculate(false, 66); //注意这个配置参数
srlObj.init2();
}
}, 100);
break;
}
}
if (this.propertyList.length == 0) {
this.emitClose();
}
}
public emitConfirm() {
const empty = this.propertyList.some((item) => item.label.length === 0);
if (empty) {
this.isErrorShowing = true;
return;
}
this.$emit(
"confirm",
this.propertyList.map((item) => item.label)
);
this.emitClose();
}
public emitClose() {
this.$emit("close");
}
public created() {
this.addNewProperty();
}
}
</script>
<style scoped lang="less">
// @import "./common.css";
/* 添加模板公用样式 */
.c-dialog {
width: 500px;
/* 600 - 100 */
padding: 34px 50px 63px 50px;
}
.c-dialog-title {
margin: 0;
font-size: 22px;
line-height: 30px;
color: #000;
font-weight: 500;
}
.c-dialog-input {
box-sizing: border-box;
padding: 0 26px;
width: 500px;
height: 44px;
border: 1px solid #e2e2e2;
color: var(--base-color);
font-weight: 400;
font-size: 18px;
background: transparent;
outline: none;
&::placeholder {
color: var(--base-color);
}
}
.c-dialog-btn_wrapper {
text-align: right;
}
.c-dialog-btn_confirm {
width: 120px;
height: 40px;
border-radius: 4px;
&:after {
clear: both;
}
}
.c-dialog-btn_cancel {
margin-right: 22px;
/* 28 - (40 - 28) / 2 */
color: #5c6476;
background: transparent;
height: 40px;
width: 60px;
}
.c-dialog {
padding: 34px 0 63px 50px;
}
.c-dialog-btn_wrapper {
padding-right: 50px;
}
.l-title {
margin-bottom: 42px;
}
.l-input {
margin-bottom: 16px; /* todo ui未给出多行情况 */
}
/deep/ .l-input input {
width: 440px;
}
.btn_add {
color: #abafb6;
line-height: 20px;
height: 20px;
font-size: 0;
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn_add-icon {
margin: 1px 6px 0 0;
display: inline-block;
vertical-align: top;
font-size: 20px;
color: #b1b5bc;
}
.btn_add-text {
font-size: 14px;
vertical-align: top;
}
.l-btn_wrapper {
margin-top: 11px;
}
.shanchu-con {
display: inline-block;
position: relative;
width: 22px;
position: absolute;
line-height: 44px;
padding-left: 14px;
}
.iconshanchu- {
font-size: 20px;
left: 0;
top: 0;
color: #eaeaea;
}
.dialog-input-con-con {
height: 360px;
position: relative;
}
.dialog-input-con {
position: absolute;
z-index: 1;
top: 45px;
bottom: 48px;
left: 0;
width: 100%;
background: #aaa;
overflow: auto;
}
/deep/ .c-dialog {
max-height: 600px;
}
/deep/ .dialog_content {
max-height: 570px;
}
/deep/ .pc-myscroll {
height: auto;
max-height: 360px;
}
/deep/ .mylist {
padding: 5px 0 5px 0;
}
/deep/.mybar {
background-color: #efefef;
width: 16px;
}
</style>
<style lang='less'>
#add_child_dialog {
& .t-input {
& .input {
color: var(--base-color);
}
}
}
</style>
<template>
<!-- 添加一级标题输入框 -->
<common-dialog id="add_root_dialog" @closePopup="emitClose">
<div class="c-dialog">
<h2 class="c-dialog-title">添加一级标题</h2>
<dialog-input
class="l-input t-input"
v-model="bindValue"
:errorShowing="isErrorShowing"
placeholder="输入一级标题名称"
:maxlength="limit"
/>
<div class="c-dialog-btn_wrapper">
<button class="g-btn_primary c-dialog-btn_cancel" @click="emitClose">
取消
</button>
<button class="g-btn_primary c-dialog-btn_confirm" @click="emitConfirm">
确定
</button>
</div>
</div>
</common-dialog>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import CommonDialog from "@/components/CommonDialog.vue";
// import { Limit } from "@/config";
import DialogInput from "@/components/DialogInput.vue";
@Component({
components: {
CommonDialog,
DialogInput,
},
})
export default class AddRootDialog extends Vue {
public limit = 10;
public bindValue: string = "";
public isErrorShowing: boolean = false;
public emitConfirm() {
// console.log(1);
if (this.bindValue.length === 0) {
this.isErrorShowing = true;
return;
}
this.$emit("confirm", this.bindValue);
this.emitClose();
}
public emitClose() {
this.$emit("close");
}
}
</script>
<style scoped lang='less'>
.l-input {
margin: 42px 0 47px 0;
}
#add_root_dialog {
& .t-input {
& .input {
color: var(--base-color);
}
}
}
/* 添加模板公用样式 */
.c-dialog {
width: 500px;
/* 600 - 100 */
padding: 34px 50px 63px 50px;
}
.c-dialog-title {
margin: 0;
font-size: 22px;
line-height: 30px;
color: #000;
font-weight: 500;
}
.c-dialog-btn_wrapper {
text-align: right;
}
.c-dialog-btn_confirm {
width: 120px;
height: 40px;
border-radius: 4px;
&:after {
clear: both;
}
}
.c-dialog-btn_cancel {
margin-right: 22px;
/* 28 - (40 - 28) / 2 */
color: #5c6476;
background: transparent;
height: 40px;
width: 60px;
}
</style>
<template>
<div class="box">
<h1>设置表现形式</h1>
<div class="center">
<div class="optional" @click="select(PropertyType.Input)">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Input,
iconxingzhuang2: TypeNum === PropertyType.Input,
iconweixuanze: TypeNum !== PropertyType.Input,
}"
></i>
输入框
<input type="text" value disabled="disabled" />
</div>
<div class="optional optional--right" @click="select(PropertyType.Date)">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Date,
iconxingzhuang2: TypeNum === PropertyType.Date,
iconweixuanze: TypeNum !== PropertyType.Date,
}"
></i
>日期
<input type="text" class="mr" value disabled="disabled" />
<div class="data-box">
<i class="iconfont iconxingzhuang"></i>
</div>
</div>
<div class="optional" @click="select(PropertyType.Image)">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Image,
iconxingzhuang2: TypeNum === PropertyType.Image,
iconweixuanze: TypeNum !== PropertyType.Image,
}"
></i
>上传图片
<div class="big-box">
<div class="pic-box">+</div>
</div>
</div>
<!-- 下拉框 -->
<div
class="optional optional--right"
@click="select(PropertyType.Select)"
>
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Select,
iconxingzhuang2: TypeNum === PropertyType.Select,
iconweixuanze: TypeNum !== PropertyType.Select,
}"
></i
>下拉框
<input type="text" value disabled="disabled" />
<div class="data-box">
<i class="iconfont iconxiangxia"></i>
</div>
</div>
<div class="optional" @click="select(PropertyType.File)">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.File,
iconxingzhuang2: TypeNum === PropertyType.File,
iconweixuanze: TypeNum !== PropertyType.File,
}"
></i
>上传PDF
<div class="big-box">
<div class="pic-box">
<i class="iconfont iconshangchuanwenjian"></i>
</div>
</div>
</div>
<div class="optional optional--right" @click="select(PropertyType.Video)">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Video,
iconxingzhuang2: TypeNum === PropertyType.Video,
iconweixuanze: TypeNum !== PropertyType.Video,
}"
></i
>上传视频
<div class="big-box">
<div class="pic-box">
<i class="iconfont iconshangchuanwenjian"></i>
</div>
</div>
</div>
<div class="optional" @click="select(PropertyType.Editor)">
<div class="left">
<i
:class="{
iconfont: true,
'i--check': TypeNum === PropertyType.Editor,
iconxingzhuang2: TypeNum === PropertyType.Editor,
iconweixuanze: TypeNum !== PropertyType.Editor,
}"
></i
>编辑器
</div>
<div class="editor"></div>
</div>
</div>
<div class="footer">
<div class="btn btn--cancel" @click="cancel">取消</div>
<div class="btn" @click="selectType">确定</div>
</div>
</div>
</template>
<script>
import { PropertyType } from "@/plugins/types";
export default {
props: ["selectedEditItem"],
data() {
return {
PropertyType: PropertyType,
TypeNum: -1,
};
},
watch: {
selectedEditItem: {
handler(newName, oldName) {
this.TypeNum = newName.type;
},
deep: true,
immediate: true,
},
},
created() {},
computed: {},
methods: {
cancel() {
this.$emit("cancel");
},
selectType() {
if (this.TypeNum === -1) {
this.$message({
message: "未选择变更项目",
type: "warning",
});
return false;
}
this.$emit("select-type", this.TypeNum);
this.$emit("cancel");
},
// 选择
select(val) {
// 一级标题不可变更。
if (
this.selectedEditItem &&
this.selectedEditItem.hasOwnProperty("title")
) {
return false;
}
this.TypeNum = val;
},
},
};
</script>
<style scoped lang="less">
input {
width: 140px;
height: 30px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(231, 231, 231, 1);
font-size: 12px;
font-weight: 400;
text-indent: 12px;
color: #d8d8d8;
margin-left: 16px;
}
.box {
width: 549px;
height: 428px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 20px 0px rgba(61, 118, 249, 0.18);
padding: 0 50px;
h1 {
margin: 0;
padding: 0;
font-size: 16px;
font-weight: 500;
color: rgba(0, 0, 0, 1);
line-height: 1;
padding-top: 38px;
padding-bottom: 16px;
}
.center {
width: 494px;
height: 226px;
background: rgba(251, 251, 251, 1);
border: 1px solid rgba(240, 240, 240, 1);
margin: 0 auto;
padding: 18px 28px;
.optional--right {
float: right !important;
margin-right: 13px;
}
.optional {
cursor: pointer;
float: left;
font-size: 12px;
margin-bottom: 16px;
font-weight: 400;
position: relative;
color: rgba(53, 53, 53, 1);
.iconweixuanze {
color: #d1d1d1;
}
i {
margin-right: 12px;
}
.i--check {
color: #15cbba;
}
.mr {
margin-left: 28px;
}
.data-box {
position: absolute;
top: 8px;
right: 10px;
i {
color: #d8d8d8;
}
.iconxiangxia {
font-size: 12px;
// transform: scale(0.46);
}
}
.big-box {
width: 140px;
height: 32px;
display: inline-block;
margin-left: 8px;
}
.pic-box {
width: 35px;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(231, 231, 231, 1);
display: inline-block;
line-height: 32px;
text-align: center;
color: #d8d8d8;
font-size: 20px;
i {
margin: 0;
}
}
.editor {
width: 391px;
height: 75px;
margin-left: 24px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
float: left;
border: 1px solid rgba(231, 231, 231, 1);
}
.left {
float: left;
}
}
}
.footer {
overflow: hidden;
float: right;
margin-top: 28px;
.btn {
width: 120px;
height: 40px;
background: rgba(63, 121, 254, 1);
border-radius: 4px;
float: left;
color: white;
cursor: pointer;
font-size: 14px;
text-align: center;
line-height: 40px;
}
.btn--cancel {
background: white;
color: #5c6476;
}
}
}
</style>
This diff is collapsed.
......@@ -6,33 +6,49 @@
</div>-->
<div class="body_center">
<div class="left">
<span :class="{'span--check':isActive,'classification':true}" @click="systemSelected">
<span
:class="{ 'span--check': isActive, classification: true }"
@click="systemSelected"
>
<div class="up">
<i class="iconfont icongengduo1"></i>
</div>系统模板
</div>
系统模板
</span>
<!-- <div> -->
<ul class="system-list" :style="showHeight">
<li v-for="(item,index) in SystemList" :key="index" @click="check(item,index)">
<li
v-for="(item, index) in SystemList"
:key="index"
@click="check(item, index)"
>
<i class="iconfont iconwenjianjia"></i>
<span :class="{'name--check':index===checkIndex}">{{item.folder_name}}</span>
<span :class="{ 'name--check': index === checkIndex }">{{
item.folder_name
}}</span>
</li>
</ul>
<!-- </div> -->
<span :class="{'span--check':!isActive,'classification':true}" @click="my">
<div class="up" :class="{'up--down':true}">
<span
:class="{ 'span--check': !isActive, classification: true }"
@click="my"
>
<div class="up" :class="{ 'up--down': true }">
<i class="iconfont icongengduo1"></i>
</div>我的模板
</div>
我的模板
</span>
<!-- 个人模板>分类 -->
<ul class="system-list" :style="showHeight2">
<li
v-for="(item,index) in PersonalClassification"
v-for="(item, index) in PersonalClassification"
:key="index"
@click="checkMy(item,index)"
@click="checkMy(item, index)"
>
<i class="iconfont iconwenjianjia"></i>
<span :class="{'name--check':index===checkIndex2}">{{item.name}}</span>
<span :class="{ 'name--check': index === checkIndex2 }">{{
item.name
}}</span>
</li>
</ul>
<!-- 分类模块暂时隐藏 -->
......@@ -40,16 +56,27 @@
</div>
<div class="right">
<ul>
<li v-for="(item,index) in ListOfDetails" :key="index" @click="selection(item,index)">
<li
v-for="(item, index) in ListOfDetails"
:key="index"
@click="selection(item, index)"
>
<img
src="https://f10.baidu.com/it/u=557133877,2120362237&fm=72"
v-if="isActive && !item.image_url"
/>
<img :src="item.image_url" v-if="isActive && item.image_url" />
<img
src="../../../../../src/entry/refactoring/images/just.jpg"
v-if="isActive&&!item.image_url"
v-if="!isActive"
src="../../entry/refactoring/images/TemplateManage/self-tmpl-bg.png"
class="img_my"
/>
<img :src="item.image_url" v-if="isActive&&item.image_url" />
<img v-if="!isActive" src="../../../../assets/images/self-tmpl-bg.png" class="img_my" />
<span :class="{'my':!isActive}">{{item.name}}</span>
<div class="iconbox" :class="{'iconbox_my':!isActive}">
<i class="iconfont iconxingzhuang2" v-if="coordinate===index"></i>
<span :class="{ my: !isActive }">{{ item.name }}</span>
<div class="iconbox" :class="{ iconbox_my: !isActive }">
<i
class="iconfont iconxingzhuang2"
v-if="coordinate === index"
></i>
<i class="iconfont iconweixuanze" v-else></i>
</div>
</li>
......@@ -67,7 +94,7 @@
<!-- 预览弹窗 -->
<common-dialog
v-if="previewWindow"
@closePopup="previewWindow=false"
@closePopup="previewWindow = false"
showMask
class="template-popup__style"
>
......@@ -241,8 +268,6 @@ export default class TemplatePopup extends Vue {
public systemSelected() {
// isActive true为系统模板,false为个人模板
if (this.isActive) {
if (this.BenchmarkHeight === 31) {
this.BenchmarkHeight = 0;
} else {
......
......@@ -245,12 +245,11 @@ import ReadOnly from "./readOnly.vue"; // 回显
import AddLevel1Button from "@/components/editTemplate/AddLevel1Button.vue";
import SetBar from "@/components/editTemplate/SetBar.vue";
import RootUnit from "@/components/editTemplate/RootUnit.vue";
// import TemplatePopup from "@/entry/refactoring/views/template/TemplatePopup.vue";
// import banner from "@/entry/refactoring/components/editTemplate/banner.vue";
// import ModifyPresentation from "@/entry/refactoring/components/editTemplate/ModifyPresentation.vue"; //修改表现形式
// import AddChildDialog from "@/entry/refactoring/components/editTemplate/AddChildDialog.vue"; //添加下一级
//分割线-------------------------
// import AddRootDialog from "@/views/template/AddTemplate/AddRootDialog.vue";
import ModifyPresentation from "@/components/editTemplate/ModifyPresentation.vue"; //修改表现形式
import banner from "@/components/editTemplate/banner.vue";
import TemplatePopup from "./TemplatePopup.vue";
import AddChildDialog from "@/components/editTemplate/AddChildDialog.vue"; //添加下一级
import AddRootDialog from "@/components/editTemplate/AddRootDialog.vue";
// import ModifyTitle from "@/views/template/AddTemplate/ModifyTitle.vue"; //修改标题
// 未认证提示组件
// import Uncertified from "@/views/template/Uncertified.vue";
......@@ -264,13 +263,13 @@ import RootUnit from "@/components/editTemplate/RootUnit.vue";
AddLevel1Button,
RootUnit,
SetBar,
// banner,
// AddRootDialog,
// AddChildDialog,
// TemplatePopup,
ModifyPresentation,
banner,
TemplatePopup,
AddChildDialog,
AddRootDialog,
// ChooseClassification,
// ModifyTitle,
// ModifyPresentation,
// Uncertified,
// guide
},
......
......@@ -19,7 +19,7 @@ import { GO_URLS } from "@/config/URLS";
import { Unit } from "@/plugins/types2";
// 取本地数据转换函数
import { formatTemplateApi2Local } from "@/plugins/Template";
import RootUnit from "@/views/template/AddTemplate/RootUnit.vue";
import RootUnit from "@/components/editTemplate/RootUnit.vue";
@Component({
components: {
RootUnit,
......
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