diff --git a/src/router/index.js b/src/router/index.js index 0c0b8ea..a5069f3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,10 +1,10 @@ -import Vue from 'vue' -import Router from 'vue-router' +import Vue from "vue"; +import Router from "vue-router"; -Vue.use(Router) +Vue.use(Router); /* Layout */ -import Layout from '@/layout' +import Layout from "@/layout"; /** * Note: sub-menu only appear when route children.length >= 1 @@ -30,83 +30,101 @@ import Layout from '@/layout' * a base page that does not have permission requirements * all roles can be accessed */ -export const constantRoutes = [{ - path: '/login', - component: () => import('@/views/login/index'), - hidden: true +export const constantRoutes = [ + { + path: "/login", + component: () => import("@/views/login/index"), + hidden: true, }, { - path: '/404', - component: () => import('@/views/404'), - hidden: true + path: "/404", + component: () => import("@/views/404"), + hidden: true, }, { - path: '/test', - component: () => import('@/views/component/test.vue'), - hidden: true + path: "/test", + component: () => import("@/views/component/test.vue"), + hidden: true, }, { - path: '/info', + path: "/info", component: Layout, - children: [{ - path: 'password', - component: () => import('@/views/system/password'), - name: '密码修改', - meta: { - title: '密码修改' - } - }], - hidden: true + children: [ + { + path: "password", + component: () => import("@/views/system/password"), + name: "密码修改", + meta: { + title: "密码修改", + }, + }, + ], + hidden: true, }, { - path: '/', + path: "/", component: Layout, - redirect: '/dashboard', - children: [{ - path: 'dashboard', - name: '系统首页', - component: () => import('@/views/dashboard/index'), - meta: { - title: '系统首页', - icon: 'dashboard' - } - }, ] + redirect: "/dashboard", + children: [ + { + path: "dashboard", + name: "系统首页", + component: () => import("@/views/dashboard/index"), + meta: { + title: "系统首页", + icon: "dashboard", + }, + }, + ], + }, + { + path: "/h5", + component: () => import("@/views/h5/index.vue"), + meta: { + title: "首页", + }, + hidden: true + }, + { + path: '/h5login', + component:() => import("@/views/h5/login.vue"), + meta: { + title: "登录", + }, + hidden: true } -] - - +]; /** * asyncRoutes * the routes that need to be dynamically loaded based on user roles */ export const asyncRoutes = [ - - // 404 page must be placed at the end !!! { - path: '*', - redirect: '/404', - hidden: true - } -] + path: "*", + redirect: "/404", + hidden: true, + }, +]; -const createRouter = () => new Router({ - // mode: 'history', // require service support - scrollBehavior: () => ({ - y: 0 - }), - routes: constantRoutes -}) +const createRouter = () => + new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ + y: 0, + }), + routes: constantRoutes, + }); -const router = createRouter() +const router = createRouter(); // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { - const newRouter = createRouter() - router.matcher = newRouter.matcher // reset router + const newRouter = createRouter(); + router.matcher = newRouter.matcher; // reset router } -export default router +export default router; diff --git a/src/styles/iconfont.css b/src/styles/iconfont.css index 9f6fdb2..03f68d7 100644 --- a/src/styles/iconfont.css +++ b/src/styles/iconfont.css @@ -1,8 +1,8 @@ @font-face { - font-family: "iconfont"; /* Project id 4052909 */ - src: url('iconfont.woff2?t=1683361610626') format('woff2'), - url('iconfont.woff?t=1683361610626') format('woff'), - url('iconfont.ttf?t=1683361610626') format('truetype'); + font-family: "iconfont"; /* Project id 4318661 */ + src: url('iconfont.woff2?t=1699320146625') format('woff2'), + url('iconfont.woff?t=1699320146625') format('woff'), + url('iconfont.ttf?t=1699320146625') format('truetype'); } .iconfont { @@ -13,107 +13,47 @@ -moz-osx-font-smoothing: grayscale; } -.icon-jurassic_process-list:before { - content: "\e6c4"; +.icon-heyan:before { + content: "\e661"; } -.icon-biaodan:before { - content: "\e663"; +.icon-qiantaifuwu-:before { + content: "\e605"; } -.icon-biaozhunhuaguizeguanli:before { - content: "\e60a"; -} - -.icon-a-zhidu6:before { - content: "\eb07"; -} - -.icon-dat:before { - content: "\e691"; -} - -.icon-audio:before { - content: "\e692"; -} - -.icon-video:before { - content: "\e693"; -} - -.icon-zip:before { - content: "\e694"; -} - -.icon-image:before { - content: "\e695"; -} - -.icon-pdf:before { - content: "\e696"; -} - -.icon-ppt:before { - content: "\e697"; -} - -.icon-21excel:before { - content: "\e698"; -} - -.icon-21word:before { - content: "\e699"; -} - -.icon-21move:before { - content: "\e69a"; -} - -.icon-21setting:before { - content: "\e69b"; -} - -.icon-21upload:before { - content: "\e69c"; -} - -.icon-21download:before { - content: "\e69d"; +.icon-zhongduanzaixianguanli:before { + content: "\e618"; } -.icon-21cancel:before { - content: "\e69e"; +.icon-zhanghaoguanli:before { + content: "\e690"; } -.icon-21ok:before { - content: "\e69f"; +.icon-rw-qt-t:before { + content: "\e7c4"; } -.icon-21copy:before { - content: "\e6a0"; +.icon-zaitu:before { + content: "\e60a"; } -.icon-21delete:before { - content: "\e6a1"; +.icon-chaxun:before { + content: "\e61b"; } -.icon-21edit:before { - content: "\e6a2"; +.icon-heyan1:before { + content: "\e604"; } -.icon-21new:before { +.icon-heyan2:before { content: "\e6a3"; } -.icon-21folder:before { - content: "\e6a4"; -} - -.icon-21mutil:before { - content: "\e6a5"; +.icon-dayin:before { + content: "\e65c"; } -.icon-21file:before { - content: "\e6a6"; +.icon-lianxi2hebing_dayin:before { + content: "\e630"; } diff --git a/src/styles/iconfont.ttf b/src/styles/iconfont.ttf index 4e2970e..680433e 100644 Binary files a/src/styles/iconfont.ttf and b/src/styles/iconfont.ttf differ diff --git a/src/styles/iconfont.woff b/src/styles/iconfont.woff index b7c5531..12c5f11 100644 Binary files a/src/styles/iconfont.woff and b/src/styles/iconfont.woff differ diff --git a/src/styles/iconfont.woff2 b/src/styles/iconfont.woff2 index 0c051c5..c505699 100644 Binary files a/src/styles/iconfont.woff2 and b/src/styles/iconfont.woff2 differ diff --git a/src/views/component/detail.vue b/src/views/component/detail.vue index 8139a21..7e48717 100644 --- a/src/views/component/detail.vue +++ b/src/views/component/detail.vue @@ -148,13 +148,21 @@ export default { Promise.all(promiseAll).then(res => { if (item.edit_input !== 'files') { let dataTable = this.allTables.find(t => t.table_name === res[1].relation[0].link_table_name); - formShow({ id: dataTable.id }).then(res1 => { + if (dataTable) { + formShow({ id: dataTable?.id }).then(res1 => { + this.linkTableList.push({ + value: res[0].data?.map(o => o[res[1]?.relation[0]?.link_with_name]), + field: this.formatColumn(res1), + title: res[1]?.name + }) + }) + } else { this.linkTableList.push({ - value: res[0].data?.map(o => o[res[1]?.relation[0]?.link_with_name]), - field: this.formatColumn(res1), + value: this.detail[item?._relations?.link_with_name], + field: this.formatColumn(res[1]), title: res[1]?.name }) - }) + } } else { this.linkTableList.push({ value: res[0].data?.map(o => o[res[1]?.relation[0]?.link_with_name]), diff --git a/src/views/component/dialog.vue b/src/views/component/dialog.vue index 2cdf3e3..ea2c37c 100644 --- a/src/views/component/dialog.vue +++ b/src/views/component/dialog.vue @@ -69,12 +69,14 @@ export default { }, this.$scopedSlots[i.field] ? this.$scopedSlots[i.field]({ - fieldInfo: i, - form: this.form, - file: this.file, - }) - : (i._relations && i.edit_input !== 'file' && i.edit_input !== 'files') - ? [ + fieldInfo: i, + form: this.form, + file: this.file, + }) + : i._relations && + i.edit_input !== "file" && + i.edit_input !== "files" + ? [ h( "el-input", { @@ -82,60 +84,50 @@ export default { readonly: true, value: i._relations.link_relation === - "newHasOne" || + "newHasOne" || i._relations.link_relation === "hasOne" ? this.originalForm[ - i._relations.link_with_name + i._relations.link_with_name ]?.name || - this.originalForm[ - i._relations.link_with_name + this.originalForm[ + i._relations.link_with_name ]?.mingcheng || - this.originalForm[ - i._relations.link_with_name + this.originalForm[ + i._relations.link_with_name ]?.no || - this.originalForm[ - i._relations.link_with_name - ]?.id + this.originalForm[ + i._relations.link_with_name + ]?.id || this.form[i.field] : this.originalForm[ - i._relations.link_with_name + i._relations.link_with_name ] - ?.map( - (j) => - j[i._relations.custom_form_field] - ) - ?.toString(), + ?.map( + (j) => + j[ + i._relations + .custom_form_field + ] + ) + ?.toString(), }, on: { - // ['focus']:e => { - // this.$refs['linkPickModal'].show() - // } - }, - }, - [ - h("el-button", { - props: { - icon: "el-icon-arrow-right", - }, - slot: "append", - on: { - click: (e) => { - this.pickedLinkField.field = i.field; - this.pickedLinkField.linkType = - i._relations.link_relation; - this.pickedLinkField.linkTableName = - i._relations.link_table_name; - this.pickedLinkField.originalRows = - this.originalForm[ - i._relations.link_with_name + ['focus']:e => { + this.pickedLinkField.field = i.field; + this.pickedLinkField.linkType = + i._relations.link_relation; + this.pickedLinkField.linkTableName = + i._relations.link_table_name; + this.pickedLinkField.originalRows = + this.originalForm[ + i._relations.link_with_name ]; - this.$refs["linkPickModal"].show(); - }, - }, - }), - ] - ), + this.$refs["linkPickModal"].show(); + } + }, + } + ) ] - : [ + : [ h( domMap.get(i.edit_input), { @@ -164,55 +156,55 @@ export default { i.edit_input === "file" || i.edit_input === "files" ? { - file: (scope) => { - let { file } = scope; - 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", - }, - style: { - padding: "0 4px", - }, + padding: "0 4px", }, - 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) @@ -314,16 +306,16 @@ export default { if (info.edit_input === "checkbox" || info.edit_input === "radio") { return info._params && info._params instanceof Array ? info._params.map((i) => - h("el-option", { - props: { - label: - i.key || i.value || i.name || i.no || i.mingcheng || i.id, - value: info._relations - ? i[info._relations.foreign_key] - : i.value, - }, - }) - ) + h("el-option", { + props: { + label: + i.key || i.value || i.name || i.no || i.mingcheng || i.id, + value: info._relations + ? i[info._relations.foreign_key] + : i.value, + }, + }) + ) : []; } if (info.edit_input === "file" || info.edit_input === "files") { @@ -443,21 +435,21 @@ export default { if (i && (i.edit_input === "file" || i.edit_input === "files")) { res[i._relations.link_with_name] ? (this.file[i.field] = - res[i._relations.link_with_name] instanceof Array - ? res[i._relations.link_with_name].map((i) => { - return { - name: i?.original_name, - url: i?.url, - response: i, - }; - }) - : [ - { - name: res[i._relations.link_with_name]?.original_name, - url: res[i._relations.link_with_name]?.url, - response: res[i._relations.link_with_name], - }, - ]) + res[i._relations.link_with_name] instanceof Array + ? res[i._relations.link_with_name].map((i) => { + return { + name: i?.original_name, + url: i?.url, + response: i, + }; + }) + : [ + { + name: res[i._relations.link_with_name]?.original_name, + url: res[i._relations.link_with_name]?.url, + response: res[i._relations.link_with_name], + }, + ]) : (this.file[i.field] = []); return @@ -515,7 +507,7 @@ export default { if (info.edit_input === "files") { copyForm[info._relations.link_with_name] = this.file[ info.field - ]?.map((i) => { + ]?.map((i) => { return { upload_id: i?.response?.id, original_name: i?.response?.original_name @@ -526,7 +518,7 @@ export default { info.field ] instanceof Array ? copyForm[ info.field - ]?.map((i) => { + ]?.map((i) => { return { [info._relations.custom_form_field]: i, //...copyRelation, diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue new file mode 100644 index 0000000..98b6b2f --- /dev/null +++ b/src/views/h5/index.vue @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/src/views/h5/login.vue b/src/views/h5/login.vue new file mode 100644 index 0000000..7ba120c --- /dev/null +++ b/src/views/h5/login.vue @@ -0,0 +1,60 @@ + + + + 苏州市总工会 + 在档困难职工查询系统 + + 请输入留档信息登录 + + + + + + + + + 确 认 + + + + + 2023 苏州市总工会 + + + + + +