Commit 5c0c0dad by 无尘

fix: 修改 vue 文件

parent ec116ce8
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-07-20 14:48:46
-->
<!--
<secret-set :categoryId="categoryId" @closeText="closeText" @submitText="submitText"></secret-set>
import secretSet from '@/components/set/secret-set.vue';
-->
<template>
<el-dialog :title="!!editRow.materialId ? '编辑' : '新建'" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<div class="">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item label="小程序名称" prop="secretName">
<limitInput :inputWidth="402" :inputValue.sync="ruleForm.secretName" :holder="'请输入小程序名称'" :getByType="'word'" :maxLength="20"> </limitInput>
</el-form-item>
<!-- <el-form-item label="agentid" prop="agentid">
<limitInput :inputWidth="402" :inputValue.sync="ruleForm.agentid" :holder="'请输入agentid'" :getByType="'word'" :maxLength="80"> </limitInput>
</el-form-item> -->
<el-form-item label="secret" prop="secretVal">
<limitInput :inputWidth="402" :inputValue.sync="ruleForm.secretVal" :holder="'请输入secret'" :getByType="'word'" :maxLength="80"> </limitInput>
</el-form-item>
<el-form-item label="关联商户" prop="enterpriseId">
<el-select class="w-402" v-model="ruleForm.enterpriseId" placeholder="全部品牌" @change="getTableList">
<!-- <el-option label="全部品牌" value=""></el-option> -->
<el-option v-for="item in brandOptions" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId"> </el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="toCancel">取消</el-button>
<el-button type="primary" @click="submitForm('ruleForm')">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import limitInput from '@/components/limit-input.vue';
import { _debounce } from '@/common/js/public';
import { postRequest } from '@/api/api';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';
export default {
props: {
editRow: {
type: Object,
default() {
return {};
}
},
categoryId: {
type: Object,
default() {
return '';
}
}
},
components: {
limitInput,
},
data() {
return {
editPersion: localStorage.getItem('userName'),
dialogVisible: true,
ruleForm: {
secretName: '',
secretVal: '',
enterpriseId: '',
secretId: ''
},
rules: {
secretName: [{ required: true, message: '请输入小程序名称', trigger: 'blur' }],
secretVal: [{ required: true, message: '请输入secret', trigger: 'blur' }],
enterpriseId: [{ required: true, message: '请选择关联商户', trigger: 'change' }]
},
brandOptions: [] //品牌
};
},
methods: {
/**
* 获取品牌
*/
getBrandData() {
const that = this;
postRequest('/haoban-manage3-web/wx-enterprise-list', {})
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
if (!!resData.result && !!resData.result.length) {
that.brandOptions = resData.result;
}
return;
}
errMsg.errorMsg(resData);
})
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
});
});
},
toCancel() {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
handleClose(done) {
const that = this;
that.$emit('closeText');
that.$refs['ruleForm'].resetFields();
},
submitForm: _debounce(function(formName) {
const that = this;
that.$refs[formName].validate(valid => {
if (valid) {
that.postSave();
}
});
}, 300),
postSave() {
const that = this;
const data = {
secretId: that.ruleForm.secretId,
secretName: that.ruleForm.secretName,
enterpriseId: that.ruleForm.enterpriseId,
memberSecret: that.ruleForm.secretVal
};
postRequest('/haoban-manage3-web/wx-enterprise-member-secret-set', data)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
showMsg.showmsg('操作成功', 'success');
that.$refs['ruleForm'].resetFields();
that.$emit('submitText');
} else {
errMsg.errorMsg(resData);
}
})
.catch(error => {
that.$message.error({
duration: 1000,
message: error.message
});
});
}
},
watch: {
editRow(newData) {
const that = this;
if (Object.keys(newData).length) {
that.ruleForm = JSON.parse(JSON.stringify(newData));
}
}
},
mounted() {
const that = this;
that.getBrandData();
if (Object.keys(that.editRow).length) {
that.ruleForm = JSON.parse(JSON.stringify(that.editRow));
}
}
};
</script>
<style lang="less" scoped>
.w-402 {
width: 402px;
}
.m-b-20 {
margin-bottom: 20px;
}
.p-l-18 {
padding-left: 18px;
}
.material-content {
position: relative;
.material-body {
/* resize: none;
width: 440px;
height: 273px;
border-radius: 2px;
border: 1px solid rgba(196, 198, 207, 1); */
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
}
.emoji-img {
position: absolute;
left: 10px;
bottom: 10px;
}
}
.el-textarea {
/deep/ .el-textarea__inner {
height: 273px;
}
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-07-16 16:37:05 * @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-07-17 11:07:15 * @LastEditTime: 2020-07-20 14:49:34
*/ */
import _import from './_import.js'; import _import from './_import.js';
...@@ -78,6 +78,20 @@ export const routes = [ ...@@ -78,6 +78,20 @@ export const routes = [
] ]
}, },
{ {
// 企业设置
path: '/enterprise',
name: '企业设置',
redirect: 'enterpriseSet',
component: _import('enterprise', 'index'),
children: [
{
path: '/enterpriseSet',
name: '企业信息',
component: _import('enterprise', 'enterpriseSet')
}
]
},
{
path: '/gic-error', path: '/gic-error',
name: 'gic跳转失败页', name: 'gic跳转失败页',
component: _import('errorPage', 'gic-error') component: _import('errorPage', 'gic-error')
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-07-20 14:49:18
-->
<template>
<div class="my-customer-wrap common-set-wrap">
<vue-office-header :projectName="projectName" @collapseTag="collapseTag" @toRouterView="toRouterView"> </vue-office-header>
<div class="enterprise-wrap__body">
<div id="content" class="content">
<div class="content-body">
<div class="right-content border-box">
<div class="right-box" style="min-height: calc(100vh - 86px);">
<div class="apps-content flex" style="min-height: calc(100vh - 86px);">
<div class="apps-content-left w-157" style="min-height: calc(100vh - 86px);">
<common-detail-left :tabListData="tabListData" :activeSelTab="activeSelTab" @setSelectTab="setSelectTab"></common-detail-left>
</div>
<div class="apps-content-right border-box">
<transition name="fade" mode="out-in">
<router-view :brandId="activeBrand" :activeGroupId="activeGroup" :tabType="activeTab" @showTab="showTab"></router-view>
</transition>
</div>
</div>
</div>
</div>
<!-- <vue-gic-footer></vue-gic-footer> -->
<!-- 公共组件 -->
</div>
</div>
</div>
</div>
</template>
<script>
import commonDetailLeft from '@/components/app/app-detail-left.vue';
import vueOfficeHeader from '@/components/vue-office-header.vue';
export default {
name: 'reviewed',
data() {
return {
bgHeight: window.screen.availHeight - 288 + 'px',
activeSelTab: '1',
activeTab: '1',
tabListData: [
{
tabId: '1',
tabName: '企业信息',
icon: 'iconqiyexinxi'
}
],
activeBrand: '', // 商户(品牌) id
activeGroup: '' // 商户(品牌) groupId
};
},
computed: {},
methods: {
// 处理路由跳转
toRouterView(val) {
let that = this;
// 模拟检查数据
// //有两个参数
//{
// name:,
// path:
//}
that.$router.push({
path: val.path
});
},
/**
* 路由跳转
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* 返回 的 brandId
*/
selectBrandId(id, groupId) {
let that = this;
that.activeBrand = id;
that.activeGroup = groupId;
},
/**
* 选择后返回tabId,做各路由判断
*/
setSelectTab(item) {
let that = this;
that.activeTab = item.tabId;
switch (item.tabId) {
case '1':
that.changeRoute('enterpriseSet');
break;
case '2':
that.changeRoute('adminList');
break;
case '3':
that.changeRoute('material');
break;
}
},
/**
* 各路由返回 tabId
*/
showTab(id) {
let that = this;
that.activeTab = id;
that.activeSelTab = id;
that.tabListData.forEach(ele => {
if (ele.tabId == id) {
ele.onlyIconActive = false;
}
if (!!ele.children) {
ele.children.forEach(el => {
if (el.tabId == id) {
ele.onlyIconActive = true;
}
if (!!el.children) {
el.children.forEach(item => {
if (item.tabId == id) {
ele.onlyIconActive = true;
}
});
}
});
}
});
}
},
watch: {
$route: {
handler: function(val, oldVal) {},
// 深度观察监听
deep: true
},
activeBrand: function(newData, oldData) {
const that = this;
that.activeBrand = newData;
},
activeGroup: function(newData, oldData) {
const that = this;
that.activeGroup = newData;
}
},
mounted() {
// const that = this;
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {
commonDetailLeft,
vueOfficeHeader
}
};
</script>
<style type="text/scss" lang="scss" scoped>
.bg-82C5FF {
background: #82c5ff;
}
.color-508CEE {
color: #508cee;
}
.color-FF585C {
color: #ff585c;
}
.line-h-18 {
line-height: 18px;
}
.tooltip-text {
width: 100%;
white-space: pre-wrap;
word-break: break-all;
}
.my-customer-wrap {
height: 100%;
}
.content {
padding-top: 46px;
min-width: 1400px;
box-sizing: border-box;
}
.right-content {
/*width: 100%;*/
padding: 20px;
min-height: calc(100% - 157px);
.right-box {
background: #fff;
min-height: 500px;
padding: 0px;
.apps-content {
.apps-content-left {
min-width: 157px;
height: 100%;
background: #fff;
overflow-x: hidden;
overflow-y: auto;
.apps-content-left__title {
height: 55px;
line-height: 55px;
padding: 0 0 0 18px;
}
.tab-left-list-cell {
position: relative;
text-align: left;
margin-top: 15px;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
&:hover {
background: rgba(24, 144, 255, 0.06);
i {
color: #2f54eb;
}
}
&.active-tab {
background: rgba(24, 144, 255, 0.06);
&::before {
content: ' ';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 2px;
background: #2f54eb;
z-index: 1;
}
i {
color: #2f54eb;
}
}
.child-tab-left-list {
li {
position: relative;
text-align: left;
height: 30px;
line-height: 30px;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
&:hover {
background: rgba(24, 144, 255, 0.06);
i {
color: #2f54eb;
}
}
&.active-tab {
background: rgba(24, 144, 255, 0.06);
&::before {
content: ' ';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 2px;
background: #2f54eb;
z-index: 1;
}
i {
color: #2f54eb;
}
}
}
}
}
}
.apps-content-right {
width: calc(100% - 157px);
padding-left: 10px;
background: #f0f2f5;
.daily-set-wrap {
height: 100%;
background: #fff;
}
.app-detail-wrap {
height: 100%;
background: #fff;
}
.common-set-wrap {
height: 100%;
background: #fff;
}
}
}
}
}
</style>
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