2020-08-28 15:00:45 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<v-card class="ml-1 mr-1 mb-1 mt-1">
|
|
|
|
|
|
<v-card-title>
|
|
|
|
|
|
<v-icon left color="primary">sort</v-icon>
|
2020-12-05 13:39:11 +08:00
|
|
|
|
正则排序
|
2020-08-28 15:00:45 +08:00
|
|
|
|
<v-spacer></v-spacer>
|
2020-09-18 11:07:23 +08:00
|
|
|
|
<v-btn icon @click="$emit('up', idx)">
|
|
|
|
|
|
<v-icon>keyboard_arrow_up</v-icon>
|
|
|
|
|
|
</v-btn>
|
|
|
|
|
|
<v-btn icon @click="$emit('down', idx)">
|
|
|
|
|
|
<v-icon>keyboard_arrow_down</v-icon>
|
|
|
|
|
|
</v-btn>
|
|
|
|
|
|
<v-btn icon @click="$emit('deleteProcess', idx)">
|
2020-08-28 15:00:45 +08:00
|
|
|
|
<v-icon color="error">mdi-delete</v-icon>
|
|
|
|
|
|
</v-btn>
|
|
|
|
|
|
<v-dialog>
|
|
|
|
|
|
<template #activator="{on}">
|
|
|
|
|
|
<v-btn icon v-on="on">
|
|
|
|
|
|
<v-icon>help</v-icon>
|
|
|
|
|
|
</v-btn>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<v-card>
|
|
|
|
|
|
<v-card-title class="headline">
|
2020-12-05 13:39:11 +08:00
|
|
|
|
正则排序
|
2020-08-28 15:00:45 +08:00
|
|
|
|
</v-card-title>
|
|
|
|
|
|
<v-card-text>
|
2020-12-05 13:39:11 +08:00
|
|
|
|
根据给出的正则表达式的顺序对节点进行排序,无法匹配的节点将会按照正序排列。
|
2020-08-28 15:00:45 +08:00
|
|
|
|
</v-card-text>
|
|
|
|
|
|
</v-card>
|
|
|
|
|
|
</v-dialog>
|
|
|
|
|
|
</v-card-title>
|
|
|
|
|
|
<v-card-text>
|
2020-12-05 13:39:11 +08:00
|
|
|
|
正则表达式
|
|
|
|
|
|
<v-chip-group
|
|
|
|
|
|
column
|
2020-08-28 15:00:45 +08:00
|
|
|
|
>
|
|
|
|
|
|
<v-chip
|
|
|
|
|
|
close
|
|
|
|
|
|
close-icon="mdi-delete"
|
2020-12-05 13:39:11 +08:00
|
|
|
|
v-for="(item, idx) in items"
|
2020-08-28 15:00:45 +08:00
|
|
|
|
:key="idx"
|
2020-09-18 11:07:23 +08:00
|
|
|
|
@click="edit(idx)"
|
2020-08-28 15:00:45 +08:00
|
|
|
|
@click:close="remove(idx)"
|
|
|
|
|
|
>
|
2020-12-05 13:39:11 +08:00
|
|
|
|
{{ item }}
|
2020-08-28 15:00:45 +08:00
|
|
|
|
</v-chip>
|
|
|
|
|
|
</v-chip-group>
|
|
|
|
|
|
<v-text-field
|
2020-12-05 13:39:11 +08:00
|
|
|
|
placeholder="添加新正则表达式"
|
2020-09-21 10:15:05 +08:00
|
|
|
|
clearable
|
|
|
|
|
|
clear-icon="clear"
|
2020-08-28 15:00:45 +08:00
|
|
|
|
solo
|
2020-12-05 13:39:11 +08:00
|
|
|
|
v-model="form.item"
|
2020-08-28 15:00:45 +08:00
|
|
|
|
append-icon="mdi-send"
|
2020-12-05 13:39:11 +08:00
|
|
|
|
@click:append="add(form.item)"
|
|
|
|
|
|
@keyup.enter="add(form.item)"
|
2020-08-28 15:00:45 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</v-card-text>
|
|
|
|
|
|
</v-card>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
2020-09-18 11:07:23 +08:00
|
|
|
|
props: ['args'],
|
2020-08-28 15:00:45 +08:00
|
|
|
|
data: function () {
|
|
|
|
|
|
return {
|
2020-09-18 11:07:23 +08:00
|
|
|
|
idx: this.$vnode.key,
|
2020-08-28 15:00:45 +08:00
|
|
|
|
selection: null,
|
|
|
|
|
|
currentTag: null,
|
|
|
|
|
|
form: {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
item: ""
|
2020-08-28 15:00:45 +08:00
|
|
|
|
},
|
2020-12-05 13:39:11 +08:00
|
|
|
|
items: []
|
2020-08-28 15:00:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-09-18 11:07:23 +08:00
|
|
|
|
created() {
|
|
|
|
|
|
if (this.args) {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
this.items = this.args || [];
|
2020-09-18 11:07:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
items() {
|
2020-09-18 11:07:23 +08:00
|
|
|
|
this.save();
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2020-08-28 15:00:45 +08:00
|
|
|
|
methods: {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
add(item) {
|
|
|
|
|
|
if (item) {
|
|
|
|
|
|
this.items.push(item);
|
|
|
|
|
|
this.form.item = "";
|
2020-08-28 15:00:45 +08:00
|
|
|
|
} else {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
this.$store.commit("SET_ERROR_MESSAGE", "正则表达式不能为空!");
|
2020-08-28 15:00:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2020-09-18 11:07:23 +08:00
|
|
|
|
edit(idx) {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
this.form.item = this.items[idx];
|
2020-09-18 11:07:23 +08:00
|
|
|
|
this.remove(idx);
|
|
|
|
|
|
},
|
2020-08-28 15:00:45 +08:00
|
|
|
|
remove(idx) {
|
2020-12-05 13:39:11 +08:00
|
|
|
|
this.items.splice(idx, 1);
|
2020-08-28 15:00:45 +08:00
|
|
|
|
},
|
2020-09-18 11:07:23 +08:00
|
|
|
|
save() {
|
|
|
|
|
|
this.$emit("dataChanged", {
|
|
|
|
|
|
idx: this.idx,
|
2020-12-05 13:39:11 +08:00
|
|
|
|
args: this.items
|
2020-09-18 11:07:23 +08:00
|
|
|
|
});
|
2020-08-28 15:00:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|