diff --git a/.env.production b/.env.production index 12d1ef2..efdd02d 100644 --- a/.env.production +++ b/.env.production @@ -3,4 +3,4 @@ ENV = 'production' # base api VUE_APP_BASE_API = http://weiyuan-ziliao-test.ali251.langye.net -VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file \ No newline at end of file +VUE_APP_UPLOAD_API = http://weiyuan-ziliao-test.ali251.langye.net/api/admin/upload-file diff --git a/src/assets/reception/container-logo.png b/src/assets/reception/container-logo.png new file mode 100644 index 0000000..e6fe1b2 Binary files /dev/null and b/src/assets/reception/container-logo.png differ diff --git a/src/assets/reception/footer-bkg.png b/src/assets/reception/footer-bkg.png new file mode 100644 index 0000000..7264eb9 Binary files /dev/null and b/src/assets/reception/footer-bkg.png differ diff --git a/src/assets/reception/search-bottom-bkg.png b/src/assets/reception/search-bottom-bkg.png new file mode 100644 index 0000000..0baa456 Binary files /dev/null and b/src/assets/reception/search-bottom-bkg.png differ diff --git a/src/components/Reception/Footer.vue b/src/components/Reception/Footer.vue new file mode 100644 index 0000000..5bf9f57 --- /dev/null +++ b/src/components/Reception/Footer.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/components/Reception/Navbar.vue b/src/components/Reception/Navbar.vue new file mode 100644 index 0000000..f5c8467 --- /dev/null +++ b/src/components/Reception/Navbar.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/components/Reception/Search.vue b/src/components/Reception/Search.vue new file mode 100644 index 0000000..783981f --- /dev/null +++ b/src/components/Reception/Search.vue @@ -0,0 +1,133 @@ + + + + + + + diff --git a/src/router/index.js b/src/router/index.js index dcffe2a..5919949 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,7 +30,8 @@ import Layout from '@/layout' * a base page that does not have permission requirements * all roles can be accessed */ -export const constantRoutes = [{ +export const constantRoutes = [ + { path: '/login', component: () => import('@/views/login/index'), hidden: true @@ -54,6 +55,18 @@ export const constantRoutes = [{ }], hidden: true }, + { + path: '/index', + redirect: '/index/home', + component: () => import('@/views/reception'), + children: [ + { + path: 'home', + component: () => import('@/views/reception/home') + } + ], + hidden: true + }, { path: '/', diff --git a/src/views/component/dialog.vue b/src/views/component/dialog.vue index 3de0beb..e0ff0cf 100644 --- a/src/views/component/dialog.vue +++ b/src/views/component/dialog.vue @@ -41,26 +41,27 @@ export default { }, (() => { let dom = []; - this.formInfo.forEach((i, index) => { - if (i.list_show) { - dom.push( - h( - "el-form-item", - { - ref: `elFormItem${i.field}`, - style: { - width: "100%", - }, - props: { - label: i.name, - prop: i.field, - required: - i.validation instanceof Array - ? !!i.validation.find((i) => i === "required") - : false, - }, + this.formInfo.filter(i => i.form_show).forEach((i, index) => { + dom.push( + h( + "el-form-item", + { + ref: `elFormItem${i.field}`, + style: { + width: "100%", }, - [ + props: { + label: i.name, + prop: i.field, + required: + i.validation instanceof Array + ? !!i.validation.find((i) => i === "required") + : false, + }, + }, + this.$scopedSlots[i.field] + ? this.$scopedSlots[i.field]({ fieldInfo: i, form: this.form }) + : [ h( domMap.get(i.edit_input), { @@ -79,7 +80,6 @@ export default { }, on: { [this.getEventType(i.edit_input)]: (e) => { - console.log(1111, e); if (i.field) { this.form[i.field] = e; this.form = Object.assign({}, this.form); @@ -87,61 +87,62 @@ export default { }, }, scopedSlots: - i.edit_input === "file" || i.edit_input === "files" + i.edit_input === "file" || + i.edit_input === "files" ? { - file: (scope) => { - let { file } = scope; - - console.log(111, file); - return [ - h("div", {}, [ - h("i", { + file: (scope) => { + let { file } = scope; + return [ + h("div", {}, [ + h("i", { + class: { + "el-icon-circle-check": + file.status === "success", + "el-icon-loading": + file.status === "uploading", + }, + style: { + color: + file.status === "success" + ? "green" + : "", + }, + }), + h( + "a", + { + attrs: { + href: file.url, + download: file.name, + }, class: { - "el-icon-circle-check": + "uploaded-a": file.status === "success", - "el-icon-loading": - file.status === "uploading", - }, - style: { - "color": file.status === "success" ? "green" : "" - } - }), - h( - "a", - { - attrs: { - href: file.url, - download: file.name, - }, - class: { - "uploaded-a": - file.status === "success", - } }, - file.name - ) - ]), - h("i", { - class: "el-icon-close", - on: { - ["click"]: () => - this.fileRemoveHandler( - file, - i.field - ), }, - }), - ]; - }, - } + file.name + ), + ]), + h("i", { + class: "el-icon-close", + on: { + ["click"]: () => + this.fileRemoveHandler( + file, + i.field + ), + }, + }), + ]; + }, + } : "", }, this.optionsRender(h, i) ), ] - ) - ); - } + ) + ); }); return dom; })() @@ -202,7 +203,7 @@ export default { }, //on事件类别获取 getEventType(info) { - if (info.type === "checkbox") { + if (info === "checkbox") { return "change"; } return "input"; @@ -211,12 +212,12 @@ export default { //渲染一些组件内部需要选项等 optionsRender(h, info) { if (info.edit_input === "checkbox" || info.edit_input === "radio") { - return info._paramters && info._paramters instanceof Array - ? info._paramters.map((i) => + return info._params && info._params instanceof Array + ? info._params.map((i) => h("el-option", { props: { - label: i.name || i.no || i.value || i.id, - value: i.id, + label: i.key || i.name || i.no || i.value || i.id, + value: info._relations ? i[info._relations.foreign_key] : i.value, }, }) ) @@ -287,13 +288,13 @@ export default { this.file[info.field] = fileList; }; - props.onError = (err,file,fileList) => { + props.onError = (err, file, fileList) => { this.file[info.field] = fileList; this.$message({ type: "warning", - message: err - }) - } + message: err, + }); + }; } return props; }, diff --git a/src/views/component/table.vue b/src/views/component/table.vue index 21c1727..6135c74 100644 --- a/src/views/component/table.vue +++ b/src/views/component/table.vue @@ -63,9 +63,9 @@ @@ -160,9 +160,9 @@ @@ -414,26 +414,28 @@ export default { } fields.forEach((i, index) => { i._relations = relation.find((j) => j.local_key === i.field); - i._params = { - value: [], - load: false, - get: () => i._params.value, - set: () => { - if(i._params.load) return - i._relations.parameter_id - ? getparameter({ id: i._relations.parameter_id },false).then((res) => { - i._params.value = res.detail; - }) - : this.index({ - table_name: i._relations.link_table_name, - page: 1, - page_size: 9999, - }).then((res) => { - i._params.value = res.data; - }); - i._params.load = true - }, - }; + if (i.select_item && typeof i.select_item === 'object') { + let keys = Object.keys(i.select_item) + i._params = keys.map(key => { + return { + key, + value: i.select_item[key] + } + }) + } + if (i._relations) { + i._params = i._relations.parameter_id + ? getparameter({ id: i._relations.parameter_id },false).then((res) => { + i._params = res.detail; + }) + : this.index({ + table_name: i._relations.link_table_name, + page: 1, + page_size: 9999, + }).then((res) => { + i._params = res.data; + }); + } }); this.form = fields; console.log(111, this.form); @@ -464,44 +466,56 @@ export default { // }) // } // this.form = res.fields - this.table = res.fields + this.table = this.form ?.filter((i) => i.list_show) .map((i) => { let linkOb = {}; - if (i.parameter_id) { - linkOb.customFn = (row) => { - return {row[i.link_with_name]?.value}; - }; + if (i.select_item && typeof i.select_item === 'object') { + let keys = Object.keys(i.select_item) + linkOb.customFn = row => { + let paramMap = new Map() + keys.forEach(key => { + paramMap.set(i.select_item[key],key) + }) + + return ( + + { paramMap.get(row[i.field].toString()) } + + ) + } } - if (i.link_table_name) { - if (i.link_relation === "hasOne") { - linkOb.customFn = (row) => { + if (i._relations) { + let { link_relation, foreign_key, link_with_name } = i._relations + if (link_relation === 'newHasOne' || link_relation === 'hasOne') { + linkOb.customFn = row => { if (i.edit_input === "file") { return ( - {row[i.link_with_name]?.original_name} + {row[link_with_name]?.original_name} ); } else { return ( - {row[i.link_with_name]?.name || - row[i.link_with_name]?.no || - row[i.link_with_name]?.value} + { row[link_with_name]?.name || + row[link_with_name]?.no || + row[link_with_name]?.value } ); } - }; + } } - if (i.link_relation === "hasMany") { + + if (link_relation === "hasMany" || link_relation === 'newHasMany') { linkOb.customFn = (row) => { return (
- {row[i.link_with_name]?.map((o) => ( + {row[link_with_name]?.map((o) => ( {o?.name || o?.no || o?.value} ))}
@@ -531,17 +545,24 @@ export default { columnArrTest() { return function (field) { return this.form.find((i) => i.field === field) - ? this.form.find((i) => i.field === field).search_input === "checkbox" + ? this.form.find((i) => i.field === field).search_input === "checkbox" || this.form.find((i) => i.field === field).search_input === "radio" : false; }; }, + getColumnField() { + return function (field) { + return this.form.find((i) => i.field === field) + ? this.form.find((i) => i.field === field) + : {}; + }; + }, getColumnParams() { return function (field) { return this.form.find((i) => i.field === field) - ? this.form.find((i) => i.field === field)._paramters + ? this.form.find((i) => i.field === field)._params : []; }; - }, + } }, created() { this.getFormDetail(); diff --git a/src/views/infomation/flows.vue b/src/views/infomation/flows.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/reception/home/index.vue b/src/views/reception/home/index.vue new file mode 100644 index 0000000..d81d697 --- /dev/null +++ b/src/views/reception/home/index.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/views/reception/index.vue b/src/views/reception/index.vue new file mode 100644 index 0000000..c7afd0c --- /dev/null +++ b/src/views/reception/index.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/views/system/components/editPane.vue b/src/views/system/components/editPane.vue index 0cb13d8..b3a324f 100644 --- a/src/views/system/components/editPane.vue +++ b/src/views/system/components/editPane.vue @@ -23,6 +23,36 @@ placeholder="请输入帮助文字" > + +
+
+ + +
+ +
+
+
+
+ +
+
+ + +
+
@@ -140,7 +173,6 @@