Commit 15f7b168 by liimin

合并

1 parent 83a1e2fb
......@@ -9,4 +9,4 @@ export function searchReportLog (data) {
export function searchDepot (data) {
data.method = `fims.configuration.from.conftype`
return request(data)
}
\ No newline at end of file
}
......@@ -9,7 +9,6 @@
</template>
<script>
import { last, get } from 'lodash'
import { mapMutations } from 'vuex'
export default {
data () {
......
......@@ -27,7 +27,7 @@ export default {
PersonalPanel
},
mounted () {
this.$event.$on('e-password-dialog',res=>this.passVisible =res)
this.$event.$on('e-password-dialog', res => (this.passVisible = res))
},
computed: {
...mapState('d2admin/user', ['info'])
......
......@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-08-27 19:16:26
* @Last Modified by: limin
* @Last Modified time: 2019-09-08 20:54:05
* @Last Modified time: 2019-09-09 17:45:36
*/
import { cloneDeep } from 'lodash'
const permision = {}
......@@ -26,7 +26,7 @@ permision.packRoutesBtns = function (resources, idsInPermision) {
} else { // 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.parentId]
if (__objResource && __objResource.auth) {
__obj = __objResource.auth.find(o => o.authId == obj.authId)
__obj = __objResource.auth.find(o => +o.authId === +obj.authId)
if (__oBtnInPermision[obj.parentId] && __oBtnInPermision[obj.parentId].length) {
__oBtnInPermision[obj.parentId].push(__obj)
} else {
......@@ -62,7 +62,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true
}
if (obj.parentId == '0') { // 取出1级菜单
if ((obj.parentId+'') === '0') { // 取出1级菜单
__aMenusInPermision.push(__oMenu)
} else { // 取出子菜单
__aSub.push(__oMenu)
......@@ -73,7 +73,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
*/
let __parent = null
__aSub.forEach(obj => {
__parent = __aMenusInPermision.find(menu => menu.authId == obj.parentId)
__parent = __aMenusInPermision.find(menu => +menu.authId === +obj.parentId)
if (__parent.children) {
__parent.children.push(obj)
} else {
......
......@@ -93,7 +93,7 @@ service.interceptors.response.use(
return data
default:
// 不是正确的 code
errorCreate(`code:${code} ${dataAxios.message}---${dataAxios.solution}`)
errorCreate(`code:${code} ${dataAxios.message}`)
break
}
},
......@@ -142,5 +142,4 @@ service.interceptors.response.use(
return Promise.reject(error)
}
)
export default service
......@@ -45,7 +45,7 @@ router.beforeEach(async (to, from, next) => {
if (store.state.d2admin.user.info) {
next()
} else {
if (to.path == '/login') { // 如果是登录页面路径,就直接next()
if (to.path === '/login') { // 如果是登录页面路径,就直接next()
next()
} else { // 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
......
......@@ -171,7 +171,6 @@ export const resources = {
},
'105': {
path: 'materialList',
icon: 'folder-o',
icon: 'tickets',
name: '物料列表',
meta: {
......@@ -361,7 +360,7 @@ export const resources = {
authId: '108',
parentId: '0'
},
component: _import('reportingLogs'),
component: _import('reportingLogs')
// auth: [{
// authId: '10801',
// parentId: '108',
......
......@@ -24,7 +24,7 @@ export default {
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
util.cookies.set('uuid', data.loginName)
const authes = (data.roleType == SUPPER_ADMIN)
const authes = (+data.roleType === +SUPPER_ADMIN)
? util.permision.flatten(Object.values(localRoutes))
.map(obj => ({ authId: obj.authId, parentId: obj.parentId }))
: cloneDeep(data.authes)
......
......@@ -2,10 +2,10 @@
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Last Modified by: limin
* @Last Modified time: 2019-09-06 18:23:17
* @Last Modified time: 2019-09-09 17:36:51
*/
import { FetchRoleList, CompanyList, DepartList, StationList, PostList, BaseDataApi } from '@/api/sys.base'
import { FetchRoleList, BaseDataApi } from '@/api/sys.base'
import { BaseData, TYPE_NAME, ConfigType } from '@/common/constants'
const map = {
[BaseData.ROLE.KEY]: FetchRoleList,
......
......@@ -154,7 +154,7 @@ export default {
methods: {
async isCodeExist (rule, value, callback) {
if(this.deviceNum === value && this.deviceName === this.editForm.deviceName) {
if (this.deviceNum === value && this.deviceName === this.editForm.deviceName) {
const res = await isExistApi({ deviceNum: value, deviceName: this.editForm.deviceName, stationCode: this.editForm.stationCode })
// console.log(res)
res ? callback(new Error(rule.message)) : callback()
......
......@@ -295,7 +295,7 @@ export default {
orderCode: row.orderCode
}).then(res => {
// console.log(res)
this.dialogTitle = row.orderType == 1 ? '物料申请' : '物料报废'
this.dialogTitle = row.orderType == 1 ? '物料申请' : '物料报废'
this.pdfUrl = res.url
this.detailVisible = !this.detailVisible
}).catch(() => {
......
......@@ -123,14 +123,14 @@ export default {
},
methods: {
async isCodeExist(rule, value, callback) {
if(this.editForm.trafficCode) {
async isCodeExist (rule, value, callback) {
if (this.editForm.trafficCode) {
const res = await isExistApi({ subsystemCode: value, trafficCode: this.editForm.trafficCode })
res ? callback(new Error(rule.message)) : callback()
}
},
validateCode(value) {
validateCode (value) {
this.$refs.editRuleForm.validateField('subsystemCode')
},
......
......@@ -145,8 +145,8 @@ export default {
{ required: true, message: '姓名不能为空', trigger: ['blur'] }
],
mobile: [
{ required: true,
validator: (rule, value, callback) => {
{ required: true,
validator: (rule, value, callback) => {
if (value === '') {
callback(new Error('联系方式不能为空'))
} else {
......@@ -156,7 +156,8 @@ export default {
return callback(new Error('联系方式错误'))
}
}
}, trigger: ['blur'] },
},
trigger: ['blur'] }
],
companyName: [
{ required: true, message: '所属公司不能为空', trigger: ['blur'] }
......
......@@ -174,7 +174,7 @@ export default {
value: 0,
itemStyle: {
color: '#999999'
},
}
// selected: true
}]
}, {
......@@ -199,7 +199,7 @@ export default {
value: 0,
itemStyle: {
color: '#e45b4e'
},
}
// selected: true
}]
}]
......
......@@ -97,15 +97,15 @@ export default {
mounted () {},
methods: {
async isCodeExist(rule, value, callback) {
const res = await isExistApi({trafficCode: value})
async isCodeExist (rule, value, callback) {
const res = await isExistApi({ trafficCode: value })
res ? callback(new Error(rule.message)) : callback()
},
handleClose () {
this.$emit('closeDialog')
},
handleConfirm () {
this.$refs.editRuleForm.validate((vaild) => {
if (vaild) {
......
......@@ -23,7 +23,7 @@
:rows="2"
placeholder="角色描述"
clearable
maxlength="50"
maxlength="50"
:show-word-limit="true"
v-model="roleForm.description">
</el-input>
......
......@@ -153,18 +153,19 @@ export default {
{ required: true, message: '姓名不能为空', trigger: ['blur'] }
],
mobile: [
{ required: true,
validator: (rule, value, callback) => {
{ required: true,
validator: (rule, value, callback) => {
if (value === '') {
callback(new Error('联系方式不能为空'))
} else {
if (/^1\d{10}$/.test(value)) {
callback()
callback()
} else {
return callback(new Error('联系方式错误'))
}
}
}, trigger: ['blur'] },
},
trigger: ['blur'] }
],
companyName: [
{ required: true, message: '所属公司不能为空', trigger: ['blur'] }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!