Commit 4397d279 by crushh

update: dist

parent acdd2845
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<link rel="shortcut icon" href="./favicon.ico" /> <link rel="shortcut icon" href="./favicon.ico" />
<title>好办管理平台</title> <title>好办管理平台</title>
<link rel="stylesheet" type="text/css" href="//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.69.css" /> <link rel="stylesheet" type="text/css" href="//web-1251519181.file.myqcloud.com/custom-element/custom-element.1.0.69.css" />
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1628375_kcme8v8q3t.css" /> <!--好办后台3.0--> <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1628375_5ghlvsafe8j.css" /> <!--好办后台3.0-->
<script src="//at.alicdn.com/t/font_1628375_kcme8v8q3t.js"></script> <script src="//at.alicdn.com/t/font_1628375_5ghlvsafe8j.js"></script>
</head> </head>
<body style="min-width: 1400px;" class="damolish"> <body style="min-width: 1400px;" class="damolish">
......
...@@ -39,7 +39,7 @@ VueAMap.initAMapApiLoader({ ...@@ -39,7 +39,7 @@ VueAMap.initAMapApiLoader({
plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'Geocoder', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor'], plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'Geocoder', 'ToolBar', 'MapType', 'PolyEditor', 'AMap.CircleEditor'],
v: '1.4.4' v: '1.4.4'
}); });
window.ELEMENT.Dialog.props.closeOnClickModal.default = false; // 全局设置点击蒙层不关闭
Vue.use(htmlToPdf); Vue.use(htmlToPdf);
Vue.use(vueGicImgPreview); Vue.use(vueGicImgPreview);
Vue.use(vueOfficeUploadImage); Vue.use(vueOfficeUploadImage);
......
<template> <template>
<div> <div>
<div class="warp"> <!-- <div class="warp">
<h2>加好友配置</h2> <h2>加好友配置</h2>
<span class="echoData" v-show="friendSettingType">{{ echoFriendData }}</span> <span class="echoData" v-show="friendSettingType">{{ echoFriendData }}</span>
<el-button type="text" style="margin-left: 20px;" @click="openDialog">去配置</el-button> <el-button type="text" style="margin-left: 20px;" @click="openDialog">去配置</el-button>
</div> </div> -->
<div class="daily-set-wrap"> <div class="daily-set-wrap">
<div class="daily-set-content border-box"> <div class="daily-set-content border-box">
<div class="admin-tip-body"> <div class="admin-tip-body">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-input placeholder="请输入标题" maxlength="50" v-model="title" class="w-264" style="width: 264px;" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input> <el-input placeholder="请输入标题" maxlength="50" v-model="title" class="w-264" style="width: 264px;" @keyup.native="value => toInput(value, searchInput)" clearable @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
<el-button type="primary" @click="changeRoute">新建欢迎语</el-button> <el-button type="primary" @click="changeRoute">新建欢迎语</el-button>
</div> </div>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }"> <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" v-loading="loading">
<el-table-column prop="title" label="标题" width="200" show-overflow-tooltip> <el-table-column prop="title" label="标题" width="200" show-overflow-tooltip>
<template slot-scope="{ row }">{{ row.title }}</template> <template slot-scope="{ row }">{{ row.title }}</template>
</el-table-column> </el-table-column>
...@@ -70,13 +70,13 @@ ...@@ -70,13 +70,13 @@
<el-table-column label="操作" width="180"> <el-table-column label="操作" width="180">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="changeRoute(row)">编辑</el-button> <el-button type="text" @click="changeRoute(row)">编辑</el-button>
<el-button type="text" @click="remove(row)" v-if="row.defaultWelcomeFlag != 1">删除</el-button> <el-button type="text" @click="remove(row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
<el-dialog title="加好友配置" :visible.sync="dialogVisible" width="590px" :before-close="handleClose"> <!-- <el-dialog title="加好友配置" :visible.sync="dialogVisible" width="590px" :before-close="handleClose">
<span class="tips">好办欢迎语支持文字、图片、视频、文件、链接</span> <span class="tips">好办欢迎语支持文字、图片、视频、文件、链接</span>
<el-form label-width="100px" style="margin-top:20px"> <el-form label-width="100px" style="margin-top:20px">
<el-form-item label="加好友配置"> <el-form-item label="加好友配置">
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" :loading="btnLoading" @click="saveSetting">确 定</el-button> <el-button type="primary" :loading="btnLoading" @click="saveSetting">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -100,24 +100,25 @@ export default { ...@@ -100,24 +100,25 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
friendSettingTypeOption: [ // friendSettingTypeOption: [
{ label: 2, content: '发送【好办欢迎语】+【带导购参数的公众号二维码】' }, // { label: 2, content: '发送【好办欢迎语】+【带导购参数的公众号二维码】' },
{ label: 1, content: '发送【好办欢迎语】+【带导购参数的会员小程序卡片】' } // { label: 1, content: '发送【好办欢迎语】+【带导购参数的会员小程序卡片】' }
], // ],
title: '', title: '',
wxEnterpriseId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '',
friendSettingType: '', // friendSettingType: '',
type: 1, type: 1,
friendSettingId: '', friendSettingId: '',
btnLoading: false, btnLoading: false,
dialogVisible: false, // dialogVisible: false,
iconType: { iconType: {
1: 'iconwenjianleixingtupian', 1: 'iconwenjianleixingtupian',
2: 'iconwenjianleixingshipin', 2: 'iconwenjianleixingshipin',
3: 'iconwenjianleixing-wenjian', 3: 'iconwenjianleixing-wenjian',
4: 'iconwenjianleixing-lianjie' 4: 'iconwenjianleixing-lianjie'
}, },
tableData: [] tableData: [],
loading: false
}; };
}, },
mounted() { mounted() {
...@@ -125,19 +126,19 @@ export default { ...@@ -125,19 +126,19 @@ export default {
that.$emit('showTab', 4); that.$emit('showTab', 4);
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
that.getData(); that.getData();
this.getSetting(); // this.getSetting();
}, },
destroyed() { destroyed() {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
computed: { computed: {
echoFriendData() { // echoFriendData() {
let content = ''; // let content = '';
if (this.friendSettingType) { // if (this.friendSettingType) {
content = this.friendSettingTypeOption.filter(item => item.label == this.friendSettingType)[0].content; // content = this.friendSettingTypeOption.filter(item => item.label == this.friendSettingType)[0].content;
} // }
return content; // return content;
} // }
}, },
methods: { methods: {
/** /**
...@@ -152,20 +153,20 @@ export default { ...@@ -152,20 +153,20 @@ export default {
clearSearch() { clearSearch() {
this.getData(); this.getData();
}, },
openDialog() { // openDialog() {
this.dialogVisible = true; // this.dialogVisible = true;
}, // },
getSetting() { // getSetting() {
getRequest('/haoban-manage3-web/welcome/get/friend-setting', { wxEnterpriseId: this.wxEnterpriseId }).then(res => { // getRequest('/haoban-manage3-web/welcome/get/friend-setting', { wxEnterpriseId: this.wxEnterpriseId }).then(res => {
let resData = res.data; // let resData = res.data;
if (resData.code == 0 && resData.result) { // if (resData.code == 0 && resData.result) {
const { friendSettingId, friendSettingType } = resData.result; // const { friendSettingId, friendSettingType } = resData.result;
this.friendSettingId = friendSettingId; // this.friendSettingId = friendSettingId;
this.type = friendSettingType ? friendSettingType : 1; // this.type = friendSettingType ? friendSettingType : 1;
this.friendSettingType = friendSettingType; // this.friendSettingType = friendSettingType;
} // }
}); // });
}, // },
saveSetting() { saveSetting() {
let data = { let data = {
friendSettingId: this.friendSettingId, friendSettingId: this.friendSettingId,
...@@ -179,8 +180,8 @@ export default { ...@@ -179,8 +180,8 @@ export default {
let resData = res.data; let resData = res.data;
if (resData.code == 0 && resData.result) { if (resData.code == 0 && resData.result) {
this.$message.success(resData.message); this.$message.success(resData.message);
this.dialogVisible = false; // this.dialogVisible = false;
this.getSetting(); // this.getSetting();
} }
}) })
.finally(() => { .finally(() => {
...@@ -212,6 +213,7 @@ export default { ...@@ -212,6 +213,7 @@ export default {
* 获取数据 * 获取数据
*/ */
getData() { getData() {
this.loading = true;
postJsonRequest('/haoban-manage3-web/welcome/list', { title: this.title, wxEnterpriseId: this.wxEnterpriseId }) postJsonRequest('/haoban-manage3-web/welcome/list', { title: this.title, wxEnterpriseId: this.wxEnterpriseId })
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
...@@ -232,6 +234,9 @@ export default { ...@@ -232,6 +234,9 @@ export default {
duration: 1000, duration: 1000,
message: error.message message: error.message
}); });
})
.finally(() => {
this.loading = false;
}); });
} }
}, },
......
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
</p> </p>
</el-popover> </el-popover>
</div> </div>
<div class="mediaEcho" v-if="showEchoData"> <div class="mediaEcho">
<div class="flexBoxContainer" v-for="(item, index) in form.welcomeMediaList" :key="index"> <div class="flexBoxContainer" v-for="(item, index) in form.welcomeMediaList" :key="index">
<div class="flexBox" v-if="item.mediaType != 5"> <div class="flexBox">
<svg-icon :iconname="iconType[item.mediaType]" size="16" style="margin-right: 13px;"> </svg-icon> <svg-icon :iconname="iconType[item.mediaType]" size="16" style="margin-right: 13px;"> </svg-icon>
<span class="popverText">{{ item.mediaTitle }}</span> <span class="popverText">{{ item.mediaTitle }}</span>
<i class="el-icon-close" style="margin-left: 20px;cursor: pointer;" @click="handleDelMedia(item, index)"></i> <i class="el-icon-close" style="margin-left: 20px;cursor: pointer;" @click="handleDelMedia(item, index)"></i>
</div> </div>
</div> </div>
</div> </div>
<div class="addInfo" :style="showEchoData ? 'border-top: 1px dashed #dcdfe6;' : ''"> <div class="addInfo" :style="form.welcomeMediaList.length > 0 ? 'border-top: 1px dashed #dcdfe6;' : ''">
<el-popover placement="top" trigger="click"> <el-popover placement="top" trigger="click">
<ul class="flex flex-wrap"> <ul class="flex flex-wrap">
<li v-for="(item, index) in uploadList" :key="index" :class="['uploadListBox', form.welcomeMediaList.length >= 9 ? 'disabled' : '']" @click="handleUploadList(item, index)"> <li v-for="(item, index) in uploadList" :key="index" :class="['uploadListBox', form.welcomeMediaList.length >= 9 || (index == 5 && publicAccountDisabled) ? 'disabled' : '']" :style="index == 5 ? 'width: 118px;' : ''" @click="handleUploadList(item, index)">
<i :class="['iconfont-hb3', item.icon]" style="font-size:20px"></i> <i :class="['iconfont-hb3', item.icon]" style="font-size:20px"></i>
<p>{{ item.title }}</p> <p>{{ item.title }}</p>
<input type="file" :accept="item.fileType" @change="e => handkeFileChange(e, item)" class="upload-input" /> <input type="file" :accept="item.fileType" @change="e => handkeFileChange(e, item)" class="upload-input" />
...@@ -45,14 +45,17 @@ ...@@ -45,14 +45,17 @@
</ul> </ul>
<div slot="reference" style="cursor: pointer; display: inline-block;"> <div slot="reference" style="cursor: pointer; display: inline-block;">
<i class="iconfont-hb3 icontianjiajiahaowubiankuang"></i> <i class="iconfont-hb3 icontianjiajiahaowubiankuang"></i>
<p>添加图片/视频/文件/链接</p> <p>添加图片/视频/文件/链接/小程序/带参公众号</p>
</div> </div>
</el-popover> </el-popover>
<p style="font-size:12px;color:#909399">(附件不超过9个,单个大小不超过2M)</p> <p style="font-size:12px;color:#909399">(附件不超过9个,单个大小不超过2M)</p>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="使用范围" required> <el-form-item label="使用范围" required>
<div v-if="isDefalut" class="scopeContainer"> <el-radio v-model="form.defaultWelcomeFlag" :disabled="defaultWelcomeFlag && echoDefaultWelcomeFlag == 0" :label="1">全体成员</el-radio>
<el-radio v-model="form.defaultWelcomeFlag" :label="0">部分成员</el-radio>
<span @click="openScopeDialog" v-if="form.defaultWelcomeFlag == 0" class="color-2f54eb cursor-pointer" style="margin-left:8px;"> {{ form.suitDepartmentAddList.length ? '修改使用范围' : '请选择使用范围' }}</span>
<div class="scopeContainer" v-if="form.defaultWelcomeFlag == 1">
<div class="wwTag"> <div class="wwTag">
<span class="font-14 color-2f54eb opacity80 iconfont-hb3 iconqiye-tianchong"></span> <span class="font-14 color-2f54eb opacity80 iconfont-hb3 iconqiye-tianchong"></span>
全体成员 全体成员
...@@ -66,7 +69,6 @@ ...@@ -66,7 +69,6 @@
<!-- <i class="el-icon-close" style="margin-left: 20px;cursor: pointer;"></i> --> <!-- <i class="el-icon-close" style="margin-left: 20px;cursor: pointer;"></i> -->
</div> </div>
</div> </div>
<span @click="openScopeDialog" class="color-2f54eb cursor-pointer" style="margin-left:8px;"> {{ form.suitDepartmentAddList.length ? '修改使用范围' : '请选择使用范围' }}</span>
</div> </div>
</el-form-item> </el-form-item>
<el-button type="primary" style="margin-left:117px;margin-bottom:20px" :loading="submitbtnLoading" @click="submit">保存</el-button> <el-button type="primary" style="margin-left:117px;margin-bottom:20px" :loading="submitbtnLoading" @click="submit">保存</el-button>
...@@ -83,33 +85,35 @@ ...@@ -83,33 +85,35 @@
</div> </div>
</div> </div>
<div class="infoListBox" v-for="(item, index) in form.welcomeMediaList" :key="index"> <div class="infoListBox" v-for="(item, index) in form.welcomeMediaList" :key="index">
<div class="infoAvatar"> <div>
<img src="@/assets/head_default.jpg" /> <div class="infoAvatar">
</div> <img src="@/assets/head_default.jpg" />
<div v-if="item.mediaType == 1" class="imgInfo">
<img :src="item.mediaUrl" />
</div>
<div v-if="item.mediaType == 2" class="videoInfo" @click="blank(item.mediaUrl)">
<video :src="item.mediaUrl" />
</div>
<div v-if="item.mediaType == 3" class="docInfo">
<div class="docTitle">
<b>{{ item.mediaTitle }}</b>
<p>{{ item.mediaSize }} KB</p>
</div> </div>
<svg-icon iconname="iconwenjianleixing-wenjian" size="40"> </svg-icon> <div v-if="item.mediaType == 1 || item.mediaType == 7" class="imgInfo">
</div> <img :src="item.mediaUrl" />
<div v-if="item.mediaType == 4" class="urlInfo"> </div>
<div class="urlTitle">{{ item.mediaTitle }}</div> <div v-if="item.mediaType == 2" class="videoInfo" @click="blank(item.mediaUrl)">
<div class="urlContent"> <video :src="item.mediaUrl" />
<b>{{ item.mediaTitle }}</b> </div>
<svg-icon iconname="iconwenjianleixing-lianjie" size="40"> </svg-icon> <div v-if="item.mediaType == 3" class="docInfo">
<div class="docTitle">
<b>{{ item.mediaTitle }}</b>
<p>{{ item.mediaSize }} KB</p>
</div>
<svg-icon iconname="iconwenjianleixing-wenjian" size="40"> </svg-icon>
</div>
<div v-if="item.mediaType == 4" class="urlInfo">
<div class="urlTitle">{{ item.mediaTitle }}</div>
<div class="urlContent">
<b>{{ item.mediaTitle }}</b>
<svg-icon iconname="iconwenjianleixing-lianjie" size="40"> </svg-icon>
</div>
</div>
<div v-if="item.mediaType == 5 || item.mediaType == 6" class="appletsInfo">
<div class="appletsTitle">{{ item.miniProgramName }}</div>
<div class="appletsTitle" style="font-size:12px">{{ item.mediaTitle }}</div>
<img :src="item.mediaUrl" />
</div> </div>
</div>
<div v-if="item.mediaType == 5" class="appletsInfo">
<div class="appletsTitle">{{ item.miniProgramName }}</div>
<div class="appletsTitle" style="font-size:12px">{{ item.mediaTitle }}</div>
<img :src="item.mediaUrl" />
</div> </div>
</div> </div>
</div> </div>
...@@ -171,6 +175,31 @@ ...@@ -171,6 +175,31 @@
<el-button type="primary" @click="addSuitDepartment">确认</el-button> <el-button type="primary" @click="addSuitDepartment">确认</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="添加小程序" width="600px" :visible.sync="appletDialogVisible" @closed="closeAppletDialog">
<div class="admin-tip-body">
<div role="alert" class="el-alert el-alert--info" style="width: 550px;">
<i class="el-alert__icon el-icon-info"></i>
<div class="el-alert__content">
<p class="el-alert__title">
1. 小程序需要在好办后台--企业设置--小程序管理中配置后方可使用<br />
2. 请确保配置的小程序已在企微后台配置好,否则将被企微拦截,导致发送失败; <br />
3. 使用达摩会员小程序才会带有导购参数,建立好友会员关联;<br />
</p>
</div>
</div>
</div>
<el-form label-position="right" ref="form" :model="{}" label-width="100px" style="margin-top:20px" @submit.native.prevent>
<el-form-item label="小程序配置">
<el-select v-model="selectedApple" style="width:458px;">
<el-option v-for="item in appTableData" :key="item.miniprogramSettingId" :label="item.miniprogramName" :value="item.miniprogramSettingId" :disabled="handleDiabled(item)"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="">
<el-button @click="closeAppletDialog">取消</el-button>
<el-button type="primary" @click="addApplet">确定</el-button>
</div>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
...@@ -194,7 +223,8 @@ export default { ...@@ -194,7 +223,8 @@ export default {
welcomeContent: '你好,<微信昵称>', welcomeContent: '你好,<微信昵称>',
welcomeMediaList: [], welcomeMediaList: [],
suitDepartmentAddList: [], suitDepartmentAddList: [],
suitDepartmentList: [] suitDepartmentList: [],
defaultWelcomeFlag: 0
}, },
uploadList: [ uploadList: [
{ {
...@@ -215,6 +245,14 @@ export default { ...@@ -215,6 +245,14 @@ export default {
{ {
title: '链接', title: '链接',
icon: 'iconlianjie' icon: 'iconlianjie'
},
{
title: '小程序',
icon: 'iconxiaochengxu'
},
{
title: '带参公众号二维码',
icon: 'icongongzhonghao'
} }
], ],
iconType: { iconType: {
...@@ -222,7 +260,9 @@ export default { ...@@ -222,7 +260,9 @@ export default {
2: 'iconwenjianleixingshipin', 2: 'iconwenjianleixingshipin',
3: 'iconwenjianleixing-wenjian', 3: 'iconwenjianleixing-wenjian',
4: 'iconwenjianleixing-lianjie', 4: 'iconwenjianleixing-lianjie',
5: 'iconwenjianleixing-xiaochengxu' 5: 'iconwenjianleixing-xiaochengxu', // 小程序
6: 'iconwenjianleixing-xiaochengxu', // 带参小程序
7: 'icongongzhonghao1' // 带参公众号
}, },
accountName: '', accountName: '',
rules: { rules: {
...@@ -243,9 +283,13 @@ export default { ...@@ -243,9 +283,13 @@ export default {
btnLoading: false, btnLoading: false,
submitbtnLoading: false, submitbtnLoading: false,
selectedTreeData: [], selectedTreeData: [],
friendSettingType: '',
showTree: true, showTree: true,
isDefalut: 0 appTableData: [],
appletDialogVisible: false,
selectedApple: '',
defaultWelcomeFlag: false,
isNew: true,
echoDefaultWelcomeFlag: 0
}; };
}, },
watch: { watch: {
...@@ -256,31 +300,24 @@ export default { ...@@ -256,31 +300,24 @@ export default {
} }
}, },
computed: { computed: {
showEchoData() { publicAccountDisabled() {
let bool1 = true; if (this.form.welcomeMediaList.filter(item => item.mediaType == 7).length) {
let bool2 = false; return true;
if (this.form.welcomeMediaList && this.form.welcomeMediaList.length && this.form.welcomeMediaList.length == 1 && this.form.welcomeMediaList[0].mediaType == 5) { } else {
bool1 = false; return false;
}
if (this.form.welcomeMediaList && this.form.welcomeMediaList.length) {
bool2 = true;
} }
return bool1 && bool2;
} }
}, },
mounted() { mounted() {
const that = this; this.$emit('showTab', 4);
that.$emit('showTab', 4);
document.documentElement.style.backgroundColor = '#f0f2f5'; document.documentElement.style.backgroundColor = '#f0f2f5';
const { id, type, isDefalut } = this.$route.query; const { id } = this.$route.query;
if (id) { if (id) {
that.getData(); this.getData();
this.isNew = false;
} }
if (type && type == 1 && !id) { this.getExistDefaultWelcome();
this.friendSettingType = type; this.getAppleList();
this.getAppData();
}
this.isDefalut = isDefalut;
}, },
destroyed() { destroyed() {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
...@@ -291,19 +328,57 @@ export default { ...@@ -291,19 +328,57 @@ export default {
multUpload multUpload
}, },
methods: { methods: {
getAppData() { getExistDefaultWelcome(isNew) {
getRequest('/haoban-manage3-web/welcome/exist-default-welcome', { wxEnterpriseId: this.wxEnterpriseId }).then(res => {
let resData = res.data;
if (resData.code == 0) {
this.defaultWelcomeFlag = res.data.result;
if (this.isNew) {
this.form.defaultWelcomeFlag = res.data.result ? 0 : 1;
}
}
});
},
handleDiabled(val) {
console.log('handleDiabled');
if (this.form.welcomeMediaList.filter(item => item.miniProgramId && item.miniProgramId == val.miniprogramSettingId).length) {
return true;
} else {
return false;
}
},
addApplet(val) {
if (!this.selectedApple) {
this.$message.error('请选择小程序');
return;
}
const obj = this.appTableData.filter(item => item.miniprogramSettingId == this.selectedApple)[0];
if (!this.form.welcomeMediaList.filter(item => item.miniProgramId && item.miniProgramId == obj.miniprogramSettingId).length) {
this.form.welcomeMediaList.push({
miniProgramName: obj.miniprogramName,
mediaType: obj.miniprogramSettingId == 6 ? 6 : 5,
mediaUrl: obj.imageUrl,
mediaTitle: obj.mediaTitle,
miniProgramId: obj.miniprogramSettingId
});
}
this.closeAppletDialog();
},
closeAppletDialog() {
this.selectedApple = '';
this.appletDialogVisible = false;
},
getAppleList() {
// 获取小程序 // 获取小程序
getRequest('/haoban-manage3-web/list-miniprogram-setting', {}) getRequest('/haoban-manage3-web/list-miniprogram-setting', {})
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1 && resData.result) { if (resData.errorCode == 1 && resData.result) {
const applet = resData.result.length && resData.result[0]; this.appTableData = resData.result;
this.form.welcomeMediaList.push({ this.appTableData.push({
miniProgramName: applet.miniprogramName, miniprogramName: '带参小程序',
mediaTitle: applet.title, miniprogramSettingId: 6,
mediaType: 5, mediaTitle: '小程序标题'
mediaUrl: applet.imageUrl,
mediaSize: ''
}); });
} }
}) })
...@@ -336,8 +411,8 @@ export default { ...@@ -336,8 +411,8 @@ export default {
}, },
handleSelectedDataCancel(item, index) { handleSelectedDataCancel(item, index) {
// 删除 右侧 被选中部门树的数据 // 删除 右侧 被选中部门树的数据
console.log(item);
this.$refs.tree.setChecked(item.departmentId, false, true); this.$refs.tree.setChecked(item.departmentId, false, true);
this.selectedTreeData = this.$refs.tree.getCheckedNodes();
}, },
handlefilterTextClear() { handlefilterTextClear() {
// 清空搜索部门树条件 // 清空搜索部门树条件
...@@ -387,7 +462,6 @@ export default { ...@@ -387,7 +462,6 @@ export default {
}, },
handleCheckChange(data, checked) { handleCheckChange(data, checked) {
// 部门树选中变化时 // 部门树选中变化时
console.log('部门树选中变化时', this.selectedTreeData.length);
const obj = JSON.parse(JSON.stringify(data)); const obj = JSON.parse(JSON.stringify(data));
if (!checked) { if (!checked) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -456,20 +530,25 @@ export default { ...@@ -456,20 +530,25 @@ export default {
window.open(url); window.open(url);
}, },
handleUploadList(item, index) { handleUploadList(item, index) {
console.log(item);
if (['图片', '视频', '文件'].includes(item.title)) { if (['图片', '视频', '文件'].includes(item.title)) {
document.getElementsByClassName('upload-input')[index].click(); document.getElementsByClassName('upload-input')[index].click();
} else if (item.title == '链接') { } else if (item.title == '链接') {
this.urlDialogVisible = true; this.urlDialogVisible = true;
} else if (item.title == '小程序') {
this.appletDialogVisible = true;
} else if (item.title == '带参公众号二维码') {
this.form.welcomeMediaList.push({
mediaTitle: '带参公众号',
mediaType: 7,
mediaUrl: 'https://other-1251519181.cos.ap-shanghai.myqcloud.com/haoban/20220310143912/abdf84f1112815e936f3ed4f09dba525.png'
});
} }
}, },
handleDelMedia(row, index) { handleDelMedia(row, index) {
this.form.welcomeMediaList.splice(index, 1); this.form.welcomeMediaList.splice(index, 1);
}, },
handkeFileChange(e, item) { handkeFileChange(e, item) {
console.log(item);
const file = e.target.files[0]; // only use files[0] const file = e.target.files[0]; // only use files[0]
console.log(file);
let fileType = ''; let fileType = '';
if (file.size > 2000000) { if (file.size > 2000000) {
this.$message.error('单个大小不超过2M'); this.$message.error('单个大小不超过2M');
...@@ -579,9 +658,10 @@ export default { ...@@ -579,9 +658,10 @@ export default {
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.code == 0 && resData.result) { if (resData.code == 0 && resData.result) {
const { suitDepartmentList, title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId } = resData.result; const { suitDepartmentList, title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId, defaultWelcomeFlag } = resData.result;
this.form = { suitDepartmentList: suitDepartmentList || [], suitDepartmentAddList: JSON.parse(JSON.stringify(suitDepartmentList)) || [], title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId }; this.form = { suitDepartmentList: suitDepartmentList || [], suitDepartmentAddList: JSON.parse(JSON.stringify(suitDepartmentList)) || [], title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId, defaultWelcomeFlag };
this.form = Object.assign({}, this.form); this.form = Object.assign({}, this.form);
this.echoDefaultWelcomeFlag = defaultWelcomeFlag;
} }
}) })
.catch(error => { .catch(error => {
...@@ -592,14 +672,14 @@ export default { ...@@ -592,14 +672,14 @@ export default {
}); });
}, },
submit() { submit() {
if (!this.isDefalut && !this.form.suitDepartmentAddList.length) { if (!this.form.defaultWelcomeFlag && !this.form.suitDepartmentAddList.length) {
this.$message.error('请选择使用范围'); this.$message.error('请选择使用范围');
return; return;
} }
this.$refs.form.validate(value => { this.$refs.form.validate(value => {
if (value) { if (value) {
const { suitDepartmentAddList, suitDepartmentList, title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId } = this.form; const { suitDepartmentAddList, suitDepartmentList, title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId, defaultWelcomeFlag } = this.form;
const para = { title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId: wxEnterpriseId || this.wxEnterpriseId }; const para = { title, welcomeId, welcomeContent, welcomeMediaList, wxEnterpriseId: wxEnterpriseId || this.wxEnterpriseId, defaultWelcomeFlag };
const addArr = []; const addArr = [];
const delArr = []; const delArr = [];
suitDepartmentAddList.forEach(ele => { suitDepartmentAddList.forEach(ele => {
...@@ -621,7 +701,6 @@ export default { ...@@ -621,7 +701,6 @@ export default {
item.selectType = 1; item.selectType = 1;
}); });
console.log(para); console.log(para);
para.welcomeMediaList = para.welcomeMediaList.filter(item => item.mediaType != 5);
this.submitbtnLoading = true; this.submitbtnLoading = true;
postJsonRequest('/haoban-manage3-web/welcome/save', para) postJsonRequest('/haoban-manage3-web/welcome/save', para)
.then(res => { .then(res => {
...@@ -723,6 +802,7 @@ export default { ...@@ -723,6 +802,7 @@ export default {
max-height: 500px; max-height: 500px;
min-height: 40px; min-height: 40px;
overflow-y: auto; overflow-y: auto;
margin-top: 10px;
.wwTag { .wwTag {
background: #ebeffe; background: #ebeffe;
border-radius: 4px; border-radius: 4px;
......
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