Commit 274a42b2 by 张立顺

feat:虚拟对公账户详情也开发

1 parent fc946905
const elTransition =
'0.3s height ease-in-out, 0.3s padding-top ease-in-out, 0.3s padding-bottom ease-in-out'
const Transition = {
'before-enter'(el) {
el.style.transition = elTransition
if (!el.dataset) el.dataset = {}
el.dataset.oldPaddingTop = el.style.paddingTop
el.dataset.oldPaddingBottom = el.style.paddingBottom
el.style.height = 0
el.style.paddingTop = 0
el.style.paddingBottom = 0
},
enter(el) {
el.dataset.oldOverflow = el.style.overflow
if (el.scrollHeight !== 0) {
el.style.height = el.scrollHeight + 'px'
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
} else {
el.style.height = ''
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
}
el.style.overflow = 'hidden'
},
'after-enter'(el) {
el.style.transition = ''
el.style.height = ''
el.style.overflow = el.dataset.oldOverflow
},
'before-leave'(el) {
if (!el.dataset) el.dataset = {}
el.dataset.oldPaddingTop = el.style.paddingTop
el.dataset.oldPaddingBottom = el.style.paddingBottom
el.dataset.oldOverflow = el.style.overflow
el.style.height = el.scrollHeight + 'px'
el.style.overflow = 'hidden'
},
leave(el) {
if (el.scrollHeight !== 0) {
el.style.transition = elTransition
el.style.height = 0
el.style.paddingTop = 0
el.style.paddingBottom = 0
}
},
'after-leave'(el) {
el.style.transition = ''
el.style.height = ''
el.style.overflow = el.dataset.oldOverflow
el.style.paddingTop = el.dataset.oldPaddingTop
el.style.paddingBottom = el.dataset.oldPaddingBottom
}
}
export default {
name: 'collapseTransition',
functional: true,
render(h, { children }) {
const data = {
on: Transition
}
return h('transition', data, children)
}
}
// 将该代码定义为一个js文件
const resize = {
bind(el, binding) {
let width = ''
let height = ''
function isResize() {
const style = document.defaultView.getComputedStyle(el)
if (width !== style.width || height !== style.height) {
binding.value()
}
width = style.width
height = style.height
}
el._vueSetInterval_ = setInterval(isResize, 300)
},
unbind(el) {
clearInterval(el._vueSetInterval_)
}
}
export default resize
......@@ -111,12 +111,11 @@ export default {
}
</script>
<style scoped lang="scss">
#baseDialog {
overflow: hidden;
}
::v-deep .el-dialog {
height: 90vh;
// height: 90vh;
border-radius: 6px;
// padding: 0;
overflow: hidden;
.el-dialog__header {
// box-shadow: 0px 0px 5px 0px rgba(136, 152, 157, 0.3);
border-bottom: solid 1px #e6e6e6;
......@@ -137,10 +136,11 @@ export default {
}
}
.el-dialog__body {
padding-left: 25px;
box-sizing: border-box;
// padding-left: 25px;
color: #333;
height: calc(100% - 121px);
overflow: scroll;
max-height: calc(100% - 121px);
// height: calc(100% - 121px);
}
.roleTitle {
margin-right: 40px;
......
......@@ -45,7 +45,7 @@ axios({
}).then(({ data }) => {
baseConfig = data
// 先本地切换到测试环境接口
data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
new Vue({
router,
store,
......
import Vue from 'vue'
import VueRouter from 'vue-router'
// 进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import store from '@/store/index'
import util from '@/libs/util.js'
// 路由数据
import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location) && originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
// 导出路由 在 main.js 里使用
const router = new VueRouter({
routes
})
const setCurrent = path => {
return new Promise(async resolve => {
path !== '/login' && await store.dispatch('d2admin/page/currentSet', path)
resolve()
})
}
/**
* 路由拦截
* 权限验证
*/
router.beforeEach(async(to, from, next) => {
const source = store.state.d2admin.auth.source
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
// await store.dispatch('d2admin/page/isLoaded')
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
// await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面
await setCurrent(to.fullPath)
// 进度条
NProgress.start()
// 关闭搜索面板
store.commit('d2admin/search/set', false)
if (from.name === null && to.path !== '/login' && !source) { // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load')
next(to.path)
} else {
if (store.state.d2admin.user.info) { // sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
next()
} else {
if (to.path === '/login') { // 如果是登录页面路径,就直接next()
next()
} else { // 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
next('/login')
}
}
}
})
router.afterEach(to => {
// 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
// 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
})
export const ResetRouter = () => new VueRouter({
routes
})
export default router
import Vue from 'vue'
import VueRouter from 'vue-router'
// 进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import store from '@/store/index'
import util from '@/libs/util.js'
// 路由数据
import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push(location, onResolve, onReject) {
// 解决Uncaught (in promise) 控制台报错问题
if (onResolve || onReject) {
return originalPush.call(this, location, onResolve, onReject)
}
return originalPush.call(this, location).catch(err => err)
// return originalPush.call(this, location) && originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
// 导出路由 在 main.js 里使用
const router = new VueRouter({
routes
})
const setCurrent = path => {
return new Promise(async resolve => {
path !== '/login' && (await store.dispatch('d2admin/page/currentSet', path))
resolve()
})
}
/**
* 路由拦截
* 权限验证
*/
router.beforeEach(async (to, from, next) => {
const source = store.state.d2admin.auth.source
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
// await store.dispatch('d2admin/page/isLoaded')
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
// await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面
await setCurrent(to.fullPath)
// 进度条
NProgress.start()
// 关闭搜索面板
store.commit('d2admin/search/set', false)
if (from.name === null && to.path !== '/login' && !source) {
// 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load')
next(to.path)
} else {
if (store.state.d2admin.user.info) {
// sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
next()
} else {
if (to.path === '/login') {
// 如果是登录页面路径,就直接next()
next()
} else {
// 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
next('/login')
}
}
}
})
router.afterEach(to => {
// 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
// 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
})
export const ResetRouter = () =>
new VueRouter({
routes
})
export default router
<!-- 商品管理 -->
<template>
<d2-container class="commodity">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData"
>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData">
<!-- <p>
<el-input
size="small"
......@@ -22,84 +18,60 @@
</p> -->
</d2-search>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
<el-button :id="tableParams.btnId"
size="small"
type="primary">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030201']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
:showBtnIds="['9030201']"></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030202']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
:showBtnIds="['9030202']"></auth-button>
</d2-table-header>
<d2-table
ref="commodityTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
>
<img
slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.goodsInfo.thumbUrl"
/>
<template
v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)"
>查看</el-button>
<auth-button
:data="scope.scope"
></auth-button>
<d2-table ref="commodityTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<img slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.goodsInfo.thumbUrl" />
<template v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)">查看</el-button>
<auth-button :data="scope.scope"></auth-button>
</template>
</d2-table>
</div>
<d2-dialog
:title="detailData ? detailData.goodsInfo.goodsName : ''"
:className="storeDetail"
:isVisible.sync="detailVisible"
:showClose="showClose"
noCancel="true"
@closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose"
>
<store-detail
v-if="detailVisible"
:detailData="detailData"
></store-detail>
<d2-dialog v-if="detailVisible"
:title="detailData ? detailData.goodsInfo.goodsName : ''"
:className="storeDetail"
:isVisible.sync="detailVisible"
:showClose="showClose"
noCancel="true"
@closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose">
<store-detail :detailData="detailData"></store-detail>
</d2-dialog>
<!-- 查看面板 -->
<drawer-detail
v-if="drawerDetailVisible"
:drawerDetailVisible="drawerDetailVisible"
:commodityInfoId="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose"
></drawer-detail>
<drawer-detail v-if="drawerDetailVisible"
:drawerDetailVisible="drawerDetailVisible"
:commodityInfoId="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose"></drawer-detail>
</d2-container>
</template>
......
......@@ -42,12 +42,14 @@
v-if="accountDetailVisible"
@confirmDialog="handleDetailClose"
noCancel="true" -->
<!-- v-if="accountDetailVisible" -->
<baseDialog :isShow.sync="accountDetailVisible"
:config="dialogConfig.setting"
:dialogConfig="dialogConfig.config"
@closeDialog="handleDetailClose">
<!-- <span>test</span> -->
<account-detail :accountDetailVisible="accountDetailVisible"
<account-detail v-if="accountDetailVisible"
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"></account-detail>
</baseDialog>
......@@ -299,7 +301,7 @@ export default {
},
handleDetailClose() {
console.log('visible')
// console.log('visible')
this.accountDetailVisible = !this.accountDetailVisible
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!