htui-yllkbz 1.2.51 → 1.2.55

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.51",
3
+ "version": "1.2.55",
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-11 14:34:01
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,6 +203,7 @@
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">
@@ -221,12 +234,30 @@
221
234
  </el-scrollbar>
222
235
  </div>
223
236
  </el-dialog>
237
+ <!-- 附件详情弹框 -->
238
+ <el-dialog :visible.sync="state.visibleFile"
239
+ title="附件查看"
240
+ :append-to-body="true"
241
+ :close-on-click-modal="true"
242
+ width="400px"
243
+ :center="true">
244
+ <p slot="title"
245
+ style="font-weight:700;font-size:18px;float:left">附件查看</p>
246
+ <el-divider></el-divider>
247
+ <div style='overflow:hidden;height:calc(30vh)'>
248
+ <el-scrollbar style='height: calc(100% + 17px)'>
249
+ <HtUploadFiles :disabled="true"
250
+ v-model="state.files"></HtUploadFiles>
251
+ </el-scrollbar>
252
+ </div>
253
+ </el-dialog>
224
254
  </div>
225
255
  </template>
226
256
  <script lang='ts'>
227
257
  import { Component, Prop, Vue, Watch } from "vue-property-decorator";
228
258
  import { Column, PageInfoType } from "@/packages/type";
229
259
  import PageInfo from "@/packages/PageInfo/index.vue";
260
+ import HtUploadFiles from "@/packages/HtUploadFiles/index.vue";
230
261
  interface State {
231
262
  pageInfo: PageInfoType;
232
263
  loading: boolean;
@@ -235,13 +266,18 @@ interface State {
235
266
  showColumnKeys: string[];
236
267
  /** 是否展示筛选框 */
237
268
  visibleFilter: boolean;
269
+ /** 是否展示附件 */
270
+ visibleFile: boolean;
238
271
  /** 当前拖动的数据 */
239
272
  currentColumn?: Column;
273
+ /** 附件ids */
274
+ files?: string;
240
275
  }
241
276
  @Component({
242
277
  name: "HtTable",
243
278
  components: {
244
279
  PageInfo,
280
+ HtUploadFiles,
245
281
  },
246
282
  })
247
283
  export default class HtTable extends Vue {
@@ -285,6 +321,7 @@ export default class HtTable extends Vue {
285
321
  @Prop() pagination?: any;
286
322
  state: State = {
287
323
  loading: false,
324
+ files: undefined,
288
325
  pageInfo: {
289
326
  currentPage: 1,
290
327
  pageSize: 10,
@@ -294,6 +331,7 @@ export default class HtTable extends Vue {
294
331
  showColumns: [],
295
332
  currentColumn: undefined,
296
333
  visibleFilter: false,
334
+ visibleFile: false,
297
335
  showColumnKeys: [],
298
336
  };
299
337
  created() {
@@ -319,6 +357,11 @@ export default class HtTable extends Vue {
319
357
  return arr;
320
358
  }, []);
321
359
  }
360
+ /** 展示附件信息 */
361
+ showFiles(val = "") {
362
+ this.state.files = val;
363
+ this.state.visibleFile = true;
364
+ }
322
365
  changeColumns(node: any, checked: boolean) {
323
366
  let { showColumnKeys } = this.state;
324
367
  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-11 14:39:04
7
+ * @LastEditTime: 2022-02-10 10:33:52
8
8
  */
9
9
  /** 初始的默认条数 */
10
10
  export const defalutPageSize = 10
@@ -69,11 +69,11 @@ 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
- commonType?: 'userId' | 'departmentId' | 'baseDataId' | 'roleId' | 'baseDataName' | 'baseDataValue',
76
- showOverflowTooltip?: boolean,
75
+ commonType?: 'userId' | 'departmentId' | 'baseDataId' | 'roleId' | 'baseDataName' | 'baseDataValue';
76
+ showOverflowTooltip?: boolean;
77
77
  /** 筛选时候是否禁用 */
78
78
  disabled?: boolean;
79
79
  }
@@ -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-11 13:46:07
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,13 @@
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
33
  :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>
34
+
40
35
  <div slot="header_name">测试名字</div>
41
36
  </HtTable>
42
37
  </div>
@@ -87,16 +82,15 @@ export default class Index extends Vue {
87
82
  {
88
83
  name: "胡涛",
89
84
  age: 12,
90
- sex: 0,
85
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90,e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
91
86
  id: 1,
92
-
93
- test: { title: "测试" },
87
+ test: { title: "33476c23-9faa-22d3-3ee6-39f97d173566" },
94
88
  time: "2022-01-20T00:00:00+08:00",
95
89
  },
96
90
  {
97
91
  name: "胡涛",
98
92
  age: 12,
99
- sex: 1,
93
+ sex: "e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90",
100
94
  id: 2,
101
95
  test: { title: "测试" },
102
96
  time: "2022-01-20T00:00:00+08:00",
@@ -104,7 +98,7 @@ export default class Index extends Vue {
104
98
  {
105
99
  name: "胡涛",
106
100
  age: 12,
107
- sex: 1,
101
+ sex: "tt",
108
102
  id: 3,
109
103
  test: { title: "测试" },
110
104
  time: "2022-01-20T00:00:00+08:00",
@@ -112,7 +106,7 @@ export default class Index extends Vue {
112
106
  {
113
107
  name: "胡涛",
114
108
  age: 12,
115
- sex: 0,
109
+ sex: "tt",
116
110
  id: 4,
117
111
  test: { title: "测试" },
118
112
  time: "2022-01-20T00:00:00+08:00",
@@ -120,7 +114,7 @@ export default class Index extends Vue {
120
114
  {
121
115
  name: "胡涛",
122
116
  age: 12,
123
- sex: 0,
117
+ sex: "tt",
124
118
  id: 41,
125
119
  test: { title: "测试" },
126
120
  time: "2022-01-20T00:00:00+08:00",
@@ -150,6 +144,7 @@ export default class Index extends Vue {
150
144
  {
151
145
  title: "性别",
152
146
  key: "sex",
147
+ type: "file",
153
148
  },
154
149
  ],
155
150
  };