Quellcode durchsuchen

feat: #帮助内容重新对接

loki vor 3 Jahren
Ursprung
Commit
0c7f4bbe15

+ 8 - 3
src/api/help/info.js

@@ -1,10 +1,15 @@
 import api from '@/utils/request';
 
-export const getList = params =>
+export const getPage = params =>
 	api.post(`/yxl-back-end/framework/help/content/page`, params);
 export const getItem = ({ id, ...params }) =>
 	api.get(`/yxl-back-end/framework/help/content/${id}`, params);
-export const saveItem = params =>
-	api.post(`/yxl-back-end/framework/help/content/save`, params);
+export const saveItem = ({ id, ...params }) => {
+	if (id) {
+		return api.put(`/yxl-back-end/framework/help/content/${id}`, params);
+	} else {
+		return api.post(`/yxl-back-end/framework/help/content`, params);
+	}
+};
 export const delItem = ({ id, ...params }) =>
 	api.del(`/yxl-back-end/framework/help/content/${id}`, params);

+ 2 - 2
src/containers/issueType/IssueTypeSelect.vue

@@ -10,7 +10,7 @@
 </template>
 
 <script>
-import { getList } from '@/api/help/type';
+import { getPage } from '@/api/help/type';
 
 const resetList = (arr = []) => {
   const reuslt = arr.map(x => ({
@@ -67,7 +67,7 @@ export default {
     },
 
     async loadData() {
-      const { success, data, msg } = await getList({
+      const { success, data, msg } = await getPage({
         data: {
           isShow: null
         },

+ 7 - 7
src/views/helpInfo/information/index.vue

@@ -19,7 +19,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getList, delItem } from '@/api/help/info';
+import { getPage, delItem } from '@/api/help/info';
 
 export default {
   name: 'Information',
@@ -28,7 +28,7 @@ export default {
 
   mixins: [
     mxFilterList({
-      fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
+      fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
     })
   ],
 
@@ -38,29 +38,29 @@ export default {
         {
           key: 'helpGroupName',
           name: '分类名称',
-          width: '180',
+          width: this.$col.b,
           render: (h, { row }) =>
             h('span', `${row.parentHelpGroupName}/${row.helpGroupName}`)
         },
         {
           key: 'name',
           name: '标题',
-          minWidth: '160'
+          minWidth: this.$col.b
         },
         {
           key: 'sort',
           name: '排序',
-          width: '80'
+          width: this.$col.s
         },
         {
           key: 'createAt',
           name: '创建时间',
-          width: '140'
+          width: this.$col.b
         },
         {
           key: 'isShow',
           name: '状态',
-          width: '80',
+          width: this.$col.s,
           type: 'tag',
           fetchTagType: val => (val ? 'success' : 'info'),
           tagName: row => (row.isShow ? '显示' : '隐藏')

+ 4 - 4
src/views/helpInfo/issueType/index.vue

@@ -39,22 +39,22 @@ export default {
         {
           key: 'name',
           name: '分类名称',
-          minWidth: '180'
+          minWidth: this.$col.b
         },
         {
           key: 'sort',
           name: '排序',
-          width: '80'
+          width: this.$col.s
         },
         {
           key: 'createAt',
           name: '创建时间',
-          width: '140'
+          width: this.$col.b
         },
         {
           key: 'isShow',
           name: '状态',
-          width: '80',
+          width: this.$col.s,
           type: 'tag',
           fetchTagType: val => (val ? 'success' : 'info'),
           tagName: row => (row.isShow ? '显示' : '隐藏')