design.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <div class="mod-demo-echarts">
  3. <el-breadcrumb class="divi2" separator-class="el-icon-arrow-right">
  4. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  5. <el-breadcrumb-item>可视化设计</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-divider class="divi"></el-divider>
  8. <!-- <design-graph></design-graph> -->
  9. <el-form
  10. :inline="true"
  11. :model="dataForm"
  12. @keyup.enter.native="getDataList()"
  13. >
  14. <el-form-item>
  15. <el-button type="primary" @click="addHandle()">新建实验</el-button>
  16. <el-button
  17. type="danger"
  18. @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button
  19. >
  20. </el-form-item>
  21. <el-form-item>
  22. <el-input
  23. v-model="dataForm.workflowName"
  24. placeholder="请输入实验名称"
  25. clearable
  26. @keyup.enter.native="
  27. pageIndex = 1;
  28. getDataList();
  29. "
  30. ></el-input>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button
  34. @click="
  35. pageIndex = 1;
  36. getDataList();
  37. "
  38. >查询</el-button
  39. >
  40. </el-form-item>
  41. </el-form>
  42. <el-table
  43. :data="dataList"
  44. border
  45. v-loading="dataListLoading"
  46. @selection-change="selectionChangeHandle"
  47. style="width: 100%"
  48. >
  49. <el-table-column
  50. type="selection"
  51. header-align="center"
  52. align="center"
  53. width="50"
  54. >
  55. </el-table-column>
  56. <!-- <el-table-column prop="datasetId" header-align="center" align="center" width="80" label="数据集ID">-->
  57. <!-- </el-table-column>-->
  58. <el-table-column
  59. label="序号"
  60. header-align="center"
  61. align="center"
  62. width="80"
  63. type="index"
  64. :index="
  65. (index) => {
  66. return index + 1 + (this.pageIndex - 1) * this.pageSize;
  67. }
  68. "
  69. >
  70. </el-table-column>
  71. <el-table-column
  72. prop="experimentName"
  73. header-align="center"
  74. align="center"
  75. label="实验名称"
  76. >
  77. </el-table-column>
  78. <!-- <el-table-column
  79. prop="username"
  80. header-align="center"
  81. align="center"
  82. label="创建人"
  83. >
  84. </el-table-column> -->
  85. <el-table-column
  86. prop="workflowtempName"
  87. header-align="center"
  88. align="center"
  89. label="模板名称"
  90. >
  91. </el-table-column>
  92. <el-table-column
  93. prop="workflowName"
  94. header-align="center"
  95. align="center"
  96. label="工作流名称"
  97. >
  98. </el-table-column>
  99. <el-table-column
  100. fixed="right"
  101. header-align="center"
  102. align="center"
  103. label="操作"
  104. >
  105. <template slot-scope="scope">
  106. <el-button
  107. type="text"
  108. size="small"
  109. @click="addOrUpdateHandle(scope.row)"
  110. >查看
  111. </el-button>
  112. <el-button
  113. type="text"
  114. size="small"
  115. @click="addOrUpdateHandle(scope.row)"
  116. >修改</el-button
  117. >
  118. <el-button
  119. type="text"
  120. size="small"
  121. @click="deleteHandle(scope.row)"
  122. >
  123. 删除</el-button
  124. >
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <el-pagination
  129. @size-change="sizeChangeHandle"
  130. @current-change="currentChangeHandle"
  131. :current-page="pageIndex"
  132. :page-sizes="[10, 20, 50, 100]"
  133. :page-size="pageSize"
  134. :total="totalPage"
  135. layout="total, sizes, prev, pager, next, jumper"
  136. >
  137. </el-pagination>
  138. </div>
  139. </template>
  140. <script>
  141. import { info } from '../../../mock/modules/sys-menu';
  142. // import DesignGraph from "./design-graph.vue"
  143. import DesignGraph1 from "./design-graph1.vue";
  144. import { Message } from "element-ui";
  145. import { MessageBox } from "element-ui";
  146. export default {
  147. components: {
  148. // DesignGraph,
  149. DesignGraph1,
  150. },
  151. data() {
  152. return {
  153. dataForm: {
  154. key: "",
  155. },
  156. username: this.$store.state.user.name,
  157. dataList: [],
  158. pageIndex: 1,
  159. pageSize: 10,
  160. totalPage: 0,
  161. dataListLoading: false,
  162. dataListSelections: [],
  163. addOrUpdateVisible: false,
  164. };
  165. },
  166. mounted() {},
  167. activated() {
  168. // if (location.href.indexOf("#reloaded") == -1) {
  169. // location.href = location.href + "#reloaded";
  170. // location.reload();
  171. // }
  172. this.getDataList();
  173. },
  174. methods: {
  175. addHandle() {
  176. this.$router.replace({ path: "/design-create" ,query: {
  177. update: false
  178. }});
  179. },
  180. getDataList() {
  181. this.dataListLoading = true;
  182. this.$http({
  183. url: this.$http.adornUrl("/visi/visiworkflow/list"),
  184. method: "get",
  185. params: this.$http.adornParams({
  186. page: this.pageIndex,
  187. limit: this.pageSize,
  188. key: this.dataForm.key,
  189. }),
  190. }).then(({ data }) => {
  191. if (data && data.code === 0) {
  192. this.dataList = data.page.list;
  193. this.totalPage = data.page.totalCount;
  194. } else {
  195. this.dataList = [];
  196. this.totalPage = 0;
  197. }
  198. this.dataListLoading = false;
  199. });
  200. },
  201. // 筛选查询
  202. getDataList2 () {
  203. this.dataListLoading = true
  204. if (this.status === '1') {
  205. // 获取静态数据集
  206. this.st_dataList = []
  207. this.$http({
  208. url: this.$http.adornUrl('/dataset/list'),
  209. method: 'get',
  210. params: this.$http.adornParams({
  211. page: this.pageIndex,
  212. limit: this.pageSize,
  213. modelName: this.dataForm.modelName,
  214. // 增加status参数用于筛选查询
  215. classificationtag: this.classificationtag,
  216. status: this.status
  217. })
  218. }).then(({ data }) => {
  219. if (data && data.code === 0) {
  220. this.st_dataList = data.page.list.reverse()
  221. this.totalPage = data.page.totalCount
  222. } else {
  223. this.st_dataList = []
  224. this.totalPage = 0
  225. }
  226. this.dataListLoading = false
  227. })
  228. } else {
  229. this.dy_dataList = []
  230. // 获取动态数据集
  231. this.$http({
  232. url: this.$http.adornUrl('/datasetdy/list'),
  233. method: 'get',
  234. params: this.$http.adornParams({
  235. page: this.pageIndex,
  236. limit: this.pageSize,
  237. modelName: this.dataForm.modelName,
  238. // 增加status参数用于筛选查询
  239. classificationtag: this.classificationtag,
  240. status: this.status
  241. })
  242. }).then(({ data }) => {
  243. if (data && data.code === 0) {
  244. this.dy_dataList = data.page.list.reverse()
  245. this.totalPage = data.page.totalCount
  246. } else {
  247. this.dy_dataList = []
  248. this.totalPage = 0
  249. }
  250. this.dataListLoading = false
  251. })
  252. this.dataListLoading = false
  253. }
  254. },
  255. // 每页数
  256. sizeChangeHandle(val) {
  257. this.pageSize = val;
  258. this.pageIndex = 1;
  259. this.getDataList();
  260. },
  261. // 当前页
  262. currentChangeHandle(val) {
  263. this.pageIndex = val;
  264. this.getDataList();
  265. },
  266. // 多选
  267. selectionChangeHandle(val) {
  268. this.dataListSelections = val;
  269. },
  270. // 新增 / 修改
  271. addOrUpdateHandle(info) {
  272. // this.addOrUpdateVisible = true;
  273. // this.$nextTick(() => {
  274. // this.$refs.addOrUpdate.init(info);
  275. // });
  276. this.$router.replace({ path: '/design-create' ,query: {
  277. winfo: info,update: true
  278. },})
  279. },
  280. // // 删除
  281. // deleteHandle (info) {
  282. // var datasetId = info.datasetId
  283. // ? [info.datasetId] : this.dataListSelections.map((item) => {
  284. // return item.datasetId
  285. // })
  286. // var datasetName = info.datasetName ? [info.datasetName] : this.dataListSelections.map(item => {
  287. // return item.datasetName
  288. // })
  289. // MessageBox.confirm(
  290. // `确定对[数据集=${datasetName.join(' , ')}]进行[${info.datasetId ? '删除' : '批量删除'}]操作?`,
  291. // '提示',
  292. // {
  293. // confirmButtonText: '确定',
  294. // cancelButtonText: '取消',
  295. // type: 'warning'
  296. // }
  297. // )
  298. // .then(() => {
  299. // this.dataListLoading = true
  300. // this.$http({
  301. // url: this.$http.adornUrl('/dataset/delete'),
  302. // method: 'post',
  303. // data: this.$http.adornData(datasetId, false)
  304. // }).then(({ data }) => {
  305. // if (data && data.code === 0) {
  306. // this.dataListLoading = false
  307. // Message({
  308. // message: '操作成功',
  309. // type: 'success',
  310. // duration: 1500,
  311. // onClose: () => {
  312. // this.getDataList()
  313. // }
  314. // })
  315. // this.pageIndex = 1
  316. // } else {
  317. // Message.error(data.msg)
  318. // }
  319. // })
  320. // })
  321. // .catch(() => {})
  322. // },
  323. // 删除
  324. deleteHandle(info) {
  325. var ids = info.workflowId
  326. ? [info.workflowId]
  327. : this.dataListSelections.map((item) => {
  328. return item.workflowId;
  329. });
  330. var experimentName = info.experimentName ? [info.experimentName] : this.dataListSelections.map(item => {
  331. return item.experimentName
  332. })
  333. MessageBox.confirm(
  334. `确定对[实验=${experimentName.join(' , ')}]进行[${info.workflowId ? "删除" : "批量删除"}]操作?`,
  335. "提示",
  336. {
  337. confirmButtonText: "确定",
  338. cancelButtonText: "取消",
  339. type: "warning",
  340. }
  341. ).then(() => {
  342. this.$http({
  343. url: this.$http.adornUrl("/visi/visiworkflow/delete"),
  344. method: "post",
  345. data: this.$http.adornData(ids, false),
  346. }).then(({ data }) => {
  347. if (data && data.code === 0) {
  348. this.$message({
  349. message: "操作成功",
  350. type: "success",
  351. duration: 1500,
  352. onClose: () => {
  353. this.getDataList();
  354. },
  355. });
  356. } else {
  357. this.$message.error(data.msg);
  358. }
  359. });
  360. });
  361. },
  362. },
  363. };
  364. </script>
  365. <style lang="scss">
  366. .mod-demo-echarts {
  367. > .el-alert {
  368. margin-bottom: 10px;
  369. }
  370. > .el-row {
  371. margin-top: -10px;
  372. margin-bottom: -10px;
  373. .el-col {
  374. padding-top: 10px;
  375. padding-bottom: 10px;
  376. }
  377. }
  378. .chart-box {
  379. min-height: 400px;
  380. }
  381. }
  382. .divi {
  383. display: block;
  384. height: 1px;
  385. width: 100%;
  386. margin: 24px 0;
  387. background-color: #dcdfe6;
  388. position: relative;
  389. }
  390. .divi2 {
  391. display: block;
  392. height: 1px;
  393. width: 100%;
  394. position: relative;
  395. }
  396. </style>