Commit 4b2f3d3d authored by 赵啸非's avatar 赵啸非

添加客户端资源部署

parent b1bdcfd0
<template>
<!-- 弹出框表单 -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field :span="20" label="产品" prop="productId" v-model="form.productId" :enumData="dict.productId" type="select" placeholder="请选择产品"/>
<Field :span="20" label="分辨率" prop="imageResolution" v-model="form.imageResolution" :enumData="dict.imageResolution" type="select" placeholder="请选择分辨率"/>
<Field :span="20" label="上传文件"><fileUpload v-model="form.filePath" prePath="/file/uploadfile"/></Field>
<Field :span="20" label="版本号" prop="version" v-model="form.version" placeholder="请输入版本号"/>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow";
import FileUpload from '@/components/FileUpload';
export default {
mixins: [form],
components: {
dialogShow ,
FileUpload,
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "设备前端模块部署",
// 是否显示弹出层
open: false,
toString:[
"distribute",
"productId",
"imageResolution"
],
// 表单校验
rules: {
imageResolution: [
{required: true,message: "请输入分辨率", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
],
imageResolutionValue: [
{required: true,message: "请输入分辨率值", trigger: "blur" },
{max: 256,message: "最多只能录入256个字符",trigger: "blur",},
],
distribute: [
{required: true,message: "请输入是否部署", trigger: "blur" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="device/module/distribute/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改设备前端模块部署";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "device/module/distribute/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增设备前端模块部署";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="device/module/distribute/view";
this.getData();
this.pageInfo.type="view"
this.title = "设备前端模块部署详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
productId : null,
productCode : "",
productName : "",
imageResolution : "",
imageResolutionValue : "",
filePath : "",
distributeFilePath : "",
version : "",
distribute : null,
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig"> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
export default {
name: "DeviceModuleDistributeList",
components: {
dialogShow,
},
mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.dialogform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.dialogform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
},
distribute(row) {
this.$post("/device/module/distribute/active", row)
.then((res) => {
if (res.code == 1) {
this.$message.success("模块部署成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
},
data() {
return {
config: {
search: [],
columns: [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ label: "产品", prop: "productId", formatter: this.formatter },
{
label: "分辨率",
prop: "imageResolution",
formatter: this.formatter,
},
{ label: "版本号", prop: "version" },
{ label: "是否部署", prop: "distribute", formatter: this.formatter },
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<div>
<table-buttons
noAdd
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
<el-button
size="mini"
type="text"
icon="el-icon-open"
onClick={() => {
this.distribute(row);
}}
>
部署
</el-button>
</div>
);
},
},
],
},
};
},
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="产品Id" label-class-name="labelClass" content-class-name="contentClass">
{{form.productId}}
</el-descriptions-item>
<el-descriptions-item label="产品编码" label-class-name="labelClass" content-class-name="contentClass">
{{form.productCode}}
</el-descriptions-item>
<el-descriptions-item label="产品名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.productName}}
</el-descriptions-item>
<el-descriptions-item label="分辨率" label-class-name="labelClass" content-class-name="contentClass">
{{form.imageResolution}}
</el-descriptions-item>
<el-descriptions-item label="分辨率值" label-class-name="labelClass" content-class-name="contentClass">
{{form.imageResolutionValue}}
</el-descriptions-item>
<el-descriptions-item label="文件相对路径地址" label-class-name="labelClass" content-class-name="contentClass">
<fileUpload v-model="form.filePath" prePath="/file/uploadfile"/>
</el-descriptions-item>
<el-descriptions-item label="文件部署路径地址" label-class-name="labelClass" content-class-name="contentClass">
<fileUpload v-model="form.distributeFilePath" prePath="/file/uploadfile"/>
</el-descriptions-item>
<el-descriptions-item label="版本号" label-class-name="labelClass" content-class-name="contentClass">
{{form.version}}
</el-descriptions-item>
<el-descriptions-item label="是否部署" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("distribute", form.distribute) }}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import FileUpload from '@/components/FileUpload';
export default {
mixins: [view],
components: {
FileUpload,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
"distribute",
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
......@@ -6826,10 +6826,10 @@ npmlog@^4.0.0, npmlog@^4.1.2:
gauge "~2.7.3"
set-blocking "~2.0.0"
nprogress@0.2.0:
nprogress@^0.2.0:
version "0.2.0"
resolved "https://registry.npm.taobao.org/nprogress/download/nprogress-0.2.0.tgz"
integrity sha1-y480xTIT2JVyP8urkH6UIq28r7E=
resolved "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==
nth-check@^1.0.2:
version "1.0.2"
......
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