diff --git a/nezha-fronted/src/components/common/rightBox/accountBox.vue b/nezha-fronted/src/components/common/rightBox/accountBox.vue
index 287fcc1f3..4428aa023 100644
--- a/nezha-fronted/src/components/common/rightBox/accountBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/accountBox.vue
@@ -165,18 +165,18 @@
},
getScripts() {
- /*this.$get("/alert/script?pageNo=1&pageSize=-1").then(response => {
+ this.$get("/alert/script?pageNo=1&pageSize=-1").then(response => {
this.scripts = response.data.list;
this.getSelectableScripts();
- });*/
- this.scripts = [
+ });
+ /*this.scripts = [
{id: 1, name: "DOLBY"},
{id: 2, name: "IMAX"},
{id: 3, name: "CGS"},
{id: 4, name: "LUXE"},
{id: 5, name: "DST:X"},
];
- this.getSelectableScripts();
+ this.getSelectableScripts();*/
},
getSelectableScripts() {
diff --git a/nezha-fronted/src/components/page/config/account.vue b/nezha-fronted/src/components/page/config/account.vue
index 407013a35..b0352f0f7 100644
--- a/nezha-fronted/src/components/page/config/account.vue
+++ b/nezha-fronted/src/components/page/config/account.vue
@@ -57,6 +57,7 @@
v-for="(item, index) in tools.customTableTitle"
v-if="item.show"
:key="`col-${index}`"
+ :fixed="item.fixed"
:label="item.label"
:prop="item.prop"
:sort-orders="['ascending', 'descending']"
@@ -98,7 +99,7 @@
{{scope.row[item.prop]}}
-
+
@@ -207,7 +208,8 @@
label: this.$t('config.account.option'),
prop: 'option',
show: true,
- width: 120
+ width: 120,
+ fixed: "right"
}
],
tableData: [],
@@ -289,13 +291,13 @@
if (response.code === 200) {
for (let i = 0; i < response.data.list.length; i++) {
response.data.list[i].status = response.data.list[i].status + "";
- response.data.list[i].notifications = [
+ /*response.data.list[i].notifications = [
{scriptId: 1, account: "杀死比尔"},
{scriptId: 2, account: "虎虎虎"},
{scriptId: 3, account: "红海行动"},
{scriptId: 4, account: "十面埋伏"},
{scriptId: 5, account: "哪吒"},
- ];
+ ];*/
}
this.tableData = response.data.list;
this.pageObj.total = response.data.total
@@ -362,38 +364,40 @@
let title = this.tools.customTableTitle;
let tableTitle = title.slice(0, this.tableTitle.length);
let tagTitle = title.slice(this.tableTitle.length, title.length);
- /*this.$get("/alert/script?pageNo=1&pageSize=-1").then(response => {
- this.scripts = response.data.list;
- this.getSelectableScripts();
- });*/
- let scripts = [
+ this.$get("/alert/script?pageNo=1&pageSize=-1").then(response => {
+ let scripts = response.data.list;
+ scripts = scripts.map(item => {
+ return {label: item.name, prop: 'tags', show: false, allowed: true, scriptId: item.id, type: "tag"};
+ });
+ let newTags = scripts.filter(item=>{ return !tagTitle.find(t =>{return item.label == t.label})});
+ let keepTags = tagTitle.filter(item=>{ return scripts.find(t =>{return item.label == t.label})});
+ keepTags.forEach(item => {
+ let script = scripts.find(t =>{return item.label == t.label});
+ item.scriptId = script.scriptId;
+ });
+ let result = tableTitle.concat([{label: this.$t("config.account.notification"), show: false, NotSet: true, type: 'title', prop:'table-tag'}]);
+
+ result = result.concat(keepTags).concat(newTags);
+ this.tools.customTableTitle = JSON.parse(JSON.stringify(result));
+ });
+ /*let scripts = [
{id: 1, name: "DOLBY"},
{id: 2, name: "IMAX"},
{id: 3, name: "CGS"},
{id: 4, name: "LUXE"},
{id: 5, name: "DST:X"},
- ];
- scripts = scripts.map(item => {
- return {label: item.name, prop: 'tags', show: false, allowed: true, scriptId: item.id, type: "tag"};
- });
- let newTags = scripts.filter(item=>{ return !tagTitle.find(t =>{return item.label == t.label})});
- let keepTags = tagTitle.filter(item=>{ return scripts.find(t =>{return item.label == t.label})});
- keepTags.forEach(item => {
- let script = scripts.find(t =>{return item.label == t.label});
- item.scriptId = script.scriptId;
- });
- let result = tableTitle.concat([{label: this.$t("config.account.notification"), show: false, NotSet: true, type: 'title', prop:'table-tag'}]);
-
- result = result.concat(keepTags).concat(newTags);
- this.tools.customTableTitle = JSON.parse(JSON.stringify(result));
+ ];*/
},
filterTags(scriptId, scope) {
- let notification = scope.row.notifications.find(item => {
- return scriptId === item.scriptId;
- });
- if (notification) {
- return notification.account;
- }
+ this.$nextTick(() => {
+ let notification = scope.row.notifications.find(item => {
+ return scriptId === item.scriptId;
+ });
+ if (notification) {
+ return notification.account;
+ }
+ })
+
}
},
computed: {