Commit 134f88bb by xiaohai

Merge branch 'dev' of http://115.159.76.241/office/office-web into dev

parents 7a56bc8b ec9c3de2
<template>
<div class="custom-dialog-wrap">
<el-dialog title="门店环境图变更" :visible.sync="customDialog" width="600px" :before-close="handleCardClose">
<div class="dialog-content">
<el-row>
<el-col :span="11">
<div class="grid-content bg-purple-dark">
变更前
</div>
<div class="data-body">
<div class="data-body-content flex flex-column flex-space-between">
<template v-for="item in leftData">
<img :src="item.src" alt=""/>
</template>
</div>
</div>
</el-col>
<el-col :span="11">
<div class="grid-content bg-purple-dark">
变更后
</div>
<div class="data-body">
<div class="data-body-content flex flex-column flex-space-between">
<template v-for="item in rightData">
<img :src="item.src" alt=""/>
</template>
</div>
</div>
</el-col>
</el-row>
</div>
</el-dialog>
</div>
</template>
<script>
import { getRequest, postRequest, postJsonRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
import qs from 'qs';
export default {
name: 'custom-dialog',
props: {
value: {
type: Boolean,
default: false
},
storeChangeData: {
type: Object
}
},
data () {
return {
repProjectName: 'gic-web', // 项目名
customDialog: this.value, // 弹框显示
leftData: [
{
src: require('../../assets/test.png')
},
{
src: require('../../assets/test.png')
},
{
src: require('../../assets/test.png')
}
],
rightData: [
{
src: require('../../assets/test.png')
},
{
src: require('../../assets/test.png')
},
{
src: require('../../assets/test.png')
}
]
}
},
beforeMount() {
const that = this
},
methods:{
// 关闭
handleCardClose() {
const that = this;
that.customCancel();
},
// 取消
customCancel() {
const that = this;
that.customDialog = false
that.$emit('input',that.customDialog)
},
formatDate(time,flag) {
const that = this
// (0-9)年月数字的显示
function formatDig(num) {
return num > 9 ? '' + num : '0' + num;
}
let myDate = new Date(time);
let y = myDate.getFullYear();
let m = myDate.getMonth()+1;
let d = myDate.getDate();
return y + flag + formatDig(m) + flag + formatDig(d) + flag
},
handleData() {
const that = this;
}
},
watch: {
value: function(newData,oldData){
const that = this;
// console.log("新数据:",newData,oldData)
that.customDialog = newData
},
storeChangeData: function(newData,oldData){
const that = this;
}
},
/* 接收数据 */
mounted(){
const that = this;
// console.log("新数据:",that.value)
// that.customDialog = that.showStoreDialog
},
}
</script>
<style lang="scss" scoped>
.flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flex-column {
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
}
.flex-space-between {
-webkit-justify-content: space-between;
-moz-justify-content: space-between;
-ms-justify-content: space-between;
-o-justify-content: space-between;
justify-content: space-between;
}
.dialog-content {
/*height: 484px;*/
padding-bottom: 20px;
.grid-content {
width: 100%;
height: 42px;
line-height: 42px;
text-align: center;
background: rgba(245,247,250,1);
font-size: 16px;
color: #303133;
/*border: 1px solid rgba(235,238,245,1);
border-radius: 4px;*/
}
.el-row {
width: 100%;
font-size: 0
}
.el-col-11 {
width: 272px;
border:1px solid rgba(235,238,245,1);
border-radius: 4px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
&+.el-col-11 {
margin-left: 14px;
}
}
.data-body {
height: 442px;
max-height: 442px;
padding: 11px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.data-body-content {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
img {
width: 100%;
&+img {
margin-top: 10px;
}
}
}
}
</style>
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
<span class="template-title-span">员工档案设置</span> <span class="template-title-span">员工档案设置</span>
</div> </div>
<div class="template-btns flex-1 flex-r"> <div class="template-btns flex-1 flex-r">
<el-button plain @click="saveAndBack('preview')">预览</el-button>
<el-button plain @click="changeRoute('/')">返 回</el-button> <el-button plain @click="changeRoute('/')">返 回</el-button>
<el-button type="primary" @click="saveAndBack">保存并启用</el-button> <el-button type="primary" @click="saveAndBack('save')">保存并启用</el-button>
</div> </div>
</div> </div>
<!-- 模板body --> <!-- 模板body -->
...@@ -507,7 +508,24 @@ ...@@ -507,7 +508,24 @@
</div> </div>
</div> </div>
</div> </div>
<div class="qr-dialog-content" style="opacity: 1;" v-show="dialogVisible">
<div class="qr-mask" @click.stop="closeDialog"></div>
<div class="qr-dialog">
<div class="qr-dialog__hd">
<strong class="qr-dialog__title">预览</strong>
<i class="el-icon-close" @click.stop="closeDialog"></i>
</div>
<div class="qr-dialog__bd">
<div id="qrcode"></div>
<div class="qr-dialog__p">请使用好办 APP 扫一扫预览</div>
</div>
<div class="qr--dialog__ft">
</div>
</div>
</div>
<!-- <vue-gic-footer></vue-gic-footer> --> <!-- <vue-gic-footer></vue-gic-footer> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -515,6 +533,7 @@ import draggable from 'vuedraggable'; ...@@ -515,6 +533,7 @@ import draggable from 'vuedraggable';
import AddInput from '@/components/templateSet/add-input'; import AddInput from '@/components/templateSet/add-input';
import limitInput from '@/components/limit-input.vue'; import limitInput from '@/components/limit-input.vue';
import QRCode from 'qrcodejs2'
import allInfo from '@/components/contacts/staffInfoTemplate'; import allInfo from '@/components/contacts/staffInfoTemplate';
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
...@@ -531,6 +550,8 @@ export default { ...@@ -531,6 +550,8 @@ export default {
// right tab // right tab
rightName: 'first', rightName: 'first',
dialogVisible: false,
bodyHeight: (document.documentElement.clientHeight || document.body.clientHeight) + 'px', bodyHeight: (document.documentElement.clientHeight || document.body.clientHeight) + 'px',
// option // option
...@@ -749,6 +770,10 @@ export default { ...@@ -749,6 +770,10 @@ export default {
// 已经选择的字段集合 // 已经选择的字段集合
setList: [], setList: [],
// 二维码
qrcodeCase: '', // 二维码实例
qrcodeNum: '',
} }
}, },
created() { created() {
...@@ -920,7 +945,7 @@ export default { ...@@ -920,7 +945,7 @@ export default {
*/ */
addItem(evt) { addItem(evt) {
const that = this; const that = this;
console.log("中间add:",evt,that.tempaletDataList) // console.log("中间add:",evt,that.tempaletDataList)
}, },
/** /**
...@@ -928,7 +953,7 @@ export default { ...@@ -928,7 +953,7 @@ export default {
*/ */
addDragItem(evt) { addDragItem(evt) {
const that = this; const that = this;
console.log("中间 child-add:",evt,that.tempaletDataList) // console.log("中间 child-add:",evt,that.tempaletDataList)
return false; return false;
}, },
...@@ -937,12 +962,12 @@ export default { ...@@ -937,12 +962,12 @@ export default {
*/ */
selectChildItem(key,index,ind,list) { selectChildItem(key,index,ind,list) {
const that = this const that = this
console.log(key,index,ind,list) // console.log(key,index,ind,list)
that.currentIndex = null; that.currentIndex = null;
that.currentChildKey = key that.currentChildKey = key
that.childIndex = index that.childIndex = index
that.currentChildIndex = ind; that.currentChildIndex = ind;
console.log(that.tempaletDataList) // console.log(that.tempaletDataList)
}, },
/** /**
...@@ -950,7 +975,7 @@ export default { ...@@ -950,7 +975,7 @@ export default {
*/ */
deleteChildItem(key,index,ind,list,childItem) { deleteChildItem(key,index,ind,list,childItem) {
const that = this const that = this
console.log(key,index,ind,list) // console.log(key,index,ind,list)
that.childIndex = index that.childIndex = index
that.currentIndex = null; that.currentIndex = null;
that.currentChildKey = that.tempaletDataList[index].children[ind].fieldCode; that.currentChildKey = that.tempaletDataList[index].children[ind].fieldCode;
...@@ -963,7 +988,7 @@ export default { ...@@ -963,7 +988,7 @@ export default {
that.tempaletDataList[index].children.splice(ind,1) that.tempaletDataList[index].children.splice(ind,1)
// 重新设置左侧的 fixed // 重新设置左侧的 fixed
console.log(childItem.parentCode) // console.log(childItem.parentCode)
that[childItem.parentCode].forEach(function(ele,index){ that[childItem.parentCode].forEach(function(ele,index){
if (ele.fieldCode === key) { if (ele.fieldCode === key) {
ele.fixed = false; ele.fixed = false;
...@@ -985,12 +1010,12 @@ export default { ...@@ -985,12 +1010,12 @@ export default {
*/ */
delChildItem(index,ind,item) { delChildItem(index,ind,item) {
const that = this const that = this
console.log(index,ind,item) // console.log(index,ind,item)
item.fieldOperations.fieldContent.splice(ind,1) item.fieldOperations.fieldContent.splice(ind,1)
}, },
addChildItem(index,ind,item) { addChildItem(index,ind,item) {
const that = this const that = this
console.log(index,ind,item) // console.log(index,ind,item)
// 多选 // 多选
if (ind == 19) { if (ind == 19) {
...@@ -1093,7 +1118,7 @@ export default { ...@@ -1093,7 +1118,7 @@ export default {
/** /**
* 保存 * 保存
*/ */
saveAndBack() { saveAndBack(opt) {
const that = this const that = this
let data = JSON.parse(JSON.stringify(that.tempaletDataList)) let data = JSON.parse(JSON.stringify(that.tempaletDataList))
let tagObj = that.checkTag(data) let tagObj = that.checkTag(data)
...@@ -1148,8 +1173,12 @@ export default { ...@@ -1148,8 +1173,12 @@ export default {
// }) // })
// console.log(JSON.stringify(data)) // console.log(JSON.stringify(data))
if (opt === 'save') {
that.saveAllData(data)
}else {
that.postPreview(data)
}
that.saveAllData(data)
}, },
/** /**
...@@ -1183,10 +1212,72 @@ export default { ...@@ -1183,10 +1212,72 @@ export default {
}, },
/** /**
* 获取所有系统模板信息---api * 预览---api
*/
postPreview(data) {
const that = this;
let para = {
templateContent: JSON.stringify(data)
}
postRequest('/haoban-manage-web/record/record-template-preview.json',para)
.then((res) => {
// console.log(res.data)
let resData = res.data
if (resData.errorCode == 1) {
// 生成二维码需要的 url
let webUrl= `${window.location.origin}/${resData.result}`;
that.qrcode(webUrl)
that.dialogVisible = true;
return;
}
errMsg.errorMsg(resData)
})
.catch(function (error) {
// console.log(error);
that.$message.error({
duration: 1000,
message: error.message
})
});
},
/**
* 生成二维码
*/
qrcode (text) {
const that = this;
if (!!that.qrcodeCase) {
document.getElementById("qrcode").innerHTML = '';
that.qrcodeCase.clear(); // 先清除原有的
}
that.qrcodeCase = new QRCode('qrcode',
{
width: 210,
height: 210, // 高度
text: text, // 二维码内容 //
//render: 'canvas', // 设置渲染方式(有两种方式 table和canvas,默认是canvas) //
//background: '#f0f',
//foreground: '#ff0'
}
)
console.log(that.qrcodeCase)
},
/**
* 关闭预览窗口
*/
closeDialog() {
const that = this;
that.dialogVisible = false;
},
/**
* 获取所有字段
*/ */
getAllFields() { getAllFields() {
const that = this const that = this;
postRequest('/haoban-manage-web/record/employee-find-system-template.json',{}) postRequest('/haoban-manage-web/record/employee-find-system-template.json',{})
.then((res) => { .then((res) => {
// console.log(res.data) // console.log(res.data)
...@@ -1311,7 +1402,7 @@ export default { ...@@ -1311,7 +1402,7 @@ export default {
that.setList.push(ele.fieldCode) that.setList.push(ele.fieldCode)
} }
}) })
// console.log(JSON.stringify(that.treeData(data)))
that.tempaletDataList = that.treeData(data) that.tempaletDataList = that.treeData(data)
that.setFixed(); that.setFixed();
}, },
...@@ -1381,6 +1472,83 @@ export default { ...@@ -1381,6 +1472,83 @@ export default {
margin: 0 auto; margin: 0 auto;
} }
.qr-mask {
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, .6);
cursor: pointer;
}
.qr-dialog {
position: fixed;
z-index: 5000;
width: 80%;
max-width: 300px;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #fff;
text-align: center;
border-radius: 3px;
overflow: hidden;
.qr-dialog__hd {
position: relative;
.qr-dialog__title {
display: block;
padding: 32px 0;
font-size: 18px;
color: #303133;
}
i {
position: absolute;
top: 0;
right: 0;
display: block;
width: 46px;
height: 46px;
line-height: 46px;
text-align: center;
font-size: 10px;
color: #9b9da3;
cursor: pointer;
}
}
.qr-dialog__bd {
padding: 0 1.6em 0.8em;
min-height: 40px;
font-size: 15px;
line-height: 1.3;
word-wrap: break-word;
word-break: break-all;
color: #808080;
#qrcode {
display: -webkit-flex;
display: flex;
justify-content: center;
align-items: center;
}
.qr-dialog__p {
padding: 20px 0;
font-size: 14px;
color: #606266;
}
}
.qr-dialog__ft {
}
}
.template-head { .template-head {
display: -webkit-box; display: -webkit-box;
display: -webkit-flex; display: -webkit-flex;
......
...@@ -2,18 +2,32 @@ ...@@ -2,18 +2,32 @@
<div class="review-wrap"> <div class="review-wrap">
<!-- 公共头部菜单插件 --> <!-- 公共头部菜单插件 -->
<vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"></vue-office-header> <vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"></vue-office-header>
<div class="review-wrap__body"> <div class="setting-wrap__body">
<div id="content" class="content">
<div class="content-body" :style="{height: contentHeight}">
<div class="left-menu" :style="{height: contentHeight}">
<vue-office-aside ref="asideMenu" :projectName="projectName" :collapseFlag="collapseFlag"></vue-office-aside>
</div>
<transition name="fade" mode="out-in">
<!-- 缓存已经填好内容的页面 -->
<!-- <keep-alive include="editGroupGrade"> -->
<router-view></router-view>
<!-- </keep-alive > -->
</transition>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "review", name: "reviewed",
data() { data() {
return { return {
projectName: 'gic-clique', // 当前项目名 projectName: 'gic-clique', // 当前项目名
collapseFlag: false, // 折叠参数 collapseFlag: false, // 折叠参数
contentHeight: '0px', //页面内容高度
} }
}, },
computed: { computed: {
...@@ -43,11 +57,46 @@ export default { ...@@ -43,11 +57,46 @@ export default {
}, },
}, },
mounted() { mounted() {
const that = this
that.contentHeight = (document.documentElement.clientHeight || document.body.clientHeight) - 64 +'px';
}, },
} }
</script> </script>
<style lang="less" scoped> <style lang="less" >
.setting-wrap__body{
.content{
padding-top: 64px;
/* height: calc(100% - 64px);
overflow-y: auto;*/
min-width: 1400px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
.content-body {
display: flex;
overflow: hidden;
.common-set-wrap {
position: relative;
width: 100%;
height: 100%;
overflow-y: auto;
.right-content {
/*width: 100%;*/
padding: 24px;
min-height: calc(100% - 240px);
.right-box {
background: #fff;
padding: 24px;
}
}
}
}
}
}
</style> </style>
...@@ -270,6 +270,12 @@ ...@@ -270,6 +270,12 @@
<div class="fontclass">.icon-xinxixianshi</div> <div class="fontclass">.icon-xinxixianshi</div>
</li> </li>
<li>
<i class="icon iconfont icon-yewuduanmorentouxian"></i>
<div class="name">morentouxian</div>
<div class="fontclass">.icon-yewuduanmorentouxian</div>
</li>
</ul> </ul>
<h2 id="font-class-">font-class引用</h2> <h2 id="font-class-">font-class引用</h2>
......
...@@ -371,6 +371,14 @@ ...@@ -371,6 +371,14 @@
<div class="fontclass">#icon-xinxixianshi</div> <div class="fontclass">#icon-xinxixianshi</div>
</li> </li>
<li>
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-yewuduanmorentouxian"></use>
</svg>
<div class="name">morentouxian</div>
<div class="fontclass">#icon-yewuduanmorentouxian</div>
</li>
</ul> </ul>
......
...@@ -290,6 +290,12 @@ ...@@ -290,6 +290,12 @@
<div class="code">&amp;#xe74f;</div> <div class="code">&amp;#xe74f;</div>
</li> </li>
<li>
<i class="icon iconfont">&#xe7a3;</i>
<div class="name">morentouxian</div>
<div class="code">&amp;#xe7a3;</div>
</li>
</ul> </ul>
<h2 id="unicode-">unicode引用</h2> <h2 id="unicode-">unicode引用</h2>
<hr> <hr>
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -149,6 +149,9 @@ Created by iconfont ...@@ -149,6 +149,9 @@ Created by iconfont
<glyph glyph-name="xinxixianshi" unicode="&#59215;" d="M486.4 477.696h68.096V128H486.4V477.696zM512-42.496c239.104 0 426.496 187.904 426.496 426.496S751.104 810.496 512 810.496 85.504 623.104 85.504 384s187.392-426.496 426.496-426.496z m0-85.504C230.4-128 0 102.4 0 384S230.4 896 512 896s512-230.4 512-512-230.4-512-512-512zM520.704 568.32m-51.2 0a51.2 51.2 0 1 1 102.4 0 51.2 51.2 0 1 1-102.4 0Z" horiz-adv-x="1024" /> <glyph glyph-name="xinxixianshi" unicode="&#59215;" d="M486.4 477.696h68.096V128H486.4V477.696zM512-42.496c239.104 0 426.496 187.904 426.496 426.496S751.104 810.496 512 810.496 85.504 623.104 85.504 384s187.392-426.496 426.496-426.496z m0-85.504C230.4-128 0 102.4 0 384S230.4 896 512 896s512-230.4 512-512-230.4-512-512-512zM520.704 568.32m-51.2 0a51.2 51.2 0 1 1 102.4 0 51.2 51.2 0 1 1-102.4 0Z" horiz-adv-x="1024" />
<glyph glyph-name="yewuduanmorentouxian" unicode="&#59299;" d="M506.368 365.056c146.944 0 266.24 117.76 266.24 262.656s-119.296 262.656-266.24 262.656-266.24-117.76-266.24-262.656 119.296-262.656 266.24-262.656z m105.984-46.592h-199.68c-185.344 0-335.872-148.48-335.872-331.264v-19.968C76.8-128 225.28-128 412.672-128h199.168c180.224 0 335.872 0 335.872 95.232v19.968c0.512 182.272-150.528 331.264-335.36 331.264z" horiz-adv-x="1024" />
</font> </font>
......
No preview for this file type
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