李志伟 3 lat temu
rodzic
commit
f0f099a85b

+ 46
- 0
src/api/appApi.js Wyświetl plik

1
+import request from '@/utils/request'
2
+
3
+/**
4
+* 保存应用
5
+* @param {*} data 
6
+* @returns 
7
+*/
8
+export const saveApp = (data) => request({
9
+  url: '/admin/App',
10
+  method: 'post',
11
+  data
12
+})
13
+
14
+/**
15
+ * 应用列表
16
+ * @param {*} params 
17
+ * @returns 
18
+ */
19
+export const getAppList = (params) => request({
20
+  url: '/admin/App', params
21
+})
22
+
23
+/**
24
+ * 删除应用
25
+ * @param {*} data 
26
+ * @returns 
27
+ */
28
+export const deleteApp = (id) => request({
29
+  url: `/admin/App/${id}`, method: 'delete'
30
+})
31
+/**
32
+ * 更新应用
33
+ * @param {*} data 
34
+ * @returns 
35
+ */
36
+export const UpdateApp = (data, id) => request({
37
+  url: `/admin/App/${id}`, method: 'put', data
38
+})
39
+/**
40
+ * 查询应用详情
41
+ * @param {*} params 
42
+ * @returns 
43
+ */
44
+export const getAppDetail = (id) => request({
45
+  url: `/admin/App/${id}`
46
+})

+ 5
- 0
src/components/CharacterResult/index.vue Wyświetl plik

36
           />
36
           />
37
         </template>
37
         </template>
38
       </el-table-column>
38
       </el-table-column>
39
+      <el-table-column prop="createDate" label="创建时间">
40
+        <template slot-scope="scope">{{
41
+          scope.row.createDate.substr(0, 10)
42
+        }}</template>
43
+      </el-table-column>
39
       <el-table-column fixed="right" label="操作">
44
       <el-table-column fixed="right" label="操作">
40
         <template slot-scope="scope">
45
         <template slot-scope="scope">
41
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
46
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>

+ 2
- 2
src/main.js Wyświetl plik

29
 // }
29
 // }
30
 
30
 
31
 // set ElementUI lang to EN
31
 // set ElementUI lang to EN
32
-Vue.use(ElementUI, { locale })
32
+// Vue.use(ElementUI, { locale })
33
 // 如果想要中文版 element-ui,按如下方式声明
33
 // 如果想要中文版 element-ui,按如下方式声明
34
-// Vue.use(ElementUI)
34
+Vue.use(ElementUI)
35
 
35
 
36
 Vue.config.productionTip = false
36
 Vue.config.productionTip = false
37
 
37
 

+ 43
- 1
src/router/index.js Wyświetl plik

39
       path: 'dashboard',
39
       path: 'dashboard',
40
       name: 'Dashboard',
40
       name: 'Dashboard',
41
       component: () => import('@/views/dashboard/index'),
41
       component: () => import('@/views/dashboard/index'),
42
-      meta: { title: 'Dashboard', icon: 'dashboard' }
42
+      meta: { title: '首页', icon: 'dashboard' }
43
     }]
43
     }]
44
   },
44
   },
45
 
45
 
90
     ]
90
     ]
91
   },
91
   },
92
 
92
 
93
+  {
94
+    path: '/gameManage',
95
+    component: Layout,
96
+    name: '游戏管理',
97
+    meta: { title: '游戏管理', icon: 'form' },
98
+    children: [
99
+      {
100
+        path: 'gameManage',
101
+        name: '游戏列表',
102
+        component: () => import('@/views/gameManage/index'),
103
+        meta: { title: '游戏列表', icon: 'form' }
104
+      },
105
+      
106
+    ]
107
+  },
108
+  {
109
+    path: '/appManage',
110
+    component: Layout,
111
+    name: '应用管理',
112
+    meta: { title: '应用管理', icon: 'form' },
113
+    children: [
114
+      {
115
+        path: 'appManage',
116
+        name: '应用列表',
117
+        component: () => import('@/views/appManage/index'),
118
+        meta: { title: '应用列表', icon: 'form' }
119
+      },
120
+      {
121
+        path: 'appManage/add',
122
+        name: '新增应用',
123
+        component: () => import('@/views/appManage/add'),
124
+        // meta: { title: '新增应用', icon: 'form' }
125
+      },
126
+      {
127
+        path: 'appManage/edit',
128
+        name: '编辑应用',
129
+        component: () => import('@/views/appManage/edit'),
130
+        // meta: { title: '编辑应用', icon: 'form' }
131
+      }
132
+    ]
133
+  },
134
+
93
   {
135
   {
94
     path: '/login',
136
     path: '/login',
95
     component: () => import('@/views/login/index'),
137
     component: () => import('@/views/login/index'),

+ 45
- 0
src/views/appManage/add.vue Wyświetl plik

1
+<template>
2
+  <div class="body_edit">
3
+    <h2 style="text-align: center">应用新增</h2>
4
+        <el-form
5
+          ref="form"
6
+          :model="appForm"
7
+          label-width="150px"
8
+          size="mini"
9
+        >
10
+          <el-form-item label="应用名称:">
11
+            <el-input v-model="appForm.appName"></el-input>
12
+          </el-form-item>
13
+          <el-form-item class="editBottomItem">
14
+            <el-button type="primary" @click="onSubmit">添加</el-button>
15
+            <el-button @click="onCancel">取消</el-button>
16
+          </el-form-item>
17
+        </el-form>
18
+  </div>
19
+</template>
20
+<script>
21
+import { saveApp } from "@/api/appApi";
22
+export default {
23
+  data() {
24
+    return {
25
+      appForm: {
26
+        appName: undefined,
27
+      },
28
+    };
29
+  },
30
+
31
+  methods: {
32
+    onCancel() {
33
+      this.$router.go(-1);
34
+    },
35
+    onSubmit() {
36
+      saveApp(this.appForm).then((res) => {
37
+        this.$message("保存成功");
38
+        this.onCancel();
39
+      });
40
+    },
41
+  },
42
+};
43
+</script>
44
+<style>
45
+</style>

+ 53
- 0
src/views/appManage/edit.vue Wyświetl plik

1
+<template>
2
+  <div style="padding: 20px">
3
+    <el-form ref="form" :model="appForm" label-width="150px" size="mini">
4
+      <el-form-item label="特征库名称:">
5
+        <el-input v-model="appForm.appName"></el-input>
6
+      </el-form-item>
7
+      <el-form-item class="editBottomItem">
8
+        <el-button type="primary" @click="onEdit">修改</el-button>
9
+        <el-button @click="onCancel">取消</el-button>
10
+      </el-form-item>
11
+    </el-form>
12
+  </div>
13
+</template>
14
+<script>
15
+import { UpdateApp, getAppDetail } from "@/api/appApi";
16
+
17
+export default {
18
+  data() {
19
+    return {
20
+      appForm: {
21
+        appId: undefined,
22
+        appName: undefined,
23
+      },
24
+    };
25
+  },
26
+
27
+  methods: {
28
+    //上方实例库的方法
29
+    onCancel() {
30
+      this.$router.go(-1);
31
+    },
32
+    onEdit() {
33
+      UpdateApp(this.appForm, this.appForm.appId).then((res) => {
34
+        this.$message("修改成功");
35
+      });
36
+    },
37
+  },
38
+  //进入页面执行的方法
39
+  mounted: function () {
40
+    if (this.$route?.query.id) {
41
+      getAppDetail(this.$route.query.id).then((res) => {
42
+        this.appForm = res.data;
43
+      });
44
+    }
45
+  },
46
+};
47
+</script>
48
+<style>
49
+.editBottomItem > div {
50
+  margin: 0 !important;
51
+  text-align: center;
52
+}
53
+</style>

+ 104
- 0
src/views/appManage/index.vue Wyświetl plik

1
+<template>
2
+  <div class="body">
3
+    <el-card class="box-card">
4
+      应用名称:<el-input
5
+        v-model="appName"
6
+        size="medium"
7
+        style="width: 200px; margin-right: 20px"
8
+      />
9
+      创建时间:
10
+      <el-date-picker
11
+        v-model="daterange"
12
+        type="daterange"
13
+        range-separator="至"
14
+        start-placeholder="开始日期"
15
+        end-placeholder="结束日期"
16
+        value-format="yyyy-MM-dd"
17
+        @change="dateChange"
18
+        style="margin-right: 20px"
19
+      >
20
+      </el-date-picker>
21
+
22
+      <el-button type="primary" @click="onSearch">查询</el-button>
23
+      <el-button @click="onReset">重置</el-button>
24
+      <el-button type="primary" @click="handleAdd">添加应用</el-button>
25
+    </el-card>
26
+    <el-table stripe :data="tableData" border style="width: 100%">
27
+      <el-table-column prop="appName" label="应用名称" />
28
+      <el-table-column prop="createDate" label="创建时间">
29
+        <template slot-scope="scope">{{
30
+          scope.row.createDate.substr(0, 10)
31
+        }}</template>
32
+      </el-table-column>
33
+      <el-table-column fixed="right" label="操作">
34
+        <template slot-scope="scope">
35
+          <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
36
+          <el-popconfirm
37
+            icon="el-icon-info"
38
+            icon-color="red"
39
+            title="这个应用确定删除吗?"
40
+            @onConfirm="handleDelete(scope.row)"
41
+          >
42
+            <el-button type="text" slot="reference">删除</el-button>
43
+          </el-popconfirm>
44
+        </template>
45
+      </el-table-column>
46
+    </el-table>
47
+  </div>
48
+</template>
49
+<script>
50
+import { getAppList, deleteApp } from "@/api/appApi";
51
+
52
+export default {
53
+  data() {
54
+    return {
55
+      appName: undefined,
56
+      daterange: "",
57
+      tableData: [],
58
+      endDate: undefined,
59
+      startDate: undefined,
60
+    };
61
+  },
62
+  methods: {
63
+    handleAdd() {
64
+      this.$router.push({ path: "appManage/add" });
65
+    },
66
+    handleEdit(row) {
67
+      this.$router.push({
68
+        path: "appManage/edit",
69
+        query: { id: row.appId },
70
+      });
71
+    },
72
+    handleDelete(row) {
73
+      deleteApp(row.appId).then(() => {
74
+        this.onSearch();
75
+      });
76
+    },
77
+    onSearch() {
78
+      getAppList({
79
+        appName: this.appName,
80
+        startDate: this.startDate,
81
+        endDate: this.endDate,
82
+      }).then((res) => {
83
+        this.tableData = res.data.records;
84
+      });
85
+    },
86
+    onReset() {
87
+      this.appName = "";
88
+      this.daterange = "";
89
+      this.startDate = "";
90
+      this.endDate = "";
91
+      this.onSearch();
92
+    },
93
+    dateChange(val) {
94
+      this.startDate = this.daterange[0];
95
+      this.endDate = this.daterange[1];
96
+    },
97
+  },
98
+  mounted() {
99
+    this.onSearch();
100
+  },
101
+};
102
+</script>
103
+<style>
104
+</style>

+ 6
- 2
src/views/characterLibManage/add.vue Wyświetl plik

19
             <el-input type="textarea" v-model="characterLib.remark"></el-input>
19
             <el-input type="textarea" v-model="characterLib.remark"></el-input>
20
           </el-form-item>
20
           </el-form-item>
21
 
21
 
22
-          <el-form-item>
22
+          <el-form-item class="editBottomItem">
23
             <el-button type="primary" @click="onSubmit">添加</el-button>
23
             <el-button type="primary" @click="onSubmit">添加</el-button>
24
             <el-button @click="onCancel">取消</el-button>
24
             <el-button @click="onCancel">取消</el-button>
25
           </el-form-item>
25
           </el-form-item>
26
         </el-form>
26
         </el-form>
27
       </el-col>
27
       </el-col>
28
       <el-col :span="5">
28
       <el-col :span="5">
29
-        特征词列表        
29
+        特征词列表
30
         <TagComponents
30
         <TagComponents
31
           :value="characterLib.wordList"
31
           :value="characterLib.wordList"
32
           @handleDelete="handleDelete"
32
           @handleDelete="handleDelete"
87
 };
87
 };
88
 </script>
88
 </script>
89
 <style>
89
 <style>
90
+.editBottomItem > div {
91
+  margin: 0 !important;
92
+  text-align: center;
93
+}
90
 </style>
94
 </style>

+ 5
- 1
src/views/characterLibManage/edit.vue Wyświetl plik

22
                   v-model="characterLib.remark"
22
                   v-model="characterLib.remark"
23
                 ></el-input>
23
                 ></el-input>
24
               </el-form-item>
24
               </el-form-item>
25
-              <el-form-item>
25
+              <el-form-item class="editBottomItem" >
26
                 <el-button type="primary" @click="onEdit">修改</el-button>
26
                 <el-button type="primary" @click="onEdit">修改</el-button>
27
                 <el-button @click="onCancel">取消</el-button>
27
                 <el-button @click="onCancel">取消</el-button>
28
               </el-form-item>
28
               </el-form-item>
182
 };
182
 };
183
 </script>
183
 </script>
184
 <style>
184
 <style>
185
+.editBottomItem>div{
186
+  margin: 0 !important;
187
+  text-align: center;
188
+}
185
 </style>
189
 </style>

+ 19
- 9
src/views/characterLibManage/index.vue Wyświetl plik

3
     <el-card class="box-card">
3
     <el-card class="box-card">
4
       特征库名称:<el-input
4
       特征库名称:<el-input
5
         v-model="name"
5
         v-model="name"
6
-        size='medium'
6
+        size="medium"
7
         style="width: 200px; margin-right: 20px"
7
         style="width: 200px; margin-right: 20px"
8
       />
8
       />
9
       创建时间:
9
       创建时间:
15
         end-placeholder="结束日期"
15
         end-placeholder="结束日期"
16
         value-format="yyyy-MM-dd"
16
         value-format="yyyy-MM-dd"
17
         @change="dateChange"
17
         @change="dateChange"
18
+        style="margin-right: 20px"
18
       >
19
       >
19
       </el-date-picker>
20
       </el-date-picker>
20
 
21
 
29
           <el-image :src="scope.row.icon" style="width: 100px; height: 100px" />
30
           <el-image :src="scope.row.icon" style="width: 100px; height: 100px" />
30
         </template>
31
         </template>
31
       </el-table-column>
32
       </el-table-column>
33
+      <el-table-column prop="createDate" label="创建时间">
34
+        <template slot-scope="scope">{{
35
+          scope.row.createDate.substr(0, 10)
36
+        }}</template>
37
+      </el-table-column>
32
       <el-table-column fixed="right" label="操作">
38
       <el-table-column fixed="right" label="操作">
33
         <template slot-scope="scope">
39
         <template slot-scope="scope">
34
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
40
           <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
52
   data() {
58
   data() {
53
     return {
59
     return {
54
       name: undefined,
60
       name: undefined,
55
-      daterange:'',
61
+      daterange: "",
56
       tableData: [],
62
       tableData: [],
57
-      endDate:undefined,
58
-      startDate:undefined
63
+      endDate: undefined,
64
+      startDate: undefined,
59
     };
65
     };
60
   },
66
   },
61
   methods: {
67
   methods: {
74
       });
80
       });
75
     },
81
     },
76
     onSearch() {
82
     onSearch() {
77
-      getCharacterLibList({ name: this.name,startDate:this.startDate,endDate:this.endDate }).then((res) => {
83
+      getCharacterLibList({
84
+        name: this.name,
85
+        startDate: this.startDate,
86
+        endDate: this.endDate,
87
+      }).then((res) => {
78
         this.tableData = res.data.records;
88
         this.tableData = res.data.records;
79
       });
89
       });
80
     },
90
     },
85
       this.endDate = "";
95
       this.endDate = "";
86
       this.onSearch();
96
       this.onSearch();
87
     },
97
     },
88
-    dateChange(val){
89
-      this.startDate=this.daterange[0]
90
-      this.endDate=this.daterange[1]
91
-    }
98
+    dateChange(val) {
99
+      this.startDate = this.daterange[0];
100
+      this.endDate = this.daterange[1];
101
+    },
92
   },
102
   },
93
   mounted() {
103
   mounted() {
94
     this.onSearch();
104
     this.onSearch();

+ 7
- 0
src/views/gameManage/index.vue Wyświetl plik

1
+<template>
2
+<div>游戏列表</div>
3
+</template>
4
+<script>
5
+</script>
6
+<style>
7
+</style>