floorTable.vue 8.0 KB

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