Skip to content

Commit

Permalink
hotfix:高危语句规则页面增加搜索等通用操作 TencentBlueKing#1345
Browse files Browse the repository at this point in the history
  • Loading branch information
hLinx committed May 11, 2023
1 parent c8af5f3 commit 3e979b5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@
</template>
<script>
import _ from 'lodash';
import I18n from '@/i18n';

import rollingExprParse from '@utils/rolling-expr-parse';

import Guide from './guide';

import I18n from '@/i18n';

export default {
name: '',
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/domain/model/dangerous-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

export default class DangerousRule {
constructor (payload) {
constructor(payload) {
this.action = payload.action;
this.createTime = payload.createTime;
this.creator = payload.creator;
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/src/domain/service/dangerous-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
*/

/* eslint-disable no-param-reassign */
import DangerousRuleSource from '../source/dangerous-rule';
import DangerousRuleModel from '@model/dangerous-rule';

import DangerousRuleSource from '../source/dangerous-rule';

import I18n from '@/i18n';

export default {
Expand All @@ -45,7 +47,7 @@ export default {
return DangerousRuleSource.move(params)
.then(({ data }) => data);
},
fetchActionList () {
fetchActionList() {
return Promise.resolve([
{
id: 1,
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/utils/rolling-expr-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
* IN THE SOFTWARE.
*/

import I18n from '@/i18n';
import { ordinalSuffixOf } from '@utils/assist';

import I18n from '@/i18n';

const fixed = /^([1-9]\d*)$/;
const fixedIn = /^\+([1-9]\d*)$/;
const fixedMu = /^\*([1-9]\d*)$/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
</template>
<script>
import _ from 'lodash';

import DangerousRuleService from '@service/dangerous-rule';

export default {
Expand All @@ -71,7 +72,7 @@
};
},
computed: {
text () {
text() {
const action = _.find(this.actionList, _ => _.id === this.value);
if (!action) {
return '--';
Expand All @@ -86,11 +87,11 @@
return classMap[this.value];
},
},
created () {
created() {
this.fetchData();
},
methods: {
fetchData () {
fetchData() {
DangerousRuleService.fetchActionList()
.then((data) => {
this.actionList = Object.freeze(data);
Expand All @@ -116,7 +117,7 @@
/**
* @desc 触发change 事件
*/
handleChange (value) {
handleChange(value) {
if (this.value === value) {
return;
}
Expand Down

0 comments on commit 3e979b5

Please sign in to comment.