htui-yllkbz 1.2.52 → 1.2.56

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.2.52",
3
+ "version": "1.2.56",
4
4
  "typings": "types/index.d.ts",
5
5
  "main": "lib/htui.common.js",
6
6
  "style": "lib/htui.css",
@@ -5,7 +5,7 @@
5
5
  * @Author: hutao
6
6
  * @Date: 2021-11-11 11:23:24
7
7
  * @LastEditors: hutao
8
- * @LastEditTime: 2022-01-13 14:47:22
8
+ * @LastEditTime: 2022-02-13 16:12:46
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading"
@@ -104,12 +104,14 @@
104
104
  type="tag"></common-org-info>
105
105
  <span v-else>--</span>
106
106
  </template>
107
+ <!-- 处理基础数据 -->
107
108
  <template v-else-if="item.type==='common'">
109
+
108
110
  <div v-if="getPropByPath(row,item.key)"
109
111
  is='common-datas-info-id'
110
- :user-id="item.commonType==='userId'?[getPropByPath(row,item.key)]:'[]'"
111
- :department-id="item.commonType==='departmentId'?[getPropByPath(row,item.key)]:'[]'"
112
- :role-id="item.commonType==='roleId'?[getPropByPath(row,item.key)]:'[]'"
112
+ :user-id="item.commonType==='userId'?JSON.stringify([getPropByPath(row,item.key)]):'[]'"
113
+ :department-id="item.commonType==='departmentId'?JSON.stringify([getPropByPath(row,item.key)]):'[]'"
114
+ :role-id="item.commonType==='roleId'?JSON.stringify([getPropByPath(row,item.key)]):'[]'"
113
115
  :base-data-id="item.commonType==='baseDataId'?getPropByPath(row,item.key):''"
114
116
  :base-data-value="item.commonType==='baseDataValue'?getPropByPath(row,item.key):''"
115
117
  :base-data-name="item.commonType==='baseDataName'?getPropByPath(row,item.key):''"
@@ -136,7 +138,7 @@
136
138
  </div>
137
139
  <span v-else>--</span>
138
140
  </template>
139
- <!-- 处理部门人员 -->
141
+ <!-- 处理布尔值显示 -->
140
142
  <template v-else-if="item.type==='boolean'">
141
143
  <el-tag :type="'success'"
142
144
  :size="'small'"
@@ -145,15 +147,25 @@
145
147
  :size="'small'"
146
148
  v-else>否</el-tag>
147
149
  </template>
148
- <!-- 处理部门人员 -->
150
+ <!-- 处理图片显示 -->
149
151
  <template v-else-if="item.type==='img'">
150
- <span v-if="fileToken in getPropByPath(row,item.key).split(',')">
152
+ <span v-if="getPropByPath(row,item.key)">
151
153
  <el-image style="width: 38px; height: 38px;margin-right:5px"
154
+ :key="fileToken"
155
+ v-for="fileToken in getPropByPath(row,item.key).split(',')"
152
156
  :src="'/files/api/filing/file/download/'+fileToken"
153
157
  :preview-src-list="['/files/api/filing/file/download/'+fileToken]">
154
158
  </el-image>
155
159
  </span>
156
-
160
+ </template>
161
+ <!-- 处理附件显示 -->
162
+ <template v-else-if="item.type==='file'">
163
+ <span v-if="getPropByPath(row,item.key)">
164
+ <i class="el-icon-paperclip"
165
+ @click="showFiles(getPropByPath(row,item.key))"
166
+ style="color:var(--primary);cursor:pointer">{{getPropByPath(row,item.key).split(',').length}}</i>
167
+ </span>
168
+ <span v-else>--</span>
157
169
  </template>
158
170
  <!-- 其他 -->
159
171
  <span v-else>{{getPropByPath(row,item.key)}}</span>
@@ -191,11 +203,14 @@
191
203
  <!-- 详情弹框 -->
192
204
  <el-dialog :visible.sync="state.visibleFilter"
193
205
  title="属性设置"
206
+ :append-to-body="true"
194
207
  :close-on-click-modal="true"
195
208
  width="400px"
196
209
  :center="true">
197
- <div style='overflow:hidden;height:500px'>
198
- <el-scrollbar style='height: 517px'>
210
+ <p slot="title"
211
+ style="font-weight:700;font-size:18px;float:left;margin:0">自定义列展示</p>
212
+ <div style='overflow:hidden;height:40vh;margin-top:12px'>
213
+ <el-scrollbar style='height: calc(40vh + 17px)'>
199
214
  <el-tree :data="columns"
200
215
  ref="tree"
201
216
  show-checkbox
@@ -215,18 +230,36 @@
215
230
  <span class="custom-tree-node"
216
231
  slot-scope="{ node, data }">
217
232
  <slot :name="'header_'+data.key"
218
- :column="data">{{data.title}}</slot>
233
+ :column="data">{{data.title}}<span style="color:#C0C4CC">{{data.property?`(${data.property==='base'?'基础属性':'扩展属性'})`:''}}</span></slot>
219
234
  </span>
220
235
  </el-tree>
221
236
  </el-scrollbar>
222
237
  </div>
223
238
  </el-dialog>
239
+ <!-- 附件详情弹框 -->
240
+ <el-dialog :visible.sync="state.visibleFile"
241
+ title="附件查看"
242
+ :append-to-body="true"
243
+ :close-on-click-modal="true"
244
+ width="400px"
245
+ :center="true">
246
+ <p slot="title"
247
+ style="font-weight:700;font-size:18px;float:left;margin:0">附件查看</p>
248
+
249
+ <div style='overflow:hidden;height:calc(30vh)'>
250
+ <el-scrollbar style='height: calc(100% + 17px)'>
251
+ <HtUploadFiles :disabled="true"
252
+ v-model="state.files"></HtUploadFiles>
253
+ </el-scrollbar>
254
+ </div>
255
+ </el-dialog>
224
256
  </div>
225
257
  </template>
226
258
  <script lang='ts'>
227
259
  import { Component, Prop, Vue, Watch } from "vue-property-decorator";
228
260
  import { Column, PageInfoType } from "@/packages/type";
229
261
  import PageInfo from "@/packages/PageInfo/index.vue";
262
+ import HtUploadFiles from "@/packages/HtUploadFiles/index.vue";
230
263
  interface State {
231
264
  pageInfo: PageInfoType;
232
265
  loading: boolean;
@@ -235,13 +268,18 @@ interface State {
235
268
  showColumnKeys: string[];
236
269
  /** 是否展示筛选框 */
237
270
  visibleFilter: boolean;
271
+ /** 是否展示附件 */
272
+ visibleFile: boolean;
238
273
  /** 当前拖动的数据 */
239
274
  currentColumn?: Column;
275
+ /** 附件ids */
276
+ files?: string;
240
277
  }
241
278
  @Component({
242
279
  name: "HtTable",
243
280
  components: {
244
281
  PageInfo,
282
+ HtUploadFiles,
245
283
  },
246
284
  })
247
285
  export default class HtTable extends Vue {
@@ -285,6 +323,7 @@ export default class HtTable extends Vue {
285
323
  @Prop() pagination?: any;
286
324
  state: State = {
287
325
  loading: false,
326
+ files: undefined,
288
327
  pageInfo: {
289
328
  currentPage: 1,
290
329
  pageSize: 10,
@@ -294,6 +333,7 @@ export default class HtTable extends Vue {
294
333
  showColumns: [],
295
334
  currentColumn: undefined,
296
335
  visibleFilter: false,
336
+ visibleFile: false,
297
337
  showColumnKeys: [],
298
338
  };
299
339
  created() {
@@ -319,6 +359,11 @@ export default class HtTable extends Vue {
319
359
  return arr;
320
360
  }, []);
321
361
  }
362
+ /** 展示附件信息 */
363
+ showFiles(val = "") {
364
+ this.state.files = val;
365
+ this.state.visibleFile = true;
366
+ }
322
367
  changeColumns(node: any, checked: boolean) {
323
368
  let { showColumnKeys } = this.state;
324
369
  if (checked) {
@@ -0,0 +1,14 @@
1
+ /*
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2021-11-15 15:00:57
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2022-02-11 14:26:45
8
+ */
9
+ import HtUploadFiles from "./index.vue";
10
+ (HtUploadFiles as any).install = function (Vue: any) {
11
+
12
+ Vue.component("HtUploadFiles", HtUploadFiles);
13
+ };
14
+ export default HtUploadFiles;
@@ -0,0 +1,234 @@
1
+ <!--
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2022-02-11 14:26:23
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2022-02-11 14:36:54
8
+ -->
9
+ <!--
10
+ * @Descripttion: 附件列表 ------没有搞完
11
+ * @version:
12
+ * @Author: hutao
13
+ * @Date: 2021-12-30 16:07:59
14
+ * @LastEditors: hutao
15
+ * @LastEditTime: 2022-02-10 15:11:11
16
+ -->
17
+ <template>
18
+ <div>
19
+ <el-upload class="ht-upload"
20
+ v-if="!disabled"
21
+ style="width:368px;height:108px"
22
+ :show-file-list="false"
23
+ :disabled="disabled"
24
+ :on-success="onSuccess"
25
+ :before-upload="beforeUpload"
26
+ drag
27
+ action="/files/api/filing/file/upload"
28
+ multiple>
29
+ <!-- <i class="el-icon-upload"></i> -->
30
+ <div style="margin-top:8px;font-size:12px;color:#999"
31
+ class="el-upload__text">拖动文件到此处,或<br /><em>点击上传</em></div>
32
+ <!-- <div class="el-upload__tip"
33
+ slot="tip">只能上传jpg/png文件,且不超过5M</div> -->
34
+ </el-upload>
35
+ <ul class="ht-ul-upload">
36
+ <li :key="item.fileToken"
37
+ v-for=" (item,index) in state.filesInfo">
38
+ <a @click="downLoadFile(item)"><i class="le-icon el-icon-document"
39
+ style="margin-right:7px"></i>{{item.fileName}}</a>
40
+ <span>
41
+
42
+ <i v-if="!disabled"
43
+ class="el-icon el-icon-circle-check"></i>
44
+ <i v-if="!disabled"
45
+ class="el-icon el-icon-close"
46
+ @click="delItem(item,index)"
47
+ title="删除"></i>
48
+ <i class="el-icon el-icon-download"
49
+ style="margin-right:24px"
50
+ @click="downLoadFile(item)"
51
+ title="下载"></i>
52
+ </span>
53
+
54
+ </li>
55
+ </ul>
56
+ <a :href="state.fileSrc"
57
+ target="_blank"
58
+ v-show="false"
59
+ ref="download1"></a>
60
+ </div>
61
+ </template>
62
+ <script lang='ts'>
63
+ import { _axios } from "vue-kst-auth";
64
+ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
65
+ interface State {
66
+ /** 数据状态 */
67
+ loading: boolean;
68
+ fileSrc: string;
69
+ /** 图片地址 */
70
+ fileToken: string[];
71
+ dialogVisible: boolean;
72
+ /** 附件详情列表 */
73
+ filesInfo: CreateAttachmentDto[];
74
+ }
75
+ interface FileType {
76
+ fileName: string;
77
+ fileSize?: number;
78
+ fileToken?: string;
79
+ fileType?: string;
80
+ }
81
+ interface CreateAttachmentDto {
82
+ fileToken?: string | undefined;
83
+ fileName?: string | undefined;
84
+ fileSize?: number;
85
+ fileType?: string | undefined;
86
+ sortNum?: number;
87
+ }
88
+ @Component({
89
+ name: "HtUploadFiles",
90
+ })
91
+ export default class HtUploadFiles extends Vue {
92
+ @Prop() value!: string;
93
+ /* 是否只读 */
94
+ @Prop({ default: false }) readonly?: boolean;
95
+ /** 是否禁用 */
96
+ @Prop() disabled?: boolean;
97
+ /** 数据 */
98
+ state: State = {
99
+ loading: false,
100
+ fileSrc: "",
101
+ fileToken: [],
102
+ filesInfo: [],
103
+ dialogVisible: false,
104
+ };
105
+ /** 生命周期 */
106
+ created() {
107
+ this.onValue(this.value);
108
+ }
109
+ /** 方法 */
110
+ /** 上传文件前验证 */
111
+
112
+ /** 附件上传之前的判断 */
113
+ beforeUpload(file: File) {
114
+ const isLt10MB = file.size / 1024 / 1024 < 5;
115
+ const arr = ["jpg", "png", "xlsx", "lsx", "doc", "pdf"];
116
+ const lastArr = file.name.split(".");
117
+ const type = lastArr[lastArr.length - 1];
118
+ if (!isLt10MB) {
119
+ this.$message.error("大小不能超过 5MB!");
120
+ }
121
+ if (arr.includes(type)) {
122
+ return true;
123
+ } else {
124
+ this.$notify.error(`只能上传${arr.toString()}格式文件`);
125
+ return false;
126
+ }
127
+ }
128
+ /**下载文件 */
129
+ downLoadFile(item: any) {
130
+ this.state.fileSrc = `/files/api/filing/file/download/${item.fileToken}`;
131
+ setTimeout(() => {
132
+ const adom: any = this.$refs.download1;
133
+ adom.click();
134
+ }, 100);
135
+ }
136
+ /** 附件上传成功 */
137
+ onSuccess(response: { fileToken: string }) {
138
+ console.log("response, file, fileList", response.fileToken);
139
+ //this.state.files.push(response.fileToken);
140
+ this.getFileInfo(response.fileToken);
141
+ }
142
+ /** 获取到的附件列表详情 */
143
+ getFileInfo(id: string) {
144
+ _axios.get("/files/api/filing/file/" + id).then((res) => {
145
+ this.state.filesInfo.push(res.data);
146
+ });
147
+ }
148
+ /** 删除附件列表 */
149
+ delItem(item: FileType, index: number) {
150
+ const { filesInfo } = this.state;
151
+ if (item.fileToken) {
152
+ filesInfo.splice(index, 1);
153
+ this.state.filesInfo = filesInfo;
154
+ }
155
+ }
156
+ /** 请求所有的附件信息 */
157
+ async getAllFileInfo() {
158
+ const { fileToken } = this.state;
159
+ //this.state.filesInfo = [];
160
+ for (let i = 0; i < fileToken.length; i++) {
161
+ if (
162
+ this.state.filesInfo.findIndex(
163
+ (item) => item.fileToken === fileToken[i]
164
+ ) < 0
165
+ ) {
166
+ await _axios
167
+ .get("/files/api/filing/file/" + fileToken[i])
168
+ .then((res) => {
169
+ this.state.filesInfo.push(res.data);
170
+ });
171
+ }
172
+ }
173
+ }
174
+ /** 监听 */
175
+ /** 计算属性 */
176
+ get fileList() {
177
+ return [];
178
+ }
179
+ @Watch("state.filesInfo")
180
+ onFileToken(val: CreateAttachmentDto[], old: string) {
181
+ const arr: string[] = [];
182
+ val.forEach((item) => {
183
+ if (item.fileToken) arr.push(item.fileToken);
184
+ });
185
+ this.$emit("input", arr.toString());
186
+ }
187
+ @Watch("value")
188
+ onValue(val: string) {
189
+ if (val) {
190
+ this.state.fileToken = val.split(",");
191
+ this.getAllFileInfo();
192
+ } else {
193
+ this.state.fileToken = [];
194
+ }
195
+ }
196
+ }
197
+ </script>
198
+ <style lang='scss' scoped>
199
+ .ht-ul-upload {
200
+ li {
201
+ width: 100%;
202
+ list-style: none;
203
+ height: 40px;
204
+ line-height: 40px;
205
+ padding: 0 8px;
206
+ display: flex;
207
+ justify-content: space-between;
208
+ cursor: pointer;
209
+ a {
210
+ color: #606266;
211
+ font-size: 12px;
212
+ }
213
+ .el-icon-close {
214
+ display: none;
215
+ }
216
+ &:hover {
217
+ background: #eee;
218
+ a {
219
+ color: var(--primary);
220
+ }
221
+ .el-icon-close {
222
+ display: block;
223
+ line-height: 40px;
224
+ }
225
+ .el-icon-circle-check {
226
+ display: none;
227
+ }
228
+ }
229
+ .el-icon-circle-check {
230
+ color: var(--primary);
231
+ }
232
+ }
233
+ }
234
+ </style>
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-21 10:08:41
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-01-04 09:47:12
7
+ * @LastEditTime: 2022-02-11 14:29:18
8
8
  */
9
9
 
10
10
  // 导入组件
@@ -18,10 +18,11 @@ import HtExport from './HtExport/index'
18
18
  import HtUpload from './HtUpload/index'
19
19
  import HtMd from './HtMd/index'
20
20
  import HtCountDown from './HtCountDown/index'
21
+ import HtUploadFiles from './HtUploadFiles/index'
21
22
 
22
23
 
23
24
  // 存储组件列表
24
- const components = [HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown]
25
+ const components = [HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles]
25
26
  // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
26
27
  const install = function (Vue: any) {
27
28
  // 判断是否安装
@@ -37,6 +38,6 @@ export default {
37
38
  // 导出的对象必须具有 install,才能被 Vue.use() 方法安装
38
39
  install,
39
40
  // 以下是具体的组件列表
40
- HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown
41
+ HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles
41
42
  }
42
43
 
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-25 17:05:17
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-01-13 15:08:32
7
+ * @LastEditTime: 2022-02-10 10:33:52
8
8
  */
9
9
  /** 初始的默认条数 */
10
10
  export const defalutPageSize = 10
@@ -69,13 +69,15 @@ export interface Column {
69
69
  hide?: boolean;
70
70
  /** 时间是否跨行展示 */
71
71
  spread?: boolean;
72
- /** 通过type展示相应的数据 用户id|部门id|时间格式化|是否布尔值*/
73
- type?: 'userId' | 'org' | 'time' | 'common' | 'boolean' | 'img';
72
+ /** 通过type展示相应的数据 用户id|部门id|时间格式化|是否布尔值|图片 |附件*/
73
+ type?: 'userId' | 'org' | 'time' | 'common' | 'boolean' | 'img' | 'file';
74
74
  /** 只有当type='common'时候有效 数据类型个ca common里面的一样但不包括时间 时间使用time */
75
75
  commonType?: 'userId' | 'departmentId' | 'baseDataId' | 'roleId' | 'baseDataName' | 'baseDataValue';
76
76
  showOverflowTooltip?: boolean;
77
77
  /** 筛选时候是否禁用 */
78
78
  disabled?: boolean;
79
+ /** 自定义列时候展示是否是基础属性还是扩展属性 */
80
+ property?: 'base'|'extend';
79
81
  }
80
82
  export interface PageInfoType {
81
83
  currentPage: number;
@@ -4,13 +4,13 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-01-11 10:29:04
7
+ * @LastEditTime: 2022-02-13 16:11:09
8
8
  -->
9
9
  <template>
10
10
  <div>
11
11
 
12
- <el-button type=""
13
- @click="test">test</el-button>
12
+ <!-- <el-button type=""
13
+ @click="test">test</el-button> -->
14
14
  <!-- <ht-count-down :stopwatch="true"
15
15
  :frequency="200"
16
16
  :start="!state.start">
@@ -25,18 +25,14 @@
25
25
  </template>
26
26
  </ht-count-down> -->
27
27
 
28
- <ht-md v-model="state.content"
29
- :subfield="true"></ht-md>
28
+ <!-- <ht-md v-model="state.content"
29
+ :subfield="true"></ht-md> -->
30
30
  <div ref="ht-pdf">
31
31
  <HtTable :data="state.data"
32
32
  :height="200"
33
+ :showFilter="true"
33
34
  :columns="state.columns">
34
- <div slot="sex"
35
- slot-scope="{row}">{{row.sex?'男':'女'}}</div>
36
- <div slot="age"
37
- slot-scope="{row}">
38
- <el-tag>{{row.age}}</el-tag>
39
- </div>
35
+
40
36
  <div slot="header_name">测试名字</div>
41
37
  </HtTable>
42
38
  </div>
@@ -86,17 +82,17 @@ export default class Index extends Vue {
86
82
  data: [
87
83
  {
88
84
  name: "胡涛",
85
+
89
86
  age: 12,
90
- sex: 0,
87
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90,e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
91
88
  id: 1,
92
-
93
- test: { title: "测试" },
89
+ test: { title: "33476c23-9faa-22d3-3ee6-39f97d173566" },
94
90
  time: "2022-01-20T00:00:00+08:00",
95
91
  },
96
92
  {
97
93
  name: "胡涛",
98
94
  age: 12,
99
- sex: 1,
95
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
100
96
  id: 2,
101
97
  test: { title: "测试" },
102
98
  time: "2022-01-20T00:00:00+08:00",
@@ -104,7 +100,7 @@ export default class Index extends Vue {
104
100
  {
105
101
  name: "胡涛",
106
102
  age: 12,
107
- sex: 1,
103
+ sex: "tt",
108
104
  id: 3,
109
105
  test: { title: "测试" },
110
106
  time: "2022-01-20T00:00:00+08:00",
@@ -112,7 +108,7 @@ export default class Index extends Vue {
112
108
  {
113
109
  name: "胡涛",
114
110
  age: 12,
115
- sex: 0,
111
+ sex: "tt",
116
112
  id: 4,
117
113
  test: { title: "测试" },
118
114
  time: "2022-01-20T00:00:00+08:00",
@@ -120,7 +116,7 @@ export default class Index extends Vue {
120
116
  {
121
117
  name: "胡涛",
122
118
  age: 12,
123
- sex: 0,
119
+ sex: "tt",
124
120
  id: 41,
125
121
  test: { title: "测试" },
126
122
  time: "2022-01-20T00:00:00+08:00",
@@ -131,6 +127,7 @@ export default class Index extends Vue {
131
127
  title: "姓名",
132
128
  key: "test.title",
133
129
  width: "300px",
130
+ property: "base",
134
131
  disabled: true,
135
132
  },
136
133
  {
@@ -150,6 +147,7 @@ export default class Index extends Vue {
150
147
  {
151
148
  title: "性别",
152
149
  key: "sex",
150
+ type: "file",
153
151
  },
154
152
  ],
155
153
  };