uni-oaview 1.0.9 → 1.0.11

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.
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <view style="display: flex; align-items: center">
3
+ <uni-rate v-bind="$attrs" disabledColor="#ffca3e" :value="modelValue" @update:modelValue="updateHandler" />
4
+ <span class="rank" :class="{ perfect: +innerValue > 2 }">{{ rankDesc }}</span>
5
+ </view>
6
+ </template>
7
+
8
+ <script lang="ts" setup>
9
+ import { computed, ref, watch } from 'vue';
10
+ const RANK_CONTANTS = ['', '非常差', '差', '一般', '满意', '超赞'];
11
+ const props = defineProps({
12
+ modelValue: {
13
+ type: [Number, String],
14
+ default: 0,
15
+ },
16
+ });
17
+ const innerValue = ref(props.modelValue);
18
+ watch(
19
+ () => props.modelValue,
20
+ () => {
21
+ innerValue.value = props.modelValue;
22
+ },
23
+ );
24
+ const emit = defineEmits(['update:modelValue']);
25
+ const updateHandler = (val: number) => {
26
+ emit('update:modelValue', val);
27
+ innerValue.value = val;
28
+ };
29
+ const rankDesc = computed(() => {
30
+ return RANK_CONTANTS[+innerValue.value];
31
+ });
32
+ </script>
33
+ <style scoped lang="scss">
34
+ .rank {
35
+ color: #91999f;
36
+ margin-left: 10px;
37
+ font-weight: bold;
38
+ }
39
+ .perfect {
40
+ color: #f2a204;
41
+ }
42
+ </style>
@@ -25,7 +25,7 @@
25
25
  title?: string;
26
26
  value?: string;
27
27
  modelValue: boolean;
28
- columns: Array<string>;
28
+ columns: Array<any>;
29
29
  labelKey?: string;
30
30
  valueKey?: string;
31
31
  }>();
@@ -82,6 +82,7 @@
82
82
  line-height: 36px;
83
83
  margin: 20rpx 20rpx 0 20rpx;
84
84
  &-left {
85
+ cursor: pointer;
85
86
  height: 36px;
86
87
  font-size: 16px;
87
88
  color: #909193;
@@ -92,6 +93,7 @@
92
93
  color: #19242c;
93
94
  }
94
95
  &-right {
96
+ cursor: pointer;
95
97
  height: 36px;
96
98
  font-size: 16px;
97
99
  color: #119af5;
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <view></view>
3
+ </template>
4
+
5
+ <script lang="ts" setup></script>
6
+ <style scoped lang="scss"></style>
@@ -54,7 +54,7 @@
54
54
  'http://test-oa.ge.cn:6174',
55
55
  ];
56
56
  const show = ref(false);
57
- const isShowDebugButton = ref(whiteUrls.includes(uni.getStorageSync('baseUrl')) || !!uni.getStorageSync('isDebug'));
57
+ const isShowDebugButton = ref(true);
58
58
  const list = ref(['console', 'network', 'event', 'error', 'storage', 'system']);
59
59
  const current = ref(0);
60
60
  const openDebug = () => {
@@ -0,0 +1,41 @@
1
+ interface JsonObject {
2
+ [key: string]: JsonValue;
3
+ }
4
+
5
+ type JsonValue = JsonObject | JsonArray | string | number | boolean | null;
6
+
7
+ type JsonArray = Array<JsonValue>;
8
+
9
+ export function formatJson(obj: JsonValue, indent: string = ''): string {
10
+ let output = '';
11
+
12
+ if (Array.isArray(obj)) {
13
+ output += '[\n';
14
+ const lastIndex = obj.length - 1;
15
+
16
+ obj.forEach((value, index) => {
17
+ const isLast = index === lastIndex;
18
+ const formattedValue = formatJson(value, indent + ' ');
19
+ output += `${indent} ${formattedValue}${isLast ? '' : ','}\n`;
20
+ });
21
+
22
+ output += `${indent}]`;
23
+ } else if (typeof obj === 'object' && obj !== null) {
24
+ output += '{\n';
25
+ const keys = Object.keys(obj);
26
+ const lastIndex = keys.length - 1;
27
+
28
+ keys.forEach((key, index) => {
29
+ const value = obj[key];
30
+ const isLast = index === lastIndex;
31
+ const formattedValue = formatJson(value, indent + ' ');
32
+ output += `${indent} "${key}": ${formattedValue}${isLast ? '' : ','}\n`;
33
+ });
34
+
35
+ output += `${indent}}`;
36
+ } else {
37
+ output += JSON.stringify(obj);
38
+ }
39
+
40
+ return output;
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-oaview",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "uniapp小程序组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "typings": "dist/index.d.ts",
@@ -23,11 +23,16 @@
23
23
  "@babel/cli": "^7.14.5",
24
24
  "@babel/core": "^7.14.6",
25
25
  "@babel/preset-env": "^7.14.7",
26
+ "@dcloudio/uni-ui": "^1.4.26",
26
27
  "@rollup/plugin-commonjs": "^17.1.0",
27
28
  "@rollup/plugin-json": "^4.1.0",
28
29
  "@rollup/plugin-node-resolve": "^11.2.0",
29
30
  "@rollup/plugin-replace": "^2.4.2",
31
+ "@typescript-eslint/parser": "^5.59.8",
32
+ "@vueuse/core": "^9.12.0",
33
+ "clipboard": "^2.0.11",
30
34
  "cross-env": "^7.0.2",
35
+ "dayjs": "1.11.7",
31
36
  "rimraf": "^3.0.2",
32
37
  "rollup": "^2.26.11",
33
38
  "rollup-plugin-alias": "^2.2.0",
@@ -40,18 +45,14 @@
40
45
  "rollup-plugin-vue": "^6.0.0",
41
46
  "typescript": "^4.0.2",
42
47
  "uniapp-log-sdk": "^1.1.1",
43
- "uview-plus": "^3.1.30",
44
- "@vueuse/core": "^9.12.0",
45
- "clipboard": "^2.0.11",
46
- "dayjs": "1.11.7",
47
- "@dcloudio/uni-ui": "^1.4.26"
48
+ "uview-plus": "^3.1.30"
48
49
  },
49
50
  "peerDependencies": {
50
- "uniapp-log-sdk": "^1.1.1",
51
- "uview-plus": "^3.1.30",
51
+ "@dcloudio/uni-ui": "^1.4.26",
52
52
  "@vueuse/core": "^9.12.0",
53
53
  "clipboard": "^2.0.11",
54
54
  "dayjs": "1.11.7",
55
- "@dcloudio/uni-ui": "^1.4.26"
55
+ "uniapp-log-sdk": "^1.1.1",
56
+ "uview-plus": "^3.1.30"
56
57
  }
57
58
  }