mirror of https://github.com/veops/cmdb.git
Merge branch 'master' of github.com:veops/cmdb
This commit is contained in:
commit
3e67bb94bc
|
@ -78,6 +78,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import _ from 'lodash'
|
||||||
import Pager from './pager.vue'
|
import Pager from './pager.vue'
|
||||||
import SearchForm from './searchForm.vue'
|
import SearchForm from './searchForm.vue'
|
||||||
import { searchPermissonHistory } from '@/modules/acl/api/history'
|
import { searchPermissonHistory } from '@/modules/acl/api/history'
|
||||||
|
@ -251,23 +252,25 @@ export default {
|
||||||
},
|
},
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let q = ''
|
let q = ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
key !== 'app_id' &&
|
key !== 'app_id' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return q ? newQueryParams : queryParams
|
return q ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
|
|
||||||
// searchForm相关
|
// searchForm相关
|
||||||
|
@ -283,7 +286,7 @@ export default {
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, app_id: this.app_id }
|
this.queryParams = { ...this.queryParams, ...queryParams, app_id: this.app_id }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,12 @@ export default {
|
||||||
|
|
||||||
// searchForm相关
|
// searchForm相关
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, app_id: this.app_id, scope: this.checked ? 'resource_group' : 'resource' }
|
this.queryParams = {
|
||||||
|
...this.queryParams,
|
||||||
|
...queryParams,
|
||||||
|
app_id: this.app_id,
|
||||||
|
scope: this.checked ? 'resource_group' : 'resource',
|
||||||
|
}
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -245,9 +250,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -255,16 +262,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -179,7 +179,7 @@ export default {
|
||||||
|
|
||||||
// searchForm相关
|
// searchForm相关
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, app_id: this.app_id, scope: 'resource_type' }
|
this.queryParams = { ...this.queryParams, ...queryParams, app_id: this.app_id, scope: 'resource_type' }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -206,9 +206,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -216,16 +218,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -220,7 +220,12 @@ export default {
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, app_id: this.app_id, scope: this.checked ? 'role_relation' : 'role' }
|
this.queryParams = {
|
||||||
|
...this.queryParams,
|
||||||
|
...queryParams,
|
||||||
|
app_id: this.app_id,
|
||||||
|
scope: this.checked ? 'role_relation' : 'role',
|
||||||
|
}
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -237,9 +242,11 @@ export default {
|
||||||
|
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -247,16 +254,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
// 处理tag颜色
|
// 处理tag颜色
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
|
|
|
@ -147,7 +147,6 @@ export default {
|
||||||
expand: false,
|
expand: false,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 50,
|
|
||||||
},
|
},
|
||||||
date: undefined,
|
date: undefined,
|
||||||
checked: false,
|
checked: false,
|
||||||
|
@ -188,7 +187,6 @@ export default {
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.queryParams = {
|
this.queryParams = {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 50,
|
|
||||||
}
|
}
|
||||||
this.date = undefined
|
this.date = undefined
|
||||||
this.$emit('searchFormReset')
|
this.$emit('searchFormReset')
|
||||||
|
|
|
@ -200,7 +200,7 @@ export default {
|
||||||
|
|
||||||
// searchForm相关
|
// searchForm相关
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = queryParams
|
this.queryParams = { ...this.queryParams, ...queryParams }
|
||||||
this.queryParams.app_id = this.app_id
|
this.queryParams.app_id = this.app_id
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
|
@ -281,25 +281,27 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let q = ''
|
let q = ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
key !== 'app_id' &&
|
key !== 'app_id' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
if (q) {
|
if (q) {
|
||||||
q += `,${key}:${queryParams[key]}`
|
q += `,${key}:${_queryParams[key]}`
|
||||||
} else {
|
} else {
|
||||||
q += `${key}:${queryParams[key]}`
|
q += `${key}:${_queryParams[key]}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return q ? newQueryParams : queryParams
|
return q ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import _ from 'lodash'
|
||||||
import debounce from 'lodash/debounce'
|
import debounce from 'lodash/debounce'
|
||||||
import Pager from '../../module/pager.vue'
|
import Pager from '../../module/pager.vue'
|
||||||
import SearchForm from '../../module/searchForm.vue'
|
import SearchForm from '../../module/searchForm.vue'
|
||||||
|
@ -347,7 +348,7 @@ export default {
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = queryParams
|
this.queryParams = { ...this.queryParams, ...queryParams }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
handleExpandChange(expand) {
|
handleExpandChange(expand) {
|
||||||
|
@ -387,23 +388,24 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
let q = ''
|
let q = ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
key !== 'app_id' &&
|
key !== 'app_id' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return q ? newQueryParams : queryParams
|
return q ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,7 +267,7 @@ export default {
|
||||||
this.isExpand = expand
|
this.isExpand = expand
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, scope: this.checked ? 'resource_group' : 'resource' }
|
this.queryParams = { ...this.queryParams, ...queryParams, scope: this.checked ? 'resource_group' : 'resource' }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -317,9 +317,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -327,16 +329,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -217,7 +217,7 @@ export default {
|
||||||
this.isExpand = expand
|
this.isExpand = expand
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, scope: 'resource_type' }
|
this.queryParams = { ...this.queryParams, ...queryParams, scope: 'resource_type' }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -253,9 +253,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -263,16 +265,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -231,7 +231,7 @@ export default {
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = { ...queryParams, scope: this.checked ? 'role_relation' : 'role' }
|
this.queryParams = { ...this.queryParams, ...queryParams, scope: this.checked ? 'role_relation' : 'role' }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -247,9 +247,10 @@ export default {
|
||||||
|
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
let flag = false
|
let flag = false
|
||||||
let q = queryParams.q ? queryParams.q : ''
|
let q = _queryParams.q ? _queryParams.q : ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
|
@ -257,16 +258,16 @@ export default {
|
||||||
key !== 'q' &&
|
key !== 'q' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
flag = true
|
flag = true
|
||||||
if (q) q += `,${key}:${queryParams[key]}`
|
if (q) q += `,${key}:${_queryParams[key]}`
|
||||||
else q += `${key}:${queryParams[key]}`
|
else q += `${key}:${_queryParams[key]}`
|
||||||
delete queryParams[key]
|
delete _queryParams[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return flag ? newQueryParams : queryParams
|
return flag ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
// 处理tag颜色
|
// 处理tag颜色
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
|
|
|
@ -241,7 +241,7 @@ export default {
|
||||||
this.isExpand = expand
|
this.isExpand = expand
|
||||||
},
|
},
|
||||||
handleSearch(queryParams) {
|
handleSearch(queryParams) {
|
||||||
this.queryParams = queryParams
|
this.queryParams = { ...this.queryParams, ...queryParams }
|
||||||
this.getTable(this.queryParams)
|
this.getTable(this.queryParams)
|
||||||
},
|
},
|
||||||
searchFormReset() {
|
searchFormReset() {
|
||||||
|
@ -326,25 +326,27 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleQueryParams(queryParams) {
|
handleQueryParams(queryParams) {
|
||||||
|
const _queryParams = _.cloneDeep(queryParams)
|
||||||
|
|
||||||
let q = ''
|
let q = ''
|
||||||
for (const key in queryParams) {
|
for (const key in _queryParams) {
|
||||||
if (
|
if (
|
||||||
key !== 'page' &&
|
key !== 'page' &&
|
||||||
key !== 'page_size' &&
|
key !== 'page_size' &&
|
||||||
key !== 'app_id' &&
|
key !== 'app_id' &&
|
||||||
key !== 'start' &&
|
key !== 'start' &&
|
||||||
key !== 'end' &&
|
key !== 'end' &&
|
||||||
queryParams[key] !== undefined
|
_queryParams[key] !== undefined
|
||||||
) {
|
) {
|
||||||
if (q) {
|
if (q) {
|
||||||
q += `,${key}:${queryParams[key]}`
|
q += `,${key}:${_queryParams[key]}`
|
||||||
} else {
|
} else {
|
||||||
q += `${key}:${queryParams[key]}`
|
q += `${key}:${_queryParams[key]}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const newQueryParams = { ...queryParams, q }
|
const newQueryParams = { ..._queryParams, q }
|
||||||
return q ? newQueryParams : queryParams
|
return q ? newQueryParams : _queryParams
|
||||||
},
|
},
|
||||||
handleTagColor(operateType) {
|
handleTagColor(operateType) {
|
||||||
return this.colorMap.get(operateType)
|
return this.colorMap.get(operateType)
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ci-type-grant">
|
<div class="ci-type-grant">
|
||||||
<vxe-table size="mini" stripe class="ops-stripe-table" :data="filterTableData" :max-height="`${tableHeight}px`">
|
<vxe-table
|
||||||
|
ref="xTable"
|
||||||
|
size="mini"
|
||||||
|
stripe
|
||||||
|
class="ops-stripe-table"
|
||||||
|
:data="filterTableData"
|
||||||
|
:max-height="`${tableHeight}px`"
|
||||||
|
:row-style="(params) => getCurrentRowStyle(params, addedRids)"
|
||||||
|
>
|
||||||
<vxe-column field="name"></vxe-column>
|
<vxe-column field="name"></vxe-column>
|
||||||
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
|
@ -37,6 +45,7 @@ import _ from 'lodash'
|
||||||
import { permMap } from './constants.js'
|
import { permMap } from './constants.js'
|
||||||
import { grantCiType, revokeCiType } from '../../api/CIType'
|
import { grantCiType, revokeCiType } from '../../api/CIType'
|
||||||
import ReadCheckbox from './readCheckbox.vue'
|
import ReadCheckbox from './readCheckbox.vue'
|
||||||
|
import { getCurrentRowStyle } from './utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CiTypeGrant',
|
name: 'CiTypeGrant',
|
||||||
|
@ -55,10 +64,13 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'ci_type',
|
default: 'ci_type',
|
||||||
},
|
},
|
||||||
|
addedRids: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filterTableData() {
|
filterTableData() {
|
||||||
console.log(_.cloneDeep(this.tableData))
|
|
||||||
const _tableData = this.tableData.filter((data) => {
|
const _tableData = this.tableData.filter((data) => {
|
||||||
const _intersection = _.intersection(
|
const _intersection = _.intersection(
|
||||||
Object.keys(data),
|
Object.keys(data),
|
||||||
|
@ -90,6 +102,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCurrentRowStyle,
|
||||||
async handleChange(e, col, row) {
|
async handleChange(e, col, row) {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
await grantCiType(this.CITypeId, row.rid, { perms: [col] }).catch(() => {
|
await grantCiType(this.CITypeId, row.rid, { perms: [col] }).catch(() => {
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
@grantDepart="grantDepart"
|
@grantDepart="grantDepart"
|
||||||
@grantRole="grantRole"
|
@grantRole="grantRole"
|
||||||
@getTableData="getTableData"
|
@getTableData="getTableData"
|
||||||
|
ref="grant_ci_type"
|
||||||
|
:addedRids="addedRids"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template
|
<template
|
||||||
|
@ -25,6 +27,8 @@
|
||||||
@grantRole="grantRole"
|
@grantRole="grantRole"
|
||||||
@getTableData="getTableData"
|
@getTableData="getTableData"
|
||||||
@openReadGrantModal="openReadGrantModal"
|
@openReadGrantModal="openReadGrantModal"
|
||||||
|
ref="grant_ci"
|
||||||
|
:addedRids="addedRids"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="cmdbGrantType.includes('type_relation')">
|
<template v-if="cmdbGrantType.includes('type_relation')">
|
||||||
|
@ -36,6 +40,8 @@
|
||||||
@grantDepart="grantDepart"
|
@grantDepart="grantDepart"
|
||||||
@grantRole="grantRole"
|
@grantRole="grantRole"
|
||||||
@getTableData="getTableData"
|
@getTableData="getTableData"
|
||||||
|
ref="grant_type_relation"
|
||||||
|
:addedRids="addedRids"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="cmdbGrantType.includes('relation_view')">
|
<template v-if="cmdbGrantType.includes('relation_view')">
|
||||||
|
@ -47,6 +53,8 @@
|
||||||
@grantDepart="grantDepart"
|
@grantDepart="grantDepart"
|
||||||
@grantRole="grantRole"
|
@grantRole="grantRole"
|
||||||
@getTableData="getTableData"
|
@getTableData="getTableData"
|
||||||
|
ref="grant_relation_view"
|
||||||
|
:addedRids="addedRids"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -108,6 +116,7 @@ export default {
|
||||||
attrGroup: [],
|
attrGroup: [],
|
||||||
filerPerimissions: {},
|
filerPerimissions: {},
|
||||||
loading: false,
|
loading: false,
|
||||||
|
addedRids: [], // 本次新增的rid
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -282,6 +291,12 @@ export default {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
this.addedRids = rids
|
||||||
|
this.$nextTick(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs[`grant_${grantType}`].$refs.xTable.elemStore['main-body-wrapper'].scrollTo(0, 0)
|
||||||
|
}, 300)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
openReadGrantModal(col, row) {
|
openReadGrantModal(col, row) {
|
||||||
this.$refs.readGrantModal.open(col, row)
|
this.$refs.readGrantModal.open(col, row)
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ci-relation-grant">
|
<div class="ci-relation-grant">
|
||||||
<vxe-table size="mini" stripe class="ops-stripe-table" :data="tableData" :max-height="`${tableHeight}px`">
|
<vxe-table
|
||||||
|
ref="xTable"
|
||||||
|
size="mini"
|
||||||
|
stripe
|
||||||
|
class="ops-stripe-table"
|
||||||
|
:data="tableData"
|
||||||
|
:max-height="`${tableHeight}px`"
|
||||||
|
:row-style="(params) => getCurrentRowStyle(params, addedRids)"
|
||||||
|
>
|
||||||
<vxe-column field="name"></vxe-column>
|
<vxe-column field="name"></vxe-column>
|
||||||
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
|
@ -18,6 +26,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { permMap } from './constants.js'
|
import { permMap } from './constants.js'
|
||||||
import { grantRelationView, revokeRelationView } from '../../api/preference.js'
|
import { grantRelationView, revokeRelationView } from '../../api/preference.js'
|
||||||
|
import { getCurrentRowStyle } from './utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'RelationViewGrant',
|
name: 'RelationViewGrant',
|
||||||
inject: ['loading', 'isModal'],
|
inject: ['loading', 'isModal'],
|
||||||
|
@ -34,6 +44,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'relation_view',
|
default: 'relation_view',
|
||||||
},
|
},
|
||||||
|
addedRids: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -53,6 +67,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCurrentRowStyle,
|
||||||
grantDepart() {
|
grantDepart() {
|
||||||
this.$emit('grantDepart', this.grantType)
|
this.$emit('grantDepart', this.grantType)
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ci-relation-grant">
|
<div class="ci-relation-grant">
|
||||||
<vxe-table size="mini" stripe class="ops-stripe-table" :data="tableData" :max-height="`${tableHeight}px`">
|
<vxe-table
|
||||||
|
ref="xTable"
|
||||||
|
size="mini"
|
||||||
|
stripe
|
||||||
|
class="ops-stripe-table"
|
||||||
|
:data="tableData"
|
||||||
|
:max-height="`${tableHeight}px`"
|
||||||
|
:row-style="(params) => getCurrentRowStyle(params, addedRids)"
|
||||||
|
>
|
||||||
<vxe-column field="name"></vxe-column>
|
<vxe-column field="name"></vxe-column>
|
||||||
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
<vxe-column v-for="col in columns" :key="col" :field="col" :title="permMap[col]">
|
||||||
<template #default="{row}">
|
<template #default="{row}">
|
||||||
|
@ -18,6 +26,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { permMap } from './constants.js'
|
import { permMap } from './constants.js'
|
||||||
import { grantTypeRelation, revokeTypeRelation } from '../../api/CITypeRelation.js'
|
import { grantTypeRelation, revokeTypeRelation } from '../../api/CITypeRelation.js'
|
||||||
|
import { getCurrentRowStyle } from './utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TypeRelationGrant',
|
name: 'TypeRelationGrant',
|
||||||
inject: ['loading', 'isModal'],
|
inject: ['loading', 'isModal'],
|
||||||
|
@ -34,6 +44,10 @@ export default {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
addedRids: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -53,6 +67,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCurrentRowStyle,
|
||||||
grantDepart() {
|
grantDepart() {
|
||||||
this.$emit('grantDepart', this.grantType)
|
this.$emit('grantDepart', this.grantType)
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const getCurrentRowStyle = ({ row }, addedRids) => {
|
||||||
|
const idx = addedRids.findIndex(item => item.rid === row.rid)
|
||||||
|
return idx > -1 ? 'background-color:#E0E7FF!important' : ''
|
||||||
|
}
|
|
@ -1,130 +1,137 @@
|
||||||
<template>
|
<template>
|
||||||
<a-form :form="form" class="create-new-attribute">
|
<a-form :form="form" class="create-new-attribute">
|
||||||
<a-divider style="font-size:14px;margin-top:6px;">基础设置</a-divider>
|
<a-divider style="font-size:14px;margin-top:6px;">基础设置</a-divider>
|
||||||
<a-col :span="12">
|
<a-row>
|
||||||
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="属性名(英文)">
|
<a-col :span="12">
|
||||||
<a-input
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="属性名(英文)">
|
||||||
name="name"
|
|
||||||
placeholder="英文"
|
|
||||||
v-decorator="[
|
|
||||||
'name',
|
|
||||||
{
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '请输入属性名' },
|
|
||||||
{ message: '不能以数字开头,可以是英文 数字以及下划线 (_)', pattern: RegExp('^(?!\\d)[a-zA-Z_0-9]+$') },
|
|
||||||
{ message: '内置字段', pattern: RegExp('^(?!(id|_id|ci_id|type|_type|ci_type)$).*$') },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="别名">
|
|
||||||
<a-input name="alias" v-decorator="['alias', { rules: [] }]" />
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="12">
|
|
||||||
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="数据类型">
|
|
||||||
<a-select
|
|
||||||
name="value_type"
|
|
||||||
style="width: 100%"
|
|
||||||
v-decorator="['value_type', { rules: [{ required: true }], initialValue: '2' }]"
|
|
||||||
@change="handleChangeValueType"
|
|
||||||
>
|
|
||||||
<a-select-option :value="key" :key="key" v-for="(value, key) in valueTypeMap">{{ value }}</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="currentValueType === '6' ? 24 : 12">
|
|
||||||
<a-form-item
|
|
||||||
:label-col="{ span: currentValueType === '6' ? 4 : 8 }"
|
|
||||||
:wrapper-col="{ span: currentValueType === '6' ? 18 : 12 }"
|
|
||||||
label="默认值"
|
|
||||||
>
|
|
||||||
<template>
|
|
||||||
<a-select
|
|
||||||
v-if="form.getFieldValue('is_list')"
|
|
||||||
mode="tags"
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
|
||||||
>
|
|
||||||
</a-select>
|
|
||||||
<a-input-number
|
|
||||||
style="width: 100%"
|
|
||||||
v-else-if="currentValueType === '1'"
|
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
|
||||||
>
|
|
||||||
</a-input-number>
|
|
||||||
<a-select
|
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
|
||||||
mode="tags"
|
|
||||||
v-else-if="currentValueType === '0'"
|
|
||||||
@select="selectIntDefaultValue"
|
|
||||||
>
|
|
||||||
<a-select-option key="$auto_inc_id">
|
|
||||||
自增ID
|
|
||||||
</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
<a-input
|
<a-input
|
||||||
style="width: 100%"
|
name="name"
|
||||||
v-else-if="currentValueType === '2' || currentValueType === '5'"
|
placeholder="英文"
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
v-decorator="[
|
||||||
>
|
'name',
|
||||||
</a-input>
|
{
|
||||||
<a-select
|
rules: [
|
||||||
allowClear
|
{ required: true, message: '请输入属性名' },
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
{
|
||||||
v-else-if="currentValueType === '3' && defaultForDatetime !== '$custom_time'"
|
message: '不能以数字开头,可以是英文 数字以及下划线 (_)',
|
||||||
@select="changeDefaultForDatetime"
|
pattern: RegExp('^(?!\\d)[a-zA-Z_0-9]+$'),
|
||||||
>
|
},
|
||||||
<a-select-option key="$created_at">
|
{ message: '内置字段', pattern: RegExp('^(?!(id|_id|ci_id|type|_type|ci_type)$).*$') },
|
||||||
创建时间
|
],
|
||||||
</a-select-option>
|
},
|
||||||
<a-select-option key="$updated_at">
|
]"
|
||||||
更新时间
|
|
||||||
</a-select-option>
|
|
||||||
<a-select-option key="$custom_time">
|
|
||||||
自定义时间
|
|
||||||
</a-select-option>
|
|
||||||
</a-select>
|
|
||||||
<template v-else-if="currentValueType === '4' || currentValueType === '3'">
|
|
||||||
<a-date-picker
|
|
||||||
style="width: 100%"
|
|
||||||
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
|
||||||
:format="currentValueType === '4' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
|
||||||
:showTime="currentValueType === '4' ? false : { format: 'HH:mm:ss' }"
|
|
||||||
/>
|
|
||||||
<a-dropdown
|
|
||||||
:style="{ position: 'absolute', right: '-15px', top: '-10px' }"
|
|
||||||
:trigger="['click']"
|
|
||||||
v-if="currentValueType === '3'"
|
|
||||||
>
|
|
||||||
<a><a-icon type="down" /> </a>
|
|
||||||
<a-menu slot="overlay" @click="onClick">
|
|
||||||
<a-menu-item key="$created_at">
|
|
||||||
<a>创建时间</a>
|
|
||||||
</a-menu-item>
|
|
||||||
<a-menu-item key="$updated_at">
|
|
||||||
<a>更新时间</a>
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</a-dropdown>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<vue-json-editor
|
|
||||||
v-else-if="currentValueType === '6'"
|
|
||||||
:style="{ '--custom-height': `${200}px` }"
|
|
||||||
v-model="default_value_json"
|
|
||||||
:showBtns="false"
|
|
||||||
:mode="'code'"
|
|
||||||
lang="zh"
|
|
||||||
@json-change="onJsonChange"
|
|
||||||
@has-error="onJsonError"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</a-form-item>
|
||||||
</a-form-item>
|
</a-col>
|
||||||
</a-col>
|
<a-col :span="12">
|
||||||
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="别名">
|
||||||
|
<a-input name="alias" v-decorator="['alias', { rules: [] }]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="数据类型">
|
||||||
|
<a-select
|
||||||
|
name="value_type"
|
||||||
|
style="width: 100%"
|
||||||
|
v-decorator="['value_type', { rules: [{ required: true }], initialValue: '2' }]"
|
||||||
|
@change="handleChangeValueType"
|
||||||
|
>
|
||||||
|
<a-select-option :value="key" :key="key" v-for="(value, key) in valueTypeMap">{{ value }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="currentValueType === '6' ? 24 : 12">
|
||||||
|
<a-form-item
|
||||||
|
:label-col="{ span: currentValueType === '6' ? 4 : 8 }"
|
||||||
|
:wrapper-col="{ span: currentValueType === '6' ? 18 : 12 }"
|
||||||
|
label="默认值"
|
||||||
|
>
|
||||||
|
<template>
|
||||||
|
<a-select
|
||||||
|
v-if="form.getFieldValue('is_list')"
|
||||||
|
mode="tags"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
<a-input-number
|
||||||
|
style="width: 100%"
|
||||||
|
v-else-if="currentValueType === '1'"
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
>
|
||||||
|
</a-input-number>
|
||||||
|
<a-select
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
mode="tags"
|
||||||
|
v-else-if="currentValueType === '0'"
|
||||||
|
@select="selectIntDefaultValue"
|
||||||
|
>
|
||||||
|
<a-select-option key="$auto_inc_id">
|
||||||
|
自增ID
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<a-input
|
||||||
|
style="width: 100%"
|
||||||
|
v-else-if="currentValueType === '2' || currentValueType === '5'"
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
>
|
||||||
|
</a-input>
|
||||||
|
<a-select
|
||||||
|
allowClear
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
v-else-if="currentValueType === '3' && defaultForDatetime !== '$custom_time'"
|
||||||
|
@select="changeDefaultForDatetime"
|
||||||
|
>
|
||||||
|
<a-select-option key="$created_at">
|
||||||
|
创建时间
|
||||||
|
</a-select-option>
|
||||||
|
<a-select-option key="$updated_at">
|
||||||
|
更新时间
|
||||||
|
</a-select-option>
|
||||||
|
<a-select-option key="$custom_time">
|
||||||
|
自定义时间
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<template v-else-if="currentValueType === '4' || currentValueType === '3'">
|
||||||
|
<a-date-picker
|
||||||
|
style="width: 100%"
|
||||||
|
v-decorator="['default_value', { rules: [{ required: false }] }]"
|
||||||
|
:format="currentValueType === '4' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
||||||
|
:showTime="currentValueType === '4' ? false : { format: 'HH:mm:ss' }"
|
||||||
|
/>
|
||||||
|
<a-dropdown
|
||||||
|
:style="{ position: 'absolute', right: '-15px', top: '-10px' }"
|
||||||
|
:trigger="['click']"
|
||||||
|
v-if="currentValueType === '3'"
|
||||||
|
>
|
||||||
|
<a><a-icon type="down" /> </a>
|
||||||
|
<a-menu slot="overlay" @click="onClick">
|
||||||
|
<a-menu-item key="$created_at">
|
||||||
|
<a>创建时间</a>
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item key="$updated_at">
|
||||||
|
<a>更新时间</a>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</a-dropdown>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<vue-json-editor
|
||||||
|
v-else-if="currentValueType === '6'"
|
||||||
|
:style="{ '--custom-height': `${200}px` }"
|
||||||
|
v-model="default_value_json"
|
||||||
|
:showBtns="false"
|
||||||
|
:mode="'code'"
|
||||||
|
lang="zh"
|
||||||
|
@json-change="onJsonChange"
|
||||||
|
@has-error="onJsonError"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
<a-col :span="6">
|
<a-col :span="6">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
|
|
|
@ -534,7 +534,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getAllFlatEmployees() {
|
getAllFlatEmployees() {
|
||||||
getEmployeeList({ block_status: 0, page_size: 99999 }).then((res) => {
|
getEmployeeList({ block_status: -1, page_size: 99999 }).then((res) => {
|
||||||
this.allFlatEmployees = res.data_list
|
this.allFlatEmployees = res.data_list
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -721,7 +721,7 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
updateAll() {
|
updateAll() {
|
||||||
this.expression = []
|
// this.expression = []
|
||||||
this.updateCount()
|
this.updateCount()
|
||||||
this.updateTableDataByFilter()
|
this.updateTableDataByFilter()
|
||||||
},
|
},
|
||||||
|
@ -774,7 +774,7 @@ export default {
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.filterName = ''
|
this.filterName = ''
|
||||||
this.$refs.filterComp.expression = ''
|
this.$refs.filterComp.expression = []
|
||||||
this.updateTableDataByFilter()
|
this.updateTableDataByFilter()
|
||||||
},
|
},
|
||||||
handleSearch(expression) {
|
handleSearch(expression) {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue