floorTable.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="filterTable-container">
  3. <el-table ref="filterTable" :data="tableData" style="width: 100%" height="100%" :header-cell-style="{background:'#d9d9d9',color:'#2b2b2b'}">
  4. <el-table-column prop="floorName" label="模型文件" width="180">
  5. <template slot-scope="scope">
  6. <i v-if="scope.row.status == 4" class="iconfont icon-yun--tianchong" style="color:#67C23A;cursor:pointer;fontSize:18px;" title="模型校验完成..."
  7. @click="toPathControl(scope.row)"></i>
  8. <i v-else-if="scope.row.status == 31" class="iconfont icon-yun--tianchong1" style="color:#F56C6C;cursor:pointer;fontSize:18px;"
  9. title="同步到数据中心出问题..." @click="toPathControl(scope.row)"></i>
  10. <i v-else-if="scope.row.status == 21" class="iconfont icon-yun--tianchong1" style="color:#F56C6C;cursor:pointer;fontSize:18px;"
  11. title="模型数据导出出问题..." @click="toPathControl(scope.row)"></i>
  12. <i v-else class="iconfont icon-yun--tianchong2" style="color:#E6A23C;cursor:pointer;fontSize:18px;" title="模型校验进行中..."
  13. @click="toPathControl(scope.row)"></i>
  14. <span style="margin-left: 10px">{{ scope.row.floorName }}</span>
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="note" label="备注" width="240"></el-table-column>
  18. <el-table-column label="版本号">
  19. <template slot-scope="scope">
  20. <span style="margin-right: 5px">{{ scope.row.version }}</span>
  21. <i v-show="scope.row.version && scope.row.status == 4" class="iconfont icon-warn" style="cursor:pointer;position:relative;top:1px;" title="查看版本更新信息" @click="handleClickVersion(scope.row)"></i>
  22. </template>
  23. </el-table-column>
  24. <el-table-column prop="revitVersion" label="revit版本"></el-table-column>
  25. <el-table-column prop="acceptTime" label="上传时间" width="200"></el-table-column>
  26. <el-table-column prop="userName" label="上传人"></el-table-column>
  27. <el-table-column prop="address" align="center" label="操作" width="240">
  28. <template slot-scope="scope">
  29. <div class="operate" v-show="scope.row.status == 4">
  30. <el-button title="下载模型" type="primary" size="mini" class="iconfont icon-download" @click="downloadModel(scope.row)"></el-button>
  31. <el-button title="替换模型" type="primary" size="mini" class="iconfont icon-replace" @click="repliaceModel(scope.row)"></el-button>
  32. <el-button title="查看版本日志" type="primary" size="mini" class="iconfont icon-Log" @click="queryModelLog(scope.row)"></el-button>
  33. <el-button title="下载BIMID模型" type="primary" size="mini" class="el-icon-download" @click="downloadModelBIMID(scope.row)"></el-button>
  34. </div>
  35. <div :class="['upLoad-loading']" v-show="scope.row.status != 4">
  36. <div class="progress">
  37. <el-progress :text-inside="false" :stroke-width="20" :percentage="100" :color="scope.row.status?'#909399':'#67C23A'"></el-progress>
  38. </div>
  39. <div class="progress-right">
  40. <span v-if="!scope.row.status">上传中...</span>
  41. <span v-else-if="scope.row.status == 1">等待检查...</span>
  42. <span v-else>模型检查中...</span>
  43. <!-- <span v-show="!scope.row.Status">上传中...</span>
  44. <span v-show="scope.row.Status == 1">等待检查...</span>
  45. <span v-show="scope.row.Status == 10">模型检查中...</span>
  46. <span v-show="scope.row.Status == 11">未通过检查</span>
  47. <span v-show="scope.row.Status == 2 || scope.row.Status == 20">等待数据导出...</span>
  48. <span v-show="scope.row.Status == 21">模型数据导出失败</span>
  49. <span v-show="scope.row.Status == 3">处理导出数据中...</span>
  50. <span v-show="scope.row.Status == 31">同步到数据中心失败</span> -->
  51. </div>
  52. </div>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <version-dialog :dialogVisible.sync="dialogVisible" :modelFile="modelFile" ref="addSpaceDialog"></version-dialog>
  57. </div>
  58. </template>
  59. <script>
  60. import { mapGetters } from "vuex";
  61. import versionDialog from "@/components/model/file/versionDialog";
  62. export default {
  63. components: {
  64. versionDialog
  65. },
  66. props: {
  67. tableData: Array,
  68. persentList: Array,
  69. modelFolderName: String
  70. },
  71. data() {
  72. return {
  73. maxHeight: 0,
  74. dialogVisible: false,
  75. modelFile: null
  76. };
  77. },
  78. computed: {
  79. ...mapGetters("layout", ["projectId", "userInfo", "userId", "secret"])
  80. },
  81. methods: {
  82. // 查看日志
  83. queryModelLog(item) {
  84. this.$emit("openModelLog", item);
  85. },
  86. // 查看版本信息
  87. handleClickVersion(item) {
  88. this.modelFile = item;
  89. this.dialogVisible = true;
  90. },
  91. // 替换日志
  92. repliaceModel(item) {
  93. if (item.Status != 4) {
  94. this.$alert("正在识别模型对象,请稍后再替换。", "替换模型", {
  95. confirmButtonText: "确定",
  96. callback: action => {
  97. }
  98. });
  99. } else {
  100. this.$emit("replaceModel", item);
  101. }
  102. },
  103. filterTag(Id, precent) {
  104. this.$refs.filterTable.data.map(item => {
  105. if (item.Id == Id) {
  106. if (precent >= 100) {
  107. // 如过precent == 100 不能关闭进度条,
  108. if (precent == 100) {
  109. item.precent = 99;
  110. } else if (precent == 101) {
  111. // 如过precent == 101 则返回结果为suceess 不能关闭进度条,
  112. item.precent = 100;
  113. this.$emit("percentFinish");
  114. }
  115. return;
  116. } else {
  117. item.precent = precent;
  118. }
  119. }
  120. });
  121. },
  122. // 下载模型文件
  123. downloadModel(item) {
  124. let url = item.Url.match(/(\/image-service\S*)$/g) ? item.Url.match(/(\/image-service\S*)$/g)[0] : ''
  125. if (url) {
  126. let a = document.createElement("a");
  127. a.href = url;
  128. a.download = `${this.modelFolderName}${item.FloorName}模型文件v${item.Version}.rvt`;
  129. a.click();
  130. document.body.removeChild(a);
  131. } else {
  132. this.$message({
  133. message: "该文件夹下没有资源",
  134. type: "error"
  135. });
  136. }
  137. },
  138. // 下载BIMID模型文件
  139. downloadModelBIMID(item) {
  140. let url = item.Url.match(/(\/image-service\S*)$/g) ? item.Url.match(/(\/image-service\S*)$/g)[0] : ''
  141. if (url) {
  142. let a = document.createElement("a");
  143. a.href = url;
  144. a.download = `${this.projectId}${item.FolderId}${item.FloorName}.rvt`;
  145. a.click();
  146. document.body.removeChild(a);
  147. } else {
  148. this.$message({
  149. message: "该文件夹下没有资源",
  150. type: "error"
  151. });
  152. }
  153. },
  154. // 停止上传
  155. closeUpdate(item) {
  156. if (this.userInfo.userName == item.UserName) {
  157. this.$emit("closeUpdateFile", item);
  158. } else {
  159. this.$message({
  160. message: "您不是该文件的上传者,不能停止该文件上传!",
  161. type: "error"
  162. });
  163. }
  164. },
  165. // 跳转至模型流程处理监控
  166. toPathControl(row) {
  167. this.$router.push({
  168. path: '/model/path',
  169. query: {
  170. Id: row.CurrentModelId,
  171. Size: row.Size,
  172. OriginalName: row.OriginalName
  173. }
  174. })
  175. }
  176. },
  177. watch: {
  178. persentList: {
  179. immediate: true,
  180. deep: true,
  181. handler: function (val, oldVal) {
  182. if (val.length != 0) {
  183. val.map(item => {
  184. if (item.precent != 0) {
  185. this.filterTag(item.Id, item.precent);
  186. }
  187. });
  188. }
  189. }
  190. }
  191. }
  192. };
  193. </script>
  194. <style scoped lang="less">
  195. .box-card {
  196. height: 100%;
  197. .filterTable-container {
  198. height: calc(100% - 54px);
  199. margin-bottom: 8px;
  200. }
  201. .operate {
  202. .iconfont {
  203. font-size: 12px;
  204. padding: 7px 12px;
  205. }
  206. }
  207. .icon-termination {
  208. color: #f56c6c;
  209. background: #fff;
  210. padding: 0;
  211. border: 0;
  212. font-size: 20px;
  213. margin-left: 5px;
  214. }
  215. .upLoad {
  216. display: flex;
  217. justify-content: center;
  218. align-items: center;
  219. padding: 4px 0;
  220. .progress {
  221. // width: 150px;
  222. width: 175px;
  223. height: 20px;
  224. }
  225. .progress-right {
  226. height: 20px;
  227. line-height: 20px;
  228. }
  229. }
  230. .upLoad-loading {
  231. position: relative;
  232. justify-content: center;
  233. .progress {
  234. width: 220px;
  235. height: 20px;
  236. }
  237. .progress-right {
  238. position: absolute;
  239. left: 50%;
  240. top: 50%;
  241. transform: translate(-50%, -50%);
  242. color: #fff;
  243. }
  244. }
  245. }
  246. /deep/ .el-icon-warning {
  247. display: none;
  248. // color: transparent;
  249. }
  250. /deep/ .el-progress__text {
  251. display: none;
  252. }
  253. /deep/ .upLoad-loading .el-progress-bar {
  254. padding-right: 44px;
  255. margin-right: -44px;
  256. }
  257. /deep/ .el-progress-bar__inner {
  258. text-align: center;
  259. }
  260. </style>