d3&workflow
This commit is contained in:
parent
cbb1920724
commit
ca5084d20a
|
@ -15,15 +15,17 @@
|
|||
"core-js": "3.22.8",
|
||||
"cropperjs": "1.5.12",
|
||||
"crypto-js": "4.1.1",
|
||||
"d3": "^7.6.1",
|
||||
"dagre-d3": "^0.6.4",
|
||||
"echarts": "5.3.2",
|
||||
"element-plus": "2.2.3",
|
||||
"json-editor-vue3": "^1.0.6",
|
||||
"nprogress": "0.2.0",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"sortablejs": "1.15.0",
|
||||
"tinymce": "6.0.3",
|
||||
"vue": "3.2.36",
|
||||
"vue-i18n": "9.1.10",
|
||||
"vue-json-editor": "^1.4.3",
|
||||
"vue-router": "4.0.15",
|
||||
"vuedraggable": "4.0.3",
|
||||
"vuex": "4.0.2",
|
||||
|
|
|
@ -44,9 +44,6 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
/*作业*/
|
||||
operation: {
|
||||
list: {
|
||||
|
@ -89,7 +86,6 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
/*作业许可证*/
|
||||
opl: {
|
||||
list: {
|
||||
|
|
|
@ -0,0 +1,387 @@
|
|||
<template>
|
||||
<!--基本信息!-->
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="110px"
|
||||
style="margin: 10px 20px 0 20px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="关联作业:">
|
||||
<span>{{form.name}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业许可种类:">
|
||||
<span>{{pagtitle}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业开始时间:">
|
||||
<span>{{form.start_time}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业结束时间:">
|
||||
<span>{{form.end_time}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业级别:">
|
||||
<el-select v-model="form.level" placeholder="选择作业级别">
|
||||
<el-option
|
||||
v-for="item in leveloptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业部门:">
|
||||
<el-cascader
|
||||
placeholder="选择作业部门"
|
||||
getCheckedNodes="true"
|
||||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业负责人:">
|
||||
<el-select v-model="form.charger" placeholder="选择作业负责人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业监护人:">
|
||||
<el-select v-model="form.monitor" placeholder="选择作业监护人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="风险选择:">
|
||||
<el-checkbox-group v-model="form.risks_checked" disabled>
|
||||
<el-checkbox
|
||||
v-show="form.risks_checked.indexOf(item.id)>-1"
|
||||
v-for="(item, index) in risklist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}
|
||||
</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="其他风险:">
|
||||
<span>{{form.other_risk}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="措施选择:">
|
||||
<el-checkbox-group v-model="form.measures_checked" disabled>
|
||||
<el-checkbox
|
||||
v-show="form.measures_checked.indexOf(item.id)>-1"
|
||||
v-for="(item, index) in measurelist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}
|
||||
</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix">
|
||||
<span>应急处置:</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>1、发生火灾时立即使用消防器材边灭火边报告</p>
|
||||
<p>2、预判火势无法控制时,应立即疏散人群并拨打110或119求救。</p>
|
||||
<p>
|
||||
3、发生人员烫伤时用清水对烫伤部位进行冲洗或浸泡,用干净的纱布或衣物盖住被烫伤部位,伤势严重时立即拨打120送医。若贴身衣服与伤口粘在一起时,可用剪刀剪开,然后缓慢剥离衣物。
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form-item label="其他应急处置:">
|
||||
<span>{{form.other_emr}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-card>
|
||||
<div>作业人员</div>
|
||||
<!--作业人员!-->
|
||||
<scTable
|
||||
ref="workerTable"
|
||||
:data="apiworkerObj"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
hideDo
|
||||
style="height: calc(100% - 60px);"
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
fixed="left"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.worker_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="证书" prop="certificates" width="150">
|
||||
<template #default="scope">
|
||||
<el-tag v-for="item in scope.row.certificates_"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-button text type="primary" size="small" @click="bltHandle(scope.row,'1')">绑卡</el-button>
|
||||
<!--<el-button text type="primary" size="small" @click="bltHandle(scope.row,'0')">解绑</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<div>气体检测记录</div>
|
||||
<!--气体检测记录!-->
|
||||
<scTable
|
||||
ref="gasTable"
|
||||
:data="apigasObj"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
hideDo
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
fixed="left"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检测部位"
|
||||
prop="check_place"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="O2(%)" prop="o2" min-width="120"></el-table-column>
|
||||
<el-table-column label="CO" prop="co" min-width="120"></el-table-column>
|
||||
<el-table-column
|
||||
label="可燃气体(V%LEL)"
|
||||
prop="lel"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检验结论"
|
||||
prop="is_ok"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ is_ok_[scope.row.is_ok] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检测人"
|
||||
prop="checker"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.checker_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检测时间"
|
||||
prop="check_time"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
</scTable>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {genTree} from "@/utils/verificate";
|
||||
export default {
|
||||
name: "scFire",
|
||||
props: {
|
||||
id: { type: String, default: "" },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
form: {
|
||||
id: "",
|
||||
start_time: null,
|
||||
end_time: null,
|
||||
operation: "",
|
||||
cate: "",
|
||||
risks_checked: [],
|
||||
},
|
||||
initForm: {},
|
||||
oplcateCode: "",
|
||||
operationId: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{id: 10, name: "特殊动火"},
|
||||
{id: 20, name: "一级动火"},
|
||||
{id: 30, name: "二级动火"},
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
measurelist: [],
|
||||
pagtitle: "",
|
||||
dutyOptions: [
|
||||
{value: 10, label: "作业人员"},
|
||||
{value: 20, label: "起重司机"},
|
||||
{value: 30, label: "司索人员"},
|
||||
{value: 40, label: "起重指挥"},
|
||||
{value: 40, label: "电工"},
|
||||
],
|
||||
certificatesOptions: [],
|
||||
apiworkerObj: [],
|
||||
workerdialog: false,
|
||||
gasdialog: false,
|
||||
apigasObj: [],
|
||||
is_ok_: {
|
||||
true: "正常",
|
||||
false: "不正常",
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.oplId = that.id; //许可证ID
|
||||
this.$nextTick(()=>{
|
||||
debugger;
|
||||
console.log("this.getData");
|
||||
that.getOplData();
|
||||
that.getDept();
|
||||
that.getUser();
|
||||
that.getworkerList();
|
||||
that.getgasList();
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
//根据oplId,查许可证
|
||||
getOplData() {
|
||||
debugger;
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
this.getOperation();
|
||||
this.getOplcates();
|
||||
});
|
||||
},
|
||||
|
||||
//根据作业许可证类别ID获取,风险、措施===>作业许可证类别详情
|
||||
getOplcates() {
|
||||
debugger;
|
||||
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||
console.log(res); //
|
||||
this.pagtitle = res.name;
|
||||
this.oplcateCode = res.code;
|
||||
this.risklist = res.risk_options_; //风险缝隙
|
||||
this.measurelist = res.measure_options_; //控制措施
|
||||
});
|
||||
},
|
||||
|
||||
//根据operationId,查作业信息
|
||||
getOperation() {
|
||||
this.$API.opm.operation.read.req(this.operationId).then((res) => {
|
||||
this.form.start_time = res.start_time; //作业开始时间
|
||||
this.form.end_time = res.end_time; //作业结束时间
|
||||
this.form.name = res.name; //作业结束时间
|
||||
});
|
||||
},
|
||||
//作业部门
|
||||
getDept() {
|
||||
this.$API.system.dept.list.req({page: 0}).then((res) => {
|
||||
this.deptoptions = genTree(res);
|
||||
});
|
||||
},
|
||||
//作业负责人、作业监护人
|
||||
getUser() {
|
||||
this.$API.system.user.list.req({page: 0}).then((res) => {
|
||||
this.useroptions = res;
|
||||
});
|
||||
},
|
||||
//作业人员列表
|
||||
getworkerList(id) {
|
||||
this.$API.opm.worker.list.req({opl: id, page: 0}).then((res) => {
|
||||
this.apiworkerObj = res;
|
||||
});
|
||||
},
|
||||
//气体检测记录列表
|
||||
getgasList(id) {
|
||||
this.$API.opm.gas.list.req({opl: id, page: 0}).then((res) => {
|
||||
this.apigasObj = res;
|
||||
});
|
||||
},
|
||||
bltHandle(item,index){
|
||||
if(index==='1'){
|
||||
//绑卡
|
||||
}else{
|
||||
//解绑
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -23,6 +23,7 @@ import scQrCode from './components/scQrCode'
|
|||
|
||||
import scStatusIndicator from './components/scMini/scStatusIndicator'
|
||||
import scTrend from './components/scMini/scTrend'
|
||||
import scFire from './components/scOpl/scFire'
|
||||
|
||||
import auth from './directives/auth'
|
||||
import role from './directives/role'
|
||||
|
@ -62,6 +63,7 @@ export default {
|
|||
app.component('scStatusIndicator', scStatusIndicator);
|
||||
app.component('scUserSelect', scUserSelect);
|
||||
app.component('scTrend', scTrend);
|
||||
app.component('scFire', scFire);
|
||||
|
||||
//注册全局指令
|
||||
app.directive('auth', auth);
|
||||
|
|
|
@ -44,10 +44,8 @@
|
|||
fixed="left"
|
||||
></el-table-column>
|
||||
<el-table-column label="作业状态" prop="state" width="180" fixed="left">
|
||||
<template #default="scope">{{
|
||||
stateoptions[scope.row.state]
|
||||
}}</template></el-table-column
|
||||
>
|
||||
<template #default="scope">{{stateoptions[scope.row.state]}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="生产状态"
|
||||
prop="state_work"
|
||||
|
@ -69,7 +67,6 @@
|
|||
prop="end_time"
|
||||
width="180"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="作业区域"
|
||||
prop="area"
|
||||
|
@ -108,30 +105,31 @@
|
|||
type="primary"
|
||||
size="small"
|
||||
@click="creatopl(scope.row)"
|
||||
>关联许可证</el-button
|
||||
>
|
||||
>许可证
|
||||
</el-button>
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="table_show(scope.row, scope.$index)"
|
||||
>查看</el-button
|
||||
>
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.state === 10"
|
||||
text
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="table_edit(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
text
|
||||
type="primary"
|
||||
type="danger"
|
||||
size="small"
|
||||
v-if="scope.row.state == 10"
|
||||
v-if="scope.row.state === 10"
|
||||
@click="table_del(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -147,6 +145,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import saveDialog from "./operation_form.vue";
|
||||
|
||||
export default {
|
||||
name: "operation",
|
||||
components: {
|
||||
|
@ -245,10 +244,12 @@ export default {
|
|||
}, 500);
|
||||
},
|
||||
//搜索
|
||||
upsearch() {},
|
||||
upsearch() {
|
||||
},
|
||||
//根据ID获取树结构
|
||||
filterTree(id) {
|
||||
var target = null;
|
||||
|
||||
function filter(tree) {
|
||||
tree.forEach((item) => {
|
||||
if (item.id == id) {
|
||||
|
@ -259,6 +260,7 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
filter(this.$refs.tableoperation.tableData);
|
||||
return target;
|
||||
},
|
||||
|
|
|
@ -30,6 +30,28 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card>
|
||||
<el-descriptions title="作业详情" :column="3">
|
||||
<el-descriptions-item label="作业名称:">
|
||||
{{operationObj.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="具体地点:">
|
||||
{{operationObj.place }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="生产状态:">
|
||||
{{operationObj.state_work }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态:">
|
||||
{{state_[operationObj.state] }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间:">
|
||||
{{operationObj.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间:">
|
||||
{{operationObj.end_time }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
|
@ -97,26 +119,34 @@
|
|||
type="primary"
|
||||
size="small"
|
||||
@click="table_show(scope.row, scope.$index)"
|
||||
>查看</el-button
|
||||
>查看
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="operationObj.state===10"
|
||||
text
|
||||
type="warning"
|
||||
size="small"
|
||||
@click="table_edit(scope.row, scope.$index)"
|
||||
>编辑</el-button
|
||||
>编辑
|
||||
</el-button
|
||||
>
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-drawer :size="'50%'" v-model="showLimited" :title="oplName+'作业许可证详情'">
|
||||
<sc-fire :id="oplId"></sc-fire>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import ScFire from "../../components/scOpl/scFire";
|
||||
|
||||
export default {
|
||||
name: "opl",
|
||||
components: {},
|
||||
components: {ScFire},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
|
@ -130,14 +160,31 @@ export default {
|
|||
keyword: null,
|
||||
},
|
||||
oplcateList: {},
|
||||
operationObj: {},
|
||||
showLimited: false,
|
||||
oplId: '',
|
||||
state_: {
|
||||
10: "创建中",
|
||||
20: "审批中",
|
||||
30: "待入厂",
|
||||
40: "进行中",
|
||||
50: "已完成",
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getoplcate();
|
||||
this.getopllist();
|
||||
this.getOperation();
|
||||
},
|
||||
methods: {
|
||||
getOperation(){
|
||||
this.$API.opm.operation.read.req(this.$route.query.id).then((res) => {
|
||||
debugger;
|
||||
this.operationObj = res;
|
||||
});
|
||||
},
|
||||
//作业许可证列表
|
||||
getopllist() {
|
||||
this.$API.opm.opl.list.req({operation: this.$route.query.id, page: 0}).then((res) => {
|
||||
|
@ -327,10 +374,10 @@ export default {
|
|||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
this.showLimited = true;
|
||||
this.oplId = row.id;
|
||||
this.oplName = row.cate_name;
|
||||
this.workId = row.workers[0];
|
||||
},
|
||||
//权限设置
|
||||
permission() {
|
||||
|
@ -365,7 +412,8 @@ export default {
|
|||
loading.close();
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
|
@ -382,10 +430,12 @@ export default {
|
|||
}, 500);
|
||||
},
|
||||
//搜索
|
||||
upsearch() {},
|
||||
upsearch() {
|
||||
},
|
||||
//根据ID获取树结构
|
||||
filterTree(id) {
|
||||
var target = null;
|
||||
|
||||
function filter(tree) {
|
||||
tree.forEach((item) => {
|
||||
if (item.id == id) {
|
||||
|
@ -396,6 +446,7 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
filter(this.$refs.table.tableData);
|
||||
return target;
|
||||
},
|
||||
|
|
|
@ -80,15 +80,15 @@
|
|||
this.list = res;
|
||||
},
|
||||
handleShow(row) {
|
||||
let workflowKey = row.workflow_.key;
|
||||
let cateType = '',projectId='';
|
||||
if(workflowKey==='visit'){
|
||||
cateType = row.workflow_.key;
|
||||
let cateType = row.workflow_.key;
|
||||
let projectId='';
|
||||
if(cateType==='visit'){
|
||||
projectId = row.ticket_data.visit;
|
||||
}else if(workflowKey==='rparty'){
|
||||
cateType = row.workflow_.key;
|
||||
}else if(cateType==='rparty'){
|
||||
projectId = row.ticket_data.rpj;
|
||||
}else{}
|
||||
}else{
|
||||
projectId = row.ticket_data.opl;
|
||||
}
|
||||
this.$router.push({
|
||||
name: "visitdetail",
|
||||
query: {
|
||||
|
|
|
@ -138,11 +138,20 @@
|
|||
},
|
||||
//处理
|
||||
handleDetail(row){
|
||||
debugger;
|
||||
console.log(row)
|
||||
let projectId = '';
|
||||
let catetype = row.workflow_.key;
|
||||
if(catetype==='visit'){
|
||||
projectId=row.ticket_data.visit;
|
||||
}else if(catetype==='Fire'){
|
||||
projectId=row.ticket_data.opl;
|
||||
}
|
||||
this.$router.push({
|
||||
name: "visitdetail",
|
||||
query: {
|
||||
id: row.id,
|
||||
projectId:row.ticket_data.visit,
|
||||
projectId:projectId,
|
||||
catetype:row.workflow_.key
|
||||
},
|
||||
});
|
||||
|
|
|
@ -83,14 +83,15 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="条件表达式" prop="condition_expression">
|
||||
<vue-json-editor
|
||||
<!--<vue-json-editor
|
||||
style="width:100%"
|
||||
v-model="addForm.condition_expression"
|
||||
:showBtns="false"
|
||||
:mode="'code'"
|
||||
lang="zh"
|
||||
@json-change="onJsonChange"
|
||||
/>
|
||||
/>-->
|
||||
<JsonEditorVue class="editorJson" v-model="addForm.condition_expression"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性类型" prop="attribute_type">
|
||||
<el-select style="width: 100%" v-model="addForm.attribute_type" placeholder="请选择">
|
||||
|
@ -120,10 +121,11 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import vueJsonEditor from 'vue-json-editor'
|
||||
// import vueJsonEditor from 'vue-json-editor'
|
||||
import JsonEditorVue from 'json-editor-vue3'
|
||||
export default {
|
||||
name: "transform",
|
||||
components: { vueJsonEditor },
|
||||
components: { JsonEditorVue },
|
||||
data() {
|
||||
return {
|
||||
id: sessionStorage.getItem('jinYuWorkflowId'),
|
||||
|
@ -224,5 +226,7 @@
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.editorJson{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -78,6 +78,34 @@
|
|||
</div>
|
||||
<show-dialog v-if="rpjShow" ref="showDialog"></show-dialog>
|
||||
</el-card>
|
||||
<el-card style="margin-left: 10px; margin-bottom: 10px" v-else>
|
||||
<el-descriptions title="作业许可证" :column="3">
|
||||
<el-descriptions-item label="工单流水号:">
|
||||
{{ticketDetail.sn }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="许可证编号:">
|
||||
{{oplDetail.number }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="许可证类别:">
|
||||
{{oplDetail.cate_name}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="级别:">
|
||||
{{oplDetail.level }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间:">
|
||||
{{oplDetail.start_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间:">
|
||||
{{oplDetail.end_time }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="text-align: center">
|
||||
<el-link type="primary" @click="showMoreInfo"> 更多信息 </el-link>
|
||||
</div>
|
||||
<show-dialog v-if="rpjShow" ref="showDialog"></show-dialog>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-left: 10px; margin-bottom: 10px" v-if="type!=='show'">
|
||||
<scTitle title="处理"></scTitle>
|
||||
<el-form :model="form" ref="addForm" label-width="100px" label-position="left">
|
||||
|
@ -156,6 +184,7 @@
|
|||
projectId: "",//对应项目的id
|
||||
userName: "",
|
||||
rpjDetail: {},
|
||||
oplDetail: {},
|
||||
ticketDetail: [],
|
||||
visitDetail: [],
|
||||
employeeLists: [],
|
||||
|
@ -204,10 +233,14 @@
|
|||
|
||||
},
|
||||
mounted() {
|
||||
debugger;
|
||||
if(this.cateType==='visit'){
|
||||
this.getVisit();
|
||||
}else if(this.cateType==='rparty'){
|
||||
this.getRpj();
|
||||
}else{
|
||||
debugger;
|
||||
this.getOpl();
|
||||
}
|
||||
this.getticketItem();
|
||||
this.getBtns();
|
||||
|
@ -246,6 +279,13 @@
|
|||
this.rpjDetail = res;
|
||||
});
|
||||
},
|
||||
//作业详情
|
||||
getOpl(){
|
||||
this.$API.opm.opl.read.req(this.projectId).then((res) => {
|
||||
debugger;
|
||||
this.oplDetail = res;
|
||||
});
|
||||
},
|
||||
//加签处理-start
|
||||
addNode(){
|
||||
this.limitedAdd = true;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
||||
<el-table-column label="#" type="index"></el-table-column>
|
||||
<el-table-column label="ID" prop="id" min-width="120"></el-table-column>
|
||||
<el-table-column label="工作流名称" prop="name" min-width="250"></el-table-column>
|
||||
<el-table-column label="标识" prop="key" min-width="250"></el-table-column>
|
||||
|
@ -32,6 +33,13 @@
|
|||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button link size="small" type="primary" @click="workflowEdit(scope.row)">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="handleWatch(scope)"
|
||||
>
|
||||
查看流程图
|
||||
</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="workflowDel(scope.row)">
|
||||
<template #reference>
|
||||
<el-button link size="small" type="danger">删除</el-button>
|
||||
|
@ -42,6 +50,15 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<div class="svgMark" v-if="limitedWatch" @click="closeMark">
|
||||
<div class="svgWrapper">
|
||||
<div class="svgItem">工作流流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div>
|
||||
<div style="width: 90%;margin: auto;">
|
||||
<svg height=1800 id="mySvg" style="width:100%!important;">
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
|
||||
<el-form :model="addForm" :rules="rules" ref="addForm" label-width="100px" label-position="left">
|
||||
<el-form-item label="名称" prop="name">
|
||||
|
@ -86,7 +103,10 @@
|
|||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dagreD3 from 'dagre-d3'
|
||||
import * as d3 from 'd3'
|
||||
export default {
|
||||
name: 'index',
|
||||
data() {
|
||||
|
@ -101,6 +121,7 @@
|
|||
editId: null,
|
||||
isSaving: false,
|
||||
limitedVisible: false,
|
||||
limitedWatch: false,
|
||||
type: "add",
|
||||
titleMap: {
|
||||
add: '新增',
|
||||
|
@ -234,7 +255,104 @@
|
|||
} else if (type == 'edit') {
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
},
|
||||
handleWatch(scope) {
|
||||
debugger;
|
||||
let that = this;
|
||||
let workFlow = scope.row.id;
|
||||
that.limitedWatch = true;
|
||||
that.$nextTick(() => {
|
||||
var g = new dagreD3.graphlib.Graph().setGraph({
|
||||
rankdir: 'DL',
|
||||
nodesep: 100,
|
||||
edgesep: 50,//两条线之间的距离
|
||||
ranksep: 50,//节点之间的距离
|
||||
marginx: 160,
|
||||
marginy: 20,
|
||||
});
|
||||
//获取state得到节点
|
||||
this.$API.wf.workflow.states.req(workFlow).then((response) => {
|
||||
if (!response.err_msg) {
|
||||
let nodes = response;
|
||||
// 添加节点
|
||||
nodes.forEach((item) => {
|
||||
debugger;
|
||||
g.setNode(item.id, {
|
||||
// 节点标签
|
||||
label: item.name,
|
||||
// 节点形状
|
||||
shape: 'rect',
|
||||
toolText: item.name,
|
||||
//节点样式
|
||||
style: "fill:#fff;stroke:#000",
|
||||
labelStyle: "fill:#000;",
|
||||
rx: 5,//矩形节点圆角度
|
||||
ry: 5
|
||||
});
|
||||
});
|
||||
debugger;
|
||||
console.log(g.nodes());
|
||||
g.nodes().forEach(function (v) {
|
||||
debugger;
|
||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||
});
|
||||
//获取流转得到线 链接关系
|
||||
this.$API.wf.workflow.transitions.req(workFlow).then((res) => {
|
||||
if (!res.err_msg) {
|
||||
let transitionList = res;
|
||||
debugger;
|
||||
transitionList.forEach((transition0) => {
|
||||
if (transition0.condition_expression.length > 0) {
|
||||
debugger;
|
||||
g.setNode(transition0.source_state_.id + 100000, {
|
||||
label: "条件表达式",
|
||||
style: "stroke: #000;fill: #afa",
|
||||
shape: "diamond"
|
||||
});
|
||||
g.setEdge(transition0.source_state_.id, transition0.source_state_.id + 100000, {
|
||||
// 边标签
|
||||
label: transition0.name,
|
||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
||||
});
|
||||
let condition_expression = transition0.condition_expression;
|
||||
condition_expression.forEach(condition_expression0 => {
|
||||
g.setEdge(transition0.source_state_.id + 100000, condition_expression0.target_state, {
|
||||
label: condition_expression0.label,
|
||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px"
|
||||
})
|
||||
})
|
||||
} else {
|
||||
g.setEdge(transition0.source_state_.id, transition0.destination_state_.id, {
|
||||
// 边标签
|
||||
label: transition0.name,
|
||||
// 边样式
|
||||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
|
||||
});
|
||||
}
|
||||
})
|
||||
g.nodes().length - 1
|
||||
g.nodes().forEach(function (v) {
|
||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||
});
|
||||
// 创建渲染器
|
||||
let render = new dagreD3.render();
|
||||
// 选择 svg 并添加一个g元素作为绘图容器.
|
||||
let svg = d3.select('#mySvg');
|
||||
let svgGroup = svg.append('g');
|
||||
// 在绘图容器上运行渲染器生成流程图.
|
||||
render(d3.select("svg g"), g);
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
closeMark() {
|
||||
this.limitedWatch = false;
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -245,5 +363,75 @@
|
|||
border: 1px solid #dcdfe6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
|
||||
background-color: #fefefe;
|
||||
border-radius: 7px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 7px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.svgMark {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
z-index: 2000;
|
||||
background: rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
.svgWrapper {
|
||||
background: #fff;
|
||||
width: 800px;
|
||||
margin:0 auto;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.svgItem {
|
||||
padding: 20px 40px 0;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
svg {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.node rect {
|
||||
stroke: #606266;
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.edgePath path {
|
||||
stroke: #606266;
|
||||
fill: #333;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
g.conditions > rect {
|
||||
fill: #00ffd0;
|
||||
stroke: #000;
|
||||
}
|
||||
|
||||
.el-icon-close {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in New Issue