区分项目
This commit is contained in:
@@ -3,8 +3,12 @@
|
|||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="项目名称">
|
<el-form-item label="项目名称">
|
||||||
<el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue"
|
<el-input
|
||||||
placeholder="请输入项目名称"></el-input>
|
maxlength="32"
|
||||||
|
show-word-limit
|
||||||
|
v-model.trim="tableStore.table.params.searchValue"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
@@ -12,45 +16,75 @@
|
|||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<!-- <Table ref="tableRef" /> -->
|
<!-- <Table ref="tableRef" /> -->
|
||||||
<div style="overflow-x: hidden; overflow-y: scroll;padding: 0 10px;" v-loading="tableStore.table.loading"
|
<div
|
||||||
:style="{ height: tableStore.table.height }">
|
style="overflow-x: hidden; overflow-y: scroll; padding: 0 10px"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
:style="{ height: tableStore.table.height }"
|
||||||
|
>
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
<el-col :span="6" v-for="item in tableStore.table.data" :key="item.id" class="mt10">
|
<el-col :span="6" v-for="item in tableStore.table.data" :key="item.id" class="mt10">
|
||||||
<el-card class="box-card" @click="querdata(item)" shadow="hover">
|
<el-card class="box-card" @click="querdata(item)" shadow="hover">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span style="display: flex;align-items: center">{{ item.name }}
|
<span style="display: flex; align-items: center">
|
||||||
|
{{ item.name }}
|
||||||
|
|
||||||
<el-tooltip class="item" effect="dark" content="修改项目" placement="top">
|
<el-tooltip class="item" effect="dark" content="修改项目" placement="top">
|
||||||
<Edit style="margin-left: 5px;width: 16px;" class=" xiaoshou color"
|
<Edit
|
||||||
@click="editd(item)" />
|
style="margin-left: 5px; width: 16px"
|
||||||
</el-tooltip></span>
|
class="xiaoshou color"
|
||||||
<div style="display: flex;justify-content: end;">
|
@click="editd(item)"
|
||||||
<el-button class="color" icon="el-icon-Share" style="padding: 3px 0" type="text"
|
/>
|
||||||
@click="Aclick(item)">设计</el-button>
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
<div style="display: flex; justify-content: end">
|
||||||
|
<el-button
|
||||||
|
class="color"
|
||||||
|
icon="el-icon-Share"
|
||||||
|
style="padding: 3px 0"
|
||||||
|
type="text"
|
||||||
|
@click="Aclick(item)"
|
||||||
|
>
|
||||||
|
设计
|
||||||
|
</el-button>
|
||||||
<!-- <el-button icon="el-icon-share" style="padding: 3px 0; color: green"
|
<!-- <el-button icon="el-icon-share" style="padding: 3px 0; color: green"
|
||||||
type="text" @click="shejid(item)">设计</el-button> -->
|
type="text" @click="shejid(item)">设计</el-button> -->
|
||||||
<!-- <el-button icon="el-icon-edit" style="padding: 3px 0; color: blue" type="text"
|
<!-- <el-button icon="el-icon-edit" style="padding: 3px 0; color: blue" type="text"
|
||||||
@click="shejid(item)">编辑</el-button> -->
|
@click="shejid(item)">编辑</el-button> -->
|
||||||
<el-button icon="el-icon-Delete" style="padding: 3px 0; color: red" type="text"
|
<el-button
|
||||||
@click="deleted(item)">删除</el-button>
|
icon="el-icon-Delete"
|
||||||
|
style="padding: 3px 0; color: red"
|
||||||
|
type="text"
|
||||||
|
@click="deleted(item)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<img v-if="item.fileContent" :src="item.fileContent" class="image xiaoshou" @click="imgData(item)" />
|
<img
|
||||||
<el-empty v-else description="暂无设计" style="height: 220px;"/>
|
v-if="item.fileContent"
|
||||||
|
:src="item.fileContent"
|
||||||
|
class="image xiaoshou"
|
||||||
|
@click="imgData(item)"
|
||||||
|
/>
|
||||||
|
<el-empty v-else description="暂无设计" style="height: 220px" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-pagination">
|
<div class="table-pagination">
|
||||||
<el-pagination :currentPage="tableStore.table.params!.pageNum"
|
<el-pagination
|
||||||
:page-size="tableStore.table.params!.pageSize" :page-sizes="[10, 20, 50, 100]" background
|
:currentPage="tableStore.table.params!.pageNum"
|
||||||
:layout="'sizes,total, ->, prev, pager, next, jumper'" :total="tableStore.table.total"
|
:page-size="tableStore.table.params!.pageSize"
|
||||||
@size-change="onTableSizeChange" @current-change="onTableCurrentChange"></el-pagination>
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
background
|
||||||
|
:layout="'sizes,total, ->, prev, pager, next, jumper'"
|
||||||
|
:total="tableStore.table.total"
|
||||||
|
@size-change="onTableSizeChange"
|
||||||
|
@current-change="onTableCurrentChange"
|
||||||
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<popup ref="popupRef" @submit="tableStore.index()" />
|
<popup ref="popupRef" @submit="tableStore.index()" />
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -61,9 +95,12 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { deleteTopoTemplate, uploadTopo } from '@/api/cs-device-boot/topologyTemplate'
|
import { deleteTopoTemplate, uploadTopo } from '@/api/cs-device-boot/topologyTemplate'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { audit, add } from '@/api/cs-harmonic-boot/mxgraph';
|
import { audit, add } from '@/api/cs-harmonic-boot/mxgraph'
|
||||||
import { Edit } from '@element-plus/icons-vue'
|
import { Edit } from '@element-plus/icons-vue'
|
||||||
import popup from './components/popup.vue'
|
import popup from './components/popup.vue'
|
||||||
|
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'ypt'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'mxgraph/graph-list'
|
name: 'mxgraph/graph-list'
|
||||||
})
|
})
|
||||||
@@ -78,11 +115,8 @@ const tableStore = new TableStore({
|
|||||||
url: '/cs-harmonic-boot/csconfiguration/queryPage',
|
url: '/cs-harmonic-boot/csconfiguration/queryPage',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
publicHeight: 60,
|
publicHeight: 60,
|
||||||
column: [
|
column: [],
|
||||||
],
|
loadCallback: () => {}
|
||||||
loadCallback: () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
@@ -93,12 +127,11 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
// 查询
|
// 查询
|
||||||
const onSubmitadd = () => {
|
const onSubmitadd = () => {
|
||||||
|
|
||||||
popupRef.value.open({
|
popupRef.value.open({
|
||||||
title: '新增项目'
|
title: '新增项目'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const querdata = (e: any) => { }
|
const querdata = (e: any) => {}
|
||||||
const editd = (e: any) => {
|
const editd = (e: any) => {
|
||||||
popupRef.value.open({
|
popupRef.value.open({
|
||||||
title: '修改项目',
|
title: '修改项目',
|
||||||
@@ -107,45 +140,48 @@ const editd = (e: any) => {
|
|||||||
}
|
}
|
||||||
// 设计
|
// 设计
|
||||||
const Aclick = (e: any) => {
|
const Aclick = (e: any) => {
|
||||||
window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
//window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
||||||
// window.open('http://192.168.1.128:4001' + `/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=zl`)
|
window.open(
|
||||||
|
'http://192.168.1.179:4001' +
|
||||||
|
`/zutai/?id=${e.id}&&name=${e.name}&&preview=false&&graphicDisplay=${VITE_FLAG ? 'ypt' : 'zl'}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
// 删除
|
// 删除
|
||||||
const deleted = (e: any) => {
|
const deleted = (e: any) => {
|
||||||
ElMessageBox.confirm("此操作将永久删除该项目, 是否继续?", "提示", {
|
ElMessageBox.confirm('此操作将永久删除该项目, 是否继续?', '提示', {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: '取消',
|
||||||
type: "warning",
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
let data = {
|
let data = {
|
||||||
id: e.id,
|
id: e.id,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
status: "0",
|
status: '0'
|
||||||
};
|
}
|
||||||
audit(data).then((res: any) => {
|
audit(data).then((res: any) => {
|
||||||
if (res.code == "A0000") {
|
if (res.code == 'A0000') {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "success",
|
type: 'success',
|
||||||
message: "删除项目成功!",
|
message: '删除项目成功!'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
});
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: "info",
|
type: 'info',
|
||||||
message: "已取消删除",
|
message: '已取消删除'
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const imgData = (e: any) => {
|
const imgData = (e: any) => {
|
||||||
window.open(window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
window.open(
|
||||||
|
window.location.origin + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=${VITE_FLAG ? 'ypt' : 'zl'}#/preview_ZL`
|
||||||
|
)
|
||||||
// window.open('http://192.168.1.128:4001' + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
// window.open('http://192.168.1.128:4001' + `/zutai/?id=${e.id}&&name=${e.name}&&preview=true&&graphicDisplay=zl#/preview_ZL`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onTableSizeChange = (val: number) => {
|
const onTableSizeChange = (val: number) => {
|
||||||
@@ -155,7 +191,6 @@ const onTableSizeChange = (val: number) => {
|
|||||||
const onTableCurrentChange = (val: number) => {
|
const onTableCurrentChange = (val: number) => {
|
||||||
tableStore.onTableAction('current-page-change', { page: val })
|
tableStore.onTableAction('current-page-change', { page: val })
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.text {
|
.text {
|
||||||
@@ -179,7 +214,7 @@ span {
|
|||||||
.clearfix::before,
|
.clearfix::before,
|
||||||
.clearfix::after {
|
.clearfix::after {
|
||||||
display: table;
|
display: table;
|
||||||
content: "";
|
content: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
.clearfix::after {
|
.clearfix::after {
|
||||||
@@ -189,7 +224,7 @@ span {
|
|||||||
.box-card {
|
.box-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// border: 1px solid #000;
|
// border: 1px solid #000;
|
||||||
box-shadow: var(--el-box-shadow-light)
|
box-shadow: var(--el-box-shadow-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.xiaoshou {
|
.xiaoshou {
|
||||||
@@ -218,7 +253,7 @@ span {
|
|||||||
|
|
||||||
// 不可全选样式
|
// 不可全选样式
|
||||||
.el-tree-node {
|
.el-tree-node {
|
||||||
.is-leaf+.el-checkbox .el-checkbox__inner {
|
.is-leaf + .el-checkbox .el-checkbox__inner {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user