ZaiZai 1 an în urmă
părinte
comite
ab2adff43d
2 a modificat fișierele cu 17 adăugiri și 14 ștergeri
  1. 14 0
      src/api/modules/other.js
  2. 3 14
      src/utils/tools.js

+ 14 - 0
src/api/modules/other.js

@@ -11,3 +11,17 @@ export const getRemixicon = () => HcApi({
     url: 'plugins/remixicon/remixicon.css?time=' + new Date().getTime(),
     method: 'get',
 }, false)
+
+//获取字典数据
+export const getDictionary = (form, msg = true) => HcApi({
+    url: '/api/blade-system/dict/dictionary',
+    method: 'get',
+    params: form,
+}, msg)
+
+//获取系统字典数据
+export const getBizDictionary = (form, msg = true) => HcApi({
+    url: '/api/blade-system/dict-biz/dictionary',
+    method: 'get',
+    params: form,
+}, msg)

+ 3 - 14
src/utils/tools.js

@@ -1,16 +1,5 @@
-import { nextTick } from 'vue'
 import { getArrValue } from 'js-fast-way'
-//import { getBizDictionary, getDictionary } from '~api/other'
-
-//设置分割滑块
-export const setSplit = (ids, data) => {
-    //配置参考: https://split.js.org/#/?direction=vertical&snapOffset=0
-    nextTick(() => {
-        setTimeout(() => {
-            window.$split(ids, data)
-        }, 300)
-    }).then()
-}
+import { getBizDictionary, getDictionary } from '~api/other'
 
 //刷新页面
 export const reloadPage = () => {
@@ -32,7 +21,7 @@ export const isNumberReg = (text, lose = true) => {
 
 //获取字典数据
 export const getDictionaryData = async (code, biz = false) => {
-    /*let res = []
+    let res = []
     if (biz) {
         const { data } = await getBizDictionary({ code: code })
         res = getArrValue(data)
@@ -48,7 +37,7 @@ export const getDictionaryData = async (code, biz = false) => {
             value: Number(res[i]['dictKey']),
         })
     }
-    return newArr*/
+    return newArr
 }
 
 //判断是否为网址