Commit 14864aa8 by 胡悦

合并、提交

2 parents 52574c7a fdff2951
...@@ -2677,6 +2677,11 @@ ...@@ -2677,6 +2677,11 @@
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
"dev": true "dev": true
}, },
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
},
"check-types": { "check-types": {
"version": "7.4.0", "version": "7.4.0",
"resolved": "http://registry.npm.taobao.org/check-types/download/check-types-7.4.0.tgz", "resolved": "http://registry.npm.taobao.org/check-types/download/check-types-7.4.0.tgz",
...@@ -3344,6 +3349,11 @@ ...@@ -3344,6 +3349,11 @@
"which": "^1.2.9" "which": "^1.2.9"
} }
}, },
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
},
"crypto-browserify": { "crypto-browserify": {
"version": "3.12.0", "version": "3.12.0",
"resolved": "http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz", "resolved": "http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz",
...@@ -5474,10 +5484,26 @@ ...@@ -5474,10 +5484,26 @@
"minimatch": "~3.0.2" "minimatch": "~3.0.2"
} }
}, },
"glsx-table": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/glsx-table/-/glsx-table-1.0.3.tgz",
"integrity": "sha512-J0Ha1J1s3SOLurkZE3HRLF1EHFF3/LsD7eu0uEfJG+qZeobpBN0wXBs54kwisiUG/rBH46JxQ5hw9ABVhQvZgQ==",
"requires": {
"element-ui": "^2.13.1",
"vue": "^2.6.12"
},
"dependencies": {
"vue": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz",
"integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ=="
}
}
},
"glsx-vue-common": { "glsx-vue-common": {
"version": "1.2.8", "version": "1.2.9",
"resolved": "https://registry.npmjs.org/glsx-vue-common/-/glsx-vue-common-1.2.8.tgz", "resolved": "https://registry.npmjs.org/glsx-vue-common/-/glsx-vue-common-1.2.9.tgz",
"integrity": "sha512-xUJ2kuVH26Hs/aAJLxkHkj1XXEY3xcS8SX4FmFPwTxgvWeRYJzMK3prkiuxbDuvDt7MybeYAi+K0bjTdRiEF2w==", "integrity": "sha512-oG7tbd5ex0xmcmrBzmYYrRj8aXjFpfBl2/etUqzwHhuSswNl7hAxuhmJxF1JhnOoOcOjgq/HqIFYtnv3eGt1jw==",
"requires": { "requires": {
"vue": "^2.5.10" "vue": "^2.5.10"
} }
...@@ -7516,6 +7542,11 @@ ...@@ -7516,6 +7542,11 @@
"minimist": "0.0.8" "minimist": "0.0.8"
} }
}, },
"moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"move-concurrently": { "move-concurrently": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "http://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", "resolved": "http://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",
...@@ -10634,6 +10665,15 @@ ...@@ -10634,6 +10665,15 @@
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=",
"requires": {
"charenc": ">= 0.0.1",
"crypt": ">= 0.0.1"
}
},
"shallow-clone": { "shallow-clone": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/shallow-clone/download/shallow-clone-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/shallow-clone/download/shallow-clone-1.0.0.tgz",
......
...@@ -12,10 +12,13 @@ ...@@ -12,10 +12,13 @@
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"element-ui": "^2.15.1", "element-ui": "^2.15.1",
"glsx-vue-common": "^1.2.8", "glsx-table": "^1.0.3",
"glsx-vue-common": "^1.2.9",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"moment": "^2.29.1",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"sha1": "^1.1.1",
"vue": "^2.5.17" "vue": "^2.5.17"
}, },
"devDependencies": { "devDependencies": {
......
import request from './request'
const path = 'org.ore.api.accountType.'
const accountApi = {
/** 账户类型分页数据*/
getPageApi(data = {}) {
data.method = `${path}page`
return request(data)
},
/** 账户类型列表 */
getList(data = {}) {
data.method = `${path}list`
return request(data)
},
/** 删除账户类型 */
delete(data = {}) {
data.method = `${path}deleteById`
return request(data)
},
/** 根据id获取账户类型 */
getById(data = {}) {
data.method = `${path}getById`
return request(data)
},
/** 新增账户类型 */
insert(data = {}) {
data.method = `${path}insert`
return request(data)
},
/** 编辑账户类型 */
update(data = {}) {
data.method = `${path}update`
return request(data)
}
}
export { accountApi }
import request from './request'
const path = 'cn.com.glsx.merchants.menu.'
const dictApi = {
/** 查询字典类型*/
findDictType(data = {}) {
data.method = `${path}findDictType`
return request(data)
},
/** 删除字典类型 */
deleteDictType(data = {}) {
data.method = `${path}deleteDictType`
return request(data)
},
/** 保存字典类型 */
saveDictType(data = {}) {
data.method = `${path}saveDictType`
return request(data)
},
/** 更新字典类型 */
updateDictType(data = {}) {
data.method = `${path}updateDictType`
return request(data)
},
/** 查询字典数据列表 */
findDictData(data = {}) {
data.method = `${path}findDictData`
return request(data)
},
/** 删除字典数据 */
deleteDictData(data = {}) {
data.method = `${path}deleteDictData`
return request(data)
},
/** 保存字典数据 */
saveDictData(data = {}) {
data.method = `${path}saveDictData`
return request(data)
},
/** 更新字典数据 */
updateDictData(data = {}) {
data.method = `${path}updateDictData`
return request(data)
}
}
export { dictApi }
import request from './request'
const path = 'cn.com.glsx.merchants.'
// 产品
export const productApi = {
/** 获取财务管理列表*/
getListApi(data = {}) {
data.method = `${path}product.findProductByPage`
return request(data)
}
}
// 菜单
export const menuApi = {
/** 获取财务管理列表*/
getListApi(data = {}) {
data.method = `${path}menu.findMerProMenuByPageRemote`
return request(data)
}
}
// 功能
export const functionApi = {
/** 获取财务管理列表*/
getListApi(data = {}) {
data.method = `${path}menu.findMerchantFunction`
return request(data)
}
}
import RequestMethods from './request.methods'
// import GlsxVueCommon from 'glsx-vue-common'
import sign from './sign'
import {
GlAxios
} from 'glsx-vue-common'
const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
params.source = 'glsx-oss-merchant-data'
params.appKey = '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
// params.createBy = this.$get_session_config().user.id
var data = sign(params, noSignAttr)
return method === RequestMethods.GET ? GlAxios.get('router', {
params: sign(params, noSignAttr)
}) : GlAxios.post('router', data)
}
export default request
const RequestMethods = {
POST: 'post',
GET: 'get',
PUT: 'put',
DELETE: 'delete'
}
export default RequestMethods
import sha1 from 'sha1'
import qs from 'qs'
import _ from 'lodash'
const secret = window.location.href.includes('dj.glsx.com.cn') ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => {
delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices',
allowDots: true,
encodeValuesOnly: true
})
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
const idx = item.indexOf('=')
realObj[item.split('=')[0]] = decodeURIComponent(item.slice(idx + 1))
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// (runtime-only or standalone) has been set in webpack.base.conf with an alias. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue' import Vue from 'vue'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import glsxTable from 'glsx-table'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
// import GlsxVueComponents from 'glsx-vue-components' // import GlsxVueComponents from 'glsx-vue-components'
// import 'glsx-vue-components/dist/glsx-vue-components.css' // import 'glsx-vue-components/dist/glsx-vue-components.css'
...@@ -17,8 +18,15 @@ Vue.prototype.btn_size = 'mini' ...@@ -17,8 +18,15 @@ Vue.prototype.btn_size = 'mini'
Vue.prototype.$Common = Common Vue.prototype.$Common = Common
Vue.prototype.$Constants = Constants Vue.prototype.$Constants = Constants
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(glsxTable)
var mixin = { var mixin = {
data() {
return {
flag: true,
eventBus: new Vue()
}
},
mounted() { mounted() {
const _this = this const _this = this
const theme = new this.$Theme() const theme = new this.$Theme()
...@@ -29,16 +37,40 @@ var mixin = { ...@@ -29,16 +37,40 @@ var mixin = {
}, },
height() { height() {
return document.height || document.body.offsetHeight // document.documentElement.clientHeight || document.body.clientHeight // return document.height || document.body.offsetHeight // document.documentElement.clientHeight || document.body.clientHeight //
},
translate(params) {
_this.eventBus.$emit('params', params)
} }
} }
}) })
connection.promise.then(parent => { connection.promise.then(parent => {
const cfg = _this.$get_session_config() const cfg = _this.$get_session_config()
_this.$$parent = parent
if (cfg) return if (cfg) return
parent.getResources().then(config => { parent.getResources().then(config => {
_this.$set_session_config(config) _this.$set_session_config(config)
}) })
}) })
},
methods: {
/**
* 页面跳转方法 用法 :
* this.$root.to(['MOCK系统A', '一键导航', '导航数据', 'MOCK数据B', 'localhost'],'1123')
* 或:
* this.$parent.to(['MOCK系统A', '一键导航', '导航数据', 'MOCK数据B', 'localhost'],'1123')
*
* @param {*} path 如: ['一级菜单名称','二级菜单名称','三级菜单名称','四级菜单名称','五级菜单名称']
* @param {*} params 传给下一个页面的参数
*/
to(path, params) {
if (this.$$parent) {
this.$$parent.to(path, params)
} else {
this.$$connection.promise.then(parent => {
parent.to(path, params)
})
}
}
} }
} }
const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config' const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
......
import Vue from 'vue'
export default new Vue({
methods: {
warningTips(message) {
this.$notify({
type: 'warning',
title: message
})
},
okTips(message) {
this.$notify({
type: 'success',
title: message || '操作成功'
})
},
errorTips(message) {
this.$notify({
type: 'error',
title: message || '操作失败'
})
}
}
})
import Vue from 'vue'
import { Message, MessageBox, Loading } from 'element-ui';
import moment from 'moment'
let loadingInstance = ''
export const Util = {
/**
* 简单alert
* title 标题
* message 内容
* className 自定义class
* showCancelButton 是否展示取消按钮
* confirmButtonText 确认按钮文案
* cancelButtonText 取消按钮文案
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
*/
msg: function(options) {
MessageBox({
title: options.title || '',
type: options.type || 'error',
message: options.message || '',
className: options.className || '',
showCancelButton: options.showCancelButton || false,
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true,
callback: function(action, done) {
if (action == 'confirm') {
if (options.success) {
(options.success)(done)
}
} else {
console.log(done);
// done()
}
}
});
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
* 提示框
*/
Info: function(options) {
Message({
message: options.message || '提示',
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || ''
});
},
/**
* 轻提示
*/
Tips: function(options) {
Message({
message: options.message || '提示',
duration: options.duration || 3000,
type: options.type || 'text',
icon: options.icon || ''
})
},
/**
* loading
*/
loading: function(message) {
loadingInstance = Loading.service({
text: message || '加载中...'
});
},
/**
* 关闭loading
*/
closeLoading: function() {
loadingInstance.close();
},
/**
* 校验手机号码格式
*/
checkPhone: function(mobile) {
let myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/;
return myreg.test(mobile);
},
/**
* 校验固定电话
*/
validationTel: function(tel) {
let reg = /^0[\d]{2,3}-[\d]{7,8}$/;
return reg.test(tel);
},
/**
* 是否特殊字符
*/
isSpecialLetter: function(str) {
let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]");
return reg.test(str);
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function(str) {
let reg = /[^\w\.\/]/ig;
return reg.test(str);
},
/**
* 获取当前时间
*/
getCurrentDate: function() {
let time = new Date();
let y = time.getFullYear();
let m = time.getMonth() + 1;
let d = time.getDate();
return {
date: y + '/' + m + '/' + d
}
},
/**
   * 获取浏览器参数
   */
  getUrlParams: function(name) {
    let vars = [],
      hash;
      let oParams = {};
    let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (let i = 0; i < hashes.length; i++) {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      oParams[hash[0]] = hash[1];
    }
    console.log(vars);
    if(name){
      return oParams[name];
    }else{
      return oParams;
    }
  },
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function(day) {
let date1 = new Date();
let date2 = new Date(date1);
let time = 30;
if (day) {
time = day;
}
date2.setDate(date1.getDate() + time);
let _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate();
return {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate()
};
},
/**
* 日期格式转换
*/
dateFormate: function(str, type) {
let txt = 'YYYY-MM-DD'
if (type) {
txt = type
}
const m = moment(str).format(txt)
return m
},
/**
* 字段截取
*/
cutStr: function(str, num) {
if (!str) {
return ''
}
let m = 10
let n = str
if (num) {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class="d2-table"> <div class="d2-table">
<el-table <el-table
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'"
:data="getListApi ? data : tableData" :data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''" :row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading" v-loading="loading"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
width="60px" width="60px"
label="序号" label="序号"
type='index' type='index'
:index="index=>index+(page.currentPage - 1) * page.pageSize + 1" :index="index=>index+(page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
v-for="(item, index) in tableParams.tableColumns" v-for="(item, index) in tableParams.tableColumns"
...@@ -93,9 +93,9 @@ ...@@ -93,9 +93,9 @@
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="page.currentPage" :current-page="page[this.pageConf.pageNum]"
:page-sizes="[10,20,30,40]" :page-sizes="[10,20,30,40]"
:page-size="page.pageSize" :page-size="page[this.pageConf.pageSize]"
:total="getListApi ? total : tableTotal" :total="getListApi ? total : tableTotal"
:layout="layout" :layout="layout"
> >
...@@ -111,10 +111,7 @@ export default { ...@@ -111,10 +111,7 @@ export default {
loading: false, loading: false,
data: [], data: [],
// 页码 // 页码
page: { page: {},
pageSize: 10,
currentPage: 1
},
total: 10, total: 10,
// 排序 // 排序
sortColum: '', sortColum: '',
...@@ -158,6 +155,10 @@ export default { ...@@ -158,6 +155,10 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
pageConf: {
type: Object,
default: () => ({ pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'totalCount' })
},
// 分页组件配置 // 分页组件配置
layout: { layout: {
type: String, type: String,
...@@ -213,6 +214,9 @@ export default { ...@@ -213,6 +214,9 @@ export default {
}, },
mounted() { mounted() {
this.page = {}
this.page[this.pageConf.pageSize] = 10
this.page[this.pageConf.pageNum] = 1
const btn = document.getElementById(this.tableParams.btnId) const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshEmit) btn && btn.addEventListener('click', this.refreshEmit)
this.getListApi && this.refreshTable() this.getListApi && this.refreshTable()
...@@ -244,13 +248,12 @@ export default { ...@@ -244,13 +248,12 @@ export default {
this.refreshTable(true, true) this.refreshTable(true, true)
}, },
refreshTable(clearMuti = true, resetCurrentPage = false) { refreshTable(clearMuti = true, resetPageNum = false) {
this.beforeSearchFn().then(res => { this.beforeSearchFn().then(res => {
// console.log(res)
// 清空多选 // 清空多选
clearMuti && this.clearMutiSelect() clearMuti && this.clearMutiSelect()
this.loading = true this.loading = true
resetCurrentPage && (this.page.currentPage = 1) resetPageNum && (this.page.pageNum = 1)
var params = { var params = {
...this.page, ...this.page,
...this.searchForm ...this.searchForm
...@@ -260,8 +263,8 @@ export default { ...@@ -260,8 +263,8 @@ export default {
params.sort = this.sort === 'descending' ? 1 : 0 params.sort = this.sort === 'descending' ? 1 : 0
} }
this.getListApi(params).then(res => { this.getListApi(params).then(res => {
this.data = res[this.tableParams.listName] this.data = this.findVal(res, this.tableParams.listName)
this.total = res.pagination.totalCount this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false this.loading = false
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
...@@ -269,15 +272,24 @@ export default { ...@@ -269,15 +272,24 @@ export default {
}) })
}, },
// 找返回值
findVal(res, rankStr, attr) {
var rankList = rankStr.split('.')
if (!rankStr) {
return res
}
return this.findVal(res[rankList[0]], rankList.splice(1).join('.'), attr)
},
// 每页条数 // 每页条数
handleSizeChange(value) { handleSizeChange(value) {
this.page.pageSize = value this.page[this.pageConf.pageSize] = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page) this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
}, },
// 页码 // 页码
handleCurrentChange(value) { handleCurrentChange(value) {
this.page.currentPage = value this.page[this.pageConf.pageNum] = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page) this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
} }
} }
......
/**
* 时间控件-限制月份
*/
export const rangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form
:inline="true"
v-model="formObj"
:label-width="labelWidth"
:rules="formRules"
size="small"
class="glsx-combi-form-block"
>
<template v-for="(item, index) in formData">
<el-form-item
v-if="!item.isHide"
:key="index"
:class="{'no-label': !item.label}"
:label="item.label ? (item.label + ':') : ''"
:prop="item.name"
>
<el-input
v-if="item.type === 'input'"
:placeholder="item.placeholder || ('请输入' + item.label)"
v-model.trim="formObj[item.name]"
:disabled="item.isDisabled"
:maxlength="item.maxlength"
:clearable="item.isClear || false"
:type="item.inputType || 'text'"
@keydown.native="e => handleInputDown(e, item)"
></el-input>
<!-- 选择-输入框 -->
<el-input
v-else-if="item.type === 'selectInput'"
:placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label"
v-model.trim="searchSelectObj[item.selectName].value"
:clearable="item.isClear || false"
class="input-with-select"
>
<el-select
v-model="searchSelectObj[item.selectName].attr"
style="width: 130px"
slot="prepend"
placeholder="请选择"
@change="item.handleSelectChange"
>
<el-option
v-for="(subItem, subIndex) in item.selectOption"
:key="subIndex"
:label="subItem.label"
:value="subItem.name"
></el-option>
</el-select>
</el-input>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectDatePicker'">
<el-select
v-model="searchSelectObj[item.selectName].attr"
style="width: 130px"
placeholder="请选择"
@change="item.handleSelectChange"
>
<el-option
v-for="(subItem, subIndex) in item.selectOption"
:key="subIndex"
:label="subItem.label"
:value="subItem.name"
></el-option>
</el-select>
<el-date-picker
v-model="searchSelectObj[item.selectName].value"
style="width: calc(100% - 130px)"
:type="item.dateType || 'daterange'"
:clearable="item.isClear || false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOption[item.pickerOptions]"
>
</el-date-picker>
</template>
<!-- 双选择框 -->
<template v-else-if="item.type === 'selectDouble'">
<el-select
v-model="searchSelectObj[item.selectName].attr"
style="width: 130px"
placeholder="请选择"
@change="item.handleSelectChange"
>
<el-option
v-for="(subItem, subIndex) in item.selectOption"
:key="subIndex"
:label="subItem.label"
:value="subItem.name"
></el-option>
</el-select>
<el-select
v-model="searchSelectObj[item.selectName].value"
style="width: calc(100% - 130px)"
:placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label"
>
<el-option
label="全部"
value=""
></el-option>
<el-option
v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]"
></el-option>
</el-select>
</template>
<!-- 选择框 -->
<el-select
v-else-if="item.type === 'select'"
:style="{ width: item.width || '100%'}"
v-model="formObj[item.name]"
:clearable="item.isClear || false"
:placeholder="'请选择' + item.label"
:filterable="!item.noFilter"
:disabled="item.isDisabled"
:no-data-text="item.noDataText || '无数据'"
:multiple="item.multiple || false"
:collapse-tags="item.collapseTags || true"
@change="selectAddAttr($event, item)"
>
<el-option
v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]"
>
</el-option>
</el-select>
<el-date-picker
v-else-if="item.type === 'datePicker'"
v-model="formObj[item.name]"
:type="item.dateType || 'daterange'"
:clearable="item.isClear || false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOption[item.pickerOptions]"
>
</el-date-picker>
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="item"
></slot>
</el-form-item>
</template>
<slot></slot>
</el-form>
</div>
</template>
<script>
import { rangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
return {
pickerOption: {
rangePickerOptions: rangePickerOptions
}
}
},
props: {
labelWidth: {
type: String,
default: '85px'
},
formData: {
type: Array,
default: () => []
},
formObj: {
type: Object,
default: () => { }
},
hasTitle: {
type: Boolean,
default: true
},
formRules: {
type: Object,
default: () => { }
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => { }
}
},
mounted() { },
methods: {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
}
}
}
</script>
<style>
/* .glsx-combi-form {
min-width: 922px;
} */
.glsx-combi-form .glsx-combi-form-block {
padding: 16px 40px 0;
}
/* .glsx-combi-form .el-form-item {
width: 65%;
} */
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content,
.el-form-item--small .el-form-item__label {
width: 100%;
}
/* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px);
} */
.glsx-combi-form .el-col {
margin-bottom: 10px;
}
.glsx-combi-form .el-select {
width: 100%;
}
.glsx-combi-form .item-height {
height: 37px;
}
.glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
.glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
>
<span slot="title">
{{title}}
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button
type="primary"
@click="handleConfirm"
>{{btnOkLabel}}</el-button>
<el-button
v-if="!noCancel"
@click="handleClose"
>取消</el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {
}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
...@@ -4,3 +4,5 @@ import Vue from 'vue' ...@@ -4,3 +4,5 @@ import Vue from 'vue'
Vue.component('d2-table', () => import('./d2-table/index.vue')) Vue.component('d2-table', () => import('./d2-table/index.vue'))
Vue.component('basic-dialog', () => import('./basic-dialog/index.vue')) Vue.component('basic-dialog', () => import('./basic-dialog/index.vue'))
Vue.component('rule-form', () => import('./rule-form/index.vue')) Vue.component('rule-form', () => import('./rule-form/index.vue'))
Vue.component('glsx-dialog', () => import('./glsx-dialog/index.vue'))
Vue.component('glsx-combi-form', () => import('./glsx-combi-form/index.vue'))
...@@ -81,3 +81,49 @@ a:hover { ...@@ -81,3 +81,49 @@ a:hover {
.el-table .cell { .el-table .cell {
padding: 0 0; padding: 0 0;
} }
// 状态
.dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 5px;
vertical-align: middle;
margin-right: 2px;
}
.green-text {
color: #00A854;
}
.red-text {
color: rgb(255, 0, 0);
}
.green {
background-color: #00A854;
}
.gray {
background-color: #BFBFBF;
}
.blue {
background-color: rgb(0, 81, 255);
}
.red {
background-color: rgb(255, 0, 0);
}
.yellow {
background-color: rgb(217, 255, 0);
}
.orange {
background-color: rgb(255, 145, 0);
}
.statusText {
vertical-align: middle;
}
\ No newline at end of file \ No newline at end of file
const Constants = { const Constants = {
// 字典状态
DICT_STATUS: {
'1': '启用, green',
'2': '停用, red'
},
ACCOUNT_STAUS: {
'0': '正常',
'1': '草稿'
},
DICT_STATUS_OPTIONS: [
{
label: '启用',
value: 1
},
{
label: '停用',
value: 2
}
]
} }
export default Constants export default Constants
...@@ -147,21 +147,25 @@ export default { ...@@ -147,21 +147,25 @@ export default {
} }
}, },
mounted() { mounted() {
this.accountRuleForm = { this.$root.eventBus.$on('params', (params) => {
accounttypeName: '12121', console.log(params)
accounttypeDetail: '232223', })
accounttypeCode: [{ // this.accountRuleForm = {
value: 1, // accounttypeName: '12121',
label: '嘀加智慧门店PC后台' // accounttypeDetail: '232223',
}, { // accounttypeCode: [{
value: 2, // value: 1,
label: '嘀加智享车生活PC后台' // label: '嘀加智慧门店PC后台'
}] // }, {
} // value: 2,
// label: '嘀加智享车生活PC后台'
// }]
// }
}, },
methods: { methods: {
// 功能权限切换 // 功能权限切换
handleClick(tab, event) { handleClick(tab, event) {
this.addStyle()
}, },
// 渲染树结构 // 渲染树结构
renderContent(h, v) { renderContent(h, v) {
...@@ -211,6 +215,8 @@ export default { ...@@ -211,6 +215,8 @@ export default {
case 'save': case 'save':
break break
case 'cancel': case 'cancel':
window.href = ""
// this.$parent.to(['MOCK系统G', '系统设置', '账户管理', '账户类型管理', '账户类型列表'])
break break
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div> <div>
<el-form :inline="true" :model="accountSearchForm"> <el-form :inline="true" :model="accountSearchForm">
<el-form-item> <el-form-item label="账户状态:">
<el-select <el-select
v-model="accountSearchForm.value" v-model="accountSearchForm.value"
:size="btn_size" :size="btn_size"
...@@ -17,32 +17,32 @@ ...@@ -17,32 +17,32 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="账户类型名称:">
<el-input v-model="accountSearchForm.input" :size="btn_size" placeholder="请输入内容"></el-input> <el-input v-model="accountSearchForm.input" :size="btn_size" placeholder="请输入内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button> <el-button type="primary" :size="btn_size" :id="accountTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size">添加账户类型</el-button> <el-button type="primary" :size="btn_size" @click="btnClick('create')">添加账户类型</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<d2-table :searchForm="accountSearchForm" :tableData="tableData" :tableParams="accountTableParams"> <d2-table :searchForm="accountSearchForm" :getListApi="getListApi" :tableParams="accountTableParams">
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button <el-button
type="text" type="text"
:size="btn_size" :size="btn_size"
@click="btnClick(scope.scope, 'view')" @click="btnClick()"
>查看详情</el-button >查看详情</el-button
> >
<el-button <el-button
type="text" type="text"
:size="btn_size" :size="btn_size"
@click="btnClick(scope.scope, 'edit')" @click="btnClick('edit', scope.scope)"
>修改</el-button >修改</el-button
> >
<el-button <el-button
type="text" type="text"
:size="btn_size" :size="btn_size"
@click="btnClick(scope.scope, 'delete')" @click="btnClick('delete', scope.scope)"
>删除</el-button >删除</el-button
> >
</div> </div>
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
</template> </template>
<script> <script>
import { accountApi } from '@/api/accountManage'
export default { export default {
data() { data() {
return { return {
...@@ -58,25 +59,29 @@ export default { ...@@ -58,25 +59,29 @@ export default {
tableData: [{ tableData: [{
name: 'dsfd' name: 'dsfd'
}], }],
getListApi: accountApi.getPageApi,
accountTableParams: { accountTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'data.data',
tableColumns: [ tableColumns: [
{ {
label: '账户类型ID', label: '账户类型ID',
prop: '' prop: 'accounttypeCode'
}, },
{ {
label: '账户类型名称', label: '账户类型名称',
prop: 'name' prop: 'accounttypeName'
}, },
{ {
label: '更新时间', label: '更新时间',
prop: '' prop: 'updatedTime'
}, },
{ {
label: '状态', label: '状态',
prop: '' prop: 'delFlag',
formatter: cellValue => {
return this.$Constants.ACCOUNT_STAUS[cellValue.delFlag]
}
} }
], ],
tableOption: true tableOption: true
...@@ -85,9 +90,11 @@ export default { ...@@ -85,9 +90,11 @@ export default {
} }
}, },
methods: { methods: {
btnClick(scope, type) { btnClick(type, scope) {
switch (type) { switch (type) {
case 'create': case 'create':
console.log('create')
this.$root.to(['商户账号系统', '系统设置', '账户管理', '账户类型管理', '*新增账户类型'], { id: 1 })
break break
case 'edit': case 'edit':
break break
......
...@@ -3,26 +3,27 @@ ...@@ -3,26 +3,27 @@
<el-form :inline="true" :model="dictDataSearchForm"> <el-form :inline="true" :model="dictDataSearchForm">
<el-form-item> <el-form-item>
<el-input <el-input
v-model="dictDataSearchForm.name" v-model="dictDataSearchForm.dictName"
:size="btn_size" :size="btn_size"
placeholder="请输入字典名称" placeholder="请输入字典名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="dictDataSearchForm.type" v-model="dictDataSearchForm.dictType"
:size="btn_size" :size="btn_size"
readonly
placeholder="请输入字典类型" placeholder="请输入字典类型"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select
v-model="dictDataSearchForm.status" v-model="dictDataSearchForm.enableStatus"
:size="btn_size" :size="btn_size"
placeholder="请选择字典状态" placeholder="请选择字典状态"
> >
<el-option <el-option
v-for="item in statusOptions" v-for="item in $Constants.DICT_STATUS_OPTIONS"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
>搜索</el-button >搜索</el-button
> >
<el-button type="primary" :size="btn_size" @click="btnClick('create')" <el-button type="primary" :size="btn_size" @click="btnClick('create')"
>新增</el-button >新增字典数据</el-button
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
ref="dictDataTable" ref="dictDataTable"
:tableParams="dictDataTableParams" :tableParams="dictDataTableParams"
:searchForm="dictDataSearchForm" :searchForm="dictDataSearchForm"
:tableData="dictDataTableData" :getListApi="getListApi"
> >
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<el-button <el-button
...@@ -78,20 +79,24 @@ ...@@ -78,20 +79,24 @@
</template> </template>
<script> <script>
import { dictApi } from '@/api/dictManage'
export default { export default {
data() { data() {
return { return {
dictDataSearchForm: {}, dictDataSearchForm: {
dictType: 'functional_attributes'
},
dictDataTableData: [ dictDataTableData: [
{ {
id: 1, id: 1,
dictName: 'dasf' dictName: 'dasf'
} }
], ],
getListApi: dictApi.findDictData,
dictDataTableParams: { dictDataTableParams: {
numName: '字典编码', numName: '字典编码',
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'data.data',
tableColumns: [ tableColumns: [
{ {
label: '字典标签', label: '字典标签',
...@@ -133,16 +138,6 @@ export default { ...@@ -133,16 +138,6 @@ export default {
] ]
} }
}, },
statusOptions: [
{
label: '启用',
value: 1
},
{
label: '停用',
value: 2
}
],
// 弹窗 // 弹窗
dictDataDialogTitle: '新增字典', dictDataDialogTitle: '新增字典',
dictDataVisible: false, dictDataVisible: false,
...@@ -190,8 +185,16 @@ export default { ...@@ -190,8 +185,16 @@ export default {
{ validator: this.$Common.checkRegExpNumber, trigger: 'blur' } { validator: this.$Common.checkRegExpNumber, trigger: 'blur' }
], ],
enableStatus: [{ required: true }] enableStatus: [{ required: true }]
},
dictData: {}
} }
} },
mounted() {
this.$root.eventBus.$on('params', (params) => {
console.log(params)
this.dictDataSearchForm.dictType = params.dictType
this.dictData = params
})
}, },
methods: { methods: {
// 确定 // 确定
...@@ -240,10 +243,10 @@ export default { ...@@ -240,10 +243,10 @@ export default {
case 'create': case 'create':
this.dictDataDialogTitle = '新增字典' this.dictDataDialogTitle = '新增字典'
// const params = this.getInitStorage() // const params = this.getInitStorage()
// this.dictDataForm = { this.dictDataForm = {
// dictType: params.row.dictType, dictType: this.dictData.dictType,
// enableStatus: params.row.enableStatus == 1 enableStatus: params.row.enableStatus == 1
// } }
this.handleClose() this.handleClose()
break break
case 'edit': case 'edit':
......
<template> <template>
<div> <div>
<el-form :inline="true" :model="dictSearchForm"> <el-form :inline="true" :model="dictSearchForm">
<el-form-item> <el-form-item label="字典名称:">
<el-input v-model="dictSearchForm.name" :size="btn_size" placeholder="请输入字典名称"></el-input> <el-input v-model="dictSearchForm.name" :size="btn_size" placeholder="请输入字典名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="字典类型:">
<el-input v-model="dictSearchForm.type" :size="btn_size" placeholder="请输入字典类型"></el-input> <el-input v-model="dictSearchForm.type" :size="btn_size" placeholder="请输入字典类型"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="字典状态:">
<el-select <el-select
v-model="dictSearchForm.status" v-model="dictSearchForm.enableStatus"
:size="btn_size" :size="btn_size"
placeholder="请选择字典状态" placeholder="请选择字典状态"
> >
<el-option <el-option
v-for="item in statusOptions" v-for="item in $Constants.DICT_STATUS_OPTIONS"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -24,10 +24,19 @@ ...@@ -24,10 +24,19 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">搜索</el-button> <el-button type="primary" :size="btn_size" :id="dictTableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" @click="btnClick('create')">新增</el-button> <el-button type="primary" :size="btn_size" @click="btnClick('create')">新增字典</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<d2-table ref="dictTable" :tableParams="dictTableParams" :searchForm="dictSearchForm" :tableData="tableData"> <d2-table ref="dictTable" :hasNum="false" :tableParams="dictTableParams" :searchForm="dictSearchForm" :getListApi="getListApi">
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span><span class="statusText">{{ scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span <span
slot="auth-button" slot="auth-button"
slot-scope="scope" slot-scope="scope"
...@@ -60,17 +69,20 @@ ...@@ -60,17 +69,20 @@
</template> </template>
<script> <script>
import { dictApi } from '@/api/dictManage'
export default { export default {
data() { data() {
return { return {
DICTSTATUS: this.$Constants.DICT_STATUS,
dictSearchForm: {}, dictSearchForm: {},
tableData: [{ tableData: [{
id: 1, id: 1,
dictName: 'dsfd' dictName: 'dsfd'
}], }],
getListApi: dictApi.findDictType,
dictTableParams: { dictTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'data.data',
tableColumns: [ tableColumns: [
{ {
label: '字典主键', label: '字典主键',
...@@ -111,15 +123,6 @@ export default { ...@@ -111,15 +123,6 @@ export default {
] ]
} }
}, },
statusOptions: [
{
label: '启用',
value: 1
}, {
label: '停用',
value: 2
}
],
// 弹窗 // 弹窗
dictionaryDialogTitle: '新增字典', dictionaryDialogTitle: '新增字典',
dictionaryVisible: false, dictionaryVisible: false,
...@@ -145,26 +148,26 @@ export default { ...@@ -145,26 +148,26 @@ export default {
console.log(this.dictionaryForm) console.log(this.dictionaryForm)
this.$refs.dictionaryForm.$children[0].validate((valid) => { this.$refs.dictionaryForm.$children[0].validate((valid) => {
if (valid) { if (valid) {
let params = JSON.parse(JSON.stringify(this.dictionaryForm)) const params = JSON.parse(JSON.stringify(this.dictionaryForm))
params.enableStatus = this.dictionaryForm.enableStatus ? 1 : 2 params.enableStatus = this.dictionaryForm.enableStatus ? 1 : 2
console.log(params) console.log(params)
// let api = addDict let api = 'saveDictType'
// if (params.id) api = editDict if (params.id) api = 'updateDictType'
// api(params).then(res => { dictApi[api](params).then(res => {
// if (res.code == 200) { if (res.code == 0) {
// this.$message({ this.$message({
// type: 'success', type: 'success',
// message: '操作成功!' message: '操作成功!'
// }) })
// this.$refs.dictManage.refreshTable() this.$refs.dictTable.refreshTable()
// this.handleClose() this.handleClose()
// } else { } else {
// this.$message({ this.$message({
// type: 'error', type: 'error',
// message: res.message message: res.message
// }) })
// } }
// }) })
} }
}) })
}, },
...@@ -204,10 +207,7 @@ export default { ...@@ -204,10 +207,7 @@ export default {
this.deleteEvent(scope.id) this.deleteEvent(scope.id)
break break
case 'list': case 'list':
// console.log('list', scope) this.$root.to(['商户账号系统', '系统设置', '字典管理', '字典类型', '*字典数据'], { id: 1 })
// const listData = { row: scope };
// localStorage.setItem('dictionaryParams', JSON.stringify(listData));
// this.$router.push({ name: 'dictionaryData', params: listData });
break break
} }
}, },
...@@ -228,23 +228,23 @@ export default { ...@@ -228,23 +228,23 @@ export default {
type: 'warning', type: 'warning',
callBack: () => { callBack: () => {
const params = { const params = {
typeId: id id
} }
console.log(params) console.log(params)
// deleteDict(params).then(res => { dictApi.deleteDictData(params).then(res => {
// if (res.code == 200) { if (res.code == 0) {
// this.$message({ this.$message({
// type: 'success', type: 'success',
// message: '删除成功!' message: '删除成功!'
// }) })
// this.$refs.dictManage.refreshTable() this.$refs.dictTable.refreshTable()
// } else { } else {
// this.$message({ this.$message({
// type: 'error', type: 'error',
// message: res.message message: res.message
// }) })
// } }
// }) })
} }
} }
this.$Common.confirmDialog(tipData) this.$Common.confirmDialog(tipData)
......
<template> <template>
<div id="app" class="outsider"> <div
id="app"
class="outsider"
>
<gl-card class="index-card"> <gl-card class="index-card">
<div slot="header"> <div slot="header">
广联运营平台 广联运营平台
...@@ -11,6 +14,36 @@ ...@@ -11,6 +14,36 @@
<li> <li>
<a href="../customer/account/add.html">添加账户</a> <a href="../customer/account/add.html">添加账户</a>
</li> </li>
<li>
<a href="../customer/dictionaryManage/index.html">字典类型</a>
</li>
<li>
<a href="../customer/dictionaryManage/dictionaryData.html">字典数据</a>
</li>
<li>
<a
href="../productManage/productList.html"
target="_self"
>
产品列表
</a>
</li>
<li>
<a
href="../productManage/menuList.html"
target="_self"
>
菜单列表
</a>
</li>
<li>
<a
href="../productManage/functionList.html"
target="_self"
>
功能管理
</a>
</li>
</ul> </ul>
</gl-card> </gl-card>
</div> </div>
...@@ -24,8 +57,8 @@ export default { ...@@ -24,8 +57,8 @@ export default {
</script> </script>
<style scoped> <style scoped>
.outsider{ .outsider {
background-color: #FFF; background-color: #fff;
padding: 20px 0px 40px 0px; padding: 20px 0px 40px 0px;
/* margin: 20px 20px; */ /* margin: 20px 20px; */
} }
......
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
const Apps = require.context('./', false, /\.vue$/)
Apps.keys().map(item => {
base.getConfig().then(data => {
const {
vue,
config
} = data
vue.use(GlsxVueCommon, config)
base.render(Apps(item).default)
})
})
<!-- 功能列表 -->
<template>
<div>
<el-button
icon="el-icon-plus"
@click="handleAdd"
>创建功能</el-button>
<glsx-combi-form
ref="showSearch"
labelWidth="120px"
:formObj="searchForm"
:searchSelectObj="searchSelectObj"
:formData="searchFormData"
>
<el-button
size="small"
type="primary"
:id="tableParams.btnId"
>查询</el-button>
</glsx-combi-form>
<glsx-table
ref="functionTable"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:getListApi="getListApi"
>
<el-button
slot="auth-button"
type="text"
>编辑</el-button>
</glsx-table>
<glsx-dialog
:title="title"
:isVisible="editVisible"
@closeDialog="handleAdd"
@confirmDialog="handleAdd"
>
<glsx-combi-form
labelWidth="130px"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
<el-select
slot="parentid"
slot-scope="scope"
></el-select>
</glsx-combi-form>
</glsx-dialog>
</div>
</template>
<script>
import _ from 'lodash'
import { functionApi } from '@/api/productManage'
export default {
name: 'functionList',
data() {
return {
searchForm: {
functionName: '',
merchantName: ''
},
searchSelectObj: {
funcOrName: {
attr: 'functionName',
value: ''
}
},
searchFormData: [{
label: '产品',
name: 'productId',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'productList'
}, {
label: '菜单',
name: '',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '功能属性类型',
name: '',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '商户账户类型',
name: '',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
label: '所属客户群体',
name: '',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}, {
type: 'selectInput',
selectName: 'funcOrName',
isClear: true,
selectOption: [{
label: '功能名称',
name: 'functionName'
}, {
label: '商户名称',
name: 'merchantName'
}],
handleSelectChange: (value) => {
this.searchSelectObj.funcOrName.value = ''
}
}],
getListApi: functionApi.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNumer', totalCount: 'data.totalCount' },
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableOption: true,
tableColumns: [{
label: '功能名称',
prop: 'functionName'
}, {
label: '功能属性名',
prop: 'functionAttributeName'
}, {
label: '功能属性类型',
prop: 'functionType'
}, {
label: '所属菜单名',
prop: 'menuId'
}, {
label: '所属菜单地址',
prop: ''
}, {
label: '所属产品',
prop: ''
}, {
label: '所属客户群体',
prop: 'ownedCusgroupValue'
}, {
label: '更新时间',
prop: ''
}]
},
// 弹窗
title: '创建产品',
editVisible: false,
editForm: {},
editRule: {
productName: [{ required: true, message: '请输入产品名称', trigger: 'blur' }]
},
editFormData: [{
label: '产品',
name: 'productId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'productList'
}, {
label: '父级菜单',
name: 'parentid',
addHtml: 'parentid'
}, {
label: '功能名称',
name: '',
type: 'input',
maxlength: 15
}, {
label: '功能属性名',
name: '',
type: 'input'
}, {
label: '所属客户群体'
}, {
label: '功能值',
name: '',
type: 'input'
}, {
label: '排序值',
name: 'sort',
type: 'input'
}],
// 基本数据
baseData: {
productList: [{
confId: '1',
confLabel: '产品1'
}, {
confId: '2',
confLabel: '产品2'
}, {
confId: '3',
confLabel: '产品3'
}]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getOptionsList('editFormData', false)
},
methods: {
keyDowmGetList() {
this.$refs.productTable.refreshTable()
},
getOptionsList(formName, hasAll = true) {
this[formName].forEach((item, index) => {
if (item.type === 'select') {
this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = _.cloneDeep(this.searchForm)
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
return params
},
handleAdd() {
this.editVisible = !this.editVisible
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file \ No newline at end of file
// import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
const Apps = require.context('./', false, /\.vue$/)
console.log('00000000000000')
Apps.keys().map(item => {
console.log(item)
base.getConfig().then(data => {
const {
vue,
config
} = data
vue.use(GlsxVueCommon, config)
base.render(Apps(item).default)
})
})
// base.getConfig().then(data => {
// const { vue, config } = data
// vue.use(GlsxVueCommon, config)
// base.render(App)
// })
<!-- 菜单列表 -->
<template>
<div>
<el-row>
<el-col :span="8">
<el-button
icon="el-icon-plus"
@click="handleAdd"
>创建菜单</el-button>
</el-col>
<el-col
style="text-align: right;"
:span="16"
>
<glsx-combi-form
ref="showSearch"
:formObj="searchForm"
:formData="searchFormData"
>
<el-button
size="small"
type="primary"
:id="tableParams.btnId"
>查询</el-button>
</glsx-combi-form>
</el-col>
</el-row>
<glsx-table
ref="menuTable"
:searchForm="searchForm"
:pageConf="pageConf"
:tableParams="tableParams"
:getListApi="getListApi"
>
<span slot="auth-button">
<el-button type="text">修改</el-button>
<el-button type="text">删除</el-button>
</span>
</glsx-table>
<glsx-dialog
:title="title"
:isVisible="editVisible"
@closeDialog="handleAdd"
@confirmDialog="handleAdd"
>
<glsx-combi-form
labelWidth="100px"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
<el-select
slot="parentid"
slot-scope="scope"
></el-select>
</glsx-combi-form>
</glsx-dialog>
</div>
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
import { menuApi } from '@/api/productManage'
export default {
name: 'menuList',
data() {
return {
searchForm: {
productId: [],
menuName: ''
},
searchFormData: [{
label: '产品',
name: 'productId',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'productList'
}, {
label: '菜单名称',
name: 'menuName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}],
getListApi: menuApi.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNumer', totalCount: 'data.totalCount' },
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableOption: true,
tableColumns: [{
label: '菜单名称',
prop: 'menuName'
}, {
label: '菜单编号',
prop: 'menuCode'
}, {
label: '排序值',
prop: 'sort'
}, {
label: '菜单地址',
prop: 'menuUrl'
}, {
label: '父级菜单名',
prop: ''
}, {
label: '产品名称',
prop: ''
}, {
label: '更新时间',
prop: 'updatedTime',
formatter: cellValue => {
return cellValue.updatedTime ? Util.dateFormate(cellValue.updatedTime, 'YYYY-MM-DD HH:mm:ss') : ''
}
}]
},
// 弹窗
title: '创建菜单',
editVisible: false,
editForm: {},
editRule: {
productId: [{ required: true, message: '请选择产品', trigger: 'blur' }]
},
editFormData: [{
label: '产品',
name: 'productId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'productList'
}, {
label: '父级菜单',
name: 'parentid',
addHtml: 'parentid'
}, {
label: '菜单名称',
name: 'menuName',
type: 'input',
maxlength: 15
}, {
label: '菜单地址',
name: 'menuUrl',
type: 'input'
}, {
label: '菜单ICON'
}, {
label: '菜单排序值',
name: 'sort',
type: 'input'
}],
// 基本数据
baseData: {
productList: [{
confId: '1',
confLabel: '产品1'
}, {
confId: '2',
confLabel: '产品2'
}, {
confId: '3',
confLabel: '产品3'
}]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getOptionsList('editFormData', false)
},
methods: {
keyDowmGetList() {
this.$refs.productTable.refreshTable()
},
getOptionsList(formName, hasAll = true) {
this[formName].forEach((item, index) => {
if (item.type === 'select') {
this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
},
handleAdd() {
this.editVisible = !this.editVisible
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file \ No newline at end of file
// import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
const Apps = require.context('./', false, /\.vue$/)
Apps.keys().map(item => {
base.getConfig().then(data => {
const {
vue,
config
} = data
vue.use(GlsxVueCommon, config)
base.render(Apps(item).default)
})
})
// base.getConfig().then(data => {
// const { vue, config } = data
// vue.use(GlsxVueCommon, config)
// base.render(App)
// })
<!-- 产品列表 -->
<template>
<div>
<el-row>
<el-col :span="12">
<el-button
icon="el-icon-plus"
@click="handleAdd"
>创建产品</el-button>
</el-col>
<el-col
style="text-align: right;"
:span="12"
>
<glsx-combi-form
ref="showSearch"
:formObj="searchForm"
:formData="searchFormData"
>
<el-button
size="small"
type="primary"
:id="tableParams.btnId"
>查询</el-button>
</glsx-combi-form>
</el-col>
</el-row>
<glsx-table
ref="productTable"
:searchForm="searchForm"
:pageConf="pageConf"
:tableParams="tableParams"
:getListApi="getListApi"
>
<el-button
slot="auth-button"
type="text"
>修改</el-button>
</glsx-table>
<glsx-dialog
:title="title"
:isVisible="editVisible"
@closeDialog="handleAdd"
@confirmDialog="handleAdd"
>
<glsx-combi-form
labelWidth="100px"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
</glsx-combi-form>
</glsx-dialog>
</div>
</template>
<script>
import _ from 'lodash'
import { productApi } from '@/api/productManage'
export default {
name: 'productList',
data() {
return {
searchForm: {
productName: ''
},
searchFormData: [{
label: '产品名称',
name: 'productName',
type: 'input',
isClear: true,
keyFn: this.keyDowmGetList
}],
getListApi: productApi.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNumer', totalCount: 'data.totalCount' },
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data.data',
tableOption: true,
tableColumns: [{
label: '产品名称',
prop: 'productName'
}, {
label: '类型',
prop: 'productType',
formatter: cellValue => {
return cellValue.productType
}
}, {
label: '产品编号',
prop: 'productCode'
}, {
label: '产品说明',
prop: 'productDetail'
}, {
label: '创建时间',
prop: 'createdTime'
}]
},
// 弹窗
title: '创建产品',
editVisible: false,
editForm: {},
editRule: {
productName: [{ required: true, message: '请输入产品名称', trigger: 'blur' }]
},
editFormData: [{
label: '产品名称',
name: 'productName',
type: 'input',
maxlength: 15,
isClear: true
}, {
label: '产品类型',
name: 'productType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'productTypeList'
}, {
label: '产品说明',
name: 'productDetail',
type: 'input',
inputType: 'textarea',
maxlength: 50
}, {
label: '产品地址',
name: 'productAddress',
type: 'input',
isClear: true
}],
// 基本数据
baseData: {
productTypeList: [{
confId: '1',
confLabel: 'web'
}, {
confId: '2',
confLabel: '微信小程序'
}, {
confId: '3',
confLabel: '企微小程序'
}]
}
}
},
mounted() {
this.getOptionsList('editFormData', false)
},
methods: {
keyDowmGetList() {
this.$refs.productTable.refreshTable()
},
getOptionsList(formName, hasAll = true) {
this[formName].forEach((item, index) => {
if (item.type === 'select') {
this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
},
handleAdd() {
this.editVisible = !this.editVisible
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!