hd-idevvue3 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -191
- package/dist/index.html +17 -0
- package/package.json +13 -9
- package/pnpm-lock.yaml +5593 -0
- package/src/App.vue +15 -0
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +43 -0
- package/src/demo/dropdemo.vue +43 -0
- package/src/demo/extsets.vue +107 -0
- package/src/demo/formedit.vue +145 -0
- package/src/demo/hightquery.vue +169 -0
- package/src/demo/inlineedit.vue +88 -0
- package/src/demo/selfdrop.vue +41 -0
- package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +2 -0
- package/src/directive/el-dragDialog/drag.js +124 -0
- package/src/directive/el-dragDialog/index.js +13 -0
- package/src/errorLog.js +14 -0
- package/src/hdcom/BigGrid.js +173 -0
- package/src/hdcom/BillShow.vue +90 -0
- package/src/hdcom/BillUpload.vue +253 -0
- package/src/hdcom/BtnRight.vue +98 -0
- package/src/hdcom/ErrHint.vue +30 -0
- package/src/hdcom/ExtendColumn.vue +108 -0
- package/src/hdcom/ExtendCommon.js +29 -0
- package/src/hdcom/ExtendForm.vue +114 -0
- package/src/hdcom/FacePicUpload.vue +71 -0
- package/src/hdcom/FaceRecTest.vue +104 -0
- package/src/hdcom/GridChart.vue +194 -0
- package/src/hdcom/GridExField.vue +281 -0
- package/src/hdcom/GridShow.vue +238 -0
- package/src/hdcom/HdAside.vue +178 -0
- package/src/hdcom/HdBtn.vue +113 -0
- package/src/hdcom/HdButton.vue +137 -0
- package/src/hdcom/HdComFaceRec.vue +58 -0
- package/src/hdcom/HdComGrid.vue +776 -0
- package/src/hdcom/HdComQuery.vue +273 -0
- package/src/hdcom/HdComQueryDetail.vue +161 -0
- package/src/hdcom/HdComSortDetail.vue +155 -0
- package/src/hdcom/HdDatePicker.vue +78 -0
- package/src/hdcom/HdDialog.vue +63 -0
- package/src/hdcom/HdDrop.vue +163 -0
- package/src/hdcom/HdFileUpload.vue +148 -0
- package/src/hdcom/HdFilterBox.vue +90 -0
- package/src/hdcom/HdFooter.vue +149 -0
- package/src/hdcom/HdForm.vue +278 -0
- package/src/hdcom/HdFormBtn.vue +89 -0
- package/src/hdcom/HdFormItem.vue +35 -0
- package/src/hdcom/HdGctosGrid +0 -0
- package/src/hdcom/HdGrid.vue +825 -0
- package/src/hdcom/HdGridEditBtn.vue +44 -0
- package/src/hdcom/HdGridExt.js +219 -0
- package/src/hdcom/HdGridSel.vue +223 -0
- package/src/hdcom/HdHeader.vue +148 -0
- package/src/hdcom/HdHotKey.vue +81 -0
- package/src/hdcom/HdInputHint.vue +49 -0
- package/src/hdcom/HdMain.vue +43 -0
- package/src/hdcom/HdMessage.vue +192 -0
- package/src/hdcom/HdNum.vue +69 -0
- package/src/hdcom/HdPopSel.vue +58 -0
- package/src/hdcom/HdRightMenu.vue +61 -0
- package/src/hdcom/HdSel/SelGridFieldcod.vue +36 -0
- package/src/hdcom/HdTableColumn.vue +334 -0
- package/src/hdcom/HdTempSave.vue +140 -0
- package/src/hdcom/HdTree.vue +86 -0
- package/src/hdcom/HdTreeTable/eval.js +32 -0
- package/src/hdcom/HdTreeTable/index.vue +174 -0
- package/src/hdcom/ImportExcel.vue +143 -0
- package/src/hdcom/PdfShow.vue +266 -0
- package/src/hdcom/index.js +80 -0
- package/src/idev.common.js +72 -0
- package/src/index.js +13 -0
- package/src/utils/HdQuery.js +54 -0
- package/src/utils/comutils.js +98 -0
- package/src/utils/utils.js +105 -0
- package/src/vendor/Blob.js +179 -0
- package/src/vendor/Export2Excel.js +220 -0
- package/src/vendor/Export2Zip.js +22 -0
- package/src/views/layout/AppMain.vue +32 -0
- package/src/views/layout/HdLayout.vue +78 -0
- package/src/views/layout/header/ElasticSearch.vue +225 -0
- package/src/views/layout/header/HZRecorder.js +231 -0
- package/src/views/layout/header/HeaderSearch.vue +198 -0
- package/src/views/layout/header/Levelbar.vue +49 -0
- package/src/views/layout/header/MainHeader.vue +271 -0
- package/src/views/layout/header/Navbar.vue +105 -0
- package/src/views/layout/header/ScrollPane.vue +81 -0
- package/src/views/layout/header/TagsView.vue +210 -0
- package/src/views/layout/header/VocRec.vue +97 -0
- package/src/views/layout/header/changepswform.vue +96 -0
- package/src/views/layout/index.js +12 -0
- package/src/views/layout/menu/Hamburger.vue +45 -0
- package/src/views/layout/menu/HdMenu.vue +167 -0
- package/src/views/layout/menu/css/menu.css +288 -0
- package/src/views/layout/menu/index.vue +25 -0
- package/src/views/privilege/commsg/commsg.vue +78 -0
- package/src/views/privilege/commsg/commsgOrgn.vue +42 -0
- package/src/views/privilege/commsg/commsgRole.vue +149 -0
- package/src/views/privilege/commsg/commsgform.vue +160 -0
- package/src/views/privilege/commsg/commsgiframe.vue +33 -0
- package/src/views/privilege/commsg/commsgto.vue +120 -0
- package/src/views/privilege/commsg/commsgtoform.vue +108 -0
- package/src/views/privilege/commsg/commsgtrans.vue +155 -0
- package/src/views/privilege/exfield/comexcolumn.vue +71 -0
- package/src/views/privilege/exfield/comexcolumnform.vue +101 -0
- package/src/views/privilege/exfield/comexfield.vue +31 -0
- package/src/views/privilege/exfield/comexfieldform.vue +94 -0
- package/src/views/privilege/exfield/comexfieldsub.vue +72 -0
- package/src/views/privilege/index.js +42 -0
- package/src/views/privilege/menu/comMenu.vue +41 -0
- package/src/views/privilege/menu/menu.vue +133 -0
- package/src/views/privilege/menu/menuinfo.vue +56 -0
- package/src/views/privilege/menu/rolelist.vue +47 -0
- package/src/views/privilege/menu/userlist.vue +49 -0
- package/src/views/privilege/mobile/authmobileupdate.vue +69 -0
- package/src/views/privilege/mobile/authmobileupdateform.vue +90 -0
- package/src/views/privilege/orgDept/authOrgn.vue +96 -0
- package/src/views/privilege/orgDept/authorgnform.vue +145 -0
- package/src/views/privilege/orgDept/orgDept.vue +37 -0
- package/src/views/privilege/orgDept/orgTree.vue +88 -0
- package/src/views/privilege/orgDept/orgnselect.vue +134 -0
- package/src/views/privilege/personDept/authuser.vue +123 -0
- package/src/views/privilege/personDept/authuserform.vue +154 -0
- package/src/views/privilege/personDept/facerec.vue +117 -0
- package/src/views/privilege/personDept/orgncascader.vue +125 -0
- package/src/views/privilege/personDept/personDept.vue +31 -0
- package/src/views/privilege/quartz/comquartzjob.vue +65 -0
- package/src/views/privilege/quartz/comquartzjobform.vue +99 -0
- package/src/views/privilege/quartz/comquartzlog.vue +59 -0
- package/src/views/privilege/role/btnRole.vue +117 -0
- package/src/views/privilege/role/menuRole.vue +64 -0
- package/src/views/privilege/role/orgnRole.vue +56 -0
- package/src/views/privilege/role/role.vue +67 -0
- package/src/views/privilege/role/rolelist.vue +67 -0
- package/src/views/privilege/role/roleselect.vue +57 -0
- package/src/views/privilege/search/comsearch.vue +105 -0
- package/src/views/privilege/search/menu.vue +52 -0
- package/src/views/privilege/syscode/syscode.vue +103 -0
- package/src/views/privilege/syscode/sysfield.vue +66 -0
- package/src/views/privilege/syscode/sysfieldframe.vue +30 -0
- package/src/views/privilege/syslog/menulog.vue +52 -0
- package/src/views/privilege/syslog/syslog.vue +115 -0
- package/src/views/privilege/syslog/syslogconfig.vue +61 -0
- package/src/views/privilege/syslog/syslogform.vue +83 -0
- package/src/views/privilege/syslog/syslogframe.vue +26 -0
- package/src/views/privilege/userRole/userRole.vue +122 -0
- package/src/views/privilege.zip +0 -0
- package/vite.config.js +118 -0
- package/.babelrc +0 -17
- package/.editorconfig +0 -14
- package/.eslintignore +0 -3
- package/.npminstall.done +0 -1
- package/.postcssrc.js +0 -8
- package/LICENSE +0 -21
- package/Listening +0 -28
- package/build/build.js +0 -70
- package/build/check-versions.js +0 -45
- package/build/config.js +0 -81
- package/build/dev-client.js +0 -9
- package/build/dev-server.js +0 -93
- package/build/utils.js +0 -78
- package/build/vue-loader.conf.js +0 -12
- package/build/webpack.common.js +0 -37
- package/build/webpack.component.js +0 -36
- package/build/webpack.prod.conf.js +0 -38
- package/components.json +0 -8
- package/conf.js +0 -42
- package/config/dev.env.js +0 -6
- package/config/index.js +0 -43
- package/config/prod.env.js +0 -6
- package/config/sit.env.js +0 -6
- package/favicon.ico +0 -0
- package/jsdoc-vue.js +0 -12
- package/lib/0.index.js +0 -12573
- package/lib/1.index.js +0 -6
- package/lib/2.index.js +0 -2
- package/lib/idev.common.js +0 -1
- package/lib/idv8.common.js +0 -1
- package/lib/index.js +0 -49170
- package/lib/js/ErrHint.js +0 -1
- package/lib/js/HdAside.js +0 -1
- package/lib/js/HdBtn.js +0 -1
- package/lib/js/HdButton.js +0 -1
- package/lib/js/HdComFaceRec.js +0 -1
- package/lib/js/HdComGrid.js +0 -1
- package/lib/js/HdDatePicker.js +0 -1
- package/lib/js/HdDialog.js +0 -1
- package/lib/js/HdDrop.js +0 -1
- package/lib/js/HdFileUpload.js +0 -1
- package/lib/js/HdFooter.js +0 -1
- package/lib/js/HdForm.js +0 -1
- package/lib/js/HdFormBtn.js +0 -1
- package/lib/js/HdFormItem.js +0 -1
- package/lib/js/HdGrid.js +0 -1
- package/lib/js/HdGridEditBtn.js +0 -1
- package/lib/js/HdGridSel.js +0 -1
- package/lib/js/HdHeader.js +0 -1
- package/lib/js/HdHotkey.js +0 -1
- package/lib/js/HdLayout.js +0 -1
- package/lib/js/HdMain.js +0 -1
- package/lib/js/HdMessage.js +0 -1
- package/lib/js/HdNum.js +0 -1
- package/lib/js/HdPopSel.js +0 -1
- package/lib/js/HdSearch.js +0 -1
- package/lib/js/HdTableColumn.js +0 -1
- package/lib/js/HdTempSave.js +0 -1
- package/lib/js/HdTree.js +0 -1
- package/lib/js/HdTreeTable.js +0 -1
- package/lib/js/authmobileupdate.js +0 -1
- package/lib/js/comexfield.js +0 -1
- package/lib/js/commsg.js +0 -1
- package/lib/js/commsgto.js +0 -1
- package/lib/js/comquartzjob.js +0 -1
- package/lib/js/comquartzlog.js +0 -1
- package/lib/js/comsearch.js +0 -1
- package/lib/js/menu.js +0 -1
- package/lib/js/menuinfo.js +0 -1
- package/lib/js/orgDept.js +0 -1
- package/lib/js/orgTree.js +0 -1
- package/lib/js/personDept.js +0 -1
- package/lib/js/role.js +0 -1
- package/lib/js/sysfieldframe.js +0 -1
- package/lib/js/syslog.js +0 -1
- package/lib/js/syslogframe.js +0 -1
- package/lib/js/userRole.js +0 -1
- package/npminstall-debug.log +0 -200
- package/ytgvue.rar +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import hdcom from './hdcom'
|
|
2
|
+
import comutils from './utils/comutils'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
|
|
6
|
+
install(Vue, options, inElement) {
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
let ver = require('../package.json').version
|
|
10
|
+
console.info('您现在使用的是hd-idevvue2:' + ver)
|
|
11
|
+
} catch (e) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//滚动去掉高亮事件,提升虚拟滚动条性能
|
|
15
|
+
inElement.Table.components.TableBody.methods.handleMouseEnter = function handleMouseEnter(index) {//去掉eltable的hover事件
|
|
16
|
+
if(this.store.states.hoverRow != 'locked') {
|
|
17
|
+
this.store.commit('setHoverRow', index);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
inElement.Table.components.TableBody.methods.handleMouseLeave = function handleMouseLeave(index) {//去掉eltable的hover事件
|
|
21
|
+
if(this.store.states.hoverRow != 'locked') {
|
|
22
|
+
this.store.commit('setHoverRow', null);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
inElement.Table.components.TableBody.methods.getColspanRealWidth = function getColspanRealWidth(columns, colspan, index) {
|
|
26
|
+
if (colspan < 1) {
|
|
27
|
+
return columns[index].realWidth;
|
|
28
|
+
}
|
|
29
|
+
const widthArr = columns.map(({ realWidth }) => realWidth).slice(index, index + colspan);
|
|
30
|
+
return widthArr.reduce((acc, width) => acc + width, 0);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
inElement.Input.props.clearable = {// clearable默认生效
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
}
|
|
37
|
+
inElement.Input.props.value = {// 不写会出现undefined
|
|
38
|
+
type: [String, Number],
|
|
39
|
+
default: ''
|
|
40
|
+
}
|
|
41
|
+
//element ui自身组件进行了扩展,如果使用纯原生的可以使用Ex***,或者自己import
|
|
42
|
+
Vue.component('ExFooter', inElement.Footer)
|
|
43
|
+
Vue.component('ExMain', inElement.Main)
|
|
44
|
+
Vue.component('ExAside', inElement.Aside)
|
|
45
|
+
Vue.component('ExHeader', inElement.Header)
|
|
46
|
+
Vue.component('ExDialog', inElement.Dialog) //这里引入,然后HdDialog调用,保证了一个vue对象,zIndex才能正常
|
|
47
|
+
Vue.component('ExFormItem', inElement.FormItem)
|
|
48
|
+
Vue.component('ExFormItem', inElement.FormItem)
|
|
49
|
+
Vue.component('ExButton', inElement.Button)
|
|
50
|
+
Vue.component('ExTableColumn', inElement.TableColumn)
|
|
51
|
+
Vue.component('ExDatePicker', inElement.DatePicker)
|
|
52
|
+
Vue.use(inElement, options)
|
|
53
|
+
Vue.use(comutils)
|
|
54
|
+
Vue.use(hdcom)
|
|
55
|
+
Vue.prototype.$message = function (options) { // 消息默认值
|
|
56
|
+
if (!options.duration) {
|
|
57
|
+
if(options.type=="error") {
|
|
58
|
+
options.duration = 3000
|
|
59
|
+
} else {
|
|
60
|
+
options.duration = 5000
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!options.showClose) {
|
|
64
|
+
options.showClose = true
|
|
65
|
+
}
|
|
66
|
+
inElement.Message(options)
|
|
67
|
+
}
|
|
68
|
+
Vue.prototype.$message.closeAll = inElement.Message.closeAll
|
|
69
|
+
Vue.prototype.$message.close = inElement.Message.close
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
package/src/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import common from './idev.common'
|
|
2
|
+
import privilege from './views/privilege'
|
|
3
|
+
import layout from './views/layout'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
|
|
7
|
+
install(Vue, options, inElement) {
|
|
8
|
+
common.install(Vue, options, inElement)
|
|
9
|
+
Vue.use(privilege)
|
|
10
|
+
Vue.use(layout)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export default (st, pageRows, queryMethod) => {//st页面this对象,pageRows,每页显示行数,queryMethod如果默认查询不是doQuery需要指定字符串
|
|
2
|
+
let _thisst = st
|
|
3
|
+
let query = {}
|
|
4
|
+
let page = 1
|
|
5
|
+
let rows = 20
|
|
6
|
+
if (pageRows) {
|
|
7
|
+
rows = pageRows
|
|
8
|
+
}
|
|
9
|
+
let q = ''
|
|
10
|
+
let sort = ''
|
|
11
|
+
let order = 'desc'
|
|
12
|
+
let selObj = []//checkbox勾选的对象
|
|
13
|
+
let doQueryMethod = queryMethod ? '_thisst.' + queryMethod + '()' : '_thisst.doQuery()'
|
|
14
|
+
|
|
15
|
+
let outObj = {
|
|
16
|
+
|
|
17
|
+
query, page, rows, q, sort, order, selObj, doQueryMethod,
|
|
18
|
+
|
|
19
|
+
add:
|
|
20
|
+
(key, value) => {//没啥用
|
|
21
|
+
query[key] = value
|
|
22
|
+
},
|
|
23
|
+
setThis(st) {
|
|
24
|
+
_thisst = st
|
|
25
|
+
},
|
|
26
|
+
doSizeChg(val) {//显示行数切换
|
|
27
|
+
outObj.rows = val
|
|
28
|
+
return eval(doQueryMethod)
|
|
29
|
+
|
|
30
|
+
//st.doQuery()
|
|
31
|
+
},
|
|
32
|
+
doCurPageChange(val) {//页码切换
|
|
33
|
+
outObj.page = val
|
|
34
|
+
|
|
35
|
+
return eval(doQueryMethod)
|
|
36
|
+
},
|
|
37
|
+
doSort(val, noQuery) {
|
|
38
|
+
outObj.sort = val.prop
|
|
39
|
+
if (val.order == 'ascending') {
|
|
40
|
+
outObj.order = 'asc'
|
|
41
|
+
} else if (val.order == 'descending') {
|
|
42
|
+
outObj.order = 'desc'
|
|
43
|
+
} else {
|
|
44
|
+
outObj.sort = ''
|
|
45
|
+
outObj.order = ''
|
|
46
|
+
}
|
|
47
|
+
if (!noQuery) {//true 不查询,适合列表一加载时
|
|
48
|
+
return eval(doQueryMethod)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return outObj
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function genRules(isRequired, minLength, maxLength, type = 'string', decimalNum) { // decimalNum=0是整数
|
|
2
|
+
const result = []
|
|
3
|
+
if (isRequired) {
|
|
4
|
+
const msg = {message: this.$t('此处必填'), required: true}
|
|
5
|
+
result.push(msg)
|
|
6
|
+
}
|
|
7
|
+
if (type == 'string') {
|
|
8
|
+
if (minLength) {
|
|
9
|
+
result.push({min: minLength, message: this.$t('字符长度不能小于x个字符', [minLength])})
|
|
10
|
+
}
|
|
11
|
+
if (maxLength) {
|
|
12
|
+
result.push({max: maxLength, message: this.$t('字符长度不能大于x个字符', [maxLength])})
|
|
13
|
+
}
|
|
14
|
+
} else if (type == 'number') {
|
|
15
|
+
result.push({type: 'number', message: this.$t('必须为数字')})
|
|
16
|
+
if (minLength != null) {
|
|
17
|
+
result.push({type: 'number', min: minLength, message: this.$t('数字不能小于') + minLength})
|
|
18
|
+
}
|
|
19
|
+
if (maxLength) {
|
|
20
|
+
result.push({type: 'number', max: maxLength, message: this.$t('数字不能大于') + maxLength})
|
|
21
|
+
}
|
|
22
|
+
if (decimalNum) { // 非0时,有小数
|
|
23
|
+
const reg = new RegExp('^(\\-|\\+?)\\d+(\\.\\d{0,' + decimalNum + '})?$')
|
|
24
|
+
result.push({pattern: reg, message: this.$t('小数最多x位', [decimalNum])}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
if (decimalNum === 0) {
|
|
28
|
+
const reg = new RegExp('(^-?\\d+$)')
|
|
29
|
+
result.push({pattern: reg, message: this.$t('请输入整数')}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return result
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function ckFt(value) { // checkbox展示用
|
|
38
|
+
if (value == '1') {
|
|
39
|
+
return '√'
|
|
40
|
+
} else {
|
|
41
|
+
return '×'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
function date() {
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
|
|
52
|
+
install(Vue) {
|
|
53
|
+
Vue.prototype.$r = genRules
|
|
54
|
+
Vue.prototype.$ckFt = ckFt
|
|
55
|
+
Vue.prototype.$date = {
|
|
56
|
+
type: 'date',
|
|
57
|
+
placeholder: '选择日期',
|
|
58
|
+
format: 'yyyy-MM-dd',
|
|
59
|
+
valueFormat: 'yyyy-MM-dd',
|
|
60
|
+
style: {width: '100%'}
|
|
61
|
+
}
|
|
62
|
+
Vue.prototype.$time = {
|
|
63
|
+
type: 'datetime',
|
|
64
|
+
placeholder: '选择时间',
|
|
65
|
+
format: 'yyyy-MM-dd HH:mm',
|
|
66
|
+
valueFormat: 'yyyy-MM-dd HH:mm',
|
|
67
|
+
style: {width: '100%'}
|
|
68
|
+
}
|
|
69
|
+
Vue.prototype.$simdate = {
|
|
70
|
+
type: 'date',
|
|
71
|
+
placeholder: '选择日期',
|
|
72
|
+
format: 'yy-MM-dd',
|
|
73
|
+
valueFormat: 'yyyy-MM-dd',
|
|
74
|
+
style: {width: '100%'}
|
|
75
|
+
}
|
|
76
|
+
Vue.prototype.$simtime = {
|
|
77
|
+
type: 'datetime',
|
|
78
|
+
placeholder: '选择时间',
|
|
79
|
+
format: 'yy-MM-dd HH:mm',
|
|
80
|
+
valueFormat: 'yyyy-MM-dd HH:mm',
|
|
81
|
+
style: {width: '100%'}
|
|
82
|
+
}
|
|
83
|
+
Vue.prototype.$simdateshow = (v) => {
|
|
84
|
+
if (v) {
|
|
85
|
+
return v.substring(2, 10)
|
|
86
|
+
} else {
|
|
87
|
+
return ''
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
Vue.prototype.$simtimeshow = (v) => {
|
|
91
|
+
if (v) {
|
|
92
|
+
return v.substring(2)
|
|
93
|
+
} else {
|
|
94
|
+
return ''
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
Date.prototype.format = function (format) {
|
|
2
|
+
var args = {
|
|
3
|
+
'M+': this.getMonth() + 1,
|
|
4
|
+
'd+': this.getDate(),
|
|
5
|
+
'H+': this.getHours(),
|
|
6
|
+
'm+': this.getMinutes(),
|
|
7
|
+
's+': this.getSeconds(),
|
|
8
|
+
'q+': Math.floor((this.getMonth() + 3) / 3), // quarter
|
|
9
|
+
'S': this.getMilliseconds()
|
|
10
|
+
}
|
|
11
|
+
if (/(y+)/.test(format)) {
|
|
12
|
+
format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
|
|
13
|
+
}
|
|
14
|
+
for (var i in args) {
|
|
15
|
+
var n = args[i]
|
|
16
|
+
if (new RegExp('(' + i + ')').test(format)) {
|
|
17
|
+
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? n : ('00' + n).substr(('' + n).length))
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return format
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
String.prototype.formatStr = function (format) {
|
|
24
|
+
var date = this
|
|
25
|
+
if (!format) format = 'yyyy-MM-dd'
|
|
26
|
+
switch (typeof date) {
|
|
27
|
+
case 'string':
|
|
28
|
+
date = new Date(date.replace(/-/, '/'))
|
|
29
|
+
break
|
|
30
|
+
case 'number':
|
|
31
|
+
date = new Date(date)
|
|
32
|
+
break
|
|
33
|
+
default:
|
|
34
|
+
date = new Date(date.toString().replace(/-/, '/'))
|
|
35
|
+
break
|
|
36
|
+
}
|
|
37
|
+
if (!date instanceof Date) return
|
|
38
|
+
var dict = {
|
|
39
|
+
'yyyy': date.getFullYear(),
|
|
40
|
+
'M': date.getMonth() + 1,
|
|
41
|
+
'd': date.getDate(),
|
|
42
|
+
'H': date.getHours(),
|
|
43
|
+
'm': date.getMinutes(),
|
|
44
|
+
's': date.getSeconds(),
|
|
45
|
+
'MM': ('' + (date.getMonth() + 101)).substr(1),
|
|
46
|
+
'dd': ('' + (date.getDate() + 100)).substr(1),
|
|
47
|
+
'HH': ('' + (date.getHours() + 100)).substr(1),
|
|
48
|
+
'mm': ('' + (date.getMinutes() + 100)).substr(1),
|
|
49
|
+
'ss': ('' + (date.getSeconds() + 100)).substr(1)
|
|
50
|
+
}
|
|
51
|
+
return format.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, function () {
|
|
52
|
+
return dict[arguments[0]]
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
String.prototype.replaceAll = function (oldStr, newStr) {
|
|
56
|
+
return this.replace(new RegExp(oldStr, 'gm'), newStr)
|
|
57
|
+
}
|
|
58
|
+
// 遍历整个数组,移除匹配item的元素,使用强比较===,给第二个参数的话就从头开始找到第一个匹配item元素移除后返回;
|
|
59
|
+
// 如有找到元素返回处理后的数组自身,如果没有找到过就返回undefined;
|
|
60
|
+
Array.prototype.remove = function (item, all) {
|
|
61
|
+
let result, isType = Object.prototype.toString, i, len, start, hasLast = arguments[2]
|
|
62
|
+
start = 0, len = this.length
|
|
63
|
+
for (i = start; i < len;) {
|
|
64
|
+
var isPass = true, inx
|
|
65
|
+
if (!hasLast) {
|
|
66
|
+
inx = i
|
|
67
|
+
} else {
|
|
68
|
+
inx = len - 1
|
|
69
|
+
}
|
|
70
|
+
if (isType.call(item) == '[object Array]') {
|
|
71
|
+
for (var ii = 0, iimax = item.length; ii < iimax; ii++) {
|
|
72
|
+
if (this[inx] === item[ii]) {
|
|
73
|
+
isPass = false
|
|
74
|
+
break
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} else if (this[inx] === item) {
|
|
78
|
+
isPass = false
|
|
79
|
+
}
|
|
80
|
+
if (!isPass) {
|
|
81
|
+
result = true
|
|
82
|
+
this.splice(inx, 1)
|
|
83
|
+
if (all) {
|
|
84
|
+
break
|
|
85
|
+
}
|
|
86
|
+
} else if (!hasLast) {
|
|
87
|
+
len = this.length
|
|
88
|
+
i++
|
|
89
|
+
} else {
|
|
90
|
+
len--
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return result ? this : void 0
|
|
94
|
+
}
|
|
95
|
+
// 删除一个并返回当前位置,匹配不到返回-1
|
|
96
|
+
Array.prototype.removeone = function (item) {
|
|
97
|
+
for (let i = 0; i < this.length; i++) {
|
|
98
|
+
if (this[i] === item) {
|
|
99
|
+
this.splice(i, 1)
|
|
100
|
+
return i
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return -1
|
|
104
|
+
}
|
|
105
|
+
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* Blob.js
|
|
3
|
+
* A Blob implementation.
|
|
4
|
+
* 2014-05-27
|
|
5
|
+
*
|
|
6
|
+
* By Eli Grey, http://eligrey.com
|
|
7
|
+
* By Devin Samarin, https://github.com/eboyjr
|
|
8
|
+
* License: X11/MIT
|
|
9
|
+
* See LICENSE.md
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/*global self, unescape */
|
|
13
|
+
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
|
|
14
|
+
plusplus: true */
|
|
15
|
+
|
|
16
|
+
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
|
17
|
+
|
|
18
|
+
(function (view) {
|
|
19
|
+
"use strict";
|
|
20
|
+
|
|
21
|
+
view.URL = view.URL || view.webkitURL;
|
|
22
|
+
|
|
23
|
+
if (view.Blob && view.URL) {
|
|
24
|
+
try {
|
|
25
|
+
new Blob;
|
|
26
|
+
return;
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Internally we use a BlobBuilder implementation to base Blob off of
|
|
31
|
+
// in order to support older browsers that only have BlobBuilder
|
|
32
|
+
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
|
|
33
|
+
var
|
|
34
|
+
get_class = function(object) {
|
|
35
|
+
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
|
|
36
|
+
}
|
|
37
|
+
, FakeBlobBuilder = function BlobBuilder() {
|
|
38
|
+
this.data = [];
|
|
39
|
+
}
|
|
40
|
+
, FakeBlob = function Blob(data, type, encoding) {
|
|
41
|
+
this.data = data;
|
|
42
|
+
this.size = data.length;
|
|
43
|
+
this.type = type;
|
|
44
|
+
this.encoding = encoding;
|
|
45
|
+
}
|
|
46
|
+
, FBB_proto = FakeBlobBuilder.prototype
|
|
47
|
+
, FB_proto = FakeBlob.prototype
|
|
48
|
+
, FileReaderSync = view.FileReaderSync
|
|
49
|
+
, FileException = function(type) {
|
|
50
|
+
this.code = this[this.name = type];
|
|
51
|
+
}
|
|
52
|
+
, file_ex_codes = (
|
|
53
|
+
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
|
|
54
|
+
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
|
|
55
|
+
).split(" ")
|
|
56
|
+
, file_ex_code = file_ex_codes.length
|
|
57
|
+
, real_URL = view.URL || view.webkitURL || view
|
|
58
|
+
, real_create_object_URL = real_URL.createObjectURL
|
|
59
|
+
, real_revoke_object_URL = real_URL.revokeObjectURL
|
|
60
|
+
, URL = real_URL
|
|
61
|
+
, btoa = view.btoa
|
|
62
|
+
, atob = view.atob
|
|
63
|
+
|
|
64
|
+
, ArrayBuffer = view.ArrayBuffer
|
|
65
|
+
, Uint8Array = view.Uint8Array
|
|
66
|
+
;
|
|
67
|
+
FakeBlob.fake = FB_proto.fake = true;
|
|
68
|
+
while (file_ex_code--) {
|
|
69
|
+
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
|
|
70
|
+
}
|
|
71
|
+
if (!real_URL.createObjectURL) {
|
|
72
|
+
URL = view.URL = {};
|
|
73
|
+
}
|
|
74
|
+
URL.createObjectURL = function(blob) {
|
|
75
|
+
var
|
|
76
|
+
type = blob.type
|
|
77
|
+
, data_URI_header
|
|
78
|
+
;
|
|
79
|
+
if (type === null) {
|
|
80
|
+
type = "application/octet-stream";
|
|
81
|
+
}
|
|
82
|
+
if (blob instanceof FakeBlob) {
|
|
83
|
+
data_URI_header = "data:" + type;
|
|
84
|
+
if (blob.encoding === "base64") {
|
|
85
|
+
return data_URI_header + ";base64," + blob.data;
|
|
86
|
+
} else if (blob.encoding === "URI") {
|
|
87
|
+
return data_URI_header + "," + decodeURIComponent(blob.data);
|
|
88
|
+
} if (btoa) {
|
|
89
|
+
return data_URI_header + ";base64," + btoa(blob.data);
|
|
90
|
+
} else {
|
|
91
|
+
return data_URI_header + "," + encodeURIComponent(blob.data);
|
|
92
|
+
}
|
|
93
|
+
} else if (real_create_object_URL) {
|
|
94
|
+
return real_create_object_URL.call(real_URL, blob);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
URL.revokeObjectURL = function(object_URL) {
|
|
98
|
+
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
|
|
99
|
+
real_revoke_object_URL.call(real_URL, object_URL);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
FBB_proto.append = function(data/*, endings*/) {
|
|
103
|
+
var bb = this.data;
|
|
104
|
+
// decode data to a binary string
|
|
105
|
+
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
|
|
106
|
+
var
|
|
107
|
+
str = ""
|
|
108
|
+
, buf = new Uint8Array(data)
|
|
109
|
+
, i = 0
|
|
110
|
+
, buf_len = buf.length
|
|
111
|
+
;
|
|
112
|
+
for (; i < buf_len; i++) {
|
|
113
|
+
str += String.fromCharCode(buf[i]);
|
|
114
|
+
}
|
|
115
|
+
bb.push(str);
|
|
116
|
+
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
|
|
117
|
+
if (FileReaderSync) {
|
|
118
|
+
var fr = new FileReaderSync;
|
|
119
|
+
bb.push(fr.readAsBinaryString(data));
|
|
120
|
+
} else {
|
|
121
|
+
// async FileReader won't work as BlobBuilder is sync
|
|
122
|
+
throw new FileException("NOT_READABLE_ERR");
|
|
123
|
+
}
|
|
124
|
+
} else if (data instanceof FakeBlob) {
|
|
125
|
+
if (data.encoding === "base64" && atob) {
|
|
126
|
+
bb.push(atob(data.data));
|
|
127
|
+
} else if (data.encoding === "URI") {
|
|
128
|
+
bb.push(decodeURIComponent(data.data));
|
|
129
|
+
} else if (data.encoding === "raw") {
|
|
130
|
+
bb.push(data.data);
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
if (typeof data !== "string") {
|
|
134
|
+
data += ""; // convert unsupported types to strings
|
|
135
|
+
}
|
|
136
|
+
// decode UTF-16 to binary string
|
|
137
|
+
bb.push(unescape(encodeURIComponent(data)));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
FBB_proto.getBlob = function(type) {
|
|
141
|
+
if (!arguments.length) {
|
|
142
|
+
type = null;
|
|
143
|
+
}
|
|
144
|
+
return new FakeBlob(this.data.join(""), type, "raw");
|
|
145
|
+
};
|
|
146
|
+
FBB_proto.toString = function() {
|
|
147
|
+
return "[object BlobBuilder]";
|
|
148
|
+
};
|
|
149
|
+
FB_proto.slice = function(start, end, type) {
|
|
150
|
+
var args = arguments.length;
|
|
151
|
+
if (args < 3) {
|
|
152
|
+
type = null;
|
|
153
|
+
}
|
|
154
|
+
return new FakeBlob(
|
|
155
|
+
this.data.slice(start, args > 1 ? end : this.data.length)
|
|
156
|
+
, type
|
|
157
|
+
, this.encoding
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
FB_proto.toString = function() {
|
|
161
|
+
return "[object Blob]";
|
|
162
|
+
};
|
|
163
|
+
FB_proto.close = function() {
|
|
164
|
+
this.size = this.data.length = 0;
|
|
165
|
+
};
|
|
166
|
+
return FakeBlobBuilder;
|
|
167
|
+
}(view));
|
|
168
|
+
|
|
169
|
+
view.Blob = function Blob(blobParts, options) {
|
|
170
|
+
var type = options ? (options.type || "") : "";
|
|
171
|
+
var builder = new BlobBuilder();
|
|
172
|
+
if (blobParts) {
|
|
173
|
+
for (var i = 0, len = blobParts.length; i < len; i++) {
|
|
174
|
+
builder.append(blobParts[i]);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return builder.getBlob(type);
|
|
178
|
+
};
|
|
179
|
+
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
|