Commit 8cb35973 by liimin

tiaozhengdaima

1 parent bc5a8ead
...@@ -2908,6 +2908,16 @@ ...@@ -2908,6 +2908,16 @@
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
"dev": true "dev": true
}, },
"clipboard": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
"integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
"requires": {
"good-listener": "1.2.2",
"select": "1.1.2",
"tiny-emitter": "2.0.2"
}
},
"clipboardy": { "clipboardy": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "http://registry.npm.taobao.org/clipboardy/download/clipboardy-1.2.3.tgz", "resolved": "http://registry.npm.taobao.org/clipboardy/download/clipboardy-1.2.3.tgz",
...@@ -3893,6 +3903,11 @@ ...@@ -3893,6 +3903,11 @@
"resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
}, },
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"delegates": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "http://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz", "resolved": "http://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz",
...@@ -5532,6 +5547,14 @@ ...@@ -5532,6 +5547,14 @@
} }
} }
}, },
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"requires": {
"delegate": "3.2.0"
}
},
"graceful-fs": { "graceful-fs": {
"version": "4.1.11", "version": "4.1.11",
"resolved": "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz", "resolved": "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz",
...@@ -10525,6 +10548,11 @@ ...@@ -10525,6 +10548,11 @@
} }
} }
}, },
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
},
"select-hose": { "select-hose": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "http://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz", "resolved": "http://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz",
...@@ -11442,6 +11470,11 @@ ...@@ -11442,6 +11470,11 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true "dev": true
}, },
"tiny-emitter": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz",
"integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow=="
},
"tmp": { "tmp": {
"version": "0.0.33", "version": "0.0.33",
"resolved": "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz", "resolved": "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz",
...@@ -12010,6 +12043,11 @@ ...@@ -12010,6 +12043,11 @@
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
"dev": true "dev": true
}, },
"vee-validate": {
"version": "2.1.7",
"resolved": "https://registry.npmjs.org/vee-validate/-/vee-validate-2.1.7.tgz",
"integrity": "sha512-IyPDTTvIRY6o9y14jXlgfY76Qv+hmvYDwNaMn9JY5KbQN8a1tJAu7H/+a/+EdHg1w8Zl9tsdG8lndGqY1lyMzQ=="
},
"vendors": { "vendors": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://registry.npm.taobao.org/vendors/download/vendors-1.0.2.tgz", "resolved": "http://registry.npm.taobao.org/vendors/download/vendors-1.0.2.tgz",
...@@ -12040,6 +12078,14 @@ ...@@ -12040,6 +12078,14 @@
"resolved": "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz", "resolved": "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz",
"integrity": "sha1-D4eJrXGL5oyhhyYpgy7VM1icato=" "integrity": "sha1-D4eJrXGL5oyhhyYpgy7VM1icato="
}, },
"vue-clipboard2": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.2.1.tgz",
"integrity": "sha512-n6ie/0g0bKohmLlC/5ja1esq2Q0jQ5hWmhNSZcvCsWfDeDnVARjl6cBB9p72XV1nlVfuqsZcfV8HTjjZAIlLBA==",
"requires": {
"clipboard": "2.0.4"
}
},
"vue-eslint-parser": { "vue-eslint-parser": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "http://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz", "resolved": "http://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz",
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
"glsx-vue-components": "^1.0.13", "glsx-vue-components": "^1.0.13",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"vee-validate": "^2.1.5", "vee-validate": "^2.1.7",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-i18n": "^8.7.0" "vue-clipboard2": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.0.1", "@vue/cli-plugin-babel": "^3.0.1",
......
...@@ -4,18 +4,35 @@ import Vue from 'vue' ...@@ -4,18 +4,35 @@ import Vue from 'vue'
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'
import './styles/index.scss' import './styles/index.scss'
import zh_CN from 'vee-validate/dist/locale/zh_CN' // import zh_CN from 'vee-validate/dist/locale/zh_CN'
import VeeValidate from 'vee-validate' import VeeValidate from 'vee-validate'
import VueI18n from 'vue-i18n' import VueClipboard2 from 'vue-clipboard2'
Vue.use(VueI18n) // const {
const i18n = new VueI18n({ // Validator
locale: 'zh_CN' // } = VeeValidate
}) // import VueI18n from 'vue-i18n'
// Vue.use(VueI18n)
// const i18n = new VueI18n({
// locale: 'zh_CN'
// })
Vue.use(VueClipboard2)
Vue.use(VeeValidate, { Vue.use(VeeValidate, {
i18n, // i18n,
i18nRootKey: 'validation', // i18nRootKey: 'validation',
dictionary: { dictionary: {
zh_CN en: {
messages: {
required: (field) => `${field}不能为空`,
between: (field, data) => `${field}必须在${data[0]}~${data[1]}之间`,
confirmed: (field, data) => `${field}必须与${data[0]}相匹配`,
max: (field, data) => `${field}最大长度不能超过${data[0]}`,
min: (field, data) => `${field}最小长度不能小于${data[0]}`,
digits: (field, data) => `${field}必须为数字,且长度必须等于${data[0]}`,
min_value: (field, data) => `${field}数值不能小于${data[0]}`,
max_value: (field, data) => `${field}数值不能大于${data[0]}`,
not_in: (field, data) => `${field}不能为${data.join(',')}`
}
}
}, },
errorBagName: 'errorBags', errorBagName: 'errorBags',
fieldsBagName: 'fieldBags', fieldsBagName: 'fieldBags',
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<script> <script>
import { manufacturers, merchants, grayscaleuser } from '@/api' import { manufacturers, merchants, grayscaleuser } from '@/api'
import { NoticeMixin } from '@/mixins' import { NoticeMixin } from '@/mixins'
let manufacturer_list_back_up = [ const manufacturer_list_back_up = [
{ {
manufacturer: null, manufacturer: null,
manufacturerName: '请选择品牌厂商', manufacturerName: '请选择品牌厂商',
...@@ -135,7 +135,7 @@ let manufacturer_list_back_up = [ ...@@ -135,7 +135,7 @@ let manufacturer_list_back_up = [
merchantName: '' merchantName: ''
} }
] ]
let merchant_list_back_up = [ const merchant_list_back_up = [
{ {
merchantId: null, merchantId: null,
merchantName: '请选择渠道商', merchantName: '请选择渠道商',
...@@ -152,39 +152,38 @@ export default { ...@@ -152,39 +152,38 @@ export default {
manufactureOnly: Boolean, manufactureOnly: Boolean,
in_row: Boolean, in_row: Boolean,
uploadAction: String, uploadAction: String,
default_value: Object default_value: Object,
value: Object
// id: String
// errorBags: Object // errorBags: Object
}, },
watch: { watch: {
eventBus: { eventBus: {
handler(__eventBus) { handler(__eventBus) {
if (__eventBus) { if (__eventBus) {
__eventBus.$on('submit', callback => { // __eventBus.$on('submit', callback => {
this.$validator.validate().then(result => { // this.$validator.validate().then(result => {
this.result.manufacturers = this.manufacturer_list.filter( // this.result.manufacturers = this.manufacturer_list.filter(
obj => this.model.manufacturerId === obj.manufacturer // obj => this.model.manufacturerId === obj.manufacturer
)[0] // )[0]
this.result.merchants = this.merchant_list.filter( // this.result.merchants = this.merchant_list.filter(
obj => this.model.merchantId === obj.merchantId // obj => this.model.merchantId === obj.merchantId
)[0] // )[0]
this.$emit('update:value', this.result) // const __back__data__ = this.$deep_clone(this.result)
let __back__data__ = null // // this.$emit('update:value', __back__data__)
// console.log(result, this.result, this.errorBags) // // console.log(result, this.result, this.errorBags)
if (this.manufactureOnly) { // if (result || this.manufactureOnly) {
callback && callback(this.result) // this.$emit('update:value', __back__data__)
} else { // //通过验证 回调结果 如果只有"制造商"选项 不需验证 此逻辑只适用于目前需求
if (result) { // callback && callback(__back__data__)
__back__data__ = this.result // }
} // })
callback && __back__data__ && callback(__back__data__) // }),
}
})
}),
__eventBus.$on('clear_error', () => { __eventBus.$on('clear_error', () => {
this.$validator.errors.clear() this.$validator.errors.clear()
}) })
__eventBus.$on('reset', () => { __eventBus.$on('reset', () => {
this.__reset() !this.manufactureOnly && this.__reset()
}) })
} }
}, },
...@@ -207,11 +206,36 @@ export default { ...@@ -207,11 +206,36 @@ export default {
}, },
immediate: true, immediate: true,
deep: true deep: true
},
'model.merchantId': {
handler(__value) {
this.result.merchants = this.merchant_list.filter(
obj => this.model.merchantId === obj.merchantId
)[0]
const __back__data__ = this.$deep_clone(this.result)
this.$emit('update:value', __back__data__)
} }
}, },
'model.manufacturerId': {
handler(__value) {
this.result.manufacturers = this.manufacturer_list.filter(
obj => this.model.manufacturerId === obj.manufacturer
)[0]
const __back__data__ = this.$deep_clone(this.result)
this.$emit('update:value', __back__data__)
}
},
result: {
handler(__value) {
const __back__data__ = this.$deep_clone(__value)
this.$emit('update:value', __back__data__)
},
deep: true
}
},
inject: ['$validator'],
data() { data() {
return { return {
value: '',
action: '', action: '',
template_url: template_url:
'http://qcimg01.glsx.net:7060/ddh-ai-m/AI管家-灰度用户导入模板.XLSX', 'http://qcimg01.glsx.net:7060/ddh-ai-m/AI管家-灰度用户导入模板.XLSX',
...@@ -281,14 +305,14 @@ export default { ...@@ -281,14 +305,14 @@ export default {
this.model.grayscaleUserList = '' this.model.grayscaleUserList = ''
}, },
__reset() { __reset() {
//初始化 // 初始化
this.model.manufacturerId = null this.model.manufacturerId = null
this.model.merchantId = null this.model.merchantId = null
this.result = { this.result = {
manufacturers: null, //生产厂商 manufacturers: null, // 生产厂商
merchants: null, //商户渠道 merchants: null, // 商户渠道
grayscaleUserList: null, //灰度用户列表 grayscaleUserList: null, // 灰度用户列表
influenceScope: '' //用户类型 influenceScope: '' // 用户类型
} }
// this.$emit('update:value', this.result) // this.$emit('update:value', this.result)
}, },
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
<script> <script>
import Edit from './Edit' import Edit from './Edit'
import { Manufacturers } from '../components' import { Manufacturers } from '../components'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import { voiceList, manufacturers, mergeActivity } from '@/api' import { voiceList, manufacturers, mergeActivity } from '@/api'
import { NoticeMixin } from '@/mixins' import { NoticeMixin } from '@/mixins'
import Vue from 'vue' import Vue from 'vue'
...@@ -148,10 +147,10 @@ export default { ...@@ -148,10 +147,10 @@ export default {
} }
} }
}, },
{ // {
label: '触发次数', // label: '触发次数',
prop: 'triCount' // prop: 'triCount'
}, // },
{ {
label: '操作人', label: '操作人',
prop: 'updatedBy' prop: 'updatedBy'
...@@ -173,8 +172,8 @@ export default { ...@@ -173,8 +172,8 @@ export default {
{ {
label: '上架', label: '上架',
type: 'text', type: 'text',
formatter: row => formatter: rows =>
row.status === { ON: '上架', OF: '下架' }[rows.status], rows.status === { ON: '上架', OF: '下架' }[rows.status],
callback: (index, rows) => callback: (index, rows) =>
this.$confirm( this.$confirm(
`确定${ `确定${
...@@ -235,11 +234,11 @@ export default { ...@@ -235,11 +234,11 @@ export default {
/* 接口请求-start */ /* 接口请求-start */
getParams() { getParams() {
return new Promise(resolve => { return new Promise(resolve => {
var __p = { condition: {} } var __p = { condition: {}}
this.eventBus.$emit('submit', data => { this.eventBus.$emit('submit', data => {
try { try {
if (data && data.manufacturers) { if (data && data.manufacturers && data.manufacturers.manufacturer) {
__p.condition.manufacturerId = data.manufacturers.manufacturerId __p.condition.manufacturerId = data.manufacturers.manufacturer
} }
if (this.searchCondition.activityTitle) { if (this.searchCondition.activityTitle) {
__p.condition.activityTitle = this.searchCondition.activityTitle __p.condition.activityTitle = this.searchCondition.activityTitle
...@@ -291,24 +290,12 @@ export default { ...@@ -291,24 +290,12 @@ export default {
this.page.pageNum = val this.page.pageNum = val
this.loadingGetList() this.loadingGetList()
}, },
updateVisibleChange() {
this.updateVisible = !this.updateVisible
this.updateLoading = false
// if(!this.updateVisible) {
// this.allModulelist = []
// this.updateParams = this.$deep_clone(channelStructrue)
// }
},
dialog(index, rows) { dialog(index, rows) {
this.updateVisible = true this.updateVisible = true
this.eventBus.$emit('edit_event_data', rows ? rows[index] : null) this.eventBus.$emit('edit_event_data', rows ? rows[index] : null)
}, },
updateDialogClose(updateData) { updateDialogClose() {
this.updateLoading = true this.updateVisible = false
updateData ? this.updateChannel(updateData) : this.updateVisibleChange()
},
recordVisibleChange() {
this.recordVisible = !this.recordVisible
} }
} }
} }
...@@ -321,5 +308,8 @@ export default { ...@@ -321,5 +308,8 @@ export default {
padding: 5px 10px; padding: 5px 10px;
} }
} }
.el-dialog {
margin-top: 3vh !important;
}
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!