@netang/quasar 0.0.52 → 0.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,7 @@ export default {
53
53
  function onDialog() {
54
54
 
55
55
  // 创建对话框
56
- $n.$dialog.create({
56
+ $n.dialog.create({
57
57
  // 标题
58
58
  title: props.title,
59
59
  // 宽
@@ -329,7 +329,7 @@ export default {
329
329
 
330
330
 
331
331
  // 创建权限实例
332
- const $power = $n.$power.create({
332
+ const $power = $n.power.create({
333
333
  // 路由路径
334
334
  path: $n.isValidString(props.path) ? props.path : false,
335
335
  // 路由参数
@@ -344,7 +344,7 @@ export default {
344
344
  } = $power
345
345
 
346
346
  // 创建表格实例
347
- const $table = $n.$table.create({
347
+ const $table = $n.table.create({
348
348
  // 权限实例
349
349
  $power,
350
350
  // 附加请求数据
@@ -760,7 +760,7 @@ export default {
760
760
  // 如果有路由路径
761
761
  } else if (routePath) {
762
762
  // 否则如果有路由表格列数据
763
- const rawTableColumns = $n.$table.config(routePath, 'columns')
763
+ const rawTableColumns = $n.table.config(routePath, 'columns')
764
764
  if ($n.isValidArray(rawTableColumns)) {
765
765
  columns = $n.cloneDeep(rawTableColumns)
766
766
  }
@@ -48,7 +48,7 @@ export default {
48
48
  submit,
49
49
  // 父级声明属性
50
50
  props,
51
- } = $n.$dialog.inject()
51
+ } = $n.dialog.inject()
52
52
 
53
53
  const {
54
54
  // 树节点列表
@@ -90,7 +90,7 @@ export default {
90
90
  const uploadFileLists = ref([])
91
91
 
92
92
  // 创建上传器
93
- const uploader = $n.$uploader.create({
93
+ const uploader = $n.uploader.create({
94
94
  type: props.type,
95
95
  // 声明属性
96
96
  props,
@@ -0,0 +1,32 @@
1
+ import path from 'path'
2
+ import { defineUserConfig } from '@vuepress/cli'
3
+
4
+ export default defineUserConfig({
5
+ // 站点的标题
6
+ title: 'netang-quasar',
7
+ // 部署站点的基础路径
8
+ base: '/netang-quasar/docs/dist',
9
+ // 打包目录
10
+ dest: path.join(__dirname, '../../dist'),
11
+
12
+ themeConfig: {
13
+ nav:[
14
+ {
15
+ text: 'components 组件',
16
+ link: '/components/',
17
+ items: [
18
+ {text: 'FieldTable 下拉表格', link: '/field-table'},
19
+ {text: 'FieldTree 下拉树', link: '/field-tree'},
20
+ ]
21
+ },
22
+ {
23
+ text: 'utils 工具',
24
+ link: '/utils/',
25
+ items: [
26
+ {text: 'confirm 确认框', link: '/confirm'},
27
+ {text: 'alert 提示框', link: '/alert'},
28
+ ]
29
+ },
30
+ ]
31
+ }
32
+ })
@@ -0,0 +1 @@
1
+ # table
@@ -0,0 +1 @@
1
+ # tree
@@ -0,0 +1 @@
1
+ # homepage
@@ -0,0 +1 @@
1
+ # alert
@@ -0,0 +1 @@
1
+ # confirm
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@netang/quasar/docs",
3
+ "private": true,
4
+ "scripts": {
5
+ "docs:dev": "vuepress dev docs",
6
+ "docs:build": "vuepress build docs"
7
+ },
8
+ "devDependencies": {
9
+ "vuepress": "^2.0.0-beta.60"
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -379,7 +379,7 @@ async function getInfo(params) {
379
379
  return res
380
380
  }
381
381
 
382
- $n.$area = {
382
+ $n.area = {
383
383
  // 获取数据
384
384
  getData,
385
385
  // 获取详情
@@ -117,7 +117,7 @@ function logout() {
117
117
  /**
118
118
  * 鉴权业务
119
119
  */
120
- $n.$auth = {
120
+ $n.auth = {
121
121
  // 是否登录
122
122
  isLogin,
123
123
  // 登录后更新数据
@@ -35,7 +35,7 @@ function onInject() {
35
35
  /**
36
36
  * 对话框业务
37
37
  */
38
- $n.$dialog = {
38
+ $n.dialog = {
39
39
  // 创建对话框
40
40
  create,
41
41
  // 获取对话框注入数据
@@ -46,7 +46,7 @@ function create(params) {
46
46
  /**
47
47
  * 业务表单
48
48
  */
49
- $n.$form = {
49
+ $n.form = {
50
50
  // 创建表单
51
51
  create,
52
52
  }
package/utils/http.js CHANGED
@@ -95,8 +95,8 @@ $n.http = createHttp({
95
95
  if (para.token) {
96
96
 
97
97
  // 如果已登录
98
- if ($n.$auth.isLogin()) {
99
- const { token } = $n.$auth.getAdminUserInfo()
98
+ if ($n.auth.isLogin()) {
99
+ const { token } = $n.auth.getAdminUserInfo()
100
100
 
101
101
  // 头部添加鉴权认证
102
102
  options.headers.Authorization = token
@@ -109,7 +109,7 @@ $n.http = createHttp({
109
109
 
110
110
  // 否则未登录 && 如果开启强制登录, 则跳转登录页面
111
111
  } else if (para.login) {
112
- $n.$auth.pushLogin()
112
+ $n.auth.pushLogin()
113
113
  return false
114
114
  }
115
115
  }
@@ -127,7 +127,7 @@ $n.http = createHttp({
127
127
  // 如果请求成功
128
128
  if (res.status && para.checkCode && para.token) {
129
129
  // 设置权限数据
130
- $n.$power.setData($n.get(res, 'response.data.power'))
130
+ $n.power.setData($n.get(res, 'response.data.power'))
131
131
  }
132
132
 
133
133
  return res
@@ -240,10 +240,10 @@ $n.http = createHttp({
240
240
  })
241
241
 
242
242
  // 退出登录
243
- $n.$auth.logout()
243
+ $n.auth.logout()
244
244
 
245
245
  // 跳转登录页面
246
- $n.$auth.pushLogin()
246
+ $n.auth.pushLogin()
247
247
 
248
248
  return false
249
249
  }
@@ -1106,7 +1106,7 @@ function getPageData($route) {
1106
1106
  /**
1107
1107
  * 权限业务
1108
1108
  */
1109
- $n.$power = {
1109
+ $n.power = {
1110
1110
  // 创建
1111
1111
  create,
1112
1112
  // 设置权限数据
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 验证规则(用于表单验证)
3
3
  */
4
- $n.$rule = function (rule) {
4
+ $n.rule = function (rule) {
5
5
  return function(value) {
6
6
  const res = $n.validate(value, 'data', rule, '', '该值')
7
7
  if (res) {
@@ -10,7 +10,7 @@ $n.$rule = function (rule) {
10
10
  }
11
11
  }
12
12
 
13
- $n.$ruleValid = function (rule) {
13
+ $n.ruleValid = function (rule) {
14
14
  return function(value) {
15
15
  return ! $n.validate(value, 'data', rule, '', '该值')
16
16
  }
@@ -338,7 +338,7 @@ async function getOptions(rawSearchOptions, format) {
338
338
  newItem.tree.nodes = await $n.runAsync(newItem.tree.nodes)()
339
339
  }
340
340
 
341
- // 如果有表格选项(调用的是 <n-field-table> 组件)
341
+ // 如果有表格选项(调用的是 <n-field-table.md> 组件)
342
342
  } else if ($n.has(newItem, 'table')) {
343
343
  newItem.searchType = 'table'
344
344
  newItem.table = Object.assign({
@@ -469,7 +469,7 @@ function formatValue(rawSearchOptions, searchValue) {
469
469
  /**
470
470
  * 搜素业务
471
471
  */
472
- $n.$search = {
472
+ $n.search = {
473
473
  // 获取原始值
474
474
  getRawData,
475
475
  // 获取参数
@@ -254,7 +254,7 @@ function create(params) {
254
254
  // 首次表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
255
255
  firstTableSearchValue,
256
256
  // 表格搜索值(如果表格搜索参数中带了初始值, 则设置初始值)
257
- } = $n.$search.getRawData(tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
257
+ } = $n.search.getRawData(tableColumns, Object.assign({}, $route.query), o.searchFromQuery)
258
258
 
259
259
  // 表格搜索数据值
260
260
  const tableSearchValue = ref($route.fullPath ? firstTableSearchValue : [])
@@ -275,7 +275,7 @@ function create(params) {
275
275
  const lists = []
276
276
 
277
277
  // 先格式化权限按钮列表
278
- $n.forEach($n.$power.formatBtns($power.powerBtns.value), function(item) {
278
+ $n.forEach($n.power.formatBtns($power.powerBtns.value), function(item) {
279
279
 
280
280
  // 如果是固定按钮
281
281
  if (item.fixed) {
@@ -641,7 +641,7 @@ function create(params) {
641
641
  })
642
642
 
643
643
  // 获取搜索值
644
- const search = $n.$search.formatValue(rawSearchOptions, tableSearchValue.value)
644
+ const search = $n.search.formatValue(rawSearchOptions, tableSearchValue.value)
645
645
  if ($n.isValidArray(search)) {
646
646
  data.n_search = $n.has(data, 'n_search') ? $n.concat(data.n_search, search) : search
647
647
  }
@@ -841,14 +841,14 @@ function create(params) {
841
841
  * 设置表格搜索参数
842
842
  */
843
843
  async function setTableSearchOptions(format) {
844
- tableSearchOptions.value = await $n.$search.getOptions(rawSearchOptions, format)
844
+ tableSearchOptions.value = await $n.search.getOptions(rawSearchOptions, format)
845
845
  }
846
846
 
847
847
  /**
848
848
  * 是否有表格搜索值
849
849
  */
850
850
  function hasTableSearchValue() {
851
- return !! $n.$search.formatValue(rawSearchOptions, tableSearchValue.value).length
851
+ return !! $n.search.formatValue(rawSearchOptions, tableSearchValue.value).length
852
852
  }
853
853
 
854
854
  // 如果开启搜索
@@ -957,7 +957,7 @@ function config(routePath, path, defaultValue) {
957
957
  /**
958
958
  * 业务表格
959
959
  */
960
- $n.$table = {
960
+ $n.table = {
961
961
  // 创建表格
962
962
  create,
963
963
  // 获取表格配置
@@ -278,7 +278,7 @@ function create(params) {
278
278
  }
279
279
 
280
280
  // 创建对话框
281
- $n.$dialog.create({
281
+ $n.dialog.create({
282
282
  // 标题
283
283
  title: `移动至节点的${o.type === 'moveUp' ? '上方' : (o.type === 'moveDown' ? '下方' : '内部')}`,
284
284
  // 宽度
@@ -676,7 +676,7 @@ function create(params) {
676
676
  /**
677
677
  * 树业务
678
678
  */
679
- $n.$tree = {
679
+ $n.tree = {
680
680
  // 创建树实例
681
681
  create,
682
682
  }
@@ -1023,7 +1023,7 @@ function create(params) {
1023
1023
  /**
1024
1024
  * 上传器
1025
1025
  */
1026
- $n.$uploader = {
1026
+ $n.uploader = {
1027
1027
  // 创建对话框
1028
1028
  create,
1029
1029
  }