Commit 680c7170 authored by 徐一鸣's avatar 徐一鸣

Merge branch 'xym' into dev

parents 0e6f1f32 247e6b74
......@@ -499,10 +499,11 @@ export default {
.more_action_list > li:first-child::before {
content: "";
position: absolute;
top: -14px;
right: calc(50% - 14px);
width: 28px;
height: 14px;
top: -20px;
right: calc(50% - 20px);
width: 40px;
height: 20px;
/* background-color: red; */
}
.more_action_list > li:first-child::after {
content: "";
......
......@@ -31,8 +31,38 @@
ref="dialog"
:title="dialogInfo.title"
:msg="dialogInfo.msg"
:cancel-text="dialogInfo.cancelText"
:submit="dialogInfo.submit"
:sunbmit-text="dialogInfo.sunbmitText"
></apass-dialog>
<apass-dialog ref="copyProcess" title="复制流程">
<template slot="content">
<el-form
v-if="copyTempItem"
ref="detail_form"
class="apaas_detail_form"
label-position="top"
:model="copyTempItem"
:rules="copyTempItem_rules"
>
<el-form-item label="流程名称:" prop="newName">
<el-input
v-model="copyTempItem.newName"
placeholder="请输入流程名称"
></el-input>
</el-form-item>
</el-form>
</template>
<template slot="action">
<el-button type="defalut" size="mini" @click="cancelCopyProcess">
取消
</el-button>
<el-button type="primary" size="mini" @click="submitCopyProcess">
保存
</el-button>
</template>
</apass-dialog>
</div>
</template>
......@@ -50,91 +80,90 @@ export default {
filterList: [
{
name: "服务领域",
prop: "service_domains",
data: [],
},
{
name: "工作区域",
prop: "workareas",
data: [],
},
{
name: "流程状态",
prop: "states",
data: [],
},
],
listHeader: [],
listData: [],
listTotal: 0,
dialogInfo: {
title: "",
msg: "",
cancelText: "",
submit: null,
sunbmitText: "",
},
tempFilter: null,
}),
methods: {
init(filter) {
console.log(filter);
this.tempFilter = filter;
this.listTotal = 3;
this.listData = [
{
id: "WF00000001",
name: "保安资格申请流程",
sectors_name: "经济建设",
create_time: "2021-01-01T00:00:00Z",
state: "0",
},
copyTempItem: null,
copyTempItem_rules: {
newName: [
{
id: "WF00000002",
name: "保安考试流程",
sectors_name: "经济建设",
create_time: "2021-01-01T00:00:00Z",
state: "1",
required: true,
message: "请输入流程名称",
trigger: "blur",
},
{
id: "WF00000003",
name: "申请材料审核流程",
sectors_name: "经济建设",
create_time: "2021-01-01T00:00:00Z",
state: "2",
max: 16,
message: "长度小于16个字符",
trigger: "blur",
},
];
],
},
initFilter() {
Promise.all([
this.$http.get("/apaas/service/v3/service/manager/servtype"),
this.$http.get("/apaas/service/v3/service/manager/servarea"),
])
.then((response) => {
let filterList = response.map((item) => {
return {
name: item.body.data[0].type_name,
prop: item.body.data[0].type_code,
data: item.body.data.map((v) => ({
name: v.name,
value: v.id,
})),
}),
methods: {
init(filter) {
let params = {
sectors: (filter.service_domains && filter.service_domains.map((item) => item.value).join(",")) || "",
workareas: (filter.workareas && filter.workareas.map((item) => item.value).join(",")) || "",
states: (filter.states && filter.states.map((item) => item.value).join(",")) || "",
page: filter.page,
page_size: filter.size,
};
});
this.filterList = [
...filterList,
{
name: "流程状态",
prop: "state",
data: [
{
name: "已发布",
value: 2,
},
{
name: "已部署",
value: 1,
},
{
name: "未部署",
value: 0,
},
],
this.tempFilter = filter;
this.$http
.get("/apaas/serviceapp/v3/workflows/list", { params })
.then(({ data }) => {
if (data.success === 1) {
this.listTotal = data.total;
this.listData = data.data;
}
})
.catch((error) => {
console.log(error);
});
},
];
initFilter() {
this.$http
.get("/apaas/serviceapp/v3/workflows/searchConditions")
.then(({ data }) => {
if (data.success === 1) {
let datas = data.data;
this.filterList.forEach((item) => {
let filter = datas[item.prop] || [];
this.$set(
item,
"data",
filter.map((item) => ({
name: item.name,
value: item.id,
}))
);
});
}
})
.catch((error) => {
console.log(error);
......@@ -144,7 +173,7 @@ export default {
this.listHeader = [
{
label: "流程编号",
prop: "id",
prop: "workflows_code",
width: 180,
},
{
......@@ -155,7 +184,7 @@ export default {
},
{
label: "服务领域",
prop: "sectors_name",
prop: "sector_name",
align: "center",
width: 240,
},
......@@ -197,9 +226,17 @@ export default {
},
],
moreActionList: [
{
label: "取消发布",
callback: this.cancelPublishItem,
},
{
label: "部署",
callback: this.deployItem,
},
{
label: "取消部署",
callback: this.canceldeployItem,
callback: this.cancelDeployItem,
},
{
label: "复制",
......@@ -215,28 +252,96 @@ export default {
},
refresh() {
this.init(this.tempFilter);
}, // 刷新当前页列表
showDialog() {
this.$refs.dialog.show();
},
addNewProcess() {
console.log("addNewProcess");
},
detailItem(item) {
this.$router.push(`/progress/designer/detail/${item.id}`);
copyProcessShow() {
this.$refs.copyProcess.show();
},
publishItem(item) {
console.log(`publish ${item.name}`);
copyProcessHide() {
this.$refs.copyProcess.hide();
this.copyTempItem = null;
},
addNewProcess() {
this.$router.push("/progress/designs");
}, // FIXME: 新建流程
editItem(item) {
console.log(`edit ${item.name}`);
},
canceldeployItem(item) {
console.log(`cancel deploy ${item.name}`);
},
this.$router.push("/progress/designs");
}, // FIXME: 编辑流程
detailItem(item) {
this.$router.push(`/progress/designer/detail/${item.workflows_id}`);
}, // TODO: 查看详情
publishItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = `发布后流程后,流程将部署到工作区域并上架到服务超市,是否发布该流程?`;
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "发布";
this.dialogInfo.submit = () => {
console.log(`发布${item.name}`);
};
this.showDialog();
}, // TODO: 发布流程
cancelPublishItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = `取消发布后,该流程服务将从服务超市下架,仅部署在工作区域${item.workarea_name}中,是否取消发布流程服务“${item.name}”?`;
this.dialogInfo.cancelText = "暂不";
this.dialogInfo.sunbmitText = "取消发布";
this.dialogInfo.submit = () => {
console.log(`取消发布${item.name}`);
};
this.showDialog();
}, // TODO: 取消发布流程
deployItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = `部署流程后,流程将部署到工作区域,但不会上架到服务超市,是否部署该流程?`;
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "部署";
this.dialogInfo.submit = () => {
console.log(`部署${item.name}`);
};
this.showDialog();
}, // TODO: 部署流程
cancelDeployItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = `取消部署后,该流程服务不能通过链接访问,是否取消部署流程服务“${item.name}”?`;
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "取消部署";
this.dialogInfo.submit = () => {
console.log(`取消部署${item.name}`);
};
this.showDialog();
}, // TODO: 取消流程
copyItem(item) {
console.log(`copy ${item.name}`);
},
this.copyTempItem = {
...item,
newName: "",
};
this.copyProcessShow();
}, // TODO: 复制流程
cancelCopyProcess() {
this.copyProcessHide();
}, // 复制流程-取消
submitCopyProcess() {
this.$refs.detail_form.validate((valid) => {
if (valid) {
console.log(this.copyTempItem);
this.copyProcessHide();
} else {
return false;
}
});
}, // TODO: 复制流程-确定
deleteItem(item) {
console.log(`delete ${item.name}`);
},
this.dialogInfo.title = "提示";
this.dialogInfo.msg = `您确定要删除流程服务“${item.name}”吗?`;
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "确定";
this.dialogInfo.submit = () => {
console.log(`删除${item.name}`);
};
this.showDialog();
}, // TODO: 删除流程
},
created() {
this.initFilter();
......@@ -249,4 +354,11 @@ export default {
.process-designer-container {
height: 100%;
}
.apaas_detail_form {
text-align: left;
margin-top: 20px;
}
.apaas_detail_form .el-form-item {
margin: 0;
}
</style>
......@@ -106,7 +106,7 @@
:title="dialogInfo.title"
:msg="dialogInfo.msg"
:submit="dialogInfo.submit"
:sunbmitText="dialogInfo.sunbmitText"
:sunbmit-text="dialogInfo.sunbmitText"
></apass-dialog>
<allot-info-confirm
......@@ -148,6 +148,7 @@ export default {
title: "",
msg: "",
submit: null,
sunbmitText: "",
},
listUrl: "",
deleteUrl: "",
......@@ -1064,8 +1065,7 @@ export default {
callback(item) {
if (item.state == 0) {
return null; // 已下架,上架的操作需要普通用户申请
} else
if (item.state == 1) {
} else if (item.state == 1) {
return _self.soldOutItem(item); // 已上架,超管用户可以直接下架
} else if (item.state == 2) {
return _self.soldUpItem(item); // 上架审核中,超管用户可以直接上架
......@@ -1398,7 +1398,6 @@ export default {
applyForSoldUpItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = "确认申请上架此服务吗?";
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "发送通知";
this.dialogInfo.submit = () => {
this.$http
......@@ -1433,7 +1432,6 @@ export default {
this.dialogInfo.title = "是否确定下架服务";
this.dialogInfo.msg =
"下架此服务会导致用户被迫暂停对服务的调用,下架前需向超级管理员发送通知,超级管理员通过后此服务将会从服务超市中下架。";
this.dialogInfo.cancelText = "取消";
this.dialogInfo.sunbmitText = "发送通知";
this.dialogInfo.submit = () => {
this.$http
......@@ -1467,7 +1465,6 @@ export default {
soldUpItem(item) {
this.dialogInfo.title = "提示";
this.dialogInfo.msg = "确认上架此服务吗?";
this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = "确定";
this.dialogInfo.submit = () => {
this.$http
......@@ -1501,7 +1498,6 @@ export default {
this.dialogInfo.title = "提示";
this.dialogInfo.msg =
"下架此服务会导致调用该服务的<br />用户被迫暂停对服务的调用";
this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = "确定";
this.dialogInfo.submit = () => {
this.$http
......@@ -1534,7 +1530,6 @@ export default {
deleteItem(item) {
this.dialogInfo.title = "";
this.dialogInfo.msg = "是否删除该条服务?";
this.dialogInfo.cancelText = "";
this.dialogInfo.sunbmitText = "";
this.dialogInfo.submit = () => {
this.$http
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment