|
@@ -38,7 +38,15 @@
|
|
)
|
|
)
|
|
"
|
|
"
|
|
>
|
|
>
|
|
- <div
|
|
|
|
|
|
+ <img
|
|
|
|
+ v-for="(item1, index1) in scope.row[scope.column.property].value"
|
|
|
|
+ :key="index1"
|
|
|
|
+ :src="getFileTypeIcon(item1)"
|
|
|
|
+ alt=""
|
|
|
|
+ class="pic-icon"
|
|
|
|
+ @click="onPreview(item1, scope.row[scope.column.property].value)"
|
|
|
|
+ />
|
|
|
|
+ <!-- <div
|
|
v-for="(item1, index1) in scope.row[scope.column.property].value"
|
|
v-for="(item1, index1) in scope.row[scope.column.property].value"
|
|
:key="index1"
|
|
:key="index1"
|
|
class="flex_row"
|
|
class="flex_row"
|
|
@@ -73,7 +81,7 @@
|
|
style="margin-left: 10px"
|
|
style="margin-left: 10px"
|
|
@click.native="onDownLoad(item1)"
|
|
@click.native="onDownLoad(item1)"
|
|
></el-link>
|
|
></el-link>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
</template>
|
|
</template>
|
|
<span v-else>{{ fieldFormatter(scope.row, scope.column) }}</span>
|
|
<span v-else>{{ fieldFormatter(scope.row, scope.column) }}</span>
|
|
</template>
|
|
</template>
|
|
@@ -85,6 +93,7 @@
|
|
<script>
|
|
<script>
|
|
import { downloadFile } from "@/utils";
|
|
import { downloadFile } from "@/utils";
|
|
import { fieldExportAPI } from "@/api/serviceProviderOrder";
|
|
import { fieldExportAPI } from "@/api/serviceProviderOrder";
|
|
|
|
+import { getFileIconWithSuffix } from "@/utils";
|
|
import Clipboard from "clipboard";
|
|
import Clipboard from "clipboard";
|
|
let clipboard = null;
|
|
let clipboard = null;
|
|
export default {
|
|
export default {
|
|
@@ -176,6 +185,21 @@ export default {
|
|
created() {},
|
|
created() {},
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getFileTypeIcon(file) {
|
|
|
|
+ const temps = file.url ? file.url.split(".") : [];
|
|
|
|
+ let ext = "";
|
|
|
|
+ if (file.fileType) {
|
|
|
|
+ ext = file.fileType;
|
|
|
|
+ } else if (temps.length > 0) {
|
|
|
|
+ ext = temps[temps.length - 1];
|
|
|
|
+ } else {
|
|
|
|
+ ext = "";
|
|
|
|
+ }
|
|
|
|
+ if (["jpg", "jpeg", "png"].includes(ext)) {
|
|
|
|
+ return file.url;
|
|
|
|
+ }
|
|
|
|
+ return getFileIconWithSuffix(ext);
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* 通过回调控制class
|
|
* 通过回调控制class
|
|
*/
|
|
*/
|
|
@@ -285,16 +309,23 @@ export default {
|
|
fieldId: this.component.id,
|
|
fieldId: this.component.id,
|
|
ticketId: this.ticketId,
|
|
ticketId: this.ticketId,
|
|
})
|
|
})
|
|
- .then(() => {
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
+ if (res.code !== 0) {
|
|
|
|
+ this.$alert(res.msg, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: "/utils/downLoad/list",
|
|
path: "/utils/downLoad/list",
|
|
query: {
|
|
query: {
|
|
bizType: "CUSTOM_FORM_FIELD",
|
|
bizType: "CUSTOM_FORM_FIELD",
|
|
},
|
|
},
|
|
});
|
|
});
|
|
- this.exportLoading = false;
|
|
|
|
})
|
|
})
|
|
- .catch(() => {
|
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ console.log(err.response);
|
|
this.exportLoading = false;
|
|
this.exportLoading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -303,4 +334,10 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
+.pic-icon {
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|