widget.qw 0.0.1 → 1.0.0

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.
Files changed (41) hide show
  1. package/build/style.css +101 -0
  2. package/build/widget.qw.es.js +639 -236
  3. package/build/widget.qw.umd.js +639 -236
  4. package/package.json +1 -1
  5. package/src/api/index.js +16 -0
  6. package/src/components/CascaderPicker.vue +107 -0
  7. package/src/components/index.js +35 -30
  8. package/src/components/widget/CascaderPop.vue +313 -0
  9. package/src/main.js +2 -2
  10. package/src/router/index.ts +5 -0
  11. package/src/util/tree_util.js +34 -0
  12. package/src/views/auditbar/index.vue +1 -1
  13. package/src/views/billcard/index.vue +1 -1
  14. package/src/views/cascaderpicker/index.vue +86 -0
  15. package/src/views/checkgroup/index.vue +1 -1
  16. package/src/views/dataSelector/index.vue +2 -2
  17. package/src/views/datetimepicker/index.vue +1 -1
  18. package/src/views/daydropdown/index.vue +1 -1
  19. package/src/views/filepicker/index.vue +1 -1
  20. package/src/views/home/index.vue +1 -0
  21. package/src/views/imagepicker/index.vue +1 -1
  22. package/src/views/imagespicker/index.vue +1 -1
  23. package/src/views/input/index.vue +1 -1
  24. package/src/views/monthdropdown/index.vue +1 -1
  25. package/src/views/multListSelector/index.vue +1 -1
  26. package/src/views/multipicker/index.vue +1 -1
  27. package/src/views/productSelector/index.vue +1 -1
  28. package/src/views/projectdropdown/index.vue +1 -1
  29. package/src/views/projectpicker/index.vue +1 -1
  30. package/src/views/sheet/index.vue +4 -4
  31. package/src/views/singlepicker/index.vue +1 -1
  32. package/src/views/subdepartmentSelector/index.vue +1 -1
  33. package/src/views/switch/index.vue +1 -1
  34. package/src/views/treepicker/index.vue +1 -1
  35. package/src/views/userSelector/index.vue +3 -3
  36. package/src/views/userSelectorNew/index.vue +1 -1
  37. package/src/views/userpicker/index.vue +1 -1
  38. package/src/views/userprofile/index.vue +1 -1
  39. package/src/views/userspicker/index.vue +1 -1
  40. package/src/views/yeardropdown/index.vue +1 -1
  41. package/vite.config.ts +2 -2
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div class="page">
3
+ <widget-qw-cascader-picker v-model="data.id" label="零件" placeholder="请选择零件"
4
+ :queryNodes="queryNodes"
5
+ :queryNode="queryNode"
6
+ :auth="data.auth" />
7
+ </div>
8
+ </template>
9
+
10
+ <script setup>
11
+ import { onMounted, reactive, watch } from "vue";
12
+ import util from '@/util'
13
+
14
+ const data = reactive({
15
+ auth: 'require',
16
+ id: '',
17
+ projectId:'GnsMl3mO'
18
+ })
19
+
20
+ const queryNodes = async (params,setNodes) => {
21
+ if (!data.projectId)
22
+ return
23
+
24
+ let p = {
25
+ projectId: data.projectId,
26
+ hasChildren: false
27
+ }
28
+
29
+ if(params.keyword)
30
+ p.keyword = params.keyword
31
+
32
+ if(params.parentId)
33
+ p.parentId = params.parentId
34
+
35
+ let res = await util.part_children(p)
36
+ if (res.code != 200)
37
+ return
38
+
39
+ let formatNodes = res.data.map(item=>{
40
+ return {
41
+ id:item.id,
42
+ label: item.formatName,
43
+ formatLabel: item.path,
44
+ hasChildren: item.hasChildren,
45
+ data: item
46
+ }
47
+ })
48
+ setNodes(formatNodes)
49
+ }
50
+
51
+ const queryNode=async(setNode)=>{
52
+ let params={
53
+ id:data.id
54
+ }
55
+ let res = await util.part_detail(params)
56
+ if(res.code!=200)
57
+ return
58
+
59
+ let formatNode = {
60
+ id:res.data.id,
61
+ label: res.data.formatName,
62
+ formatLabel: item.path,
63
+ hasChildren: res.data.hasChildren,
64
+ data:res.data
65
+ }
66
+ setNode(formatNode)
67
+ }
68
+
69
+ watch(() => data.id, (newVal, oldVal) => {
70
+ console.log(newVal, oldVal)
71
+ })
72
+ </script>
73
+
74
+ <style lang="scss" scoped>
75
+ .page {
76
+ height: 100vh;
77
+ background: #fff;
78
+ text-align: center;
79
+ background-size: cover;
80
+ display: flex;
81
+ flex-direction: column;
82
+ justify-content: flex-start;
83
+ padding: 80px 15px 0 15px;
84
+ box-sizing: border-box;
85
+ }
86
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-check-group
3
+ <widget-qw-check-group
4
4
  v-model="data.codes"
5
5
  id="fire_builder_checks"
6
6
  label="船舶建造师确认内容"
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-data-selector :options="options" v-model="formData.singleSelect" mode="single" label="单选数据"
3
+ <widget-qw-data-selector :options="options" v-model="formData.singleSelect" mode="single" label="单选数据"
4
4
  placeholder="单选数据" :auth="formData.auth" />
5
- <uiqw-data-selector :options="options" v-model="formData.multSelect" mode="multiple" label="多选数据"
5
+ <widget-qw-data-selector :options="options" v-model="formData.multSelect" mode="multiple" label="多选数据"
6
6
  placeholder="多选数据" :required="true" :readonly="false" />
7
7
  </div>
8
8
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwDatetimePicker
3
+ <WidgetQwDatetimePicker
4
4
  v-model="data.date"
5
5
  label="时间"
6
6
  :auth="data.auth" />
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="page">
3
3
  <van-dropdown-menu>
4
- <uiqw-day-dropdown v-model="formData.day" year="2025" month="2" />
4
+ <widget-qw-day-dropdown v-model="formData.day" year="2025" month="2" />
5
5
  </van-dropdown-menu>
6
6
  </div>
7
7
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-file-picker label="文件" v-model="data.url" :auth="data.auth" accept=".xls,.xlsx" />
3
+ <widget-qw-file-picker label="文件" v-model="data.url" :auth="data.auth" accept=".xls,.xlsx" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -32,6 +32,7 @@
32
32
  <van-button class="btn" type="primary" @click="router.push('/switch')">开关</van-button>
33
33
  <van-button class="btn" type="primary" @click="router.push('/sheet')">表格</van-button>
34
34
  <van-button class="btn" type="primary" @click="router.push('/treepicker')">树选择器</van-button>
35
+ <van-button class="btn" type="primary" @click="router.push('/cascaderpicker')">级联选择器</van-button>
35
36
  </div>
36
37
  </template>
37
38
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-image-picker label="图片" v-model="data.url" :auth="data.auth" />
3
+ <widget-qw-image-picker label="图片" v-model="data.url" :auth="data.auth" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-images-picker label="图片列表" v-model="data.urls" :auth="data.auth" />
3
+ <widget-qw-images-picker label="图片列表" v-model="data.urls" :auth="data.auth" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-input label="单号" v-model="data.text" :auth="data.auth" :type="data.type" :rows="data.rows" :autosize="data.autosize" />
3
+ <widget-qw--input label="单号" v-model="data.text" :auth="data.auth" :type="data.type" :rows="data.rows" :autosize="data.autosize" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="page">
3
3
  <van-dropdown-menu>
4
- <uiqw-month-dropdown v-model="formData.month" />
4
+ <widget-qw-month-dropdown v-model="formData.month" />
5
5
  </van-dropdown-menu>
6
6
  </div>
7
7
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-mult-list-selector
3
+ <widget-qw-mult-list-selector
4
4
  v-model="formData.safetyConfirmations"
5
5
  :options="safetyConfirmationOptions"
6
6
  :tips="'根据现场实际情况勾选条目'"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-multi-picker
3
+ <widget-qw-multi-picker
4
4
  v-model="data.codes"
5
5
  id="fire_accident_types"
6
6
  label="事故类型"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-product-selector
3
+ <widget-qw-product-selector
4
4
  v-model="formData.productInfo"
5
5
  :required="true"
6
6
  :rules="[{ required: true, message: '请选择产品信息' }]"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="page">
3
3
  <van-dropdown-menu>
4
- <uiqw-project-dropdown v-model="formData.id" />
4
+ <widget-qw-project-dropdown v-model="formData.id" />
5
5
  </van-dropdown-menu>
6
6
  </div>
7
7
  </template>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwProjectPicker
3
+ <WidgetQwProjectPicker
4
4
  v-model="formData.code"
5
5
  label="项目"
6
6
  :auth="formData.auth"
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-sheet v-model="data.datas" :auth="data.auth" label="子表">
3
+ <widget-qw-sheet v-model="data.datas" :auth="data.auth" label="子表">
4
4
  <template #item="{item}">
5
- <uiqw-input label="姓名" v-model="item.name" :auth="data.auth" />
6
- <uiqw-input label="年龄" v-model="item.age" :auth="data.auth" />
7
- <uiqw-datetime-picker v-model="item.detectionTime" label="检测时间" placeholder="请选择检测时间" :auth="data.auth" />
5
+ <widget-qw-input label="姓名" v-model="item.name" :auth="data.auth" />
6
+ <widget-qw-input label="年龄" v-model="item.age" :auth="data.auth" />
7
+ <widget-qw-datetime-picker v-model="item.detectionTime" label="检测时间" placeholder="请选择检测时间" :auth="data.auth" />
8
8
  </template>
9
9
  </uiqw-sheet>
10
10
  </div>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwSinglePicker
3
+ <WidgetQwSinglePicker
4
4
  v-model="data.code"
5
5
  id="danger_level"
6
6
  label="隐患等级"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-subdepartment-selector label="责任部门"
3
+ <widget-qw-subdepartment-selector label="责任部门"
4
4
  v-model="formData.departmentId"
5
5
  :deptRangeId = "formData.deptRangeId"
6
6
  :rules="[{ required: true, message: '请选择责任部门' }]"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-switch
3
+ <widget-qw-switch
4
4
  v-model="data.isChecked"
5
5
  label="是否动火"
6
6
  :auth="data.auth" />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwTreePicker
3
+ <WidgetQwTreePicker
4
4
  label="访问区域"
5
5
  placeholder="请选择访问区域"
6
6
  :auth="formData.auth"
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-user-selector v-model="formData.singleUser"
3
+ <widget-qw-user-selector v-model="formData.singleUser"
4
4
  label="单选人员"
5
5
  mode="single"
6
6
  :auth="formData.auth"
7
7
  @select="onSelect" />
8
8
 
9
- <uiqw-user-selector v-model="formData.multUser"
9
+ <widget-qw-user-selector v-model="formData.multUser"
10
10
  label="多选人员"
11
11
  mode="multiple"
12
12
  :required="true"
13
13
  :rules="[{ required: true, message: '请选择人员' }]"
14
14
  :readonly="false" />
15
15
 
16
- <uiqw-user-selector v-model="formData.singleUser"
16
+ <widget-qw-user-selector v-model="formData.singleUser"
17
17
  label="指定部门下的人员"
18
18
  mode="single"
19
19
  :required="true"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwSingleUserSelector
3
+ <WidgetQwSingleUserSelector
4
4
  :auth="formData.auth"
5
5
  :deptRangeId="formData.deptRangeId"
6
6
  v-model="formData.singleUser"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwUserPicker
3
+ <WidgetQwUserPicker
4
4
  :auth="formData.auth"
5
5
  v-model="formData.userId"
6
6
  @select="onSelect"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <uiqw-user-profile @logout="onLogout" />
3
+ <widget-qw-user-profile @logout="onLogout" />
4
4
  </div>
5
5
  </template>
6
6
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="page">
3
- <UiqwUsersPicker
3
+ <WidgetQwUsersPicker
4
4
  :auth="formData.auth"
5
5
  :deptRangeId="formData.deptRangeId"
6
6
  v-model="formData.userIds"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="page">
3
3
  <van-dropdown-menu>
4
- <uiqw-year-dropdown v-model="formData.year" startYear="2020" />
4
+ <widget-qw-year-dropdown v-model="formData.year" startYear="2020" />
5
5
  </van-dropdown-menu>
6
6
 
7
7
  </div>
package/vite.config.ts CHANGED
@@ -40,8 +40,8 @@ export default {
40
40
  VUE_APP_NEED_LOGIN_CODE: 401,
41
41
  //注意:发布时 VUE_APP_IS_DEBUG必须配置为false
42
42
  // 本地开发时 VUE_APP_IS_DEBUG必须配置为true
43
- VUE_APP_IS_DEBUG: false,
44
- // VUE_APP_IS_DEBUG: true,
43
+ // VUE_APP_IS_DEBUG: false,
44
+ VUE_APP_IS_DEBUG: true,
45
45
  VUE_APP_DEBUG_TOKEN: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiIwMTQzOTEiLCJyblN0ciI6ImZ0ejhnaFpLMWR4ejhnOTFDZkJUMXQxVWNJajF3R3c1In0.tgI4iGOJ8OrjoqWIqC2pjH7J52l6H7wyuUwJATKIVns'
46
46
  },
47
47
  },