htui-yllkbz 1.3.58 → 1.3.61

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.3.58",
3
+ "version": "1.3.61",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
package/src/App.vue CHANGED
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-07-10 16:50:19
7
+ * @LastEditTime: 2022-09-27 14:50:29
8
8
  -->
9
9
  <template>
10
10
  <div id="app">
@@ -12,9 +12,17 @@
12
12
  <HtSelectBaseData
13
13
  dataTypeId="chengbenzhongxin"
14
14
  v-model="state.value"
15
+ :multiple="false"
16
+ @change="change"
17
+ ></HtSelectBaseData>
18
+ <HtSelectBaseData
19
+ :byCode="true"
20
+ :multiple="false"
21
+ :clearable="true"
22
+ dataTypeId="SeverityLevel"
23
+ v-model="state.value"
15
24
  @change="change"
16
25
  ></HtSelectBaseData>
17
-
18
26
  <HtSelectOrg
19
27
  :clearable="true"
20
28
  :multiple="false"
@@ -68,7 +76,7 @@ export default class App extends Vue {
68
76
  // console.log("eeee", e);
69
77
  }
70
78
  testuser(e: any) {
71
- console.log('eee', e);
79
+ //console.log('eee', e);
72
80
  }
73
81
  test(e: any) {
74
82
  //mgr.removeUser();
@@ -247,10 +247,12 @@
247
247
  v-model="state.selectVal[item.code]"
248
248
  :disabled="!!disabled"
249
249
  :key="item.id"
250
+ :clearable="state.configJson[item.code].clearable"
250
251
  :style="comStyle || ''"
251
252
  :placeholder="placeholder || '请选择严重等级'"
252
253
  :filterable="!state.configJson[item.code].multiple"
253
254
  class="component-item"
255
+ :multiple="state.configJson[item.code].multiple"
254
256
  style="width:100%"
255
257
  @click.native="selectClick($event)"
256
258
  @change="setSelctItem(item.code)"
@@ -285,6 +287,8 @@
285
287
  :key="item.id"
286
288
  :disabled="!!disabled"
287
289
  :style="comStyle || ''"
290
+ :multiple="state.configJson[item.code].multiple"
291
+ :clearable="state.configJson[item.code].clearable"
288
292
  :placeholder="placeholder || '请选择响应列表'"
289
293
  :filterable="!state.configJson[item.code].multiple"
290
294
  class="component-item"
@@ -701,6 +705,14 @@ export default class CommonDatas extends Vue {
701
705
  default:
702
706
  break;
703
707
  }
708
+
709
+ this.$emit(
710
+ 'change',
711
+ this.state.selectValData[key] && this.state.selectValData[key].length
712
+ ? this.state.selectValData
713
+ : { [key]: [] }
714
+ );
715
+ //console.log('this.state.selectValData[key]', this.state.selectValData[key]);
704
716
  }
705
717
  /** 动态设置显示面板位置 */
706
718
 
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Descripttion: 基础数据展示组件
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2022-04-12 17:34:51
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2022-09-28 11:18:26
8
+ */
9
+
10
+ import HtDrawer from "./index.vue";
11
+ (HtDrawer as any).install = function (Vue: any) {
12
+
13
+ Vue.component("HtDrawer", HtDrawer);
14
+ };
15
+ export default HtDrawer;
@@ -0,0 +1,123 @@
1
+ <!--
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2022-09-28 10:24:08
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2022-09-28 11:22:34
8
+ -->
9
+ <template>
10
+ <el-drawer
11
+ :visible.sync="state.visible"
12
+ :direction="direction"
13
+ :custom-class="customClass"
14
+ :append-to-body="appendToBody"
15
+ :close-on-press-escape="closeOnPressEscape"
16
+ :destroy-on-close="destroyOnClose"
17
+ :modal-append-to-body="modalAppendToBody"
18
+ :modal="modal"
19
+ :size="size"
20
+ :show-close="showClose"
21
+ :withHeader="withHeader"
22
+ :wrapperClosable="wrapperClosable"
23
+ >
24
+ <span slot="title">
25
+ <slot name="title"
26
+ ><span style="font-size:18px;font-weight:bold">{{ title }}</span></slot
27
+ >
28
+ </span>
29
+
30
+ <div
31
+ style="overflow:hidden;;padding:0 16px"
32
+ :style="
33
+ `height:calc(100vh - ${withFooter ? '90px' : '0px'} - ${
34
+ withHeader ? '100px' : '0px'
35
+ })`
36
+ "
37
+ >
38
+ <el-scrollbar style="height: calc(100% + 19px)">
39
+ <slot></slot>
40
+ </el-scrollbar>
41
+ </div>
42
+ <el-divider v-if="withFooter"></el-divider>
43
+ <slot name="foot" v-if="withFooter">
44
+ <div>
45
+ <el-button style="margin-left:20px" @click="onCancel">取消</el-button>
46
+ <el-button style="margin-left:20px" type="primary" @click="onOk"
47
+ >确定</el-button
48
+ >
49
+ </div></slot
50
+ >
51
+ </el-drawer>
52
+ </template>
53
+ <script lang="ts">
54
+ import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
55
+ interface State {
56
+ /** 数据状态 */
57
+ loading: boolean;
58
+ /** 弹窗 */
59
+ visible: boolean;
60
+ }
61
+ @Component({
62
+ name: 'HtDrawer',
63
+ components: {},
64
+ })
65
+ export default class Index extends Vue {
66
+ /** 抽屉尺寸 */
67
+ @Prop({ default: '50%' }) size!: string;
68
+ /** 标题 */
69
+ @Prop() title!: string;
70
+ /** 是否显示隐藏来自父级传参 */
71
+ @Prop() value!: boolean;
72
+ /** 展开方式 参考elemen UI */
73
+ @Prop({ default: 'rtl' }) direction!: string;
74
+
75
+ @Prop({ default: true }) appendToBody!: boolean;
76
+ @Prop({ default: false }) wrapperClosable!: boolean;
77
+ /** 是否可以通过按下 ESC 关闭 Drawer */
78
+ @Prop({ default: false }) closeOnPressEscape!: boolean;
79
+ /** 控制是否在关闭 Drawer 之后将子元素全部销毁 */
80
+ @Prop({ default: false }) destroyOnClose!: boolean;
81
+ /** 是否需要遮罩层 */
82
+ @Prop({ default: true }) modal!: boolean;
83
+ /** Drawer 的自定义类名 */
84
+ @Prop() customClass!: string;
85
+ /** 遮罩层是否插入至 body 元素上,若为 false,则遮罩层会插入至 Drawer 的父元素上 */
86
+ @Prop({ default: true }) modalAppendToBody!: boolean;
87
+ @Prop({ default: true }) showClose!: boolean;
88
+ /** 控制是否显示 header 栏, 默认为 true, 当此项为 false 时, title attribute 和 title slot 均不生效 */
89
+ @Prop({ default: true }) withHeader!: boolean;
90
+ /** 控制是否显示 foot 栏, 默认为 true, 当此项为 false 时, foot attribute 和 foot slot 均不生效 */
91
+ @Prop({ default: true }) withFooter!: boolean;
92
+ /** 数据 */
93
+ state: State = {
94
+ loading: false,
95
+ visible: false,
96
+ };
97
+ /** 生命周期 */
98
+ /** 方法 */
99
+ onCancel() {
100
+ this.state.visible = false;
101
+ this.$emit('onCancel', false);
102
+ }
103
+ onOk() {
104
+ this.$emit('onOk', true);
105
+ }
106
+
107
+ /** 监听 */
108
+ @Watch('value', { immediate: true })
109
+ getVisible(val: boolean, old: boolean) {
110
+ if (val !== old) {
111
+ this.state.visible = val;
112
+ }
113
+ }
114
+ /** 监听 */
115
+ @Watch('state.visible', { immediate: true })
116
+ setVisible(val: boolean) {
117
+ this.$emit('input', val);
118
+ this.$emit('change', val);
119
+ }
120
+ /** 计算属性 */
121
+ }
122
+ </script>
123
+ <style lang="scss" scoped></style>
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-12-30 15:47:47
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-09-15 10:04:16
7
+ * @LastEditTime: 2022-09-27 14:50:08
8
8
  -->
9
9
 
10
10
  <template>
@@ -34,7 +34,8 @@
34
34
  <HtShowBaseData
35
35
  :hide-code="hideCode"
36
36
  :show-all-level="showAllLevels"
37
- :base-data-id="value"
37
+ :base-data-id="!byCode ? value : undefined"
38
+ :base-data-value="byCode ? value : undefined"
38
39
  :base-data-info="true"
39
40
  com-style="font-size:12px"
40
41
  style="font-size:12px"
@@ -71,6 +72,8 @@ export default class HtSelectBaseData extends Vue {
71
72
  @Prop() org?: string;
72
73
  @Prop() size?: string;
73
74
  @Prop() placeholder?: string;
75
+ /** 是否通过其他Key来做下拉选择 */
76
+ @Prop({ default: false }) byCode!: boolean;
74
77
  /** 是否禁用 */
75
78
  @Prop({ default: false }) disabled?: boolean;
76
79
  /* 是否只读 */
@@ -107,13 +110,17 @@ export default class HtSelectBaseData extends Vue {
107
110
  if (this.multiple) {
108
111
  const arr: string[] = [];
109
112
  dep.forEach((item: any) => {
110
- arr.push(item.id);
113
+ arr.push(item[this.byCode ? 'value' : 'id']);
111
114
  });
112
115
  data = arr;
113
116
  } else {
114
- data = dep[0].id;
117
+ data = dep[0][this.byCode ? 'value' : 'id'];
118
+ if (this.byCode && !isNaN(data)) {
119
+ data = data.toString();
120
+ }
115
121
  }
116
122
  }
123
+
117
124
  this.$emit('input', data);
118
125
  this.$emit('change', data, dep);
119
126
  // this.$emit("input", id);
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-21 10:08:41
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-05-15 15:58:44
7
+ * @LastEditTime: 2022-09-28 11:19:36
8
8
  */
9
9
 
10
10
  // 导入组件
@@ -26,12 +26,13 @@ import HtShowBaseData from './HtShowBaseData/index'
26
26
  import HtOrgInfo from './HtOrgInfo/index'
27
27
  import HtBaseData from './HtBaseData/index'
28
28
  import HtShowBaseType from './HtShowBaseType'
29
+ import HtDrawer from './HtDrawer'
29
30
 
30
31
 
31
32
 
32
33
 
33
34
  // 存储组件列表
34
- const components = [HtBaseData, HtShowBaseType, HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles, HtSelectBaseData, HtSelectOrg, HtSelectUser, HtShowBaseData, HtOrgInfo]
35
+ const components = [HtBaseData, HtDrawer, HtShowBaseType, HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles, HtSelectBaseData, HtSelectOrg, HtSelectUser, HtShowBaseData, HtOrgInfo]
35
36
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
36
37
  const install = function (Vue: any) {
37
38
  // 判断是否安装
@@ -48,6 +49,6 @@ export default {
48
49
  install,
49
50
  // 以下是具体的组件列表
50
51
  HtSelectTable, HtPagination, HtShowBaseType, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles,
51
- HtSelectBaseData, HtSelectOrg, HtSelectUser, HtShowBaseData, HtOrgInfo, HtBaseData
52
+ HtSelectBaseData, HtSelectOrg, HtSelectUser, HtShowBaseData, HtOrgInfo, HtBaseData, HtDrawer
52
53
  }
53
54