作者 小范

部署管理新增功能

1 import http from './http.js' 1 import http from './http.js'
2 let baseUrl = 'wlpt-custom-service-workflow' 2 let baseUrl = 'wlpt-custom-service-workflow'
3 3
4 - 4 +//部署管理
5 export const deployment = params => { return http.get(`${baseUrl}/deployment/deployment`, params); }; 5 export const deployment = params => { return http.get(`${baseUrl}/deployment/deployment`, params); };
6 export const del = params => { return http.post(`${baseUrl}/deployment/del`, params); }; 6 export const del = params => { return http.post(`${baseUrl}/deployment/del`, params); };
  7 +export const upload = params => { return http.post(`${baseUrl}/file/upload`, params); };
  8 +export const create = params => { return http.post(`${baseUrl}/deployment/create`, params); };
  9 +
7 10
  11 +
  12 +//实例管理
8 export const instanceList = params => { return http.get(`${baseUrl}/process/instanceList`, params); }; 13 export const instanceList = params => { return http.get(`${baseUrl}/process/instanceList`, params); };
  14 +//任务管理
9 export const allTask = params => { return http.get(`${baseUrl}/task/allTask`, params); }; 15 export const allTask = params => { return http.get(`${baseUrl}/task/allTask`, params); };
10 16
  17 +export const uploadPath = `/api/${baseUrl}/file/upload`;
  18 +
11 19
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 16
17 <el-col :span="8"> 17 <el-col :span="8">
18 <el-button type="primary" v-on:click="getList">查询</el-button> 18 <el-button type="primary" v-on:click="getList">查询</el-button>
19 -<!-- <el-button type="success" v-on:click="toAddDialog">新增</el-button>--> 19 + <el-button type="success" v-on:click="toAddDialog">新增</el-button>
20 20
21 </el-col> 21 </el-col>
22 </el-row> 22 </el-row>
@@ -40,7 +40,8 @@ @@ -40,7 +40,8 @@
40 </el-table-column> 40 </el-table-column>
41 <el-table-column 41 <el-table-column
42 prop="key" 42 prop="key"
43 - label="key-ID"> 43 + label="key-ID"
  44 + show-overflow-tooltip>
44 </el-table-column> 45 </el-table-column>
45 <el-table-column 46 <el-table-column
46 prop="id" 47 prop="id"
@@ -86,13 +87,87 @@ @@ -86,13 +87,87 @@
86 </div> 87 </div>
87 </el-col> 88 </el-col>
88 </el-row> 89 </el-row>
  90 +<!-- 新增弹框-->
  91 + <el-dialog title="收货地址" :visible.sync="dialogFormVisible" style="margin-top: -60px" width="60%">
  92 + <el-form :model="formInline" :rules="rules" ref="formInline">
  93 + <el-row>
  94 + <el-col :offset="2" :span="12">
  95 + <el-form-item label="" :label-width="formLabelWidth">
  96 + <el-upload
  97 + class="upload-demo"
  98 + drag
  99 + :action="uploadPath"
  100 + accept="xml"
  101 + :headers="uploadHeaderObj"
  102 + :on-success="handleUploadSuccess">
  103 + <i class="el-icon-upload"></i>
  104 + <div class="el-upload__text">将文件拖到此处,或<em>点击上传xml文件</em></div>
  105 + </el-upload>
  106 + </el-form-item>
  107 + </el-col>
  108 + </el-row>
  109 + <el-row>
  110 + <el-col :span="10">
  111 + <el-form-item label="" :label-width="formLabelWidth">
  112 + <el-input v-model="formInline.filePath" disabled style="width: 220px">
  113 + <template slot="prepend">路径</template>
  114 + </el-input>
  115 + </el-form-item>
  116 + </el-col>
  117 + <el-col :span="12">
  118 + <el-form-item label="" :label-width="formLabelWidth" prop="key">
  119 + <el-input v-model="formInline.key" style="width: 220px">
  120 + <template slot="prepend">key</template>
  121 + </el-input>
  122 + </el-form-item>
  123 + </el-col>
  124 +
  125 + </el-row>
  126 + <el-row>
  127 + <el-col :span="10">
  128 + <el-form-item label="" :label-width="formLabelWidth">
  129 + <el-input v-model="formInline.category" style="width: 220px">
  130 + <template slot="prepend">类别</template>
  131 + </el-input>
  132 + </el-form-item>
  133 + </el-col>
  134 + <el-col :span="12">
  135 + <el-form-item label="" :label-width="formLabelWidth" prop="name">
  136 + <el-input v-model="formInline.name " style="width: 220px">
  137 + <template slot="prepend">名称</template>
  138 + </el-input>
  139 + </el-form-item>
  140 + </el-col>
  141 + </el-row>
  142 + <el-row>
  143 + <el-col :span="10">
  144 + <el-form-item label="" :label-width="formLabelWidth">
  145 + <el-input v-model="formInline.tenantId " style="width: 220px">
  146 + <template slot="prepend">租户</template>
  147 + </el-input>
  148 + </el-form-item>
  149 + </el-col>
  150 +<!-- <el-col :span="12">-->
  151 +<!-- <el-form-item label="" :label-width="formLabelWidth">-->
  152 +<!-- <el-input v-model="" style="width: 220px">-->
  153 +<!-- <template slot="prepend">其他</template>-->
  154 +<!-- </el-input>-->
  155 +<!-- </el-form-item>-->
  156 +<!-- </el-col>-->
  157 + </el-row>
  158 + </el-form>
  159 + <div slot="footer" class="dialog-footer" align="center">
  160 + <el-button @click="dialogFormVisible = false">取 消</el-button>
  161 + <el-button type="primary" @click="trans_add">确 定</el-button>
  162 + </div>
  163 + </el-dialog>
89 </el-main> 164 </el-main>
90 </el-container> 165 </el-container>
91 166
92 </template> 167 </template>
93 168
94 <script> 169 <script>
95 - import {deployment, del} from "../../api/technological"; 170 + import {deployment, del,upload,create,uploadPath} from "../../api/technological";
96 171
97 172
98 export default { 173 export default {
@@ -105,15 +180,44 @@ @@ -105,15 +180,44 @@
105 pageNum:1, 180 pageNum:1,
106 pageSize:10, 181 pageSize:10,
107 }, 182 },
  183 + uploadPath:uploadPath,
108 total:0, 184 total:0,
109 tableData: [], 185 tableData: [],
110 tableloading:false, 186 tableloading:false,
  187 + formInline:{
  188 + filePath :'',
  189 + category:'',
  190 + key:'',
  191 + name:'',
  192 + tenantId:'',
  193 + variables: {},
  194 + // cascade:'true'
  195 + },
  196 + uploadHeaderObj: {
  197 + Authorization: window.sessionStorage.getItem("token"),
  198 + },
  199 + faceImageUrl:'',
  200 + formLabelWidth: '120px',
  201 + dialogFormVisible:false,
  202 + rules: {
  203 + name: [
  204 + { required: true, message: '请输入名称', trigger: 'blur' },
  205 + // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
  206 + ],
  207 + filePath : [
  208 + { required: true, message: '请上传文件', trigger: 'blur' }
  209 + ],
  210 + key : [
  211 + { required: true, message: '请输入部署key', trigger: 'blur' }
  212 + ],
  213 + }
111 } 214 }
112 }, 215 },
113 mounted() { 216 mounted() {
114 this.getList(); 217 this.getList();
115 }, 218 },
116 methods: { 219 methods: {
  220 +
117 // 分页 221 // 分页
118 handleSizeChange(val) { 222 handleSizeChange(val) {
119 this.queryinfo.pageSize= val 223 this.queryinfo.pageSize= val
@@ -146,6 +250,47 @@ @@ -146,6 +250,47 @@
146 250
147 }) 251 })
148 }, 252 },
  253 + //打开新增
  254 + toAddDialog() {
  255 + this.dialogFormVisible = true;
  256 + },
  257 + //上传文件
  258 + handleUploadSuccess: function(response, file, fileList){
  259 + let res = response.data;
  260 + if (response.code !== '200') {
  261 + // 关闭加载
  262 + return this.$message.error(response.msg);
  263 + }
  264 + this.$message.success(response.msg);
  265 + this.formInline.filePath = res.relativePath
  266 +
  267 + },
  268 + //新增功能
  269 + trans_add() {
  270 + // 进行表单的预验证
  271 + this.$refs.formInline.validate(valid => {
  272 + // 未通过,表单预校验
  273 + if (!valid) return;
  274 + create(this.formInline).then((response) => {
  275 + let res = response.data;
  276 + // 添加失败
  277 + if (res.code !== '200') {
  278 + // 关闭加载
  279 + return this.$message.error(res.msg);
  280 + // 隐藏对话框
  281 + this.dialogFormVisible = false;
  282 + }
  283 + // 添加,成功
  284 + this.$message.success(res.msg);
  285 + // 隐藏对话框
  286 + this.dialogFormVisible = false;
  287 + // 刷新列表
  288 + this.getList();
  289 + }).catch(error => {
  290 + this.$message.error(error.toString());
  291 + });
  292 + })
  293 + },
149 //删除 294 //删除
150 remove(index,row){ 295 remove(index,row){
151 // 弹框询问是否删除? 296 // 弹框询问是否删除?
1 { 1 {
2 - "nmmsVer": "1.20" 2 + "nmmsVer": "1.21"
3 } 3 }