295 lines
14 KiB
HTML
295 lines
14 KiB
HTML
<!doctype html>
|
|
<html lang="${lang,escape}">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
|
|
<title>智慧工会</title>
|
|
|
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vant/index.css" />
|
|
<!-- <link rel="stylesheet" href="${base!}/assets/platform/plugins/vant-green/index.css" />-->
|
|
<link rel="stylesheet" href="${base!}/assets/platform/css/h5.css" />
|
|
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css" />
|
|
<link rel="stylesheet" href="https://cdn.staticfile.net/animate.css/4.1.1/animate.css" />
|
|
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css" />
|
|
<link rel="stylesheet" href="${base!}/assets/platform/css/pdf/pdfh5.css">
|
|
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.2.0/weui.min.css">
|
|
|
|
<script src="${base!}/assets/platform/plugins/vue/vue.js"></script>
|
|
<script src="${base!}/assets/platform/plugins/vuex/vuex.js"></script>
|
|
<script src="${base!}/assets/platform/plugins/vuex-persistedstate/vuex-persistedstate.umd.js"></script>
|
|
<script src="${base!}/assets/platform/plugins/vue-http-loader/httpVueLoader.js"></script>
|
|
|
|
<!-- <script src="${base!}/assets/platform/plugins/vant-green/vant-green.min.js"></script>-->
|
|
<script src="${base!}/assets/platform/plugins/vant/index.js"></script>
|
|
|
|
<script src="${base!}/assets/platform/plugins/moment/moment.min.js"></script>
|
|
<script src="${base!}/assets/platform/plugins/axios/axios.js"></script>
|
|
|
|
<script src="${base!}/assets/platform/plugins/jquery/jquery.js"></script>
|
|
<!-- pjax是异步加载html片段的工具,模拟前端路由机制 -->
|
|
<script src="${base!}/assets/platform/plugins/pjax/jquery.pjax.js"></script>
|
|
|
|
<!--nprogress 配合pjax使用-->
|
|
<link rel="stylesheet" href="https://cdn.staticfile.net/nprogress/0.2.0/nprogress.css" />
|
|
<script src="${base!}/assets/platform/plugins/nprogress/nprogress.js"></script>
|
|
|
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css" />
|
|
<!-- import ElementUI -->
|
|
<script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script>
|
|
|
|
<!-- 引入 form-create 和 designer -->
|
|
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js?v=0.0.1"></script>
|
|
<script src="${base!}/assets/platform/plugins/form-create/designer/index.umd.js"></script>
|
|
|
|
<!--图片预览-->
|
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/viewerjs/viewer.css" />
|
|
<script src="${base!}/assets/platform/plugins/viewerjs/viewer.js"></script>
|
|
|
|
<!--pdf平铺展示-->
|
|
<script src="${base!}/assets/platform/plugins/pdfJs/h5/pdf.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="${base!}/assets/platform/plugins/pdfJs/h5/pdf.worker.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="${base!}/assets/platform/plugins/pdfJs/h5/pdfh5.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
<!--h5扫码-->
|
|
<script src="${base!}/assets/platform/plugins/html5-qrcode/html5-qrcode.min.js"></script>
|
|
|
|
<script src="${base!}/assets/platform/js/mixin/styleMixin.js"></script>
|
|
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
|
|
<script src="${base!}/assets/platform/js/util/commonUtil.js"></script>
|
|
<script src="${base!}/assets/platform/js/tool/businessTool.js"></script>
|
|
|
|
<!--富文本编辑器-->
|
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/wangEditor4/wangEditor.css" />
|
|
<script src="${base!}/assets/platform/plugins/wangEditor4/wangEditor.js"></script>
|
|
<!--签字canvas-->
|
|
<script src="${base!}/assets/platform/plugins/smooth-signature/index.umd.min.js"></script>
|
|
<!--g2plot-->
|
|
<script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script>
|
|
|
|
<!--二维码-->
|
|
<script src="${base!}/assets/platform/plugins/vue-qrcode/index.js"></script>
|
|
|
|
<script>
|
|
window._AMapSecurityConfig = {
|
|
securityJsCode: "4fa1e1aeabba7eb9518129cf57ab17c1"
|
|
}
|
|
</script>
|
|
<script
|
|
type="text/javascript"
|
|
src="https://webapi.amap.com/maps?v=2.0&key=57f0d098ba1b881ecc436c4cfd23bbbf&plugin=AMap.PolyEditor,AMap.Geolocation"
|
|
></script>
|
|
|
|
<script>
|
|
Vue.config.devtools = true
|
|
|
|
function toggleShowBar() {
|
|
if (["/platform/h5/home", "/platform/home"].includes(window.location.pathname)) {
|
|
document.querySelector("body>.main-page").classList.add("page-showtabbar")
|
|
} else {
|
|
document.querySelector("body>.main-page").classList.remove("page-showtabbar")
|
|
}
|
|
}
|
|
|
|
// toast多例模式
|
|
vant.Toast.allowMultiple()
|
|
|
|
function formRules(rules, form, callback) {
|
|
for (let key in rules) {
|
|
const value = form[key]
|
|
const rs = rules[key]
|
|
for (let i = 0; i < rs.length; i++) {
|
|
if (rs[i].required && (!value || value.length === 0)) {
|
|
vant.Toast(rs[i].message)
|
|
callback(false)
|
|
return
|
|
} else if (rs[i].pattern && !rs[i].pattern.test(value)) {
|
|
vant.Toast(rs[i].message)
|
|
callback(false)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
callback(true)
|
|
}
|
|
|
|
//初始化pjax
|
|
;(function initPjax() {
|
|
if ($.support.pjax) {
|
|
$(document).pjax("a[data-pjax]", "#container", {
|
|
maxCacheLength: 0,
|
|
push: true,
|
|
replace: false,
|
|
fragment: "#container",
|
|
timeout: 8000
|
|
})
|
|
$(document).on("pjax:send", function () {
|
|
NProgress.start()
|
|
window.customStyleList = document.querySelectorAll('style[id^="style-"]')
|
|
// document.querySelectorAll('style[id^="style-"]').forEach((style) => {
|
|
// style.parentNode.removeChild(style)
|
|
// })
|
|
})
|
|
$(document).on("pjax:complete", function () {
|
|
if (window.customStyleList) {
|
|
window.customStyleList.forEach((style) => {
|
|
style.parentNode.removeChild(style)
|
|
})
|
|
}
|
|
NProgress.done()
|
|
toggleShowBar()
|
|
})
|
|
|
|
// 监听浏览器的前进和后退操作
|
|
$(window).on("popstate", function (event) {
|
|
if (event.originalEvent.state) {
|
|
// 如果存在历史记录状态,触发 Pjax 加载对应内容
|
|
$.pjax({
|
|
url: event.originalEvent.state.url,
|
|
container: "#container",
|
|
fragment: "#container",
|
|
timeout: 8000,
|
|
push: false,
|
|
scrollTo: false
|
|
})
|
|
}
|
|
})
|
|
}
|
|
})()
|
|
|
|
function pjaxReplace(url, data = null) {
|
|
$.pjax({
|
|
url: url,
|
|
container: "#container",
|
|
maxCacheLength: 0,
|
|
push: true,
|
|
replace: false,
|
|
fragment: "#container",
|
|
timeout: 8000,
|
|
data: data
|
|
})
|
|
}
|
|
|
|
function removeHTMLTag(str) {
|
|
str = str.replace(/<\/?[^>]*>/g, "") //去除HTML tag
|
|
str = str.replace(/[ | ]*\n/g, "\n") //去除行尾空白
|
|
str = str.replace(/\n[\s| | ]*\r/g, "\n") //去除多余空行
|
|
str = str.replace(/ /gi, "") //去掉
|
|
return str
|
|
}
|
|
|
|
function GetQueryString(name) {
|
|
return new URLSearchParams(window.location.search).get(name)
|
|
}
|
|
|
|
function base64ToFile(base64Data, filename) {
|
|
// 将base64的数据部分提取出来
|
|
const parts = base64Data.split(";base64,")
|
|
const contentType = parts[0].split(":")[1]
|
|
const raw = window.atob(parts[1])
|
|
const rawLength = raw.length
|
|
const uInt8Array = new Uint8Array(rawLength)
|
|
|
|
for (let i = 0; i < rawLength; ++i) {
|
|
uInt8Array[i] = raw.charCodeAt(i)
|
|
}
|
|
|
|
// 使用Blob对象创建File对象
|
|
const blob = new Blob([uInt8Array], { type: contentType })
|
|
blob.lastModifiedDate = new Date()
|
|
blob.name = filename
|
|
return new File([blob], filename, { type: contentType })
|
|
}
|
|
|
|
function createListLoading(icon = "https://preview.qiantucdn.com/58pic/35/39/61/62K58PICb88i68HEwVnm5_PIC2018.gif!qt480") {
|
|
return vant.Toast.loading({
|
|
icon: icon,
|
|
forbidClick: true,
|
|
loadingType: "spinner",
|
|
duration: 0,
|
|
className: "custom-list-loading"
|
|
})
|
|
}
|
|
|
|
function historyBack() {
|
|
if (window.history.length > 1) {
|
|
window.history.back()
|
|
} else {
|
|
window.location.href = "/platform/h5/home"
|
|
}
|
|
}
|
|
|
|
Vue.mixin({
|
|
methods: {
|
|
historyBack: historyBack
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--vuex相关-->
|
|
<script>
|
|
const logonUser = ${json(@auth.getLogonUser())}
|
|
const store = new Vuex.Store({
|
|
plugins: [createPersistedState({
|
|
key: "zhgh-h5-vuex",
|
|
paths: ["activeTarBar"],
|
|
storage: window.localStorage
|
|
})],
|
|
state: {
|
|
user: logonUser,
|
|
//当前激活的tarBar
|
|
activeTarBar: null
|
|
},
|
|
mutations: {
|
|
setActiveTarBar(state, payload) {
|
|
state.activeTarBar = payload
|
|
}
|
|
},
|
|
actions: {
|
|
logout() {
|
|
window.localStorage.removeItem("zhgh-h5-vuex")
|
|
window.location.href = "/platform/login/logout"
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
//挂载
|
|
Vue.prototype.$moment = moment
|
|
Vue.prototype.$businessTool = businessTool
|
|
Vue.prototype.$commonUtil = commonUtil
|
|
Vue.prototype.$auth = commonUtil.authService()
|
|
Vue.prototype.$axios = commonUtil.axiosService()
|
|
Vue.prototype.$downLoad = commonUtil.downLoadService.bind(commonUtil)
|
|
Vue.prototype.$pjaxReplace = pjaxReplace
|
|
</script>
|
|
|
|
<script>
|
|
Vue.component(VueQrcode.name, VueQrcode)
|
|
Vue.component("rich-text", httpVueLoader("/components/plugins/sysRichTextView/index.vue?v=" + new Date().getTime()))
|
|
Vue.component("h5-file-upload", httpVueLoader("/components/plugins/sysUpload/h5Index.vue?v=" + new Date().getTime()))
|
|
Vue.component("h5-signature", httpVueLoader("/components/plugins/sysSignature/h5Index.vue?v=" + new Date().getTime()))
|
|
Vue.component("text-editor", httpVueLoader("/components/plugins/sysTextEditor/index.vue?v=" + new Date().getTime()))
|
|
Vue.component("dict-tag", httpVueLoader("/components/plugins/sysDict/DictTag.vue?v=" + new Date().getTime()))
|
|
Vue.component("svg-icon", httpVueLoader("/components/plugins/sysSvgIcon/index.vue?v=" + new Date().getTime()))
|
|
Vue.component("year-van-dropdown-item", httpVueLoader("/components/plugins/vantMore/yearVanDropDownItem.vue?v=" + new Date().getTime()))
|
|
Vue.component("van-text-dialog", httpVueLoader("/components/plugins/vantMore/vantTextDialog.vue?v=" + new Date().getTime()))
|
|
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
|
|
Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + new Date().getTime()))
|
|
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + new Date().getTime()))
|
|
Vue.component("file-preview", httpVueLoader("/components/plugins/sysFilePreview/H5Index.vue?v=" + new Date().getTime()))
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div class="main-page page-showtabbar">
|
|
<div class="page-wrapper">
|
|
<div id="container">${layoutContent}</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
toggleShowBar()
|
|
</script>
|
|
</body>
|
|
</html>
|