@zscreate/zhxy-app-component 1.0.314 → 1.0.316

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.
@@ -43,29 +43,37 @@
43
43
  :class="{ showAsteriskRect: hasRequiredAsterisk, isRequired: showRequiredAsterisk }" :style="mLabelStyle">
44
44
  {{ widget.name }}
45
45
  </view>
46
- <view class="evan-form-item-container__main download_moban" style="display: block" :style="mContentStyle">
46
+ <view class="evan-form-item-container__main download_moban" style="display: block" :style="mContentStyle" v-if="!widget.options.QYSContractFlag">
47
47
  <view class="download_item" @click.prevent.native="downLoadFile(item)" style="margin-right: 20px;color: #007AFF;"
48
48
  v-for="(item, index) in widget.options.defaultValue" :key="index">
49
49
  {{ item.name }}
50
50
  </view>
51
51
  <view class="option-font-size" v-if="widget.options.defaultValue.length === 0">暂无模板</view>
52
52
  </view>
53
+ <view class="evan-form-item-container__main download_moban" style="display: flex" :style="mContentStyle" v-else>
54
+ <view class="download_item" @click.prevent.native="uploadFileQYS" style="margin-right: 10px;color: #007AFF;">
55
+ 文件下载
56
+ </view>
57
+ <view class="download_item" @click.prevent.native="uploadFileQYS('perview')" style="margin-right: 20px;color: #007AFF;">
58
+ 预览
59
+ </view>
60
+ </view>
53
61
  </view>
54
62
 
55
63
  <!-- textarea -->
56
64
  <view v-else-if="widget.type === 'textarea'" class="evan-form-item-container"
57
- :class="'evan-form-item-container--' + labelPosition" style="display: block;">
65
+ :class="'evan-form-item-container--' + labelPosition">
58
66
  <view class="evan-form-item-container__label"
59
67
  :class="{ showAsteriskRect: hasRequiredAsterisk, isRequired: showRequiredAsterisk }" :style="mLabelStyle">
60
68
  {{ widget.name }}
61
69
  </view>
62
- <view class="evan-form-item-container__main evan-form-item-container__textarea form-input-placeholder-textarea" :style="mContentStyle">
70
+ <view class="evan-form-item-container__main evan-form-item-container__textarea" :style="mContentStyle">
63
71
  <view v-if="widget.options.disabled" class="form-input cover-text" style="height: initial;line-break: anywhere;">
64
72
  {{ dataModel }}
65
73
  </view>
66
- <textarea v-else maxlength="-1" class="form-input cover-text form-input-placeholder-textarea" v-model="dataModel"
74
+ <textarea v-else maxlength="-1" class="form-input cover-text" v-model="dataModel"
67
75
  :style="{ height: (widget.options.height || 100) * 2 + 'px'}"
68
- placeholder-class="form-input-placeholder form-input-placeholder-textarea"
76
+ placeholder-class="form-input-placeholder"
69
77
  :placeholder="widget.options.placeholder" :disabled="widget.options.disabled">
70
78
  </textarea>
71
79
  </view>
@@ -1222,7 +1230,7 @@ export default {
1222
1230
  })
1223
1231
  uni.navigateTo({
1224
1232
  url: '/pages/picker/relateSub?multiple=' + Number(widget.multiple) + '&params=' + encodeURIComponent(JSON.stringify(params)) + '&sign=' + PubsubSign +
1225
- '&selectedData=' + JSON.stringify(this.dataModel ? this.dataModel : []) + '&appId=' + this.$Route.query.id
1233
+ '&selectedData=' + JSON.stringify(this.dataModel ? this.dataModel : [])
1226
1234
  });
1227
1235
 
1228
1236
  },
@@ -1263,10 +1271,10 @@ export default {
1263
1271
  },
1264
1272
 
1265
1273
  downLoadFile(item) {
1266
- // #ifdef H5
1267
1274
  if(this.widget.options.disabled){
1268
1275
  return;
1269
1276
  }
1277
+ // #ifdef H5
1270
1278
  const { h5_preview, h5_preview_type } = this.widget.options
1271
1279
  if (h5_preview) {
1272
1280
  return h5PreviewFile(this.downLoadUrl + item.url, h5_preview_type)
@@ -1274,7 +1282,96 @@ export default {
1274
1282
  // #endif
1275
1283
  downloadFile(this.downLoadUrl, { path: item.url, name: item.name })
1276
1284
  },
1277
-
1285
+ // 锲约锁模版下载
1286
+ uploadFileQYS(type) {
1287
+ if(this.widget.options.disabled) return
1288
+ if (type === 'perview') {
1289
+ if (!this.dataObj().config.applyId) {
1290
+ uni.showToast({
1291
+ title: '当前状态不支持文件预览',
1292
+ icon: "none",
1293
+ duration: 1500,
1294
+ })
1295
+ return
1296
+ }
1297
+ this.$u.get('/form/qiyuesuo/viewQiyuesuoDoc', { applyId: this.dataObj().config.applyId }).then((res) => {
1298
+ if (res.success && res.result) {
1299
+ // #ifdef H5
1300
+ window.open(res.result, '_blank')
1301
+ // #endif
1302
+ // #ifdef MP
1303
+ uni.setClipboardData({
1304
+ data: res.result,
1305
+ success: () =>
1306
+ uni.showToast({
1307
+ title: '链接已复制,请通过浏览器预览'
1308
+ })
1309
+ });
1310
+ // #endif
1311
+ } else {
1312
+ this.$message.warning(res.message)
1313
+ }
1314
+ })
1315
+ } else {
1316
+ if (!this.dataObj().config.applyId) {
1317
+ uni.showToast({
1318
+ title: '当前状态不支持文件下载',
1319
+ icon: "none",
1320
+ duration: 1500,
1321
+ })
1322
+ return
1323
+ }
1324
+ this.$u.http.request({
1325
+ url: '/form/qiyuesuo/download',
1326
+ method: 'GET',
1327
+ header: {},
1328
+ responseType: 'arraybuffer',
1329
+ dataType: 'binary',
1330
+ originalData: true,
1331
+ data: { applyId: this.dataObj().config.applyId }
1332
+ }).then(res => {
1333
+ let data = res.data
1334
+ if (data instanceof String) {
1335
+ console.log(data)
1336
+ uni.showToast({
1337
+ title: '导出失败!',
1338
+ icon: "none",
1339
+ duration: 1500,
1340
+ })
1341
+ return
1342
+ }
1343
+ //#ifdef MP
1344
+ const fs = uni.getFileSystemManager(); //全局唯一的文件管理器
1345
+ const filePath = wx.env.USER_DATA_PATH + `/${(this.dataObj().config.formName || '文件下载')}.xls`
1346
+ fs.writeFile({
1347
+ filePath, //这里填文件的名字
1348
+ data,
1349
+ encoding: "binary",
1350
+ success(res) {
1351
+ uni.openDocument({
1352
+ showMenu: true,
1353
+ filePath,
1354
+ success: function (res) {
1355
+ console.log('打开文档成功');
1356
+ }
1357
+ });
1358
+ }
1359
+ })
1360
+ //#endif
1361
+ //#ifdef H5
1362
+ let url = window.URL.createObjectURL(new Blob([data]));
1363
+ let link = document.createElement("a");
1364
+ link.style.display = "none";
1365
+ link.href = url;
1366
+ link.setAttribute("download", (this.dataObj().config.formName || '文件下载') + ".pdf");
1367
+ document.body.appendChild(link);
1368
+ link.click();
1369
+ document.body.removeChild(link); //下载完成移除元素
1370
+ window.URL.revokeObjectURL(url); //释放掉blob对象
1371
+ //#endif
1372
+ })
1373
+ }
1374
+ },
1278
1375
  /**纠错**/
1279
1376
  CorrentItem() {
1280
1377
  getApp().globalData.correntFormData
@@ -1851,11 +1948,10 @@ export default {
1851
1948
  this.validateInit()
1852
1949
  })
1853
1950
  var departType = this.widget.options.departType ? this.widget.options.departType : ''
1854
- var departTypeAFDesign = this.widget.options.departTypeAFDesign ? this.widget.options.departTypeAFDesign : ''
1855
1951
  uni.navigateTo({
1856
1952
  url: '/pages/picker/depart?sign=' + PubsubSign + '&multiple=' + flag + '&departRela=' +
1857
1953
  departRela + '&selectedDepart=' + JSON.stringify(this.dataModel ? this.dataModel : []) + '&departType=' +
1858
- departType + '&departTypeAFDesign=' + departTypeAFDesign
1954
+ departType
1859
1955
  });
1860
1956
  },
1861
1957
  // 获取EvanForm组件
@@ -2321,19 +2417,16 @@ checkbox-group label {
2321
2417
  &--top {
2322
2418
  .evan-form-item-container__label {
2323
2419
  // padding-bottom: 10upx;
2324
- color: #000000 !important;
2420
+ color: #000000;
2325
2421
  }
2326
2422
  }
2327
2423
  }
2328
2424
 
2329
2425
  ::v-deep .form-input-placeholder {
2330
2426
  // line-height: 90upx;
2331
- color: #555 !important;
2427
+ color: #555;
2332
2428
  }
2333
2429
 
2334
- ::v-deep .form-input-placeholder-textarea {
2335
- text-align: left !important;
2336
- }
2337
2430
  .form-textarea-placeholder {
2338
2431
  padding-top: 28upx;
2339
2432
  font-size: 34upx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.314",
3
+ "version": "1.0.316",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",