diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js
index 2ddd809f..a6c9a5b6 100644
--- a/frontend/src/i18n/zh.js
+++ b/frontend/src/i18n/zh.js
@@ -137,6 +137,7 @@ export default {
'Domain': '域名',
'Category': '类别',
'Select': '请选择',
+ 'Select Category': '请选择类别',
// 文件
'Choose Folder': '选择文件',
diff --git a/frontend/src/store/modules/site.js b/frontend/src/store/modules/site.js
index 496fedb5..2ffc392d 100644
--- a/frontend/src/store/modules/site.js
+++ b/frontend/src/store/modules/site.js
@@ -4,7 +4,9 @@ const state = {
tableData: [],
// filter
- filter: {},
+ filter: {
+ category: undefined
+ },
keyword: '',
// pagination
@@ -34,6 +36,12 @@ const mutations = {
}
const actions = {
+ editSite ({ state, dispatch }, payload) {
+ const { id, category } = payload
+ return request.post(`/sites/${id}`, {
+ category
+ })
+ },
getSiteList ({ state, commit }) {
return request.get('/sites', {
page_num: state.pageNum,
diff --git a/frontend/src/views/site/SiteList.vue b/frontend/src/views/site/SiteList.vue
index 4f15c36c..5358539f 100644
--- a/frontend/src/views/site/SiteList.vue
+++ b/frontend/src/views/site/SiteList.vue
@@ -7,6 +7,9 @@
class="filter-search"
v-model="keyword">
+
+
+
-
+
-
+
-
-
-
+
+
+
@@ -103,6 +108,7 @@ export default {
},
computed: {
...mapState('site', [
+ 'filter',
'tableData',
'totalCount'
]),
@@ -137,6 +143,12 @@ export default {
},
onPageChange () {
this.$store.dispatch('site/getSiteList')
+ },
+ onRowChange (row) {
+ this.$store.dispatch('site/editSite', {
+ id: row.domain,
+ category: row.category
+ })
}
},
created () {
@@ -154,6 +166,11 @@ export default {
width: 180px;
}
+ .filter .filter-category {
+ width: 180px;
+ margin-left: 20px;
+ }
+
.filter .btn {
margin-left: 20px;
}