Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303

This commit is contained in:
梁琦涛
2023-03-08 15:47:14 +08:00
37 changed files with 219 additions and 172 deletions
@@ -117,7 +117,7 @@ export default {
const data = this.pcaa[value] const data = this.pcaa[value]
if (data) { if (data) {
for (const key in data) { for (const key in data) {
if (data.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(data, key)) {
options.push({ value: key, label: data[key] }) options.push({ value: key, label: data[key] })
} }
} }
+17 -12
View File
@@ -946,7 +946,9 @@ export default {
showClearSelectButton () { showClearSelectButton () {
let count = 0 let count = 0
for (const key in this.disabledRows) { for (const key in this.disabledRows) {
if (this.disabledRows.hasOwnProperty(key)) count++ if (Object.prototype.hasOwnProperty.call(this.disabledRows, key)) {
count++
}
} }
return count > 0 return count > 0
}, },
@@ -1318,7 +1320,8 @@ export default {
// 解析disabledRows // 解析disabledRows
for (const columnKey in this.disabledRows) { for (const columnKey in this.disabledRows) {
// 判断是否有该属性 // 判断是否有该属性
if (this.disabledRows.hasOwnProperty(columnKey) && data.hasOwnProperty(columnKey)) { // if (this.disabledRows.hasOwnProperty(columnKey) && data.hasOwnProperty(columnKey)) {
if (Object.prototype.hasOwnProperty.call(this.disabledRows, columnKey) && Object.prototype.hasOwnProperty.call(data, columnKey)) {
if (disabled !== true) { if (disabled !== true) {
const temp = this.disabledRows[columnKey] const temp = this.disabledRows[columnKey]
// 禁用规则可以是一个数组 // 禁用规则可以是一个数组
@@ -1659,7 +1662,8 @@ export default {
if (asyncCount === 0) { if (asyncCount === 0) {
clearInterval(timer) clearInterval(timer)
if (typeof callback === 'function') { if (typeof callback === 'function') {
callback({ error, values }) const params = { error, values }
callback(params)
} }
} }
}, 10) }, 10)
@@ -1741,7 +1745,7 @@ export default {
let { rowKey, values: newValues } = item let { rowKey, values: newValues } = item
rowKey = this.getCleanId(rowKey) rowKey = this.getCleanId(rowKey)
for (const newValueKey in newValues) { for (const newValueKey in newValues) {
if (newValues.hasOwnProperty(newValueKey)) { if (Object.prototype.hasOwnProperty.call(newValues, newValueKey)) {
let edited = false // 已被修改 let edited = false // 已被修改
for (const column of this.columns) { for (const column of this.columns) {
if (column.key === newValueKey) { if (column.key === newValueKey) {
@@ -1749,7 +1753,7 @@ export default {
this.inputValues.forEach(value => { this.inputValues.forEach(value => {
// 在inputValues中找到了该字段 // 在inputValues中找到了该字段
if (rowKey === this.getCleanId(value.id)) { if (rowKey === this.getCleanId(value.id)) {
if (value.hasOwnProperty(newValueKey)) { if (Object.prototype.hasOwnProperty.call(value, newValueKey)) {
edited = true edited = true
value[newValueKey] = newValue value[newValueKey] = newValue
} }
@@ -1839,10 +1843,10 @@ export default {
}, },
valuesHasOwnProperty (values, ownProperty) { valuesHasOwnProperty (values, ownProperty) {
const key = ownProperty const key = ownProperty
if (values.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(values, key)) {
return key return key
} }
if (values.hasOwnProperty(key + this.tempId)) { if (Object.prototype.hasOwnProperty.call(values, key + this.tempId)) {
return key + this.tempId return key + this.tempId
} }
return null return null
@@ -1900,7 +1904,8 @@ export default {
} }
if (typeof callback === 'function') { if (typeof callback === 'function') {
callback([tooltips[inputId], notPassedIds]) const param = [tooltips[inputId], notPassedIds]
callback(param)
} }
} }
@@ -2026,7 +2031,7 @@ export default {
const { idx } = tr.dataset const { idx } = tr.dataset
const value = this.inputValues[idx] const value = this.inputValues[idx]
for (const key in value) { for (const key in value) {
if (value.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(value, key)) {
const elid = `${key}${value.id}` const elid = `${key}${value.id}`
const el = document.getElementById(elid) const el = document.getElementById(elid)
if (el) { if (el) {
@@ -2052,7 +2057,7 @@ export default {
// 重新计算单个统计列 // 重新计算单个统计列
recalcOneStatisticsColumn (key) { recalcOneStatisticsColumn (key) {
if (this.hasStatisticsColumn) { if (this.hasStatisticsColumn) {
if (this.statisticsColumns.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(this.statisticsColumns, key)) {
// 计算合计值 // 计算合计值
let count = 0 let count = 0
this.inputValues.forEach(item => { this.inputValues.forEach(item => {
@@ -2073,7 +2078,7 @@ export default {
/** 获取某个统计字段的值 */ /** 获取某个统计字段的值 */
getStatisticsValue (key) { getStatisticsValue (key) {
if (this.hasStatisticsColumn) { if (this.hasStatisticsColumn) {
if (this.statisticsColumns.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(this.statisticsColumns, key)) {
return this.statisticsColumns[key] return this.statisticsColumns[key]
} }
} }
@@ -2707,7 +2712,7 @@ export default {
// 解析props // 解析props
if (typeof col.props === 'object') { if (typeof col.props === 'object') {
for (const prop in col.props) { for (const prop in col.props) {
if (col.props.hasOwnProperty(prop)) { if (Object.prototype.hasOwnProperty.call(col.props, prop)) {
props[prop] = this.replaceProps(col, col.props[prop]) props[prop] = this.replaceProps(col, col.props[prop])
} }
} }
+2 -2
View File
@@ -101,11 +101,11 @@ export default {
.drag_bg{ .drag_bg{
background-color: #7ac23c; background-color: #7ac23c;
height: 34px; height: 34px;
width: 0px; width: 0;
} }
.drag_text{ .drag_text{
position: absolute; position: absolute;
top: 0px; top: 0;
width: 100%;text-align: center; width: 100%;text-align: center;
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
@@ -178,7 +178,7 @@ export default {
} }
// slot 组件特殊处理 // slot 组件特殊处理
if (column.$type === JVXETypes.slot) { if (column.$type === JVXETypes.slot) {
if (this.$scopedSlots.hasOwnProperty(column.slotName)) { if (Object.prototype.hasOwnProperty.call(this.$scopedSlots, column.slotName)) {
renderOptions.slot = this.$scopedSlots[column.slotName] renderOptions.slot = this.$scopedSlots[column.slotName]
renderOptions.target = this renderOptions.target = this
} }
@@ -264,7 +264,7 @@ export default {
// 用户传递的事件,进行合并操作 // 用户传递的事件,进行合并操作
Object.keys(this.$listeners).forEach(key => { Object.keys(this.$listeners).forEach(key => {
let listen = this.$listeners[key] let listen = this.$listeners[key]
if (events.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(events, key)) {
if (Array.isArray(listen)) { if (Array.isArray(listen)) {
listen.push(events[key]) listen.push(events[key])
} else { } else {
@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import { getEventPath } from '@/utils/util' import { getEventPath, evil } from '@/utils/util'
import JVxeTable, { AllCells, JVXETypes } from './index' import JVxeTable, { AllCells, JVXETypes } from './index'
import './less/j-vxe-table.less' import './less/j-vxe-table.less'
// 引入 vxe-table // 引入 vxe-table
@@ -14,7 +14,7 @@ import { getEnhancedMixins, installAllCell, installOneCell } from '@/components/
const VxeGridMethodsMap = {} const VxeGridMethodsMap = {}
Object.keys(Grid.methods).forEach(key => { Object.keys(Grid.methods).forEach(key => {
// 使用eval可以避免闭包(但是要注意不要写es6的代码) // 使用eval可以避免闭包(但是要注意不要写es6的代码)
VxeGridMethodsMap[key] = eval(`(function(){return this.$refs.vxe.${key}.apply(this.$refs.vxe,arguments)})`) VxeGridMethodsMap[key] = evil(`(function(){return this.$refs.vxe.${key}.apply(this.$refs.vxe,arguments)})`)
}) })
// 将Grid所有的方法都映射(继承)到JVxeTable上 // 将Grid所有的方法都映射(继承)到JVxeTable上
JVxeTable.methods = Object.assign({}, VxeGridMethodsMap, JVxeTable.methods) JVxeTable.methods = Object.assign({}, VxeGridMethodsMap, JVxeTable.methods)
@@ -105,7 +105,9 @@ export default {
const res = this.enhanced.translate.handler.call(this, value) const res = this.enhanced.translate.handler.call(this, value)
// 异步翻译,目前仅【多级联动】使用 // 异步翻译,目前仅【多级联动】使用
if (res instanceof Promise) { if (res instanceof Promise) {
res.then(value => this.innerValue = value) res.then(value => {
this.innerValue = value
})
} else { } else {
this.innerValue = res this.innerValue = res
} }
@@ -99,7 +99,7 @@ export function getEnhancedMixins (type, name) {
if (enhanced) { if (enhanced) {
Object.keys(defEnhanced).forEach(key => { Object.keys(defEnhanced).forEach(key => {
const def = defEnhanced[key] const def = defEnhanced[key]
if (enhanced.hasOwnProperty(key)) { if (Object.prototype.hasOwnProperty.call(enhanced, key)) {
// 方法如果存在就不覆盖 // 方法如果存在就不覆盖
if (typeof def !== 'function' && typeof def !== 'string') { if (typeof def !== 'function' && typeof def !== 'string') {
enhanced[key] = Object.assign({}, def, enhanced[key]) enhanced[key] = Object.assign({}, def, enhanced[key])
+3
View File
@@ -34,6 +34,8 @@ import JSelectRole from '../jerobiz/JSelectRole.vue'
import JSelectUserByDep from '../jerobiz/JSelectUserByDep.vue' import JSelectUserByDep from '../jerobiz/JSelectUserByDep.vue'
// 引入需要全局注册的js函数和变量 // 引入需要全局注册的js函数和变量
import { Modal, notification, message } from 'ant-design-vue' import { Modal, notification, message } from 'ant-design-vue'
// eslint-disable-next-line camelcase
import lodash_object from 'lodash' import lodash_object from 'lodash'
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import pick from 'lodash.pick' import pick from 'lodash.pick'
@@ -81,6 +83,7 @@ export default {
Vue.prototype.$Jnotification = notification Vue.prototype.$Jnotification = notification
Vue.prototype.$Jmodal = Modal Vue.prototype.$Jmodal = Modal
Vue.prototype.$Jmessage = message Vue.prototype.$Jmessage = message
// eslint-disable-next-line camelcase
Vue.prototype.$Jlodash = lodash_object Vue.prototype.$Jlodash = lodash_object
Vue.prototype.$Jdebounce = debounce Vue.prototype.$Jdebounce = debounce
Vue.prototype.$Jpick = pick Vue.prototype.$Jpick = pick
@@ -1,7 +1,5 @@
<template> <template>
<iframe :id="id" :src="url" frameborder="0" width="100%" height="800px" scrolling="auto"></iframe>
<iframe :id="id" :src="url" frameborder="0" width="100%" height="800px" scrolling="auto"></iframe>
</template> </template>
<script> <script>
@@ -39,6 +37,7 @@ export default {
if (url !== null && url !== undefined) { if (url !== null && url !== undefined) {
// ----------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------
// url支持通过 ${token}方式传递当前登录TOKEN // url支持通过 ${token}方式传递当前登录TOKEN
// eslint-disable-next-line no-template-curly-in-string
const tokenStr = '${token}' const tokenStr = '${token}'
if (url.indexOf(tokenStr) !== -1) { if (url.indexOf(tokenStr) !== -1) {
const token = Vue.ls.get(ACCESS_TOKEN) const token = Vue.ls.get(ACCESS_TOKEN)
@@ -217,7 +217,7 @@ export default {
}, },
websocketOnmessage: function (e) { websocketOnmessage: function (e) {
console.log('-----接收消息-------', e.data) console.log('-----接收消息-------', e.data)
const data = eval('(' + e.data + ')') // 解析对象 const data = JSON.parse(e.data) // 解析对象
if (data.cmd + '' === 'topic') { if (data.cmd + '' === 'topic') {
// 系统通知 // 系统通知
this.loadData() this.loadData()
+1
View File
@@ -64,6 +64,7 @@ const updateTheme = primaryColor => {
const lessConfigNode = document.createElement('script') const lessConfigNode = document.createElement('script')
const lessScriptNode = document.createElement('script') const lessScriptNode = document.createElement('script')
lessStyleNode.setAttribute('rel', 'stylesheet/less') lessStyleNode.setAttribute('rel', 'stylesheet/less')
// eslint-disable-next-line camelcase,no-undef
lessStyleNode.setAttribute('href', __webpack_public_path__ + 'color.less') lessStyleNode.setAttribute('href', __webpack_public_path__ + 'color.less')
lessConfigNode.innerHTML = ` lessConfigNode.innerHTML = `
window.less = { window.less = {
+1 -1
View File
@@ -71,7 +71,7 @@ function globalDisabledAuth (code) {
// 设置全局配置是否有命中 // 设置全局配置是否有命中
let gFlag = false// 禁用命中 let gFlag = false// 禁用命中
let invalidFlag = false// 无效命中 let invalidFlag = false// 无效命中
if (allPermissionList != null && allPermissionList != '' && allPermissionList !== undefined && allPermissionList.length > 0) { if (allPermissionList && allPermissionList.length > 0) {
for (const itemG of allPermissionList) { for (const itemG of allPermissionList) {
if (code === itemG.action) { if (code === itemG.action) {
if (itemG.status + '' === '0') { if (itemG.status + '' === '0') {
@@ -1,3 +1,4 @@
/* eslint-disable */
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { ENCRYPTED_STRING } from '@/store/mutation-types' import { ENCRYPTED_STRING } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
@@ -9,7 +9,7 @@ export default class signMd5Utils {
*/ */
static sortAsc (jsonObj) { static sortAsc (jsonObj) {
const arr = new Array() const arr = []
let num = 0 let num = 0
for (const i in jsonObj) { for (const i in jsonObj) {
arr[num] = i arr[num] = i
@@ -76,7 +76,7 @@ export default class signMd5Utils {
static mergeObject (objectOne, objectTwo) { static mergeObject (objectOne, objectTwo) {
if (objectTwo && Object.keys(objectTwo).length > 0) { if (objectTwo && Object.keys(objectTwo).length > 0) {
for (const key in objectTwo) { for (const key in objectTwo) {
if (objectTwo.hasOwnProperty(key) === true) { if (Object.prototype.hasOwnProperty.call(objectTwo, key) === true) {
// 数字值转为string类型,前后端加密规则保持一致 // 数字值转为string类型,前后端加密规则保持一致
if (this.myIsNaN(objectTwo[key])) { if (this.myIsNaN(objectTwo[key])) {
objectTwo[key] = objectTwo[key].toString() objectTwo[key] = objectTwo[key].toString()
@@ -92,7 +92,7 @@ export default class signMd5Utils {
if (param == null) return '' if (param == null) return ''
let paramStr = '' let paramStr = ''
const t = typeof (param) const t = typeof (param)
if (t == 'string' || t == 'number' || t == 'boolean') { if (t === 'string' || t === 'number' || t === 'boolean') {
paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param) paramStr += '&' + key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param)
} else { } else {
for (const i in param) { for (const i in param) {
+1 -1
View File
@@ -84,7 +84,7 @@ export function filterGlobalPermission (el, binding) {
} }
// 设置全局配置是否有命中 // 设置全局配置是否有命中
let invalidFlag = false// 无效命中 let invalidFlag = false// 无效命中
if (allPermissionList != null && allPermissionList != '' && allPermissionList !== undefined && allPermissionList.length > 0) { if (allPermissionList && allPermissionList.length > 0) {
for (const itemG of allPermissionList) { for (const itemG of allPermissionList) {
if (binding.value === itemG.action) { if (binding.value === itemG.action) {
if (itemG.status + '' !== '0') { if (itemG.status + '' !== '0') {
+1 -1
View File
@@ -19,7 +19,7 @@ function classNames () {
} }
} else if (argType === 'object') { } else if (argType === 'object') {
for (const key in arg) { for (const key in arg) {
if (arg.hasOwnProperty(key) && arg[key]) { if (Object.prototype.hasOwnProperty.call(arg, key) && arg[key]) {
classes.push(key) classes.push(key)
} }
} }
+13 -5
View File
@@ -37,8 +37,7 @@ export function filterObj (obj) {
} }
for (const key in obj) { for (const key in obj) {
if (obj.hasOwnProperty(key) && if (Object.prototype.hasOwnProperty.call(obj, key) && (obj[key] == null || obj[key] === undefined || obj[key] === '')) {
(obj[key] == null || obj[key] === undefined || obj[key] === '')) {
delete obj[key] delete obj[key]
} }
} }
@@ -110,8 +109,7 @@ function generateChildRouters (data) {
} else { } else {
component = 'views/' + item.component component = 'views/' + item.component
} }
// eslint-disable-next-line const URL = (item.meta.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
if (isURL(URL) || (item.meta.url && item.meta.url.indexOf('{{') === 0)) { if (isURL(URL) || (item.meta.url && item.meta.url.indexOf('{{') === 0)) {
item.meta.url = URL item.meta.url = URL
} }
@@ -581,7 +579,7 @@ export function isOAuth2AppEnv () {
*/ */
export function getReportPrintUrl (url, id, open) { export function getReportPrintUrl (url, id, open) {
// URL支持{{ window.xxx }}占位符变量 // URL支持{{ window.xxx }}占位符变量
url = url.replace(/{{([^}]+)?}}/g, (s1, s2) => eval(s2)) url = url.replace(/{{([^}]+)?}}/g, (s1, s2) => evil(s2))
if (url.includes('?')) { if (url.includes('?')) {
url += '&' url += '&'
} else { } else {
@@ -594,3 +592,13 @@ export function getReportPrintUrl (url, id, open) {
} }
return url return url
} }
/**
* 解决eval的eslint问题
* @param fn
* @returns {*}
*/
export function evil (fn) {
const Fn = Function // 一个变量指向Function,防止有些前端编译工具报错
return new Fn('return ' + fn)()
}
+2 -3
View File
@@ -46,7 +46,7 @@
@blur="handleTagInputConfirm" @blur="handleTagInputConfirm"
@keyup.enter="handleTagInputConfirm" @keyup.enter="handleTagInputConfirm"
/> />
<a-tag v-else @click="showTagInput" style="background: #fff; borderStyle: dashed;"> <a-tag v-else @click="showTagInput" style="background: #fff; border-style: dashed;">
<a-icon type="plus" /> <a-icon type="plus" />
New Tag New Tag
</a-tag> </a-tag>
@@ -188,10 +188,9 @@ export default {
margin-bottom: 24px; margin-bottom: 24px;
& > .avatar { & > .avatar {
margin: 0 auto;
width: 104px; width: 104px;
height: 104px; height: 104px;
margin-bottom: 20px; margin: 0 auto 20px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
+2
View File
@@ -432,6 +432,8 @@ export default {
this.changeImg() this.changeImg()
const list = [].slice.call(document.querySelectorAll('pre code')) const list = [].slice.call(document.querySelectorAll('pre code'))
list.forEach((val) => { list.forEach((val) => {
// 这个变量全局搜不到,就选择了单行不校验
// eslint-disable-next-line no-undef
hljs.highlightBlock(val) hljs.highlightBlock(val)
}) })
} }
+2 -1
View File
@@ -10,10 +10,11 @@
</template> </template>
<a-button @click="sureChange" type="primary" style="margin-top: 115px">确定</a-button> <a-button @click="sureChange" type="primary" style="margin-top: 115px">确定</a-button>
</draggable> </draggable>
<br/> <br />
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<p>拖拽前json数据</p> <p>拖拽前json数据</p>
<!-- 这个改成v-modal后无法按照展开的json样式进行展示-->
<textarea rows="25" style="width: 780px">{{ oldDateSource }}</textarea> <textarea rows="25" style="width: 780px">{{ oldDateSource }}</textarea>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@@ -39,7 +39,7 @@
import moment from 'moment' import moment from 'moment'
import { pushIfNotExist, randomNumber, randomUUID } from '@/utils/util' import { pushIfNotExist, randomNumber, randomUUID } from '@/utils/util'
import { JVXETypes } from '@/components/jero/JVxeTable' import { JVXETypes } from '@/components/jero/JVxeTable'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'JVxeDemo1', name: 'JVxeDemo1',
data () { data () {
@@ -14,7 +14,7 @@
<script> <script>
import { JVXETypes } from '@/components/jero/JVxeTable' import { JVXETypes } from '@/components/jero/JVxeTable'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'JVxeDemo3', name: 'JVxeDemo3',
data () { data () {
@@ -10,16 +10,16 @@
@cancel="handleCancel"> @cancel="handleCancel">
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model" > <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model">
<!-- 主表单区域 --> <!-- 主表单区域 -->
<a-row class="form-row" :gutter="0"> <a-row class="form-row" :gutter="0">
<a-col :lg="8"> <a-col :lg="8">
<a-form-model-item label="订单号" prop="orderCode" :rules="[{ required: true, message: '请输入订单号!' }]"> <a-form-model-item label="订单号" prop="orderCode" :rules="[{ required: true, message: '请输入订单号!' }]">
<a-input placeholder="请输入订单号" v-model="model.orderCode"/> <a-input placeholder="请输入订单号" v-model="model.orderCode" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8"> <a-col :lg="8">
<a-form-model-item label="订单类型"> <a-form-model-item label="订单类型">
<a-select placeholder="请选择订单类型" v-model="model.ctype"> <a-select placeholder="请选择订单类型" v-model="model.ctype">
<a-select-option value="1">国内订单</a-select-option> <a-select-option value="1">国内订单</a-select-option>
<a-select-option value="2">国际订单</a-select-option> <a-select-option value="2">国际订单</a-select-option>
@@ -27,20 +27,20 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8"> <a-col :lg="8">
<a-form-model-item label="订单日期"> <a-form-model-item label="订单日期">
<a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%" v-model="model.orderDate"/> <a-date-picker showTime valueFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%" v-model="model.orderDate" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row class="form-row" :gutter="0"> <a-row class="form-row" :gutter="0">
<a-col :lg="8"> <a-col :lg="8">
<a-form-model-item label="订单金额"> <a-form-model-item label="订单金额">
<a-input-number placeholder="请输入订单金额" style="width: 100%" v-model="model.orderMoney"/> <a-input-number placeholder="请输入订单金额" style="width: 100%" v-model="model.orderMoney" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8"> <a-col :lg="8">
<a-form-model-item label="订单备注"> <a-form-model-item label="订单备注">
<a-input placeholder="请输入订单备注" v-model="model.content"/> <a-input placeholder="请输入订单备注" v-model="model.content" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -59,7 +59,7 @@
:loading="table1.loading" :loading="table1.loading"
:dataSource="table1.dataSource" :dataSource="table1.dataSource"
:columns="table1.columns" :columns="table1.columns"
style="margin-top: 8px;"/> style="margin-top: 8px;" />
</a-tab-pane> </a-tab-pane>
@@ -74,7 +74,7 @@
:loading="table2.loading" :loading="table2.loading"
:dataSource="table2.dataSource" :dataSource="table2.dataSource"
:columns="table2.columns" :columns="table2.columns"
style="margin-top: 8px;"/> style="margin-top: 8px;" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@@ -87,7 +87,7 @@
import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils' import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils'
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { JVXETypes } from '@/components/jero/JVxeTable' import { JVXETypes } from '@/components/jero/JVxeTable'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'jeroOrderModalForJvexTable', name: 'jeroOrderModalForJvexTable',
data () { data () {
@@ -279,7 +279,8 @@ export default {
}, },
/** 发起新增或修改的请求 */ /** 发起新增或修改的请求 */
requestAddOrEdit (formData) { requestAddOrEdit (formData) {
let url = this.url.add; let method = 'post' let url = this.url.add
let method = 'post'
if (this.model.id) { if (this.model.id) {
url = this.url.edit url = this.url.edit
method = 'put' method = 'put'
+1 -1
View File
@@ -595,7 +595,7 @@ export default {
}, },
computed: { computed: {
nameList: function () { nameList: function () {
let names = [] const names = []
for (let a = 0; a < this.selectList.length; a++) { for (let a = 0; a < this.selectList.length; a++) {
names.push(this.selectList[a].name) names.push(this.selectList[a].name)
} }
+1 -1
View File
@@ -143,7 +143,7 @@ export default {
newArr.point = point newArr.point = point
arrs[i].push(newArr) arrs[i].push(newArr)
} }
let newDataSource = [] const newDataSource = []
for (let i = 0; i < arrs.length; i++) { for (let i = 0; i < arrs.length; i++) {
const arr = arrs[i] const arr = arrs[i]
for (const j in arr) { for (const j in arr) {
@@ -106,7 +106,7 @@ export default {
validate (rule, value, callback) { validate (rule, value, callback) {
const regex = /^user-(.*)$/ const regex = /^user-(.*)$/
if (!regex.test(value)) { if (!regex.test(value)) {
callback('需要以 user- 开头') callback(new Error('需要以 user- 开头'))
} }
callback() callback()
} }
@@ -38,6 +38,7 @@ import { FormTypes } from '@/utils/JEditableTableUtil'
import { randomUUID, randomNumber } from '@/utils/util' import { randomUUID, randomNumber } from '@/utils/util'
import JEditableTable from '@/components/jero/JEditableTable' import JEditableTable from '@/components/jero/JEditableTable'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'DefaultTable', name: 'DefaultTable',
components: { JEditableTable }, components: { JEditableTable },
@@ -234,6 +235,7 @@ export default {
/** 获取值,忽略表单验证 */ /** 获取值,忽略表单验证 */
handleTableGet () { handleTableGet () {
this.$refs.editableTable.getValues((error, values) => { this.$refs.editableTable.getValues((error, values) => {
console.log('error:', error)
console.log('values:', values) console.log('values:', values)
}, false) }, false)
console.log('deleteIds:', this.$refs.editableTable.getDeleteIds()) console.log('deleteIds:', this.$refs.editableTable.getDeleteIds())
@@ -87,7 +87,7 @@
import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils' import { VALIDATE_FAILED, getRefPromise, validateFormModelAndTables } from '@/components/jero/JVxeTable/utils/vxeUtils'
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import { JVXETypes } from '@/components/jero/JVxeTable' import { JVXETypes } from '@/components/jero/JVxeTable'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'JeroOrderModalForJvexTable', name: 'JeroOrderModalForJvexTable',
data () { data () {
@@ -26,6 +26,7 @@ export default {
type: FormTypes.select, type: FormTypes.select,
width: '240px', width: '240px',
options: [], options: [],
// eslint-disable-next-line no-template-curly-in-string
placeholder: '请选择${title}' placeholder: '请选择${title}'
}, },
{ {
@@ -34,6 +35,7 @@ export default {
type: FormTypes.select, type: FormTypes.select,
width: '240px', width: '240px',
options: [], options: [],
// eslint-disable-next-line no-template-curly-in-string
placeholder: '请选择${title}' placeholder: '请选择${title}'
}, },
{ {
@@ -42,6 +44,7 @@ export default {
type: FormTypes.select, type: FormTypes.select,
width: '240px', width: '240px',
options: [], options: [],
// eslint-disable-next-line no-template-curly-in-string
placeholder: '请选择${title}' placeholder: '请选择${title}'
} }
], ],
@@ -86,7 +86,7 @@
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-form-model-item> <a-form-model-item>
<a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/> <a-icon type="minus-circle" @click="delRowCustom(index)" style="font-size :20px"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -121,7 +121,7 @@
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
<a-form-model-item> <a-form-model-item>
<a-icon type="minus-circle" @click="delRowTicket(index)" style="fontSize :20px"/> <a-icon type="minus-circle" @click="delRowTicket(index)" style="font-size :20px"/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -86,6 +86,7 @@ import JEditableTable from '@/components/jero/JEditableTable'
import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormModelAndTables } from '@/utils/JEditableTableUtil' import { FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormModelAndTables } from '@/utils/JEditableTableUtil'
import { httpAction, getAction } from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
/* eslint-disable no-template-curly-in-string */
export default { export default {
name: 'JeroOrderModalForJEditableTable', name: 'JeroOrderModalForJEditableTable',
components: { components: {
+121 -102
View File
@@ -20,16 +20,18 @@
<div class="title">退货商品</div> <div class="title">退货商品</div>
<a-table <a-table
style="margin-bottom: 24px" style="margin-bottom: 24px"
:pagination='goodsPagination'
:columns="goodsColumns" :columns="goodsColumns"
:data="loadGoodsData"> :data-source="goodsData">
</a-table> </a-table>
<div class="title">退货进度</div> <div class="title">退货进度</div>
<a-table <a-table
style="margin-bottom: 24px" style="margin-bottom: 24px"
:pagination='schedulePagination'
:columns="scheduleColumns" :columns="scheduleColumns"
:data="loadScheduleData"> :data-source="scheduleData">
<template <template
slot="status" slot="status"
@@ -57,6 +59,7 @@ export default {
}, },
data () { data () {
return { return {
goodsPagination: {},
goodsColumns: [ goodsColumns: [
{ {
title: '商品编号', title: '商品编号',
@@ -92,54 +95,9 @@ export default {
align: 'right' align: 'right'
} }
], ],
// 加载数据方法 必须为 Promise 对象 goodsData: [],
loadGoodsData: () => {
return new Promise(resolve => {
resolve({
data: [
{
id: '1234561',
name: '矿泉水 550ml',
barcode: '12421432143214321',
price: '2.00',
num: '1',
amount: '2.00'
},
{
id: '1234562',
name: '凉茶 300ml',
barcode: '12421432143214322',
price: '3.00',
num: '2',
amount: '6.00'
},
{
id: '1234563',
name: '好吃的薯片',
barcode: '12421432143214323',
price: '7.00',
num: '4',
amount: '28.00'
},
{
id: '1234564',
name: '特别好吃的蛋卷',
barcode: '12421432143214324',
price: '8.50',
num: '3',
amount: '25.50'
}
],
pageSize: 10,
pageNo: 1,
totalPage: 1,
totalCount: 10
})
}).then(res => {
return res
})
},
schedulePagination: {},
scheduleColumns: [ scheduleColumns: [
{ {
title: '时间', title: '时间',
@@ -168,60 +126,121 @@ export default {
key: 'cost' key: 'cost'
} }
], ],
loadScheduleData: () => { scheduleData: []
return new Promise(resolve => { }
resolve({ },
data: [ created () {
{ this.initPageData()
key: '1', },
time: '2017-10-01 14:10', methods: {
rate: '联系客户', // 初始化页面数据
status: 'processing', initPageData () {
operator: '取货员 ID1234', this.loadGoodsData()
cost: '5mins' this.loadScheduleData()
}, },
{ // 加载退货商品表格
key: '2', loadGoodsData () {
time: '2017-10-01 14:05', return new Promise(resolve => {
rate: '取货员出发', resolve({
status: 'success', data: [
operator: '取货员 ID1234', {
cost: '1h' id: '1234561',
}, name: '矿泉水 550ml',
{ barcode: '12421432143214321',
key: '3', price: '2.00',
time: '2017-10-01 13:05', num: '1',
rate: '取货员接单', amount: '2.00'
status: 'success', },
operator: '取货员 ID1234', {
cost: '5mins' id: '1234562',
}, name: '凉茶 300ml',
{ barcode: '12421432143214322',
key: '4', price: '3.00',
time: '2017-10-01 13:00', num: '2',
rate: '申请审批通过', amount: '6.00'
status: 'success', },
operator: '系统', {
cost: '1h' id: '1234563',
}, name: '好吃的薯片',
{ barcode: '12421432143214323',
key: '5', price: '7.00',
time: '2017-10-01 12:00', num: '4',
rate: '发起退货申请', amount: '28.00'
status: 'success', },
operator: '用户', {
cost: '5mins' id: '1234564',
} name: '特别好吃的蛋卷',
], barcode: '12421432143214324',
pageSize: 10, price: '8.50',
pageNo: 1, num: '3',
totalPage: 1, amount: '25.50'
totalCount: 10 }
}) ],
}).then(res => { pageSize: 10,
return res pageNo: 1,
totalPage: 1,
totalCount: 10
}) })
} }).then(res => {
this.goodsData = res.data
this.goodsPagination = { ...res, data: undefined }
})
},
// 加载退货进度表格
loadScheduleData () {
return new Promise(resolve => {
resolve({
data: [
{
key: '1',
time: '2017-10-01 14:10',
rate: '联系客户',
status: 'processing',
operator: '取货员 ID1234',
cost: '5mins'
},
{
key: '2',
time: '2017-10-01 14:05',
rate: '取货员出发',
status: 'success',
operator: '取货员 ID1234',
cost: '1h'
},
{
key: '3',
time: '2017-10-01 13:05',
rate: '取货员接单',
status: 'success',
operator: '取货员 ID1234',
cost: '5mins'
},
{
key: '4',
time: '2017-10-01 13:00',
rate: '申请审批通过',
status: 'success',
operator: '系统',
cost: '1h'
},
{
key: '5',
time: '2017-10-01 12:00',
rate: '发起退货申请',
status: 'success',
operator: '用户',
cost: '5mins'
}
],
pageSize: 10,
pageNo: 1,
totalPage: 1,
totalCount: 10
})
}).then(res => {
this.scheduleData = res.data
this.schedulePagination = { ...res, data: undefined }
})
} }
}, },
filters: { filters: {
+2 -2
View File
@@ -202,7 +202,7 @@ import DashChartDemo from '@/components/chart/DashChartDemo'
import BarMultid from '@/components/chart/BarMultid' import BarMultid from '@/components/chart/BarMultid'
import Bar from '@/components/chart/Bar' import Bar from '@/components/chart/Bar'
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { filterObj } from '@/utils/util' import { filterObj, evil } from '@/utils/util'
import moment from 'dayjs' import moment from 'dayjs'
const rankList = [] const rankList = []
@@ -448,7 +448,7 @@ export default {
return filterObj(param) return filterObj(param)
}, },
formatRespectiveHoldCert (value) { formatRespectiveHoldCert (value) {
return (value + '' === '1' || eval(value)) ? '是' : '否' return (value + '' === '1' || evil(value)) ? '是' : '否'
}, },
formatCertFormat (value) { formatCertFormat (value) {
if (value + '' === '1') { if (value + '' === '1') {
@@ -184,7 +184,7 @@ export default {
method = 'put' method = 'put'
} }
const formData = Object.assign({}, this.model) const formData = Object.assign({}, this.model)
if (this.fileList != '') { if (this.fileList && this.fileList.length > 0) {
formData.idcardPic = this.fileList formData.idcardPic = this.fileList
} else { } else {
formData.idcardPic = '' formData.idcardPic = ''
+1 -2
View File
@@ -194,8 +194,7 @@ export default {
UserRoleModal, UserRoleModal,
SelectUserModal, SelectUserModal,
RoleModal, RoleModal,
UserModal, UserModal
moment
}, },
data () { data () {
return { return {
@@ -162,6 +162,7 @@ export default {
width: '20%', width: '20%',
type: FormTypes.input, type: FormTypes.input,
validateRules: [ validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' } { required: true, message: '${title}不能为空' }
] ]
}, },
@@ -184,6 +185,7 @@ export default {
width: '15%', width: '15%',
type: FormTypes.inputNumber, type: FormTypes.inputNumber,
validateRules: [ validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' }, { required: true, message: '${title}不能为空' },
{ pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' } { pattern: /^[1-9]\d*$/, message: '请输入零以上的正整数' }
] ]
@@ -204,6 +206,7 @@ export default {
width: '20%', width: '20%',
type: FormTypes.input, type: FormTypes.input,
validateRules: [ validateRules: [
// eslint-disable-next-line no-template-curly-in-string
{ required: true, message: '${title}不能为空' } { required: true, message: '${title}不能为空' }
] ]
}, },
@@ -47,14 +47,12 @@ import { httpAction, getAction } from '@/api/manage'
// import { validateDuplicateValue } from '@/utils/util' // import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jero/JFormContainer' import JFormContainer from '@/components/jero/JFormContainer'
import JDate from '@/components/jero/JDate' import JDate from '@/components/jero/JDate'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
export default { export default {
name: 'TenantForm', name: 'TenantForm',
components: { components: {
JFormContainer, JFormContainer,
JDate, JDate
JDictSelectTag
}, },
props: { props: {
formData: { formData: {