feat: 删除不等于 不包含

This commit is contained in:
fit2cloud-chenyw 2021-06-16 18:03:59 +08:00
parent c9518c2e4e
commit a8b9a4fbb2
5 changed files with 129 additions and 5 deletions

View File

@ -60,10 +60,18 @@ public class F2CRealm extends AuthorizingRealm {
CacheUtils.get("lic_info", "lic");
}catch (Exception e) {
LogUtil.error(e);
throw new AuthenticationException("lic error");
}
String token = (String) auth.getCredentials();
// 解密获得username用于和数据库进行对比
TokenInfo tokenInfo = JWTUtils.tokenInfoByToken(token);
TokenInfo tokenInfo = null;
String token = null;
try {
token = (String) auth.getCredentials();
// 解密获得username用于和数据库进行对比
tokenInfo = JWTUtils.tokenInfoByToken(token);
}catch (Exception e) {
throw new AuthenticationException(e);
}
Long userId = tokenInfo.getUserId();
String username = tokenInfo.getUsername();
if (username == null) {

View File

@ -0,0 +1,53 @@
<template>
<de-complex-operator v-model="operator" :label="label" :operators="operators" :size="configSize">
<el-input v-model="value" :placeholder="$t('fu.search_bar.please_input')" :size="configSize" v-bind="$attrs" />
</de-complex-operator>
</template>
<script>
import { ComplexCondition } from 'fit2cloud-ui/src/components/search-bar/model'
// import mixins from 'fit2cloud-ui/src/components/search-bar/complex-components/mixins'
import DeComplexOperator from './DeComplexOperator.vue'
import Cookies from 'js-cookie'
export default {
name: 'DeComplexInput',
components: { DeComplexOperator },
// mixins: [mixins],
props: {
field: String,
label: String,
defaultOperator: {
type: String,
default: 'like'
}
},
data() {
return {
operator: this.defaultOperator,
value: '',
operators: [{
label: 'fu.search_bar.like',
value: 'like'
}, {
label: 'fu.search_bar.eq',
value: 'eq'
}]
}
},
computed: {
configSize() {
return Cookies.get('size') || 'medium'
}
},
methods: {
getCondition() {
if (!this.value) return
const { field, label, operator, operatorLabel, value } = this
return new ComplexCondition({ field, label, operator, operatorLabel, value })
},
init() {
this.value = ''
}
}
}
</script>

View File

@ -0,0 +1,62 @@
<template>
<div class="fu-operator-component">
<div :class="['fu-operator-component__label', 'fu-operator-component__label--' + configSize]">
{{ label }}
</div>
<div class="fu-operator-component__operator">
<el-select
v-model="value"
class="search-operator"
:placeholder="$t('fu.search_bar.please_select')"
:size="configSize"
@change="change"
@input="change"
>
<el-option v-for="o in operators" :key="o.value" :label="$t(o.label)" :value="o.value" />
</el-select>
</div>
<div class="fu-operator-component__value">
<slot />
</div>
</div>
</template>
<script>
import Cookies from 'js-cookie'
export default {
name: 'DeComplexOperator',
model: {
prop: 'operator',
event: 'change'
},
props: {
label: String,
operator: String,
operators: Array
},
data() {
return {
value: this.operator
}
},
computed: {
configSize() {
return Cookies.get('size') || 'medium'
}
},
watch: {
operator: function(v) {
this.value = v
}
},
methods: {
change(value) {
this.$emit('change', value)
}
}
}
</script>
<style scoped>
</style>

View File

@ -20,6 +20,7 @@ import widgets from '@/components/widget'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import './utils/dialog'
import DeComplexInput from '@/components/business/condition-table/DeComplexInput'
import '@/components/canvas/custom-component' // 注册自定义组件
Vue.config.productionTip = false
@ -69,6 +70,7 @@ Vue.use(filter)
Vue.use(directives)
Vue.use(message)
Vue.component('Treeselect', Treeselect)
Vue.component('DeComplexInput', DeComplexInput)
Vue.config.productionTip = false
Vue.prototype.hasDataPermission = function(pTarget, pSource) {

View File

@ -162,7 +162,6 @@
<script>
import LayoutContent from '@/components/business/LayoutContent'
import ComplexTable from '@/components/business/complex-table'
// import { checkPermission } from '@/utils/permission'
import { formatCondition, formatQuickCondition, addOrder, formatOrders } from '@/utils/index'
import { PHONE_REGEX } from '@/utils/validate'
@ -199,7 +198,7 @@ export default {
useComplexSearch: true,
quickPlaceholder: '按姓名搜索',
components: [
{ field: 'nick_name', label: '姓名', component: 'FuComplexInput' },
{ field: 'nick_name', label: '姓名', component: 'DeComplexInput' },
{
field: 'u.enabled',
label: '状态',