From 6293c53f6e04a8f0b652ad607c8913fe986050d5 Mon Sep 17 00:00:00 2001 From: liudianxin Date: Tue, 26 May 2020 12:26:48 +0800 Subject: [PATCH] =?UTF-8?q?+api=E5=85=A5=E5=8F=A3=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8axios+table?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=EF=BC=8C=E9=99=90=E5=88=B6table-selarr?= =?UTF-8?q?=E7=9A=84value=E4=B8=BA=E5=AD=97=E7=AC=A6=EF=BC=8Cfwzc+?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + src/assets/css/index.css | 3 + src/components/table-input.vue | 116 +++++++-- src/components/table-select.vue | 22 +- src/components/table-um.vue | 75 ++++-- src/components/upload_file.vue | 6 +- src/main.js | 3 + src/pages/example/example_table.vue | 12 +- src/pages/workbench/fwzc_fwcs.vue | 352 ++++++++++++++++++++++------ src/request/api.js | 5 + src/request/api/service_shop.js | 0 src/request/api/user.js | 0 src/request/api/workbench.js | 14 ++ src/request/http.js | 93 ++++++++ static/data.json | 8 +- yarn.lock | 26 ++ 16 files changed, 615 insertions(+), 122 deletions(-) create mode 100644 src/request/api.js create mode 100644 src/request/api/service_shop.js create mode 100644 src/request/api/user.js create mode 100644 src/request/api/workbench.js create mode 100644 src/request/http.js diff --git a/package.json b/package.json index f6dcfb4..328b30e 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@antv/g6": "^3.4.8", "@fortawesome/fontawesome-free": "^5.8.0", "ace-builds": "^1.4.11", + "axios": "^0.19.2", "babel-polyfill": "^6.26.0", "codemirror": "^5.45.0", "echarts": "^4.2.1", @@ -20,6 +21,7 @@ "js-yaml": "^3.13.1", "json2yaml": "^1.1.0", "material-design-icons-iconfont": "^4.0.5", + "qs": "^6.9.4", "string-format": "^2.0.0", "svg-sprite-loader": "^4.2.6", "vue": "^2.6.10", diff --git a/src/assets/css/index.css b/src/assets/css/index.css index 449dea6..022de20 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -471,6 +471,9 @@ width: 620px!important; .el-radio__input.is-checked .el-radio__inner::after { background-color: #e56600; } +.el-radio__inner:hover { + border-color: #e56600; +} /* 面包屑样式 */ .bread_crumb { margin: 20px; diff --git a/src/components/table-input.vue b/src/components/table-input.vue index 4827587..9779b4e 100644 --- a/src/components/table-input.vue +++ b/src/components/table-input.vue @@ -1,13 +1,44 @@ @@ -28,8 +59,7 @@ export default { default: "" }, name: { - type: String, - default: "" + type: String }, rowId: { type: Number, @@ -38,15 +68,29 @@ export default { couldNotEdit: { type: Boolean, default: false + }, + type: { + type: String, + default: "" + }, + typeHead: { + type: String, + default: "" } }, data: () => ({ - inputText: "" + inputText: "", + fileArray: [], + anotherData: { + directory: "file" + }, + inputTextUp: "" }), mounted() { this.inputText = this.item; }, methods: { + // input changeValue() { this.$emit("changeInputValue", { rowId: this.rowId, @@ -54,7 +98,31 @@ export default { inputValue: this.inputText, id: this.id }); - } + }, + // upload + beforeUpload(file) {}, + handleSuccess(response, file, fileList) { + if (response.success == 1) { + this.fileArray.push({ + url: response.data, + name: response.data + }); + this.inputTextUp = file.name; + this.$emit("changeUpFile", { + rowId: this.rowId, + header: this.header, + inputValue: this.inputTextUp, + id: this.id, + fileUrl: response.data + }); + } else { + this.$message.error("上传文件失败,请重试"); + } + }, + handleError(err, file, fileList) { + this.$message.error("上传文件失败,请重试"); + }, + handleRemove(file, fileList) {} } }; @@ -62,7 +130,9 @@ export default { .text-xs-center { height: 32px; } - +.table_upload { + height: 32px; +} .table_in_input { text-align: center; font-size: 14px; @@ -75,6 +145,22 @@ export default { border-radius: 4px; } .text-xs-center .el-input.is-disabled .el-input__inner { - color: #70747C; + color: #70747c; +} +.table_upload input { + width: 100%; + background-color: #f7f8f9; + border-radius: 4px; +} +.table_upload .el-input.is-disabled .el-input__inner { + color: #70747c; +} +.table_upload .el-button { + background-color: #0f2683 !important; + color: #ffffff !important; + border-radius: 0 4px 4px 0; +} +.table_upload .el-input-group__append ul { + display: none; } \ No newline at end of file diff --git a/src/components/table-select.vue b/src/components/table-select.vue index 3e92e50..04c5a32 100644 --- a/src/components/table-select.vue +++ b/src/components/table-select.vue @@ -11,10 +11,10 @@ > @@ -44,12 +44,10 @@ export default { default: "" }, name: { - type: String, - default: "" + type: String }, rowId: { - type: Number, - default: 0 + type: Number }, couldNotEdit: { type: Boolean, @@ -57,12 +55,16 @@ export default { } }, data: () => ({ - selectValue: "1" + selectValue: "0" }), mounted() { this.selectValue = this.item; - if (!this.selectValue || this.selectValue == "") { - this.selectValue = this.selectArr[0].value; + if (this.selectValue == null || !this.selectValue || this.selectValue == "") { + if (this.selectArr && this.selectArr.length != 0) { + this.selectValue = this.selectArr[0].value; + } else { + this.selectValue = ""; + } } }, methods: { diff --git a/src/components/table-um.vue b/src/components/table-um.vue index 3b592fb..438836e 100644 --- a/src/components/table-um.vue +++ b/src/components/table-um.vue @@ -144,21 +144,24 @@ > - - + + {{ scope.row[item.prop] }} @@ -243,19 +249,19 @@