Commit 8f15a51e authored by yyh's avatar yyh

模板流程

parent c84fdb03
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
<script src="//at.alicdn.com/t/font_1750816_4yzf3vgum.js"></script> <script src="//at.alicdn.com/t/font_1750816_0ozeo54g1duf.js"></script>
</head> </head>
<body> <body>
<audio src="https://go-czsy.oss-cn-hangzhou.aliyuncs.com/common/513271190a9ae71f3d97282f01fded19f2955324fa7d201614d1d4b5ed141d99.m4a"></audio> <audio src="https://go-czsy.oss-cn-hangzhou.aliyuncs.com/common/513271190a9ae71f3d97282f01fded19f2955324fa7d201614d1d4b5ed141d99.m4a"></audio>
......
...@@ -35,6 +35,7 @@ export default class App extends Vue { ...@@ -35,6 +35,7 @@ export default class App extends Vue {
color: #2c3e50; color: #2c3e50;
} }
html{ html{
background: #F9FBFF; // background: #F9FBFF;
background: #f9f9f9;
} }
</style> </style>
<template> <template>
<div class="van-hairline--bottom type-three"> <div class="van-hairline--bottom type-three">
<div style="text-align:left;font-size: 18px;line-height:1.5em;">{{proofSubItem.label}}</div> <!-- <div style="text-align:left;font-size: 18px;line-height:1.5em;color:#353535;font-weight:500;">{{proofSubItem.label}}</div> -->
<component <component
v-for="(item) in proofSubItem.data" v-for="(item) in proofSubItem.data"
:key="item.id" :key="item.id"
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<audit-failure v-if="authInfo.status === 3" @re-audit="reAuditHandler" :message="authInfo.message"></audit-failure> <audit-failure v-if="authInfo.status === 3" @re-audit="reAuditHandler" :message="authInfo.message"></audit-failure>
<div class="auth-success" v-if="authInfo.status === 2"> <div class="auth-success" v-if="authInfo.status === 2">
<div class="item van-hairline--bottom"><span class="key">姓名:</span><span class="value">{{authInfo.name}}</span></div> <div class="item van-hairline--bottom"><span class="key">姓名:</span><span class="value">{{authInfo.name}}</span></div>
<div class="item van-hairline--bottom"><span class="key">身份证号:</span><span class="value">{{authInfo.idCard}}</span></div> <div class="item van-hairline--bottom"><span class="key">身份证号:</span><span class="value">{{authInfo.id_card}}</span></div>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -209,7 +209,7 @@ export default class Index extends Vue { ...@@ -209,7 +209,7 @@ export default class Index extends Vue {
this.nextSelectedTemplate({ this.nextSelectedTemplate({
templateId: this.currentTemplate.id, templateId: this.currentTemplate.id,
templateName: this.currentTemplate.name, templateName: this.currentTemplate.name,
}) });
this.showSelectTemplate = false; this.showSelectTemplate = false;
} }
get ChainStatus() { get ChainStatus() {
...@@ -374,7 +374,8 @@ export default class Index extends Vue { ...@@ -374,7 +374,8 @@ export default class Index extends Vue {
box-sizing: border-box; box-sizing: border-box;
padding: 11px 14px; padding: 11px 14px;
background: #F9FBFF; background: #F9FBFF;
margin-bottom: $tabHeight; // margin-bottom: calc($tabHeight + 50px);
margin-bottom: 100px;
} }
.add-proof{ .add-proof{
position: fixed; position: fixed;
......
...@@ -2,16 +2,20 @@ ...@@ -2,16 +2,20 @@
<div class="template"> <div class="template">
<base-info @next="next" @cancel="cancelCreateTempl"></base-info> <base-info @next="next" @cancel="cancelCreateTempl"></base-info>
<div v-for="(item,index) in data" :key="index" class="template-item van-hairline--top"> <div v-for="(item,index) in data" :key="index" class="template-item van-hairline--top">
<div v-if="item.type === 3" style="margin-bottom:20px;"> <div v-if="item.type === 3">
<div style="display:flex;flex-direction:row;justify-content:space-between;" class="data-item"> <div style="display:flex;flex-direction:row;justify-content:space-between;" class="data-item van-hairline--bottom">
<div style="color:#353535;font-size:18px;font-weight:500;">{{item.label}}</div> <div style="color:#353535;font-size:18px;font-weight:500;">{{item.label}}</div>
<div @click="preAddWord(2,item)" style="color:#3F79FE;font-size:16px;">添加字段</div> <div style="width: 30px;text-align:center;">
<common-svg name="cunzhengliebiao-gengduo" @click.native="showActionHandler(index)" width="20px" height="20px"></common-svg>
</div> </div>
<div v-for="(item, index) in item.data" :key="index" class="data-item" style="margin-top:10px;"> <!-- <div @click="preAddWord(2,item)" style="color:#3F79FE;font-size:16px;">添加字段</div> -->
</div>
<div v-for="(item, index2) in item.data" :key="index2" class="data-item van-hairline--bottom" style="margin-top:10px;">
<div style="font-size:15px;color:#353535;">{{item.label}}</div> <div style="font-size:15px;color:#353535;">{{item.label}}</div>
<div>字段类型: {{typeObj[item.type]}}</div> <div style="font-size:10px;color:#818181;">字段类型: {{typeObj[item.type]}}</div>
<common-svg name="bianzu21" class="icon" width="20px" height="20px"></common-svg> <common-svg name="cunzhengliebiao-gengduo" class="icon" width="20px" height="20px" @click.native="showActionHandler(index2, index)"></common-svg>
</div> </div>
<div @click="preAddWord(2,item)" style="color:#B6B5BA;font-size:16px;text-align:center;padding:12px;background:#FFFFFF;"><common-svg name="tianjia1" width="16px" height="16px" style="margin-right:5px"></common-svg>添加下一级</div>
</div> </div>
<div v-else> <div v-else>
出错了 出错了
...@@ -43,11 +47,48 @@ ...@@ -43,11 +47,48 @@
<transition name="van-slide-up"> <transition name="van-slide-up">
<preview-template :data="data" v-if="preview" @cancel="preview = false" @employ="employ"></preview-template> <preview-template :data="data" v-if="preview" @cancel="preview = false" @employ="employ"></preview-template>
</transition> </transition>
<van-popup
v-model="showAction"
round
class="more-action"
position="bottom"
>
<van-grid :column-num="3" :gutter="10" :border="false">
<van-grid-item
icon="photo-o"
text="在上添加"
@click="addBefore"
>
<template #icon>
<common-svg name="zaishangtianjia" :width="'44px'" :height="'44px'"></common-svg>
</template>
</van-grid-item>
<van-grid-item
icon="photo-o"
text="在下添加"
@click="addAfter"
>
<template #icon>
<common-svg name="zaixiatianjia" :width="'44px'" :height="'44px'"></common-svg>
</template>
</van-grid-item>
<van-grid-item
icon="photo-o"
text="删除"
@click="delWord"
>
<template #icon>
<common-svg name="shanchu4" :width="'44px'" :height="'44px'"></common-svg>
</template>
</van-grid-item>
</van-grid>
<van-button block round @click="showAction = false;">取消</van-button>
</van-popup>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue } from 'vue-property-decorator';
import { List, Image, Field, Dialog } from 'vant'; import { List, Image, Field, Dialog, GridItem, Grid, Button, Popup } from 'vant';
import { TEMPLATETYPE, DataType } from '@/const/enum'; import { TEMPLATETYPE, DataType } from '@/const/enum';
import BaseInfo from './components/BaseInfo.vue'; import BaseInfo from './components/BaseInfo.vue';
import AddOption from './components/AddOption.vue'; import AddOption from './components/AddOption.vue';
...@@ -214,6 +255,10 @@ import PreviewTemplate from './components/PreviewTemplate.vue'; ...@@ -214,6 +255,10 @@ import PreviewTemplate from './components/PreviewTemplate.vue';
PreviewTemplate, PreviewTemplate,
[Field.name]: Field, [Field.name]: Field,
[Dialog.Component.name]: Dialog.Component, [Dialog.Component.name]: Dialog.Component,
[Grid.name]: Grid,
[GridItem.name]: GridItem,
[Button.name]: Button,
[Popup.name]: Popup,
}, },
}) })
export default class Add extends Vue { export default class Add extends Vue {
...@@ -337,7 +382,10 @@ export default class Add extends Vue { ...@@ -337,7 +382,10 @@ export default class Add extends Vue {
const obj: any = {obj1, obj2}; const obj: any = {obj1, obj2};
return obj[`obj${this.level}`]; return obj[`obj${this.level}`];
} }
private showAction: boolean = false;
private currentIndex: number = -1;
private parentIndex: number = -1;
private flag: string = '';
get templateData() { get templateData() {
const {templateName , data, folder } = this; const {templateName , data, folder } = this;
return { return {
...@@ -358,6 +406,42 @@ export default class Add extends Vue { ...@@ -358,6 +406,42 @@ export default class Add extends Vue {
private cancelCreateTempl() { private cancelCreateTempl() {
this.$router.back(); this.$router.back();
} }
private showActionHandler(index: number, parentIndex: number = -1) {
this.showAction = true;
this.currentIndex = index;
this.parentIndex = parentIndex;
}
private addBefore() {
this.flag = 'before';
const { parentIndex, currentIndex } = this;
if (parentIndex === -1) {
this.preAddWord(1);
return;
}
this.preAddWord(2, this.data[parentIndex]);
}
private addAfter() {
this.flag = 'after';
const { parentIndex, currentIndex } = this;
if (parentIndex === -1) {
this.preAddWord(1);
return;
}
this.preAddWord(2, this.data[parentIndex]);
}
private delWord() {
const { parentIndex, currentIndex } = this;
if (parentIndex === -1) {
this.data.splice(currentIndex, 1);
return;
}
this.data[parentIndex].data.splice(currentIndex, 1);
this.$toast({
message: '删除成功',
duration: 3000,
});
this.showAction = false;
}
private preAddWord(level: number, item?: any) { private preAddWord(level: number, item?: any) {
this.level = level; this.level = level;
this.show = true; this.show = true;
...@@ -375,9 +459,18 @@ export default class Add extends Vue { ...@@ -375,9 +459,18 @@ export default class Add extends Vue {
if (this.wordType === DataType.Select) { if (this.wordType === DataType.Select) {
tempData = { ...tempData, options: this.options }; tempData = { ...tempData, options: this.options };
} }
if ( this.flag !== '') {
if ( this.flag === 'after') {
this.currentIndex++;
}
this.tempData.splice(this.currentIndex, 0 , tempData);
} else {
this.tempData.push(tempData); this.tempData.push(tempData);
}
this.flag = '';
this.wordName = ''; this.wordName = '';
this.wordType = 0; this.wordType = 0;
this.showAction = false;
done(); done();
} else { } else {
done(); done();
...@@ -411,7 +504,7 @@ export default class Add extends Vue { ...@@ -411,7 +504,7 @@ export default class Add extends Vue {
<style scoped lang="scss"> <style scoped lang="scss">
.template{ .template{
position: relative; position: relative;
padding: 17px; // padding: 17px;
.template-item{ .template-item{
text-align: left; text-align: left;
display: flex; display: flex;
...@@ -419,12 +512,16 @@ export default class Add extends Vue { ...@@ -419,12 +512,16 @@ export default class Add extends Vue {
font-size: 10px; font-size: 10px;
line-height: 1.5; line-height: 1.5;
color: #818181; color: #818181;
background: #FFFFFF;
padding: 0 17px;
margin-bottom: 20px;
.data-item{ .data-item{
display: grid; display: grid;
grid-template-columns: auto 30px; grid-template-columns: auto 30px;
grid-template-rows: repeat(2, 20px); grid-template-rows: repeat(2, 20px);
grid-auto-flow: column; grid-auto-flow: column;
align-items: center; align-items: center;
padding: 10px 0;
.icon{ .icon{
grid-row: span 2; grid-row: span 2;
place-self: center; place-self: center;
...@@ -433,7 +530,8 @@ export default class Add extends Vue { ...@@ -433,7 +530,8 @@ export default class Add extends Vue {
} }
.add-word{ .add-word{
padding: 17px; padding: 17px;
margin-top: 24px; margin: 0 20px;
margin-top: 20px;
font-size: 16px; font-size: 16px;
color: #3F79FE; color: #3F79FE;
border-radius:6px; border-radius:6px;
...@@ -475,4 +573,13 @@ export default class Add extends Vue { ...@@ -475,4 +573,13 @@ export default class Add extends Vue {
} }
} }
} }
.more-action{
padding: 20px;
box-sizing: border-box;
.content{
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(3,100px);
}
}
</style> </style>
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
finished-text="没有更多了" finished-text="没有更多了"
@load="getList" @load="getList"
> >
<div v-for="item in list" :key="item.id" class="item"> <div v-for="item in list" :key="item.id" class="item" @click="go(item)">
<div style="color:#353535;font-size:16px;margin-bottom:9px;">{{item.name}}</div> <div style="color:#353535;font-size:16px;margin-bottom:9px;">{{item.name}}</div>
<div>删除理由 {{item.abandon_remark}}</div> <div>删除理由 {{item.abandon_remark}}</div>
<div>删除时间 {{item.update_time |timeFormat}}</div> <div>删除时间 {{item.update_time |timeFormat}}</div>
...@@ -45,6 +45,9 @@ export default class RecycleList extends Vue { ...@@ -45,6 +45,9 @@ export default class RecycleList extends Vue {
this.finished = true; this.finished = true;
} }
} }
private go(proof: any){
location.href = process.env.VUE_APP_BROWSER + `/product?hash=${proof.hash}`;
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
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