w-ui-v1 1.1.36 → 1.1.37

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.
package/index.ts CHANGED
@@ -18,6 +18,7 @@ import WFormControlVue from './w-form-control/w-form-control.vue'
18
18
  import WScanBindingSensor from './w-scan-binding-sensor/w-scan-binding-sensor.vue'
19
19
  import WUpdateVersion from './w-update-version/w-update-version.vue'
20
20
  import WTree from './w-tree/w-tree.vue'
21
+ import WTreeAddTableVue from './w-tree-add-table/w-tree-add-table.vue'
21
22
  import {menu} from './utils/apis/menu'
22
23
  import request from './utils/http'
23
24
  import nfc from './utils/nfc'
@@ -43,7 +44,8 @@ const coms: any[] = [
43
44
  WFormControlVue,
44
45
  WScanBindingSensor,
45
46
  WUpdateVersion,
46
- WTree
47
+ WTree,
48
+ WTreeAddTableVue
47
49
  ]
48
50
  // 批量组件注册
49
51
  function install(Vue: App) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.36",
3
+ "version": "1.1.37",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
package/w-add/w-add.vue CHANGED
@@ -1,11 +1,4 @@
1
- <script lang="ts">
2
- //在自定义组件中使用 Wot Design Uni 组件时,需开启styleIsolation: 'shared'选项覆盖样式
3
- export default {
4
- options: {
5
- styleIsolation: 'shared'//使css :deep()生效
6
- }
7
- }
8
- </script>
1
+
9
2
  <template>
10
3
  <view>
11
4
  <view v-if="loading" style="height: 100px;display: flex;justify-content: center;align-items: center;">
@@ -73,7 +66,7 @@ import { changeLanguageConmon} from '../Locale'
73
66
  import wCard from '../w-card/w-card.vue'
74
67
  import wFromControl from '../w-form-control/w-form-control.vue'
75
68
  import { onLoad, onUnload } from '@dcloudio/uni-app'
76
- import { ref, defineProps, reactive, watch } from 'vue';
69
+ import { ref, defineProps, reactive, watch,onBeforeUpdate } from 'vue';
77
70
  import {
78
71
  addPageConfig,
79
72
  getEnum,
@@ -89,7 +82,7 @@ defineOptions({
89
82
  })
90
83
 
91
84
  interface Props {
92
- sourceId:string
85
+ sourceId?:string
93
86
  mainCode?:string
94
87
  }
95
88
 
@@ -116,6 +109,7 @@ onLoad((option: any) => {
116
109
  getPageConfig()
117
110
  })
118
111
 
112
+
119
113
  watch(checkboxvalue, (value) => {
120
114
 
121
115
  getSelectDataPxoy(value)
@@ -125,6 +119,12 @@ watch(checkboxvalue, (value) => {
125
119
 
126
120
  })
127
121
 
122
+ onBeforeUpdate(()=>{
123
+ console.log('ssss')
124
+ mainCode.value=props.mainCode
125
+ sourceId.value = props.sourceId
126
+ })
127
+
128
128
  onUnload(() => {
129
129
  // 取消监听勾选列表页面事件
130
130
  uni.$off('getCheckData')
@@ -270,7 +270,7 @@ if(form.value){
270
270
  })
271
271
 
272
272
  try {
273
- const res = await addPageDataSave(sourceId.value, null,data)
273
+ const res = await addPageDataSave(sourceId.value, mainCode.value,data)
274
274
  if (res.data.status === 'success') {
275
275
  toast.success(changeLanguageConmon("保存成功"))
276
276
  uni.navigateBack({
@@ -323,7 +323,7 @@ if(form.value){
323
323
  })
324
324
 
325
325
  try {
326
- const res = await addPageDataSave(sourceId.value, null,data)
326
+ const res = await addPageDataSave(sourceId.value, mainCode.value,data)
327
327
  if (res.data.status === 'success') {
328
328
  toast.success(changeLanguageConmon("保存成功"))
329
329
  uni.navigateBack({
@@ -370,7 +370,7 @@ if(form.value){
370
370
  })
371
371
 
372
372
  try {
373
- const res = await addPageDataSave(sourceId.value, null,data)
373
+ const res = await addPageDataSave(sourceId.value, mainCode.value,data)
374
374
  if (res.data.status === 'success') {
375
375
  toast.success(changeLanguageConmon("保存成功"))
376
376
  uni.navigateBack({
@@ -479,6 +479,7 @@ function addrow(key: any) {
479
479
  data.fields.forEach((subItem: any) => {
480
480
  t[subItem.id] = subItem.defaultValue || ''
481
481
  })
482
+
482
483
  model.value[key].push(t)
483
484
  }
484
485
  //删除一行
package/w-tree/w-tree.vue CHANGED
@@ -1,15 +1,17 @@
1
1
  <template>
2
- <wd-col-picker label="选择地址" v-model="value" :columns="columns" :column-change="columnChange" :display-format="displayFormat"
2
+ <wd-col-picker :label="treeConfigs.branchTitle" v-model="value" :columns="columns" :column-change="columnChange" :display-format="displayFormat"
3
3
  @confirm="handleConfirm"></wd-col-picker>
4
4
  </template>
5
5
 
6
6
  <script setup lang="ts">
7
- import { ref, reactive, defineOptions, onMounted,defineProps } from 'vue'
7
+ import { ref, reactive, defineOptions, onMounted,defineProps,defineEmits } from 'vue'
8
8
  import { treeConfigApi, treeDataApi,treeNodeDataApi } from '../utils/apis/tree'
9
9
  import { pageConfig } from '../utils/apis/pageConfig'
10
+ import {onLoad} from '@dcloudio/uni-app'
10
11
  defineOptions({
11
12
  name: 'WTree',
12
13
  })
14
+ const emits=defineEmits(["handleConfirm"])
13
15
  const value = ref<string[]>([])
14
16
  const sourceId = ref('')
15
17
  const columns = ref<any[]>([])
@@ -18,19 +20,16 @@
18
20
  branchTitle: "",
19
21
  id: "",
20
22
  rootGtmplId: '',
21
- primaryColumnId: ""
23
+ primaryColumnId: "",
24
+ leafRatmplId:''
22
25
  })
23
26
  // 定义 props 类型
24
27
  interface Props {
25
- sourceId: string
28
+ sourceId?: string,
26
29
  }
27
30
 
28
31
  const props=defineProps<Props>()
29
- onMounted(() => {
30
- sourceId.value=props.sourceId
31
- treeConfig1()
32
- })
33
-
32
+
34
33
  //获取配置1
35
34
  const treeConfig1 = async () => {
36
35
  try {
@@ -39,11 +38,18 @@
39
38
  treeConfigs.branchTitle = res.data.ttmplConfig.branchTitle
40
39
  treeConfigs.id = res.data.ttmplConfig.id
41
40
  treeConfigs.rootGtmplId = res.data.ttmplConfig.rootGtmplId
41
+ treeConfigs.leafRatmplId=res.data.ttmplConfig.leafRatmplId
42
42
  treeConfig2(treeConfigs.branchRatmplId)
43
43
  } catch (error) {
44
44
  //TODO handle the exception
45
45
  }
46
46
  }
47
+
48
+ onLoad((option:any) => {
49
+
50
+ sourceId.value=props.sourceId||option.sourceId
51
+ treeConfig1()
52
+ })
47
53
 
48
54
  //获取配置2
49
55
  const treeConfig2 = async (sourceId : string) => {
@@ -95,12 +101,19 @@
95
101
 
96
102
  }
97
103
 
98
- function handleConfirm({ value }) {
99
- console.log(value)
104
+ function handleConfirm(item:any) {
105
+ emits('handleConfirm',{
106
+ data:item,
107
+ leafRatmplId:treeConfigs.leafRatmplId
108
+ })
100
109
  }
101
110
  // 格式化方法
102
111
  const displayFormat = (selectedItems: Record<string, any>[]) => {
103
- return selectedItems[selectedItems.length - 2].label + '/' + selectedItems[selectedItems.length - 1].label
112
+ if(selectedItems.length){
113
+ return selectedItems[selectedItems.length - 2].label + '/' + selectedItems[selectedItems.length - 1].label
114
+ }else{
115
+
116
+ }
104
117
  }
105
118
  </script>
106
119
 
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <view >
3
+ <w-tree :handleConfirm="handleConfirm" @handleConfirm="handleConfirm"></w-tree>
4
+ <w-add :mainCode="mainCode" :sourceId="sourceId"></w-add>
5
+ </view>
6
+
7
+ </template>
8
+
9
+ <script lang="ts" setup>
10
+ import wTree from '../w-tree/w-tree.vue'
11
+ import wAdd from '../w-add/w-add.vue'
12
+ import {ref} from 'vue'
13
+ defineOptions({
14
+ name: 'WTreeAddTable',
15
+ })
16
+ const mainCode=ref('')
17
+ const sourceId=ref('')
18
+ const handleConfirm=(data:any)=>{
19
+ mainCode.value=data.data.value[data.data.value.length-1]
20
+ sourceId.value=data.leafRatmplId
21
+ }
22
+ </script>
23
+
24
+ <style>
25
+ </style>