123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- <template>
- <div class="mod-demo-echarts">
- <el-breadcrumb class="divi2" separator-class="el-icon-arrow-right">
- <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
- <el-breadcrumb-item>可视化设计</el-breadcrumb-item>
- </el-breadcrumb>
- <el-divider class="divi"></el-divider>
- <!-- <design-graph></design-graph> -->
- <el-form
- :inline="true"
- :model="dataForm"
- @keyup.enter.native="getDataList()"
- >
- <el-form-item>
- <el-button type="primary" @click="addHandle()">新建实验</el-button>
- <el-button
- type="danger"
- @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button
- >
- </el-form-item>
- <el-form-item>
- <el-input
- v-model="dataForm.workflowName"
- placeholder="请输入实验名称"
- clearable
- @keyup.enter.native="
- pageIndex = 1;
- getDataList();
- "
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button
- @click="
- pageIndex = 1;
- getDataList();
- "
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- <el-table
- :data="dataList"
- border
- v-loading="dataListLoading"
- @selection-change="selectionChangeHandle"
- style="width: 100%"
- >
- <el-table-column
- type="selection"
- header-align="center"
- align="center"
- width="50"
- >
- </el-table-column>
- <!-- <el-table-column prop="datasetId" header-align="center" align="center" width="80" label="数据集ID">-->
- <!-- </el-table-column>-->
- <el-table-column
- label="序号"
- header-align="center"
- align="center"
- width="80"
- type="index"
- :index="
- (index) => {
- return index + 1 + (this.pageIndex - 1) * this.pageSize;
- }
- "
- >
- </el-table-column>
- <el-table-column
- prop="experimentName"
- header-align="center"
- align="center"
- label="实验名称"
- >
- </el-table-column>
- <!-- <el-table-column
- prop="username"
- header-align="center"
- align="center"
- label="创建人"
- >
- </el-table-column> -->
- <el-table-column
- prop="workflowtempName"
- header-align="center"
- align="center"
- label="模板名称"
- >
- </el-table-column>
- <el-table-column
- prop="workflowName"
- header-align="center"
- align="center"
- label="工作流名称"
- >
- </el-table-column>
- <el-table-column
- fixed="right"
- header-align="center"
- align="center"
- label="操作"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- size="small"
- @click="addOrUpdateHandle(scope.row)"
- >查看
- </el-button>
- <el-button
- type="text"
- size="small"
- @click="addOrUpdateHandle(scope.row)"
- >修改</el-button
- >
- <el-button
- type="text"
- size="small"
- @click="deleteHandle(scope.row)"
- >
- 删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper"
- >
- </el-pagination>
- </div>
- </template>
- <script>
- import { info } from '../../../mock/modules/sys-menu';
- // import DesignGraph from "./design-graph.vue"
- import DesignGraph1 from "./design-graph1.vue";
- import { Message } from "element-ui";
- import { MessageBox } from "element-ui";
- export default {
- components: {
- // DesignGraph,
- DesignGraph1,
- },
- data() {
- return {
- dataForm: {
- key: "",
- },
- username: this.$store.state.user.name,
- dataList: [],
- pageIndex: 1,
- pageSize: 10,
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: [],
- addOrUpdateVisible: false,
- };
- },
- mounted() {},
- activated() {
- // if (location.href.indexOf("#reloaded") == -1) {
- // location.href = location.href + "#reloaded";
- // location.reload();
- // }
- this.getDataList();
- },
- methods: {
- addHandle() {
- this.$router.replace({ path: "/design-create" ,query: {
- update: false
- }});
- },
- getDataList() {
- this.dataListLoading = true;
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/list"),
- method: "get",
- params: this.$http.adornParams({
- page: this.pageIndex,
- limit: this.pageSize,
- key: this.dataForm.key,
- }),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.dataList = data.page.list;
- this.totalPage = data.page.totalCount;
- } else {
- this.dataList = [];
- this.totalPage = 0;
- }
- this.dataListLoading = false;
- });
- },
- // 筛选查询
- getDataList2 () {
- this.dataListLoading = true
- if (this.status === '1') {
- // 获取静态数据集
- this.st_dataList = []
- this.$http({
- url: this.$http.adornUrl('/dataset/list'),
- method: 'get',
- params: this.$http.adornParams({
- page: this.pageIndex,
- limit: this.pageSize,
- modelName: this.dataForm.modelName,
- // 增加status参数用于筛选查询
- classificationtag: this.classificationtag,
- status: this.status
- })
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.st_dataList = data.page.list.reverse()
- this.totalPage = data.page.totalCount
- } else {
- this.st_dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- } else {
- this.dy_dataList = []
- // 获取动态数据集
- this.$http({
- url: this.$http.adornUrl('/datasetdy/list'),
- method: 'get',
- params: this.$http.adornParams({
- page: this.pageIndex,
- limit: this.pageSize,
- modelName: this.dataForm.modelName,
- // 增加status参数用于筛选查询
- classificationtag: this.classificationtag,
- status: this.status
- })
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.dy_dataList = data.page.list.reverse()
- this.totalPage = data.page.totalCount
- } else {
- this.dy_dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- this.dataListLoading = false
- }
- },
-
- // 每页数
- sizeChangeHandle(val) {
- this.pageSize = val;
- this.pageIndex = 1;
- this.getDataList();
- },
- // 当前页
- currentChangeHandle(val) {
- this.pageIndex = val;
- this.getDataList();
- },
- // 多选
- selectionChangeHandle(val) {
- this.dataListSelections = val;
- },
- // 新增 / 修改
- addOrUpdateHandle(info) {
- // this.addOrUpdateVisible = true;
- // this.$nextTick(() => {
- // this.$refs.addOrUpdate.init(info);
- // });
- this.$router.replace({ path: '/design-create' ,query: {
- winfo: info,update: true
- },})
- },
- // // 删除
- // deleteHandle (info) {
- // var datasetId = info.datasetId
- // ? [info.datasetId] : this.dataListSelections.map((item) => {
- // return item.datasetId
- // })
- // var datasetName = info.datasetName ? [info.datasetName] : this.dataListSelections.map(item => {
- // return item.datasetName
- // })
- // MessageBox.confirm(
- // `确定对[数据集=${datasetName.join(' , ')}]进行[${info.datasetId ? '删除' : '批量删除'}]操作?`,
- // '提示',
- // {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning'
- // }
- // )
- // .then(() => {
- // this.dataListLoading = true
- // this.$http({
- // url: this.$http.adornUrl('/dataset/delete'),
- // method: 'post',
- // data: this.$http.adornData(datasetId, false)
- // }).then(({ data }) => {
- // if (data && data.code === 0) {
- // this.dataListLoading = false
- // Message({
- // message: '操作成功',
- // type: 'success',
- // duration: 1500,
- // onClose: () => {
- // this.getDataList()
- // }
- // })
- // this.pageIndex = 1
- // } else {
- // Message.error(data.msg)
- // }
- // })
- // })
- // .catch(() => {})
- // },
- // 删除
- deleteHandle(info) {
- var ids = info.workflowId
- ? [info.workflowId]
- : this.dataListSelections.map((item) => {
- return item.workflowId;
- });
- var experimentName = info.experimentName ? [info.experimentName] : this.dataListSelections.map(item => {
- return item.experimentName
- })
- MessageBox.confirm(
- `确定对[实验=${experimentName.join(' , ')}]进行[${info.workflowId ? "删除" : "批量删除"}]操作?`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- ).then(() => {
- this.$http({
- url: this.$http.adornUrl("/visi/visiworkflow/delete"),
- method: "post",
- data: this.$http.adornData(ids, false),
- }).then(({ data }) => {
- if (data && data.code === 0) {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.getDataList();
- },
- });
- } else {
- this.$message.error(data.msg);
- }
- });
- });
- },
- },
- };
- </script>
- <style lang="scss">
- .mod-demo-echarts {
- > .el-alert {
- margin-bottom: 10px;
- }
- > .el-row {
- margin-top: -10px;
- margin-bottom: -10px;
- .el-col {
- padding-top: 10px;
- padding-bottom: 10px;
- }
- }
- .chart-box {
- min-height: 400px;
- }
- }
- .divi {
- display: block;
- height: 1px;
- width: 100%;
- margin: 24px 0;
- background-color: #dcdfe6;
- position: relative;
- }
- .divi2 {
- display: block;
- height: 1px;
- width: 100%;
- position: relative;
- }
- </style>
|