algorithmsPlatformList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div>
  3. <search-layout :needBox="true">
  4. <!--<template slot="searchItem1">
  5. <span class="label">ID</span>
  6. <el-input
  7. v-model="searchParams.algorithmCode"
  8. size="small"
  9. clearable
  10. placeholder="请输入"
  11. maxlength="60"
  12. >
  13. </el-input>
  14. </template>-->
  15. <template slot="searchItem2">
  16. <span class="label">算法名称</span>
  17. <el-input
  18. v-model="searchParams.algorithmName"
  19. size="small"
  20. clearable
  21. placeholder="请输入"
  22. maxlength="60"
  23. >
  24. </el-input>
  25. </template>
  26. <template slot="searchItem3">
  27. <span class="label">算法描述</span>
  28. <el-input
  29. v-model="searchParams.description"
  30. size="small"
  31. clearable
  32. placeholder="请输入"
  33. maxlength="60"
  34. >
  35. </el-input>
  36. </template>
  37. <!--<template slot="searchItem4">
  38. <span class="label">校验状态</span>
  39. <el-select v-model="searchParams.validationStatus">
  40. <el-option
  41. v-for="item in validationStatusList"
  42. :label="item.caption"
  43. :value="item.code"
  44. :key="item.code"
  45. ></el-option>
  46. </el-select>
  47. </template>-->
  48. <template slot="searchBtn1">
  49. <el-button type="primary" @click="doSearch">查询</el-button>
  50. </template>
  51. <template slot="searchBtn2">
  52. <el-button type="primary" @click="doReset">重置</el-button>
  53. </template>
  54. </search-layout>
  55. <div class="myTabsBox myTabsBoxThreeTabs">
  56. <!--<el-button
  57. v-bind:class="{ addBtn: true}"
  58. icon="el-icon-circle-plus-outline"
  59. @click="addOne"
  60. type="primary"
  61. >新增</el-button
  62. >-->
  63. </div>
  64. <tableList
  65. ref="table"
  66. style="margin: 0 30px"
  67. :columns="columns"
  68. :getDataWay="getDataWay"
  69. :pagination="pagination"
  70. tooltip-effect="light"
  71. index
  72. >
  73. </tableList>
  74. </div>
  75. </template>
  76. <script>
  77. import searchLayout from "@/components/grid/searchLayout";
  78. import tableList from "@/components/grid/TableList";
  79. export default {
  80. name: "algorithmsPlatformList", // 算法平台
  81. components: { searchLayout, tableList },
  82. data() {
  83. return {
  84. searchParams: {
  85. //搜索参数
  86. //algorithmCode: "", // ID
  87. algorithmName: "", // 算法名称
  88. description: "", // 算法描述
  89. //uploadMode: "", // 私有类型
  90. },
  91. getDataWay:{
  92. //加载表格数据
  93. dataType: "url",
  94. //dataType: "data",
  95. type: "post",
  96. // firstRequest: false,
  97. data: this.$api.algorithmsLibrary.selectAlgoPlatformList,
  98. /*data:[
  99. {
  100. algorithmCode:'111',
  101. algorithmName:'111',
  102. description:
  103. '打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲哈维打款哈对我来讲'
  104. }
  105. ],*/
  106. param: {},
  107. },
  108. columns: [
  109. //表格列
  110. {
  111. label: "ID",
  112. prop: "algorithmCode",
  113. },
  114. {
  115. label: "算法名称",
  116. prop: "algorithmName",
  117. },
  118. {
  119. label: "算法描述",
  120. prop: "description",
  121. showOverflowTooltip: true
  122. },
  123. ],
  124. pagination: {
  125. //分页使用
  126. currentPage: 1,
  127. pageSize: 10,
  128. position: "right",
  129. pageSizes: [10, 30, 50, 100, 200],
  130. layout: "sizes, total, prev, pager, next, jumper",
  131. },
  132. };
  133. },
  134. computed: {
  135. },
  136. methods: {
  137. doSearch() {
  138. this.$nextTick(() => {
  139. this.refreshList(this.searchParams);
  140. });
  141. },
  142. //刷新table
  143. refreshList(param) {
  144. param
  145. ? this.$refs["table"].loadData(param)
  146. : this.$refs["table"].loadData();
  147. },
  148. doReset() {
  149. this.searchParams = {
  150. //algorithmCode: "",
  151. algorithmName: "",
  152. description: "",
  153. //uploadMode: "",
  154. };
  155. this.doSearch();
  156. },
  157. addOne() {
  158. },
  159. editRow(row) {
  160. },
  161. delOne(row) {
  162. this.$confirm("确认是否删除?", "提示", {
  163. confirmButtonText: "确定",
  164. cancelButtonText: "取消",
  165. type: "warning",
  166. }).then(() => {
  167. this.$axios({
  168. method: "post",
  169. url: this.$api.algorithmsLibrary.deleteByid,
  170. data: {
  171. id: row.id,
  172. },
  173. }).then((res) => {
  174. if (res.code == 200) {
  175. this.$message.success("删除成功");
  176. } else {
  177. this.$message.error(res.message || "删除失败");
  178. }
  179. this.doSearch();
  180. });
  181. });
  182. },
  183. shareRow(row) {
  184. this.$confirm("确认是否分享?", "提示", {
  185. confirmButtonText: "确定",
  186. cancelButtonText: "取消",
  187. type: "warning",
  188. }).then(() => {
  189. this.$axios({
  190. method: "post",
  191. url: this.$api.algorithmsLibrary.shareAlgorithm,
  192. data: {
  193. id: row.id,
  194. },
  195. }).then((res) => {
  196. if (res.code == 200) {
  197. this.$message.success("分享成功");
  198. } else {
  199. this.$message.error(res.message || "分享失败");
  200. }
  201. this.doSearch();
  202. });
  203. });
  204. },
  205. },
  206. async mounted() {
  207. /*await this.$dicsListsInit({
  208. validationStatusList: "validationStatus",
  209. });*/
  210. },
  211. };
  212. </script>
  213. <style scoped lang="less">
  214. .tabsBox {
  215. position: relative;
  216. overflow: hidden;
  217. .el-button {
  218. position: absolute;
  219. right: 40px;
  220. top: 45px;
  221. }
  222. }
  223. .myTabsBox{
  224. min-height:29px;
  225. }
  226. </style>